![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to Redirect the error messages from Syslog file to our own Application Log File | balasubramaniam | HP-UX | 3 | 04-17-2008 02:44 PM |
| Error checking a file from previous file size | stuck1 | Shell Programming and Scripting | 2 | 12-06-2007 08:39 AM |
| Redirecting to Error File | lorcan | UNIX for Advanced & Expert Users | 1 | 10-12-2007 02:07 AM |
| Error: Internal system error: Unable to initialize standard output file | firkus | UNIX for Dummies Questions & Answers | 2 | 10-25-2005 04:23 PM |
| File Error | dreams5617 | Shell Programming and Scripting | 7 | 12-21-2004 01:17 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
error log file
I am running a script.
if in between due to any problem it fails I have to creat a error log file mentioning what was the error with date and time. If script executed succesfully I have to create success log file. Can u help me out. its urgent |
|
||||
|
Actually if something is competently written, its exit code should indicate whether or not it was successful; then you simply write Code:
if something; then date +"%c: successfully did something" else date +"%c: something failed" fi >>/tmp/error.log (Variations on output message formatting with date and the redirection flow simply to demonstrate that There Is More Than One Way To Do It.) |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|