From: Vladimir Karpinsky <vkarpinsky@mail.ru>
To: ALT Linux Community general discussions <community@lists.altlinux.org>
Subject: Re: [Comm] find and xargs
Date: Tue, 31 Mar 2009 13:56:40 +0400
Message-ID: <49D1E8D8.1010301@mail.ru> (raw)
In-Reply-To: <200903311229.32427.khedin@mail.ru>
Konstantin S. Uvarin пишет:
> On Monday 30 March 2009 23:32:18 Vladimir Karpinsky wrote:
>> Здравствуйте!
>>
>> Насколько я понял man, для предотвращения нежелательных ситуаций с xargs, в
>> случае когда find ничего не находит, рекомендуется использовать -print0 в
>> find и -0 в xargs, но:
>>
>> find ./ -size -1k -print0 | xargs -0p ls -l
>> ls -l ?...n
>>
>> файлов меньше 1k в текущем каталоге нет, и ls -l получает на вход пустую
>> строку со всеми вытекающими. Вероятно, я что-то не понял --- наставьте на
>> путь истинный.
>
> man xargs:
>
> --no-run-if-empty, -r
> If the standard input does not contain any nonblanks, do not
> run the command. Normally, the command is run once even if
> there is no input.
> This option is a GNU extension.
>
> ==========
>
> А -print0 и -0 -- это для случая, когда в выводе кавычки, пробелы и прочая.
> Кстати, часто вполне достаточно find | xargs -d\\n -- если, конечно, нет в
> выводе символов перевода строки.
>
Спасибо!
--
С уважением,
Владимир.
prev parent reply other threads:[~2009-03-31 9:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-30 19:32 Vladimir Karpinsky
2009-03-30 19:39 ` Pavlov Konstantin
2009-03-31 6:19 ` Vladimir Karpinsky
2009-03-31 6:23 ` Vladimir Karpinsky
2009-03-31 8:29 ` Konstantin S. Uvarin
2009-03-31 9:56 ` Vladimir Karpinsky [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49D1E8D8.1010301@mail.ru \
--to=vkarpinsky@mail.ru \
--cc=community@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git