10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I need to check a file whether it exists and also whether it is empty or not. I have a code for this but it is not working as per my requirement. Can anyone pls suggest me on this.
function funcFLSanityCheck
{
if
then
echo "${varFLSentFileListPath}/${varFLSentFileName}... (7 Replies)
Discussion started by: Arun1992
7 Replies
2. Shell Programming and Scripting
Hi,
I am using KSH.
I am trying to check if the output file is empty or not.
I tried with ] but what i see is my file is empty but still manages to have a size of 1 instead of 0.
But my file doesnot have anything its empty.
I am not sure how to check this.
can any one help? (10 Replies)
Discussion started by: Sharma331
10 Replies
3. Shell Programming and Scripting
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)
Discussion started by: r_t_1601
4 Replies
4. UNIX for Dummies Questions & Answers
Hello again!
I have some trouble with scripting in bash.
In the following script I read from a folder with the files
line0_Ux.xy
line1_Ux.xy
line2_Ux.xy
.
.
.
Some of the files are empty. For those I would like to print a "0" in list.
I think the problem with the code is that... (4 Replies)
Discussion started by: bjoern456
4 Replies
5. Shell Programming and Scripting
CMD=$(find "${Release_Container}" -iname "${Release_Name}"_Release.txt)
for i in `cat $CMD`
do
if ];then
cd ${Sandbox_dir}
CMD1=$(find "${Sandbox_dir}"/* -iname "${Release_Name}" -type d | awk -F/ '{print $(NF)}' | head -1 )
if ];then
echo -e "################### CHECKOUT START... (2 Replies)
Discussion started by: anuragpgtgerman
2 Replies
6. Shell Programming and Scripting
I am running a C shell script. I have an output file from a previous step and I need to run "something" in the next step to check if the file is empty. If the file is empty, then the job script should finish EOJ. If the file is not empty then the job script should abend.
Please help
Thanks. (4 Replies)
Discussion started by: jclanc8
4 Replies
7. Shell Programming and Scripting
How do I check if a file is empty in a sh script
I want to test in my shell script if the output file is empty and if it is do one thing and if it isnt empty do another?
any ideas? (8 Replies)
Discussion started by: stolz
8 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
I am new to unix worldd .
I need to check a file1 if its empty or not.
If its empty then return a non zero value say 99
could you pls let me know the perl script for this. (2 Replies)
Discussion started by: mavesum
2 Replies
9. UNIX for Dummies Questions & Answers
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)
Discussion started by: shreekrishnagd
1 Replies
10. UNIX for Dummies Questions & Answers
Hi,
May I know how to check for empty file in Perl.
Iam missing something, somewhere.
#!/usr/bin/perl
my $open_dir = '/path/';
my $file;
my $ma = "abc_.*.\.psv\$"
opendir(VAR, $open_dir) or die "Can't open $oepn_dir: $!\n";
while( defined ($file = readdir VAR) ) #read all... (1 Reply)
Discussion started by: deepakwins
1 Replies