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

learn more… | top users | synonyms (1)

0
votes
2answers
94 views

Bash script special character and background job bug

gnome-terminal --tab -e " sh -c ' gedit'/media/ubuntuman/Onces And for Al/scripts/faceBook' & ; sudo cpulimit -e ubuntu-tweak -l 80;'" This is the piece of code I want to edit. The special ...
0
votes
4answers
125 views

Creating a symbolic link to a directory

I have a directory to which I want to create a symbolic link. The commands I used were: cd workspace_b4a cd android-sdk-linux ln -sv build-tools/20.0.0/lib/ platform-tools/lib The output was: ...
1
vote
1answer
38 views

Can't trap (Ctrl^C) in my simple script

I don't know why I can't trap Ctrl^C in this simple script. #!/bin/bash for number in $(seq 10); do echo -n "." sleep 2 done function finish() { echo "bye." } trap finish ...
1
vote
1answer
190 views

Can't Change power_method 14.04

I am trying to modify my power method for my ati card as it's like having a helicopter in the room. I use the same methods described here. sudo bash -c echo "profile" > ...
0
votes
1answer
242 views

bash: /etc/bash.bashrc: Permission denied I have no name!@lappyname:~$

During resolving another problem I run this command : pkexec chmod 0440 /etc/sudoers pkexec chmod 0440 /etc/sudoers.d/README mount -o remount,rw / Than after error occurs and after reopen the ...
1
vote
2answers
104 views

Reset History inside a bash script [duplicate]

I want to make a bash script that clears the history i.e. works similarly as the command history -c So I started with the following code:- #!/bin/bash history #displaying history history -c ...
2
votes
2answers
60 views

Error using “cp” to copy files to an external disk

I have a 2TB external HDD formatted with exFat that I use to share very large files (>10GB) among Ubuntu, Windows 7 and MacOS. I am trying to copy the whole content of a directory using sudo cp -r . ...
0
votes
1answer
24 views

Path to shell script in aliases with ./

I'm trying to make an alias for my shell script which is saved in ~/Dokumente/music.sh Therefore, I added following line to ~/.bash_aliases: alias music='.//home/robin/Dokumente/music.sh' After ...
1
vote
2answers
72 views

exports in .bashrc not working

I have a program .path.py which prints an export command for PATH. In my .bashrc I have an entry at the top $(python $HOME/.prefix/.path.py) except that when I login over ssh, or even run source ...
2
votes
1answer
119 views

fsl.sh cannot be sourced

I need to install FSL and Freesurfer as part of running Connectome Mapper. Freesurfer required changing the shell to tcsh in order to configure its folders. Now for FSL, I have to add to .profile the ...
1
vote
2answers
245 views

How to run .sh through terminal without using Nautilus Ubuntu 14.04 [duplicate]

I have an .sh file that looks like #!bin/bash exec /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/ java java -jar /home/me/myfolder/my.jar I've made this file executable and it works fine when in the ...
1
vote
2answers
40 views

How to write a script with nautilus actions?

I want to use nautilus actions with my own script which I have usually started successfully with open-terminal and pasting the command (s. below) directly in the terminal. for file in *.mp4; do mkdir ...
3
votes
3answers
98 views

How to differentiate command from the output using color

