* [gentoo-user] look for a file type + sort
@ 2013-09-13 4:48 Joseph
2013-09-13 4:58 ` Canek Peláez Valdés
2013-09-13 20:52 ` Alexander Kapshuk
0 siblings, 2 replies; 14+ messages in thread
From: Joseph @ 2013-09-13 4:48 UTC (permalink / raw
To: gentoo-user
I want to list recursively certain type of files eg. *.pdf
but I want to display: date, path and newest file first.
What is the easiest way of doing it?
--
Joseph
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] look for a file type + sort
2013-09-13 4:48 [gentoo-user] look for a file type + sort Joseph
@ 2013-09-13 4:58 ` Canek Peláez Valdés
2013-09-13 5:04 ` Canek Peláez Valdés
2013-09-13 20:52 ` Alexander Kapshuk
1 sibling, 1 reply; 14+ messages in thread
From: Canek Peláez Valdés @ 2013-09-13 4:58 UTC (permalink / raw
To: gentoo-user
On Thu, Sep 12, 2013 at 11:48 PM, Joseph <syscon780@gmail.com> wrote:
> I want to list recursively certain type of files eg. *.pdf but I want to
> display: date, path and newest file first.
>
> What is the easiest way of doing it?
ls -l --sort=time "$(find /path -iname "*.pdf")"
If there are no spaces in the filenames/directories, you can drop the
quotes from $().
Regards.
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] look for a file type + sort
2013-09-13 4:58 ` Canek Peláez Valdés
@ 2013-09-13 5:04 ` Canek Peláez Valdés
2013-09-13 5:11 ` Joseph
0 siblings, 1 reply; 14+ messages in thread
From: Canek Peláez Valdés @ 2013-09-13 5:04 UTC (permalink / raw
To: gentoo-user
On Thu, Sep 12, 2013 at 11:58 PM, Canek Peláez Valdés <caneko@gmail.com> wrote:
> On Thu, Sep 12, 2013 at 11:48 PM, Joseph <syscon780@gmail.com> wrote:
>> I want to list recursively certain type of files eg. *.pdf but I want to
>> display: date, path and newest file first.
>>
>> What is the easiest way of doing it?
>
> ls -l --sort=time "$(find /path -iname "*.pdf")"
>
> If there are no spaces in the filenames/directories, you can drop the
> quotes from $().
Sorry, it doesn't work with spaces even with the quotes; if you don't
have spaces in the directories/filenames, do
ls -l --sort=time $(find /path -iname "*.pdf")
If you have spaces, you need to set/restore IFS:
S=${IFS}; IFS=$'\n'; ls -l --sort=time $(find . -iname "*.pdf"); IFS=${S}
Regards.
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] look for a file type + sort
2013-09-13 5:04 ` Canek Peláez Valdés
@ 2013-09-13 5:11 ` Joseph
2013-09-13 5:16 ` Canek Peláez Valdés
0 siblings, 1 reply; 14+ messages in thread
From: Joseph @ 2013-09-13 5:11 UTC (permalink / raw
To: gentoo-user
On 09/13/13 00:04, Canek Peláez Valdés wrote:
>On Thu, Sep 12, 2013 at 11:58 PM, Canek Peláez Valdés <caneko@gmail.com> wrote:
>> On Thu, Sep 12, 2013 at 11:48 PM, Joseph <syscon780@gmail.com> wrote:
>>> I want to list recursively certain type of files eg. *.pdf but I want to
>>> display: date, path and newest file first.
>>>
>>> What is the easiest way of doing it?
>>
>> ls -l --sort=time "$(find /path -iname "*.pdf")"
>>
>> If there are no spaces in the filenames/directories, you can drop the
>> quotes from $().
>
>Sorry, it doesn't work with spaces even with the quotes; if you don't
>have spaces in the directories/filenames, do
>
>ls -l --sort=time $(find /path -iname "*.pdf")
>
>If you have spaces, you need to set/restore IFS:
>
>S=${IFS}; IFS=$'\n'; ls -l --sort=time $(find . -iname "*.pdf"); IFS=${S}
>
>Regards.
>--
>Canek Peláez Valdés
>Posgrado en Ciencia e Ingeniería de la Computación
>Universidad Nacional Autónoma de México
Hm, I've tried:
ls -l --sort=time $(find /home/joseph -iname "*.jpg")
got:
ls: invalid option -- '/'
--
Joseph
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] look for a file type + sort
2013-09-13 5:11 ` Joseph
@ 2013-09-13 5:16 ` Canek Peláez Valdés
2013-09-13 6:24 ` Jean-Christophe Bach
0 siblings, 1 reply; 14+ messages in thread
From: Canek Peláez Valdés @ 2013-09-13 5:16 UTC (permalink / raw
To: gentoo-user
On Fri, Sep 13, 2013 at 12:11 AM, Joseph <syscon780@gmail.com> wrote:
> On 09/13/13 00:04, Canek Peláez Valdés wrote:
>>
>> On Thu, Sep 12, 2013 at 11:58 PM, Canek Peláez Valdés <caneko@gmail.com>
>> wrote:
>>>
>>> On Thu, Sep 12, 2013 at 11:48 PM, Joseph <syscon780@gmail.com> wrote:
>>>>
>>>> I want to list recursively certain type of files eg. *.pdf but I want to
>>>> display: date, path and newest file first.
>>>>
>>>> What is the easiest way of doing it?
>>>
>>>
>>> ls -l --sort=time "$(find /path -iname "*.pdf")"
>>>
>>> If there are no spaces in the filenames/directories, you can drop the
>>> quotes from $().
>>
>>
>> Sorry, it doesn't work with spaces even with the quotes; if you don't
>> have spaces in the directories/filenames, do
>>
>> ls -l --sort=time $(find /path -iname "*.pdf")
>>
>> If you have spaces, you need to set/restore IFS:
>>
>> S=${IFS}; IFS=$'\n'; ls -l --sort=time $(find . -iname "*.pdf"); IFS=${S}
>>
>> Regards.
>> --
>> Canek Peláez Valdés
>> Posgrado en Ciencia e Ingeniería de la Computación
>> Universidad Nacional Autónoma de México
>
>
> Hm, I've tried:
> ls -l --sort=time $(find /home/joseph -iname "*.jpg")
>
> got:
> ls: invalid option -- '/'
The exact same command (changing joseph with canek) works for me,
except in directories/filenames with spaces, as expected. Do you have
an alias for ls? What does find /home/joseph -iname "*.jpg" returns?
Regards.
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] look for a file type + sort
2013-09-13 5:16 ` Canek Peláez Valdés
@ 2013-09-13 6:24 ` Jean-Christophe Bach
2013-09-13 6:50 ` Florian Philipp
2013-09-13 13:36 ` Yuri K. Shatroff
0 siblings, 2 replies; 14+ messages in thread
From: Jean-Christophe Bach @ 2013-09-13 6:24 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1786 bytes --]
* Canek Peláez Valdés <caneko@gmail.com> [13.09.2013. @00:16:51 -0500]:
> On Fri, Sep 13, 2013 at 12:11 AM, Joseph <syscon780@gmail.com> wrote:
> > On 09/13/13 00:04, Canek Peláez Valdés wrote:
> >>
> >> On Thu, Sep 12, 2013 at 11:58 PM, Canek Peláez Valdés <caneko@gmail.com>
> >> wrote:
> >>>
> >>> On Thu, Sep 12, 2013 at 11:48 PM, Joseph <syscon780@gmail.com> wrote:
> >>>>
> >>>> I want to list recursively certain type of files eg. *.pdf but I want to
> >>>> display: date, path and newest file first.
> >>>>
> >>>> What is the easiest way of doing it?
> >>>
> >>>
> >>> ls -l --sort=time "$(find /path -iname "*.pdf")"
> >>>
> >>> If there are no spaces in the filenames/directories, you can drop the
> >>> quotes from $().
> >>
> >>
> >> Sorry, it doesn't work with spaces even with the quotes; if you don't
> >> have spaces in the directories/filenames, do
> >>
> >> ls -l --sort=time $(find /path -iname "*.pdf")
> >>
> >> If you have spaces, you need to set/restore IFS:
> >>
> >> S=${IFS}; IFS=$'\n'; ls -l --sort=time $(find . -iname "*.pdf"); IFS=${S}
> >>
> >> Regards.
> >> --
> >> Canek Peláez Valdés
> >> Posgrado en Ciencia e Ingeniería de la Computación
> >> Universidad Nacional Autónoma de México
> >
> >
> > Hm, I've tried:
> > ls -l --sort=time $(find /home/joseph -iname "*.jpg")
> >
> > got:
> > ls: invalid option -- '/'
>
> The exact same command (changing joseph with canek) works for me,
> except in directories/filenames with spaces, as expected. Do you have
> an alias for ls? What does find /home/joseph -iname "*.jpg" returns?
>
> Regards.
> --
> Canek Peláez Valdés
Hi,
This one should work:
find /home/joseph/ -iname "*.pdf" -exec ls -l --sort=time {} +
Regards,
JC
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] look for a file type + sort
2013-09-13 6:24 ` Jean-Christophe Bach
@ 2013-09-13 6:50 ` Florian Philipp
2013-09-13 12:45 ` Joseph
2013-09-13 13:36 ` Yuri K. Shatroff
1 sibling, 1 reply; 14+ messages in thread
From: Florian Philipp @ 2013-09-13 6:50 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 2105 bytes --]
Am 13.09.2013 08:24, schrieb Jean-Christophe Bach:
> * Canek Peláez Valdés <caneko@gmail.com> [13.09.2013. @00:16:51 -0500]:
>
>> On Fri, Sep 13, 2013 at 12:11 AM, Joseph <syscon780@gmail.com> wrote:
>>> On 09/13/13 00:04, Canek Peláez Valdés wrote:
>>>>
>>>> On Thu, Sep 12, 2013 at 11:58 PM, Canek Peláez Valdés <caneko@gmail.com>
>>>> wrote:
>>>>>
>>>>> On Thu, Sep 12, 2013 at 11:48 PM, Joseph <syscon780@gmail.com> wrote:
>>>>>>
>>>>>> I want to list recursively certain type of files eg. *.pdf but I want to
>>>>>> display: date, path and newest file first.
>>>>>>
>>>>>> What is the easiest way of doing it?
>>>>>
>>>>>
>>>>> ls -l --sort=time "$(find /path -iname "*.pdf")"
>>>>>
>>>>> If there are no spaces in the filenames/directories, you can drop the
>>>>> quotes from $().
>>>>
>>>>
>>>> Sorry, it doesn't work with spaces even with the quotes; if you don't
>>>> have spaces in the directories/filenames, do
>>>>
>>>> ls -l --sort=time $(find /path -iname "*.pdf")
>>>>
>>>> If you have spaces, you need to set/restore IFS:
>>>>
>>>> S=${IFS}; IFS=$'\n'; ls -l --sort=time $(find . -iname "*.pdf"); IFS=${S}
>>>>
>>>> Regards.
>>>> --
>>>> Canek Peláez Valdés
>>>> Posgrado en Ciencia e Ingeniería de la Computación
>>>> Universidad Nacional Autónoma de México
>>>
>>>
>>> Hm, I've tried:
>>> ls -l --sort=time $(find /home/joseph -iname "*.jpg")
>>>
>>> got:
>>> ls: invalid option -- '/'
>>
>> The exact same command (changing joseph with canek) works for me,
>> except in directories/filenames with spaces, as expected. Do you have
>> an alias for ls? What does find /home/joseph -iname "*.jpg" returns?
>>
>> Regards.
>> --
>> Canek Peláez Valdés
>
> Hi,
>
> This one should work:
>
> find /home/joseph/ -iname "*.pdf" -exec ls -l --sort=time {} +
>
> Regards,
>
> JC
>
This won't work if there are too many files because find will eventually
start ls multiple times.
Try this instead:
find /path -iname '*.pdf' -printf '%T@\t%Tc\t%p\n' | sort -nr |
cut -f 2-
Regards,
Florian Philipp
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] look for a file type + sort
2013-09-13 6:50 ` Florian Philipp
@ 2013-09-13 12:45 ` Joseph
0 siblings, 0 replies; 14+ messages in thread
From: Joseph @ 2013-09-13 12:45 UTC (permalink / raw
To: gentoo-user
On 09/13/13 08:50, Florian Philipp wrote:
[snip]
>>>>
>>>> Hm, I've tried:
>>>> ls -l --sort=time $(find /home/joseph -iname "*.jpg")
>>>>
>>>> got:
>>>> ls: invalid option -- '/'
>>>
>>> The exact same command (changing joseph with canek) works for me,
>>> except in directories/filenames with spaces, as expected. Do you have
>>> an alias for ls? What does find /home/joseph -iname "*.jpg" returns?
>>>
>>> Regards.
>>> --
>>> Canek Peláez Valdés
>>
>> Hi,
>>
>> This one should work:
>>
>> find /home/joseph/ -iname "*.pdf" -exec ls -l --sort=time {} +
>>
>> Regards,
>>
>> JC
>>
>
>This won't work if there are too many files because find will eventually
>start ls multiple times.
>
>Try this instead:
>find /path -iname '*.pdf' -printf '%T@\t%Tc\t%p\n' | sort -nr |
>cut -f 2-
>
>Regards,
>Florian Philipp
They both work thank you!
But Florian solution seems to work better eg.
Solution 1:
find /home/joseph/ -iname "*.jpg" -exec ls -l --sort=time {} + |more
-rw-r--r-- 1 joseph users 113350 Aug 16 20:11 /home/joseph/business/Drawings/tolsink_devices/Fostex-HP-P1_to_Ibasso-D12_2.6cm_c2c_69deg.jpg
-rw-r--r-- 1 joseph users 175335 Aug 14 17:16 /home/joseph/business/Drawings/tolsink_devices/M8-AK120_3.4cm_c2c_32deg.jpg.jpg
...
Solution 2.
find /home/joseph -iname '*.jpg' -printf '%T@\t%Tc\t%p\n' | sort -nr | cut -f 2- |more
Fri 30 Aug 2013 11:12:22 PM MDT /home/joseph/xp_share/img216.jpg
Tue 27 Aug 2013 05:18:56 PM MDT /home/joseph/Documents/albums/kuya_boy.jpg
Tue 27 Aug 2013 05:18:56 PM MDT /home/joseph/xp_share/kuya_boy.jpg
Tue 20 Aug 2013 10:31:29 PM MDT /home/joseph/0209C-SS_eyelets.jpg
Tue 20 Aug 2013 10:31:12 PM MDT /home/joseph/0210C.jpg
Fri 16 Aug 2013 08:11:59 PM MDT /home/joseph/business/Drawings/tolsink_devices/Fostex-HP-P1_to_Ibasso-D12_2.6cm_c2c_69deg.jpg
Wed 14 Aug 2013 05:16:13 PM MDT /home/joseph/business/Drawings/tolsink_devices/M8-AK120_3.4cm_c2c_32deg.jpg.jpg
...
The first solution did not find the first 5-files showing up in the Solution 2.
--
Joseph
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] look for a file type + sort
2013-09-13 6:24 ` Jean-Christophe Bach
2013-09-13 6:50 ` Florian Philipp
@ 2013-09-13 13:36 ` Yuri K. Shatroff
2013-09-13 13:43 ` Mark David Dumlao
1 sibling, 1 reply; 14+ messages in thread
From: Yuri K. Shatroff @ 2013-09-13 13:36 UTC (permalink / raw
To: gentoo-user
On 13.09.2013 10:24, Jean-Christophe Bach wrote:
[ ... ]
>
> This one should work:
>
> find /home/joseph/ -iname "*.pdf" -exec ls -l --sort=time {} +
-exec is not suitable here because it spawns a `ls` process per each
found entry; aside from being slow, this disallows sorting at all.
You'd prefer
find /home/joseph/ -iname "*.pdf" |xargs ls -l --sort=time
or, to be space-proof
find /home/joseph/ -iname "*.pdf" -print0 |xargs -0 ls -l --sort=time
A little late but HTH.
--
Best wishes,
Yuri K. Shatroff
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] look for a file type + sort
2013-09-13 13:36 ` Yuri K. Shatroff
@ 2013-09-13 13:43 ` Mark David Dumlao
2013-09-13 13:51 ` Yuri K. Shatroff
0 siblings, 1 reply; 14+ messages in thread
From: Mark David Dumlao @ 2013-09-13 13:43 UTC (permalink / raw
To: gentoo-user
On Fri, Sep 13, 2013 at 9:36 PM, Yuri K. Shatroff <yks-uno@yandex.ru> wrote:
> On 13.09.2013 10:24, Jean-Christophe Bach wrote:
> [ ... ]
>
>>
>> This one should work:
>>
>> find /home/joseph/ -iname "*.pdf" -exec ls -l --sort=time {} +
>
>
> -exec is not suitable here because it spawns a `ls` process per each found
> entry; aside from being slow, this disallows sorting at all.
This is incorrect. If you terminate exec with '+' instead of '\;', only a single
instance of the command is run - the command line is built by appending
each found file to the end of the {} placeholder.
The only reason I see for it to fail is if you have so many files that
it can't be
passed to the argv of the receiving command.
--
This email is: [ ] actionable [x] fyi [ ] social
Response needed: [ ] yes [x] up to you [ ] no
Time-sensitive: [ ] immediate [ ] soon [x] none
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] look for a file type + sort
2013-09-13 13:43 ` Mark David Dumlao
@ 2013-09-13 13:51 ` Yuri K. Shatroff
2013-09-14 4:04 ` Mark David Dumlao
0 siblings, 1 reply; 14+ messages in thread
From: Yuri K. Shatroff @ 2013-09-13 13:51 UTC (permalink / raw
To: gentoo-user
On 13.09.2013 17:43, Mark David Dumlao wrote:
> On Fri, Sep 13, 2013 at 9:36 PM, Yuri K. Shatroff <yks-uno@yandex.ru> wrote:
>> On 13.09.2013 10:24, Jean-Christophe Bach wrote:
>> [ ... ]
>>
>>>
>>> This one should work:
>>>
>>> find /home/joseph/ -iname "*.pdf" -exec ls -l --sort=time {} +
>>
>>
>> -exec is not suitable here because it spawns a `ls` process per each found
>> entry; aside from being slow, this disallows sorting at all.
>
> This is incorrect. If you terminate exec with '+' instead of '\;', only a single
> instance of the command is run - the command line is built by appending
> each found file to the end of the {} placeholder.
Sorry, I'm ashamed
I didn't know about this feature. Does it also handle spaces correctly?
> The only reason I see for it to fail is if you have so many files that
> it can't be
> passed to the argv of the receiving command.
There's always an opportunity to use tempfiles ;)
--
Best wishes,
Yuri K. Shatroff
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] look for a file type + sort
2013-09-13 4:48 [gentoo-user] look for a file type + sort Joseph
2013-09-13 4:58 ` Canek Peláez Valdés
@ 2013-09-13 20:52 ` Alexander Kapshuk
1 sibling, 0 replies; 14+ messages in thread
From: Alexander Kapshuk @ 2013-09-13 20:52 UTC (permalink / raw
To: gentoo-user
On 09/13/2013 07:48 AM, Joseph wrote:
> I want to list recursively certain type of files eg. *.pdf but I want
> to display: date, path and newest file first.
>
> What is the easiest way of doing it?
>
Perhaps not the most elegant solution.
ls -lt `du -a|grep -i '\.pdf$'|awk '{ print $2 }'`|awk '{ print
$6,$7,$8,$9,$10,$11 }'
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] look for a file type + sort
2013-09-13 13:51 ` Yuri K. Shatroff
@ 2013-09-14 4:04 ` Mark David Dumlao
2013-09-14 19:16 ` Florian Philipp
0 siblings, 1 reply; 14+ messages in thread
From: Mark David Dumlao @ 2013-09-14 4:04 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1507 bytes --]
On Sep 13, 2013 9:53 PM, "Yuri K. Shatroff" <yks-uno@yandex.ru> wrote:
>
> On 13.09.2013 17:43, Mark David Dumlao wrote:
>>
>> On Fri, Sep 13, 2013 at 9:36 PM, Yuri K. Shatroff <yks-uno@yandex.ru>
wrote:
>>>
>>> On 13.09.2013 10:24, Jean-Christophe Bach wrote:
>>> [ ... ]
>>>
>>>>
>>>> This one should work:
>>>>
>>>> find /home/joseph/ -iname "*.pdf" -exec ls -l --sort=time {} +
>>>
>>>
>>>
>>> -exec is not suitable here because it spawns a `ls` process per each
found
>>> entry; aside from being slow, this disallows sorting at all.
>>
>>
>> This is incorrect. If you terminate exec with '+' instead of '\;', only
a single
>> instance of the command is run - the command line is built by appending
>> each found file to the end of the {} placeholder.
>
>
> Sorry, I'm ashamed
> I didn't know about this feature. Does it also handle spaces correctly?
>
I'm not sure how the internals work. As best as I can guess, it constructs
the argv directly so spaces shouldn't be an issue. Spaces are an issue when
the output is piped through, since the pipe itself knows no difference
between filename and output spaces, hence the need to force zero delimiters
between filenames. Since find runs the command directly, you shouldn't
encounter this. But Ive yet to test.
>
>> The only reason I see for it to fail is if you have so many files that
>> it can't be
>> passed to the argv of the receiving command.
>
>
> There's always an opportunity to use tempfiles ;)
>
>
>
> --
> Best wishes,
> Yuri K. Shatroff
>
[-- Attachment #2: Type: text/html, Size: 2141 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-user] look for a file type + sort
2013-09-14 4:04 ` Mark David Dumlao
@ 2013-09-14 19:16 ` Florian Philipp
0 siblings, 0 replies; 14+ messages in thread
From: Florian Philipp @ 2013-09-14 19:16 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1569 bytes --]
Am 14.09.2013 06:04, schrieb Mark David Dumlao:
>
> On Sep 13, 2013 9:53 PM, "Yuri K. Shatroff" <yks-uno@yandex.ru
> <mailto:yks-uno@yandex.ru>> wrote:
>>
>> On 13.09.2013 17:43, Mark David Dumlao wrote:
>>>
>>> On Fri, Sep 13, 2013 at 9:36 PM, Yuri K. Shatroff <yks-uno@yandex.ru
> <mailto:yks-uno@yandex.ru>> wrote:
>>>>
>>>> On 13.09.2013 10:24, Jean-Christophe Bach wrote:
>>>> [ ... ]
>>>>
>>>>>
>>>>> This one should work:
>>>>>
>>>>> find /home/joseph/ -iname "*.pdf" -exec ls -l --sort=time {} +
>>>>
>>>>
>>>>
>>>> -exec is not suitable here because it spawns a `ls` process per each
> found
>>>> entry; aside from being slow, this disallows sorting at all.
>>>
>>>
>>> This is incorrect. If you terminate exec with '+' instead of '\;',
> only a single
>>> instance of the command is run - the command line is built by appending
>>> each found file to the end of the {} placeholder.
>>
>>
>> Sorry, I'm ashamed
>> I didn't know about this feature. Does it also handle spaces correctly?
>>
>
> I'm not sure how the internals work. As best as I can guess, it
> constructs the argv directly so spaces shouldn't be an issue. Spaces are
> an issue when the output is piped through, since the pipe itself knows
> no difference between filename and output spaces, hence the need to
> force zero delimiters between filenames. Since find runs the command
> directly, you shouldn't encounter this. But Ive yet to test.
>
Your assumption is correct. exec cannot be fooled with whitespaces.
Regards,
Florian Philipp
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2013-09-14 19:17 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-13 4:48 [gentoo-user] look for a file type + sort Joseph
2013-09-13 4:58 ` Canek Peláez Valdés
2013-09-13 5:04 ` Canek Peláez Valdés
2013-09-13 5:11 ` Joseph
2013-09-13 5:16 ` Canek Peláez Valdés
2013-09-13 6:24 ` Jean-Christophe Bach
2013-09-13 6:50 ` Florian Philipp
2013-09-13 12:45 ` Joseph
2013-09-13 13:36 ` Yuri K. Shatroff
2013-09-13 13:43 ` Mark David Dumlao
2013-09-13 13:51 ` Yuri K. Shatroff
2013-09-14 4:04 ` Mark David Dumlao
2013-09-14 19:16 ` Florian Philipp
2013-09-13 20:52 ` Alexander Kapshuk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox