#80785 - 2002-04-29 03:19 PM
Switch for running commandline parm as script
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Ruud, could you include a switch that would permit us to execute a string as a program from the command line?
Example: Kix32 /p "for $i=1 to 5 ? 'Hello World' next"
This would permit us to execute programs without creating a file and then having to clean up afterwards. [ 29 April 2002, 15:20: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#80786 - 2002-04-29 03:44 PM
Re: Switch for running commandline parm as script
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
If we could pipe the script in (previously requested), this would also deal with the issue.
Of course piping (at least on some versions of windows) is crippled, and is simply emulated by the operating system creating a temporary file.
The benefit of piping is that you can submit large files.
Of cource there is no reason that you cannot create a simply script called "execute.kix" which contains the line:
code:
Exit Execute($Script)
then call it as: quote: Kix32 execute.kix $Script="for $i=1 to 5 ? 'Hello World' next"
|
|
Top
|
|
|
|
#80788 - 2002-04-29 04:53 PM
Re: Switch for running commandline parm as script
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Shawn, Yeah, been there, tried that. As you've seen it assigns the variable name as the value if there is no input, which I guess is a feature of it reading past memory rather than an intended action. That means it's unreliable.
In fact it seems to assign something odd. From memory if you run it with no piped input you get another bit of the script.
There are another couple of problems. 1) GET doesn't work the same way, which might be a bonus (see 2) 2) There is no way to re-attach the input stream (maybe write a udf wrapper using GET instead - See 1) 3) Specific to this thread, you have to have the "read/execute" script in place anyway.
As it is an undocumented feature and a bit flakey to boot I wouldn't recommend its use at present.
I was playing with the "C" "popen()" call, to see If I could pipe the script in to avoid creating a temporary file for KiXcrypt, but the process is just not reliable enough.
Sorry Howard, we seem to have hijacked your thread.
|
|
Top
|
|
|
|
#80789 - 2002-04-29 05:03 PM
Re: Switch for running commandline parm as script
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Not a problem. All interesting ideas. I still like the switch idea. I am starting to dislike the perpetual workaround business though.
Anyway you are keeping the thread at the top of the active list where my inital post may get noticed more. ![[Smile]](images/icons/smile.gif) [ 29 April 2002, 17:17: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#80791 - 2002-04-29 05:29 PM
Re: Switch for running commandline parm as script
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
I like the idea of running kix32.exe in command mode. You could either have:
kix32.exe /p "command"
or
kix32.exe /cmd
This would start a commandline session that would allow you to type in and execute code a line at a time (REXX allows this). alternately, you could do a
kix32.exe /cmd /out="C:\test.kix"
This would allow you to save the actual lines that you are testing to an output file. The "ESC" key could always be used to cancel out and end the commandline execution.
Brian
|
|
Top
|
|
|
|
#80792 - 2002-04-29 05:34 PM
Re: Switch for running commandline parm as script
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
Hmm. After thinking about it... it might be better to do it like this:
KIX32.EXE /C "commandline"
Or
KIX32.exe /K "commandline"
to allow you to continue typing in commands.
Or as I mentioned before:
KIX32.EXE /CMD (or without switch) to run in command mode.
Brian
|
|
Top
|
|
|
|
Moderator: Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
0 registered
and 837 anonymous users online.
|
|
|