2
votes

I have few scripts developed in TCL and Shell

  1. TCL scripts (project.tcl) is used for automation of project creation and handling the multiple project runs)
  2. SHELL scripts (result.sh ) is created for result analysis Error handling with a set of commands using sed, awk and grep.

I want to create a single executable by embedding these scripts into any high level language like C/C++ file. we know that TCL is a C library. What kind of interface files APIs are useful for achieving this ?

1
Please don't sign you name at the end of questions or similar. See here for more information: meta.stackexchange.com/questions/2950/… - PiRocks
If you rewrite the shell scripts in tcl, then you only have two languages to worry about (C and tcl)... - Shawn
And if it's all in tcl, there are tools to create a binary that includes the tcl runtime and your scripts all in one: tcl.tk/software/tcltk/bindist.html and wiki.tcl-lang.org/page/Starpack - Shawn

1 Answers

0
votes
  1. TCL scripts are quite simple, as you can embed the TCL interpreter quite easy. (API-Reference: https://wiki.tcl-lang.org/page/Tcl+C+API)
  2. You can simply embed them, extract them at runtime (to /tmp) and use system(...), or you could try translating them to C: sed: https://github.com/lhoursquentin/sed-bin awk: awk2c grep: I didn't find some translator tool, but grep uses PCRE, so you could use these.

To have them in the executable, you could make a .tar(.gz) file from those scripts, embed it into the binary (Embedding binary blobs using gcc mingw), and load (and extract (with zlib, for example)) it at runtime, to a temporary directory.