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

learn more… | top users | synonyms (1)

1
vote
1answer
33 views

script sh syntax error

I have this script: #!/bin/bash IP='192.168.1.1' fping -c1 -t300 $IP 2>/dev/null 1>/dev/null if [ "$?" = 0 ] then echo "Host found" else echo "Host not found" fi When I try to run it, ...
1
vote
1answer
26 views

cannot change directory with script

I tried the following script to give myself convenience in changing directories to different hard disk partitions. But after its execution, the default location does not change, but if I use command ...
1
vote
0answers
17 views

Terminal Closes On Running clear and large output commands

When I run the clear command or ctrl+L or commands with large output like ps aux, my terminal closes. I have set the scrollback to unlimited.
0
votes
0answers
19 views

Xinput command in autorun script doesn't execute

I use two monitors 15 inch and 19 inch. With the 15 inch I also use a touchscreen. I have to map touch events to 15 inch monitor with this command: xinput map-to-output 11 VGA1 11 stands for id ...
1
vote
2answers
63 views

Shell script does not run when I double click

I have made a shell script (test.sh) on my Lubuntu (15.04) desktop. Permissions are: Only owner (View content + Change content + Execute). When I double click test.sh, I choose "Execute in Terminal". ...
1
vote
2answers
38 views

error while cron scheduling a sh script

This is my shell script which i want to schedule using cron job. parser.sh #!/bin/bash source .profile workon venv cd /home/ashish/deployments/myproject export ...
3
votes
2answers
63 views

bash: script/bash_completion_dog: No such file or directory

When I open my terminal, I get this message. I tried to correct my .bashrc file but could not find anything related to this error message. How do I resolve this? As suggested by terdon, I tried the ...
0
votes
3answers
27 views

How to Verify JAVA_HOME path

I installed java in opt/jdk1.7.75 having following directories--> bin db include jre lib man COPYRIGHT LICENSE README.html relase & other files I set JAVA_HOME path in .bashrc file as follow: ...
1
vote
1answer
28 views

Where is the manpage of the set builtin? [duplicate]

When I type the command man set It gives the postgresql 9.3.6 manpage documentation of the set command. (May be I need to precise that I have postgres installed in my machine). However, I am not ...
1
vote
1answer
25 views

How to create log file from a command (through alias)

The call is simply ud typed in a terminal. ud is defined as the following in my ~/.bash_aliases: alias ud='sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade ...
3
votes
2answers
52 views

Ctrl+C command is not terminating infinite (while) loop

I have this little script. When I start it and the terminal has the focus Ctrl+C stops feh and then the while loop starts feh again. I am expecting that, as long as the terminal(!) has the focus, ...
5
votes
8answers
450 views

How can I delete text that is NOT in quotes or parentheses?

Input: 19. "foo foo" (bar bar) (19) raboof "foo foo" raboof Expected output: "foo foo" (bar bar) (19) "foo foo" As you can see, I would like to keep the double quotes and parentheses. ...
5
votes
5answers
564 views

What can I do in order to change the “.33” value into “0.33”?

I want to compare the value against 0 and it tells me that it is less than 0. I used solution=`echo $a / $b | bc -l` This issue occurs only when "a" is less than "b".
5
votes
1answer
72 views

How to make reverse-i-search in terminal easier using comments?

When you press Ctrl+r in terminal this leads to use the reverse-incremental-search mode. The reverse-i-search lets you search for previous commands in your terminal, but this can get confusing when ...
2
votes
3answers
152 views

Regex Conversion

I'm wanting to make a command to edit /etc/default/grub and change the timeout from 10 to 2. Could anyone explain how to do this?
7
votes
4answers
254 views

How can I merge files on a line by line basis?

cat file1 foo ice two cat file2 bar cream hundred Desired output: foobar icecream twohundred I already have a solution involving a for loop with sed using the line number of the files, but in ...
4
votes
4answers
138 views

How can I extract text between parentheses containing a specific word?

How can I convert this: foo (blah) (bar 80) foo (cats) (blat 92) To this: foo bar 80 foo blat 92 I would like to keep all the text that is NOT in parentheses. I only want to extract text ...
2
votes
1answer
23 views

Gnome-terminal not working properly with screen-256colors

