Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004

    Unanswered: command set does not work!

    Hi all,

    I am trying to set an variable within the shell file, however it does not take the set. I can only set the variable in the prompt instead.


    echo "set ONE=1"

    output file:
    Content in
    set ONE=1

    $echo $ONE
    ONE: Underfined variable

    Anyone knows why is not working? How to make it work within the script.


  2. #2
    Join Date
    Jul 2003

    Re: command set does not work!

    I'm not sure what you're wanting. It seems that you run a script and test whether the environment variable is set after the script runs. This will not work - the envrionment variable has been set in a subshell.

    Check out the source command or . (period) to execute commands which are contained within a script in the current shell.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts