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

-2
votes
1answer
28 views

Crontab process not working [closed]

I have a crontab process to start run a .sh script which starts a .jar file. Although when I added multiples (changing the correct paramaters) It stopped working. This is my cron file * * * * * ...
0
votes
1answer
20 views

Cannot change default shell in solaris 8

I have a situation. We have Solaris 8 machines. For every users we have to change the shell from /bin/sh to .../sdshell. So far we have been doing it by editing the /etc/passwd file manually. Is ...
1
vote
1answer
16 views

Python script crashes when run via Cron

I have a python script that completes exactly as expected when run manually as the root user. When I put the script into cron.daily it crashes 100% of the time. The error is a timeout error, but ...
0
votes
0answers
4 views

Unable to specify a paper try with bash script [migrated]

So we use a bash script that sends control codes before printing to set some things on the printer. At the end of the script it calls a standard LP command. I add the option to print to a specific ...
0
votes
1answer
26 views

sudo (-E) doesn't preserve path, even when configured appropriately

I have circus installed in a python virtualenv using virtualenvwrapper, and I want to run it with sudo. Sounds simple, right? Unfortunately even after reading man sudo and man sudoers, I don't ...
0
votes
0answers
6 views

Odd syntax for ssh and bash to run command [migrated]

I'm pretty new to shell/bash scripting and I'm writing a script on OSX to automate some rather tedious efforts. I'm trying to run a portion of my script on a remote host using ssh. There's a common ...
1
vote
2answers
21 views

How to prevent rsync from chown'ing remote users files

I'm doing rsync /local/path/to/src user1@remote:/path/to/dest. dest belongs to user2@remote. How do I keep rsync from chown'ing dest to user1 after syncing? Please note that I have already tried ...
0
votes
2answers
19 views

Move all ls output and symlink

I want to move some of my files in directory to another drive and create symlink for each of them in the old directory that will point to the new directory. For example, [root@localhost olddir]# ls ...
-2
votes
0answers
28 views

iptables shell command from php, does not apply fully?

I run a shell script from php. shell_exec("/abs_path_to/lorem.sh"); When I run the script in Terminal # sh "/abs_path_to/lorem.sh", it works. The script consists in iptables rules. I checked it is ...
0
votes
2answers
42 views

How can I redirect logfile output to a network socket?

I am using a commercial Java app which writes it's logfiles using log4j. I'd like to get those logfile entries into Syslog where we have specific filters setup to trigger on system events. Log4j ...
0
votes
0answers
24 views

bash scripting and comparing 2 directories - Beginner [duplicate]

My problem is that i have to check what files are included in the $directory, then i have to make a new file with name specified by me and compare if the name doesn't already exist in this directory ( ...
0
votes
0answers
10 views

shell script for checking the list of websites status [duplicate]

How can i write a shell script for Checking the list of websites in a server which are running up or not. If they are running leave it. Those who are not running what type of error it is popping out ...
0
votes
1answer
117 views

Shell script for docker ps -a | grep to find number of certain containers running

I want to write a script that is executed by my development build server that will remove any 'similar' docker containers before building and running a new container. Below is pseudo code for the ...
1
vote
2answers
34 views

Dangers of closing file descriptors

