> On Fri, Jun 08, 2001 at 03:36:37AM +0200, Stipe Tolj wrote:
> -# Add a possible extension (such as ".exe") to src and dst
> +# Check if we need to add an executable extension (such as ".exe")
> +# on specific OS to src and dst
> +if [ -f "$src.exe" ]; then
> + ext=".exe"
> +fi
>
> Can we change that to:
> if [ ! -f "$src" ] && [ -f "$src.exe" ]; then
> or
> if [ ! -f "$src" -a -f "$src.exe" ]; then
> ? Just to be sure....
no, [ ! -f "$src" ] is false even if the file $src does not exist, but
$src.exe does.
Example:
$ ls /usr/local/apache/bin/httpd*
/usr/local/apache/bin/httpd.exe
$ if [ ! -f /usr/local/apache/bin/httpd ]; then echo does not exist;
fi
[nothing]
$ if [ -f /usr/local/apache/bin/httpd ]; then echo does exist; fi
does exists
so we can't check that way.
Stipe
[EMAIL PROTECTED]
-------------------------------------------------------------------
Wapme Systems AG
M�nsterstr. 248
40470 D�sseldorf
Tel: +49-211-74845-0
Fax: +49-211-74845-299
E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are