hi! I need to mount a window share on a network. im using fedora 13. i created a perl script myscript.pl. this is its content:
my $cmd = "sudo mount -o username='admin',password='',rw,uid='customer +',gid='customer' '//192.168.1.103/shared' '/home/customer/mnt'"; my $res = `$cmd`;
if i ran the script on a terminal (eg. open terminal ang type perl myscript.pl) it was able to mount properly. but the problem here is that if i called the script via a shortcut (launcher) it simply doesnt mount. not sure what is happening. so i tried this..
my $cmd = "sudo mount -o username='admin',password='',rw,uid='customer +',gid='customer' '//192.168.1.103/shared' '/home/customer/mnt'"; my $res = `gnome-terminal -e "$cmd"`;
it now works, but the problem is that i dont know how to wait for the mounting. my script simply opens a gnome-terminal then continues with the script and exits. it didnt even wait for the mounting to complete. i need to catch if it mounted or not. so how can i do this?

In reply to mount cifs using perl and sudo and mount by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.