RE: Sed, awk?

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

 



On Thu, 2003-12-18 at 14:33, 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?

OK....try this on for size....

I have a file contain multiple lines of "203lkjasdf:alsdkfjalskjf"

grep asd data | cut -f 1 -d : | tr \\012 \\40

produces

203lkjasdf 203lkjasdf 203lkjasdf 203lkjasdf 203lkjasdf

Not sure if that is sufficient for you use.  There probably is a sed or
awk that is more efficient.....





-- 
"An opinion is like an asshole - everybody has one."
    - Clint Eastwood as Harry Callahan, The Dead Pool - 1988.


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