I am trying to run a curl command which will need arguments coming in from a pipe
some operation | sort | head -n -2 | curl -s "blah/blah/<argument goes here>/blah"
some operation | sort | head -n -2 | xargs -l "$" curl -s "blah/blah/$/blah"
xargs: $: No such file or directory
See BashFAQ #1 for the best-practices way to read a string line-by-line:
#!/bin/bash # ^^^^ - not /bin/sh, or <() will be a syntax error while IFS= read -r line; do curl -s "blah/blah/$line/blah" done < <(some operation | sort | head -n -2)