Thursday, March 19, 2009

Copy paste '?' characters on Cisco IOS CLI

The Cisco IOS command line interface (CLI) has the special character '?' which you cannot insert into a literal string. One method of doing that is to do a and then type '?' (without the quotes) and then the special character gets inserted in the string.

However, when you are copy-pasting IOS CLI commands, it might be tough. The simplest way is to open the file in vim and just do this:
:%s/?/Control-V Control-V?/g
which will add the special escape character "Control V" in front of every question mark.

The other method (for all you Windows Notepad folks) is to copy paste the character in the next line:

without the trailing newline and do a search and replace of every ? with ? in the text file. Then you can copy paste the file.

3 comments:

  1. 4.5 years later I found this and it helped me delete a dir called "?".

    Thank you, Sudipta,
    N

    ReplyDelete
  2. I gained new knowledge from well written content of this blog. It is showing some different kind of strategy to keep work better and improve with every new assignment. Gracefully written blogCisco RV042

    ReplyDelete
  3. Do you need to increase your credit score?
    Do you intend to upgrade your school grade?
    Do you want to hack your cheating spouse Email, whatsapp, Facebook, instagram or any social network?
    Do you need any information concerning any database.
    Do you need to retrieve deleted files?
    Do you need to clear your criminal records or DMV?
    Do you want to remove any site or link from any blog?
    you should contact this hacker, he is reliable and good at the hack jobs..
    contact : cybergoldenhacker at gmail dot com

    ReplyDelete