[HPADM] Run command set in a variable
- From: Edi CAHYADI <edi.cahyadi@xxxxxx>
- Date: Tue, 29 Aug 2006 12:52:44 +0800
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)
- Follow-Ups:
- [HPADM] RE: Run command set in a variable
- From: Edi CAHYADI
- [HPADM] RE: Run command set in a variable
- Prev by Date: [HPADM] SUMMARY: Internal disk on N-class machine
- Next by Date: [HPADM] RE: Run command set in a variable
- Previous by thread: [HPADM] Alternate to Trusted
- Next by thread: [HPADM] RE: Run command set in a variable
- Index(es):