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

learn more… | top users | synonyms (1)

126
votes
5answers
90k views

What is the CVE-2014-6271 bash vulnerability (Shellshock) and how do I fix it?

Recently, there have been news going around regarding "CVE-2014-6271" (See USN-2362-1), which is a vulnerability in Bash. How do I know if I am affected by this, how can I fix it, and why should I ...
4
votes
2answers
3k views

CVE-2014-6271 bash patch trouble

I have a Ubuntu [EDIT] 12.04.4 LTS server that is vulnerable to the recent bash remote executable exploit. Ubuntu says they have released a patch here. I have run a sudo apt-get update && ...
0
votes
0answers
16 views

Get status of background process

Let's say I have started a process in the background: e.g. tar [...] | pv [...] & pv has the PID 1234 and normally reports it's progress to stdout. The job was started as a cronjob so there is ...
0
votes
1answer
31 views

echo “${txtred}Text${txtrst}” color not always working

I have a .sh file through terminal and I'm using echo "${txtred}Text${txtrst}" as a display of what's happening when running the script. But sometimes the color is not red, although I used {txtred}. I ...
0
votes
1answer
44 views

Script Not Running Properly On Server

I am having an issue with my webserver. I am testing it out on a new kernel build and it seems as if I can't get one certain part running on it. All of my scripts work except this one. Every file ...
0
votes
1answer
91 views

How do I use a shell command as a launcher shortcut? [duplicate]

The following command from terminal works perfectly: sh /home/flux/Downloads/TeamSpeak3-Client-linux_amd64/ts3client_runscript.sh How would I go about adding this as a shortcut, so I can open ...
3
votes
1answer
68 views

mkdir crashes bash

I'm trying to create a directory in my home directory but the shell itself keeps crashing. I have permission to write to the directory. I am able to create files in the directory via touch. I can ...
1
vote
1answer
81 views

script.sh run differently when manually opening terminal and when using .desktop launcher

I have a script file script1.sh as shown below: #!/usr/bin/env bash cd /home/userA/scripts . r1.sh when I manually open a terminal and run it using . script.sh it works fine. But when I created ...
1
vote
1answer
70 views

shell file opens terminal and run a sequence of commands in specific order

What I used to do is: Manually open a terminal instance to run the following commands and shell files Run PACKAGE_PATH=/home/userA/package1:/home/userA/package2:$PACKAGE_PAT‌​H run: cd ...
0
votes
1answer
59 views

feedingbottle/n”export: No such file or directory

I'm noob in linux, so i install feedingbottle, but then I open terminal showing this: bash: ...
1
vote
1answer
113 views

how to run command in an already opened terminal through a shell script

I'm running a shell script.sh which is supposed to open terminal and then run some commands in this opened terminal. What happens is that the terminal starts but the following commands are not ...
0
votes
1answer
43 views

Desktop Launcher executing a sequence of commands after opening a terminal

I've created a .desktop launcher as shown below which successfully opens terminal. What I want to do next is to run the following commands such as cd home/userA/scripts then ...
0
votes
0answers
13 views

How to truncate directory name in terminal? [duplicate]

Something like ../parent folder/current folder instead of 8 different directories as mine currently is when I'm accessing deep files.
-1
votes
1answer
68 views

At what time does bash scripts execute? [closed]

I would like to run a bash script at system startup. I read recently that some bash scripts are executed before logging in to a user account, others, after. Can I get some information on when bash ...
0
votes
0answers
51 views

Shell script loop stops by itself

I have two script files like this. execute.sh #!/bin/bash #259200seconds = 5 days end=$((SECONDS+432000)) x=0 cp /dev/null ~/kill_start.txt while [ $SECONDS -lt $end ] do [[ $(cat ...
1
vote
1answer
48 views

Copying files and folders with cp with shopt extglob - error is not a directory

I'm trying to copy files from a directory while excluding a folder and a file. My problem is that a get an error with shopt extglob activated. Here is my code: ...
0
votes
1answer
58 views

Run some shell files from another shell file in different location

I have 5 shell files in a specific locations on my ubuntu system. I have two users on this system userA which is the main user and userB. Currently I have to manually open a terminal using user userA ...
4
votes
4answers
1k views

Why is the output of _$ _ when executed on a terminal?

I have executed the following command sequence: $ now=$(date) $ echo _$now_ _ $ echo _ $now _ _ Mon Sep 22 09:53:44 IST 2014 _ Why is the output of _$now_ only _?
2
votes
1answer
273 views

Stopping a running script though another script file

I am new to shell scripts. Say, I start a script like this. This runs for 3 days. So, I will start the script remotely through ssh and then close my local terminal. start.sh end=$((SECONDS+259200)) ...
-1
votes
1answer
24 views

Redirected Output

I just used a command ls -l > ~/ls_output in my /usr/bin directory and I'm not sure what happened. The terminal accepted my command but I don't know what happened to the output or where it went. ...
-1
votes
1answer
336 views

Ubuntu 14.04 - Desktop icon is not running my BASH script

I have a simple script runme.sh which works when i run from terminal. #!/bin/bash chromium-browser "https://askubuntu.com/" But i need to make it now runnable for normal Users. So i place a desktop ...
2
votes
1answer
69 views

post-receive: No such file or directory

I'm getting an error when trying to push to a remote Amazon EC2 (Ubuntu Linux) instance. I've given all related directories and files full permissions. I'm trying to use a post-receive hook to move ...
1
vote
2answers
64 views

Unable to delete file

I am unable to delete file: sudo rm /usr/local/bin/Katy Perry - Dark Horse (Official) ft. Juicy J-0KSOMA3QBU0.mp4.part It is showing an error: bash: syntax error near unexpected token `(' How to ...
1
vote
2answers
95 views

Only display a range of entries from the bash history

Is it possible to set a fixed number for the "history" command to only show a certain amount of history items like 100, instead of everything from the beginning of time?
1
vote
0answers
46 views

Display running clock in terminal [duplicate]

I want to display running clock inside terminal. I have already gone through this answer but this method only works in zsh terminal. But I want to display in bash. Is there any other way to display ...
5
votes
1answer
809 views

Difference between cd / and cd //? [duplicate]

What is the difference between cd / and cd //? We can see that adding / to the end doesn't do anything. But when I do cd // and pwd, I found: $ cd // $ pwd // What is difference between / and ...
0
votes
0answers
20 views

Run script in another opened terminal

Is it possible to run a script in another opened terminal? In that case I would need to know all opened ttys. Another case would be, if I'm using SSH to login into a remote host. I would like to run ...
0
votes
4answers
49 views

Explain exec in simple terms?

I don't understand the bash command exec. I have seen it used inside scripts to redirect all output to a file (see ...
3
votes
1answer
74 views

How to quickly check the value of bash variables, aliases and history commands from terminal?

How do you expand in place: bash aliases environment variables history commands to edit them and check they are correct? For example, I have some aliases I use for flashing different devices and ...
7
votes
2answers
199 views

Creating a new subdirectory in multiple existing directories

I am trying to figure out an elegant way to create a new subdirectory in a series of existing directories. I have 15 already created directories called Week1 through Week15. Within those ...
2
votes
2answers
123 views

Pass variable value to script from terminal

I like the shred command so instead of using the 'rm' command I prefer shred. I would like to create a bash script in /usr/bin, say we will call it "shredder" so that if I want to shred a file (i.e. ...
1
vote
0answers
36 views

“sudo !!” doesn't give me permissions. What am I missing? [duplicate]

When you forgot to sudo a command you may want to write, sudo !! That would execute the last command applying the sudo command to it. However sometimes seems I can't do that, for example inside ...
11
votes
5answers
1k views

How can I run original command that aliased with same name?

An alias for ls command in ~/.bashrc file aliased with this one: alias ls='ls --color=auto' then, when I run ls command in terminal aliased ls(ls --color=auto) runs. but my question is how can I ...
1
vote
1answer
181 views

Crontab not executing jobs Ubuntu 14.04

I am trying to run bash script as a cron job every 15 minutes. The bash script simple calls a Java program. I made an entry in crontab to run the file every 15 minutes and saved it but it would not ...
1
vote
2answers
92 views

Hide stdout of a process only when it is running in background

How could I hide the standard output of a process only when it is running in background? For example, test.sh #!/bin/bash for i in $(seq 200); do echo $i done Now, I run the script. I stop ...
0
votes
1answer
30 views

CPU performance on sleep command

This is rather a beginner question. I wonder what happens when sleep command is triggered from a bash script, for example. That job would still running, with less priority?
0
votes
0answers
45 views

Diffrence beetween ' and " in bash [duplicate]

Please bear with my stupid question. I want to know the difference between ' and " in bash. Please explain it to me with an example.
-1
votes
1answer
106 views

How to let bash script knows if the open terminal is closed or not

I want to write piece of bash script that open a gnome-terminal tab and execute some commands in it after finishing execution terminal will close , i would like the make bash recognize if this ...
1
vote
3answers
122 views

Not able to run sed on bash script

I am working trough some legacy code which does not work, I came across a part that is causing problems. I was hoping some one could help me out and fill me in on what is the exact functionality of ...
0
votes
2answers
90 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
109 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
34 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
128 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
198 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
85 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
50 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
21 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
66 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
87 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
186 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 ...