Hi I have a bit of c code which I'm trying to use as a relay between apache and a scgi cluster.
Example of problem code is below:
while((n = recv(scgiSock, local_data, MAX_LENGTH, 0)) > 0)
{
time(&t2);
time_now = t2 - t1;
if(time_now > TIMEOUT)
... (2 Replies)
Hi
This will be useful who is looking for checking the files in a directory
#chmod 777 /cronacle/tools/teradata/opo/bin/file_check.sh
SUBJECT=`echo "File Not Found"`
SUBJECT1=`echo "File Found"`
#RECIPIENT=Madhu.Reddy@ge.com
cd /cronacle/tools/teradata/opo/bin
file_list=attach.sh
if
... (3 Replies)
How can I check if a file exists in shell script. Basically, I want to check if a file Test_msgs has been created today. If it has been then append data to it. Otherwise, create it. I have written the following but it does not work.
todaysdate=$(date +%d%m%Y)
timenow=$(date +%H%M%S)... (4 Replies)
Hi,
I'm new to UNIX, at least shell programming and am having trouble figuring out a problem i'm having. In one section in my nested if statement, i want the program to test if the file does not exist, based on an argument supplied at the command line by the user. What i have is
elif ; then... (3 Replies)
How can I check if a file exists in csh? I know there is "-e $file" but do not know exactly how to use it.
I have tried the below but I'm getting "Bad : modifier in $ ( )."
foreach f ($AfullnameLst)
if (-e $f) then
echo "$f: file exists"
endif
end (6 Replies)
Hi Everyone,
I am writing a shell script for the below needs and would like your suggestions and advices.
I have a lot of scripting files(Shell Scripts) under the directory:
/home/risk_dev/dev
I have another directory which has a lot of shell scripts under the directory:
... (2 Replies)
Hi All,
I am facing a problem while checking for existence of file over ssh !
Basically, i want to ssh and check if file exists.. If file exists return 1. If file does not exits return 0 (or any value)
I am using the below code
file_avail=`ssh username@host "if ]; then exit 1;... (10 Replies)
In several scripts that process files matched by name pattern I needed to add a check for file existence. Just to illustrate let's say I need to process all N??? files:
/tmp$ touch N100 N101
/tmp$ l ?10
-rw-rw-r-- 1 moss group 0 Apr 19 11:22 N100
-rw-rw-r-- 1 moss group ... (10 Replies)
Hi,
I am writing the shell script in ksh to check certain no of files exists,In my case there are 7 files exist like below
Sales1_timstamp.csv
Sales2_timstamp.csv
Sales3_timstamp.csv
Sales4_timstamp.csv
Sales5_timstamp.csv
Sales7_timstamp.csv
Sales7_timstamp.csv
Once all the files... (4 Replies)
Discussion started by: SRPR
4 Replies
LEARN ABOUT NETBSD
atf-check
ATF-CHECK(1) BSD General Commands Manual ATF-CHECK(1)NAME
atf-check -- executes a command and analyzes its results
SYNOPSIS
atf-check [-s qual:value] [-o action:arg ...] [-e action:arg ...] [-x] command
atf-check -h
DESCRIPTION
atf-check executes a given command and analyzes its results, including exit code, stdout and stderr.
In the first synopsis form, atf-check will execute the provided command and apply checks specified by arguments. By default it will act as
if it was run with -s exit:0 -o empty -e empty. Multiple checks for the same output channel are allowed and, if specified, their results
will be combined as a logical and (meaning that the output must match all the provided checks).
In the second synopsis form, atf-check will print information about all supported options and their purpose.
The following options are available:
-h Shows a short summary of all available options and their purpose.
-s qual:value Analyzes termination status. Must be one of:
exit:<value> checks that the program exited cleanly and that its exit status is equal to value. The exit code can be omit-
ted altogether, in which case any clean exit is accepted.
ignore ignores the exit check.
signal:<value> checks that the program exited due to a signal and that the signal that terminated it is value. The signal
can be specified both as a number or as a name, or it can also be omitted altogether, in which case any signal
is accepted.
Most of these checkers can be prefixed by the 'not-' string, which effectively reverses the check.
-o action:arg Analyzes standard output. Must be one of:
empty checks that stdout is empty
ignore ignores stdout
file:<path> compares stdout with given file
inline:<value> compares stdout with inline value
match:<regexp> looks for a regular expression in stdout
save:<path> saves stdout to given file
Most of these checkers can be prefixed by the 'not-' string, which effectively reverses the check.
-e action:arg Analyzes standard error (syntax identical to above)
-x Executes command as a shell command line, executing it with the system shell defined by ATF_SHELL in atf-config(1). You
should avoid using this flag if at all possible to prevent shell quoting issues.
EXIT STATUS
atf-check exits 0 on success, and other (unspecified) value on failure.
EXAMPLES
# Exit code 0, nothing on stdout/stderr
atf-check 'true'
# Typical usage if failure is expected
atf-check -s not-exit:0 'false'
# Checking stdout/stderr
echo foobar >expout
atf-check -o file:expout -e inline:"xx yy
"
'echo foobar ; printf "xx yy
" >&2'
# Checking for a crash
atf-check -s signal:sigsegv my_program
# Combined checks
atf-check -o match:foo -o not-match:bar echo foo baz
SEE ALSO atf-config(1), atf(7)BSD June 27, 2010 BSD