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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read command into a variable in bourne shell

Status
Not open for further replies.

noiz

IS-IT--Management
Apr 19, 2001
17
US
Hello,

I'm sure this is simple but i can't figure out how to read a command like history into a variable in to a bourne script.
I cann't seem to figure out the man page. perhaps cause its almost midnight..=-)

ie if this was c shell
variable day would have the date command input into it.
set day = `date`
 
Well after a few more fiddling and reading an old book i had if figured it out. Thanks anyway

for any one who might need this in the future

the syntax is: variable=`command`
ie

hist=`history` [note ` is a backward quotation]

zion

<><
=-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top