Re: Sed, awk? [solved]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Replying to my own post... *grin*

Martin Stricker wrote:
> 
> Jake McHenry wrote:

> >   grep 'nittany' * | cut -f 1 -d : | tr \\012 \\40 | spam.spam

> >   spam.spam | grep 'nittany' * | cut -f 1 -d : | tr \\012 \\40

> So try
> spam.spam ` grep -R 'email' * | awk -F: '{print $1}' | uniq | xargs \
> echo -n `
> (the backslash \ makes this work with the line break, if you issue it
> on one line, just omit it) and
> spam.spam ` grep 'nittany' * | cut -f 1 -d : | tr \\012 \\40 `

Note that the length of the argument list is limited (unless you build a
custom kernel, on Red Hat Linux you may not have more than 1024
arguments in the line, or is it 1024 characters?). The length of a pipe,
however, is not limited (I have piped complete ISO CD images through
pipes). So you should try to rewrite your script so it reads from the
standard input instead of using an argument list. With xargs you can get
around the "argument list too long" error message, but as I understand
you are writing to a file, and that might get you into trouble.

Best regards,
Martin Stricker
-- 
Homepage: http://www.martin-stricker.de/
Linux Migration Project: http://www.linux-migration.org/
Red Hat Linux 9 for low memory: http://www.rule-project.org/
Registered Linux user #210635: http://counter.li.org/


-- 
Shrike-list mailing list
Shrike-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/shrike-list

[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux