Hi,
As in scripting , some cd commands getting failed, so we do check the exist status as 0 or 1. But every time we call to function for it. But does any single line exist will do the job with || , && ? i.e
as Logss is not exist , Before printing "hi" we have to exit with some friendly output i.e "directory is not exist"
Hi,
We have a text file which has the following data.
ISA~00~ ~00~ ~ZZ~VISTN ~ZZ~U1CAD ~051227~183
7~U~00200~000011258~0~P~<
GS~FA~EE05J~U1CAD~051227~1831~000011258~X~002002
ST~997~0001
AK1~SH~247
AK2~856~2470001
AK5~A
AK2~856~2470002
AK5~A... (3 Replies)
Hi folks,
I wrote a ksh program which run scripts from remote server.
To check the status code I wrote the following function:
check_remote_status()
{
status_code=`tail -1 $installLog`
if ] ; then
echo $errMsg | tee -a $installLog
exit 1
else
echo $validMsg >> $installLog
fi... (9 Replies)
I have the below script to check whether directory is exist or not , now I sure the directory /abc NOT exist , but when run the script , it still pop the result is "the directory exist" , could suggest what is wrong ? thx
ll -d /abc > /dev/null 2>&1
if
then
echo "the directory exist !!"
... (7 Replies)
I am working on an Linux based application where I am using lp -onobanner -s -d$RPTDEST command to print the file on desired printer. Variable $RPTDEST could be different each time even for the same user. I need to implent the check if last print command was succesful or not, so that application... (3 Replies)
Hi,
How to check the status of tar command using bash script ?
I have the following tar command, how to check the status of the tar?
tar -cjf $today.tar.bz2 /opt/data
Regards,
Eye Gee (1 Reply)
Hi,
I created following script to check if file exist:
#!/bin/bash
SrcDir=$1
SrcFileName=$2
SrcTimePeriod=$3
if ;then
echo 1
else
echo 0
fi
I ran it like: /apps/Scripts/FileExist.sh /apps/Inbox file1 2nd_period_2010
Even file exist at that location, my above command is... (4 Replies)
Hi All,
I have a parent shell script A and a child shell script B.
1). If a command i.e a mysqdump fails in shell script B fails then I trap the error with this code
if ]
then func_exit "Failed to export the cleaned DB1.${MYDBNAME} database to the ${MYARCHIVEDIR} directory"... (1 Reply)
Hi,
i am a novice in scrpting and need your help on the following. i have a script that checks if a file exists:
if ; then
echo " Files exists"
else
echo " file not found"
fi
assuming the files does not exist ,, the script when run dusplays " file not found".. so far true. but when i... (2 Replies)
How do i check success status of a sed command execution i have the below script not sure if it is right approach to check status of execution using a function.
Also it looks like in the below sed command even if the search string doesn't exist in the file it is returning status as success as i... (6 Replies)
Geeks,
Could you please help me out in my script and identify the missing piece. I need to check/get the exit status of a remote command executed on remote host through script and send out an email when process/processes is/are not running on any/all server(s).
Here's the complete... (5 Replies)
Discussion started by: lovesaikrishna
5 Replies
LEARN ABOUT LINUX
stopped
stopped(7) Miscellaneous Information Manual stopped(7)NAME
stopped - event signalling that a job has stopped
SYNOPSIS
stopped JOB=JOB INSTANCE=INSTANCE RESULT=RESULT [PROCESS=PROCESS] [EXIT_STATUS=STATUS] [EXIT_SIGNAL=SIGNAL] [ENV]...
DESCRIPTION
The stopped event is generated by the Upstart init(8) daemon when an instance of a job has stopped. The JOB environment variable contains
the job name, and the INSTANCE environment variable contains the instance name which will be empty for single-instance jobs.
If the job was stopped normally, the RESULT environment variable will be ok, otherwise if the job was stopped because it has failed it will
be failed.
When the job has failed, the process that failed will be given in the PROCESS environment variable. This may be pre-start, post-start,
main, pre-stop or post-stop; it may also be the special value respawn to indicate that the job was stopped because it hit the respawn
limit.
Finally in the case of a failed job, one of either EXIT_STATUS or EXIT_SIGNAL may be given to indicate the cause of the stop. Either
EXIT_STATUS will contain the exit status code of the process, or EXIT_SIGNAL will contain the name of the signal that the process received.
The normal exit job configuration stanza can be used to prevent particular exit status values or signals resulting in a failed job, see
init(5) for more information.
If neither EXIT_STATUS or EXIT_SIGNAL is given for a failed process, it is because the process failed to spawn (for example, file not
found). See the system logs for the error.
init(8) emits this event as an informational signal, services and tasks started or stopped by this event will do so in parallel with other
activity. It is typically combined with the starting(7) event by services when inserting themselves as a dependency.
Job configuration files may use the export stanza to export environment variables from their own environment into the stopped event. See
init(5) for more details.
EXAMPLE
A service that wishes to be running whenever another service would be running, started before and stopped after it, might use:
start on starting apache
stop on stopped apache
A task that must be run after another task or service has been stopped might use:
start on stopped postgresql
SEE ALSO starting(7)started(7)stopping(7)init(5)Upstart 2009-07-09 stopped(7)