In the Stack Overflow question Check if a program exists from a bash script the accepted answer notes that closing stderr is dangerous: (minor side-note: some will suggest 2>&- is the same ...
1
vote
3answers
43 views

Execute Shell loop in parallel, but only N workers

We have more than 100 git repos, and sometimes I want to grep over all. To update the repos I use this: for repo in *; do (cd $repo; git checkout master; git pull); done This is quite slow. How ...
1
vote
1answer
45 views

Does whitespace matter in nginx conf files?

I have an nginx conf file that due to using environment variables, I have a shell script echo, this file I refer to as nginx.conf.template, then I place the echoed result into the actual nginx.conf, ...
-6
votes
1answer
30 views

How to enable ssh access without public/private keys [closed]

I want to access my server via terminal like this: ssh username@host.com Password: (enters password) ... I have access to cpanel for this server. There is a section called "SSH access" where I can ...
0
votes
1answer
31 views

Change shell prompt based on container name?

I have been doing a lot of work using Linux containers, and I keep forgetting which of the terminals on my screen is running inside which container, particularly when I leave them open overnight. How ...
0
votes
0answers
49 views

Change ram usage in apache.conf

I´m triggering a shell command from my PHP script. As it is much slower when running from my Webserver then manually from shell, I thought the max ram per Apache Thread might be the reason. The ...
1
vote
1answer
55 views

unexpected end of file error in script file

#!/bin/sh # Host = ############### Port = #### email_id="##################" email_sub="######" # if ping -q -c 5 $Host >/dev/null then result_host="Successful" else result_host="Not ...
1
vote
2answers
40 views

Why is the cron ENV different from the user's ENV?

On a new Ubuntu install, a user's PATH is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games But in that same user's cron environment, it is: /usr/bin:/bin ...
1
vote
0answers
49 views

Echo each shell script command with a timestamp

set -x or set -v prints every executed command. How do I get the command printed with the time when the command started executing?
0
votes
1answer
191 views

run PHP file from shell script

I have never added a cron job and am not much use with shell either... My chosen cron directory is /etc/cron.daily/ all I need my script to do is run a php file daily. I would be nice if it ran at ...
0
votes
3answers
67 views

Doing a backup with mysqldump and drop it on another server (Bash)

I'm using a cron job to do backups hourly and now, I want to drop those backups on another server by default. My script is the following: mysqldump -u db_user -p db_password db_name| gzip > ...
4
votes
1answer
150 views

Running detached screen session but without termination in the same bash

Here are already many questions like this, but every one recommends (a variant of) the following solution: screen -dmS somename bash -c "/path/to/script; bash -l" e.g. when the script ends, run an ...
0
votes
2answers
88 views

What is making /tmp/info-html*.tmp files and how do I stop it?

What is making /tmp/info-html*.tmp files and how do I stop it or configure it to clean these up and/or make these somewhere else? For example, # ll /tmp/info-html* -rw-r--r-- 1 user user 0 Oct 30 ...
0
votes
1answer
108 views

sftp: get file by mtime

Objective: Connect to sftp server with very simple script using -b option, cd to directory and get file with the latest modified time or created time. I can connect and download *.csv but that may ...
1
vote
2answers
125 views

Why can't I capture AWS EC2 CLI Output in Bash?

I am trying to capture the output of an aws ec2 delete-snapshot in a Bash script command but I cannot get anything to capture the output. I have tried result=$(command), result=`command` etc. but when ...
1
vote
2answers
161 views

How to generate gpg key without user interaction?

I found in https://www.gnupg.org/documentation/manuals/gnupg/Unattended-GPG-key-generation.html#Unattended-GPG-key-generation method to generate gpg keys without user interaction, but it doesn't seem ...
1
vote
1answer
77 views

Trouble installing ZSH

I did the following: yum install zsh Then chsh eduar New shell [/bin/bash]: /bin/zsh When I type: curl -L http://install.ohmyz.sh | sh I got this: You already have Oh My Zsh ...
0
votes
2answers
290 views

Shell Script to connect to Database and execute query [closed]

#!bin/bash Query="update table_name set colume ='i' where column_name is NOT NUll" mysql -u username -p password mysql <<EOF $query; EOF The above script is not working
1
vote
1answer
754 views

Add cronjob with bash script - No crontab for root [duplicate]

I have a deployment script and in it I'm trying to add a cron job. This is the code I am using which I found on stackoverflow. I'm running debian 8. # ADD CRON crontab -l > mycron echo "10 * * * * ...
1
vote
0answers
59 views

mail send format issue in different linux servers

I have created a send mail script which will run on couple of my client servers. The mail was sent correctly in couple of servers but in some servers the format we receive is not what what we ...
1
vote
1answer
530 views

Update version of network manager

In shell on sever I see following error after launching several commands: Error: nmcli (1.0.0) and NetworkManager (0.9.9.1) versions don't match. Force execution using --nocheck, but the results are ...
0
votes
2answers
75 views

Add a user from root with ssh key

Perhaps a strange question, but I'm not a shell script expert. I'm provisioning an Ubuntu server starting out as root. I'd like to non-interactively setup a new user account, remove root login and ...
0
votes
1answer
117 views

Nagios bash syntax error

I want to refer with this question to the following post where I got the Skript: Post with Script I'm using Bash 4.1.2(1) and when I try to execute the script, I get following error messages: ...
0
votes
1answer
45 views

Crontab is delayed by 2 hours [duplicate]

I have got a problem with two crontabs that execute some operations on my website: the first one run a command every 3 minutes and the second one at 5am in this way: m h dom mon dow command 0 ...
0
votes
2answers
459 views

Installing PHP extensions to the correct PHP version

We have two versions of PHP on our Linux CentOS6 machine, 5.3.3 and 5.6.7, and wanted to install PHP extensions, memcache and imagick, to 5.6.7. Logged in as root, using yum, we installed both of ...
0
votes
1answer
70 views

Suhosin - Disable shell_exec default, allow from one directory

I have in php ini this function, which blocks shell_exec default. php.ini suhosin.executor.func.blacklist = shell_exec Its works well. When I want to allow shell_exec, so I use in httpd.conf ...
0
votes
1answer
455 views

How to scp file to remote servers' root directory and run sudo commands?

NOTE: The servers does not share the same password but I will setup no-password login at first. Here's the use case, I need to do these below step by step in my deploy.sh: scp files to remote ...
0
votes
1answer
31 views

Check if user is logged in VSFTPD (from the server)

I need to solve a task with a script. I moving files from a user home directory to another storage regularly (in every 5 minutes and so). How can I detect if this user is logged in (via VSFTPd ...
0
votes
2answers
74 views

Can I get an array as an option argument in bash script

I am writing a shell script and wants to pass multiple options in an argument. Is it possible to do that like using getopts? Requirement example: ./shell.sh -d db1 db2 should pass the values db1 ...
2
votes
2answers
397 views

bash: convert date from to unix timestamp changes timestamp

Running the following command at the xen-servers (either DOM0 or DOMU) at $company gives me a negativ number, on every other system zero (0) (even in my cygwin). date -d "1970-01-01T00:00:00" "+%s" ...
0
votes
0answers
40 views

Configure to enable login in a different shell pass through default shell in SSH

I would like to configure a SSH server in Linux that be enable to login a user in two different shells: one by default and one alternative. I have tried configuring SSH subsystem. I can configure ...
0
votes
0answers
27 views

ForceCommand vs Subsystem

Is there any particula reason why I should use ForceCommand internal-sftp instead of Subsystem sftp iternal-sftp and disabling the shell?
-1
votes
1answer
55 views

understanding the result of this bash script [closed]

I have this simple bash script #!/bin/bash -x for line in `tail /home/user/line` do echo $line done but dont know why it echos all words instead of each line below is output ++ tail ...
-1
votes
4answers
601 views

How to test if two given files are identical?

Just updated the code... I get out everytime on the "else" sequence. You can download the update.sh file from my server. it only contains echo "Hallo update" Updated code (03.11.2015) ...
-5
votes
1answer
62 views

How to password protect a file? [closed]

I have a script called 'Linux.sh'. This script should be executed by every one . it should prompt for password when some one edit it . I have tried by using ' vi -x linux.sh ' to password protect the ...
3
votes
4answers
39 views

Bash evaluation baffling

I'm trying to get a script to do something when one number is bigger than another, in this case, when the system load average exceeds a defined value. All of it is working aside from the evaluation ...
0
votes
1answer
15 views

Nova CLI yields zero output on stderr and stdout

following problem. I got this shell script: #!/bin/sh # Provide log for debugging if [ ! -f /home/some-user/port-control.log ]; then touch /home/some-user/port-control.log chown some-user ...