If I have a file with three lines like this
line 1
line 2
curl -H 'Content-Type: application/json' -d '{"user": "joe"}' localhost/api
How can I execute a third line as command in bash?
I tried
$(sed '3q;d' file)
and
`sed '3q;d' file`
but it seems like in both cases the command is only partly executed, I don't get the right result. Of course, calling curl directly works fine.