Return blank

jramos

New Member
Hi, I need your help, I run the following code but the variable always returns blank, the command works fine in linux command line (openssl enc ....) TIA

define variable cSign as character no-undo.
input through openssl enc -base64 -A -in file.txt.
import cSign.
input close.
display cSign format "x(60)".



Progress 9.1E04/Redhat Linux
 
The problem: import expects a string like this to be in quotes. The simplest way around this is to use update instead of import. Just add no-echo after the input and change the import to an update.

input through "openssl enc -base64 -A -in file.txt" no-echo.
update cSign.

If file.in is too large you might want to redirect to a file, then read it in with the binary option in "input from".
 

TomBascom

Curmudgeon
There is no real advantage to "update" vs. "import". The key is to enclose the command string in quotes. While not strictly necessary I like to also add VALUE() like this:
Code:
define variable sign as character no-undo.

input through value( "openssl enc -base64 -A -in file.txt" ).
import sign.
input close.

display sign format "x(60)".

("Systems" Hungarian Notation is a travesty that should be eliminated from decent discourse so I have taken the liberty of removing it for you.)
 

jramos

New Member
tommartinson, I have to redirect the output to a file and then read it with the statement "input from".

Thanks for the idea.
 
Top