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

learn more… | top users | synonyms (1)

3
votes
1answer
411 views

Automatically cd into directories?

In the terminal You use cd ../../........ to get to wherever you want, But I am lazy, I am wondering if it is possible to automatically cd into the directories if the command is simply the directory. ...
0
votes
1answer
57 views

How do I change the location in the terminal with a custom string?

If I have a really long path to a folder, and I just want the string 'longlocation' to replace it in the terminal, I know I can edit the .bashrc file and add this command: alias changelc='export ...
-1
votes
1answer
624 views

bash script does not work

I am trying to run a bash script that does the following: The following bash script will populate Keystone with some initial data: Projects: admin and services Roles: admin, Member ...
5
votes
3answers
11k views

Where are ALL ubuntu logs/terminal history stored

In what folders are the logs and key histories stored so that I may make a script to purge them. Is there a specific folder for the hibernation partition or a file by which it keeps the RAM data on ...
2
votes
2answers
2k views

Crontab not running a script

I have set my crontab to run 2 script: $ crontab -l 0 20 * * * /usr/bin/bkp.sh --silent > /home/perforce/logs/bkp.log 2>&1 0 21 * * * /usr/bin/flsbk.sh --silent > ...
0
votes
1answer
210 views

Can't login to GUI, only to tty1-6, /bin is not included in the PATH environment

I was trying to make the brightness controls work after I had made a clean reinstall of Ubuntu 12.04 on my Gateway computer, based on this thread, and proceeded to restart because I also had a few ...
1
vote
1answer
2k views

When $SHELL variable does not change when I switch shell

I am using 'zsh' by default. But when I am in my zsh shell, I enter 'bash' to switch to bash, why the $SHELL variable does not change? Can I make screen to use whatever shell I right before execute ...
4
votes
1answer
801 views

Rsync behavior in a cron script

I have an nfs device that creates checkpoint (backups) everyday. I want to use Rsync to copy these checkpoints to another device (Drobo connected via iSCSI). So I've run the script on a single nfs ...
2
votes
2answers
2k views

No duplicated lines in bash history [duplicate]

Supposedly, adding export HISTCONTROL=ignoreboth to .bashrc would do the trick, but what I see in practice is there still exists duplicated lines in my .bash_history file. You can see my .bashrc ...
1
vote
1answer
1k views

how to export bash arrays? any workaround tips?

I am using the bash version 4.2.37 at ubuntu 12.10. But since ubuntu 12.04 I am unable to export arrays in bash... This is an example (type these lines in the command line, it is not a script): ...
3
votes
2answers
277 views

How can I get diffuse to play well with a Python virtualenv?

Diffuse is installed on my workstation and plays well with Mercurial so I often use it for diff'ing. However, I also am using a Python virtualenv to use some different modules in a more controlled ...
0
votes
1answer
524 views

How to build libHaru and the examples which are included

I downloaded libHaru from http://libharu.org/. libHaru is a opensource pdf creator. Now in the INSTALL file says I only have to run ./configure && make && make install. When I run this ...
0
votes
1answer
201 views

Environmental Variable for current domain

I'm using Ubuntu 12.04 LTS Desktop edition I want to use environmental variable for currently joined domain just like I use $USER to bring current user. From what I read there are few variables for ...
0
votes
2answers
6k views

/usr/bin/env: bash: Permission denied

Suddenly, when your Seniors Linux Server admin does not come at office. And Then Junior Linux Admin take a charge of it, then it is NIGHTMARE for them. Please help. I'm not able to recollect, that ...
34
votes
2answers
75k views

Run a shell script as another user that has no password

I would like to run a script from the main ubuntu shell as a different user that has no password. I have full sudo priviledges, so I tried this: sudo su -c "Your command right here" -s /bin/sh ...
2
votes
1answer
528 views

Change Gsetting with script on Logout

System : Ubuntu Raring Ringtail (13.04) from fresh installation. Purpose : Main : Change gsetting (desktop wallpaper) with script on user logout. What's I've Done : (carefully read) I try to stop ...
3
votes
3answers
11k views

if condition on multiple lines in bash shell

I have a bash shell function that takes an argument and perform something on it if needed. do_somthing() { if [need to do something on $1] then do it return 0 else return 1 fi } ...
0
votes
1answer
86 views

bash permissions

My friend was trying to tighten up security on his ubuntu server and changed the permissions on bash. He logged out, and now the computer won't let him log back in. The server is an off-site server ...
1
vote
1answer
187 views

How to use readline to insert a predetermined string onto the command line with a shortcut when using Bash?

Is it possible to have an arbitrary amount of text placed next to the cursor on the command-line? I have heard that it is possible using Bash, but I am not sure how to accomplish it. It seems to be ...
0
votes
1answer
233 views

How to fake Ubuntu version number to applications

I'm trying to install Intel C++ compiler on Ubuntu 13.04, but the installation script says that only Ubuntu 12.10 and below are supported, and there is no option to force installation. So is there any ...
0
votes
1answer
533 views

Installing IRAF problem

I've installed iraf v216 on my desktop computer without any difficulties but installing it on laptop(HP pavilion g6) is giving me a lots of trouble. I can't solve this particular problem, and I don't ...
0
votes
1answer
716 views

Macxchange Script to Change MAC and Hostname in ubuntu 12.04

I'm trying to adapt a script in backtrack to work with ubuntu. I keep getting an error on line 14 which is the "if [ $? == 0 ]; then" line the script was found on ...
1
vote
1answer
361 views

Bash script reading text file - No such file Error

I'm writing a script to read a simple text file. But I get only a "No such file" message. The file exist and has proper access rigths the code I'm using is: Ficheiro="mensagem" while read linha; ...
3
votes
1answer
325 views

Why doesn't this command work as an alias?

I've been using the following command to list the ten largest files, at any depth, under the current directory: find -type f -size +10M -exec ls -gGsSh1 {} + | awk 'NR<=10 {print $0}' (I use awk ...
0
votes
0answers
116 views

How can I make a command execute at startup? [duplicate]

I wanted to remap the keys for my page up and page down number pad so that they would actually act like the real page up and page down. I used the xmodmap successfully following the directions based ...
1
vote
2answers
80 views

How can I set a persistent bash variable?

I use the following procedure to set up a shortcut for accessing directory $ pwd $ user/home/somefolder/somefolder1 $ export SHORTCUT=$PWD Now if I am in my home directory and type $ pwd $ ...
2
votes
1answer
897 views

How do I open screen with many tabs to execute some commands within each one

How to open screen with many tabs? How can I execute some commands within each tab, plus giving the main screen window a name to call it again later to execute other commands? For example, I have a ...
1
vote
2answers
4k views

How to use Bash Script to open URLs in a different profile with Firefox?

Working on a script to automate some tasks in Firefox. These tasks should run through a clean Firefox profile, so they are fast and don't interfere with any of my regular surfing. #!/bin/bash # ...
0
votes
2answers
317 views

Flatten directory with incrementing names

i need a bash script for flattern a directory with same names, and get an ordered output after a conversion. input folder structure: /in1/file1.wav /in1/file2.wav /in1/file3.wav /in2/file1.wav ...
2
votes
3answers
267 views

Command line prompt looks strange in virtual console

In a terminal emulator like xterm my prompt looks like this: [august@macmini ~]$ but in a virtual console the string ;linux is prepended to the prompt to make it look like this: ...
2
votes
1answer
152 views

What is the best directory for script files?

I have my own shell script files and I want to run them in terminal, keeping them in /usr/bin folder. But my question is: which directory is best for keeping files of my own script? I want to use this ...
1
vote
1answer
322 views

How to make a script passing his PID to another running script

i have a script which is the main one and this script open a new terminal and execute another script so what i want is to pass the PID of the second script to the first script the main script ...
1
vote
1answer
1k views

Tell sed to make changes but those starting with a specific string in 8th to last line

Here again with another problem with sed. As the title says, I want sed to change lines starting at the 8th line to the end, but only lines which start with <b>. I have code all ready and ...
0
votes
1answer
483 views

How to write a script as a string and save it in variable ten echo it to any file during run time and execute it in a terminal

Here u are the code i want to do , the problem is the special characters i punt like / and then and those things while executing , it dont consider the text between those two parentheses () a string ...
1
vote
2answers
701 views

