Run part of a bash script from within another
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 :)
There are ways to get two lines from a file and execute them as commands but I do not know of a way to get a script to execute two lines and stop until told to proceed by another process.
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.
|All times are GMT -5. The time now is 05:48 PM.|