codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Folder name with "&" not getting created with ssh in perl  Sudarshan H at 12:38 on Friday, August 08, 2008
 

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.

  Re: Folder name with  mimir at 13:47 on Friday, August 08, 2008
 

#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");





  Re:- Folder name with  Sudarshan H at 13:57 on Friday, August 08, 2008
 

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

  Re: Folder name with  mimir at 14:01 on Friday, August 08, 2008
 

#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');




  Re: Folder name with  mimir at 18:52 on Friday, August 08, 2008
 

so did that work or no?

  Re: Folder name with  Sudarshan H at 06:06 on Monday, August 11, 2008
 

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









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Re: Folder name with
•  What does this do?
•  is automating javascript through VBA possible??
•  Re: How do i deactivate my button
•  Set target to _blank in javascript
•  onclick multiple functions
•  ONUNLOAD
•  How to replace the div content onclick?
•  Engine for site on Java Script


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008