Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: system() vs `backtick`

by hossman (Prior)
on Aug 07, 2004 at 00:31 UTC ( #380789=note: print w/replies, xml ) Need Help??

in reply to system() vs `backtick`

Many people have have pointed out the difference between `` and system(), but I'd like to suggest that the problem you're seeing might not be something you need to fix in your perl script. The problem might be that in upgrading your RetHat distro, the program(s) you are executing using system() may have changed, such that if they detect they are running attached to a terminal, they wait for input on STDIN. (and in the old version, the program may not have assumed this).

It's also important to remember that system() adn `` can/will pass your input to "/bin/sh -c" if it contains shell metacharacters, and on many newer systems /bin/sh is just a symlink to /bin/bash -- which may also be why you are now seeing a different in the behavior of your script. Your old distorbution may have genuinely had "sh" installed, which may have involved your program(s) differently so that they didn't know they were attached to a terminal.

Replies are listed 'Best First'.
Re^2: system() vs `backtick`
by etcshadow (Priest) on Aug 07, 2004 at 02:45 UTC
    Regarding the compatibility of bash and sh... Bash is supposed to run in a compatibility when invoked as "sh" (by "compatibility mode" I mean that it should function in exactly the same way as sh). Of course, I cannot speak for how well it pulls this off. :-D
    ------------ :Wq Not an editor command: Wq

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://380789]
[erix]: thanks, cya :)
[Your Mother]: Sorry, I missed you.

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2017-01-18 00:31 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (159 votes). Check out past polls.