I want to set in TCL the below error message as a variable and compare with the error message from a network switch, by-passing the special characters
<
Well, you can use wrap it in curly brackets as follows:
set x {Use [slot/port] or ["portname"] or [slot/] or [].}
Alternatively, you can escape special characters with backslash.