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

learn more… | top users | synonyms (1)

1
vote
1answer
407 views

gdialog cannot output variable

copied='cp -v *SNAPSHOT.jar /home/user/folder' $copied prints information about copied files however gdialog --title "done" --clear --yesno "done $copied" 15 60 shows command that was executed, ...
2
votes
1answer
940 views

Upstart scripting: Start service and immediately run another command

Here is my current Upstart script I've placed at /etc/init/redis.conf: description "redis server" start on runlevel [2345] stop on shutdown exec sudo /opt/redis/redis-server /opt/redis/redis.conf ...
1
vote
1answer
672 views

Running program on startup

I wrote a program in Bash, and now I want to run it on startup for all users so that nobody can cancel it, except for root. How can I do it?
2
votes
1answer
949 views

Problem to write long lines in terminal

I have defined a PS1 prompt multi-line in my server with Ubuntu 11.04. The problem occurs when I write a long command, the line cuts before the end of terminal and it continues at beginning the same ...
1
vote
1answer
3k views

output terminal redirect to zenity

Let's explain you my doubt. We all know that >& is shell syntax for "fold a file descriptor into another". So 2>&1 means that i want to redirect stderr to the stdin, this is simple and ...
0
votes
0answers
72 views

How do I make nautilus reload emblems when changed by a script? [duplicate]

