Bash is the Bourne Again SHell, the successor to the classic Unix sh (shell).

learn more… | top users | synonyms (1)

3
votes
2answers
844 views

Start Unix screen, Run command, Detach

How can screen be used to start a new session and run a command within that session without killing that session? screen -S myScreenName runSomething I tried the above command and it says [screen ...
3
votes
4answers
147 views

Remove IP with ip command in linux

If I add two IPs like this: ip addr add 1.1.1.1/24 dev eth2 ip addr add 1.1.1.2/24 dev eth2 and then I try to delete one of like this: ip addr del 1.1.1.2/24 dev eth2 BOTH IPs will be deleted ...
2
votes
1answer
1k views

Linux- Permission denied?

I'm installing Neo4j server as a linux service, but when I install it, I get the following message: /sbin/insserv: Permission denied What is this? What should I do? I'm running everything with ...
0
votes
0answers
7 views

date command, going back one or two days. Seeing different flags [migrated]

I'm writing a bash script that should run on OSX and Ubuntu. I'm not sure if this particular problem is due to an OS mismatch; more likely it's a difference in the date command on the two shells, ...
1
vote
2answers
2k views

Bash script count down 5 minutes display on single line [closed]

I would like to have a count down of 5 minutes, updating every second and showing the result on the same line. Is this even possible with Bash scripting?
0
votes
2answers
392 views

Can't run AWS CLI from CRON (credentials)

Trying to run a simple AWS CLI backup script. It loops through lines in an include file, backs those paths up to S3, and dumps output to a log file. When I run this command directly, it runs without ...
0
votes
2answers
29 views

Using find to exclude a directory and tar up everything else in a directory

I have following in a directory: dir1 dir2 file1 file2 I want to tar up everything except dir1 When I do: find . -path '*dir1*' -prune -o -print I don't see dir1 in the output ( as expected) ...
1
vote
2answers
22 views

Hourly Clamscan cron script failes at reading file list

I've this piece of code located in /etc/cron.hourly/hourlyclamscan. #!/usr/bin/bash # Create Hourly Cron Job With Clamscan # Directories to scan SCAN_DIR=/home/transmission/Downloads # Temporary ...
3
votes
1answer
33 views

List directories not containing a file which has a variable prefix

I'm checking the output from a script. In some cases the script has failed, and a certain file hasn't been produced. I want to check whether this file is present in a directory and if not, print the ...
0
votes
1answer
914 views

Improper output in SSH session on OSX using FreeSSHd on Windows with cygwin bash/sh shell

I am testing out running an SSH server on a local Windows VM. I have installed FreeSSHd and set the command shell to "c:\cygwin\bin\sh --login -i" (bash as well) with "Use new console engine" ...
0
votes
1answer
34 views

Dumping a binary file to stdout [closed]

I have a Docker container which builds a binary file from source and I'd like to then have it output the binary file to stdout so it can be then used by the calling host. I was hoping it would be as ...
-1
votes
2answers
97 views

Delete all files except the newest of each day

I have dump directory that is filled at the rate of one file per 4 hours. I wish to keep all files for a week then delete all except the newest of each day. Bash is preferred though other solution ...
0
votes
3answers
39 views

how to run the dialog command with proccess

Please look on my code – ( bash script ) I want to display both dialogs on the screen on the same time, one dialog display the: tail –f from - /var/log/proccess1.log , and the second dialog ...
0
votes
0answers
20 views

Linux: Process ignores signals

Processes running in Linux ignores signals (INT,QUIT,TERM) except KILL. Programs such as top, tail -f, sleep and etc, do not respond when pressing Ctrl+C and thus have to stop them from another ...
5
votes
2answers
750 views

How can I make bash to log shell commands to syslog?

Bash 4.1 is able to log the history to syslog. However I can't seem to make it work under FreeBSD 8. I've tried re-compiling bash from ports with -DWITH_SYSLOG= but to no avail. Has anyone managed to ...
4
votes
2answers
52 views

SSH Login Failure “-bash: error while loading shared libraries: requires glibc 2.5 or later dynamic linker”

I did a blunder on one of my production server and its very old RHEL 4 host. Due to recent "shellshock vulnerability" by mistake I upgraded the bash to wrong version from RHEL5 repo. Now I am ...
4
votes
6answers
438 views

Prevent sudo, apt-get, etc. from swallowing pasted input to STDIN?

I often write up wiki instructions to install various server packages on Ubuntu (11.10 Oneiric at the moment). They always involve things like: sudo apt-get install -y postfix sudo cp ...
-1
votes
0answers
33 views

Redirect stderr and stdout to another file descriptor [migrated]

exec 6>&1 will copy file descriptor 1 onto 6. But how can I copy both stderr and stdout (1 and 2)to file descriptor 6 ? Thanks,
0
votes
1answer
31 views

SVN Post Commit Issue (Calling Bash)

All, I would like to invoke a bash script (to do some rsync magic) towards the end of my post-commit hook. Here is what my post commit hook looks like: #!/bin/bash REPOS="$1" REV="$2" ...
1
vote
1answer
34 views

Why does printf work differently with sudo?

I have a simple script to convert a text file with colour escape sequences to the actual characters. It works if I run it directly, but not with sudo. To set up the scripts: test.txt ...
-3
votes
1answer
28 views

Dump all DB with Bash Script in separate files [duplicate]

I would like to easily dump all my DB without typing same stuff many times ... (I'm a dev and I have a lot of DB on my local machine ) Any Simple scripts that comes to your mind ?
0
votes
1answer
51 views

Getting the passphrase to ssh-keygen

I have a new private key that I'm bringing to a docker container as part of a bash script. After copying the private key to /root/.ssh/id_rsa I wanted to regenerate the public with: ssh-keygen -yf ...
1
vote
3answers
66 views

rsync using keygen login in bash script

So I have set up a password-less ssh login for a server. I can run rsync from the command line, and it works beautifully, and doesn't ask me for a password: rsync -avz -e ssh myDir ...
0
votes
2answers
31 views

Converting string into CLI instruction

I have a the following in a bash script: cmd="composer install" `"$cmd"` which results in: composer install: command not found However if I just run this in the same bash script instead: ...
-1
votes
0answers
17 views

Centos 4 Updating bash [duplicate]

I have a old machine running centos 4.8 was wondering how I could apply the latest bash patch for shellshock. I know there is no support for centos 4 not but since its just a security update is there ...
2
votes
1answer
135 views

Collection of shell shock related logfile grep patterns

There are many topics on the shellshock bash vulnerability, but there isn't any collection of patterns that we could "grep" for in either the webservers access.log files and in the normal logs. ...
0
votes
0answers
29 views

Shell script permission denied despite +x flag [migrated]

This is an odd one, it only happens on one server (shared hosting, so I have limited access to configuration and logs), but I can't wrap my head around it. I have a shell script which runs some app's ...
20
votes
7answers
6k views

bash/sed/awk/etc remove every other newline

a bash commands outputs this: Runtime Name: vmhba2:C0:T3:L14 Group State: active Runtime Name: vmhba3:C0:T0:L14 Group State: active unoptimized Runtime Name: vmhba2:C0:T1:L14 Group State: active ...
0
votes
1answer
119 views

segfault error with bash on CentOS 6

I updated bash as soon as both patches were available, and using the test script at https://shellshocker.net, I am showing fixed on all vulnerabilities except for segfault. OS: cat /etc/*release* ...
1
vote
1answer
24 views

Losing carriage returns in variable assignment

If I assign a variable in Bash like so: PRIVATE_KEY="$(< ~/.ssh/id_rsa)" and then immediately dump that to a file: echo $PRIVATE_KEY > tmp.txt and then compare this to the original: diff ...
-1
votes
0answers
39 views

Server Shellshocked, how to find out how? [duplicate]

I have access to one server that is shellshocked and there is injected crontab along with altered ssh init script. Here is gist of file that does all the work Question is how to investigate how ...
5
votes
7answers
10k views

What is a recommended way to patch the Shellshock Bash bug on an unsupported Ubuntu server?

I maintain an out-of-support Ubuntu Quantal server (12.10), don't ask me why please, and we need to patch the Shellshock Bash security bug. As upgrades are not available anymore, what is the ...
9
votes
4answers
10k views

Can not update bash on Debian Squeeze

Can not update bash on a Debian Squeeze server to get rid of discovered vulnerability: bash --version GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu) apt-get update apt-get install bash ...
1
vote
3answers
257 views

How to split a file and compress directly?

I've a 100GB file and I want to split into 100 of 1GB file each (by line break) e.g. split --bytes=1024M /path/to/input /path/to/output For the 100 files generated, I want to apply gzip/zip to ...
10
votes
4answers
8k views

Force SSH to use a specific shell

Is there any way to force SSH to use a particular shell on the remote end, regardless of what the user's default shell is? I've tried solutions akin to: ssh host.domain.com /bin/bash -c ...
0
votes
0answers
23 views

bash shellshock update causing script to behave differently [migrated]

This is one of the things that happened since we've updated our bash ( due to the Shellshock thing ) This is the code that I'm testing: #!/usr/bin/python2.4 import subprocess, os p = ...
0
votes
2answers
113 views

CentOS 7: Getting interface IP numbers

I am trying to autopopulate the /etc/issue in a CentOS 7 image (this will be a template, and it needs to be easy to identify the resultant VMs at a glance). I have the following in my ...
11
votes
3answers
795 views

grep behaving differently on Fedora vs Ubuntu

So when I run this in Fedora I'm seeing this: $ ls hmm_data/indivA12_AATAAG/refs/par1/ 2R-orths.alleles 2R-ref.alleles $ ls hmm_data/indivA12_AATAAG/refs/par1/ | grep -F '-ref.alleles' ...
1
vote
1answer
988 views

ShellShock - Unable to update CentOS 5.7

[user@server1 ~]$ wget http://mirror.centos.org/centos-5/5/updates/x86_64/RPMS/bash-3.2-33.el5.1.x86_64.rpm [user@server1 ~]$ sudo rpm -Uvh bash-3.2-33.el5.1.x86_64.rpm warning: ...
3
votes
3answers
8k views

How to update solaris 10 to be safe from shellshock bug?

Saw this post here. Logged into my Solaris server in ssh and tried patchadd 19689293 and it just says it cannot find the patch.
-2
votes
1answer
251 views

I've uninstalled/deleted bash and it's killed the server

I changed the default shell to zsh. And then proceeded to uninstall bash (this was via yast on SLES). To my horror I start to see everything deleted/uninstalled, apache, mysql . I can't putty into ...
68
votes
6answers
41k views

How to test if my server is vulnerable to the ShellShock bug?

How can I ensure my Bash installation is not vulnerable to the ShellShock bug anymore after the updates?
0
votes
1answer
122 views

How do I update bash on RHEL5 servers with expired contracts? [duplicate]

I have two servers with expired contracts that are both vulnerable to shellshock. I am in the process of migrating both to new servers with RHEL6 or greater depending when I get this done. That ...
0
votes
5answers
102 views

Solaris - How to see if Bash is installed

never touched Solaris before is there an easy command to see if Bash is installed? Probably a silly question, thanks for your help
0
votes
1answer
35 views

“File not found” from bash script executed by Apache (CentOS)

I have a bash script that sets up a classpath for accessing a series of JARs (it's tf, the cross-platform, command line tool for Team Foundation Server). The file structure is something like: ...
0
votes
1answer
32 views

Password less mysql access to specified user/script only

In addition to this question: Performing root mysql operations in bash scripts I'd like to ask how to limit/allow this action (performing root administrative actions): mysql --local-path=mypath -e ...
3
votes
3answers
3k views

chsh: PAM authentication failed

i want to change default shell env and run chsh -s /bin/zsh as root user, but a error message appeared: chsh: PAM authentication failed. i find this thread ...
0
votes
0answers
17 views

lftp mirror leaves empty folders on remote

My script is set up with this for lftp lftp -p 2218 -u $login,$pass sftp://$host << EOF set mirror:use-pget-n 5 mirror -c -P5 --depth-first --Remove-source-files ...
16
votes
4answers
19k views

How do I patch RHEL 4 for the bash vulnerabilities in CVE-2014-6271 and CVE-2014-7169?

A mechanism for remote code execution through Bash has been widely reported yesterday and today (September 24, 2014.) http://seclists.org/oss-sec/2014/q3/650 Reported as CVE-2014-7169 or CVE-2014-6271 ...
1
vote
1answer
105 views

CentOS fails to update Bash

I'm trying to patch my server against the Shellshock vulnerability issue. However, I'm unable to update Bash to a safe version, these are the results I'm getting: # yum update bash Loaded plugins: ...