Re: mv xrags and cp
- From: "Heike C. Zimmerer" <nospam06q3@xxxxxxx>
- Date: Sat, 20 Jan 2007 20:08:55 +0100
Florian Diesch <diesch@xxxxxxxxxxxxx> writes:
See my answer to the same mail.
If you want do it with a loop use a while loop:
find olddir -name '*.jpg | while read fname; do
do_something_with_file $fname
done
This works as long as there's no linebreak in a filename
Nope.
find olddir -name '*.jpg | while read fname; do
breaks on leading white space (typo ignored),
do_something_with_file $fname
breaks on any white space whatsoever.
find olddir -name '*.jpg' | while IFS= read fname; do
do_something_with_file "$fname"
done
or use the canonical version which imposes no restrictions at oll on
file names:
find olddir -name '*.jpg' -exec do_something_with {} \;
--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
- References:
- mv xrags and cp
- From: OOzy Pal
- Re: mv xrags and cp
- From: Marius Gedminas
- Re: mv xrags and cp
- From: OOzy Pal
- Re: mv xrags and cp
- From: John Dangler
- Re: mv xrags and cp
- From: Florian Diesch
- Re: mv xrags and cp
- From: OOzy Pal
- Re: mv xrags and cp
- From: Florian Diesch
- mv xrags and cp
- Prev by Date: Re: where is the list of installed packages kept?
- Next by Date: Re: where is the list of installed packages kept?
- Previous by thread: Re: mv xrags and cp
- Next by thread: Re: mv xrags and cp
- Index(es):
Relevant Pages
|
Loading