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

-1
votes
0answers
17 views

Installed codec not working ffmpeg [on hold]

I have ffmpeg installed on my server, I can trancode mp4 and it works great. However, I have installed the Theora codec as it explains here, ...
2
votes
0answers
20 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
votes
0answers
11 views

Syntax error on simple init script for debian [migrated]

I have this init script to run uwsgi. It works, but only on the start command. All the other commands give me this error: /etc/init.d/uwsgi: 27: /etc/init.d/uwsgi: Syntax error: ";;" unexpected It ...
0
votes
0answers
12 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: ...
-2
votes
0answers
26 views

awk parsing output and extracting values [closed]

I am sorry to bother all good people. Unfortunately, I am no good with awk and under a past-due deadline. I suspect that my question is simple for the right person. Perhaps, I am wrong. Some program ...
0
votes
0answers
13 views

How to escape pipeline char in Windows shell?

I need to specify a regular expression that includes | character to findstr command: processtext.exe | findstr /R "Hello|Bye" How do I escape it? \| does not work. Quotes fix issue with pipelining ...
3
votes
3answers
521 views

Why cd does not change current directory in crontab?

In my user's crontab, on a CentOS system, I have something like this: 58 12 * * * cd /home/joe/dev; echo `pwd` | logger This outputs in /var/log/messages: Feb 19 12:58:01 srv01 joe: /home/joe ...
0
votes
0answers
23 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 ...
0
votes
0answers
19 views

Is it possible to break out of a “trap 1 2 3” secured terminal session by using SIGSEGV?

The title says it mostly. I'm auditing the security of a terminal-based application on AIX, and the way you use it is to connect to it remotely through telnet, where the ".profile" of the telnet user ...
0
votes
2answers
38 views

Cron job ignores part of trigger url

I created a cron job to trigger a url at set times, which in turn starts a product import script. But for some reason part of the trigger url with parameters is stripped away. I set the cron job in ...
-3
votes
0answers
17 views

Maunually executing a CRON - Confused about params [migrated]

I have this code snippet: $CUSER=tim $APPDIR=/var/www/testing $APPVENV=/var/www/testing/ven cat > $APPDIR/cronfile << EOF PWD=$APPDIR/$CUSER PATH=$APPVENV/bin:\$PATH 0 2 * * * testapp search ...
2
votes
0answers
60 views

Reset root shell back to /bin/bash in suse 11

In my production server which is running SUse 11 SP1, the root shell is set to /bin/eksh. Not sure how come it is set to this..we are using /bin/bash as root's default shell. I tried to reset it like ...
0
votes
0answers
33 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
1answer
14 views

Duplicity: No Shell Expansion with Globbing Filelist?

I am running a Samba PDC with both home directories and Win7 (roaming) profiles under '/home', i.e.: /home/[user name] /home/samba/profiles/[user name]/win.V2 For backup purposes (duplicity 0.6.18 ...
0
votes
1answer
31 views

Can't seem to create file in bash

I'm trying to use this (under the root account) code in debian 7. #!/bin/bash cat > /root/.ssh/github.id_rsa << EOF -----BEGIN RSA PRIVATE KEY----- XYZ... -----END RSA PRIVATE KEY----- EOF ...
-1
votes
1answer
23 views

Exploit PHP File Found in /tmp directory [duplicate]

I have been alerted to by our system that a PHP shell has been found in the /tmp directory. Firstly - I would like to know how it could have got here and why it would be here - is there any way PHP ...
2
votes
2answers
65 views

Looking for a way to wrap a command and give its own shell

I am working with the command line executing the same commands many times manually following the same pattern. Now I am looking for a way to simplify it by just typing the command only once. Lets ...
0
votes
0answers
46 views

ftp ERROR: PERMISSION DENIED with files downloaded with wget

i have a little issues with wget and ftp. after i download a folder from internet with wget to my home folder in centos server. wget -r --no-parent --reject "index.html*" http://www.example.com/xxx/ ...
1
vote
1answer
42 views

Linux utilities commands not working for particular user

We are using a centos 5 server. We are facing a strange problem where for a particular user, the basic linux utilities commands such as (ls,cp..) are not working. The shell gets hanged as we fire ...
5
votes
3answers
614 views

If condition is true, sleep the cron job for 5 minutes

I have a script set to run after every minute. But in the script we have mentioned, if a condition is true, the script has to sleep for 5 minutes. How could this affect the crontab? Will the script be ...
8
votes
1answer
91 views

How to “un-ANSI-fy” logs?

Lately there has been a tendency by command line tools to use fancy ANSI colors in their log output (for example, NPM and a host of nodejs based tools, rvm, docker, and a few other "modern" tools). ...
0
votes
1answer
55 views

How can I tell a script is running under cron?

Is there a standard way to know if a shell script is running under cron as opposed to running from the command line. i.e. I'm thinking of running with more verbose output when manually kicked from the ...
0
votes
1answer
70 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
191 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
70 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
205 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
98 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
1answer
39 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
144 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
41 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
162 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
28 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
751 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
32 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
1k 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
145 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
152 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
44 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
131 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
23 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
331 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
121 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
76 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
34 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
90 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
237 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
48 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
218 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
333 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
96 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. ...