Intro & Shell Script Question

Joined
Aug 31, 2012
Messages
1
Reaction score
0
Points
1
Hi

I am new 2 macs and have recently started working on some scripts

if [-f /Applications/MyApp.app/Content/Database/File]; then

exit 64
fi

exit 0

Gives me all kinds of errors

Basically I am looking for a file if found exit and return 64

else

just exit

The script is part of an Iceberg installation.

:D
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
You need an else, you're making a conditional here.

Code:
if [-f /Applications/MyApp.app/Content/Database/File]; then
	exit 64
else
	echo 0
fi
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top