How to run two parts of codes of Bashscript simultaneously while one of them is infinite while loop

i have this bash script code and i want to run the read command side by side with the while loop as the read command fetch data from user and save it in some file and the while loop do checking on a ...
1
vote
3answers
317 views

How to execute some commands while background task of bash script is about to be killed

In case i run a script in terminal and it contains a background job , in case the user close the terminal as i guess the script with his all back ground tasks will be dead , i want something like an ...
2
votes
1answer
1k views

Cannot use bash tab complete in tmux

I just install tmux on Ubuntu 12.04 LTS and it throws me this error when I try to use tab completion for simple commands like 'cd' or 'mv' in the /etc/bash_completion file. command substitution: line ...
0
votes
1answer
3k views

Error when installing RTL8188CUS wireless driver from sh: “/lib/modules/3.5.0-27-generic/build: No such file or directory”

I'm using 12.10, updated to this day. The Realtek USB Wi-fi dongle doesn't work. I've seen lots of discussions in forums that suggests downloading the official driver. However, when I run "sudo bash ...
1
vote
2answers
1k views

How to read file starting from a specific number of line within the “while read ”?

All what i want is to specify a certain number of line like this lineNumberIs=3 and to tell while read to start out of this third line or what ever line number and fetching lines after wards to ...
0
votes
1answer
2k views

How to run a shell script without terminal

I have a shell command that executes a command and sends it through pipe to a python file. The python file does various checks on it and then starts processes with parameters using subprocess.Popen. ...
0
votes
1answer
327 views

Automatically load cdc-acm at boot

Hi I am trying to figure out how I can load the cdc-acm module at boot. I tried this command: sudo bash -c echo hoi >> /etc/modules but I get this: bash: /etc/modules: Permission denied ...
1
vote
1answer
464 views

special character and parsing BUG - Bashscript

Failed to parse arguments: Argument to "--command/-e" is not a valid command: Text ended before matching quote was found for ". (The text was '"cpulimit') this is what i get when i run the following ...
0
votes
1answer
322 views

How to open many-tabbed Gnome terminal as one windown instead of many independent windows

aa=$( ps -e | grep "chrome" | awk '{print $1;}') for i in $aa do gnome-terminal --tab -e" sudo cpulimit -p $i -l 35 " done i want to open one gnome window before the execution of the ...
2
votes
1answer
517 views

Modifying PATH does not work

I want to add /home/myname/adt-bundle-linux-x86_64-20130219/eclipse to PATH. I edited .profile: PATH="$HOME/bin:$PATH:/home/myname/adt-bundle-linux-x86_64-20130219/eclipse" but it won't work. Why? ...
1
vote
2answers
77 views

trivia bug in bash script

#!/bin/bash aa=$( ps -e | grep "chrome" | awk '{print $1;}') for i in $aa do gnome-terminal --tab -e" sudo cpulimit -p $i -l 35 " done when i run it i get error missing argument e i ...
1
vote
1answer
159 views

Bash is printing (only) one of my aliases before every prompt

I think this is the relevant bit of my ~/.bashrc file: # enable color support of ls and also add handy aliases if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors ...
1
vote
2answers
722 views

How can you create a command with a Bash file

I created a .sh (or bash) file and I would like to make a command in GNOME-Terminal for the file. I know you run a .sh file by: ./file.sh After you compile it, I also know all the command are ...
3
votes
3answers
722 views

Can't get $(date +%F) set as environment variable

I would like to create an evironment variable that will output the current date. I have added the following to ~/.pam_environment: TODAY=$(date +%F) Apparently you have to log out after changing ...
3
votes
1answer
698 views

Unable to execute shell scripts from `~/bin` [duplicate]

I am learning to write shell script from this tutorial on linuxcommand.org. It says - Most modern Linux distributions encourage a practice in which each user has a specific directory for the ...
1
vote
1answer
400 views

Create multiple directory and subdirectory from multiple txt files

I have three text files: years.txt containing: 2003 2004 2005 2006 ... type.txt containing: cpu case ram hd ... month.txt containing: jenuary february march ... Now, I want to create the ...