Shell redirection is rewinding?!?
Kevin D. Clark
kclark at CetaceanNetworks.com
Wed Feb 18 09:31:46 EST 2004
> Could someone here slap me upside the head and point me in the right
> direction?
makewhatis is a shell script that does all sorts of hokey stuff with
shell redirection, like opening its own fds for stderr
(example: echo blah >/dev/stderr) and for "stdout" too
(example: echo blah >/dev/tty). Practices such as this in shell
scripts are marginal at best, and it could probably be argued that
these coding techniques are simply wrong. For example, confusing
/dev/tty with stdout is typically a mistake made by people who have
been infected with the idea that the C shell is an acceptable shell to
do any work with. Perhaps there's a reason why the code does all of
this, but if there is, I don't know what this reason is.
Anyways, makewhatis does a lot of work using such hokey shell
redirection techniques, and in the end, all of these techniques end up
truncating stderr. So, during the period of time that makewhatis is
running, it's not surprising to me that the fs is reporting that the
file is growing, but in the end, eventually the code in makewhatis
truncates the output file one last time, resulting in the 33 bytes
that you see.
--kevin
--
Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA)
cetaceannetworks.com!kclark (GnuPG ID: B280F24E)
alumni.unh.edu!kdc
More information about the gnhlug-discuss
mailing list