Pipe the result of a cut command to curl
Leverage command substitution, $()
:
curl "$(grep ... | cut -d, -f 3)"
Here $()
will be substituted by the STDOUT of the command inside $()
i.e. grep ... | cut -d, -f 3
, as this is done by the shell first so the curl
command would be finally:
curl <the_url>
Another solution without substitution:
grep theName | cut -d, -f 3 | xargs curl > result.txt