cut question

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

 



awesome-dave1 at juno.com staggered into view and mumbled:
>
>Hello,
>	Got probably a simple question, one whose answer is probably staring me
>in the face. I'm writing a script that outputs stopped or aborted jobs in
>a mailq. The purpose is to grab field one, the queue ID field then place
>that info in a file. The problem is i can grab the first field, but cut
>takes the entire line. I need to know how to make cut split on a space?

The `cut' man page indicates that the -d parameter can be used to
define the needed delimiter.  Using `-d' with a space enclosed in
quotes should do the trick.  See the man page for `cut' for more
information.  You might also consider using `awk', or defining a
`bash' function and outputting the $1 variable.  There are other ways
of capturing the first word on a given line, but these techniques
seem to be the simplest to me.

I hope this info helps, and have a _great_ day!

-- 
Ralph.  N6BNO.  Wisdom comes from central processing, not from I/O.
rreid at sunset.net  http://personalweb.sunset.net/~rreid
Opinions herein are either mine or they are flame bait.
CIRCLE RADIUS = sqrt (x ^ 2 + y ^ 2)




[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]
  Powered by Linux