Today I noticed I did not have 256 color support in Weechat. I decided this would be a quick fix. It isn't. First thing I googled was how to test the color support in terminal. I have installed ...
0
votes
3answers
46 views

How to create desktop shortcut to bash program running java

I've downloaded the free and open-source image analysis software "Icy" (http://icy.bioimageanalysis.org/), and I can launch it by making the "icy.sh" file executable and double-clicking on it. ...
1
vote
1answer
33 views

How can I list mp3 files that have a leading period?

I have mp3 files in a directory. For this example, let's assume they are these 3: Enter Sandman.mp3 ...And Justice For All.mp3 St. Anger.mp3 How can I list (ls is highly preferred) all ...
0
votes
2answers
26 views

aliases not picked up when sudo in mac? [on hold]

I have the following aliases in /etc/profile. # System-wide .profile for sh(1) if [ -x /usr/libexec/path_helper ]; then eval `/usr/libexec/path_helper -s` fi if [ "${BASH-no}" != "no" ]; ...
4
votes
2answers
53 views

useradd doesn't allow the user to log on

On an Ubuntu 14.04.2 LTS the following command: adduser fu and then entering a password bar and just pressing Enter on all other questions, creates a user that allows me to log on and has the ...
-2
votes
1answer
18 views

Zenity is not displaying the GUI results in the bash script. The same script is displaying results successfully in Redhat [closed]

