Hi,
I have the following snippet of code that compiles in character base (Linux box) but will not compile using OpenEdge on windows. We are trying to move from character base to using OpenEdge and all it's helpful functionality but when doing full recompiles of our code we have some programs that aren't compiling anymore.
def stream str.
input stream str through value("ps -ef | awk '\{print $2\}' | grep -q " + string("blabla") + " 2> /dev/null; echo $?").
Other than changing the code is there a setting in OpenEdge to work similar to our Linux box?
Any help will be appreciated.
The issue is the { before print. Change it to '\~{print $2\}' and it compiles ok. I'm not really sure why it should compile ok on Linux, but I'm not aware of any way around this.
Those commands are not native to Windows. Do you have a unix tool set installed on the the Windows server?
You will have to change the code. The backslash is supported as an escape character on UNIX/LINUX platforms but can't be treated that way on Windows since it is the directory separator.
The tilde(~) is the universal escape character that works on both platforms. I am pretty sure the backslash as an escape character predated the first version of Progress for Windows and probably the existence of Windows itself.
See the ABL Reference documentation for the various special characters.
backslash as an escape character comes from UNIX early 70's. Predates DOS and Progress too.
Of course, but in this case it's the progress compiler that's confused. The backslash in a quoted string means nothing.
message "\abc" prints \abc (as it should).
That I knew :-)
I was just talking about the Progress implementation of the backslash as an escape character. I didn't use V1-V3 so I didn't know which exact version it showed up in.
Hi,
in an OERA approach you should better do an extra "list_tasks.sh" or call it "list_task.bat" with the wished parameters. $1 and $2 or what you want. So for the future it's never a progress compile problem anymore, when you would liek to move to anyOS.
No, it is not confused. The compiler will interpret the { inside and outside code. It will try to do a compile time substitution (positional parameter, compiler constant or include file) regardless of the presence of quotes.
It is quite valid to do this in an include:
MESSAGE "{1}" ...
In the example above, the { inside the quotes is the problem. The original developer got around the problem by escaping it with with "\", which is valid in *NIX only, but not on Windows. "~" will always work.