Editing
Solaris 10 Associate
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Command redirection == * each process that korn shell creates works with file descriptors * file descriptors determine where the input to the command originates and where the output and error messages are sent {| border="1" cellspacing="0" cellpadding="5" align="center" ! file descriptor number ! file descriptor abbreviation ! definition |- | 0 | stdin | standard command input |- | 1 | stdout | standard command output |- | 2 | stderr | standard command error |} === standard input === Less-than sign (<) forces a command to read input from file Syntax: * <code>command < filename</code> <insert examples> === standard output === Greater-than sign (>) sends output from a command to a file. (>>) appends to file Syntax: * <code>command > filename</code> Example of redirection: <pre>$ echo $SHELL > file1 $ more file1 /bin/ksh $ echo $HOME > file1 $ more file1 /export/home/paul $ echo $SHELL >> file1 $ more file1 /export/home/paul /bin/ksh $</pre> === standard error === File descriptor number 2 and greater-than (>) redirects standard error to file. Redirection of standard error will suppress error messages from going to display device Syntax: * <code>command 2> filename</code> <insert examples> === Pipe character === Use pipe character (|) to redirect standard output to standard input another command Syntax: * <code>command | command</code> <insert examples>
Summary:
Please note that all contributions to GotOpinion may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
GotOpinion:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information