Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix shell script to wrap edastart -x

Status
Not open for further replies.

Exie

Programmer
Sep 3, 2003
156
0
0
AU
Hi,

I'm new to WebFocus, and I'm getting tired of encrypting and decrypting focexec's. I was just whipping up a shell script to do alot of this for me, but cant seem to get edastart -x to work right. For example:
[blue]edastart -x "SET PASS='mypassword' ; ENCRYPT FILE set.fex FOCEXEC ; FIN"[/blue]

.. just gives me:
[red]%connect
%begin
set pass='mypassword' ; encrypt file set.fex focexec ; fin
%end
CLOSEALL.ALL
%disconnect
%stop_server[/red]

... it doesnt actually do the encrypting/decrypting. Any ideas what I'm doing wrong ? Can you not chain up commands with a semicolon ?
 
The online doc for edastart (edastart -?) says:

-x "<command>" Run server with single command as input

You actually want THREE commands. Why not put the commands into a FEX, and invoke it with parameters, and call it ENCR.FEX, for example. It might look like this:

Code:
SET PASS=&PSWD
ENCRYPT FILE &FILENAME FOCEXEC
FIN

To invoke it, you could code:

edastart -x "EX ENCR PSWD=%1, FILENAME=%2"

The %1 and %2 are parameters (in DOS BAT files). In Unix, you'd use $1 and $2. You're passing the values to the FEX as PSWD and FILENAME, which get substituted by the Dialogue Manager. You'd invoke your script as:

scriptname password filename

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top