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

learn more… | top users | synonyms (1)

0
votes
1answer
57 views

git push script, only if difference

I've found some nice questions illustrating how one would write a script automating git push/pull with cron here and here, but I want to elaborate on that slightly. I only want to push/pull if there ...
2
votes
1answer
49 views

Trouble with simple script :(

Could someone please tell me why this script doesn't run correctly. Seems to be a problem with the if statement as i keep getting the error: /home/sinttx/Development/backup/ddbackup.sh: line 18: ...
1
vote
2answers
60 views

Select Top N files based on modification date and rsync them

I'm fairly new to linux and I'm trying to transfer some N files based on Modification Date. I've found this commandls -tr | head -100, which to my understanding, will list the Top 100 Files (head ...
0
votes
1answer
135 views

/var/log/secure not present in 14.04 ,is there any alternative?

While reading about Linux ,especially about sudo I got:: A message such as the following would appear in a system log file (usually /var/log/secure) when trying to execute sudo bash without ...
1
vote
1answer
48 views

How to create your own commands that can be used anywhere [duplicate]

I am new to linux, and I am learning bash scripting at the moment. I was wondering how I would save my script as a command and then be able to call that command anywhere in the terminal. So i could ...
1
vote
1answer
48 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
34 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 ...
1
vote
1answer
21 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 ...
0
votes
1answer
203 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
54 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 ...
3
votes
4answers
372 views

How to write literal \n in a file as text from the terminal?

I write this in terminal: printf ' \n\necho -e \"writes (>> appends) in note.txt this text'\n'on 2lines (with "-e" and "'\n'" help)\" >> note.txt\n' > note.txt I get this in ...
0
votes
1answer
49 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
72 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" ...
0
votes
1answer
65 views

provide more than one processor with taskset

I am using taskset to assign CPU cores 4-7 to a java process that normally uses ~200-400% CPU. The cores 4-7 were isolated on boot so only the java process should run on them. Eventually taskset ...
0
votes
1answer
48 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 ...
0
votes
3answers
37 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 ...
1
vote
0answers
107 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 ...
16
votes
1answer
1k 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
1answer
47 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.
0
votes
1answer
87 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
39 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 ...
2
votes
1answer
4k views

Shellshock: How can I update only Bash without restarting?

I want to fix the Shellshock issue, and the usual solution is to update Ubuntu. How can I update only Bash and without having to reboot?
2
votes
1answer
228 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 ...
0
votes
0answers
21 views

How can I give an option (-o vi) to login shell

I want my login shell to be started with option -o vi so that instead of /bin/bash my login shell would be /bin/bash -o vi I tried changing /etc/passwd but that result in invalid shell, as it ...
1
vote
1answer
45 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 | ...
1
vote
2answers
421 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 ...
-1
votes
1answer
61 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() { ...
2
votes
2answers
72 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 ...
0
votes
2answers
45 views

Problem with bash script [duplicate]

I have a little problem with a script of mine. I execute a command in background using sudo and I try to retrieve the PID of the command in a variable. the code is the following: #!/bin/bash sudo ...
1
vote
0answers
84 views

Synaptic Package Manager -E-“cache open”, E - Default-Release not available

In an attempt to re-install Bash I tried to open Synaptic Package Manager but got this message E: The value 'precise-updates' is invalid for APT::Default-Release as such a release is not available in ...
3
votes
1answer
117 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 ...
1
vote
4answers
1k 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
99 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
2answers
305 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
608 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?
0
votes
0answers
72 views

How to fix RAID1 array by mdadm with script?

In system works two RAID1-arrays madadm. There is one reserve disk to change faulty disk. I need to write a script which will be monitoring disks and automatically fix degraded array. How do you ...
0
votes
0answers
53 views

bash autocomplete behaving strangely after update

Since bash was updated very recently, when I try to autocomplete by tabbing during a cd I get the following... tony@tony-HP:~$ cd Mucword=1 words[0]=${!ref}${COMP_WORDS[i]} ...
0
votes
2answers
132 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
218 views

How to fix invalid identifier error after setting environment variables?

I'm trying to setup cocos2dx in Ubuntu 14.04 LTS but after setting the environmental variables (in .bashrc) I start getting this error: bash: export: dev/cocos2d-x-3.2/tools/cocos2d-console/bin': not ...
1
vote
2answers
85 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 ...
2
votes
3answers
99 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 ...
0
votes
2answers
184 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.... ...
28
votes
2answers
14k 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?
8
votes
4answers
565 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 ...
0
votes
2answers
939 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 ...
5
votes
2answers
217 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 ...
1
vote
1answer
769 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 ...
0
votes
1answer
204 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
0answers
26 views

Creating an alias with tab completion

I know how to create a permanent alias, just edit .bashrc . I created alias forsudo apt-get install <appname> . As you may not know the exact name of app or want to check the dependency u can ...
0
votes
1answer
239 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 ...