J
John
Have got a Perl script called from within a bash script.
Bash connects to a Samba share:
umount ~/Documents/bin/pdfs
mount -t smbfs //NAMEass@server/SHARE ~/Documents/bin/pdfs
Then it calls this Perl script:
#!/usr/bin/perl -w
my $sourcedir="~/Documents/bin/pdfs";
print "sourcedir=$sourcedir\n";
system("ls",$sourcedir);
I get:
ls: ~/Documents/bin/pdfs: No such file or directory
However if I copy the path from the error message and paste it onto
the command line behind 'ls' [ ls ~/Documents/bin/pdfs ], then the
shell lists the directory.
In an earlier try, I mounted the Samba volume via the Mac GUI and
pointed the script to something like /Volumes/pdfs. In that case it
found the files I was looking for.
Since I want this to run on a crontab and can't count on the volume
being mounted in the middle of a random night, I wanted to script the
Samba connection. Since I couldn't count on the volume NOT being
mounted either, I begin by unmounting anything that might already be
at that point.
John Campbell
Bash connects to a Samba share:
umount ~/Documents/bin/pdfs
mount -t smbfs //NAMEass@server/SHARE ~/Documents/bin/pdfs
Then it calls this Perl script:
#!/usr/bin/perl -w
my $sourcedir="~/Documents/bin/pdfs";
print "sourcedir=$sourcedir\n";
system("ls",$sourcedir);
I get:
ls: ~/Documents/bin/pdfs: No such file or directory
However if I copy the path from the error message and paste it onto
the command line behind 'ls' [ ls ~/Documents/bin/pdfs ], then the
shell lists the directory.
In an earlier try, I mounted the Samba volume via the Mac GUI and
pointed the script to something like /Volumes/pdfs. In that case it
found the files I was looking for.
Since I want this to run on a crontab and can't count on the volume
being mounted in the middle of a random night, I wanted to script the
Samba connection. Since I couldn't count on the volume NOT being
mounted either, I begin by unmounting anything that might already be
at that point.
John Campbell