Computing.Net > Forums > Unix > Shell Script Help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Shell Script Help

Reply to Message Icon

Name: ohuang
Date: April 11, 2005 at 10:13:05 Pacific
OS: AIX
CPU/Ram: ?
Comment:

Can someone tell me what the following line of code does.

ls $SOURCE/$DATE* 2>&1 > /tmp/ediin$$

I have a hard time to understand it especially the "2>&1 > /tmp/ediin$$" part.

Thanks.




Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: April 11, 2005 at 11:39:37 Pacific
Reply:

2>&1 redirect stderr to stdout
$$ is the process ID of the script

It should be written as

ls filename* > /tmp/outfile$$ 2>&1



0

Response Number 2
Name: Luke Chi
Date: April 17, 2005 at 15:54:51 Pacific
Reply:

More info:

In Unix:

There are 3 standard file handlers

0: standard input
1: standard output
2: standard error output


Luke Chi


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Shell Script Help

Shell Scripting Help www.computing.net/answers/unix/shell-scripting-help/5020.html

C Shell script help! www.computing.net/answers/unix/c-shell-script-help/3108.html

c shell script help PLEASE www.computing.net/answers/unix/c-shell-script-help-please/4355.html