Hi Erin,
First, the -e option with GNU sed means 'expression' and it's use with more than one expression in a Linux distribution is mandatory. Check in the man pages of your system what flag, if any, should be used. I believe Solaris sed uses the flag in the same way but I know AIX sed doesn't need a flag for this.
Second, you'd better check the UNIX shell script community for questions about sed because it's a pure OS tool, not an Informix one.
But since you've pasted it in 4GL I can give you the following example.
Code:
LET path = "/home3/users/bcs02/irni/txtfile/a.txt"
LET sed = "\\/usr/bin/sed -e '1s/$/|||||||/' -e '$s/$/|||||||/' >", path
LET sed = sed CLIPPED
RUN sed
Comment:
The systemcommand RUN tries to execute needs to be of the same form as when executed from the commandline, so why do you write a backslash in front of sed?
Code:
LET sed = "sed -e ..."
will probably work OK, but better is to use the fullpathname of the command, which can be obtained on the commandline with
that shows the exact location of the sed program, usualy /bin or /usr/bin.
To redirect the stdout of sed (or any command in UNIX) to a file use '>
filename' for a creating a new file (or overwriting one if it already exists) or '>>
filename' for appending to an existing one (or creating a new one if it doesn't exist).
You don't have to undo the variable (with CLIPPED) from it's trailing spaces; the shell that's executing the sed command will ignore them automatically.
That should be it, try the command first on the commandline and if it works past it into the 4GL program.
Regards