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

learn more… | top users | synonyms (1)

4
votes
1answer
15 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
14 views

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

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
25 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 ...
4
votes
1answer
198 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
21 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
46 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 ...
0
votes
1answer
16 views

X3 Terran Conflict doesnt launch

I recently bought x3 Terran War Pack and installed x3 Terran Conflict but it doesnt launch I tried to execute the launch script with chmod +x testandlaunch but i am getting the error: ...
5
votes
1answer
109 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
29 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
86 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
139 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
237 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
5 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 ...
14
votes
5answers
873 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
27 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
274 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 getting ...
1
vote
1answer
30 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
248 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
30 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
23 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
139 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: ...
19
votes
3answers
1k 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
121 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
201 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
58 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
46 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
39 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?
6
votes
6answers
295 views

Exit terminal after running a bash script

I am trying to write a bash script to open certain files (mostly pdf files) using the gnome-open command. I also want the terminal to exit once it opens the pdf file. I have tried adding exit to the ...
6
votes
1answer
119 views
+150

How to log bash history by editing bash source?

I'm using bash-4.3.30. I need to log all my commands history on a single file. I can do that by editing the bashrc or bash_profile but I'm not going to do that. I want to play with bash source ...
2
votes
0answers
18 views

How to check the password entered is a valid password for this user?

The scenario: In a bash script, I have to check if a password given by a user is a valid user password. I.e suppose I have a user A with password PA.. In the script I asked userA to enter his ...
0
votes
0answers
28 views

After changing Ubuntu 9 version to ubuntu 12.04.If i run my code i get core dumped segmentation fault

After upgrading from Ubuntu 9 to ubuntu 12.04, when I run my my shell (below) I get a: core dumped segmentation fault This code used to work before. My C-based applications still work. #! ...
0
votes
3answers
30 views

Problem when trying to run shell script : No such file or directory

I'm trying to run the following command on bash: ./home/abcdef/Desktop/jikesrvm/dist/prototype_x86_64-linux/rvm which is giving me a bash: ...
2
votes
1answer
122 views

How do I use the “^” and “$” symbols with regular expressions in a bash script?

How do I use the "^" and "$" symbols with regular expressions in a bash script? Please give me an example using both symbols.
0
votes
1answer
30 views

.bashrc edit messes up terminal command arrow-up history print

I wanted to give my terminal prompt in Ubuntu a more personal look, and wanted to change the text prior to the '$' when writing a command. From what I've found this is done by editing the .bashrc ...
5
votes
2answers
67 views
+50

How to run a script when a directory is changed by another user?

I know has been a bit of discussion about topics similar to this. But here is what I am basically trying to do. I have a watch directory called watched and whenever a file is added to that directory, ...
1
vote
1answer
24 views

bash file for managing public private and history of website

I have a website and i have 3 versions I have the beta version with the most recent and usually not fully working changes. I have the public site that is on www. lastly, i have the history that I ...
0
votes
1answer
27 views

Unable to run apt-get with proxy even after setting the environment variables

I was trying to configure proxy in my lubuntu 14.04. Since I wanted to use the username and password for my proxy authentication, I opted ntlm and installed it. Now I can use my proxy link as ...
0
votes
1answer
13 views

having elevated priority and general @audio permssion in rc.local

I am trying to run jackd instance from /etc/rc.local (along with a few other applications) from a custom made init script. The system is ubuntustudio and I have setup everything to have elevated ...
5
votes
1answer
87 views

What do these commands from a shell script do?

I'm just starting to learn bash. I have the following script, and I would like to know what does the following commands do in order to start to understand a little bit this world. if [ ! -w "." ] ...
-1
votes
1answer
45 views

How to create logfile for a bash script?

I've written a bash script that runs multiple instances of a program and would like to write the entire output of the script to a logfile. I tried #!/bin/bash touch <.../somewhere/logfile.log> ...
4
votes
1answer
142 views

Writing a program that will demo the $PS2 variable

I've been customizing my terminal prompt, and found that it's possible to change the "secondary prompt". However, I have no way to test the changes I make to this one so I was wondering if a simple ...
1
vote
2answers
47 views

Running a command in screen daemon mode

I am trying to run a command in screen mode using the command screen -dmS screen_name sed -i 's/a/b/'g some-file.txt Nothing happens. When I put the same command in a script and run the command: ...
1
vote
2answers
23 views

Rsync --delete option doesn't delete files in target directory

I'm trying to use the --delete option in rsync to delete files in the target directory which isn't present in the original directory Here is the command I'm using: rsync -avz --ignore-existing ...
5
votes
4answers
333 views

Get previous commands in Terminal that match the currently typed command [duplicate]

In some terminals you can do something like this... Type some command nmap -sn 192.168.1.1/24 Then go on to do other things in the terminal for a while. Then later you can type nmap and then ...
1
vote
1answer
34 views

Different shells on SSH and local

So I've got an Ubuntu 14.04.2 computer that has OpenSSH Server installed on it. Whenever I use the computer locally, through the terminal, if I run: ~$ echo $SHELL /bin/bash However, if I SSH into ...
1
vote
3answers
39 views

What does this egrep command do?

I run this command egrep "\" string_demo | wc -l I got output below: akshay@akshay-K53SC:~/shell$ egrep "\" string_demo | wc -l > abc > pqr > xyz > ">" will continue until I press ...
0
votes
0answers
13 views

purpose of bamf-2.index [duplicate]

What is the purpose of /usr/share/applications/bamf-2.index ? I have noticed the applications it contains are installed in my computer. But I don't think it contains the complete list. Because the ...