Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!mit-eddie!uw-beaver!teknowledge-vaxc!sri-unix!quintus!ok
From: ok@quintus.UUCP (Richard A. O'Keefe)
Newsgroups: comp.unix.questions
Subject: Re: More categories for aliases (was Re: something or other)
Message-ID: <1047@cresswell.quintus.UUCP>
Date: 2 Jun 88 04:55:11 GMT
References: <1827@silver.bacs.indiana.edu> <1044@cresswell.quintus.UUCP> <1833@silver.bacs.indiana.edu>
Distribution: na
Organization: Quintus Computer Systems, Mountain View, CA
Lines: 54
Posted: Wed Jun  1 21:55:11 1988

In article <1833@silver.bacs.indiana.edu>, creps@silver.bacs.indiana.edu (Steve Creps) writes:
> In article <1044@cresswell.quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes:
> >In article <1827@silver.bacs.indiana.edu>, creps@silver (Steve Creps) writes:
> >> - To set default flags for a command (i.e. "alias rm rm -i" makes -i a default
> >>   flag for rm instead of -f)
> >"-f" is NOT a default for rm.
> 
>    It is on our system (which runs Ultrix 2.0). Actually, from what I've heard
> on the net, "-f" is indeed the default for rm on most Unix-based systems. At
> least, I've heard people say "-f" is the default, but have never before heard
> anyone say "-i" is.

Somebody is confused here, and just for once I'm pretty sure it isn't me.
I *have* checked the Ultrix manuals, also the SVID.  There are THREE
possible modes:

    -i	Ask about *every* file

DEFAULT	Ask before removing a file if
	(standard input is a terminal) and
	(no write permission for file to be deleted)

    -f	Don't ask about *any* files.

"-f" is not the default in either System V or BSD, including Ultrix.
The default mode hasn't got an option letter which can force it (but
see below).

Oddly enough, "-f" is redundant, the same effect can be obtained by doing
	rm /dev/tty -i -options.. files..
to ensure that the prompts go to the right place and the response is
read from the right place.

Recommendations:
(1) R the FM carefully!
(2) DO NOT ALIAS BASIC COMMANDS, you'll break scripts.
    (Or if you feel that you *must* alias basic commands, always write
    your scripts in Bournese so that they won't be broken.)
(3) alias del 'rm /dev/tty -i \!*'
    (If you want something you can use in scripts.)