Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

Using "cut" for field "N" thru the "last" field

SOLVED
Go to solution
john guardian
Super Advisor

Using "cut" for field "N" thru the "last" field

Isn't there a method for using cut to grab, for instance, the 3rd thru the "remaining" fields in a space delimited string.

String example: ExStr="One 2 three for"

Let's say I want "all fields beyond field 2 (3-end of the string). Doesn't cut work with some limited set of wildcards for this...

IE: echo $ExStr | cut -f 3- -d " "

3 REPLIES
larsoncu
Advisor
Solution

Re: Using "cut" for field "N" thru the "last" field

3- would specify 3 thru the last
Sandman!
Honored Contributor

Re: Using "cut" for field "N" thru the "last" field

# echo "one two three four five six seven eight nine" | cut -f3- -d" "
Highlighted
john guardian
Super Advisor

Re: Using "cut" for field "N" thru the "last" field

Thanks.