Hi,
I need to check for value not equal (<>) to 21 and not equal empty or null values.
Please modify this script
if
then
echo "$VALUE,$BSC_NAME,$BSC_ID" > $OUT_FILE/power_up.out
end if
TQ (5 Replies)
Hi Masters.....
I have problem !!!
I need to check number of records in a file and if it is zero or file is empty i need to do some task.
if ; then
echo "File s empty"
else
echo "Not empty"
fi
so how to check this condition.
I used wc -l < filename.txt => 1 for zero records
same result... (1 Reply)
I have the list of users in user.log, under each user folder there is sub1 folder is there. i want to check whether sub1 is empty or not, if it is empty i have to skip that user user folder and iterate next user folders. i have the sample code,its not giving not proper results.
while read line... (8 Replies)
I need to check if a directory is empty using an if condition
in the pseudocode below
if ; then
else
although i looked at a few forums on this topic, I left feeling a little unclear and i could not use the command successfully
what can i substitute in the if conditon above,... (2 Replies)
I am reading from a file and executing the jobs with/without parameters as the job requires.
File
job1 R
job2
job3 Y 123
if
then
<job>.ksh
else
<job>.ksh $params
fi
This works fine if the line read from the file has parameters
it executes like job1.ksh R
But for... (2 Replies)
hi,
i want to check whether a a variable contains some value or is empty in a shell script. so if the variable contains some value i want to do some job and if the variable doesnt contain any value then i need to skip that job.
here is a sample script
read_filenames.sh contains
... (5 Replies)
Hi gurus ,
I have two files and i want to perform different action based on the condition if both or either is empty
If
then
Do something
elif
then
do something
elif
then
do something
else
do something
fi
I have tried the below bt its not... (4 Replies)
Hello
So i have that script collection, in which i have a single script to create a configuration file.
In there, i have multiple occourences of something like this:
prj_title=$(tui-read "What is the TITLE? ($prj_name):")
] && prj_title="${prj_name/_/ }"
They all work as expected, if... (5 Replies)
Discussion started by: sea
5 Replies
LEARN ABOUT CENTOS
string::shellquote
ShellQuote(3) User Contributed Perl Documentation ShellQuote(3)NAME
String::ShellQuote - quote strings for passing through the shell
SYNOPSIS
$string = shell_quote @list;
$string = shell_quote_best_effort @list;
$string = shell_comment_quote $string;
DESCRIPTION
This module contains some functions which are useful for quoting strings which are going to pass through the shell or a shell-like object.
shell_quote [string]...
shell_quote quotes strings so they can be passed through the shell. Each string is quoted so that the shell will pass it along as a
single argument and without further interpretation. If no strings are given an empty string is returned.
If any string can't be safely quoted shell_quote will croak.
shell_quote_best_effort [string]...
This is like shell_quote, excpet if the string can't be safely quoted it does the best it can and returns the result, instead of dying.
shell_comment_quote [string]
shell_comment_quote quotes the string so that it can safely be included in a shell-style comment (the current algorithm is that a sharp
character is placed after any newlines in the string).
This routine might be changed to accept multiple string arguments in the future. I haven't done this yet because I'm not sure if the
strings should be joined with blanks ($") or nothing ($,). Cast your vote today! Be sure to justify your answer.
EXAMPLES
$cmd = 'fuser 2>/dev/null ' . shell_quote @files;
@pids = split ' ', `$cmd`;
print CFG "# Configured by: ",
shell_comment_quote($ENV{LOGNAME}), "
";
BUGS
Only Bourne shell quoting is supported. I'd like to add other shells (particularly cmd.exe), but I'm not familiar with them. It would be
a big help if somebody supplied the details.
AUTHOR
Roderick Schertler <roderick@argon.org>
SEE ALSO perl(1).
perl v5.16.3 2010-06-11 ShellQuote(3)