- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Script help
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
тАО11-21-2005 04:56 PM
тАО11-21-2005 04:56 PM
Script help
I want output of both like
testin='ls -a'
output with that command how do that
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2005 05:03 PM
тАО11-21-2005 05:03 PM
Re: Script help
alias testin='ls -a'
testin would now give what 'ls -a' would give.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2005 05:08 PM
тАО11-21-2005 05:08 PM
Re: Script help
testin=`ls -a`
echo $testin >> out.txt
and also i want to include that ls -a command to that file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2005 05:42 PM
тАО11-21-2005 05:42 PM
Re: Script help
Also, you do not need to do echo $testin >> some_file, you need to do as follows.
testin >> some_file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2005 05:51 PM
тАО11-21-2005 05:51 PM
Re: Script help
its not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2005 05:55 PM
тАО11-21-2005 05:55 PM
Re: Script help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2005 06:01 PM
тАО11-21-2005 06:01 PM
Re: Script help
i want to output the 'ls -a' to some file and also will include what command i executed for this output eg:'la -a'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2005 06:06 PM
тАО11-21-2005 06:06 PM
Re: Script help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2005 11:20 PM
тАО11-21-2005 11:20 PM
Re: Script help
Perhaps this is what you want (by example):
# CMD="ls -l /var/tmp";{ echo executing: $CMD;$CMD; } > file
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2005 01:59 AM
тАО11-22-2005 01:59 AM
Re: Script help
echo ├в output from ls ├в a command├в > file.out
testin=$(ls ├в a)
echo $testin >> file.out
in this case $( ) works just like the back tick ` `
Howard