CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
Folder name with "&" not getting created with ssh in perl

 



mail2sanand
New User

Aug 8, 2008, 5:34 AM

Post #1 of 2 (1419 views)
Folder name with "&" not getting created with ssh in perl Can't Post

Hi All,Blush
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. Unsure

Please help how we can escape the "&" symbol in the perl's ssh command. Pirate

Thanks in advance

Regards,
Anand. Wink


KevinR
Veteran


Aug 8, 2008, 9:43 AM

Post #2 of 2 (1402 views)
Re: [mail2sanand] Folder name with "&" not getting created with ssh in perl [In reply to] Can't Post

try two backslashes:

TS_\\&_ABC"
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives