[lkml]   [2003]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [RFD] Combined fork-exec syscall.
    On Mon, 28 Apr 2003 10:16:21 EDT, "Richard B. Johnson" said:

    > Read the bash documentation `man bash`. The first argument becomes
    > $0 (the process name), the second becomes $1, etc. Please don't
    > just keep assuming that I don't know what I'm talking about.
    > $ sh -c 'ignore echo a b c'
    > Works fine.

    [~]2 /bin/bash -c ignore echo a b c
    echo: line 1: ignore: command not found
    [~]2 /bin/bash -c 'ignore echo a b c'
    /bin/bash: line 1: ignore: command not found

    Obviously, tokenization makes a difference here. ;)

    So let's try forcing $0 to /bin/bash rather than 'ignore'...

    [~]2 sh -c '/bin/bash echo a b c'
    echo: /bin/echo: cannot execute binary file

    Correct, but unexpected results..

    [~]2 sh -c /bin/echo echo a b c

    [~]2 sh -c '/bin/echo a b c'
    a b c

    Again, tokenization matters - try working out what the value of argc is
    for the exec of /bin/bash for each of these cases...

    Dick, do you have an 'ignore' in your $PATH?

    [unhandled content-type:application/pgp-signature]
     \ /
      Last update: 2005-03-22 13:35    [W:0.018 / U:26.492 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site