Thread: KSH Script

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    St. Louis, MO
    Posts
    2
    Rep Power
    0

    KSH Script


    Hello,

    I have an issue with the error returned on a simple ksh script.

    What I am doing is the following from a command line:

    if [ `echo $foo` ]
    then
    echo Variable FOO exists
    else
    echo Variable FOO does not exist.
    fi

    This works for the most part other then when foo does not
    exist. If I have unset foo then I get this message when typing
    in the above lines:

    ksh: foo: 0403-041 Parameter not set.
    ksh: foo:: 0403-012 A test command parameter is not valid.
    Variable FOO does not exist.

    Is there a way to NOT receive that message?

    Thanks for any assistance in advance.

    -Burgel
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    St. Louis, MO
    Posts
    2
    Rep Power
    0

    Script


    Hrm,

    ksh -u was on =)

    Nevermind (unless anyone else has other ideas)

    -Burgel

IMN logo majestic logo threadwatch logo seochat tools logo