How can I remove the number after switch name?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎03-03-2016 04:02 PM
I have connected to the switch using a telnet session. The prompt that I have looks something like this:
switchName.1 #
After issuing a command the number right after the switch name increments. So the prompt is:
switchName.2 #
For different reasons I don't want to see that number. Is there a way I could remove that number?
switchName.1 #
After issuing a command the number right after the switch name increments. So the prompt is:
switchName.2 #
For different reasons I don't want to see that number. Is there a way I could remove that number?
10 REPLIES 10
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎03-04-2016 03:42 PM
Hi Ali,
I want to point out that if you need to remove the number for scripting purposes, a regular expression could be used to detect the prompt and avoid conflicts due to the changing number.
I want to point out that if you need to remove the number for scripting purposes, a regular expression could be used to detect the prompt and avoid conflicts due to the changing number.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎03-04-2016 03:42 PM
I believe this will do it:
std::regex re("switchName.[0-9]+\s#");
std::regex re("switchName.[0-9]+\s#");
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎03-04-2016 03:42 PM
Hi Dorian,
That's why I need to remove it. I am not familiar with regular expression. How can I do it in C++?
That's why I need to remove it. I am not familiar with regular expression. How can I do it in C++?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎03-03-2016 07:22 PM
It's not necessary remove this number..
