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

Re: bash: if, test et *



* Edi Stojicevic <estojicevic@debianworld.org> [2008-10-28 08:44:10 +0000] wrote :

[..]
> Ma solution en utilisant un array et en vérifiant chacune des fichiers :
> 
> #!/bin/bash 
> 
> list=( `ls` )
> 
> for i in ${!list[@]}
> do
>  if [[ ${list[i]}  =~ ^fichier.* ]]
>  then 
>     echo "il existe une/des copie/s de ce fichier"
>  fi
> done
> 
> Ceci marche avec bash 3.2 !

Au fait, il existe une liste de diffusion dédiée à la programmation en
shell :

http://debianworld.org/shellscript-fr

@+
-- 
. ''`.  (\___/) E d i   S T O J I C E V I C
: :'  : (='.'=) http://www.debianworld.org 
`. `~'  (")_(") GPG: 0x1237B032
  `-


Reply to: