I want to replace some shellscripts using ruby and therefore I need a
method to execute external scripts (ksh). Without rewriting a lot of
scripts, I need the possibility to execute external scripts in another
directory (as the ruby-script) but within their directory context:
path1 -> rubyscript.rb
path2 -> shellscript.ksh
path3 -> last_script.ksh
shellscript.ksh calls the other scripts using relative path statements
but when I use system(“path2/shellscript.ksh”), shellscript.ksh is
started with the rubyscript.rb-directory context and within
shellscript.ksh, the call of “./anotherscript.ksh” or
“path3/last_script.ksh” results in “script not found here you fool!”.
I tried some things like
system(“cd path2; shellscript.ksh”)
but none of them worked out.
What do you suggest?