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

learn more… | top users | synonyms (1)

4
votes
1answer
53 views

Bash to start missing debugger after update to 4.2

I'm on Centos 7.2. Yesterday I've made an update of bash to version bash-4.2.46-19.el7.x86_64 and now on login I get this: -bash: /usr/share/bashdb/bashdb-main.inc: No such file or directory ...
4
votes
0answers
177 views

grep is inconsistently defaulting to grep -P?

I have a script that does some housekeeping that works perfectly well when invoked from an interactive shell, but did nothing when invoked by cron. To troubleshoot this I started a shell with a ...
3
votes
0answers
40 views

lspci “Memory at…” vs /proc/bus/pci/devices BAR address

I have a userspace application that I use to write to the registers of a pci device. It takes the base memory address of the device as an argument. Instead of looking this up via lspci on each ...
3
votes
0answers
2k views

Can't write to other users “you have write permission turned off”

For some reason I'm not able to write to other users on my system. [root@hostname ~]# write write: you have write permission turned off. [root@hostname ~]# mesg y [root@hostname ~]# mesg is y ...
2
votes
0answers
266 views

pg_basebackup automatic password

I have a master and slave database setup. The master database is on a secure network and only the postgres port is allowed through to the slave database server. The database needs to be secured and ...
2
votes
0answers
126 views

yum-complete-transaction in a crazy loop

I was trying to update a server that I have with yum update and it aborted because the server ran out of memory. I killed off a few processes that were not needed and ran yum-complete-transaction but ...
2
votes
0answers
89 views

SNMPget and bash gives strange results (gauge32 values incorrect)

Reallly strange to me but here is the problem. If I use an SNMP client such as ManageEngineMibBrowser to query the appliance I get what look like reasonable Numbers: dpStatusMemoryStatusUsage.0 97 ...
2
votes
0answers
160 views

use socat to provide password to bsign

I have many servers, where I deploy various binaries. For this purpose I use a script that packs them into archives, publishes to the local repository and then ssh-es to the target servers and ...
2
votes
0answers
246 views

error in killing tshark from shell script

I'm getting this error: *** glibc detected *** /usr/sbin/tshark: double free or corruption while doing as below, any idea why? #!/bin/bash trap 'my_exit; exit' SIGINT SIGQUIT count=0 ...
2
votes
0answers
295 views

How to run script only if load balancer is NOT routing requests to it via bash script?

I have 4 cloud instances. First is a load balancer (LB), and then 2 instances with the identical setup holding the application code (APP1 & APP2). And finally, I have a database instance (DB). ...
1
vote
0answers
27 views

How to write a bash script that traps SIGTERM and kills the process and all sub-processes immediately

I have this script: #!/bin/bash set -e #WHAT SHOULD I WRITE HERE? sleep 60 # this is for testing #java ... | logger # this is what will be in the real script I want to be able to kill myscript and ...
1
vote
0answers
35 views

Script to block domains that send too many messages

I've written a little script that will block a domain name from sending email after it has queued more than X amount of messages exim queue. I don't know if this is the right way to go about it, can ...
1
vote
0answers
16 views

io error on no-match glob within cifs OSX -> debian jessie mount

Using a wildcard/glob (at least * and ?) in bash causes an input/output error when there are no matches on a samaba cifs mount in Debain Jessie 8.2. On other filesystems, the expected No such file ...
1
vote
0answers
31 views

mysql-cli - force quit on timeout / connection drop

I have set timeouts in /etc/profile.d/ to disconnect inactive users using TMOUT and this works great however now I am seeing users just holding their connection open by keeping some foreground process ...
1
vote
0answers
80 views

how to filter sar -d disk output tidily

sar -D output-I would like a suitable command to run alongside stress -hdd but this is the output which sar -D 1 10 gives. I have filtered it using both awk |'NR > 1 {printf ...
1
vote
0answers
115 views

Linux: What could be the reason for random fails in updating passwd.byuid by running yppasswd?

In order to allow NOC users in my company to manage users through NIS I've created the following script: #!/bin/bash # This script will simplicate NIS user management. # You will not be able to ...
1
vote
0answers
102 views

