[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: je sais plus rentrer en root



On Wed, Aug 21, 2002 at 10:31:33AM +0200, edeveaud@pasteur.fr wrote:

>> Cela m'amène à une question technique : si tu as un alias rm=rm
>> -i dans ton bashrc, cela veut-il dire qu'un script aussi
>> interprétera rm comme rm -i ?

> ça dépend de ce que tu fais, et e comment tu lances tes scripts.
> si tu as un alias rm='rm -i'

> si tu lances tes scripts dans ton environnement OUI rm sera interactif.
> plusieurs solutions.

Meuh non:

master@desktop:~/tmp/df$ cat > foo.sh
#! /bin/bash
rm bar
master@desktop:~/tmp/df$ touch bar
master@desktop:~/tmp/df$ alias rm='rm -i'
master@desktop:~/tmp/df$ chmod u+x foo.sh 
master@desktop:~/tmp/df$ ./foo.sh 
master@desktop:~/tmp/df$ touch bar
master@desktop:~/tmp/df$ rm bar 
rm: remove `bar'? y
master@desktop:~/tmp/df$ touch bar
master@desktop:~/tmp/df$ bash foo.sh 
master@desktop:~/tmp/df$ touch bar
master@desktop:~/tmp/df$ source foo.sh 
rm: remove `bar'? n

-- 
Lionel

Attachment: pgpGTpKhmL6r_.pgp
Description: PGP signature


Reply to: