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

learn more… | top users | synonyms (1)

0
votes
2answers
84 views

Shell script compsrison does not work as intended

The follwing code is for to compare two strings or variables. But, I cannot do it. I did a lot of googling, but no use. Here, output doesn't depend upon the changing of inputs. Can any one correct ...
2
votes
1answer
1k views

Creating new user, inconsistent bash prompt

I've created a new user profile with: useradd kitty passwd kitty mkdir kitty chmod 0700 kitty chown -R kitty:kitty adduser kitty sudo #when I did it I initially didn't ...
0
votes
2answers
2k views

Changing current directory to shared filesytem using linux terminal

I have a shared filesystem (E: in my installation of Windows 7) in which I keep my programming codes. I want to shift from Windows to Ubuntu for programming mainly because I like the linux terminal ...
0
votes
1answer
2k views

why is source command not being run in .bashrc

I have a source command which i have to manually run every time I open a new terminal. source /opt/ros/groovy/setup.bash Thus I added the command into the .bashrc file. However the does not seem to ...
0
votes
2answers
170 views

How to make a script which always activates on the startup? [duplicate]

So I'd like to add always a folder to the Path. I'm not a huge linux wizard but I think I would need to always write the "export PATH=$PATH:(directory)" line when I log in. But I need this to be on ...
0
votes
1answer
912 views

Check if torrent file is complete before copying

I have a crontab command that daily copies .iso files found within my torrents folder into an iso directory on a separate partition. My problem is that multiple .iso files will still be in the process ...
1
vote
1answer
495 views

Auto backup when USB Drive inserted

If this is not the best place to post this question, can you please direct me to a more appropriate place to post this. What I am trying to do: I have a USB drive, it is fat32 and its name is ...
5
votes
4answers
2k views

A script for moving files from subdirs to parent dir

I am looking for a script for moving files from subdirs to the parent directory My folder structure looks like this. Inside of a folder A I have a lot of folders named 1,2,3,4,5... All these ...
14
votes
3answers
1k views

Exclude from * in command line

There are plenty of situations where the use of a * is virtually inevitable - e.g. rm -rf * in a folder that holds thousands of subfolders and files. But what if you want to exclude just one or two ...
0
votes
1answer
92 views

who is $user with name as “festival”?

Have tried this script out of abs-guide (downloaded in this galaxy somewhere...) : http://paste.ubuntu.com/5952973/ It was written by Mendel Cooper. Now on my machine an user pops up with name ...
1
vote
1answer
160 views

Force terminal text editors to open specific file types first, if there are multiple with the same name

If I have multiple files all with the same name (except, of course, the extension), is there a way of making bash auto-complete to a specific extension when I open them from the terminal with a text ...
1
vote
2answers
5k views

/bin/sh is a symbolic link that doesn't point to /bin/bash [closed]

I was installing the software environment of Armadeus experiment board APF27DEV, and when I tried the make command, it gave me the following error message: On your system /bin/sh is a symbolic link ...
1
vote
1answer
4k views

Help needed in passing arguments from command line in bash

#function myfunc myfunc(){ echo $1 case $1 in e) a=5 ;; q) a=10 ;; esac } myfunc I need help in following : $myfunc.sh e echo $1 is not ...
3
votes
2answers
4k views

Assign VNC password using script

I am using a script to automatically set up a computer. I need to assign a password to the vnc server for the user, which is normally done using the vncserver command. However, it prompts for the user ...
0
votes
1answer
116 views

random lines with delay in between

I am using the following package to pull random lines from file(s) where line delimiter is % http://manpages.ubuntu.com/manpages/lucid/man1/rl.1.html rl -c 10 -d % myfile.txt -c 10 gives 10 lines ...
0
votes
1answer
181 views

Set command can't handle lines constituting of a \n (word/line counting script)

I have a problem with execution of a while loop, I have found out that the problem involves the execution of the set command, the assigment of the \n character to an environmental variable ...
-1
votes
1answer
169 views

tar - command different to 10 years ago?

With this question am asking "old rabbits" of Ubuntu resp. of Debian. Am puzzled by the "newer" use of command tar - I know that 10 years ago it was possible to tar a file to 1/3 of size or even less ...
0
votes
4answers
3k views

