xargs
xargs turns input into arguments for a command.
Example
printf "a\nb\nc\n" | xargs echo files:
printf "1 2 3" | xargs -n1 echo n=
echo "x y" | xargs -I{} echo "[{}]"Result
files: a b c n= 1 n= 2 n= 3 [x y]
Exercise
One per call.
xargs 1 echo
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.