Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

perl system() interactive/noninteractive question

by renegadex (Beadle)
on Oct 19, 2010 at 02:43 UTC ( #866092=perlquestion: print w/replies, xml ) Need Help??

renegadex has asked for the wisdom of the Perl Monks concerning the following question:

i have this code inside a perl script.
system('gvfs-mount smb://');
if i open a gnome-terminal and run my script there, the network share is mounted on my computer. but if i change the permission of the script into 'allow executing file as a program' and double clicked on the script and select run. i doesnt mount the network share. the same happens when i create a desktop launcher(application). but if i create a desktop launcher(application in terminal) it mounts properly. what is happening? i need to run the script as an application and not an application in terminal.
Mabuhay Civil Engineers! :D

Replies are listed 'Best First'.
Re: perl system() interactive/noninteractive question
by ikegami (Patriarch) on Oct 19, 2010 at 03:00 UTC
    Sounds like gvfs-mount wants a terminal. I don't see what this has to do with Perl.
Re: perl system() interactive/noninteractive question
by Anonymous Monk on Oct 19, 2010 at 02:47 UTC
    When it fails to mount, what is the error message you get?
      hey thats funny, i was trying to figure out how to extract the error message, and was having no success. and i thought i might need to put the header line
      #!/usr/bin/perl -w
      to enable warnings and my script can now mount! wow i think problem is solved! tnx for the reply!
      Mabuhay Civil Engineers! :D
        Aha, the old shebang quandry
Re: perl system() interactive/noninteractive question
by ahmad (Hermit) on Oct 19, 2010 at 22:51 UTC

    Try specifying the full path of the command gvfs-mount command, and make sure you have all the required environment variables set in your perl script.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://866092]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2023-06-09 14:13 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (36 votes). Check out past polls.