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

learn more… | top users | synonyms (1)

1
vote
1answer
141 views

why my bash script only outputs one line on echoing awk variable

Anyone can probably tell I'm new at scripting and have tried doing as much homewaork before posting here. I have what I think is a simple script parsing out DNS zone file for IP and unique domain ...
1
vote
1answer
47 views

restore patched bash to apt maintained

Last month I manually patched bash on a server running ubuntu 11.10 for the shellshock bug, as suggested in the comments here: What is the CVE-2014-6271 bash vulnerability (Shellshock) and how do I ...
11
votes
5answers
16k views

What does >> or double Angle brackets mean? [duplicate]

It seems like such a simple questions but I cant find any resource regarding it In C/C++ , it means to store the read in a value from command prompt and store it inside a variable , How about in ...
1
vote
1answer
28 views

One time “firmware” upgrade script

I was wondering how you could make a script so that on first boot it changes files to a specific parameters? So it would be like if I just installed a fresh kernel. I want to run a script once and ...
5
votes
2answers
452 views

How to easily make an alias command permanent? [duplicate]

I search everywhere and almost everyone was suggesting to open the ~/.bashrc or ~/.bash_aliases, then put the alias command there, I created a function name palias as permanent alias function and put ...
8
votes
3answers
18k views

Where is the bash history for the root user saved?

I'm not talking about .bash_history from my home directory. I usually prefer to use sudo -i or sudo su and then run commands as root user. Since, after these commands the history is not saved in the ...
0
votes
1answer
379 views

Does Ubuntu 14.10 have the security fix for Shellshock bash exploit? [duplicate]

On the internet, I noticed there were Patches for the Shellshock vulnerability which is scaring me a lot. Does Ubuntu 14.10 have this automatically in it?
-1
votes
1answer
331 views

How can i fix this bash problem?

I am trying to set xinput to run at startup to switch some mouse button functions. The problem though is it is not working obviously. I want to go from this: xinput set-button-map 8 1 2 3 4 5 6 7 8 ...
9
votes
2answers
2k views

What does the first '.' mean in '. ~/.bashrc'? [duplicate]

I saw a post about fix your alias in .bashrc. And he says after you put your alias in .bashrc , you need to use: . ~/.bashrc I do not quite understand what the first dot(' . ') does here. What's ...
0
votes
1answer
64 views

Changing SH Directory

I want to have a main launcher that executes a python program The directory is /Downloads/Test/ #!/bin/bash/ python Test.py I want to be able to run the file in the terminal, without the following ...
0
votes
1answer
545 views

Echo to file apparently needs double escaping backslash (\\\n) to write \n. Why?

As per the graylog2 docs, I need to add this line to my rsyslog.conf: $template GRAYLOGRFC5424,"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msg% \n" ...
31
votes
2answers
19k views

Explanation of the command to check shellshock

Here is the command I have used to check my bash shell for the Shellshock bug: env x='() { :;}; echo vulnerable' bash -c "echo this is a test" Can anyone please explain the command in details?
6
votes
2answers
8k views

How do I remove all metadata from a quicktime movie file?

My camera takes .mov files as movies. How can I remove all metadata from them so I can feel confident sharing them on youtube without accidentally sharing when/where they were filmed, what type of ...
0
votes
2answers
165 views

Install only bash from trusty on old distributions (to be save from Shellshock vulnerability)

Is there a way to just install only bash from the latest distribution on an old mashine? I once did pinning to a certain version of a package, but that was bevcause I didn't want to update that ...
0
votes
1answer
91 views

Need Help Improving Script

I have a group of folders (L1N-L5N), in which I want to copy from my /home/michael/documents/XXX to my Dropbox folder. At present, I have used the following script: #!/bin/sh cp -ra ...
17
votes
1answer
2k views

What does su > echo “<username>” mean?

When I was entering the command su > echo "sachin" it was asking for a password. When I gave my password, some strange things happened as you can see: One more thing: there is another user, ...
0
votes
3answers
56 views

