Header Only - DO NOT REMOVE - Extreme Networks

How can I print a message after executing an .xsf script?


I am given some .xsf scripts that I just load using the
load script scriptName.xsf
[/code]The scripts do not print out anything. If possible I'd like to see a message printed after the execution like

Done! [/code]Is it possible? It should be very simple but I cannot find any commands which print out messages in the manual. I tried

echo

but it is not supported. Is there a guide to .xsf scripting?

6 replies

Userlevel 6
I don't think that feature was added. But when the script is done it gives your prompt back.

You can do the same thing with python. and print ("Done!") at the end.
Userlevel 7
Ali, There's a guide out there somewhere. I'll look for it - maybe someone can share it before I get to it.
Meanwhile, there's a lot of example scripts on our GitHub page that you might be able to borrow code from.
https://github.com/extremenetworks/ExtremeScripting/tree/master/EXOS/CLI_Scripting

Hope this helps!
Userlevel 6
easy python script. Just save it as a .py file and run it like you would a .xsf.

exsh.clicmd('show vlan', True)
exsh.clicmd('show port conf no', True)
exsh.clicmd('show vlan "Default"', True)
print ("Done!")
Userlevel 6
Credit goes to Drew C. Place these two lines at the end of your script

set var done "Done!"
show var done

X450G2-48p-G4.16 # load sc s.xsf
Done!
* X450G2-48p-G4.17 #
Stephen Williams wrote:

Credit goes to Drew C. Place these two lines at the end of your script

set var done "Done!"
show var done

X450G2-48p-G4.16 # load sc s.xsf
Done!
* X450G2-48p-G4.17 #

Thank you so much. That's exactly what I needed.
Userlevel 3
Hi,

you can also send info to log, like: create log entry "Test string..."

--
Jarek

Reply