Re: Sed, awk?

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

 



On Thu, 2003-12-18 at 13:10, Jake McHenry wrote:
> This is probably really simple for u guys.. I need a one liner to
> basically do the same as explode in php. Here is the input to the
> command:
> 
> Oneliner | grep 'whatever' *
> 
> What will be actually being passed to sed or whatever will look like
> this:
> 
> 203lkjasdf:alsdkfjalskjf
> 
> I only need the first part, before the colon. I could make up a php
> script very easly explode(":", $input); but I would like to just have
> a short command instead of a separate script.

cut -f 1 -d :

example...

$ echo "203lkjasdf:alsdkfjalskjf" | cut -f 1 -d :
203lkjasdf

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