How can I remove the number after switch name?


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?

10 replies

Userlevel 1
Are the number of commands you've executed on the switch.
Jairo Rojas Herrera wrote:

Are the number of commands you've executed on the switch.

Yes, I know what those numbers represent. But I don't want to see it. I know exactly how many commands I've executed.
Userlevel 6
Jairo Rojas Herrera wrote:

Are the number of commands you've executed on the switch.

Currently there is no way to remove it. Sorry
Userlevel 6
Hi Ali,

When you login into the switch it starts with #1 that represents the next CLI number/position in history buffer.

As far as I know there is no CLI to clear or disable this counter.

If you logout/login you can get the initial value #1
Henrique wrote:

Hi Ali,

When you login into the switch it starts with #1 that represents the next CLI number/position in history buffer.

As far as I know there is no CLI to clear or disable this counter.

If you logout/login you can get the initial value #1

Hi Henrique,

Thanks. Yes, I figured it out but I was hoping there is an easier way.
Userlevel 7
Hi Ali,
Welcome to The Hub!

Unfortunately, there is no way to disable the command count on the CLI.
It's not necessary remove this number..
Userlevel 4
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.
Dorian Perry wrote:

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.

Hi Dorian,

That's why I need to remove it. I am not familiar with regular expression. How can I do it in C++?
Userlevel 4
Dorian Perry wrote:

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 believe this will do it:

std::regex re("switchName.[0-9]+\s#");

Reply