Thread Parsing Errors, need a new set of EYES

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Thread Parsing Errors, need a new set of EYES

  • Creator
    Topic
  • #52569
    mike brown
    Participant

      Please tell me why am i getting the following, I kinda need help with NetConfig Dump

      and getting the following…

      syntax error at line 6 : `(‘ unexpected any and all help welcomed.

      In the following PROCS…

      getroutedata :

      ######################################################

      # Tcl program to obtain Routing info for each thread

      # Author: Mike Brown

    Viewing 12 reply threads
    • Author
      Replies
      • #74707
        David Barr
        Participant

          Because you’re running the script with a Bourne shell interpreter instead of a TCL interpreter.

        • #74708
          mike brown
          Participant

            thanks for replying

            Oh Ok, help me out a minute should i rewrite the code or change the extension, i am at a loss right now

            mike

          • #74709
            David Barr
            Participant

              You’ve got this code in a file, probably called something like foo.tcl. Instead of typing “foo.tcl” or “./foo.tcl” to run it, type “tcl foo.tcl”.

              There are other more complicated ways of dealing with this. You can add a “shebang” line to the top of the script (#!/quovadx/qdx5.7/integrator/bin/tcl), but then you’ve got to worry about maintaining the script every time that Cloverleaf is upgraded.

              You can add lines like this to the top of the script:

              Code:

              #!/bin/sh
              # the next line restarts using tclsh
              exec tclsh “$0” “$@”

              Personally, I like to keep it simple and say “tcl foo.tcl” wherever  I’m calling my scripts.

            • #74710
              mike brown
              Participant

                Thanks David big time that really works.. i am now able to complete my task.. thanks again..

                mike

              • #74711
                Jim Kosloskey
                Participant

                  Dave and Mike,

                  Actually if you put the following at the front of your Tcl proc you will be unaffected by Cloverleaf upgrades:

                  #!/usr/bin/ksh

                  # this line to escape the next line from the tcl interpreter

                  exec hcitcl “$0” “$@”

                  email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 61 years IT – old fart.

                • #74712
                  Charlie Bursell
                  Participant

                    Even better Jim, try this:

                    #!/usr/bin/env tcl

                    or for perl

                    #!/usr/bin/env perl

                  • #74713
                    Jim Rawls
                    Participant

                      Charlie,

                      If we use your Tcl invocation method, are the hci Tcl extensions still available to the proc?

                    • #74714
                      Jim Kosloskey
                      Participant

                        Charlie,

                        Even better – I will start using that.

                        Thanks

                        email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 61 years IT – old fart.

                      • #74715
                        Charlie Bursell
                        Participant

                          Assuming the root is set, yes

                          Try it and echo out the variables you want.

                        • #74716
                          Bob Richardson
                          Participant

                            Jim and Charlie,

                            I have experimented with the KSH method and found that I have problems in passing shell arguments ($1… $N) into the script

                            for the hcitcl program to interpret.

                            Do you have a suggestion for how that can be accomplished?

                            Admittedly not “korny” enough on my part.

                            Thanks.

                          • #74717
                            Charlie Bursell
                            Participant

                              Don’t really understand the problem Bob.

                              You pass args on the command line like any other script:

                                   mytcl  arg1 arg2 arg3 etc

                              in your script you should have a line at the end of the script like

                                  procname $argv $argc

                              argv will contain a list of command line args while argc will contain the number of args

                              The proc you are calling should look something like:

                              proc procname {argv argc} {

                              Just habdle argv and argc in the proc

                            • #74718
                              Bob Richardson
                              Participant

                                Charlie,

                                Thanks.  I will redo my experiment and report back to this forum on results.  I do have the code statements you illustrate in my hcitcl program.

                                Most likely will have to wait until next week as this week I am the turkey in the hot seat for problems (the on call bain of IT).

                                BobR

                              • #74719
                                Jim Kosloskey
                                Participant

                                  Bob,

                                  Virtually all of my command line Tcl scripts use command line arguments and I don’t have any issues.

                                  If you would like an example of a command line proc I have utilizing arguments, email me and I will send it to you.

                                  email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 61 years IT – old fart.

                              Viewing 12 reply threads
                              • The forum ‘Cloverleaf’ is closed to new topics and replies.