Some files recovered, next problem

Jason Clinton me at jasonclinton.com
Fri Jun 11 05:40:21 CDT 2004


Jim Herrmann wrote:
> linux:/home/jim/Downloads/tct-1.14 # perl
> ./lazarus/post-processing/rip-mail blocks/*.m.txt
> bash: /usr/bin/perl: Argument list too long

>From now on, when you see that message, you should immediately think of
'xargs'. The trouble arrises in that bash expands the file name glob to
a space seperated list of files /before/ the app is execute but there is
a limit to how much it can do/the app can accept on ARGV...

xargs just runs the command once for each file or once for each group of
files.

You will need to use the find command to generate the list of files and
then pipe it to xargs for execution. Here is one that echos the list of
files in the current directory and down, 15 at a time.

find ./ | xargs -p -n 15 echo

man xargs for more help





More information about the Kclug mailing list