- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Keeping errors in a error file
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
тАО02-23-2010 11:04 AM
тАО02-23-2010 11:04 AM
$ prueba
find: cannot stat /prodftp
find: cannot stat /rutaprueba
i want to keep these errors in a file called errors.txt, but they are not being kept :( as follows:
$ prueba 2>>/home/errors.txt
cat /home/errors.txt
"nothing, i thought i would see find: cannot..."
what do i have to do?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-23-2010 11:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-23-2010 12:02 PM
тАО02-23-2010 12:02 PM
Re: Keeping errors in a error file
Redirect standard error.
2>&1
Try:
2>filename
Play around a bit on the command line.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-24-2010 12:41 AM
тАО02-24-2010 12:41 AM
Re: Keeping errors in a error file
it depend if the message you see online is written by the command (i presume find) on stdout or on stderr. type man command to understand this.
Best way is to redirect stdout and stderr in one file:
prueba 1>/home/errors.txt 2>&1
in this way all messages will be in the file.
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-24-2010 08:14 AM
тАО02-24-2010 08:14 AM
Re: Keeping errors in a error file
i have a problem...
if i run this, it works:
prueba 1>/home/errors.txt 2>&1
but if i run the shell waiting a parameter it is not working :(
prueba value1 1>/home/errors.txt 2>&1
please let me know how i can fix it
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-24-2010 08:23 AM
тАО02-24-2010 08:23 AM
Re: Keeping errors in a error file
> but if i run the shell waiting a parameter it is not working :(
This suggests that your script has already re-directed STDERR (perhaps to the bit-bucket).
Look at your script for a line like:
# exec 2> /dev/null
If that exists, then that is why you see the behavior that you do.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-24-2010 08:47 AM
тАО02-24-2010 08:47 AM
Re: Keeping errors in a error file
the issue is when i add $1 = /home/user1/ is causing the issue ...
prueba /home/user1/ 1>/home/user1/errors.txt 2>&1
i donot understand why ????
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-24-2010 08:59 AM
тАО02-24-2010 08:59 AM
Re: Keeping errors in a error file
Just the act of adding a parameter to a command should not effect redirection of stderr and stdout.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-24-2010 09:01 AM
тАО02-24-2010 09:01 AM
Re: Keeping errors in a error file
The original issue was that you were trying to append output to a file that was not created. >>
If you start a script process and redirect the output to a file as shown in my first post, all output will go to the file you are choosing.
You want error output only to a file. That goal has been achieved.
Your last question expanded the question. You need to step back and get a basic understanding for how input/output works in Unix.
This link might help with that:
http://www.codecoffee.com/tipsforlinux/articles2/042.html
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-24-2010 06:12 PM
тАО02-24-2010 06:12 PM
Re: Keeping errors in a error file
you had reason
i had 2>/dev/null into the script
i delete that and worked!!!
thank you so muchhhh