[LUGOS] Datoteke s presledki v bash

Jure Koren jure at hehe.si
Fri Sep 7 12:10:59 CEST 2007


On Friday 07 September 2007 11:52, Robert Ludvik wrote:
> $ find . -type f
> ./datoteka s presledki.txt
>
> Če želim s tem kaj več početi, imam problem:
>
> $ for dat in `find . -type f`; do mv $dat KRNEKI; done
> mv: statusa »./datoteka« ni moč ugotoviti s stat: No such file or directory
> mv: statusa »s« ni moč ugotoviti s stat: No such file or directory
> mv: statusa »presledki.txt« ni moč ugotoviti s stat: No such file or
> directory
>
> Kako se rešim tega? (KRNEKI bo še kaj nafredil, npr. tr -s 'č' 'c' ...)

Jaz praviloma uporabim "null terminated" stringe:

find . -type f -print0 | xargs -0 ukaz

Pri tvojem primeru bi ti priporočal, da bash nadomestiš z manj kriptičnim 
orodjem - s perlom in tcl bi šlo, Python (in IPython lupina) je pa super 
izbira :)

-- 
Jure Koren, unix developer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://liste2.lugos.si/pipermail/lugos-list/attachments/20070907/85abd6ee/attachment.pgp 


More information about the lugos-list mailing list