Git Pull on CGI and Command Line have different results

I have an "after push" webhook on GitHub that calls a CGI script to update a Jekyll website. The script: user@server [~/_repo]# cat cgi-bin/githook.cgi #!/bin/bash echo Content-type: text/plain echo ...
1
vote
0answers
231 views

How to package shell script file with license key file

I am working on automated shell script for specific task . Before executing task steps I want to validate the license key provided to the customer with a webservice call. Please help me in making ...
1
vote
0answers
594 views

Powershell execute Queries using SQLPLUS

I have a RHEL server with Oracle 10G installed. I need to write a powershell script to query my database and get the output. I have imported Posh-SSH module and am able to connect to my RHEL server ...
1
vote
0answers
94 views

Is rbash secure if user login and ssh passwords are disabled?

I've got a server that I want to use as an SSH gateway for remote and local port forwarding. I don't want arbitrary commands to be able to be executed on it, only my scripts. I keep reading about how ...
1
vote
0answers
273 views

Running inotifywait on startup of machine

I want to start this inotifywait script on startup of the machine, in order to monitor the folders from the moment of booting: #!/bin/bash while inotifywait -r -e ...
1
vote
0answers
75 views

Load OpenMPI module for Apache httpd

How can I tell Apache httpd which version of MPI to use? I'm trying to run a Django web application under Apache httpd, and some of our pages make MPI calls with mpi4py. The problem is that I get an ...
1
vote
0answers
116 views

How best to maintain a recent bash version on amazon linux?

I require Bash 4.2 or higher. Amazon Linux default repositories only provide Bash 4.1. I have done some searches and can not find a yum repository for recent versions of Bash. I don't want to compile ...
1
vote
0answers
618 views

Barnyard2 error on start

Been setting up a snort box with barnyard2, run into the error below. Can someone please help? $Starting Snort Output Processor (barnyard2): ./barnyard2: 35: ./barnyard2: barnyard2: not found ...
1
vote
0answers
198 views

What is a safe alternative to wildcards in /etc/sudoers?

In the /etc/sudoers file on my Red Hat server, I have this line: %webdevgroup ALL=NOPASSWD: /bin/chmod * /home/http/* This is clearly a bad idea, since someone could do something like this: sudo ...
1
vote
0answers
360 views

AD Authentication with SAMBA, Winbind and SSS

I'm having trouble authentication with AD to a SAMBA share on a linux server. Authentication appears to be working, but only halfway... [root@myserver ~]# wbinfo -a my_ad_user%password123 ...
1
vote
0answers
101 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 ...
1
vote
0answers
253 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 ...
1
vote
0answers
259 views

Bash and background processes PGID and receiving signals

My actual problem is that a process I run in an rcfile in docker as docker run container bash --rcfile rcfile remains attached to the bash session by sharing the PGID which means that when I Ctrl-C an ...
1
vote
0answers
233 views

mailx command strange behaviour from cron

I have a script that redirect the df output to a file and then send it in an email. The mail command is set up as following: /usr/bin/mail -s "Subject" -r from@nowhere.com toaddress@somewhere.com ...
1
vote
0answers
58 views

Odd behaviour with varnishlog and stream redirecting

I wrote a helper to debug varnish installation and have used it on both production and development server. The odd thing is, I encountered different behaviour even though the setup is nearly identical ...
1
vote
0answers
134 views

pam_exec not working? cannot allocate 2 bytes?

I am trying to run a script during the login process using PAM and libpam_exec; I have added this line to the desired file under /etc/pam.d/: auth required pam_exec.so debug log=/var/log/debug ...
1
vote
0answers
111 views

Wrong PATH in init script on boot

Since the update of the System on my Synology NAS (x86), I have some problems with my startup scripts. The Bash scripts are stored in /usr/local/etc/rc.d. The scripts were executed for sure, because ...
0
votes
0answers
26 views

how to execute bash script with args in parallel on all the remote server if the remote server in the from of pair

Please read carefully problem first and then give solution................... we are having 3 files in directory myscript.sh (the myscript.sh file contain many function and starts/stop to ...
0
votes
0answers
21 views

fileschanged daemon dies unexpectedly

I'm using fileschanged to monitor files on server1 and run a bash script to synch the files in server1 to server2 if any of the files are changed in server1. to do that I'm running this: fileschanged ...
0
votes
0answers
14 views

Try to install intel cluster studio on centos, but skcript exiting with “binary operator expected”

I am trying to install intels cluster studio 2016 on my centos 7 system. When I try to execute the installation skript I get the following error. install.sh: line 331: [: /tmp/intel.pset ...
0
votes
0answers
18 views

SSH client - prompt editable as Windows control

Is there a way to configure PuTTY (or some other SSH client) to be aware of what's currently typed into the prompt and make it editable via the mouse (like in an input box / textfield that shows at ...
0
votes
0answers
31 views

Solaris 10 - after user shell change X won't start

I've created user with default shell bash, after some time I need to change default shell to /bin/sh (default Solaris 10 user shell) for practical reasons. After execution of command: usermod -s ...
0
votes
0answers
33 views

Terminal piping misunderestanding

Folks I have a few questions around this command: echo 'cat //item/*[local-name()="id"]/text()' | xmllint --shell test.xml | sed '1 d;$ d;/^ -------$/ d' | sort | uniq --repeated I thought command ...
0
votes
0answers
42 views

Error with a specific bash script

I must first of all shamefully admit that I unfortunately know nothing about scripts... I am simply trying to use one that seems to fit my goal. I am running a VPS node with OpenVZ, and I need a ...
0
votes
0answers
73 views

BASH: bash completion function in a custom script

How I can add existing function to a custom script? complete -F _known_hosts test.sh - this works on the command line however when I tried to add this to my custom script it's not working as ...
0
votes
0answers
75 views

Init script only offers help suggestion

I modified the uwsgi init.d script for debian from the apt-get package download. This is the script I have below: #!/bin/sh ### BEGIN INIT INFO # Provides: uwsgi # Required-Start: ...
0
votes
0answers
110 views

CentOS - how to chroot sftp and have mysql as shell

I have a user who I would like to have sftp access to one folder only (chrooted). Also he logs in with ssh, I would like him to only have access to mysql. I am able to chroot the users sftp (by ...
0
votes
0answers
339 views

Executing a remote command over an SSH tunnel

I have created a reverse SSH tunnel from computerB to computerA. On computerA I have a script (r1on.sh) with the following content: #!/bin/bash echo 'r1on' > command.log /usr/bin/ssh -p2222 ...
0
votes
0answers
44 views

Nagios plugin quits when encountering the bc command— how to diagnose?

I've written a nagios plugin using the bash scripting language. When I run this script by hand it works with no issue. Putting it into a nagios plugin however, using the same parameters, leads to ...
0
votes
0answers
50 views

Ctrl-C is ignored by pppd when put in a shell script

I'm trying to connect to GPRS network through a serial port connected GSM modem. When I call /usr/sbin/pppd call <peer_name> from the command line, It correctly receives and handles Ctrl+C from ...
0
votes
0answers
102 views

SSH chroot solution for Mutt

We have an environment tailored for our users to log in via ssh and instead of gaining access directly to a shell, users have a script in place of a shell. The script simply launches Mutt on the ...
0
votes
0answers
74 views

bash redirections stalling when used with jstack

I have this command that is not working and I have no idea how to debug. The command it never returns and I have to press CTRL+C. diff <(jstack 13928) <(sleep 10;jstack 13928) I want to make ...
0
votes
0answers
145 views

Get an OpenVZ container's cpuload realtime in a bash script

I have a bash script which uses CPU cores rather intensively. Recently my VPS was suspended due to server load. The main reason is a cron job for a bash script which checks for Wordpress plugins and ...
-1
votes
0answers
11 views

how to increase the last digit of strings if string like abc@0021 using bash script

Actually i have string in test.txt file. consider the string is abc@0021 so i want to increase only the last digit of my string using bash scripting and the output will be like.... abc@0022 ...