bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SERIOUS BUG FOUND


From: Chris F.A. Johnson
Subject: Re: SERIOUS BUG FOUND
Date: Sun, 1 Feb 2004 00:02:01 -0500 (EST)

On Sun, 1 Feb 2004, dpblue wrote:

> Hi all.
>
> I'm Brazilian and my english aren't good. I hope that u
> understand me.
>
> I think that i found a serious bug in bash.
>
> i've made this stupid script:
>
> --------------------------------
> #!/bin/bash
>
> if $0 == $1 ; then
>         echo "HELLO"
> fi
> --------------------------------
>
> (i dont know if this sintax are correct)

   The argument to "if" is interpreted as a command. In this case the
   argument, $0, is the name of the script, so the script calls
   itself, then calls itself, then calls itself, then calls itself,
   then calls itself, then calls itself, then calls itself.........
   ad infinitum, ad nauseam......

   What you probably want is:

if [ "$0" = "$1" ]
then
   echo "HELLO"
fi

-- 
        Chris F.A. Johnson
        =================================================================
        cfaj@freeshell.org                      http://cfaj.freeshell.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]