CompuServe Thread

#How input to env. var.?

6 messages in this thread
#84594From: Jan 10, 1993 3:20 PM
Is there any standard way in the CLI from a script having the user input data and store it in an environment variable? The SET/SETENV commands require the string to be stored to be known beforehand and the ASK command only allows input of Y/N. Regards, J0RGEN ….from DENMARK
#84600From: Thomas VoirolJan 10, 1993 4:40 PM
J0RGEN, If you can wait a couple more days/weeks, AskEnv from Bengt Giger may be available to you. I'm in close contact with the author and will upload the new version here as soon as he's got it finished. AskEnv allows you to use most OS2.0 gadgets and requesters from AmigaDOS or ARexx scripts. You can even build your own Window with multiple gadgets in them. I've already done lots of things with AskEnv including a replacement for DAAM. Of course, just reading input from a shell can be done with AskEnv as well (that's the way it started, actually), but having a System (or Arq) requester get the string looks much more elegant! Stay tuned for AskEnv to arrive here! Tom / Amiga Imagineer from Switzerland with AutoPilot engaged
#84663From: Jan 11, 1993 2:13 AM
AskEnv sounds fine, but maybe overkill for my purpose. Actually I already programmed a ReadVar command, which reads a local/global environment variable from user input. It may supplement the AskEnv command as a minimal type command. Regards, J0RGEN
#84737From: Andy FinkelJan 11, 1993 6:47 PM
I usually do something like: echo "Please give your answer " noline set >NIL: answer ? The redirection keeps you from seeing the template; the noline on the echo makes the prompt appear on the same line. The ? tells the set command to take its input from standard input. andy
#85355From: Jan 16, 1993 8:29 PM
Thanks, Andy, but that was a tricky one! However, it works, but entering a CR only will not clear the variable. It will still contain its previous value, so you must remember to issue SET var "" before the SET >NIL: var ? command. Regards, J0RGEN ….from DENMARK
#85691From: Andy FinkelJan 19, 1993 9:10 AM
Or use the UNSET command to remove the previous value. andy