06-22-2011 12:40 AM - edited 03-07-2019 12:55 AM
Hi all,
I need to know which ports are used on my switches and I want to export the result in a file. I tried the following command:
sh int | include connected | tee tftp://myIp/test.txt
The command execute itself without error but also doesn't create the test.txt file on the computer assigned by myIp.
When I tried:
sh int | tee tftp://myIp/test.txt it worked well, but the file is way too big and I have to work on it to extract the informations I need.
Is there a way to obtain the desired result in one command.
Thanks in advance, bye
Solved! Go to Solution.
06-22-2011 02:17 AM
You're welcome.
Unfortunately you can't use the pipe like it can be used in Linux that's why your first command didn't write anything on the tftp server. But you can grep the output of sh int status for the word connected and it should be good.
Regards.
Alain.
06-22-2011 12:52 AM
Hi,
You could try sh int status | tee tftp://x.x.x.x
Regards.
Alain.
06-22-2011 01:17 AM
Thanks Alain,
It is not the exact result I would, but this command creates a file easier to manage for me. Thanks a lot for your fast answer.
Regards
06-22-2011 02:17 AM
You're welcome.
Unfortunately you can't use the pipe like it can be used in Linux that's why your first command didn't write anything on the tftp server. But you can grep the output of sh int status for the word connected and it should be good.
Regards.
Alain.
06-22-2011 02:35 AM
Yes, it is the solution I used
One more thanks, Alain.
Regards
06-22-2011 04:41 AM
Balthazar,
You could give this a try, it should give you what you want.
add this to the config
alias exec sisc show interface status | include connected
then run this to get the output.
sisc | tee tftp://mylp/test.txt
That should work.
Mike
06-22-2011 05:05 AM
Hi mike,
Well thought off indeed
I rate you 5 for this. Oups i can't rate you at least I can't see the rating
Regards.
Alain.
06-22-2011 05:52 AM
Mike, that was a good idea. Alain, I'll take care of Mike's rating for you.
06-22-2011 05:55 AM
This opens up a random question for me, Mike. In lieu of the multi-piping grep ablility that you have in linux, is it possible to create an alias that references another alias to get a similar effect?
06-22-2011 06:52 AM
Hello Mike (Burleyman),
I am sorry, I tried your solution, but I have the same result as described in my first message. I don't receive any error message, but I don't receive desired result.
Have you tried your solution ? Does it work for you ?
Thanks in advance
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide