How variables can be specified as arguments

Saumen K Dutta skdutta at cs.tamu.edu
Fri Aug 10 08:40:37 AEST 1990


Pardon my ignorance wizards! I am confronted with a very simple
and tricky problem which I am not able to solve. The problem
comes with the following shell script:

--------------------------------------------
#! /bin/sh

read_KEY1() { echo -n "Key => " ; read key;
                         while  [ -z "$key" ]
                        do
                                echo Key cannot be blank , Type again
                                echo -n "Key => " ; read key;
                        done
                        }   
 
 
 
read_KEY1 
echo "The Key is: " $key
------------------------------------------

This will just ask you for the value of key until you type something.

The problem is to pass the string as a parameter and let 
it assign value the user types into it. 

e.g. 

read_KEY1 "key" 

should define a new variable called key and
assigns it's value according to what user types.

I am not able to solve this ! Please help me

-- the dumbo


--
     _                                   ||Internet: skdutta at cssun.tamu.edu  
    (   /_     _ /   --/-/- _            ||Bitnet : skd8107 at tamvenus.bitnet 
   __)_/(_____(_/_(_/_(_(__(_/_______    ||Uucp : uunet!cssun.tamu.edu!skdutta
                                 ..      ||Yellnet: (409) 846-8803



More information about the Comp.unix.wizards mailing list