![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| error redirection | sais | UNIX for Dummies Questions & Answers | 7 | 05-15-2008 03:28 AM |
| awk two file redirection | kamel.seg | Shell Programming and Scripting | 1 | 12-18-2007 02:17 PM |
| Redirection or piping error message | mariner | Shell Programming and Scripting | 2 | 05-10-2005 03:04 PM |
| .forward file for mail redirection | giannicello | UNIX for Dummies Questions & Answers | 3 | 01-12-2002 11:06 AM |
| File redirection | namtab | UNIX for Dummies Questions & Answers | 4 | 01-10-2002 11:48 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Error file Redirection
Hello All,
I was wondering is there any other way in Shell Scripting to redirect the errors to a output file inside a shell script with using a error status checking or a command line redirection. Say without doing this ksh test.ksh 2> error.txt or without doing this ... if [ "$?" = "1" ]; then exit 1 fi Thanks Rahul |
|
||||
|
Your question is not very clear, but my hunch is you might be looking for this.
Code:
exec 2>error.txt |
|
||||
|
My Question is If we need to redirect the error output to a text file in shell script
we can do by using this ksh test.ksh 2> errorfile.txt or We can do a Exit Status check as below .. if [ "$?" = "1" ]; then ... fi But What my doubt is there any other way to redirect the the errors to the error file rather than using the command line redirection to a text file. I want to handling the error redirecting part within the shell script. Thanks in advance Rahul |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|