Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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://192.168.1.108/public');
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2022-06-27 04:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (86 votes). Check out past polls.

    Notices?