This isn't really a Debian issue as such, but I thought that someone here might be able to point me in the right direction... Hope I'm not too far off base here :-)
I've got a shell script that I want to have log it's actions on a selective basis (dependent upon run-time settings). I know it could re-exec itself with appropriate redirection, but I don't want to rely on commandline parameters or environment settings which might inadvertently be set. Is there any way for a shell script to determine where it's stdout/stderr is going, and to redirect it "from this point on"? Preferably something which works with a generic /bin/sh, rather than specific to bash, but I'll work with whatever I can get... Thanx!