The sh tag has no wiki summary.
4
votes
2answers
114 views
rsync not removing single quotes around array of strings --filter list
Trying to safely retrieve files from heavily infected Windows XP and 2003 machines that came to us from an acquisition. I have a similar need for automating a script that would run on PXE booted ...
1
vote
1answer
35 views
Multiple spaces in folders and files for rsync backup via /bin/bash /bin/sh
Need a one-time backup of two old messy Windows XP machines because of a company split. Using CentOS 6 x64 minimal install, i mounted some MS Windows NTFS harddrives installed locally via ntfs3g and ...
3
votes
2answers
101 views
`sh` access denied over ssh connection
I have an ubuntu server and a windows XP client running Cygwin. The server ssh's into the client and tries to execute a shell script with some params, with the following command:
ssh user@IP_ADDR 'sh ...
0
votes
1answer
31 views
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: ...
1
vote
0answers
45 views
UDISKS instead of HAL [closed]
Does anybody have some expirence with udisks, because HAL won't be longer supported on the most linux distribution, so I am thinking of to use udisks
for UDI in $(hal-find-by-property --key ...
0
votes
1answer
47 views
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 ...
2
votes
2answers
93 views
how to remove ^m symbol
I need to compile Qt under Debian 64-bit. I downloaded sources but there is ^M symbol everywhere in every file in the end of lines and bash doesnt run configure script. How to remove it from all files ...
1
vote
1answer
416 views
Run .sh (no service) file on startup
How to execute a script once at startup time on CentOS 6.3? I added file with following containment
#chkconfig: 2345 95 20
#description: Some description
sh /opt/somePath/my.sh
into /etc/ini.d and ...
0
votes
4answers
118 views
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 ...
2
votes
0answers
390 views
How do I enable XRandR in Xvfb or disable it in firefox when running firefox headless?
I am trying to start firefox headless. The following is the beginning of the shell script that starts it:
#!/bin/sh
Xvfb :99 >/dev/null 2>&1 &
XVFB=$!
sleep 3
firefox --display=:99 ...
0
votes
3answers
123 views
SH conditional redirection [closed]
I want to be able to redirect some output of my script to /dev/null based on a command line switch.
I don't know how should I do it.
In a silly way, it would be something like this (in a too ...
1
vote
4answers
110 views
How to execute shell scrips without creating files
How is it possible to execute a shell script without creating a file? For example assume I have the following script (testscript):
#!/bin/bash
function run_free() {
free -m
}
run_free
I then of ...
1
vote
1answer
51 views
Does the sh command use the users shell
Does the sh linux command use the users current shell, even if its not bash? For example, let's say the user bob is running csh. If I create a script with functions and csh and try and execute it ...
1
vote
2answers
199 views
PHP, SSH2, and Bash Scripts not getting along
I am using the SSH2 library in my PHP to execute a SH script on a remote server. When I run it manually on SSH, it works just fine. However, when I try to run it through PHP, the script starts, but ...
1
vote
3answers
256 views
FreeBSD rc.d script doesn't work when starting up
I am trying to write a rc.d script to startup the fastcgi-mono-server4 on FreeBSD when the computer starts up - in order to run it with nginx.
The script works when I execute it while being logged in ...
3
votes
3answers
472 views
How do I get ssh to run in the background without using -f?
I'm attempting to create an ssh tunnel, spin it off into a background process, and write a pid file which I can later use to kill it. I CAN run ssh with -f, but then I don't have a handle on its PID.
...
0
votes
1answer
72 views
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 ...
0
votes
3answers
390 views
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:
...
8
votes
3answers
412 views
FreeBSD 8.2, deleted /bin/sh, can't boot
I made a really bad decision on one of my servers.
I deleted /bin/sh. I restarted the server and the server won't run because it needs /bin/sh to start the rc scripts. I can't access single user mode ...
8
votes
1answer
280 views
can't type lower cased e in amazon ec2 (Amazon Linux)
After a few days of operation on my new ec2 build, the following happens:
I log into SSH, everything is fine, I do my coding
I return the next day, and log into SSH
I cannot type a lower cased e ...
1
vote
2answers
131 views
Is there a way for me to simplify this subversion pre-commit hook?
Is there a way for me to simplify this pre-commit hook? It seems a bit much to me
#!/bin/sh
message=`$SVNLOOK log -t "$TXN" "$REPOS"`
# Block any commits which don't reference a ticket
if echo ...
0
votes
2answers
155 views
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 ...
0
votes
1answer
273 views
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 ...
1
vote
2answers
401 views
executing a sh script from the cron
I have a test.sh script
#!/bin/sh
php /home/v/file.php
sh /root/x/some.sh
when I execute the file as root from command line it works.
sh /home/v/test.sh
when I set it to crontab -e (is the root ...
2
votes
1answer
726 views
Freebsd: How to change default shell?
The default shell in freebsd is SH and I really can't stand it: autocomplete is very limited, and rehash commands kill me. I feel like a one armed and one legged man...
How can I change the shell ...
0
votes
4answers
197 views
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 ...
0
votes
3answers
337 views
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".
2
votes
1answer
417 views
Cron Permission Denied
good day,
I have a bash script in my home directory that works properly from the command line (file structure is default media temple DV. < noted for certain permission issues) but receive this ...
3
votes
1answer
2k views
AIX update environment after .profile change
I am running AIX 5.3. I have made changes to a user's .profile file (added a couple of environment variables).
Is there a command that I can use to re-process the .profile file for a particular ...