Mar 13, 2003 #1 jawon Programmer Feb 6, 2003 31 US When I do a korn shell script... if [-f filea] then echo "it exists" fi I get... [-f: not found Seems straightforward, but what are the possible reasons for the error?
When I do a korn shell script... if [-f filea] then echo "it exists" fi I get... [-f: not found Seems straightforward, but what are the possible reasons for the error?
Mar 13, 2003 #2 SamBones Programmer Aug 8, 2002 3,186 US Put a space between the "[" and the "-f". The shell is seeing "[-f" as a single token. Hope this helps. Upvote 0 Downvote
Put a space between the "[" and the "-f". The shell is seeing "[-f" as a single token. Hope this helps.
Mar 13, 2003 #3 SamBones Programmer Aug 8, 2002 3,186 US Also put a space between [tt]filea[/tt] and the final [tt]][/tt]. Upvote 0 Downvote
Mar 14, 2003 #4 iribach Technical User Oct 12, 2002 211 CH my way: [ -f filea ] && echo filea exists Upvote 0 Downvote