Bash is the shell used in Ubuntu's command-line interface.

learn more… | top users | synonyms (1)

0
votes
0answers
8 views

ssh logout cause bash file problem

I have a .sh file which is called by a Node Web Server. In the .sh file I run some commands with my username [name], which is a superuser, without specifying the password. If I'm connected through ...
0
votes
2answers
24 views

End of file syntax error shell scripting

#!/bin/bash source conf.ini inotifywait -m -e create /$1path | while read file; do if ($(echo $word | head -c 1)"=$1 then echo $file cd $1inputpath ls -l |grep $file* zcat $file* > ...
0
votes
1answer
18 views

How to change cmdline variables on boot or first boot

Not sure if this is the correct place to ask this question. I am running Ubuntu 12.10 on an EMB-3500 board. Its is an I.MX6Q. So my U-Boot saves the evn variable for my video as a development ...
2
votes
1answer
19 views

Remove list of files from different subfolders

I have a folder (call "folder"), composed of different subfolders ("subfolder1", "subfolder2",...). I would like to remove a list of files in all the subfolder of "folder", while some files are ...
2
votes
2answers
25 views

using wget to download xml for conky script won't keep html tags

So I'm trying to setup a conkyrc for weather, using the following script: #!/bin/bash station="KRAP.xml" wdir='/tmp/weather' update_xml() { if [ ! -e "$station" ]; then ...
2
votes
1answer
25 views

Copy/move a list of files to a new directory

I have an huge amount of files (e.g. 110011basz.dat, 110012basz.dat, 110013basz.dat,...) inside a folder, call folder. On the other hand I have a list related to the files I need to move to another ...
0
votes
1answer
14 views

Run a .sh on startup

I am creating a restore backup. When it start up I want it to run a .sh file that run a application and then reboots with out asking for a passcode. I have already built the .sh file but I have try ...
2
votes
2answers
73 views

How to merge values from two different text files?

I have following data set in text files: file1.txt a1:b1 a2:b2 a3:b3 a4:b4 a5:b5 file2.txt b2:c1 b4:c2 b5:c3 How to merge these values to make output file like this: output.txt a2:c1 a4:c2 ...
7
votes
2answers
528 views

Is there an easy way to log all activity that a shell script does?

Is there an easy way to log all activity that occurs from a shell script to a file? I have a script. It outputs things like echo "instructions", as well as other program output. I know the commands: ...
2
votes
3answers
47 views

Get variable from Zenity list generated from .csv file

I'm trying to get the value from zenity list. But it doesn't work. Some help would be nice :) If I remove the ans=$ I get the value from zenity in terminal like this: 10.33.54.13|10.33.54.13 But ...
1
vote
0answers
20 views

gnome-terminal / mate-terminal don't save history on ~./bash_history

Two days ago I was using my computer as usual, when I noticed that the commands I used in mate-terminal were not saved in the history. I tried installing gnome-terminal. But it does the same. I was ...
1
vote
1answer
20 views

What is the difference between 'exec ssh localhost' and 'ssh localhost'?

I read man exec output, but did not understand the difference between these two commands: exec ssh localhost and ssh localhost. I tested both commands and did not found any difference. Is there any ...
2
votes
1answer
23 views

phone book script

Good day I am a newbie in Linux scripting, and I am now exploring LINUX then suddenly I was motivated to create a program and I want to create a phone book program I am now done creating the menu that ...
0
votes
0answers
26 views

cannot execute binary file: Exec format error [duplicate]

i´m new in ubuntu and i´m trying to install a program created by one of my professors, but when i try to start it, the terminal send me the message: bash: ../bin/cidre.exe: cannot execute binary ...
2
votes
1answer
66 views

Store grive command output to variable in bash script

I am trying to create a script that syncs my computer with google drive using the grive tool. I would like to store the output of the grive command to a bash variable, but I can't seem to get it to ...
1
vote
2answers
610 views

Bash “unexpected end of file” on line 11, there is no line 11

I'm trying a new conky theme on my Lubuntu system, and for running it I need to start a bash script: #!/bin/bash #sleep 18&& conky -c /home/mathijs/conky/conky1&& sleep 1&& ...
0
votes
2answers
33 views

