On Sunday 02 June 2002 04:44, Tom Barnes-Lawrence wrote: > Could it be possible to create a program, lets call it "colourify" > for example (I don't know of one), such that when the init scripts > run a program, they direct the program's standard error (or standard > output if appropriate) stream into "colourify", and colourify then > uses the exit status of the program to determine whether it > succeeded or failed. Having determined that, colourify then dumps the > text that was fed to it in the appropriate colour- IIRC, the Linux > console type uses the same escape codes as xterms and other things, > which are in the Xterm postscript documentation. > OK, I'm not sure that you could have a program receive another > processes output *and* detect its exit status in one go, but > y'know... I'm sure something like this is possible without too much > effort (though you'd prolly not want to for fsck's progress bar > things).
_Theoretically_ (I'm not all sure about it), the init scripts return 0 on success and something else on failure. So you could in theory wrap the calls init makes into another script that simply executes the script, removes the final newline from its output and then appends the colored stuff. Since debian init scripts have a fairly standard output, you could do even further parsing of the string and perhaps do neat stuff like pritnitng the program name in bold. Just my 2cent. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]