A shell is terminology for a command-line interpreter most commonly used with Unix-like operating systems, but also used to interact with GUI-based operating systems in a more granular fashion. Not only does it allows the user to run programs from a text interface, but frequently offers basic ...

learn more… | top users | synonyms

0
votes
1answer
43 views

Script to Push Files

Script to Push Files Hey Guys, Thanks for always being helpful, I have another issue that I need a little insight on how to fix. See the below script I have and the error I get. I don't understand ...
2
votes
1answer
101 views

configuring command prompt in Asterisk CLI

I am trying to set up color prompt in asterisk CLI. In the documentation I have found this: %Cn[;n] Change terminal foreground (and optional background) color to specified. A full list of colors may ...
4
votes
1answer
38 views

How would you add a share to smb.conf via a script?

I'd like to script adding a share to a smb.conf file. My current script just appends it to the end of the file, but that's not ideal. I'd rather have something that will add a new share if it doesn't ...
2
votes
3answers
131 views

One line script to check and react to memory usage

I'd like to have one line of shell/bash that does something along these lines: test "`free | grep | awk | whatever` -gt 80" && any_command Where the total percentage of ram being used by ...
1
vote
1answer
26 views

FreeBSD/FreeNAS: How to change group for multiple users?

I need to change group membership for a bunch of users. How do I list all users? change multiple users to nogroup primary group? add secondary/auxiliary groups to multiple users? Basically I need ...
2
votes
0answers
21 views

Function body defined in /etc/profile appears in shell history on login

We run IBM AIX here (currently 7100-03-03-1415) that is missing a fair amount of the utility preset in other versions of UNIX. One of the things that we need to do on a semi-regular basis is convert ...
0
votes
1answer
37 views

Monit failed to start shell script

So I am having a problem with monit starting a process this is my code: check process program_1 matching "program_1" start program = "/home/user1/files/start.sh" stop program = ...
1
vote
1answer
32 views

Finding strings in files with relative path

I don't understand why this two commands don't provide the same result (the differrence is only relative vs. absolute path), can somebody explain it? annika /srv/www/pages/com.example.www/www/povruc ...
2
votes
2answers
76 views

bc: using “scale” with bash variable [closed]

Easily, I'm writing a script that needs some values with 2 digits after floating point. Trying to use bc I don't understand how use "scale", i.e. A=12 ; bc <<< $(($A/5)) it's correct, but ...
-2
votes
1answer
21 views

Create symlink if source exists

I'm trying to make a symlink to a directory if it exists only and cannot figure out how. I tried various ideas I found and none worked. Most notable idea that i thought would do the job was to use ln ...
0
votes
1answer
169 views

Unable to load dynamic library '/usr/lib64/php/modules/ssh2.so'

When I try to run any php script with my user within shell, I get the following warning: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/ssh2.so' - ...
1
vote
1answer
30 views

Why is find not excluding old files?

I want to copy all gzipped files from my apache logs that were created less than 43 days ago. As a test, I simply listed my files from find: sudo find /var/log/apache2/ -mindepth 1 -ctime -43 -name ...
1
vote
2answers
376 views

Expect script error send: Spawn id exp4 not open while executing

Update: Working code added here for others CREDITS to : http://serverfault.com/users/30957/glenn-jackman @Glenn I'm sorry! just apologizing and I mean it! Sorry Glenn your code need few changes ...
3
votes
3answers
60 views

How to pass command output as several arguments to another command

I have a command that produce a output like this: $./command1 word1 word2 word3 I want to pass this three words as arguments to another command like this: $ command2 word1 word2 word3 How to pass ...
0
votes
1answer
90 views

Cron occasionally fails with “grandchild #X failed with exit status 3”

I have cron jobs and every now and then they fail. Just after log message that the command has started, there is grandchild #X failed with exit status 3 message. On the next run scripts finishes ...
0
votes
1answer
32 views

How to check the existence of multiple directories?

I have a script which obviously faulty: if [ -d "$BACKUP/${DATE_MAX}_"* ] then ... fi This script would only work if there is a single or no directory there at all. If there are multiple ...
3
votes
2answers
87 views