pipe whole script to file and terminal

i want a 1liner to pipe to file AND terminal at the same time(write 1 command, then all other commands are shown like normal in terminal, but output, preferably but not required : command name, to be ...
0
votes
1answer
41 views

I accidently ran 'sudo chmod -R 775 /' and it completely broke my OS/Shell [duplicate]

So I accidentally did sudo chmod -R 775 / when I meant to do sudo chmod -R 775 ./. I quickly realized and hit Ctrl^C, but not in time to save everything. I realize this is a really stupid mistake and ...
1
vote
1answer
28 views

Bash script exiting when repeated in double click execution

This is my code #!/bin/bash function boo { function goo { echo "Please enter name" read name; echo "Hello $name" } function xoo { echo "Please ...
4
votes
1answer
45 views

What does '*' mean in the output to 'history' command?

I was seeing my history when I found a line with a * whereas, in general, the history has an output without any * I noticed this for the first time. When does this * appear and why? EDIT: ...
4
votes
2answers
124 views

Terminal autocomplete functionality can only match from the beginning?

For example, if I type in "apt-"and press tab,I can find "apt-get" below.But if I type in "get", "apt-get" cannot appear. How can I do to match not only from the beginning?
2
votes
2answers
326 views

Uncompress file from URL to hard disk?

How to uncompress directly from terminal if I have the URL of the file? For example : unzip www.test.com/test.zip destination-folder-on-my-pc
1
vote
2answers
20 views

How to navigate to directory which file system object has just been moved to?

I often find when using mv somefile somepath I often need to go to the location which the file had just been moved to. basically mv somefile somepath && cd somepath is there a way to ...
0
votes
1answer
23 views

Running lubuntu 14.04, easiest, fool proof way, to create a desktop shortcut and to execute sh file from desktop?

It sounds easy, but hell, it is not. I want a desktop icon that executes: /home/<username>/dev/intellij/bin/idea.sh if I create a sh file on desktop, it opens with leafpad. If I create ln ...
2
votes
1answer
53 views

Who is telling me “You have mail”

On a server running Ubuntu 14.04 I see You have new mail in the motd every time I log in via SSH. Q: Who is telling me this? Mail does not find anything, and I do not expect any mails on this ...
1
vote
2answers
24 views

Is it possible to specify a different zshrc file on login over ssh?

I spend all day ssh'ing into servers for work and the remote user is one that is shared by myself and several colleagues so I can't just blindly customise the shell as not everyone will want my tweaks ...
2
votes
0answers
29 views

preseed file and installation script

I am using a preseed file to auto install ubuntu 12.04. I create a normal user account (able to use sudo), I skip the creation of a root account. At the end of the file I have put this (seen it from ...
1
vote
2answers
23 views

Accidentally changed shell in gnome-terminal, no longer opens

I wanted to make screenfetch start at terminal startup. But I realized that I changed the shell from bash to screenfetch and of course gnome terminal doesn't startup. I have installed MATE terminal ...
0
votes
1answer
38 views

How to run a web url script in a terminal

I am attempting to launch a script via my terminal. It runs fine in my browser but not in the terminal. Ive tried... sudo curl https://www.example.com/myscript?info=1 sudo wget -q -O- ...
0
votes
1answer
18 views

read numbers with e in awk

Hello a file I am working with looks: header // SeqT: {"POS-s":174.683, "time":0.0130084} SeqT: {"POS-s":431.49, "time":0.0221447} ...
2
votes
3answers
94 views

Bash for loop - how can I include blank newlines? (IFS) [closed]

Please note this is pseudocode, and I am not trying to count lines this way, this question is to figure out how to include completely blank newlines in a for loop. cat file word word Since ...
1
vote
3answers
55 views

bash: /home/rathin/.profile:: No such file or directory while trying to reload it via “source ~/.profile” after editing it through “vi ~/.profile”

After I edited my ~/.profile via vi command, couldn't get out of it successfully. So I closed the terminal and when I tried it again after reopening terminal, it showed duplicate file named ...
5
votes
2answers
46 views

How to get [TAB] to work with arguments of aliases to autocomplete as can be done with the actual command

I have many aliases that I created in my .bash_aliases file, and they are very useful, so if I want all info on a package I do something like: allinfo software-center And that does the equivalent ...
0
votes
3answers
42 views

Why does asterisk produce unexpected results?

I'm new to bash. From the Finding Files documentation: You want to find every file in ~/mydir and all its subdirectories, recursively, with a file extension of .htm (or .HTM or .Htm...) and delete ...
0
votes
1answer
13 views

ROS installation:Environment setup:No such a file or directory

according to wiki tutorial of ROS installation. All of the previous steps are ok for me, but when I try to do the part of environment setup. When I type: echo "source /opt/ros/jade/setup.bash" ...
1
vote
2answers
50 views

In Bash or ZSH, is there an opposite to the `clear` command?

Typing clear into a shell creates a bunch of new lines until the output history above is all but hidden. Is there a command or method that does the opposite of clear? That essentially moves your ...
0
votes
2answers
27 views

history erase shell script not working

I am creating shelll script that is erase history of commands in the terminal. But the script is not erase the history of commands in the terminal. I follow below procedure 1. My script contains ...
0
votes
1answer
33 views

Running Bash script at login

This question has been asked numerous times but for some reason, none of the solutions proposed worked for me. I just want to run a simple script after the user has logged in. Here are my attempts: ...
0
votes
1answer
18 views

Run html2text on all files in a directory that do not have an extention

I have a directory filled with many files with no extensions that were put there by a call to wget. I want to use html2text to convert all these files to plain text files. In other words, how to ...
0
votes
2answers
15 views

Wget from webpage in html to many text files

To download all the page one level below superSite.com I do: wget -r -l1 http:/superSite.com But these pages are saved in the .html format. How can I have them be saved in .txt format? (I need to ...
1
vote
2answers
39 views

How can I get a list with the packages selected by apt-get autoremove?

Is there any command that prints only the name of the packages that apt-get autoremove selects? I'm creating a script that updates the kernel, removes the old kernel and the unnecessary packages ...
3
votes
1answer
35 views

How can I transfer my bash history to a new system?

My bash history is my memory, it contains commands that I don't want to loose when I update to a newer version of Ubuntu or change my computer. Is it possible to transfer the commands database to a ...
0
votes
1answer
23 views

How does terminal autocomplete for arguments works? [duplicate]

I find the auto-completion feature of the terminal real amazing! And sometime I ask myself "where does the terminal get that information" For example a have coded a small C-Script with a few ...
3
votes
1answer
34 views

Run a script on shutdown and not on reboot [duplicate]

I'm executing a script on Ubuntu 14.04.1 LTS when the server is stopping But I would like to execute it only on shutdown behavior, not whendoing a reboot. I tried to get the value with $1but for ...
2
votes
1answer
34 views

Bash script checking if specific printer is online

Objective: Create a bash script that checks if a certain printer is connected and online (connected: true/false) How can I do this in the terminal (or via python)? I have tried "lpstat -p -d" but ...
1
vote
2answers
209 views

Why is my function not re-evaluated in PS1?

I'm trying to have a part of my prompt set dynamically by a function, so in my .bashrc I have: asdf () { echo -n $(pwd) } PS1="\u@\h:\w $(asdf)\$ " Opening a shell gives me what I expect at ...
4
votes
1answer
25 views

Switiching Java version per session

I have a combination of Java7 and Java8 installed on my 14.04 machine. When I want to switch between them I do a sudo update-alternatives --config java. However, changing it this way changes the ...
2
votes
3answers
54 views

Get a script variable into subshell launched by find

Following on from this question I've used the following command in a bash script: find ${svn_root} -maxdepth 2 -type d -exec bash -c 'if svnlook info "$1" &>/dev/null ;then echo"$1" ...
5
votes
1answer
56 views

Help with “Exec=…” line for .desktop launcher - command works only in terminal [on hold]

I want to add another context menu option to my Thunderbird launcher in Unity. However, it does not work. The additional action appears in the launcher's context menu, and when I click it the cursor ...
1
vote
1answer
22 views

How to script Subversion verification?

Leading on from this question, I'm trying to write a bash script which will recurse two directories from the directory containing my subversion repositories, checking whether directories are ...