We can also do it without xargs by using sys.stdin to read from pipe
e.g:
yes 'Mozilla%2F5.0%20%28Macintosh%3B%20U%3B%20Intel%20Mac%20OS%20X%2010.6%3B%20en' |\
head -n 10 |\
python3 -c "import sys, urllib.parse as ul; [print(ul.unquote_plus(l), end='') for l in sys.stdin]"
We can also do it without
xargs
by usingsys.stdin
to read from pipee.g:
Thanks for the tips!