...
mais si j'ai ceci dans mon .bashrc :
del ()
     {
       echo -n 'supression de :'$*
       mv $* $HOME/.corbeille/
     }
del *
...
Tout de suite c'est moins marrant et ce que je ne comprand pas c'est $*
prend le non du fichier en entier echo est juste l� pour le montrer.
Extrait de man bash:

* Expands to the positional parameters, starting from one.  When the  expansion  occurs
  within  double  quotes,  it expands to a single word with the value of each parameter
  separated by the first character of the IFS  special  variable.   That  is,  "$*"  is
  equivalent  to  "$1c$2c...",  where  c is the first character of the value of the IFS
  variable.  If IFS is unset, the parameters are separated by spaces.  If IFS is  null,
  the parameters are joined without intervening separators.

@ Expands  to  the positional parameters, starting from one.  When the expansion occurs
  within double quotes, each parameter expands to a separate word.  That  is,  "$@"  is
  equivalent  to  "$1"  "$2"  ...  When there are no positional parameters, "$@" and $@
  expand to nothing (i.e., they are removed).

Donc il te suffit de remplacer $* par $@

--
  -o) Pascal Bleser   ATOS Origin/Aachen(DE) |
  /\\         <[EMAIL PROTECTED]> |
 _\_v <[EMAIL PROTECTED]>                     |
---------------------------------------------|
Jesus saves,Buddha makes incremental backups :
---------------------------------------------'


_______________________________________________________
Linux Mailing List - http://www.unixtech.be
Subscribe/Unsubscribe: http://www.unixtech.be/mailman/listinfo/linux
Archives: http://www.mail-archive.com/linux@;lists.unixtech.be
IRC: efnet.unixtech.be:6667 - #unixtech

Répondre à