Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!helios!cs.tamu.edu From: skdutta@cs.tamu.edu (Saumen K Dutta) Newsgroups: comp.unix.wizards Subject: How variables can be specified as arguments Message-ID: <7298@helios.TAMU.EDU> Date: 9 Aug 90 22:40:37 GMT Sender: usenet@helios.TAMU.EDU Distribution: usa Organization: Computer Science Department, Texas A&M University Lines: 43 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@cssun.tamu.edu ( /_ _ / --/-/- _ ||Bitnet : skd8107@tamvenus.bitnet __)_/(_____(_/_(_/_(_(__(_/_______ ||Uucp : uunet!cssun.tamu.edu!skdutta .. ||Yellnet: (409) 846-8803