Search code examples
bashunixifs

Using the internal field separator with curl


When I do...

ls$IFS-l

... I get the output I expect.

When I do...

curl$IFShttp://www.google.com

... I don't.

Am I misunderstanding internal field separators? How could I run a curl command without using any space characters?


Solution

  • You need to put the variable within curly brackets, otherwise the shell looks for a variable called "IFShttp...":

    curl${IFS}http://www.google.com