Questions tagged [sh]
65 questions
0
votes
1 answer
sh bash script ambiguous redirect pid of file using single quotes
I have the following new line in my .sh file
su --session-command='$javaCommandLine & >>$serviceLogFile 2>&1 & echo \$! >$pidFile' $serviceUser || return 1
When I had it with double quotes it somewhat worked but the pidFile had the wrong pid it was…

SSpoke
- 161
- 2
- 10
0
votes
1 answer
rkhunter warning message /bin/sh
I'm running Ubuntu 10.04.4 LTS with fully update OS. The below messages is from rkhunter, What does it mean? Can anyone please explain.
Warning: The file properties have changed:
File: /bin/sh
Current hash:…

Caterpillar
- 1,132
- 2
- 23
- 47
0
votes
1 answer
update all the servers through one virtual servers using Storage are network virtual machine
Using UBUNTU and Virtal Box by Oracle,
and Using this script to start nginx in Virtual Box, and placing it in Virtual box inside~/init.d
#!/bin/bash
### BEGIN INIT INFO
# Provides: Testinit
# Required-Start:
# Required-Stop:
#…

Vishruth
- 101
0
votes
1 answer
date and other commands no longer working in sh script
I have a shell script that used to run find on Ubuntu 10.04 but since I have moved to 12.04 it doesn't work as before throwing the following messages:
/home/checks.sh: 1: /home/checks.sh: date
: not found
find: invalid mode `0777\r'
the script is…

williamsdb
- 493
- 1
- 8
- 18
0
votes
4 answers
Assigning environment variables for CRON
I have a .sh script that creates a .tar.gz file and transfer's it to a remote server using RSA keys for authentication.
The script will run from terminal but it will not when I try to set it up as a Cron job.
I receive an email from the Cron Daemon…

Ríomhaire
- 103
- 3
0
votes
1 answer
Directory replication in New server
Scenario is to replicate all the directories,sub-directories,files,symbolic links present in Linux development Server to Linux QA Server.
Lot of unix users also to be created.
Consider an unix user - edwprod , there are lot of sub-directories and…
AruM
0
votes
4 answers
stat command filesize reporting on busybox
I'm trying to write a shell script in busybox to check the filesize of a file.
Having read that stat is more reliable then ls, I decided to use that, but somehow when using the following command:
stat -c %s filename
I get the following output:…

datadevil
- 535
- 1
- 7
- 22
0
votes
2 answers
Rewrite sh script for freebsd
I have an sh script:
#!/bin/bash
fullpath="$1"
filename="${fullpath##*/}"
dir="${fullpath:0:${#fullpath} - ${#filename}}"
base="${filename%.[^.]*}"
ext="${filename:${#base} + 1}"
if [ -f $fullpath ]; then
if [ $ext != "mp4" ]; then
…
user82195
0
votes
1 answer
Forking and memory allocation question
I have inherited a Perl script that runs on an EC2 instance which basically crawls a bunch of URL's for data (aka scraping). The way this script is invoked is via a shell script that forks multiple of these perl scripts. There could be hundreds of…

Etienne
- 103
- 3
0
votes
4 answers
How do I rsync an entire folder based on the existence of a specific file type in that folder
I have a server set up that receives movies to a folder. I then serve these movies using DLNA. But in the initial folder where they end up all kind of files end up. Pictures, music, documents etc. I thought I'd fix this by running the following…

inquam
- 179
- 1
- 13
0
votes
0 answers
Shebang = how to verify source/target file mounted via --bind
On a router (busybox) I'm limited to shebang. On devices like these relaying on squashfs and flash storage it's common practice to mount --bind files from USB/CIFS/JFFS onto a file provided by the squashfs (and expanded in RAM).
e.g.
mount --bind…

rs232
- 105
- 1
- 10
0
votes
1 answer
Run sh script as root on Ubuntu every time a user logs-in
I want to run a sh script as root on Ubuntu automatically, every time a user logs in. I tried to place the script in /etc/profile.d The script is being run but is run using the account of the user not as root. Is there any method to achieve this?

Radu M.
- 139
- 6
0
votes
0 answers
Can I use a BASH script for apt-get post update?
Q: Can a post-update / upgrade bash script be executed when performing apt-get? I'm experiencing an error where the post-upgrade/update script is running sh & not bash.
See below for details.
I'm building Debian packages with fpm, e.g.:
fpm -s…

John-H
- 11
- 2
0
votes
3 answers
Error when changing shell of root user in Solaris 10
I can't change my shell for root in Solaris 10. When i change, i can't login again after logout. The error is "no shell".
user33651
0
votes
1 answer
When I run `sudo passwd` I set my password and the script exits okay. Running `sudo chsh -s /bin/bash` immediately after fails
Long time lurker, first time poster.
My linux server is behaving strangely. When I run sudo passwd, I can set my password up correctly. However, if I run sudo chsh -s /bin/bash, the command returns the error:
chsh: PAM: Authentication failure
When…

Alex
- 19
- 3