RegExp in the command 'show' in TCL scripts

I have an EEM applet that runs a command to show with regex that works very well. However, when I converted the applet to TCL, I am having some problems with it. It is throwing an error on the line below:

If [catch {cli_exec $cli1 (fd) ' execute sh | "}] section ip-list of prefixes []] + seq 5 permit $ip_prefix\.0\/24 "} _cli_result] {}"

error $_cli_result $errorInfo

}

TCL seems to be catching the part [^] show command and try a substitution (trying to run "^"as a separate order "). I could surround the show with brackets {} command but then $ip_prefix will not substitute for the value of the variable. Is it possible to run this show command in TCL? Thank you.

C819G - 4 G-V-K9 #tclsh

C819G - 4 G - V - K9 (tcl) #set ip_prefix 10.10.10

10.10.10

C819G - 4 G - V - K9 (tcl) #sh run | section ip-list of prefixes []] + seq 5 permit $ip_prefix\.0\/24

invalid command name "" ^ ^

Invalid entry % detected at ' ^' marker.

It works:

C819G - 4 G - V - K9 (tcl) #sh run | ip prefix-list section------[-^-] + seq 5 permit $ip_prefix\.0\/24

IP-list of prefixes test seq 5 permit 10.10.10.0/24

Tags: Cisco Network

Similar Questions

  • 34xx/35xx version of the command 'show technical support '.

    Recently started a new job and have different models PowerConnect, that I manage on my 6248 I've been able to use the command "Show support", but that does not work on my 35xx or 34xx series switches. Y at - it equivalent command? I tried to look in the manual, but was not able to find what I'm looking for.

    On these switches, you will need to be more specific with the show commands. You can use # poster?, to see what commands are available.

    The most used most frequent are:

    # show running-config

    # See the version

    # show vlan

    # See the spanning tree

    # display arp

    The CLI guides can help provide additional information about each show command.

    http://Dell.to/1RnTNbd

    http://Dell.to/1QERcwG

    Hope you find it useful.

  • No number in boxes highlight for the command "Show Numbers"

    When you use the Windows speech recognition, the command "Show Numbers" will highlight all the actions available with a blue box, but there is no number in the blue box.  The boxes highlight meet orders if I guess what number of the box can be.  Any ideas why the numbers are missing?

    When you use the Windows speech recognition, the command "Show Numbers" will highlight all the actions available with a blue box, but there is no number in the blue box.  The boxes highlight meet orders if I guess what number of the box can be.  Any ideas why the numbers are missing?

    Just a guess, try a higher screen resolution.

  • Confused about the output of the command show vlan id

    I configured several VLANS on a switch. 3 VLANs, each assigned only one port. The output of the vlan see the brief shows me exactly what I expected:

    IOU1 #show vlan bis

    Ports of status for the name of VLAN
    ---- -------------------------------- --------- -------------------------------
    1 default active Et0/0, Et0/3, and1/3
    101 VLAN0101 active and 1/0
    102 VLAN0102 active and 1/1
    103 VLAN0103 active and 1/2

    1002 fddi-default law/unsup
    1003 token-ring-default law/unsup
    1004 default fddinet law/unsup
    1005 trnet default law/unsup

    But the confusion when I do a show vlan id for one of my VLAN it lists virtual local area network interface and then two other interfaces:

    IOU1 #show vlan id 102

    Ports of status for the name of VLAN
    ---- -------------------------------- --------- -------------------------------
    102 active VLAN0102 Et0/1, Et0/2, and 1/1

    Network type VLAN SAID MTU Parent RingNo BridgeNo Men BrdgMode Trans1 Trans2
    ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
    102 100102 1500 enet - 0 0

    Ports of secondary primary Type
    ------- --------- ----------------- ------------------------------------------

    Et0/1 and Et0/2 are trunks to two other switches. I don't understand why his list the trunk ports although I only expected to show and 1/1. Is the list these ports here because this vlan is connected via the ports of junction to the other switches? I don't know exactly what these two interfaces he said.

    I think that IOU and LIO behave this way. When you say true switch, on the platforms of nexus in my experience, they are same as what you have shown above as IOU.

    A switch as C3750, C3560, C3650, C3850 etc... they will out regular who you might be used to, i.e. not showing trunk interfaces in the release to id vlan.

    I hope this helps.

  • is there a way to tell firefox allow and remember the java plugin for all users via the command line or a script?

    Hello

    I have about 200 computers I want to push the next to parameter

    allow and remember the java plugin for firefox for all users
    

    is it possible to do this via a script or configuration file?

    You must create two files in the Firefox program folder.

    • local - settings.js file in the defaults\pref folder where you will find the channel - prefs.js
    • mozilla.cfg in the main folder of the Firefox program
  • Passing parameters to the command shell in MAXL scripts

    Hi all

    We try to run the following console MAXL


    MAXL > msh script.msh 100 c:\t.txt


    where script.msh is the line:

    "Shell ' echo $1 > > $2"

    We are looking to add a line with "100" text in the C:\t.txt file, but it is, in fact, create a file called $2 with the text "$1." it contains.

    How can you get around it?

    Thank you
    Moreover, the logfilename state you in the call to essmsh, is the file that STDOUT is redirected to, isn't?

    ^ ^ ^ No, it is a separate file.

    We noticed that the .err files are created even if there are no errors (empty files)

    ^ ^ ^ It's not a pain? I just go through and delete the .err file beforehand. You are in a more difficult situation because you have several .err files. I guess you could test for the length of the file to determine which ones to pay attention to.

    Kind regards

    Cameron Lackpour

  • Run the TCL Script to start the router

    I'm using a router 5000 series incorporated later and try to get my TCL script to run at startup of the router, with little success.

    It is the first time for me, when I went through the Cisco relevent documents, the official book on TCL script and many examples available online.

    Obviously, I'm missing something somewhere and it left me speechless. I thought it would be a simple task.

    Can anyone provide a step by step instruction/requirements for a TCL script to run on a Cisco router every time it starts?

    Hi Kyle,.

    With the adventerprisek9 image, you should not need to run this through an applet.  You should be able to run it directly from a policy of Tcl.

    Event Manager user Directorystrategie flash:

    event handler political test.tcl authorization bypass

    Mike

    Edit: By the way, when you use puts, the output should go in the syslog.  There were some bugs but where the output can go to various places or "stuck".  So please check the output of 'see the log' and see if the output went from there.

  • query on command show recyclebin.

    Hello
    I created a table and then I dropped it. After that, I issued a statement commit so now I am trying to view my table deleted using the command show recyclebin table_name, but I'm not able to get information on my table.

    the output should come as.


    See the recyclebin emp1.

    ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIMES
    ---------------- --------------------------------------------- ------------------- -----------------
    Emp1 BIN$ rHfcdmo4QGy64Z2 + uFqxXQ == $0 TABLE 2009-10 - 16:15:13:38

    but I am getting error in TOAD like invalid SQl statement.


    Please help on this.

    The Recycle Bin is enabled by default.

    To turn on the Recycle Bin:

    ALTER SESSION SET recyclebin = ON;

    ALTER SYSTEM SET = Recyclebin;

  • Execution of Tcl Script in command prompt

    Hi all

    Can someone show me please how to run a tcl script from the command prompt on a cisco router?

    See you soon

    Carlton

    You can run political EEM manually if they are registered with the no event detector.  So what you did is fine.  However, if you want to run it just to test it, take a look at https://supportforums.cisco.com/docs/DOC-12757 and scroll down to the section of the test.

  • Unable to wait 30 seconds and then call the TCL Script as Action?

    Hello and good afternoon all!

    I was browsing through different threads and did some research and I am unable to get my applet to wait 30 seconds and then call a script TCL to a succession of 'action '.  Here is the Basic script I am trying to run:

    Event Manager applet track-loopback1
    Event track 10 down state
    command action 1.0 cli 'enable '.
    Action 1.1, «config t» cli command
    Action 1.3 cli command "event manager applet-counting backwards.
    action 1.4 cli command 'event timer countdown 30 '.
    action 1.5 cli command "action 1.0 wait 30.
    Action 1.6 cli command "end".
    Action 1.7 cli command "tclsh Loopback1 - Notification.tcl.

    The goal of this applet is simply wait interface Loopback1 go down, and then launch the applet "-Countdown ' which waits 60 seconds before calling end my TCL script.  The pattern of ' countdown time 30 "and the" action 1.0 wait 30 "is my (lack of?".  :-)) understand that after counting 30 I need to a trial of the action - but I'm not 100% clear on this?  Ironically, he does, in fact, call the TCL script, it does not wait 30 seconds.  My current workaround is to simply throw a statement "after 30000' in the TCL script, but I'm really curious to know why it does not work as expected (well, as I expected to work anyway!).  Any help would be GREATLY appreciated.  Thank you very much!

    See you soon,.

    Travis

    See my response to https://supportforums.cisco.com/discussion/13009231/eem-applet-wont-fire... .  What you do not work, so you should not call tclsh to EEM anyway.

  • EEM Applet does not fire TCL script after expiration of the countdown

    We use currently EEM Applet below than securities has BGP route and if this path fails, it starts a countdown of 45 min, once the countdown expires, the router reloads. If the BGP route restores it will remove the countdown applet.

    I'm trying to change this applet to reproduce the same type of behavior, but instead to recharge after 45 minutes, I am changing the cell parameters via Script TCL or other means besides.

    Is this possible? Can someone direct me how to proceed?

    Cisco 1941 Version 15.4 (3) M2

    event handler applet track down
    Description "this applet will add the countdown applet when BGP 10.66.66.66 road goes down."
    Event track 10 down state
    command action 1.0 cli 'enable '.
    Action 2.0 cli command "config t.
    Action 3.0 cli command "event manager applet countdown."
    action 3.1 cli command "description This cmdlet is the countdown and will cause the router reload after 2700 seconds if BGP route is always down.
    Action 3.2 cli command "event timer countdown 2700".
    action 3.3 cli command "reload action 1.0.
    Action 4.0 cli command "end".
    command action 4.1 cli 'enable '.
    Action 4.2 cli command "wr mem".
    Event Manager applet track-up
    Description "this cmdlet will delete the countdown applet when restores BGP route to 10.66.66.66.
    Event State track 10 upwards
    command action 1.0 cli 'enable '.
    Action 2.0 cli command "config t.
    action 3.0 cli command "no event manager applet countdown."
    Action 4.0 cli command "end".
    !

    This is the applet changed, with that I have had the most success. The issue I'm running into is, sound without waiting 60 seconds (for testing I reduced to 1 minute) to run the tcl script. From my limited understanding, I discovered that, after the countdown event - the applet requires an action immediately after but does not accept a command like 'tclsh Cell.tcl' cli as 'action '. »

    event handler applet track down
    Event track 10 down state
    command action 1.0 cli 'enable '.
    Action 1.1, «config t» cli command
    Action 1.3 cli command "event manager applet countdown."
    action 1.4 cli command 'event timer countdown 30 '.
    action 1.5 cli command "action 1.0 wait 30.
    Action 1.6 cli command "end".
    Action 1.7 cli command "tclsh Cell.tcl.
    Event Manager applet track-up
    Event State track 10 upwards
    command action 1.0 cli 'enable '.
    Action 2.0 cli command "config t.
    action 3.0 cli command "no event manager applet countdown."
    Action 4.0 cli command "end".

    It is the TCL script that I use to run cellular changes.

    tclsh
    puts [open "flash: Cell.tcl' w +] {}
    ios_config "interface 1/0/0" "shut".
    ios_config "0/1/0 lte tech gsm cell".
    ios_config "interface 1/0/0" 'no shut '.
    After 10000
    ios_config "interface 1/0/0" "shut".
    ios_config exec 'cell auto 0/1/0 lte tech '.
    ios_config "interface 1/0/0" 'no shut '.
    }
    tclquit

    Thank you
    Robert

    These cmdlets will not accomplish what you want.  I also recommend never call EEM tclsh.  You don't need to do.  Use EEM MCI in native mode, or in your case, just use pure applets.  Take a look at https://supportforums.cisco.com/document/12723951/how-introduce-large-de... .  If you follow this example and put your config CLI commands in the countdown applet, you will be able to achieve what you want.

  • Deployment of the OMB via the TCL script

    I need to deploy all of the mappings in a module in a new target database. I want the configuration settings for
    (1) default operating mode = "DΘfinir base" and for
    (2) default audit level = 'NONE '.
    on all maps.

    It seems that the default repository for these parameters (and I can't find where these default values can be managed) are
    (1) default operating mode = "Line in function from set failover" and
    (2) level of auditing by default = "ERROR DETAILS" on all the mappings.
    While when I deploy via the script all mappings have these settings (which we do not want) as it appears that OMB orders use these repository/user settings. Card via interface OWB deployment allows you to change the settings of configuration as requires it, but it's the long answer.

    These configuration settings can be overridden in the TCL script via OMBDEPLOY or OMBALTER or any other command OMB parameter so all mappings are deployed/configured as
    (1) default operating mode = "DΘfinir base" and for
    (2) level of auditing by default = 'NONE' on all the mappings.

    Thank you
    Dave.

    Hi Dave

    Yes, you can set the code generation and the non-use of the properties of mode from a script...
    OMBALTER MAPPING "$map" DEFINED the VALUES of PROPERTIES (GENERATION_MODE, DEFAULT_OPERATING_MODE) ("SET_BASED", "SET_BASED")

    So that you can loop around all the cards and do these things, there are also a few experts on the Exchange utility, allowing you to block of updates quickly
    http://www.Oracle.com/technology/products/warehouse/htdocs/experts/multi_config.zip

    The model is available from scripts, for example to a PLSQL mapping batch you can query the properties as follows:
    OMBDESCRIBE CLASS_DEFINITION 'BATCH_MAPPING' GET PROPERTY_DEFINITIONS

    See you soon
    David

  • Photos... on the view menu, the option "Show sidebar" is not highlighted, nor the keyboard command works. Photos pretty useless for me without the sidebar.

    Photos... on the view menu, the option "Show sidebar" is not highlighted, nor the keyboard command works. Photos pretty useless for me without the sidebar.

    What version of the operating system and Photos you have - whether you use pictures you don't have OS x 10.9.4 as you say

    Maybe this thread will be hep - they found that drag the larger window solved the problem - Re: Option to display the sidebar photos on Mac is grayed out.

    LN

  • How to change Microsoft Security Essentials at the request of the parameters of scanning from the command line or in a script.

    Is it possible to change the parameters of the scheduled scan of the Microsoft Security Essentials from the command line or in a script?

    I know that I can use the command to schedule the MpCmdRun.exe tool command line to run, but that do not change or remove the existing scheduled scan that appears in the software. Run regedit to merge into the corresponding registry keys does not work because the keys are "locked", probably by the running of MSSE program.

    Suggest you post it in one of the forums dedicated to MSE - Microsoft Security Essentials: scanning, detection and removal of threats MowGreen Update Services - consumer safety

  • Foglight initialize a command on the PC and run a script that makes a sound or a banner on hold the workstation?

    How can we get foglight to invoke a command on the pc and run a script that makes a noise or a banner on my computer

    http://en.community.Dell.com/TechCenter/performance-monitoring/Foglight-administrators/f/4788/t/19552156#14120

    The question really selectively running a sound in a JavaScript browser session, do not turn something local on the user's PC.  The Sonic equivalent of an animated GIF as an analogy.

    The most difficult part, in Java, play a sound through various types and versions of browser without opening a 'player '.  This has been an incredibly difficult task by Oracle, on behalf of the whole being.  If you really want to dive into it, here are some links:

    http://docs.Oracle.com/javase/7/docs/TechNotes/guides/sound/programmer_guide/contents.html

    One approach that seems to have some promise for very small sound files is:

    http://stephengware.com/projects/soundtoclass/

    I got no time to mess around with it yet.

    This seems to have some promise, but still once, have not figured out how to operate:

    import java.awt.Toolkit

    Toolkit.getDefaultToolkit () .beep)

Maybe you are looking for