I cannot seem to retrieve a non-zero return code when calling the ftp macro. It doesn't matter what errors are encountered during the ftp macro execution e.g. directory doesn't exist, file doesn't exists etc.
I'd love to know why.
I'm using bash on Solaris.
.netrc file looks like so:
machine myftp1 login xxxxxxxx password xxxxxxxxx macdef getASCIIfiles cd $1 hash prompt off get $2
Executing the following commands
echo "\$ getASCIIfiles Scratch/mydir NON_EXISTANT_FILE.TXT" | ftp -i myftp1 echo $?
produces the following output
Hash mark printing on (8192 bytes/hash mark). Interactive mode on. NON_EXISTANT_FILE.TXT: The system cannot find the file specified. 0
Why is zero being returned?