10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I'm trying to run a program from the bash prompt and I don't understand why it is returning with an error.
Dig is my C program, and it takes in parameters J4, detect, 3 and 0182F98E
var1="cygdrive/c/2i/test fixture/software/mccdaqtest/debug/Dig J4 detect 3 0182F98E"
when I do
... (6 Replies)
Discussion started by: oahmad
6 Replies
2. Shell Programming and Scripting
Hi,
I am running a schedular script which will check for a specific time and do the job. I wanted to run this continuously. Meaning even after the if condition is true and it executes the job, it should start running again non stop.
I am using below script
#!/bin/sh
start:
while true
do... (10 Replies)
Discussion started by: sandeepcm
10 Replies
3. Shell Programming and Scripting
Hi guys,
been scratching round the forums and my mountain of resources.
Maybe I havn't read deep enough
My question is not how sed edits a stream and outputs it to a file, rather something like this below:
I have a .txt with some text in it :rolleyes:
abc:123:xyz
123:abc:987... (7 Replies)
Discussion started by: the0nion
7 Replies
4. UNIX for Dummies Questions & Answers
Hey all,
I'm trying to execute a program and despite it appearing to be there, I keep getting this:
-bash: ./aisdispatcher: No such file or directoryTo run it, I'm going into the directory where it is stored and running
./aisdispatcher...the result of which should just be a listing of options... (10 Replies)
Discussion started by: pmd006
10 Replies
5. UNIX for Dummies Questions & Answers
Hey guys, so I've been trying to write a bash script called runSorter.sh that runs an executable that also takes in some parameters and outputs the results to a text file. The executable, sorter, takes in a number parameter. I want to make it so that you can input as many number parameters into... (4 Replies)
Discussion started by: Duo11
4 Replies
6. Shell Programming and Scripting
I have this "process keepalive" script:
#!/bin/bash
PIDFILE=/tmp/php.pid
PHPSCRIPT=/home/www/mydomain.com/subdomains/www/parser.php
echo 'Checking php process from PID file'
if ; then
PID=`cat $PIDFILE`
if ps ax | grep -v grep | grep $PID > /dev/null
then
echo "php process still... (4 Replies)
Discussion started by: LukasB
4 Replies
7. Shell Programming and Scripting
Hi there,
I have written a script to check daily process,
each script is in a different directory.
Now the first process is running fine, when it goes to the next directory the process doesn't executes.
cd result/logs
ref=month_1888.log
echo $ref>> $logfile
cd /max/tot/first... (3 Replies)
Discussion started by: NehaKrish
3 Replies
8. UNIX for Dummies Questions & Answers
hi
i have file extentioned with test.vbs. i am able to run this file n execute through command promt but i dont know how to run in shell script
example:
file name is test.vbs which contains
strSoundFile = "C:\windows\Media\Notify.wav"
Set objShell = CreateObject("Wscript.Shell")
strCommand... (5 Replies)
Discussion started by: atl@mav
5 Replies
9. Shell Programming and Scripting
Hi
I have a script, which i ran in background, can someone please help in stopping this.
i gave this command:
ksh abc.ksh &
this script sends me a mail every 30 seconds. i have deleted the script but still i am getting the mails. can some one please help me stopping dese.
... (3 Replies)
Discussion started by: Prateek007
3 Replies
10. Programming
I've created a c program and compiled it with gcc, in unix.
The file name is abc.c and it is run by typing the command ./abc
I have another program which creates a child process, and I need this abc program to run on that child process. I've tried execvp(), but it doesn't work.
How can I run... (2 Replies)
Discussion started by: sdsd
2 Replies
Control(3pm) User Contributed Perl Documentation Control(3pm)
NAME
App::Control - Perl module for apachectl style control of another script or executable
SYNOPSIS
use App::Control;
my $ctl = App::Control->new(
EXEC => $exec,
ARGS => @args,
PIDFILE => $pidfile,
SLEEP => 1,
VERBOSE => 1,
);
my $pid = $ctl->pid;
if ( $ctl->running )
{
print "$pid is running
";
}
else
{
print "$pid is not running
";
}
# or alternatively ...
print $ctl->status;
$ctl->start;
# or alternatively ...
$ctl->cmd( 'start' );
$ctl->stop;
$ctl->hup;
$ctl->restart;
DESCRIPTION
App::Control is a simple module to replicate the kind of functionality you get with apachectl to control apache, but for any script or exe-
cutable. There is a very simple OO interface, where the constructor is used to specify the executable, command line arguments, and pidfile,
and various methods (start, stop, etc.) are used to control the executable in the obvious way.
The module is intended to be used in a simple wrapper control script. Currently the module does a fork and exec to start the executable,
and sets the signal handler for SIGCHLD to 'IGNORE' to avoid zombie processes.
CONSTRUCTOR
The constructor is called with a hash of options in the standard way. The options are as follows:
EXEC
Path to the executable to be controlled. This option is REQUIRED.
ARGS
Command line arguments for the executable. This option is OPTIONAL, but if set, should be an ARRAY reference.
PIDFILE
Path to the pidfile for the executable. This need not exists, but the constructor will die if it thinks it can't create it. If the path
where the pidfile lives doesn't exist the constructor will try to create it. This option is REQUIRED.
IGNOREFILE
The ignore file allows you to temporarily disable the control functionality. Suppose you have a chkdaemon / crontab entry that restarts a
service; specifying an IGNOREFILE means that you can disable this wihtout having to edit the relevant config files.
CREATE_PIDFILE
By default, App::Control depends on the application to manage the pid file. This is consistent will analogous utilities (apachectl, chk-
daemon, etc.), but if you would like App::Control to create and remove pid files for you, then set this option to a true value.
SLEEP
Number of seconds to sleep before checking that the process has been started. If the start fails, the control script will loop with a
SLEEP delay per iteration until it has (see <"LOOP">). Default is 1 second.
head2 LOOP
Number of times to loop before giving up on starting the process.
VERBOSE
If set to a true value, the module will output verbose messages to STDERR.
METHODS
start
Start the executable specified in the constructor. This method waits until it is convinced that the executable has started. It then writes
the new pid to the pidfile.
stop
Stop the executable specified in the constructor. It assumes that the pid listed in the pidfile specified in the constructor is the process
to kill. This method waits until it is convinced that the executable has stopped.
hup
Send a SIGHUP to the executable.
restart
Basically; stop if running, and then start.
status
Returns a status message along the lines of "$exec ($pid) is / is not running".
cmd
All of the above methods can also be invoked using cmd; i.e.:
$ctl->start;
is equivilent to:
$ctl->cmd( 'start' );
give or take a call to AUTOLOAD!
pid
Returns the current value of the pid in the pidfile.
running
returns true if the pid in the pidfile is running.
AUTHOR
Ave Wrigley <Ave.Wrigley@itn.co.uk>
COPYRIGHT
Copyright (c) 2001 Ave Wrigley. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same
terms as Perl itself.
perl v5.8.8 2003-08-27 Control(3pm)