xargs
bash-3.00# cat f.txt1 2 3 4 5 6 7 8 9 10 11 12 13 14
bash-3.00# cat f.txt | xargs -n 3
1 2 3
4 5 6
7 8 9
10 11 12
13 14
----------------
echo "helloXhelloXhello"
----------------
----------------
bash-3.00# cat f.txt | xargs -n 3
1 2 3
4 5 6
7 8 9
10 11 12
13 14
----------------
echo "helloXhelloXhello"
helloXhelloXhello
----------------
echo "helloXhelloXhello" | xargs -d X -n 2
hello hello
hello
----------------
echo 12345 | tr '0-9' '987654321'
87654
echo 87654 | tr '987654321' '0-9'
12345
Comments
Post a Comment