Guest User

Untitled

a guest
May 26th, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. $smburl = `pbpaste`;
  4. $smburl =~ s"\n" "g;
  5. if ($smburl =~ m"^\\\\([^\\]*)\\([^\\]*)\\(.*)") {
  6. my ($server, $share, $path) = ($1, $2, $3);
  7. if (! -d "/Volumes/$share/") {
  8. system("osascript -e 'mount volume \"smb://$server/$share\"'");
  9. }
  10. $path =~ s"\s*$"";
  11. $path =~ s"\\"\/"g;
  12. $path =~ s"\s"\\ "g;
  13. system("open /Volumes/$share/$path");
  14. }
Add Comment
Please, Sign In to add comment