Re: Accessing Samba - Mount Volume Possible?
Rich, This was _absolutely_ tremendously helpful. Thanks. /Michael #!/usr/bin/perl if(-f "/users/userid/.nsmbrc") { print "mounting share\n"; system('mount_smbfs -W workgroupname //username@domain/share /users/userid/myshare'); } else { print "password file does not exist\n"; } __END__
Re: puzzling results from missing she-bang
Peter, Thanks again. Now, I have it clear. /Michael > >> Thanks for your response. I remain puzzled, however. Your response >> seems to imply that if I invoke "print" from the command line, it will >> be interepreted. This is not the case, it errors. > > Sure it will - if you are using the sh shell. Try this: > > zany:~/unix/avr/avr/include% sh > zany% print "hello"; > hello > zany% exit > zany:~/unix/avr/avr/include% > > (ie, type: shprint "hello";) > > Enjoy, >Peter.
Re: puzzling results from missing she-bang
>> >> Note the missing "she-bang" line: #!/usr/bin/perl -w Note also that I >> didn't tell the shell "how" to execute the file. So the file is set to >> executable, but I thought it should error. Is that line not necessary >> on >> a Mac for some reason? How is this a Mac thing? It is not functional on >> other unix machines I have access to (and I tried various shells, >> including tcsh & bash). I repeated the experiment with no ".pl" >> extension, that isn't it. >> >> I suspect that it is a shell issue of some kind. >> >> /Michael Turner >> > > Not an issue. No shebang line means that 'exec(2)' will invoke your > standard > shell on it. 'print' is defined in some 'bash' or 'ksh' environments, > or you > may have such an alias or local program. > Bob, Thanks for your response. I remain puzzled, however. Your response seems to imply that if I invoke "print" from the command line, it will be interepreted. This is not the case, it errors. /Michael Turner
puzzling results from missing she-bang
I performed a test, and was surprised by the results. Can anyone tell me why the result occurs? File: -rwxr-xr-x 1 mt staff 25 Apr 26 19:07 hw.pl contents: print "Hello, World.\n"; command ../hw.pl results: Hello, World. Note the missing "she-bang" line: #!/usr/bin/perl -w Note also that I didn't tell the shell "how" to execute the file. So the file is set to executable, but I thought it should error. Is that line not necessary on a Mac for some reason? How is this a Mac thing? It is not functional on other unix machines I have access to (and I tried various shells, including tcsh & bash). I repeated the experiment with no ".pl" extension, that isn't it. I suspect that it is a shell issue of some kind. /Michael Turner