![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| combining fields in two text fields | shocker | Shell Programming and Scripting | 3 | 01-16-2008 11:27 AM |
| Cut Last 3 Fields | bourne | Shell Programming and Scripting | 4 | 01-11-2007 05:17 AM |
| Last fields | Khoomfire | UNIX for Advanced & Expert Users | 3 | 04-13-2006 06:03 PM |
| how to cut fields | rajan_ka1 | Shell Programming and Scripting | 1 | 12-29-2005 05:55 AM |
| Awk - more than 99 fields? | DaveM | UNIX for Dummies Questions & Answers | 2 | 01-23-2001 01:34 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
cut: get either one or two fields
Hello,
I would like to extract one or two fields of a line. At the moment, I am extracting the first field of a line: Code:
command | cut -f 1 -d '.' > file if three fields, I want to be able to get the first two ie if line = X.Y.Z output X.Y if two fields, I want to be able to get the first one only. ie if line = X.Y output X How can I do this ? Thank you for any help Max |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|