[SATLUG] small script, baffled problem.

travis+ml-satlug at subspacefield.org travis+ml-satlug at subspacefield.org
Wed Aug 11 16:33:16 CDT 2010


On Wed, Aug 11, 2010 at 04:26:57PM -0500, Richard Suberg wrote:
> curlftpfs 205.145.4.35 /remote -o allow_other,user=user:pass  -v
> echo exit=$?
> if  $?=0   then 

Try:

if curlftpfs ...
then
	...
else
	echo Error mounting!
fi

Or:

curftpfs ...
if [ $? == whatever ]
then
	...

Or:

curftpfs ...
if test $? == whatever
then
	...

Problem was that you forgot that the "if" clause is a program, not a conditional.
"test" is a program - actually a program and a shell builtin, but that doesn't matter.

BTW, then can't be on same line unless you use semicolon before it.
-- 
A Weapon of Mass Construction
My emails do not have attachments; it's a digital signature that your mail
program doesn't understand. | http://www.subspacefield.org/~travis/ 
If you are a spammer, please email john at subspacefield.org to get blacklisted.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
Url : http://www.satlug.org/pipermail/satlug/attachments/20100811/bb491d8d/attachment.bin


More information about the SATLUG mailing list