The tag has no wiki summary.

learn more… | top users | synonyms

-3
votes
1answer
44 views

How can I execute sibling scripts outside the directory? [closed]

$ ls -l bin/ $ ls bin/ startup.sh shutdown.sh I wrote a script named restart.sh inside the bin/ looks like #!/bin/sh sh ./shutdown.sh sh ./startup.sh Now the bin/ directory looks like this. $ ls ...
1
vote
2answers
96 views

script to count the occurence of the particular string in the given time interval

We are trying to write a script "sendemail.sh" to count the number of occurrence of a particular string in a log file "SendEmail.log" within the given interval. We have a log file. In that we are ...
0
votes
0answers
77 views

Trying to create a pre-revprop-change for editing message on commit

I'm trying to add a hook to svn so that you can edit messages on commits. But whatever I do I get the same error message. Revprop change blocked by pre-revprop-change hook (exit code 255) with ...
-4
votes
1answer
62 views

Killing a bash sh script [closed]

I made an .sh file load.sh which has (almost) unlimited loop of curl requests. I run this as $ bash load.sh. Now it just keeps running the loop. I can't cancel its execution. It keeps running. I ...
0
votes
2answers
377 views

running a remote shell script that switches to a user does not return to the issuing local server shell

When I run a script such as this: ssh -t root@10.10.10.10 '/tmp/somescript.sh' where the script is defined as: #!/bin/sh mkdir -p /data/workday/cred chown -R myuser:myuser /data su myuser - # ...
0
votes
2answers
93 views

Why does system lag or stall after successful completion of tar backup command?

I have a script that runs backup of system files via tar as a cronjob for my server. Every time the script is being fired off, it completed the task as successful. All backups were tested and appeared ...
0
votes
1answer
643 views

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 ...
0
votes
1answer
62 views

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: ...
3
votes
3answers
107 views

How can a sh script determine if it was started as a cron job as opposed to interactive or background?

I'd like to use the same scripting for cron and interactive, just wondering if there was a universal way over UNIX/Linux systems to easily make this determination.
-1
votes
1answer
57 views

Host command reverse result [closed]

For example I do in Linux using host command: host yy.yyy.yy.y Result: Host z.zzz.zz.z.in-addr.arpa. not found: 3(NXDOMAIN) Then I repeat host command in a reverse with z.zzz.zz.z than I got a ...
-1
votes
2answers
228 views

run ntpdate from rc.local [closed]

My /etc/rc.local is: #!/bin/sh touch /var/lock/subsys/local /data/automatic/ntpdate.sh My /data/automatic/ntpdate.sh is: #!/bin/sh echo "RWQERWER" >> /data/logs/1.log ntpdate ...
4
votes
2answers
591 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
126 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
132 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
36 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: ...
0
votes
1answer
57 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
136 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
1k 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
160 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 ...
3
votes
0answers
1k 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
276 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
137 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
71 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
391 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
601 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
1k 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
80 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
830 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
804 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
318 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
152 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
216 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
415 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
1k 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
2k 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
239 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
533 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
477 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
3k 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 ...