M
Marv
Hello,
I've got an issue that I can't seem to figure out.
I'm trying to run some mount and rsync commands from inside a perl
script.
I've figured out from other postings that you have to use a system
call and seperate all the command line options with quotes and commas.
I'm not sure why this is, but I can never get the commands to work if
I enclose them with backticks? Can anybody explain this?
Anyway, if the commands could be enclosed in backticks I would have my
problem solved, but since I have to use system (), I can't seem to
figure out how to capture this data either to a variable or a file.
I've tried using '2>&1 tmp.errors' but this doesn't work either
because of the commas. Here is a sample of what I'm doing:
system (
"mount",
"-r",
"-t",
"smbfs",
"-o","username=$adminuser,password=$adminpass",
"//$ip/$ashare",
"/share/$nbname/$ashare",
"2>&1 tmp.errors"
);
This method doesn't work because it takes the '2>&1 tmp.errors' as
another option of mount and bombs out. If I include it at the end of
'/share/$nbname/$ashare' then it takes as part of the name of the
mount point and bombs out.
Can anybody help me capture this info? Or show me how this can be down
with backticks.
Thanks.
Marv
I've got an issue that I can't seem to figure out.
I'm trying to run some mount and rsync commands from inside a perl
script.
I've figured out from other postings that you have to use a system
call and seperate all the command line options with quotes and commas.
I'm not sure why this is, but I can never get the commands to work if
I enclose them with backticks? Can anybody explain this?
Anyway, if the commands could be enclosed in backticks I would have my
problem solved, but since I have to use system (), I can't seem to
figure out how to capture this data either to a variable or a file.
I've tried using '2>&1 tmp.errors' but this doesn't work either
because of the commas. Here is a sample of what I'm doing:
system (
"mount",
"-r",
"-t",
"smbfs",
"-o","username=$adminuser,password=$adminpass",
"//$ip/$ashare",
"/share/$nbname/$ashare",
"2>&1 tmp.errors"
);
This method doesn't work because it takes the '2>&1 tmp.errors' as
another option of mount and bombs out. If I include it at the end of
'/share/$nbname/$ashare' then it takes as part of the name of the
mount point and bombs out.
Can anybody help me capture this info? Or show me how this can be down
with backticks.
Thanks.
Marv