On Thu, 2004-08-19 at 08:21, Voytek Eymont wrote:
> I want to check if two files exists, if so, run awstats, how do I put an
> 'and', and, is that the way to check it ?

With differing portability and robustness:

1)
if [ -s "$A" -a -s "$B" ]
then
  action --file-a "$A" --file-b "$B"
fi

2)
if [ -s "$A" ] && [ -s "$B" ]
then
  action --file-a "$A" --file-b "$B"
fi

3)
[ -s "$A" ] && [ -s "$B" ] && action

4)
action --file-a "$A" --file-b "$B"

and just let the command fail when the missing file fails to open().


-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to