how to exec .sh files

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf how to exec .sh files

  • Creator
    Topic
  • #49953
    Nate Kruse
    Participant

    My unix guy created a .sh file that I’m supposed to call from a tcl script.  Has anyone used the exec command to call/run a .sh file?

    Thanks,

    Nate.

Viewing 3 reply threads
  • Author
    Replies
    • #64240
      Bob Richardson
      Participant

      Greetings,

      Here is a method that we have used to call a Ksh script from a Tcl proc within a  running engine (process):

                       set cmd “/alin1hub_bin/datacenter_lab_down.sh”

                       catch {system $cmd} error

                       echo “system call status:$error for command $cmd”

      Be sure that the script has execute permissions.

      Good luck!

    • #64241
      Nate Kruse
      Participant

      Thanks for the response.

      I gave it a shot and error 127 is returned.  Have you came across that one?  Google isn’t doing much so far.

    • #64242
      Bob Richardson
      Participant

      Greetings,

      I have added a link here which talks about ksh error 127 – it appears that arguments may need to be passed to this script. I googled on “ksh 127 error”.  Link is: http://www.research.att.com/~gsf/man/man1/ksh.html

      Is your script designed to be invoked from another program?  run interactively?  Maybe debug it before inserting it into your tcl program.

      Here is another link for debugging: http://lekenutemekiset.homeip.net/~robertbratt/reference_library/unix_bookshelf_3.0/korn/ch09_01.htm

      Hope this helps you out.

    • #64243
      Charlie Bursell
      Participant

      From the ksh man page

      127

      -c and -s were not specified and the command script corresponding to arg could not be found.

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

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,296
Replies
34,439
Topic Tags
287
Empty Topic Tags
10