Mime-Version: |
1.0 (Apple Message framework v919.2) |
Content-Type: |
text/plain; charset=US-ASCII; format=flowed; delsp=yes |
Date: |
Fri, 25 Apr 2008 07:53:57 -0700 |
Reply-To: |
|
Subject: |
|
From: |
|
In-Reply-To: |
|
Content-Transfer-Encoding: |
7bit |
Sender: |
|
Parts/Attachments: |
|
|
On Apr 24, 2008, at 9:00 PM, Mark J. Reed wrote:
> However, there are cases where you want to take a list of filenames
> (or other strings) in one-per-line form and turn them into arguments
> to a single command; that's what the xargs (cross-arguments) command
> is for:
>
> ls -1 notes-* | xargs cat
>
> will also do the right thing.
And, if the total number of qualifying files is (or might become large
while you're skiing in the alps in a couple of years) "large", using
xargs is necessary, as command lines (after expansion) are not
infinitely long. xargs batches its calls to the program it is
calling, if the maximum would be exceeded or as controlled by
parameters. "large" varies as the limit is length not count.
--John
|
|
|