What's the easiest way to list files of a given extension, save that list to a text file, but omitting the actual extensions when in the text file?

This is for a counterstrike server, where mapcycle.txt contains all the maps found in the maps/ folder, but the list of maps must not contain the .bsp extension. Example of maps/ folder: map1.bsp ...
2
votes
2answers
708 views

How to write bash actions to a file?

I know that there is a way to write bash shell outputs to a file. However, I want to know what commands have been executed by an application as some of these executions are not outputted as a shell ...
1
vote
0answers
180 views

Unable to reproduce the ShellShock bug locally

I have been trying to reproduce the Shellshock bug on my local 14.04 Ubuntu VM without any luck. I know my local bash version is still vulnerable because the following command prints out the commented ...
0
votes
1answer
163 views

Ubuntu 14.04 Add a notification icon

everyone. I have a wonderful application that I made called Btools. I want to know how to add an icon to the notification tray. Please know that this was written in bash. Thanks for the help.
2
votes
1answer
4k views

How to set environment without sourcing .bash_profile myself every time? [duplicate]

When I restart Ubuntu 14.04, environment variables are set back to default and I have to run source .bash_profile every time which is very annoying. I generally keep my environment vars in ...
1
vote
1answer
126 views

How to remove “dpkg -l” line with “in” for unwanted i386 package on amd64 system?

I will really appreciate your help with this. When I run dpkg -l bash, I get this: Desired=Unknown/Install/Remove/Purge/Hold | ...
0
votes
1answer
215 views

Cron job daily not running

I'm having trouble with setting a cron job to run daily when I enter the script to /etc/cron.daily when I put it there it doesn't run at all like it should be doing. I setup a script so that it can ...
2
votes
1answer
193 views

Terminal errors on terminal startup

Whenever I start the Terminal, I get two errors at the top that say -bash: export:, then a path string, and then : not a valid identifier. I know that these errors are being thrown because of an ...
1
vote
2answers
644 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 ...
0
votes
2answers
1k views

Ubuntu Trusty can't update bash

I'm trying to upgrade bash to the latest version to fix the bash vulnerability, but my machine can't seem to find the new package to install. Don't know what I'm doing wrong. user@machine:~$ env ...
-1
votes
1answer
146 views

why can the terminal not find my executable

Hey all i have been experimenting with make and Ubuntu 14.04 in order to automate the build i have created 2 simple programs test2.exe test2.c #include <stdio.h> int main() { ...
3
votes
2answers
12k views

Loop through all folders and executing script

I have a bash script install.sh in my current directory and I have a directory apps which contains multiple directories. I want to loop through these sub directories in app folder and execute some ...
2
votes
2answers
305 views

Problem in creating alias, get strange messages

[Reviewers: note that the question was completely rewritten after the close votes.] I recently found how I can define aliases for bash in the ~/.bashrc. But since I tried that, I see the followig ...
7
votes
4answers
2k views

Use of default alias “alert”

The default alias Alert is for the command notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e ...
1
vote
1answer
865 views

No longer see Bash warning messages for Shellshock after update

I just updated Ubuntu from an Update pop-up. I am aware of Shellshock, so I quickly went ahead with the install. Now, when I try running env x='() { :;}; echo vulnerable' bash -c 'echo hello' I ...
3
votes
1answer
181 views

How can I start a shutdown with cron,only if no download is in progress?

I would like to shutdown my computer half-past twelve every day and can do that with "echo "30 0 * * * /sbin/shutdown -h now" > myrootcron.sh",but what if I want to cancel that shutdown or leave it ...
13
votes
7answers
7k views

Auto complete for often used command line commands?

For some projects I often type in a couple commands, like for example: cd an/extremely/long/path/in/which/I/have/some/kinda/project and ./runmyproject --with some --command line --options set ...
6
votes
4answers
123k views

How to write the path of a folder with space in it's name? [duplicate]

