Skip to main content
expanded sth; capitalized first letter of sentence; added formatting to sample elements
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 265

ifIf I have sth.something like:

echo 1 2 3 4 5 6

or

echo man woman child

what do I have to put behind the pipe to pick out one element of 1 2 3 4 5 61 2 3 4 5 6 or man woman child man woman child?

echo 1 2 3 4 5 6 | command
3

if I have sth. like

echo 1 2 3 4 5 6

or

echo man woman child

what do I have to put behind the pipe to pick out one element of 1 2 3 4 5 6 or man woman child ?

echo 1 2 3 4 5 6 | command
3

If I have something like:

echo 1 2 3 4 5 6

or

echo man woman child

what do I have to put behind the pipe to pick out one element of 1 2 3 4 5 6 or man woman child?

echo 1 2 3 4 5 6 | command
3
Source Link
Abdul Al Hazred
  • 27.7k
  • 26
  • 67
  • 92

How to pick a random element from the output of a command?

if I have sth. like

echo 1 2 3 4 5 6

or

echo man woman child

what do I have to put behind the pipe to pick out one element of 1 2 3 4 5 6 or man woman child ?

echo 1 2 3 4 5 6 | command
3