Quote:
There are many problems here, without even knowing what your script is about it's difficult to say anything concrete. About dosemu, note that's a DOS emulator, and it's not necesarilly compatible with an os/2 script. CMD and BAT scripts are compatible -and here's the key- for the most part, but not 100%.
|
The scripts, although nested, are not complicated. I've attempted to explain the function of each script/EXE below, without posting the scripts themselves. Nothing secret, just trying to save space. If you'd like to see the actual scripts, I'd prefer to do that via email instead of posting all that text here - contact me at webmaster at gnps dot org.
RunMenu runs a BASIC program called MENU, which presents a list of webpages to build. Once a selection is made, MENU writes DoWork, a script that calls a couple of scripts. Then DoWork is called to execute the commands written by MENU.
The first script BuildPagename, opens the page's datafile in the OS (OS/2 in the CMD file) text editor. Once editing is done, a BASIC program is called to read through the datafile and write HTML for the body portion of the webpage. Then it passes control back to DoWork.
DoWork passes control to a script that calls a BASIC program that adds the page body to a template (could be the one with the nav menu or without it, depends on page) and generates FTP commands to upload the page (but I'm not concerned about that at this point, looks like command line FTP works the same as OS/2). Once the program completes, the script moves the webpage to the mockup of the website on my hard drive, and uploads the page. Control is then passed back to RunMenu.
Quote:
I am no master in os/2 scripting. I did a bunch of bat scripting for DOS years ago. For a started, I think that they handle errorlevels differently, so that might (or might not) be an issue if you rely on them for the menu.
|
DOS scripting and what I've done are *very* much alike. There are 3 differences between standard DOS scripts and what I'm using under OS/2.
1) Calling OS/2's text edtor to edit datafiles (TXT)
2) Copy 8.3 name to long filename
3) Call OS/2 FTP with file of commands to upload files
For #1, any text editor that handles large text files will do, #3 might be a problem under dosemu, but I haven't gotten far enough along to start working on that. My holdup is #2 at the moment.
I ran into a problem when trying to move the webpage to the mockup location. Dosemu won't copy the long filenames used for the webpages, even though it seems to support them otherwise - all work files are 8.3 because of DOS limitations under OS/2, but the file is renamed when moved by OS/2 in the original CMD files.
Quote:
As far as I know, there're binary builds of ae(.exe) for dos. So I suggest you download one of them and use it inside the dosemu vm.
|
The DOS ae.exe I found was not a text editor, but I did find one that could handle files quite a bit larger than any I have. :-)
Quote:
If you took this approach, I'd better advice to port the script to linux. Whomever takes your place in the future can continue using the old .cmd script once you leave. Can't him?
|
Didn't think of that option. That is, indeed, a viable option. The scripts may change over time, mainly additions.
I've tried porting to linux but not much luck. I can get the MENU program to run, and the DoWork script is called, but the BuildPagename script is not found. Might that have to do with the first part of the script name being BUILD? I noticed, in the error message, that part of the filename, along with the first letter of the remainder of the name is missiing. For example, the name of one script is BuildCalendarPage.sh (originally BuildCalendarPage.CMD), the error message says it can't find alendarPage.sh.
Could it be the CR/LF at the end of the lines in DoWork? I can change that easily enough, but don't want to worry with it if it isn't necessary.