I can't figure out how to write the path of a folder that includes spaces in its name (in Terminal). I tried: cd /path/path/path/"A Folder"/file cd /path/path/path/'A Folder/file cd ...
0
votes
0answers
100 views

Unable to upgrade bash [duplicate]

everyone knows about bash vulnerability "CVE-2014-6271", I'm trying to update bash using below command. apt-get update && apt-get install --only-upgrade bash but i'm getting bash is already ...
1
vote
1answer
1k views

Shell script running but not opening terminal [duplicate]

I'm having a problem executing a shell script in ubuntu, the script is set as executable and I enabled the execute instead of view option in Nautilus and the script does what it's meant to do which is ...
0
votes
4answers
12k views

How to open bash files with terminal? [duplicate]

I am new to Ubuntu and I just started learning bash. How can I open bash files through terminal?
2
votes
3answers
314 views

Search for a files that matches another file name in another folder

I have some files in a folder, which are named ***_code_c**** (where * represents any letter or number). I have another folder that have many files, folders and subfolders inside it. What I want to do ...
1
vote
2answers
285 views

How do you clear, delete, or hide a portion of your history in the Terminal?

clear will not work, because that clears your screen. What I am looking to do is just hide, delete, or obfuscate a portion of history on my display in my session, namely a command that I inputted that ...
1
vote
2answers
2k views

Rename files in subfolders with parent folder names

I have a main directory that has four folders f1, f2, f3 and f4 each of these folders has 10 folders, and each of these 10 folders ff1...ff10 has some .jpeg images with some names lets say image1.... ...
8
votes
4answers
2k views

Can I use cd../.. as an alias name?

I am using Windows and Ubuntu in parallel and do console stuff on both of them. On Windows I can do a C:\Users\Thomas>cd..\.. C:\> However, on Linux this does not work, neither with ...
1
vote
1answer
615 views

Startup script can be run multiple times despite pid file

The reason I'm doing this script is because I want to daemonize supervisord: right now I'm in a cloud host in which I don't have access to the /etc or the sudo command; this script is my best attempt ...
6
votes
2answers
1k views

How can I delete numbered files in a given range?

I have folderA that has some files with a number sequence starting with a_000000. What I want to do is to delete files starting from a specific number: let's say a_000750 till the end of files in this ...
0
votes
1answer
241 views

Bash Shellshock Fix Applied But Seems that Additional Fix is Required

First time using this Ubuntu Forum, Not sure if this is right place to raise this issue. Anyway, I am having a Ubuntu 14-04 VPS running. I have applied: sudo apt-get update && sudo apt-get ...
0
votes
1answer
271 views

bash version does not change

bash has been updated at least twice in the last two days, but the output of bash --version did not change. Its first line keeps saying: GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) ...
0
votes
1answer
987 views

save number of lines of a text file in a variable shell file

I'm working on terminal and running a .sh file and I want to count the lines in another file and save it as a variable to be used in this .sh file. I'm using this command sed -n '$=' /lines.txt when I ...
0
votes
1answer
234 views

shellshock vulnerability and super user

can shellshock vulnerability execute somehow commands with superuser permissions? And if yes, from where/how? It is possible to be executed commands from cgi yes, but is it possible to get executed ...
1
vote
1answer
215 views

How To: Keep running script only when the network (internet connection) is idle?

I have a script (actually, a Rails application with a Sidekiq job queue system), which uploads pictures and albums to Flickr. This data is huge for my purposes (around 100GB), and the upload is slow ...
1
vote
1answer
2k views

How do I know if my system is vulnerable to the ShockShell vulnerability? [duplicate]

The recently discovered ShockShell vulnerability affects many Linux and Mac systems, because they are using the vulnerable BASH shell. How do I know if I am vulnerable to this attack and how do I ...
2
votes
2answers
327 views

CVE-2014-6271 over ssh example attack?

I've been reading about the CVE-2014-6271 bug on lots of pages, but I'm still not able to understand how exactly is it possible to exploit it over ssh. From all I've read, I couldn't find an example ...