tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ Directing output to a file from rsh command

Ma a shell TSR in memory ▻

sh: boolean value?

In article <37E818DA.FD31E5D3@geocities.com>,
* Tong *  <sun_tong@geocities.com> wrote:
>b=0
>if [ $b ] ; then echo b is true! ; fi

Old-timers use `case': it's always been a shell builtin.

    b=0
    ...
    case $b in
    0)
        echo b is still zero
        ;;
    *)
        echo b is no longer zero
        ;;
    esac

Tim.
--
Tim Goodwin   | "[ `static' ] is so overloaded in the C/C++ world that
Leicester, UK | I try to avoid it whenever I can't." -- Larry Wall

Original headers:

From: tjg@star.le.ac.uk (Tim Goodwin)
Newsgroups: comp.unix.questions,comp.unix.shell
Subject: Re: sh: boolean value?
Date: 22 Sep 1999 11:45:44 +0100
Organization: University of Leicester, UK
Message-ID: <7sac1e$gc5$1@ltpcg.star.le.ac.uk>
References: <37E818DA.FD31E5D3@geocities.com>

△ comp.unix.shell △

◅ Directing output to a file from rsh command

Ma a shell TSR in memory ▻