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
0answers
11 views

script to scan through all the users' home directories and purge .log or .txt files not used in past “n” days

I need to write one korn shell script to scan through all the users' home directories and purge .log or .txt files that have not been modified in past "n" days for . If it can display top 20 users ...
0
votes
1answer
19 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 reult into the actual nginx.conf, ...
0
votes
0answers
11 views

PHP exec() pkill works but not kill, why? [closed]

When making a PHP script for a website to kill a process, this works to kill all processes with that name... <?PHP exec ("pkill linuxjampded"); ?> But killing them via a specific port ...
-6
votes
1answer
28 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
22 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
14 views

I need to convert system log file into xml or readable form

I need to convert system log file (start -> administrative tool -> event viwer) into readable form like .xml. how can i did this via command prompt.. I did this using PowerShell by this command ...
0
votes
0answers
32 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
31 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
33 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 ...
0
votes
0answers
2 views

$PATH variable on Fish Shell OS X [migrated]

I have somehow screwed up my path variables with Fish shell on OS X. Is this the proper $PATH variable in the config.fish? Thanks! user@host ~> more ~/.config/fish/config.fish set -g -x PATH ...
1
vote
0answers
37 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
53 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
57 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
120 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
44 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
43 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
63 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
95 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
40 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
102 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
0
votes
1answer
219 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
40 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
297 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
54 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
91 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
38 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
245 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
43 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
145 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
28 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
65 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
238 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
31 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
23 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
53 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
344 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
57 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
35 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
13 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 ...
1
vote
0answers
57 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 ...
0
votes
0answers
32 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
18 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
580 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 ...
1
vote
0answers
89 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
26 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
54 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 like ...
2
votes
0answers
134 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
66 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
34 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
46 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 ...