So, the best way to xfer files is probably TFTP. Here is an
example for a config file but the principle is the same for .xsf and .py files.
Once you have the .xsf or .py file on your switch, you would issue the command "load script {scriptname}" where the script file name is given without the suffix.
That said, you could also simply vi a file and type i for insert and then copy and paste the script contents into your terminal session. Then wq! to write to the file and quit the vi editor.
Also here is some code that when run in a script does an ELRP one-shot on every VLAN, every port and reports loops. You could probably modify it to do what you want.
#usage: load script elrp_oneshot
# USE THIS SCRIPT AT YOUR OWN RISK
#
disable cli prompting
disable clipaging
enable elrp-client
set var sv "#ELRP POLL STARTED#"
show var sv
set var cli.out 0
show vlan
set var sv $TCL(split ${cli.out} "\n")
set var e $TCL(lsearch $sv *(B)*)
set var i 5
set var e ($e - 1)
while ($i < $e) do
set var cli.out 0
set var v $TCL(lindex $sv $i)
set var vn $TCL(lindex $v 0)
set var z $TCL(regexp {Mgmt} $vn)
if ($z == 0) then
conf elrp-client one-shot $vn port all print
set var p $TCL(split ${cli.out} "\n")
set var p1 $TCL(lsearch $p *NO*)
if ($p1 == -1) then
set var p1 $TCL(lindex $p 2)
set var p2 $TCL(lindex $p1 9)
set var p1 $TCL(lrange $p1 0 6)
set var p1 $TCL(concat $p1 $p2)
set var p2 $TCL(lindex $p 3)
set var p2 $TCL(lrange $p2 5 7)
set var p $TCL(concat $p1 $p2)
show var p
else
set var p1 $TCL(lindex $p 2)
set var p2 $TCL(lindex $p1 10)
set var p1 $TCL(lrange $p1 0 7)
set var p1 $TCL(concat $p1 $p2)
show var p1
endif
endif
set var i ($i + 1)
endwhile
disable elrp-client
set var sv "#ELRP POLL COMPLETED#"
show var sv
enable clipaging
enable cli prompting