Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Secure Shell

Reply
 
Thread Tools Display Modes
  #1  
Old 01-24-2012, 12:48 PM
toloughlin's Avatar
toloughlin toloughlin is offline
Senior Member
 
Join Date: Feb 2004
Location: Nashua, NH
Posts: 378
Ctrl+V, Ctrl+M

I'm trying to get a button to put the following into VI, to remove the Windows Control Characters in a file (currently on SCRT 6.7.3 (x64))

Currently, I hit : to enter into the command portion within VI & then type:

%s/\(^M\)//

The ^M above is actually Ctrl+V Ctrl+M

Is there a way I can use a button on the button bar to put that in there?
I tried just doing a string with ^M ... but no luck.

Thanks!
__________________
----------------------------------------------
Tom O'Loughlin

Last edited by toloughlin; 01-24-2012 at 01:21 PM. Reason: clarification
Reply With Quote
  #2  
Old 01-24-2012, 02:07 PM
MrC MrC is offline
Registered User
 
Join Date: Mar 2004
Posts: 216
Use the string

:%s/\026013//

\026 is ^V, and 013 is ^M
Reply With Quote
  #3  
Old 01-24-2012, 02:12 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,096
SecureCRT's send-string field allows for the use of escaped octal values for sending non-printing ASCII control characters to a remote device.

^V must be specified as the octal code: \026
^M must be specified as the octal code: \015

See the attached screen-shot: "ASCII Ctrl Codes - Help.png"

In addition, since the backslash character '\' has special meaning within a SecureCRT send-string definition, when you need to send a literal backslash without worrying about it conflicting with pre-defined escape codes that have special meaning to SecureCRT (for example \e, \r, \b, \p, \v, \n, \t), you should specify the octal code for backslash (\134) instead of using the literal '\' character in your send-string specifications.

In a nutshell...
  • You want the remote to receive this: %s/\(^M\)//
  • The equivalent send-string spec for a SecureCRT button config would be: %s/\134(\026\015\134)//
  • If you also wanted to first "press" ESC followed by ':' to get into vi's command mode, the send-string spec would be: \033:%s/\134(\026\015\134)//

Does this help to answer your question?
Attached Images
File Type: png ASCII Ctrl Codes - Help.png (43.0 KB, 1060 views)
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support
Reply With Quote
  #4  
Old 01-24-2012, 02:16 PM
MrC MrC is offline
Registered User
 
Join Date: Mar 2004
Posts: 216
and to clarify the discrepancy between my use of 013 vs \015... a three digit decimal sequence may be used to follow a ^V in Vim. Note the lack of \ in my example.

13 in decimal is the same as the \015 octal code.
Reply With Quote
  #5  
Old 02-03-2012, 09:26 AM
toloughlin's Avatar
toloughlin toloughlin is offline
Senior Member
 
Join Date: Feb 2004
Location: Nashua, NH
Posts: 378
I totally forgot about this -- thanks guys, worked like a charm!
__________________
----------------------------------------------
Tom O'Loughlin
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 06:05 AM.