Re: [#!/fr] for k in "ls" proprement.

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Freenawak
Date:  
À: La liste francophone des scripts shell
Sujet: Re: [#!/fr] for k in "ls" proprement.
En effet merci, c'était presque trop simple.

2010/6/29 Piel Jayce <jayce@???>

>
> Je ferais simplement
>
> for K in find /log/c1_grh1/ordo/ -type f -name \*100624\*.o
> do
> ...
> done
>
> Le 25 juin 10 à 14:29, Freenawak a écrit :
>
> Bonjour c'est encore moi ...
>>
>> J'essaie de travailler sur les fichiers d'un repertoire.
>>
>> for K in ls  /log/c1_grh1/ordo/*100624*.o
>> do
>>   if [  $(tail -n 1 $K | cut -d' ' -f 3)  = '[255]' ]  #va chercher dans
>> le fond du fichier si c'est egale à [255]
>>   then
>>       echo $K > TMP_255 #alors on copie le nom entier sur fichier dans un
>> txt
>>   fi
>> done

>>
>> Cela fonctionne mais me renvoie des erreurs curieuses :
>> ls: A file or directory in the path name does not exist.
>> ./rhum255.ksh[18]: test: 0403-004 Specify a parameter with this command.
>> (la
>> ligne 18 est le if)
>>
>> un collègue me propose à la place de mon ls
>>
>> for K in " find /log/c1_grh1/ordo/ -type f -exec ls -1 *100624*.o {} \; "
>> do
>> [...]
>>
>> Réponse :
>>
>> tail: 0652-044 Can only process one file at a time.
>> ./rhum255.ksh[18]: test: 0403-004 Specify a parameter with this command.
>>
>> Comment fait un "ls" propre pour travailler sur les fichiers trouvés
>> ensuite
>> ?
>> _______________________________________________
>> archives :
>> http://listes.patpro.net/list/sshfr.fr.html
>> http://listes.patpro.net/mailman/listinfo/script_shell_fr
>>
>>
> --
> Jayce Piel
> MosX.org
> la renaissance.....
>
>
> _______________________________________________
> archives :
> http://listes.patpro.net/list/sshfr.fr.html
> http://listes.patpro.net/mailman/listinfo/script_shell_fr
>

_______________________________________________
archives :
http://listes.patpro.net/list/sshfr.fr.html
http://listes.patpro.net/mailman/listinfo/script_shell_fr