title: How can I pass new lines to an argv parameter when IFS is set to something, the way command output does here?
body: <p>How can I pass new lines to an argv parameter when IFS is set to something, the way command output does here?</p>
  
  <p>Note, i'm doing this as a test to try to figure out how things work in unix. Not that i'd actually want new lines in an element of argv!</p>
  
  <p>I have this program that shows argv.</p>
  
  <pre><code>$ cat blah.c
  #include &lt;stdio.h&gt;
  
  int main(int argc, char *argv[]) {
          int i = 0;
          while (argv[i]) {
                  printf("argv[%d] = %s\n", i, argv[i]);
                  i++;
          }
          return 0;
  }
  
  $
  
  
  $gcc blah.c -o blah
  $
  </code></pre>
  
  <p>I notice that if I set IFS equal to something, or even just <code>IFS=</code> or IFS=<code>\n</code> Anything other than the default <code>unset IFS</code> So, e.g. IFS="{" then command output expansion gives multiple lines set to one argument e.g. to argv[1]</p>
  
  <pre><code>ubuntu@ubuntu:~/aaa$ IFS="{"
  ubuntu@ubuntu:~/aaa$ 
  ubuntu@ubuntu:~/aaa$ ./blah `find .`
  argv[0] = ./blah
  argv[1] = .
  ./blah
  ./blah.c
  ./b
  ./a
  </code></pre>
  
  <p>Now if I try to pass arguments to ./blah, then I can't get multiple lines in argv[1] ! (which i'm interested in doing, as a test)</p>
  
  <pre><code>ubuntu@ubuntu:~/aaa$ ./blah "g h"
  argv[0] = ./blah
  argv[1] = g h
  ubuntu@ubuntu:~/aaa$ ./blah g h
  argv[0] = ./blah
  argv[1] = g
  argv[2] = h
  ubuntu@ubuntu:~/aaa$ ./blah g\n h
  argv[0] = ./blah
  argv[1] = gn
  argv[2] = h
  ubuntu@ubuntu:~/aaa$ ./blah "g\n h"
  argv[0] = ./blah
  argv[1] = g\n h
  ubuntu@ubuntu:~/aaa$
  </code></pre>
  
  <p>So, what is <code>find .</code> expanding to, that is leading multiple lines to get sent to argv[1] ?</p>
  
  <p>Such that I can't reproduce the phenomena when I try to pass arguments to a program?</p>