Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] stdin/stderr redirection under Solaris
- Date: Wed, 25 Aug 2004 10:37:37 -0400
- From: br@example.com
- Subject: Re: [tlug] stdin/stderr redirection under Solaris
- References: <200408250944.i7P9iGJ6026852@example.com> <1093435991.412c8257641d2@example.com> <1093439749.412c9105b0dc5@example.com>
- User-agent: Internet Messaging Program (IMP) 3.2.2
Quoting br@example.com: > > test.sh: > > #! /bin/sh > > echo "standard output" >&1 > > echo "STANDARD ERROR" >&2 > > > > This command will do what you want, I guess (at least in bash): > > $ (./test.sh | tr a-z A-Z) 3>&1 1>&2 2>&3 | tr A-Z a-z > > > > The first "tr" receives stdout as input, and the second one receives > > stderr as input. > > Take care of one thing: The current state of stdout/stderr is messed up > > then. You may want to restore them, in case you have another pipe > > following, for instance: > > $ (((./test.sh | tr a-z A-Z) 3>&1 1>&2 2>&3 | tr A-Z a-z) 3>&1 1>&2 2>&3) > > Ooops. Use instead a "cat > OUT" and "cat > ERR" in my two examples (instead > of "tr"), and you will understand what happens, i.e. the second cat received > stderr as input. > In my previous examples, the output of the first "tr" seems to be filtered > again -partially- by the second one on my 5.8 box (it does not happen on > Linux, strangely). Ooops [2]. Forget about my last message. This is not a redirection problem, but a "tr" issue: tr works differently on Solaris. You should either use /usr/xpg4/bin/tr with my syntax, or, with /usr/bin/tr, use the '[a-z]' notation instead of a-z. My first message was correct with this small change, and should do what you need. br.
- References:
- Re: [tlug] stdin/stderr redirection under Solaris
- From: Shin MICHIMUKO
- Re: [tlug] stdin/stderr redirection under Solaris
- From: br
- Re: [tlug] stdin/stderr redirection under Solaris
- From: br
Home | Main Index | Thread Index
- Prev by Date: [tlug] 488 new official kanji
- Next by Date: Re: [tlug] stdin/stderr redirection under Solaris
- Previous by thread: Re: [tlug] stdin/stderr redirection under Solaris
- Next by thread: Re: [tlug] stdin/stderr redirection under Solaris
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links