Robin Becker wrote: > Is there a way for a shell script to test if 2> is the same as 1>? I > want to put messages in both when they are connected to different files, > but would like to avoid duplicating the message when they are the same.
You could try using fstat(1) to print out the open file descriptors from
your process:
fstat -p $$
and then compare the values in the DEV and INUM columns -- unfortunately
fstat has no way to map back from those device and inode values to
filenames.
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
Kent, CT11 9PW
signature.asc
Description: OpenPGP digital signature
