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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ExecUnix on Conversant 7.0

Status
Not open for further replies.

GuzaPasha

Technical User
May 15, 2003
311
FR
Hi all,

here is what I need.

I want to run shell script using execUnix command in ScriptBuilder.

let it be(test.sh)

#!/bin/sh
x=5
echo $x

ExecUnix command should be as

command string: /path../test.sh
return string : izb
return value : ret

When I trace the variable izb, it is empty string. izb iz char[10], I expect only 2 char to be returned as result of executing ExecUnix.

Could anyone check this all, and inform me what I am doing wrong?

Thanx in advance.
GuzaPasha

 
Hello guys,

is there any IVR expert or not?

Guzapasha
 
I use ExecUnix all the time... It's great. I ran your example with no problems. First, make sure your shell script is executable. You will not see the value of the Return String in a trace, but add a 'set field value' immediately after it, copying the value of the Return String to a temporary field, then trace, you will see the value of '5'. By the way, I believe you'll need the FAX package in order to run this command.


 
Hi GoBigREd,

thank you, i will check this at the weekend, and will inform you, I hope with the mark *.:)

I did not copy the value from the izb to another variable using Set Field Value, it can cause the problem as you suggested.

GuzaPasha
 
Hi GoBigRed,

here is the part of the script

4. External Action: Exec_UNIX
Command_String: "/home/ml/test3.sh"
Return_String: echostr #char[20]
Return Field: ret
End External Action
5. Set Field Value
Field: izlaz = echostr #char[20]
#*/ trace(9000, ch.F_izlaz) /*
6. Disconnect

and the shell script

#!/bin/sh
x=5
echo $x


variable izbor is still empty!!!

Could you please check this on your conversant, mine is V7.

Thanx
GuzaPasha
 
GuzaPasha, I'm currently running on V8.0 Do you have a copy of your trace? Is the fax pkg being activated? Try displaypkg | grep Fax - you should see
CONVERSANT Script Builder Fax Actions - Update A
My script and shell is identical to yours, and my trace is returning the following:

start:
1. Announce
Speak With Interrupt
Phrase: "Hello"
Phrase: "Thank You for calling "
2. External Action: Exec_UNIX
Command_String: "/usr/jcangelo/bin/seeit"
Return_String: cRetString
Return Field: nRetValue
3. Set Field Value
Field: cTemp = cRetString
4. Announce
Speak With Interrupt
Phrase: "Goodbye"
5. Disconnect
6. Quit
===================================================

CH016: TSM[001]: JC_try: STEP: 1
CH016: TSM[001]: play(talkfile: 121 phrase: 1000 style: 50)
CH016: TSM[001]: play(talkfile: 101 phrase: 2142 style: 50)
CH016: TSM[001]: JC_try: STEP: 2 VALUE: ""
CH016: TSM[001]: Pushed stack, level 1
CH016: TSM[001]: Set PC to 472
CH016: TSM[001]: JC_try: STEP: 1000 VALUE: "*** Exec_UNIX START ***"
CH016: TSM[001]: JC_try: STEP: 22222 VALUE: "/usr/jcangelo/bin/seeit"
....
....
----
CH016: sbFaxProc: /vs/bin/vrs/sbFaxProc: action: EXEC_UNIX return value: 2 jobid
: -1
...
...
...
CH016: TSM[001]: JC_try: STEP: 1000 VALUE: "*** Exec_UNIX END ***"
CH016: TSM[001]: Popped stack (rts), level 0
CH016: TSM[001]: JC_try: STEP: 2 VALUE: 2
CH016: TSM[001]: JC_try: STEP: 3 VALUE: "5"
CH016: TSM[001]: JC_try: STEP: 4
CH016: TSM[001]: play(talkfile: 101 phrase: 2375 style: 50)
CH016: TSM[001]: JC_try: STEP: 5
 
What is the length of your cRetString variable?

Do you use more than 127 chars length?

I am using just 20, is this the reason I got the empty string.

If you use more char[127], could you please test it with cRetString eg char[20], or just char[1], which is long enoguh for my example.

Thanx in advance
MArko

 
Here are my variable definitions. I'd still be curious to see your trace...
Field Name Field Type Field Size
* cRetString char 10
* cTemp char 10
* cd_ssn char 9
* cd_total num
* nRetValue num
****************************************************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top