mellman@ttrdd.UUCP (07/10/87)
After using the csh for a long time, I have recently been introduced to the ksh. And it's great. I'm a new convert. I have only one question. How do people in the ksh world do without noclobber? Is there some trick I don't know about yet, or do other people simply make fewer mistakes than I do? Actually, this applies to system V's cp/mv/ln trio, too. I can't believe people can so blithely tip-toe through their files without being just a little nervous about stomping some out. Don't get me wrong. I'm not one of those people who are so unsteady at the keyboard that they NEVER delete their files themselves - who just move them to some "garbage can", to be delete by a machine. I've even been known to do an rm -rf on occassion - after 4 or 5 double-checks. But sometimes I forget to put the second > at the end of my cat > calendar, and three months of important dates get instantly nipped in the bud. Isn't there something I can do? ihnp4!ttrdd!mellman
gwyn@brl-smoke.ARPA (Doug Gwyn ) (07/13/87)
In article <190@ttrdd.UUCP> mellman@ttrdd.UUCP (Thomas Mellman) writes: >How do people in the ksh world do without noclobber? Noclobber is not a general solution. Like many other Berkeleyisms, it helps human users who work in accordance with its usage model but gets in the way of others. I for one do not WANT this feature. Perhaps it is wise to develop the habit of pausing to review each command before typing RETURN. >But sometimes I forget to put the second > at the end of my cat > calendar ... >Isn't there something I can do? Sure. Set up a bunch of shell functions for all the things like this that you frequently do; once you have them debugged you'll not have any problems remembering just what to type at the shell syntax level -- you'll be using a single mnemonic word to invoke the entire function.
keithe@tekgvs.TEK.COM (Keith Ericson) (07/14/87)
In article <190@ttrdd.UUCP> mellman@ttrdd.UUCP (Thomas Mellman) writes: >How do people in the ksh world do without noclobber? > Ksh lets me use functions to protect myself (and especially new users I set up accounts for) with these little goodies: function rm { /bin/rm -i $@ } function RM { /bin/rm $@ } The first "maps" the rm to enforce an interactive mode; the second (uppercased to simulate shouting it) bypasses the interactive mode. It's saved me lots of problems... keith PS - they're implemented as functions rather than aliases because, for some reason, I couldn't get aliases to be case sensitive. Anybody know why?
mellman@ttrdd.UUCP (Thomas Mellman) (07/16/87)
In article <6112@brl-smoke.ARPA>, gwyn@brl-smoke.ARPA (Doug Gwyn ) writes: > In article <190@ttrdd.UUCP> mellman@ttrdd.UUCP (Thomas Mellman) writes: > >How do people in the ksh world do without noclobber? > > Like many other Berkeleyisms, > it helps human users who work in accordance with its usage model but > gets in the way of others. I for one do not WANT this feature. That's why it's a settable option of the csh. BSD discriminates against neither gamblers nor users with bravado. > Sure. Set up a bunch of shell functions for all the things like this that > you frequently do... One must conclude, then, that the redirectable outputs of the ksh are only too be used from within scripts? > Perhaps it is wise to develop the habit of pausing to review each > command before typing RETURN. *Nobody* can say he never makes mistakes, and files can have tremendous worth, even if it's not always easy to convince the system administrator, who has to dig out and mount a tape to restore an outdated version. Sure, if I have to live without noclobber, I will. Actually, I won't, because as soon as I get a chance, I'm going to hack a version that *never* overwrites a file on redirection of stdout/stderr. But I'd like to see an outpouring of support so that this kind of thing can be standardized, instead of having to use special versions. Sure we can all do without protection that we don't inadvertently stamp out files - but then, we could do without computers, too. They are here to serve our needs. Noclobber is a proven and invaluable feature for a significant set of users.