- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script output
Operating System - HP-UX
1753519
Members
4825
Online
108795
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО05-24-2005 03:35 PM
тАО05-24-2005 03:35 PM
Hi!
I have a script, that should make a file with it's output. How to do that?
Not using the following:
./myscript > output.file
Is it possible to add some command that would prescribe to save output of script in some file?
I have a script, that should make a file with it's output. How to do that?
Not using the following:
./myscript > output.file
Is it possible to add some command that would prescribe to save output of script in some file?
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-24-2005 04:19 PM
тАО05-24-2005 04:19 PM
Solution
You can add the following line at the start of myscript
exec > output.file 2>&1
this will redirect stdout and stderr to output.file.
You can also use command called script
$ script output.file
Script started, file is output.file
$ myscript
$ exit
Script done, file is output.file
exec > output.file 2>&1
this will redirect stdout and stderr to output.file.
You can also use command called script
$ script output.file
Script started, file is output.file
$ myscript
$ exit
Script done, file is output.file
- Tags:
- exec
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-24-2005 11:22 PM
тАО05-24-2005 11:22 PM
Re: script output
Hi Igor,
You can use the following:
1. ./script.sh 1>output.log 2>&1
2. nohup sh script.sh
3. nohup script.sh &
4. script output.log #spool output to output.log
./script.sh
exit #end spool
Does this help?
Cheerio,
Renarios
You can use the following:
1. ./script.sh 1>output.log 2>&1
2. nohup sh script.sh
3. nohup script.sh &
4. script output.log #spool output to output.log
./script.sh
exit #end spool
Does this help?
Cheerio,
Renarios
Nothing is more successfull as failure
- Tags:
- Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2005 01:14 AM
тАО05-31-2005 01:14 AM
Re: script output
would you like to use tee command.
./myscript | tee output.file
This would server your purpose but at the same time would display output on stdout too.
./myscript | tee output.file
This would server your purpose but at the same time would display output on stdout too.
- Tags:
- tee
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP