Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assigning Output from command to variable

Status
Not open for further replies.

bigdog175

IS-IT--Management
Nov 7, 2000
41
US
This is the first time I have ever written a sh script in "sh" on a sco box. I am trying to assign the output of a command to a variable. The command I'm use to using (variable = $(command)) doesn't seem to work on SCO 5.0.4. Thanks for any help in advance.
 
big,
put your command in single backquotes, example:
i=`who am i`
echo $i

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top