ALERT=10 df -h|grep -i dev|grep -vE '^Filesystem|proc|none|tmpfs|udev' |awk '{print $1 " " $5 " " $6}' |while read output do partition=$(echo $output | awk '{print $1}') usage=$(echo $output | ...
0
votes
1answer
27 views

Is it possible to edit the .bash_login file for the second time?

I accidentally wrote an error command in the .bash_login file. I need to edit the file to solve this problem but I can't do that anymore. The error is about the .bash_login isn't a writable file ...
5
votes
1answer
239 views

Getting the default text editor used in system

I have been searching and browsing for a long time and have not been able to find an answer to my question. I have used select-editor and I note that I am using /usr/bin/nano. Is this the default ...
1
vote
2answers
22 views

Need my random effects to show the full line

I am working on a script for random predictions and unfortunately instead of the script taking the full lines from the two random lists (Things and Effects) it prints a random word from each. Can ...
1
vote
2answers
54 views

Command to Combine text 100 lines at a time

I have a file with 7000 lines. I need to combine the lines 100 at a time to reduce it to 70 lines i.e line 1 line 2 line 3 ... line 7000 becomes line 1 line 2 line 3 line 4 ... line 100 line 101 ...
0
votes
1answer
12 views

Bash sed to read auth into debconf-set-selections for Vagrant VM

I have a Vagrantfile that uses a bash script to set up a VM. I can't get the script to set a password for MySQL using debconf-set-selections with output from an .auth file. Below is an example of the ...
5
votes
1answer
112 views

Bash always evaluate Regex as true

In a script, there's these lines #!/bin/bash ... if ! [[ $SCREEN_NAME =~ ^[a-zA-Z0-9_.-]+$ ]]; then echo "The Server title contains invalid symbole. Only a-z A-Z 0-9 - _ . are allowed" exit 1; ...
1
vote
2answers
30 views

parsing out in bash

my file looks like this // [297]((((21:0.125204,20:0.125204):0.00994299,(28:0.0790047,(7:0.0146105,5:0.0146105):0.0643943):0.0561423):0 segsites: positions: 1 2 4 6 9 10 45 67 78 89 ...
1
vote
2answers
35 views

Help with reminder script in Bash

I have stacked trying to make a simple reminder script which can compare the running date with the date that a file has. for example I have a file that contains: Apr 25 2015 cycling \n Apr 26 2015 ...
1
vote
2answers
102 views

bash: ./name.exe: Permission denied

I want to execute a program in Ubuntu 12.04...but when I type ./programname.exe it makes error: bash: ./gbat.exe: Permission denied and I typed "chmod +x programname.exe" , but it doesn't fix ...
2
votes
1answer
152 views

How to automatically answer interactive cli program (not script) with bash script?

I've googled this, and almost all I could find is to answer a bash script and this doesn't work for me. The answers I found told to do: echo "yes" | ./script or ./script <<< yes or ...
5
votes
5answers
261 views

How can I edit a range of text between 2 symbols? awk, sed, regex

Using the "*" symbol, (doesn't have to be that one, any special character will do in order to indicate), how can I edit the text from this: *berry straw rasp blue boysen * blahblah blahblah blahblah ...
0
votes
0answers
6 views

Install linux-image-$(uname -r) non-interactively

How do I install linux-image-$(uname -r) non-interactively? sudo apt-get -y install linux-image-$(uname -r) The above command will get me past the initial "do you want to install this" prompt, but ...
15
votes
5answers
902 views

Where are commands `fg`, `bg` and `jobs` installed? [duplicate]

fg, bg and jobs are used for job management. And for some reason (maybe it's just me), I'm not able to find where their binaries are nor their manpages (whereis prints no information). which gives no ...
-1
votes
1answer
29 views

How to run bash commands in gnome-pie app launcher

I recently installed gnome pie app launcher and i was trying to edit the individual slices and run a bash command to open eclipse. i'm running the more updated eclipse that i downloaded from ...
2
votes
4answers
298 views

Bash script to rename files in a directory

I am trying to write a script that takes a directory as a command line parameter and iterates over the files in the directory changing their extension to .bu . I thought this would work but I'm ...
1
vote
1answer
36 views

Running Shell Script on Double Click

Okay, I have opened nautilus and edited preferences to ask when I double click an .sh script to run in Terminal. Well, I don't want to use a .desktop file; I want to just simply double click on the ...
7
votes
2answers
301 views

How to use grep output as a path for cd?

How can I pipe grep output as an argument to the cd command? For example: [root@xxx xxx]# pip install django | grep '/usr.*' Requirement already satisfied (use --upgrade to upgrade): django in ...
1
vote
1answer
31 views

Why does the more command not work when bound to a keyboard shortcut?

I have two commands that both work in terminal: notify-send "$(more /home/tim/autest.sh | head -1)" and notify-send "$(cat /home/tim/autest.sh | head -1)" putting them in a script like this: #! ...
1
vote
1answer
21 views

My keyboard shortcut binding does not work with my script

I was trying to bind a keyboard shortcut to my script. I tried binding it to keyboard shortcut from System Settings>Keyboard>Shortcuts>Add Shortcut I added new shortcut and as mentioned in ...
0
votes
1answer
29 views

Trouble with pip on 14.04

I am trying to install a few different things and having issues. I thought pip could have been the issue on one of the packages I was trying to install. So I decided to try to upgrade pip, following ...
4
votes
1answer
147 views

gnome-terminal can't set 256 color support correctly with or without tmux

I've been trying to set up 256 color support correctly for quite some time but it seems to never work for me so I'm not even remotely sure what I'm doing wrong. How it looks in the terminal vs gVIM: ...
24
votes
3answers
2k views

“mv file” and now it's missing

In a terminal window, I typed: mv filename ..\.. [Note the wrong slash.] Now I can't find it. Gone. I ran some searches and looked through recoverable deleted files. Nothing. Poof. Serves me ...
1
vote
3answers
130 views

What is the syntax for IF/ELSE in bash?

I am trying to pull logs and doing few others things directly. written a small line BASH but not working. I am sure thats with IF Condition. sed -rne '/21:25:07/,/21:50:07/ p' ...
4
votes
3answers
205 views

How to use double substitution in awk?

To print the fields at 29th column in two files I used paste <(awk -F, '{print $29}' PreRefFile.csv) <(awk -F, '{print $29}' Txlog.csv) This worked fine. To print all the fields starting from ...
7
votes
2answers
65 views

Differences between “<command> & disown” and “nohup <command> & disown”

This is my understanding about the usage of &, disown and nohup: <command>: runs the process within the Terminal's current bash instance, in the foreground (i.e. the process is listed as a ...
1
vote
3answers
49 views

Get Parent ID of last process executed in terminal

back to this How do I find the PID of the last open file in terminal? I want to know the PPID (parent id of the process) of the last executed process.
0
votes
1answer
40 views

How do I find the PID of the last open file in terminal?

How to know the PID of the last open file (process) using the command line?