Executing Tcl Script from Command Prompt

Hello All
Can someone please show me how to execute a tcl script from the command prompt on a cisco router?
Cheers
Carlton

Hi,
Assume that you have tcl script to ping 3 ip address as below.
foreach address {
1.1.1.1
2.2.2.2
3.3.3.3
} {ping $address}
Use "tclsh" command and copy the script. That should do the job. Please find below example.
R1#tclsh
R1(tcl)#foreach address {
+>(tcl)#1.1.1.1
+>(tcl)#2.2.2.2
+>(tcl)#3.3.3.3
+>(tcl)#} {ping $address}
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
R1(tcl)#
Hope this helps.
Regards
Najaf
Please rate when applicable or helpful !!!

Similar Messages

  • Test Execution hangs while executing a test from Command prompt option

    I have done the following
    1) Created a script Test driver
    2) Added different scripts as Script->Properties->Assets to the driver script
    3) Call each of this asset script from TestDriver using command getScript("<<ScrptName>>".run(1, true, true, true);
    4) Now calling this TestDriver script from command prompt with command
    e:\\OracleATS\\agent
    runScript.bat E:\\INTEGRATION_SERVICES\\Identity_management\\Automation\\Scripts\\MasterScripts\\TestDriver
    TestDriver.jwg
    The script execution hangs at "Initializing VU 1 for Script TestDriver. After few mintues of seeing this message i get error "Execution Timed Out".
    Do I need to keep openscript UI open for script execution from command line ?
    Is there any way to increase this Execution Time out ? May be it is taking time to load the internal script assets. AS other scripts are running fine on the same machine from command prompt itself.
    Complete error is as follows
    C:\Documents and Settings\oracle>e:\\OracleATS\\agent\\runScript.bat E:\\INTEGRATION_SERVICES\\Identity_management\\Automation\\Scripts\\MasterScripts\\TestDriv
    er\\TestDriver.jwg
    Running "TestDriver" ...
    Agent started. Available commands:
    stop - Stop the virtual user after it finishes the current iteration.
    abort - Abort the virtual user cleanly, before it finishes the current itera
    tion.
    exit - Terminate the process immediately
    You may type the above commands at any time.
    12:17:53,418 INFO [1] Initialized script service "oracle.oats.scripting.modules.utilities.api.UtilitiesService"
    12:17:53,418 INFO [1] Initialized script service "oracle.oats.scripting.modules.browser.api.BrowserService"
    12:17:53,418 INFO [1] Initialized script service "oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService"
    12:17:53,465 INFO [1] Initialized script service "oracle.oats.scripting.modules.webdom.api.WebDomService"
    12:17:53,856 INFO [1] Initialized script service "oracle.oats.scripting.modules.datatable.api.DataTableService"
    12:17:53,856 INFO [1] Initializing VU 1 for script TestDriver
    Execution Timed Out.

    Hi e_raja_sekar,
    You wrote:
    public static void main(String args){should be
    public static void main(String args[]){Granted, the below code was tested on Windows XP using J2SE SDK 1.4.1_02 (and not 1.2.2 like Sridhar is using), but when I compiled and executed this code:
    public class BadMain {
      public static void main(String args) {
        System.out.println("Hello World");
    }The output I got was:
    Exception in thread "main" java.lang.NoSuchMethodError: mainSo I don't think this is Sridhar's problem (but I could be wrong) since he says that he gets no error message.
    Cheers,
    Avi.

  • Error to execute the script through command prompt

    I tried to execute the script through command prompt. I got some following error. Could you please advice me how to rectify this.
    cscript D:\JS\Test.js
    Microsoft (R) Windows Script Host Version 5.6
    Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
    D:\JS\Test.js(1, 1) Microsoft JScript runtime error: 'app' is undefined.
    Thanks,
    Prabudass

    I haven't use CS for quite some time and file associations may not work with the command prompt.
    You can try using Windows Explorer to browse to a .js file then right click on that file. From the popup menu choose Open With. Even if you see Photoshop in the file list choose Browse at the bottom. Browse to Photoshop and make sure to check 'Always use selected program...'
    If that doesn't work you will need to create an action that runs your script and make a droplet from that action. You can then use the droplet in the command prompt. You may also need to create a 'dummy' image file to launch the droplet with if you script doesn't require an open document at startup. See http://www.ps-scripts.com/bb/viewtopic.php?t=967

  • Need to execute tcl script from a Java Program

    Hello,
    I need to execute a tcl script from a Java Program. But I do not know how to call the tcl Interpreter. Can anybody help me?

    Iam using the exec command as follows:
    Process proc =
    rt.exec("C:/SpirentConnect/engines/tcl/8.3.4/windows/s
    ctcl.exe C:/Hello.tcl");
    But Hello.tcl is not executed.And does that exact string work on the command line?
    And what is the return code from running it?

  • Error while executing ODI scenario from command prompt

    Hi all,
    I am trying to execute a scenario of a package( that I have created in designer) in OS command prompt in Windows in the following way-
    C:\ODIHOME\oracledi\bin>Startscen DIM_TECHNOLOGY_PACKAGE 001 Global LEVEL5
    However I am getting the following message:-
    OracleDI: Starting scenario DIM_TECHNOLOGY_PACKAGE 001 in context Global ...
    com.sunopsis.core.SnpsInexistantObjectException: SnpScen.getScenarioByCodeAndVer
    sion ; SnpScen does not exist
    at com.sunopsis.dwg.dbobj.SnpScen.getScenarionByCodeAndVersion(SnpScen.j
    ava)
    at com.sunopsis.dwg.cmd.DwgCommandScenario.b(DwgCommandScenario.java)
    at com.sunopsis.dwg.cmd.DwgCommandScenario.treatCommand(DwgCommandScenar
    io.java)
    at com.sunopsis.dwg.cmd.DwgCommandBase.prepare(DwgCommandBase.java)
    at com.sunopsis.dwg.cmd.e.t(e.java)
    at com.sunopsis.dwg.cmd.e.y(e.java)
    at com.sunopsis.dwg.DwgJv.treatCmd(DwgJv.java)
    at com.sunopsis.dwg.DwgJv.main(DwgJv.java)
    at oracle.odi.Agent.main(Agent.java)
    com.sunopsis.core.SnpsInexistantObjectException: SnpScen.getScenarioByCodeAndVer
    sion ; SnpScen does not exist
    at com.sunopsis.dwg.dbobj.SnpScen.getScenarionByCodeAndVersion(SnpScen.j
    ava)
    at com.sunopsis.dwg.cmd.DwgCommandScenario.b(DwgCommandScenario.java)
    at com.sunopsis.dwg.cmd.DwgCommandScenario.treatCommand(DwgCommandScenar
    io.java)
    at com.sunopsis.dwg.cmd.DwgCommandBase.prepare(DwgCommandBase.java)
    at com.sunopsis.dwg.cmd.e.t(e.java)
    at com.sunopsis.dwg.cmd.e.y(e.java)
    at com.sunopsis.dwg.DwgJv.treatCmd(DwgJv.java)
    at com.sunopsis.dwg.DwgJv.main(DwgJv.java)
    at oracle.odi.Agent.main(Agent.java)
    Please tell me what can be the possible reason?
    Thanks in advance
    PB

    Hi PB ,
    Use the following syntax
    C:\ODIHOME\oracledi\bin>startscen DIM_TECHNOLOGY_PACKAGE 001 <CONTEXT_CODE> "-v=5"
    Also make sure that the repository connection details are all correct before running scenario via startscen script
    Thanks,
    Sutirtha
    Edited by: Sutirtha Roy on May 14, 2010 12:18 PM

  • Running SQLPLUS script from command prompt on SUN

    We are making a migration from VMS to SUN ( SunOS 5.10) and from 9i to 10g. We have encountered an unanticipated problem with running scripts from the command line in SUN(SQLPLUS execution from the command line). All of our packages have a naming convention such as "DM$LOAD.PKB". I know it is a strange naming convention.
    The problem is that when the package creation script is run in SQLPLUS at the command prompt SQLPLUS can not open the file.
    SQL> @dm$load.pb
    SP2-0310: unable to open file "dm$load.pb"
    SQL> host ls
    dm$load.pkb
    SQL>
    Setting the escape character does not seem to help.
    SQL> set escape '\'
    SQL>
    SQL> @dm\$load.pb
    SP2-0310: unable to open file "dm$load.pb"
    SQL>
    Unfortunately, we can not rename the scripts. This can be done from a shell script, but our Tech Services refuse to run the SQL scripts from a shell script
    Any ideas on how to get SQLPLUS to run the scripts from the SUN command line?

    I did not notice that the cut and paste was poor. It should have read
    SQL> @dm$load.pkb
    SP2-0310: unable to open file "dm$load.pkb"
    SQL> host ls
    dm$load.pkb
    Any ideas will be greatly appreciated.

  • Executing sql scripts from command line

    Hi!
    We setted the environment and navigated to the directory where the scripts are, but the instance is idle.
    [oracle@at1srv0080 preparation]$ export ORACLE_SID=OMDEMO01
    [oracle@at1srv0080 preparation]$ sqlplus / as sysdba
    SQL*Plus: Release 10.2.0.5.0 - Production on Tue Feb 28 10:07:13 2012
    Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
    Connected to an idle instance.and a startup resulted in:
    Error 6 initializing SQL*Plus
    Message file sp1<lang>.msb not found
    SP2-0750: You may need to set ORACLE_HOME to your Oracle software directoryWhat could the cause be?
    Thanks!

    It is a new and clean installation of a RAC database and we already created some tablespaces.
    Here is the environment:
    _=/bin/env
    CVS_RSH=ssh
    DISPLAY=localhost:10.0
    G_BROKEN_FILENAMES=1
    HISTSIZE=1000
    HOME=/home/oracle
    HOSTNAME=at1srv0080.xxx.net
    INPUTRC=/etc/inputrc
    LANG=en_US.UTF-8
    LD_LIBRARY_PATH=oracle/app/oracle/product/10.2.0/db_1/lib
    LESSOPEN=|/usr/bin/lesspipe.sh %s
    LOGNAME=oracle
    LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
    MAIL=/var/spool/mail/oracle
    OLDPWD=/tmp/OMCore
    ORACLE_BASE=/oracle/app/oracle
    ORACLE_HOME=oracle/app/oracle/product/10.2.0/db_1
    ORACLE_SID=OMDEMO01
    PATH=/oracle/app/oracle/product/10.2.0/db_1/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin
    PWD=/tmp/OMCore/preparation
    SHELL=/bin/bash
    SHLVL=1
    SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
    TERM=xterm
    USER=oracle

  • How to execute IDC services from command line

    Hey Guys,
    is there some way we can execute IDC Services from command prompt.
    your any pointers will be highly appriciated.
    regards,
    sapan
    Edited by: sapan on Mar 9, 2009 7:26 AM

    Hey sapan,
    You can use IdcCommand to execute services from the command line. The process is as follows:
    1. Create a text file with the services calls you want to make, the definitions are in hda format:
    @Properties LocalData
    IdcService=UPDATE_DOCINFO
    dID=1
    dDocName=000001
    dDocType=MyType
    dSecurityGroup=Public
    dRevLabel=1
    dDocAuthor=sysadmin
    dDocTitle=My Title
    @end
    <<EOD>>
    (Note: for multiple entries in the file <<EOD>> is very important)
    2. Execute IdcCommand from the <content server install>/bin directory:
    IdcCommand -f image_update.hda -u sysadmin -l c:\idccommand.log
    Options:
    -f = file with service definitions
    -u = user to run as
    -l (lowercase L) = location for log of execution
    More detailed documentation can be found in the Idc Command Reference (idc_command_reference_10en.pdf).
    Hope that helps,
    Andy Weaver - Software Consultant
    Fishbowl Solutions < http://www.fishbowlsolutions.com?WT.mc_id=L_Oracle_Consulting_amw >

  • MDX Qyery from Command Prompt

    Hi All,
    Can i execute MDX query from Command Prompt.
    If yes how can i execute please give me example
    i want to execute the below query.
    SELECT
    [Year].[Qtr1].Level.Members
    ON COLUMNS,
    [Product].Levels(0).Members
    ON ROWS
    FROM Sample.Basic.
    Thanks a ton in advance.
    Regards,
    Mink
    Edited by: Mink2 on Dec 11, 2009 9:08 AM

    Hi,
    Just start a Maxl (essmsh) session from a command line, log into the essbase server and then paste the MDX;
    e.g.
    Loging admin password on localhost;
    SELECT Year.Qtr1.Level.Members ON COLUMNS, Product.Levels(0).Members ON ROWS FROM Sample.Basic;
    Ok?
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Call an ABAP program or a function module from command prompt/python script

    Dear All,
    I want to call a function module/ABAP program from command prompt or a python script.
    Let me explain with an example.
    There is a function module "z_add" that takes  two integers as input parameters and generates their sum.
    the sum is the output parameter.
    Now i want to call this function module from command prompt / python script and pass parameters to this function module.
    In return i must get the sum(i.e. the output of function module).
    I tried using STARTRFC ,was able to call the FM but could not get the return value(output) from FM.
    Can you please provide me the code of such a function module and the method to call it thereby passing parameters and getting the sum.
    Thanks and regards,
    Gaurav
    Edited by: gauravkec2005 on Mar 4, 2010 7:41 AM

    thank you both!  helpful answers! :o)
    anyway! 
    i have written the program which is called from the SAPScript:
        /:       PERFORM GET_VATNUMBER IN PROGRAM ZFI_F140_OPERATIONS
        /:       USING &BKPF-BUKRS&
        /:       CHANGING &VATNUMBER&
        CE       VAT Registration No : &VATNUMBER&
        REPORT zfi_f140_operations.
        FORM get_vatnumber TABLES in_par  STRUCTURE itcsy
                                  out_par STRUCTURE itcsy.
          DATA: lv_co_code TYPE bukrs,
                lv_vat_no  TYPE stceg.
          READ TABLE in_par WITH KEY name = 'BKPF-BUKRS'.
          MOVE in_par-value TO lv_co_code.
          SELECT SINGLE stceg FROM t001
            INTO lv_vat_no WHERE bukrs = lv_co_code.
          out_par-name = 'VATNUMBER'.
          WRITE lv_vat_no TO out_par-value.
          CONDENSE out_par-value.
          MODIFY out_par INDEX 1.
        ENDFORM.              
    it is not working and i cannot work out why... 
    i have not been ABAPing for very long but have had a go.... 
    any thoughts as to what i have done wrong?
    or point me where i should be looking?  thank you!

  • Not able to start managed server from command prompt

    Hi,
    I am trying to start manged server from command prompt. The command i am using is as follows:
    startManagedWebLogic.cmd MS1 [http://]&lt;Listen_Address&gt;:&lt;Admin_port&gt;
    Where MS1 is the name of my managed server.
    But i am getting following exceptions:
    There are 1 nested errors:
    weblogic.management.ManagementException: Unable to obtain lock on C:\bea\user_pr
    ojects\domains\PB530Domain\servers\AdminServer\tmp\AdminServer.lok. Server may a
    lready be running
    at weblogic.management.internal.ServerLocks.getServerLock(ServerLocks.ja
    va:159)
    at weblogic.management.internal.ServerLocks.getServerLock(ServerLocks.ja
    va:58)
    at weblogic.management.internal.DomainDirectoryService.start(DomainDirec
    toryService.java:73)
    at weblogic.t3.srvr.ServerServicesManager.startService(ServerServicesMan
    ager.java:459)
    at weblogic.t3.srvr.ServerServicesManager.startInStandbyState(ServerServ
    icesManager.java:164)
    at weblogic.t3.srvr.T3Srvr.initializeStandby(T3Srvr.java:711)
    at weblogic.t3.srvr.T3Srvr.startup(T3Srvr.java:482)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:440)
    at weblogic.Server.main(Server.java:67)
    >
    <Feb 10, 2009 6:48:16 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server sta
    te changed to FAILED>
    <Feb 10, 2009 6:48:16 PM IST> <Error> <WebLogicServer> <BEA-000383> <A critical
    service failed. The server will shut itself down>
    <Feb 10, 2009 6:48:16 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server sta
    te changed to FORCE_SHUTTING_DOWN>
    Please help me to resolve this issue.
    thanks,
    Sonal
    Edited by: [email protected] on Feb 10, 2009 5:16 AM

    Looking at your error message a little closer, I don't believe it has anything to do with port conflicts but rather that even though you are executing the startManagedWeblogic.cmd with your managed server name (MS1), the error indicates that it is trying to start the Admin Server (not MS1). Note in your error message the following: Unable to obtain lock on C:\bea\user_pr
    ojects\domains\PB530Domain\servers\AdminServer\tmp\AdminServer.lok. Server may a
    lready be running
    It is saying that it cannot start the Admin Server because it is already running (which is probably true in your case). Have you made any changes to the startManagedWeblogic.cmd or the startWeblogic.cmd scripts? I would start debugging there and try to figure out why the script is trying to start your admin server instead of MS1 as you requested on the cmd line.

  • Launching Index Tuning Wizard from command prompt

    I have been playing with index tuning wizard and I could not figure how to launch it from command line (Manual says it can be launched via management console or oracle expert).
    DB2 and SQL Server provide executables which can be launched from command line. For example, below command evaluates given workload on target database and recommends something if necessary.
    Command> itw -d <targetDB> -w <workloadFile> -o <indexRecommendations>
    Is it possible to launch Oracle Index Tuning Wizard from command prompt in a similar way?
    -fa

    "TNS No Listener" => Start the listener
    To be connected as SYSDBA you dont need a password if your are logged in the DBA group, you just have to :
    PROD_:id
    uid=102(oracle) gid=103(oinstall)
    PROD_:sqlplus "/ as sysdba"
    SQL*Plus: Release 8.1.7.0.0 - Production on Wed Jul 23 11:46:50 2003
    (c) Copyright 2000 Oracle Corporation. All rights reserved.
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.4.0 - Production
    SQL> show user
    USER is "SYS"
    SQL>
    Fred

  • Selecting different homes from command prompt

    Hi Gurus,
    Oracle client-9201
    Oracle client-10201
    Win XP SP2
    We have two oracle homes. We want to switch it from one to another. We have restriction that this should be done from command prompt only. Although I can change homes launching latest OUI and going to "INSTALLED PRODUCTS" tab where we find ENVIRONMENT tab. There it is possible to change home and apply. But this thing I want to do from command prompt.
    Any help will be highly appreciated.
    Regards.
    Virendra

    No, you don't want it to be from a command prompt and from OUI. What you want is to be able to do this without the need to visit all 400 client boxes. The method is irrelevant, as long as it efficiently achieves your real goal.That is true.
    You keep saying "command prompt" and "OUI", but can't visit all the necessary machines. So what were you envisioning? Creating some batch file you could distribute to all affected users over the network, and ask them to execute said batch file? That may (or may not) be valid, but to find the best solution we have to clearly define the real requirements and separate that from any pre-concieved solution.You can say it is my pre-concieved assumption that I will go with Command Prompt/OUI. But the real problem is I don't want to visit all machines. It can be a batch file distributed to all machines or our network people may execute it sitting on domain controller machine from which he can run programs in background of any machine in network.
    From the other things discussed on this thread, I suspect you are going to have to blow in some registry hack, by one of several possible means. But first we have to know what your real constraints are and all of the options open to you.Real constraint is, We don't want (rather can't) visit all 400 terminals.
    Do you have the ability to push registry settings at client logon?Yes, We can.
    Can you guarantee the consistency of configuration of all 400 clients?Home name and Location may be different on different machines.
    Do you have the ability to force the automatic execution of a command file from a file server and client log-on time?Yes, it is possible.
    Are you working with your network people to explore what help they might be able to provide on the above points?They may help us depending upon the requirement.
    Regards
    Virendra

  • Connecting to oracle10g from command prompt

    Hello All,
    Please reply to following doubts/queries. Any help is highly appreciated.
    1.Without having any other tool, is it possible to connect to a remote oracle10g server from windows command prompt.
    I have used following command in MySQL database for this purpose:
    "mysql -u database_user_name -ppassword".
    2. My second question is about Oracle SQL developer(version 1.5.4). I am having this tool installed on my machine.
    So, how can i now connect to remote Oracle 10g server from command prompt.
    My purpose is to run batch file thereby calling a stored procedure.
    Thanks.

    Hi,
    1.Without having any other tool, is it possible to connect to a remote oracle10g server from windows command prompt.
    I have used following command in MySQL database for this purpose:
    "mysql -u database_user_name -ppassword".AFAIk, we can't correct in such ways. I might be wrong too, since I have not tested with mysql anytime.
    2. My second question is about Oracle SQL developer(version 1.5.4). I am having this tool installed on my machine.
    So, how can i now connect to remote Oracle 10g server from command prompt.
    My purpose is to run batch file thereby calling a stored procedure.You need to configure the appropriate connections identified - user/ password - wher DB host is residing IP address and port number and sid of oracle instance. Carry out those things then you can connect to DB.
    Execute the batch files from DB Server - its better approach.
    - Pavan Kumar N
    Oracle 9i/10g - OCP
    http://oracleinternals.blogspot.com/

  • To test proxyservice from command prompt

    Hi,
    I need to know the complete steps that I need to follow to test my proxy service from command prompt. Its urgent so please help.
    regards
    rahul.

    You should be more specific as it's hard to guess what you really want to achieve.
    If you want to perform functional test from command line, then you can perhaps try command line features of SoapUI:
    http://www.soapui.org/Test-Automation/functional-tests.html
    First, create a common project using SoapUI GUI and than you can execute it from command line.

Maybe you are looking for

  • HT1657 Why does my down load take so long

    How can I get iTunes tunes to download movies faster?

  • List of Inventory Differences (MI20)

    Hi SAP Sifu, actually i've one problem here, how to config this report MI20 to have negative value in different qty, ie Book Quantity : 157 Qty Counted : 133 (Book quantity - Qty Counted = Different Qty / Different Amount) 157-133= -24/378 In the sta

  • Email CollectOverMetrics.ps1 HTML Report

    Exchange 2013 SP1 with 2 member DAG with 1 DB. I want to monitor the DAG using collectovermetrics.ps1. I want to have the html report from collectovermetrics.ps1 email to administrators. I know I have to have task scheduler run the command: CollectOv

  • Copying Oracle database on Windows.

    Hi Group, I would appreciate your suggestions on the best procedure and alternatives to copy an Oracle database 10g r2 (windows 2003 server) from local server to remote server. Thanks in advance.

  • Survey Builder

    I'm using the packaged Survey Builder application and have a need to be able to edit the responses to a survey.  I don't think this is currently possible.  What would it take for me to add this functionality?