Originally Posted by tbj01
I have two scripts, one of which is very long (around 11000 lines), and i need to run this two lines at a time within the other script. Is there any way to do this?
Any help is greatly appreciated
As mentioned the only real way is for the other script to extract the lines and feed it piecemeal to a bash interpreter.
However doing this really depends on how complex the source script is. For example if the source script contains large 'loops' or other 'code blocks' then bash will not execute them until the code block is complete. Better if the script had some sort of marker (special comments) or other delimiters to separate the individual sections of code to be executed.
I have does this myself, but extracting blocks of code from a HTML file, so that the output it generates (images) can also appear on the same page, guaranteeing that the code generates what is displayed. It worked very well, and pre-dates the advent of Wiki's.
ASIDE: The shell code was stored in HTML <CODE EXECUTE ...> ... </CODE>
constructs. Note that 'EXECUTE
' is not a standard HTML tag, so should be ignored by browsers. You can see the results on the page..
If you look at the page source you will see the code blocks.