pgfdp@nzapmb.co.nz (Paul Fox ) (12/02/88)
In article <795@levels.sait.edu.au>, (DAVID NEWALL) writes: > But it turned out to be easy, to write a C program to delete the file. It Several people have talked about writing programs to do this... the trick is to get "rm" to name the file itself, and not rely on the shell, which, as has been pointed out, historically uses bit 7 for quoting purposes. rm itself is perfectly happy with 8-bit characters in filenames. Use "rm -ri .", and answer rm's questions very carefully. This certainly isn't "wizard" material anymore... more like comp.unix.quicktricks On another topic (just trying to save bandwidth, folks), in a pinch you can get the exit code for something in the middle of a pipe with: trap 'rm -f /tmp/ecode$$' 0 1 2 15 a | b | ( c ; echo $? >/tmp/ecode$$ ) | d | e if [ `cat /tmp/ecode$$` != 0 ] #etc... On yet another topic (talk about message overload! (please change the Subject: if you reply)): Does anyone have any tricks up their sleeve for using SysV shell functions for structured (gasp!) shell programming? The argument list (meaning $* and $#) get clobbered on every function call, which is a bit of a pain... ---------- paul fox, formerly from nj, currently reachable as pgfdp@apmpyr.nzapmb.co.nz