Changing the value of $? - Help

This is a discussion on Changing the value of $? - Help ; How can I most easily and most safely set the value of $? to non-zero?...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Changing the value of $?

  1. Changing the value of $?

    How can I most easily and most safely set the value of $? to
    non-zero?


  2. Re: Changing the value of $?

    * "Angel Tsankov"
    | How can I most easily and most safely set the value of $? to
    | non-zero?

    man false

    R'

  3. Re: Changing the value of $?

    On 2006-10-18, Angel Tsankov wrote:
    > How can I most easily and most safely set the value of $? to
    > non-zero?


    Run a command that will fail, e.g., any one of:

    false

    [ $1 -eq 2 ]

    [ x = "" ]

    grep '^root:@@@:' /etc/passwd

    find -name a b 2>/dev/null

    --
    Chris F.A. Johnson, author |
    Shell Scripting Recipes: | My code in this post, if any,
    A Problem-Solution Approach | is released under the
    2005, Apress | GNU General Public Licence

+ Reply to Thread