Hi everyone
Environment:
1 ) I have AIX 7
2 ) over this AIX I have installe Oracle forms 12.2.1
3 ) this AIX have korn shell
4) Installed python version is 2.7
4 ) ERP clients use windows 10 to run ERP application
5 ) command which python show: /usr/bin/python
6 ) python --version show: Python 2.7.18
Then, I need run python script from Oracle App from client. I am using HOST command.
Bash script works ok if I run this bash from AIX terminal... but if run it from ERP client using command host, bash commands works ok but python script called from inside bash script not works.
Simple example:
-- test.sh
#!/bin/bash
echo " start bash " && /u02/oraApp12c/transfer/test.py
echo " after executing py script"
-- test.py
#!/usr/bin/python
with open('test.txt', 'w') as f:
f.write('test test test\n')
Both scripts have all permissions (chmod a+x) and located in /usr/oraApp12c/transfer. This directory is accessible...
Running from terminal like this $ ./text.sh works ok (file test.txt is created).... BUT if I call test.sh from WHEN-BUTTON-PRESSED in my form file test.txt not created, the part /u02/oraApp12c/transfer/test.py sees not executed ( in fact is not executed )
In my form I am executing:
.....
......
Lv_command := '/u02/oraApp12c/transfer/test.sh';
HOST(LV_command)
....
.....
I searched in google and seems python evironment is not loaded/recognized when call python from bash....
I have tried call python script directly from oracle forms when-button-pressed but not works too.
I have also tried locate like first line into python script : #!/usr/bin/python2.7 but not works
I have also tried locate like first line into python script : #!/usr/bin/env python2.7 but not works
I have also tried locate like first line into python script : #!/usr/bin/env python but not works
Summary: Python script called from bash script not works if bash script is called from oracle forms when-button-pressed BUT it works OK if it is executed from AIX terminal
Thanks in advanced.