EXECUTE "!mv /tmp/x.tif /backups"
...I seem to be limited to a total Unix command line length of ~2000
bytes or less. Since I can't find any reference or anyone else on the
Net complaining about this using bash itself, I assume it's another
brain-dead D3 limitation where they only pass down the first 2k of a
command to unix. (oops, sorry for the little editorialization there :)
Anywho, this is a problem because the API to an remote application I'm
working with does everything through a command line interface, and
I've got few other options to make it work. (Short of a kluge where I
check if the command line I'm about to execute is over 2k, and if it
is, write a small temporary script at the Unix level and then execute
it...ugly but it would probably work...)
Anyone else know for sure that this is a D3 problem? Any easy
workarounds known before I embark upon "plan B"? Major thanks in
advance.
/Dr. J/
Example
EXECUTE.UNIX(SCRIPT,OUTPUT,ERRORS)
SCRIPT.ID=@USER.NO:'.script'
OUTPUT.ID=@USER.NO:'.output'
ERROR.ID=@USER.NO:'.error'
OPEN 'unix:/tmp/scripts' TO SCRIPT.FILE ELSE
* Some Redhat systems have cleanup routines than clean out
* the tmp directory. This code will re-create the script
* directory if it is gone.
EXECUTE '!mkdir /tmp/scripts'
OPEN 'unix:/tmp/scripts' TO SCRIPT.FILE ELSE RETURN
END
DELETE SCRIPT.FILE, SCRIPT.ID
DELETE SCRIPT.FILE, OUTPUT.ID
DELETE SCRIPT.FILE, ERROR.ID
* here you can add special coding to deal with escape characters
* meaning, characters that unix does not like, like \ or $
WRITE SCRIPT ON SCRIPT.FILE, SCRIPT.ID
EXECUTE '!chmod a+x /tmp/scripts/':SCRIPT.ID:';
/tmp/scripts/':SCRIPT.ID:' > /tmp/scripts/':OUTPUT.ID:' 2>
/tmp/scripts/':ERROR.ID
READ OUTPUT FROM SCRIPT.FILE, OUTPUT.ID ELSE OUTPUT=''
READ ERRORS FROM SCRIPTS.FILE, ERROR.ID ELSE ERRORS=''
DELETE SCRIPT.FILE, SCRIPT.ID
DELETE SCRIPT.FILE, OUTPUT.ID
DELETE SCRIPT.FILE, ERROR.ID
RETURN
I have create a similiar routine for executing PERL and Expect
Scripts. Works like a charm!
thatsea...@hotmail.com (Jonathan Rogers) wrote in message news:<ba7d6941.0302...@posting.google.com>...