It is currently Tue, 07 Dec 2021 01:53:07 GMT



 
Author Message
 (sol8 (intel))alias rm to rm -i in ksh88

Using the stock ksh that comes with sol8 (intel) how can I alias
the rm command to rm -i without changing the action of rm -rf?

alias rm='rm -i'

Makes rm -rf act like rm -ir.

However this same alias on various other machines (not solaris)
running pdksh bash or ksh93 do not behave this way. (The bsd's and
linux variants)

One way is to alias rmrf='/bin/rm -rf'
Or some other dorky notation but seems there should be a cleaner way.

(That is, besides being a more confident (homeboy) admin that doesn't
need -i ..hehe)



 Wed, 07 Jul 2004 01:27:46 GMT   
 (sol8 (intel))alias rm to rm -i in ksh88
Harry Putnam <rea...@newsguy.com> wrote in
news:x7elkn7enh.fsf@reader.newsguy.com:

anything typed as rm {whatever} will run the alias...

type \rm -rf to explicitly run the rm command, bypassing the alias.

--
-wiseguy
slummin it in Colorado ski country, while watching the IT industry move
to India, and thinking about retraining as a Sanitation Engineer

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



 Wed, 07 Jul 2004 01:43:06 GMT   
 (sol8 (intel))alias rm to rm -i in ksh88

I may have phrased the query poorly... I guess what I'm asking is why
it is necessary to do anything special on solaris?  How is it
different than the linux variants or the BSDs' on this particular
item.  On those, this problem doesn't arise.  I'm sure there are
a number of ways around it and various things like functions can solve
the problem

I have alias rm='rm -i' on several linuxs and bsds, and in bash, but I
don't see this behavior.  `rm something' gives me the expected query
that -i provides.  `rm -rf somedir' silently deletes the dir.



 Wed, 07 Jul 2004 16:59:13 GMT   
 (sol8 (intel))alias rm to rm -i in ksh88

Use alias rm='/usr/xpg4/bin/rm -i' on Solaris. Or better,
set PATH=/usr/xpg4/bin:/usr/bin:/usr/ccs/bin:... etc.
See "man rm" and "man standards" for the differences.

Markus



 Thu, 08 Jul 2004 10:18:32 GMT   
 
   [ 4 post ] 

Similar Threads

1. rm command needs rm -r on RedHat

2. rm won't rm

3. find rm {} vs. rm -r

4. alias RM='mv $1 ~/garbage/'

5. alias for rm to move files rather than deleting

6. HELP! Aliases for CP/RM/MV that ECHO

7. How to alias rm -> mv in zsh

8. Rm --fichier.tgz ?

9. kde only detects 64MB RM!

10. Backup concept suggestion : secure against hardware failure and rm -rf


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software