in reply to system vs backticks

The primary difference between system and backticks, as far as I am aware, is that backticks always call a shell to parse the command; whereas, system might not, if you pass it a list. However, why a shell would not be inheriting environment variables from its parent environment is something I cannot explain. I don't know that much about shells, and an any case you haven't said what operating system this is happening on, what shells are installed, what the default shell is for the user the script is running as, and so on and so forth. The best guess I can hazzard is that this has something to do with it.

Replies are listed 'Best First'.
Re^2: system vs backticks
by mrpeabody (Friar) on Sep 08, 2005 at 17:32 UTC
    The primary difference between system and backticks, as far as I am aware, is that backticks always call a shell to parse the command; whereas, system might not, if you pass it a list.

    And that backticks return the command's output whereas system returns its exit value.

      Oh, yes, that too. I'd forgotten because I usually open a pipe if it's the output I'm after.