SyntaxFix
Write A Post
Hire A Developer
Questions
You could try awk
echo "word1 word2" | awk '{ print $1 }'
With awk it is really easy to pick any word you like ($1, $2, ...)