Hi,
My requirement was to check the existence of a file having a specified pattern.The way i tried to achieve this was
if ; then
echo "File found"
fi
an example file having this pattern was 'ilvs_trace01.0124'.
it will vary... (3 Replies)
Hi,
I am trying to check for the existence of a file using the 'test' and the file existence options.
When trying to check for a file with a space in between e.g 'Team List', it gives the following error.
learn1: line 3: test: `Team: binary operator expected
I am pasting my code below as... (7 Replies)
Hi All,
I have a requirement where in i need to check for existence of a file and later execute some pmcmd commands related to informatica. I tried many ways but was unsuccessful could you please throw some light. Below are the sample codes i wrote.
Example 1:
#!/bin/ksh... (4 Replies)
I want to check the files in particular directory are more that 0 Bytes i.e, Non zero byte file. The script should print a msg if all the files in that directory are empty( 0 Byte). (2 Replies)
Hi,
I am trying to check the existence of a file, from a list of possible filenames:
status-A
status-B
status-C
before retrieving the last modified datetime using ls, I want to check it exists or ls will throw an error.
So I have tried this:
if ; then
ls status-*
fi
But the if... (3 Replies)
Hi
Can any body say me the reason for below error
ssh -o 'StrictHostKeyChecking no' user@client ' && print "1"'
I am getting error as "Missing ]":wall: (6 Replies)
Hi am trying to write a script which find the existence of a file from a find command output and perform a task if the file exists. Help me out with the correct syntax . Am trying with the following one but unable to get the output.
if
then <some tasks>
else
echo "file not exists"
fi (5 Replies)
Hi,
I have written a script to validate the data file by referreing to the configurtion file. And moving the validated good records and bad records into HDFS.
Suppose after 15 mins if i receive one more data fie,then after validation the good and bad records shold be stored in hadoop with the... (8 Replies)
Hello,
I have a directory where sometimes appear a certain file name - and I'd like to be notified by email when that happens... so what command or script I may use?
e.g. if there's a file named "adam" in the directory named "dir1" then send a mail to "abc@abc.com".. it needs to permanently... (5 Replies)
Discussion started by: netrom
5 Replies
LEARN ABOUT DEBIAN
get_progname
ERRORMSG(3pub)ERRORMSG(3pub)NAME
errormsg, set_progname, get_progname - printing error messages
SYNOPSIS
#include <errormsg.h>
void errormsg(int exitp, int eno, const char *fmt, ...);
void set_progname(const char *argv0, const char *def);
const char *get_progname(void);
DESCRIPTION
The errormsg function is used for printing error messages. It is a like a combination of fprintf(3) and perror(3), in that it makes it
easy to add arbitrary, printf-like formatted text to the output, and makes it easy to include the system's error message (the error string
corresponding to the eno parameter). Unlike perror, this function does not get the error code directly from errno, thus making it easier
to do something else that might set it before printing out the error message. errormsg also adds the name of the program to the output, if
known.
The first argument to errormsg should be 0 (don't exit program), 1 (exit program with exit(EXIT_FAILURE)) or 2 (with abort()). The second
one should be 0 (don't print system error message), positive (print error message corresponding to the error code), or -1 (print the error
message corresponding to errno).
The set_progname function sets the program name. You need to call this function with at least one non-NULL parameter to get the program
names included in the output. If either argument is non-NULL, it should point at strings that have static duration, i.e. they exist until
the program terminates (or at least until the last error message has been printed); this is so that it is not necessary to create a copy of
the name. (Either or both arguments can also be NULL.)
If the first argument is non-NULL, that is used as the name, otherwise the seconds argument is used. If both are NULL, no program name is
included in the output. The reason for having two arguments is so that the caller doesn't have to do the test, and can just call
set_progname(argv[0], "default_name");
(it is valid for argv[0] to be NULL, under ISO C).
The get_progname function returns a pointer to the current name of the program, as set by set_progname. If get_progname returns NULL, then
no name has been set and none is included in the output. This function is included for completeness, it is not really expected to be use-
ful.
SEE ALSO publib(3)AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi)
ERRORMSG(3pub)