In Bash, I want to get the Nth word of a string hold by a variable.
For instance:
STRING="one two three four" N=3
Result:
"three"
What Bash command/script could do this?
echo $STRING | cut -d " " -f $N
2.1m questions
2.1m answers
60 comments
57.0k users