I have to differentiate command from the output using color like this $ cat file-name (this should be in some color say like red) some test in file OUTPUT (this output should be in some other color ...
3
votes
2answers
111 views

I think I deleted bash!

I am attempting to make a PXE server that will boot Ubuntu (live cd) 14.04. I was trying to copy the bash file from /bin/bash to /var/lib/tftpboot/Ubuntu/bin/bash I must have used the ...
0
votes
2answers
80 views

How to properly detach a command?

I have this little script I use to launch a root Nautilus window (yeah, dangerous, but sometimes necessary): #!/bin/bash gksudo --description "Launch a root Nautilus" -- sh -c "xdg-open / &" ...
1
vote
1answer
218 views

Undo apt-get remove --purge

I wanted a fresh install of Python and ran sudo apt-get remove --purge python. Apparently it has killed almost everything I had installed in my system. Looking at the history.log I guess I could ...
1
vote
3answers
59 views

Cannot find location of permanent aliases.

A couple of months ago, I made a few permanent aliases for my bash shell on Ubuntu 14.04. They are actively making my life easier, and I would like to add a couple more to the list, but I cannot find ...
3
votes
1answer
1k views

How to send an email using command line?

Here's what I have: cat UserReport.txt | mail -s "TestSubject" "nospam@gmail.com" It's a small file, much smaller than a picture so it should send almost instantly. Though I receive nothing. I ...
0
votes
1answer
77 views

How to run bootinfoscript from the GParted liveCD?

How to run bootinfoscript from the GParted live CD? Windows 7 on internal hard drive, and Linux on an external USB SSD drive (Linux not loaded).
11
votes
7answers
1k views

How to make the argument as optional in bash function?

In have this function with 9 arguments: SUM() { echo "The sum is $(($1+$2+$3+$4+$5+$6+$7+$8+$9))" } And I want to make the second arguments to the next(3..9) become a optional arguments. When ...
0
votes
0answers
13 views

bash script transition to Qt Ubuntu SDK [duplicate]

I've a script in bash that I would like to write in Ubuntu SDK QtEditor: sudo su echo $PASSWD sudo cp -rf ./Livewave-master ~/tmp/Livewave cd ~/Livewave sudo chmod +x update_XPTO.sh echo $PASSWD ...
-1
votes
1answer
52 views

Sourcing a file [closed]

I am using ROS (Robot Operating System www.ros.org). I have to source .sh file every time. What it means ? source /opt/ros//setup.bash or have to enter this line in .bashrc file Why we need this ?
3
votes
4answers
477 views

making a bash script executable programatically

I need to create a bash script to create and mount a drive. So, two simple commands. Both "work" when entered at the command line. The script is created and executed every time a normal user logs in, ...
3
votes
3answers
276 views

Special variables in bash

I know these are few special variable used by bash. But I am not able to understand it. Can anyone explain me what are these variable and how to use it? $* $@ $#
0
votes
0answers
58 views

wait for job in bash script

find /var/www/ -ipath */logs/access.log.gz -execdir mv "{}" "old/`date +\%G-\%m-\%d`-access.log.gz" \; wait service nginx reload wait python /var/www/default/piwik/misc/log-analytics/import_logs.py ...
1
vote
1answer
45 views

Shell Script Problem

I decided to make a shell script for basic nmap scanning so I did it like this : #!/bin/bash sudo apt-get install nmap printf "enter the name of site to do basic scan on >>>" read NAME ...
1
vote
3answers
29 views

Wildcard: return source path

I'm trying to rename every access.log.gz file (note: exact filename, not "beginning with" or "containing") found in /home/*/logs to date-access.log.gz in the same folder. for file in ...
0
votes
2answers
156 views

Bash error on opening the terminal

Whenever I open terminal in Ubuntu I get the following bash and I don't know how to solve it. I need a solution as soon as possible: bash: ...
0
votes
1answer
727 views

“Syntax error: Unterminated quoted string”

I am trying to use a backup script that will backup my sql database and website files. I am running Ubuntu 12.04 32 bit version and zPanel. Here is what my DB structure is along with which DB I want ...
1
vote
1answer
154 views

Bash script for multiple tabs program running

I have the following bash script code to open multiple session of a python script with different input argument in different terminal tabs. #!/bin/bash cd /home/me/experiment tab=" ...
2
votes
0answers
164 views

Shell command not asking for password inside while loop [closed]

I am trying to run .sh file to put certificate via keytool command in every jre/lib/security/cacert file described in ~/.java/deployment/deployment.properties file. #!/bin/bash ...
2
votes
1answer
219 views

Bash script that opens multiple netcat instances and exits them

I am trying to create a script that opens up multiple gnome-terminals and opens a netcat connection. After a couple seconds I would like the terminals to close. I am at a loss and I believe it can't ...
0
votes
1answer
35 views

combine multible commands in one run one of them is find

I want in one line a command to use find to get a file name from a txt file , search for it , and play it then after closing the video I need to run a certain script I managed the first part but ...
1
vote
1answer
67 views

Why won't this php script execute bash script?

Why am I not able to execute this bash script using php? I have tried exec() as well as shell_exec(). index.php <?php $old = getcwd(); echo $old; chdir($old); $message=exec("a.sh"); ...
0
votes
2answers
69 views

gnome-terminal profile without bash history

I'm trying to create a profile in gnome-terminal that doesn't store bash history. The easiest way to do that is to run export HISTIGNORE="*", but there is one problem, gome-terminal is executing ...
1
vote
2answers
471 views

Why isn't one 'bash' command working at startup

I am working on a VM with Lubuntu 14.04, I have created a script a.sh, #!bin/bash echo "aaaa" >> a.txt And my /etc/rc.local file is as follows: #!/bin/sh -e # # rc.local # # This script is ...
-2
votes
4answers
104 views

How to arrange this file properly?

I'd prefer to edit TestFile in place to get the desired output. How could I do this? This is a work box so I'd prefer to not have to install additional packages. TestFile: randomcollege-nt\jsmith90 ...
1
vote
3answers
683 views

How to kill a script running in terminal, without closing terminal (Ctrl + C doesn't work)?

I have written a bash script that calls several other programs and executes a bunch of commands. I run this script from the terminal. Now I want to kill the script. Pressing Ctrl + C sometimes ...
-1
votes
1answer
144 views

Run pkill without sudo permission

I want to run pkill like below. sudo pkill -u 11002 I cannot give sudo password multiple times, so I want to run pkill without sudo user. For this i copied pkill to home as named bkill, and then i ...
0
votes
1answer
220 views

Script that ssh to remote host enters pass and executes a command?

Is it possible to make a script that ssh to remote host, enters the passwords to log-in and then executes at least 1 command on the remote machine?
1
vote
1answer
67 views

Question about something appearing in my Terminal

After I moved from Windows to Ubuntu I liked to try out every new app I found so I decided to install Betty (a Siri like alternative for Ubuntu). I used the PPA given by Webupd8 site and the last ...
0
votes
0answers
107 views

Prevent *buntu from updating dictionaries during install

In utilizing Vagrant to install an Ubuntu server box with a GUI (lxde), the shell provisioning fails due to what seems to be a frequent issue when setting up dictionaries. The resolutions seem to all ...
1
vote
0answers
43 views

xdotool for writing a preformated command in bash [closed]

when I run prompt$ xdotool type 'find -iname "**"' I get this find -iname "**"prompt$ find -iname "**" how could I have that prompt$ find -iname "**" I use xdotool to fill the command line ...
-1
votes
1answer
33 views

is source code for bash sufficient, when I want source code of ext4?

when I want to know the source code of ext4-filesystem (mkfs.ext4) - is it then sufficient to download the source code for bash ? - or do I need else source-codes after I did : sudo apt-get ...
0
votes
1answer
68 views

awk: runaway regular expression

I can run command on ubuntu: free | grep Mem | awk '{print $3/$2 * 100.0}' And get result: 20.1092 But when I try to put it in alias: alias memTotal="free | grep Mem | awk '{print $3/$2 * ...
0
votes
1answer
29 views

Paging standard out using 'more', and piping to syslog

I've implemented a wrapper script which causes all commands executed via this wrapper script to log (via rsyslog) things such as the execution time, the user that ran the command, and the exit code. ...
0
votes
2answers
139 views

Bash tries to run python on unknown command and fails in Py_Initialize

Running Ubuntu 14.04 and updater says that all software is up to date. Have tried rebooting. I am preparing for a class that uses Python. I have installed it and it works fine. However, I now have ...
0
votes
1answer
64 views

Getting “no such file or directory” bash error when trying to compile a file

I have already checked out the many similar questions on this website, but I keep getting this error when trying to run my program conversion.cpp with ./conversion. The program is here: (i can't ...
1
vote
2answers
190 views

.desktop file doesn't execute a script, works fine when run by hand

I am having problems with my .desktop files. I have a shell script that constantly watches for a file to be put into the "Downloads" folder. When a file is put into the folder it automatically ...
0
votes
1answer
91 views

How to run correctly bash script from another script?

I want to run sqldeveloper on Ubuntu Gnome 14.04. I created some symbolic link and tried to call from one script file another. And it fail with message: /usr/local/bin/sqldeveloper: line 2: ...