Possible Duplicate: Is there any tweak to bring back emblems in Nautilus? I am writing a script to manage my downloads folder. It will automatically delete items older than a month (or any ...
0
votes
1answer
1k views

bash script and zenity progress

I have this cmds: (youtube-dl http://www.youtube.com/watch?v=HhoewflkQu0) | zenity --progress --width=400 --height=100 --title="Scaricamento" --text "Scaricamento in corso..." --auto-close --pulsate ...
3
votes
2answers
2k views

Where to put custom .bashrc stuff, in .bash_local?

Just upgraded to 11.10, and prompted me to wondering where is now the preferred way to put customised .bashrc bits? I have some aliases, some env variables, and a python virtualenvwrapper script, for ...
1
vote
2answers
284 views

Opening program from nautilus through custom script

Would like to open all avi and mpeg files from folders in nautilus into a script that opens the file and moves the window using wmctrl. Basically, I need to open all media files with a script that ...
1
vote
2answers
257 views

Need to make a shortcut command using xargs

I always want to kill a process id which listening on Port 3000. So presently I am using, 1.lsof -i tcp:3000 will give output as, COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ruby ...
4
votes
1answer
2k views

Toggling between Unity 3D and unity 2D [closed]

Generally, I much prefer Unity 3D over the 2D version, which is a bit broken on my machine. However, I frequently give presentations, and Compiz doesn't support multiple screens. I've been forced to ...
1
vote
2answers
216 views

Automatically run a command upon entering a certain directory?

I'm using virtualenv with django and so I have say two different directories say: ~/Development/site1 ~/Development/site2 So to set up my enviroment I normally go to ~/Development/site1 then run ...
3
votes
2answers
4k views

Why do I need to run source command for making .bash_profile alias available?

My .bash_profile is like below: alias l='ls -l' alias p='pwd' alias sites='cd /home/caveman/sites' alias time_card='cd /home/caveman/sites/time-card/time-card' alias ping='ping google.com' alias ...
2
votes
1answer
2k views

Trouble with bash and crontab [duplicate]

Possible Duplicate: Reasons why crontab does not work I'm migrating some scripts from an older machine to a lucid ec2 machine. I'm sourcing a file in our ~/.bashrc and setting some ...
1
vote
2answers
739 views

How to access executable in a seperate partition? [duplicate]

Possible Duplicate: How to 'chmod' on an NTFS partition? I have just started using Ubuntu and I have my hard drive set up with an Ubuntu partition, a Windows 7 partition and a much ...
1
vote
3answers
4k views

Can I create an SSH login script?

I have to log in to my school's Linux server for homework. I would like to be able to make a script or something for my desktop to save a bit of time (using Ubuntu desktop). Currently I log in using ...
20
votes
4answers
2k views

What is the meaning of ./ before a given path?

I've been told to run this: ./yiic message ./app/messages/config.php But I don't understand the ./ meaning, can anyone clarify please. Note: Believe me, we can't google that. I've tried: ./ ...
1
vote
1answer
154 views

How to make nautilus recognize emblems changed from the command line [duplicate]

Possible Duplicate: Is there any tweak to bring back emblems in Nautilus? I am trying to write myself a nautilus script. I need to change emblems of files in this script. I discovered how ...
6
votes
2answers
2k views

Replacement for DOS xcopy command

In DOS there's the command xcopy /s *.mp3 ..\TEMP2 How can I do this in Ubuntu? cp -r *.mp3 ../TEMP2 will copy recursively all mp3 files, unfortunately without the path because of the *.mp3 ...
19
votes
2answers
19k views

Reload bash's .profile without logging out and back in again

Is it possible to coerce bash to reload the .profile file without logging out and back in again?
3
votes
2answers
2k views

copy only certain bytes of file?

How can I copy a file, starting at $N bytes and onward? I can use curl's -r option like this: $ curl -r 41663- http://server.com/file.ext to download from byte 41663 and onward, but how can I do this ...
6
votes
1answer
890 views

How to make gnome always run a script, not ask if it should be displayed?

I have written a script: for FILE in *.svg do inkscape --file=$FILE --export-area-page --without-gui --export-pdf=${FILE%.*}.pdf done which converts all SVG files in a directory to PDF. ...
18
votes
4answers
19k views

How to save output from command (eg. diff) into a variable

I want to test if there is any output from the diff (test if files are same), if none echo "Passed $x" else echo "Failed $x". I came up with some intermidiate step (save the output from diff to a file ...
5
votes
2answers
4k views

.sh files requires `sh app.sh` even with `#!/bin/bash` line

I am under the impression that if I include the line #!/bin/bash at the start of my file, it will be recognized as a bash script that I can run just by file.sh instead of sh file.sh But in ...
3
votes
2answers
579 views

Use user's icons in a bash script

I am looking for a way to use the icons from the users theme (in gnome) in a bash script. The solution could be a environment variable or a file where the path to the users icon set is written. Eg. ...
5
votes
1answer
790 views

Source/Dot operator error on login. Possibly caused by bad byobu uninstall

I am getting an error message every time I ssh into my box or run sudo -i. It looks like this for login: login as: person chands@ubuntu-server's password: -bash: .: filename argument required .: ...
0
votes
2answers
126 views

Bash - CP difficulties

cp -r /opt/lampp/htdocs/codeigniter_2.0.2 /opt/lampp/htdocs/test/ That command is making this: /opt/lampp/htdocs/test/codeigniter_2.0.2 and I need only the content of codeigniter_2.0.2 inside test. ...
4
votes
2answers
439 views

Upgrading Evolution from source

As with most people I presume I am running Evolution 2.32.2 inside 11.04 Natty and regardless how annoying the crashes are I prefer it to Thunderbird. Obviously as soon as 11.10 Oneiric is released ...
1
vote
2answers
140 views

How do you write a script that alerts you in the Terminal like mail's “You have mail”

I guess I'm looking for how to make a script to run whenever you press ENTER in bash, so that it can alert you by echoing a line about some event if an event has occurred.
2
votes
1answer
777 views

git-ls-files: command not found

I googled this command and it said it is provided via git-man, which I have installed. Anybody having issues with this command not being found? It appears based on git-ls-files manpage that we can ...
4
votes
2answers
164 views

How can I create something similar to an alias, that does properly expand to the initial command?

I have set up aliases for apt-get update, apt-get install, and so on. Thats quite convenient. But what I really would like to have is something like this: type agi TAB vi and have it automatically ...
3
votes
2answers
6k views

installing programs from the bash script

I wish to install a large number of programs from the software center on all my 8 machines. Installing each program individually would be time consuming so I decided to write a bash script for ...
3
votes
1answer
1k views

Changing shell to zsh broke my terminal

I ran sudo chsh -s /bin/zsh to change my default shell to zsh. I then restarted my computer. When I turned it back on I get just $ as the prompt, so it doesn't look like I even get bash any more. ...
2
votes
1answer
3k views

Configuring syslog for bash script logging

I want to use syslog to do some bash script logging. I see /etc/rsyslog.d/50-default.conf, but I'm new to syslog. I want to configure local0 for logging for my scripts. Should I be editing this ...
1
vote
2answers
625 views

Running Matlab with Gnome-Do: bash script problem

In Ubuntu, Matlab should be started with the following command: setsid matlab -desktop Accordingly, I've created such a bash script: #!/bin/bash setsid matlab -desktop and saved it as ...
15
votes
5answers
15k views

How to start a terminal with certain text already input on the command-line?

Rather than rephrasing my question, let me describe to you the desired user-case: I create a short shell-script to run command "gnome-terminal --someoptionflagname 'my text to be posted'", and ...
5
votes
2answers
628 views

How to re-start a python script without killing other python processes

I develop an app called Unity Mail. A quicklist option «Edit accounts data» needs to restart it. File /usr/bin/unity-mail: #!/bin/sh python /usr/share/unity-mail/unity-mail.py $@ File ...
2
votes
1answer
417 views

Why isn't .profile sourced on login to LXDE?

I switched recently from GNOME to LXDE and since then my .profile file hasn't been sourced on login. I found out that my PATH variable doesn't include ~/bin anymore. However, my .profile file includes ...
4
votes
1answer
747 views

Adding bash script to disable Nvidia graphic card at startup?

I've found the way to disable my hybrid card GT 540M on Asus K53SV at: https://launchpad.net/~hybrid-graphics-linux That's great, but I need those commands to be executed automatically at startup. ...
1
vote
1answer
405 views

Enabling Compiz “Extra” or “Normal” effects per bash in Ubuntu

Enabling disabling compiz per bash is pretty simple per compiz --replace, But how can I switch between the None / Normal / Extra -- Visual Effects in the "gnome-appearance-properties" only using a ...
4
votes
1answer
4k views

What could be a reason for `.bash_profile` and `.bashrc` not to execute the exports?

the CUDA installation tutorial tells me to add the following two lines to my .bash_profile. export PATH=/usr/local/cuda/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH But ...
6
votes
3answers
794 views

directory name with space and bash

I'd like to exclude the directories "temp" and "Ubuntu One/" from backup. What is the correct escaping of the space???? RSYNCCONF="--delete --exclude=.* --exclude=temp/" Thanks in advance! Chris ...
3
votes
2answers
2k views

Shell script to restart a process if it outputs a certain piece of text

I have a python program which, from time to time, crashes with a number of different exceptions usually due to network issues. The only way to get it to work is to restart it. How would I write a ...
4
votes
1answer
325 views

Custom bash prompt is buggy

I followed some articles on how to change the prompt, I've got the result I was looking for, but when the cursor reach the end of the screen it doesn't go new line and tab completion it's strange. # ...
2
votes
1answer
317 views

How to `cat` filename returned by `which`?

I answered this question but realize that it could be better. How can I convert: $ which gjslint $ cat /usr/local/bin/gjslint Into something like this: $ cat < which gjslint -bash: which: No ...
2
votes
2answers
2k views

How can I change the user during a bash script execution?

I have written a bash script from which i execute it from the root. I want to execute a particular command in a user account rather than root account.So how to execute that command in a user account ...
3
votes
2answers
13k views

Read file into array

How can I read file in shell script , then assign each line to an variable that i can use later ,,,(am thinking in way to load an default setting from file) i already try : process (){ } FILE='' ...
2
votes
3answers
389 views

What other bash variables are available during execution such as $USER that can assist on my script?

This is related to question 19245, in that one of the responders answered the question in an awesome way, and very VERY clear to any newbie. Now here is a question that i can't seem to figure. i ...
1
vote
3answers
398 views

Script to move pictures

How can I write a script that will move all .png .svg .gif files from /home/eric/Desktop to /usr/share/icons?
1
vote
1answer
2k views

Path not setting up for a setup

I am unable to add path of my omnet bin directory for the installation. During the installation i go to the omnet directory and enter ./configure which gives me the following errors WARNING: your ...