input as a variable... answers

input as a variable... answers

Post by Jesse Civ » Thu, 19 May 1994 22:53:46

Hi, I recently asked how to make user defined variables, and decided to
post some of the responses in case anyone is interested.

This is for C shell.  Bourne, Korn and bash use 'read'  i.e
$ read i
$ echo $i

echo -n "enter input : "
set in = $<
echo $in

^^^ this one was the most common response.
Thanks to everyone who responded,
Jesse Civan


1. File input to variable input

I have a command (it happens to be mutt) that is reading input from a file

mutt -a file -s "subject" root < /somedir/messagefile

(this may not be exactly correct but basically you get the idea)

Currently the message for the email body is read from the messagefile is
there a way to replace the "< /somedir/messagefile" with "< $somevar" so
that the file gets the input from the variable and I don't have to use a
file?.  I am using the Korn shell.

Jonathan Leckie -- remove the z (if there is one, in my email address to
reply to me)

2. Dual boot 7.3 w/XP

3. variable output/variable input

4. WTMP record

5. Input variables in UNIX aliases

6. Capture Child PID

7. Grepping for inputted variables

8. How can I untar several tar files at one go?

9. using ksh to get kbd input into a variable???

10. Uppercasing input variable

11. Setting variables in a variable array of null variables

12. Translation - Input from a variable and a file

13. multiple arguments from script input line into one variable, in csh