Why is my find -type d performing fstat on every file in a folder?

I'm running find . -type d on a rather large directory tree. I am only interested in finding directories within this tree, but when I ran an strace against the process to make sure it was doing what I ...
0
votes
0answers
14 views

Is there a way using the shell to install certificates and enable encryption in 389 directory server?

My client has a 389 directory server installation that I discovered does not have SSL enabled on it. I would like to do this but I've always had to do it using the Admin console. At some point they ...
2
votes
1answer
219 views

ShellShock test shows wget and curl access

I've fixed shellshock bug on my Debian 6 server and while testing on http://shellshock.brandonpotter.com/ I get "No Vulnerabilities Found" and that's OK but they also check other things and in the ...
0
votes
0answers
61 views

execute local command using ProxyCommand ssh

I am trying to execute local command using ssh and ProxyCommand in sys config but getting an error cat ssh_config Host ameyj-c Hostname x ProxyCommand bash -s "/home/abc/abc.sh" ssh ameyj-c ...
1
vote
1answer
64 views

SFTP for users (own site folder)

I'm trying to config SFTP, so that my users can access their own site folder (with PSFTP/FileZilla). I use Vagrant, CentOS7, NGINX and .sh file. This is my bootstrap.sh, for creating one of my users. ...
0
votes
0answers
22 views

Check if Cacti Boost is currently running

How can I find out whether the boost update process is running presently on Cacti? I want to check in a script before I start the regular system backup, delay my backup if it's boost is still running ...
0
votes
2answers
63 views

ssh-keyscan stderr comment on success

I am running a shell script to add fingerprints to known_hosts. Code is like this: status=$(ssh-keyscan -T 5 $remotehost >> ~/.ssh/known_hosts 2>&1) if [[ $? != 0 ]]; then echo -n ...
1
vote
2answers
148 views

Python Script portion failing to execute within init.d/ on RedHat 6.5, why?

I've created a init.d script called rmCluster which is supposed to execute a simple python script at shutdown which uses boto to shutdown a particular cluster of servers, with 755 perms, located in ...
1
vote
1answer
32 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
vote
2answers
136 views

Locked out after installing a bash without executable bit

After scp-ing a shellshock-patched bash binary to an openSUSE 12.2 Linux VM and replacing the login shell with it, no user can log in via ssh or the console. As it turned out, the executable bit got ...
1
vote
1answer
327 views

Shellshock protection in Rackspace Ubuntu

I am trying to update my Ubuntu 13.10 servers in Rackspace to avoid Shellshock bug, but it is not working. Here is what I am doing: $ sudo apt-get update && sudo apt-get install ...
0
votes
1answer
72 views

Cron bash script skips second do/done set

I have a script that checks IPs for ping reply then tries to run an snmpwalk on them. I am trying to schedule the script to run weekly in cron. When I run the script in the shell, it runs perfectly. ...
3
votes
1answer
205 views

Encrypting/Decrypting a file using openssl through an autorun script

So I am trying to encrypt/decrypt a file using openssl. I am running it through a script that is automatically run when I mount a USB, and decrypts the file. However, it doesn't work quite right, so ...
0
votes
1answer
185 views

insserv: warning: script 'uwsgi' missing LSB tags and overrides

This is my code: #!/bin/bash daemon="$APPVENV/bin/uwsgi" args="--emperor $APPCONF/uwsgi/app.ini" pid="$APPDIR/emperor.pid" case "\$1" in start) echo "Starting uwsgi" ...
1
vote
0answers
62 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 ...
0
votes
1answer
21 views

Trouble using ssh-key gen specifying location and password

This is my code: ssh-keygen -t rsa -C "$APP" This works perfectly. However it then asks me to specify location and password. I was hoping I can automate this all in one go, however this command ...
0
votes
2answers
155 views

Netstat count TIME_WAIT connections by port

I can obtain individual TIME_WAIT counts on a port, netstat -nat | grep :11300 | grep TIME_WAIT | wc -l; but how to do this based on all ports eg: 11300 2900 connection 3306 1200 connection ...
0
votes
2answers
54 views

