SourceForge has been redesigned. Learn more.

Escaping square brackets

Paul Brown
  • Paul Brown

    Paul Brown - 2010-07-14

    Hi all,

    I am having trouble with some escape characters.  I have a script that expects:


    on the command line.  But I can't seem to escape the square brackets.  My code was:

    expect "CONFIRM \[y\]: "
    send "y\r"

    I have tried a number of escape sequences for the square brackets such as:

    expect "CONFIRM \: "

    but have got nowhere.  I have got this working before but have lost the file.  It was something quite annoying with a lot of back/forward slashes.  Any help would be greatly appreciated, thanks for looking.

  • Bill  Zhao

    Bill Zhao - 2016-10-29

    Yes Thanks, the problem has blank me very long time


Log in to post a comment.