- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Echo and execute a command
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2001 02:00 PM
тАО03-02-2001 02:00 PM
Echo and execute a command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2001 02:04 PM
тАО03-02-2001 02:04 PM
Re: Echo and execute a command
#!/usr/bin/sh
echo date | sh
...Madhu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2001 06:51 PM
тАО03-02-2001 06:51 PM
Re: Echo and execute a command
CMD="vgdisplay -v | grep -i name | grep -iv lv"
echo "$CMD \n\n$(eval $CMD)"
Change the last value from lv to pv:
CMD="vgdisplay -v | grep -i name | grep -iv pv"
echo "$CMD \n\n$(eval $CMD)"
I use this technique to document inventory scripts that report on system components. That way, when someone notices an interesting listing, they don't have to ask "How'd you do that?"
The string of command(s) can contain variables so you can even customize the command, document it and then run it.
BTW: The above 2 command strings do a great job in laying out LVM structures in an easy to read format.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2001 01:31 AM
тАО03-13-2001 01:31 AM
Re: Echo and execute a command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2001 02:08 AM
тАО03-13-2001 02:08 AM
Re: Echo and execute a command
eg 1.
ksh -x
eg 2.
sh -x
This way the command being executed will be printed out first then follow by the actual execution.