I'm working on creating a centralized logging facility for my NT servers.
Currently my linux servers email me highlights of their logs using logcheck.


Through this process, I discovered some interesting redirection usage that I
hadn't seen before:
"eldump -? 2>&1 | more"

I figure this means take standard error(2) and merge it with standard
out(1).  Right?

Here are some experiments I ran:
$ prog 1>d 1>j

stdout went to j
d is empty

$ prog 1>d 2>&1 1>j

stdout went to j
stderr went to d

How many streams are there?  Can I do something like
$ prog 1>&4 4>&3 1>j 3>&5  5>&2

Can I fork a stream?  Maybe like:
$ prog 1>&3>&4 3>file1 4>file2

What other tricks can I do with streams?  Can I take stdout and route it in
to stdin, thus making a superconducter inside my shell?
$ prog 1>&3 <&3
or maybe just
$ prog <&1
hmm, I just did:
$ cat <&1
but it wasn't very interesting.  Same as 'cat'

What about pipes?
$ prog 1|'perl -pe \'s....\'' 2|wc -l....


Thanks,
Cory

Reply via email to