Hi AM using unix Aix Ksh
I need to clarify regarding sending the zero size file to another server.
VAL=ftp.sh -c put souce_file Dest_file $1 $2 $3 $4 $5
$VAL 2 > $ERR
When am Sending the Zero Size File getting alerts netout write returned Zero.
But i would like to know $VAL variable what error code or what value is present in $VAL variable when Sending the Zero Size File ?
If any one knows tell me tanks in advance...
Its a warning message you receive when you transfer the 0 byte file via ftp.
If you want to redirect it use 2> /dev/null in your ftp.sh script
If i am not wrong it will return status code as 0 as its just a warning message. For more information you have to read through write system call and see how fd behaves
Thanks Vidyadhar ..
The status code is not 0 , its return some other value .
$VAL 2 > $ERR
if [ $VAL -ne 0 ]
then
echo "FTP failure"
else
echo "FTP SUCCESS'
fi
when i run this am getting FTP Failure. want to know $VAL value ret code ?
Cant you echo it before checking?
I seem to recall a thread about this before...
How is this an error? You're writing a 0-byte file, and it complains that 0 bytes are written... which is exactly what you wanted, so nothing to worry about apparently.
This is not how you check the return code of something, the $? variable holds the return code.