Generating random passwords with shell on server deployment

I'm trying to generate random and secure passwords to my various configuration files and settings on the fly when I run my automated deployment script. I want them to be generated, shown to the user, ...
0
votes
0answers
35 views

Elevated privileges for non-modifiable install script

I need to give permission to a local user to run an installation script that requires root privilege. So I created a special group in which this user is a member of and gave the permissions to the ...
0
votes
0answers
30 views

different interactive and non-interactive shells

A user account has it's shell defined in passwd file as bash. I would like to change this user account's shell to tcsh for non-interactive jobs (like ssh ), but keep interactive shell to bash. Is ...
-1
votes
1answer
91 views

Login by ssh , change the remote PS1 and don't quit the remote ssh shell [closed]

I want to change PS1 when i ssh another centos strshell = 'PS1="remote!"' os.system("ssh -i %s -l%s -p%s %s %s"%(SSH_KEY,SSH_USER,SSH_PORT,des,strshell)) ssh quit automatically. I want to ...
0
votes
2answers
57 views

How do I capture the Maven Jar name as a part of a Hudson job?

I have a Maven 3 job configured in my Hudson server. When the Hudson server successfully builds the Maven jar, I have the jar being deployed to an SCP repository on another server. I want to execute ...
-2
votes
1answer
326 views

Crontab not working to send email [closed]

I have CentOs 6.5 running on a VPS Host. I installed crontab and email using the below commands yum install vixie-cron service start crond chkconfig crond --levels 235 on yum install sendmail ...
1
vote
0answers
179 views

SSH without invoking shell

I've managed to mess up some shared libraries on my system, and now my shell cannot be run, thus locking me out of the system. Both ssh, sftp, and scp, as configured on the remote system, seem to rely ...
-1
votes
1answer
284 views

How to access a system with write permission after file system check fails?

I created three new partitions, but after a reboot, the system is being dropped to a shell: /dev/mapper/group-newpartition: clean, 11/655360 files, 276620/2621440 blocks [FAILED] An error occurred ...
-2
votes
1answer
33 views

zsh substitution, can't do regex with repetition

I'm trying to perform ZSH variable substitution, but I'm having to do it the lame way, by piping through cut. Is it possible to perform this operation entirely within ZSH? ...
0
votes
1answer
163 views

Where is this bash shell alias being configured?

While logged in as root onto a CentOS 6.5 system, I run ># alias alias cp='cp -i' alias l.='ls -d .* --color=auto' alias ll='ls -l --color=auto' alias ls='ls --color=auto' alias mv='mv -i' alias ...
0
votes
1answer
51 views

chattr: undefined symbol: set_com_err_gettext

I've moved my CentOS 6.5 installation to a new server and I'm unable to use chattr on my new server: chattr: symbol lookup error: chattr: undefined symbol: set_com_err_gettext How to resolve this ? ...
0
votes
2answers
799 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 ...
1
vote
1answer
366 views

How to prevent syslog message popping in a ssh session without affect other sessions?

i have a machine(RHEL 5.2) which receives syslog message from remote machines. And now it keeps popping message from remote machine in a ssh shell, which is annoying when i want to do something on it. ...
0
votes
0answers
73 views

Distributing Master node ssh key

For the master node to passwordless-ly ssh into the slaves, the master needs to distribute its ssh key to the slaves. Copying key using ssh-copy-id asks for the user password. If there are hundreds of ...
2
votes
3answers
100 views

Can I use Bash interpreter in service/daemon scripts?

I'm writing a Debian/Ubuntu service that should start on at runlevel 2-5. Most of the existing services I came accross are written using /bin/sh (Shell) interpreter while /bin/bash (Bash) offer lot ...
2
votes
3answers
98 views

Common login script

Few weeks ago I thought it would be a good idea to write a script which should send me an email whenever some user would log in into my server. So I came to a perfectly working script ...
0
votes
7answers
249 views

better way to loop through a list of servers

I regularly do things where I loop through a list of servers to take some action. For example: for s in `cat servers.txt` ; do echo; echo $s ssh $s 'do something' done I'm wondering (from a ...