|
Hi All,
I am trying to create a folder with "&" in itz name (Ex: TS_&_ABC) with the help of perl's ssh command in another server. The exact command I am triggering in the code is
ssh("-i",$identity_file,"abc.abc.net","mkdir -p /opt/abc/mailboxes/mail/TS_&_ABC");
This creates a folder "TS_" but throws up an error
sh: line 1: _ABC: command not found.
We have already tried enclosing the folder name with single-quotes like
ssh("-i",$identity_file,"abc.abc.net","mkdir -p /opt/abc/mailboxes/mail/'TS_&_ABC'");
Apart from this we had also tried by putting a backslash before the "&"
But no use.
Please help how we can escape the "&" symbol in the perl's ssh command.
Thanks in advance
Regards,
Anand.
|
|
|
#im not sure about this but have you tried the following?
my $tough_name = "TS_&_ABC"; #or 'TS_&_ABC'
ssh("-i",$identity_file,"abc.abc.net","mkdir -p /opt/abc/mailboxes/mail/$tough_name");
|
|
|
yes we tried to assign the value to variable as u posted down
my $tough_name = "TS_&_ABC"; #or 'TS_&_ABC'
but it was of no use.
please help me out with ssh command in creating a folder having & in its name.
Regards
sudarshan
|
|
|
#a thought...
#thing is that everything within "" gets interpreted somehow.. and that often changes things.
#so have u tried not having that crucial argument in "" but in ''?
#like this:
ssh("-i",$identity_file,"abc.abc.net",'mkdir -p /opt/abc/mailboxes/mail/TS_&_ABC');
|
|
|
|
|
Nope It didnt work...
i tried to the scp command with single quotes, but it was not successfull in creating a folder.
Still searchinhg for solutions.
Waiting for ur reply.
regards
Sudarshan
|
|
|
|
|
|
|
// |