Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

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

SOLVED
Go to Solution
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
Advisor

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

3- would specify 3 thru the last
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
Super Advisor

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

Thanks.