[HPADM] Run command set in a variable



Hi All,

We can set a command in a variable, for example:
# cmd=mount
Or
# cmd="ps -ef | grep root"
And
Run it:
# $cmd

But don’t know why the following variable setting has error when run:
# cmd="mount | grep /app"
# $cmd
usage: mount [-l][-v|-p]
mount [-F FStype][-eQ] -a
mount [-F FStype][-eQrV][-o specific_options]
{ special | directory }
mount [-F FStype][-eQrV][-o specific_options]
special directory

# cmd="for x in 1 2 3; do echo $x; done"
# $cmd
sh: for: not found.

Can anybody help?

Regards,
Edi


--
---> Please post QUESTIONS and SUMMARIES only!! <---
To subscribe/unsubscribe to this list, contact majordomo@xxxxxxxxxxxxx
Name: hpux-admin@xxxxxxxxxxxxx Owner: owner-hpux-admin@xxxxxxxxxxxxx

Archives: ftp.dutchworks.nl:/pub/digests/hpux-admin (FTP, browse only)
http://www.dutchworks.nl/htbin/hpsysadmin (Web, browse & search)