On Tue, 2003-11-04 at 10:28, Jan Schmidt wrote:
> <quote who="[EMAIL PROTECTED]">
> 
> > your questioin was nowhere near as dumb as mine,
> > talking about dumb questions, what do I use to replace 'IF EXIST" in a BAT
> > file's:
> > 
> > IF EXIST something DEL something
> 
> in sh: 
> 
> if [ -x "$FILE" ]; then
>   rm $FILE
> fi

The if bit is easy enough - or check the syntax of how to use if with
"help if".  In case you're wondering, the help command is built in (to
bash, at least) and gives help on shell commands that there aren't any
manpages for.

The "-x" means "if $FILE exists and is executable".  I always get stuck
and forget what those conditionals mean.  The bash manpage has a
complete list of them - man bash and search for "CONDITIONAL
EXPRESSIONS".

-- 
Pete

-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to