Re: Sed, awk?

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

 



On 09:33 18 Dec 2003, David Lupo <david.lupo@xxxxxxxxxxxx> wrote:
| On Thu, Dec 18, 2003 at 01:33:04AM -0500, Jake McHenry wrote:
| > grep 'alsdjf' * | cut -f 1 -d :
| > 
| > Returns all the filenames:what I'm searching for, growing rapidly,
| > right now the line count is around 200. What I want to do with this
| > output is input it into a script I made, which contains sa-learn
| > --args.. $*, where $* is the output from grep and cut.
| > 
| > I need the output from grep and cut to be all on the same line, not
| > the 200+ as it currently is.
| > 
| > So, is there a way to have the output from grep and cut to be all on
| > one big line seperated by spaces?
| 
| echo `grep 'alsdjf' * | cut -f 1 -d :`
| 
| If your script wants the names as arguments, you can replace "echo" with
| the name of the script.

True, but for larger datasets this will easily blow the command line
argument character count limit.

Most commands in UNIX _prefer_ input data to be lots of input lines.

If his scripts says:

	for arg
	do  do-stuff-with-$arg
	done

it easily transmutes into:

	while read arg
	do  do-stuff-with-$arg
	done

to read lines from stdin.

Cheers,
--
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

There's a difference between skepticism and nihilism.
        - Doug Jones <random@xxxxxxx>


-- 
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