single line group of commands as individual?

I made one small alias and got a question as , how to execute a single line group of commands as command by command with out breaking it ? echo " alias get='sudo apt-get install'" >> .bashrc ...
2
votes
1answer
2k views

Quit all instances of `gnome-terminal` via a command

This is half "this'd be useful for me" and half "hobby project" - I was wondering if it's possible to send a command via a gnome-terminal that will quit all instances of a program without using ...
1
vote
1answer
4k views

Commands not working after editing .bashrc file

I need to install a programming software called cuda for my academic purpose. Googling how to install it on my Ubuntu 10.04, I found these and I have done that. download the software cd ~/Downloads ...
9
votes
3answers
11k views

How do I configure Ubuntu to reboot every day at a given time?

Using the terminal or a bash file, how can I configure Ubuntu to reboot every day at (say for instance) 3 AM? In other words, I want to schedule an automatic reboot through the terminal. I haven't ...
0
votes
1answer
168 views

Why does the script list directories starting with uppercase first, and all-lowercase second?

The thread is an extension of: Basic script listing directories ([: discover: unexpected operator) When I execute the script: for item in * do if [ -d "$item" ] then echo "$item" fi ...
1
vote
2answers
447 views

Basic script listing directories ([: discover: unexpected operator)

I encounter an issue running a basic script listing directories. for item in * do if [ -d $item ] then echo $item fi done The outcome: lists all system folders returns an error: ...
0
votes
2answers
662 views

How to add your Eclipse workspace folder to your PATH?

I am using Ubuntu 12.04. Hi I have been working on the following issue for a couple of days and as much as a I look at the many different answers (What is PATH environment variable and how to add it) ...
1
vote
1answer
722 views

search and replace inconsistency between vim and sed

Using the Ubuntu 12.04 and vim 2.22.0, why inside the vim I shall use: :9s/\d\+/1/ to change first digit of the mentioned line to 1, but couldn't be able to use the same with sed as : sed -i ...
5
votes
1answer
4k views

How to link a custom keyboard shortcut to a bash script in Ubuntu 13.04?

As an Ubuntu 13.04 user I had myself as well various problems and incompatibilities with this newest version of Ubuntu. One of these is that the Brightness bar has suddenly disappeared from the ...
0
votes
2answers
5k views

Cannot access /etc/hosts

I cannot open my /etc/hosts file. I would very much like to, I have tried logging in as root and changing the ownership and changing the permissions, please help. When I try to open the file I get: ...
5
votes
1answer
10k views

How to change a directory using shell script?

I am trying to change a directory to home/developer. I used cd home/developer in my shell script. After executing script it is again coming to original directory,where I executed shell script.
0
votes
1answer
65 views

Any setup to version control ALL ubuntu settings?

Just now, I had to google for the third time in my life on how to disable that thing in Ubuntu, where you hold the super key and a help window pops up. Granted, there was a few months in between, but ...
0
votes
2answers
161 views

I am trying to check the mysql bind address int the terminal but keep getting error can someone help?

I am trying to check the mysql bind address in the terminal using the command cat/etc/hosts | grep localhosts that I got offline, but I keep getting a bash: cat/etc/hosts: no such file or directory ...
0
votes
1answer
30 views

Command substitiution problem, confused

I am trying to have sox play a file from user input. To do this, I set up a command like the one below: $ play proc/$(read -n 1).wav I have files 0.wav through 9.wav located in the directory proc. I ...
1
vote
1answer
198 views

Ubuntu .pam_environment for non-login shell

I remember in the past, we have two place to set env variables for Ubuntu Login shell - ~/.profile Non login shell - ~/.bashrc But now according to the doc [1], they are not recommended anymore. ...
0
votes
1answer
240 views

Why does my shell script only execute in execution mode “Display output”?

I wrote a bash script (here) for extracting EXIF GPS coordinates from an image and displaying those coordinates as a pointer in Google Maps. It works perfectly when used like this in the terminal: ...
7
votes
3answers
14k views

How to access the last return value in bash?

Simple scenario: I'm looking for a wsdl file lost in the middle of a project. $ find -name '*.wsdl' ./some/very/very/long/way/to/some/lost/directory/filename.wsdl Now that I know where it is, I ...
2
votes
1answer
889 views

Bash command-line in vi mode - command-line find/replace [duplicate]

New to linux :-) In my .bashrc I have set -o vi. That way when I'm in the terminal I can press CTRL +{ and then use VI commands to navigate, edit and search the command history. One thing I cannot ...
1
vote
3answers
27k views

./configure no such file or directory even after installing build essentials

I'm trying to install Java SE 7 on my ubuntu 13.04. I have already downloaded tar.gz file and extracted. But when I wrote in terminal: ./configure I saw this message bash: ./configure: No such ...
0
votes
1answer
504 views

Removing specific characters in string

I am currently writing a bash script and I have obtained a list of file locations. However I have notice that some file locations have spaces in the file name such as eg. : /1 2 3.txt Such files ...
0
votes
1answer
140 views

How to do tab completion with files that starts with special characters

I am unable to open a pdf file which starts with (. For example: (3311) M3N78-EM.pdf Are there any arguments to be given? I have invoked with evince command. When I type evince (and press tab, nothing ...
1
vote
1answer
120 views

How does Linux know how to execute shell vs machine code?

./something How does Linux know how to execute this if it's a shell script, or compiled machine code? I understand how the shebang works, but there doesn't seem to be anything like that here.
0
votes
2answers
53 views

Something that should seem simple

As mentioned in the title, this should be something simple, but for the life of me I can't get it to work right. I am writing a small executable script that will take care of entering the ...
0
votes
0answers
20 views

adding directory to path environment variable doesn't remain in path [duplicate]

I have been trying to get a program called "passenger-memory-stats" to run as the super user. The program is installed in the following directory: /usr/local/rvm/rubies/ruby-1.9.3-p327/bin/ruby . I ...
0
votes
2answers
222 views

enter path written in a file

I'm writing a code with fortran and I have several different output saved in different directory. During the Do cycle I saved the temporary PATH of the output in a file.txt Now I'm trying to plot ...
3
votes
2answers
1k views

How Do I Log USB Modem AT Command Output?

I want to be able to send the command "AT+CSQ" to /dev/ttyUSB1 every 5 seconds, and log out response to a text file. I can do it manually via screen (screen /dev/ttyUSB1 and type in AT+CSQ and see the ...
1
vote
1answer
108 views

get the resident memory of indivdual threads of a process using bash shell

If I want to find the resident memory a process uses, I might use something like "ps aux | grep apache2" or "sudo pmap -d 1130". However, I have one process that has 25 threads, and I would like to ...
0
votes
1answer
648 views

How to launch Dolphin file manager from command line or bash script (and give it a path)?

I want to open a Dolphin window from a bash script. It may not be relevant to the question, but I will be connecting to an SFTP location in Dolphin. First I tried this command from my script: ...
2
votes
1answer
4k views

Configure / Add a FQDN to /etc/hosts?

I'm trying to set up iRedmail 0.8.5 and I keep getting this error. root@danielbts11:~# cd /home/iRedMail-0.8.5 root@danielbts11:/home/iRedMail-0.8.5# bash iRedMail.sh hostname: Name or service not ...
3
votes
2answers
6k views

How to rename all files in folder with name ending with “_backup”

I have a bunch of images that were somehow renamed from myimage.jpg to myimage.jpg_backup, so the images on my website don't load anymore. How would I recursively find all images ending with _backup ...
1
vote
2answers
9k views

Change the terminal prompt [duplicate]

This can be really trivial,but it helps in ways of making it more comfortable while coding and sending commands to terminal. My terminal source/bash/root name(my apologies, I dunno which is the right ...
0
votes
1answer
122 views

Why won't my script work?

umm my script isn't working and I don't know why, it gives me the error "update1.run: line 187: syntax error: unexpected end of file" Here's my code http://pastebin.com/4W4AwuY5 I would really ...
1
vote
2answers
287 views

Always use `-P` flag with `cd` command

How can I set -P flag to every cd command? I do that every time. There are LS flag environment variable which I could use for ls command so I wonder can -P be set as default?