I am creating a startup script for an application. This application's startup script is in bash. It will also need to call a perl script (which I will not be able to modify) for the application environment prior to calling the application. The problem is that this perl script creates a new shell when started and will not automatically exit. Therefore it will sit until I enter �exit�, then the application will start, but I lost the environment I need.
Simple Application Script Example:
#!/bin/bash
# call perl script that sets the application environment
Perl_env_script
# startup application
APP_START
Putting the �Perl_env_script� in the background still placed the needed environment outside the application and I don't get the environment I need when the application starts.
I also want to mention that I can manually type the command `Perl_env_script`, which leaves me in its current shell, where I can manually start the application normally. Unfortunately, this will be used from an application menu launcher and so I need to automate this process.
If this cannot be done, then I'll take the time to go through the perl script (which is huge and confusing) to gain the environment I need, but I was hoping there was an easier way.
Thanks for your help!
Frustrated Newbie
---------- Post updated at 03:23 PM ---------- Previous update was at 12:13 PM ----------
I got it working, but it's a two-step process:
I created a one-line script that calls the Perl script within an xterm:
xterm -e Perl_env_script
Once the xterm is up, the user will have to start another script to start the application:
APP_START:
#!/bin/sh
export APP_HOME=/testapps/apps
${APP_HOME}/bin/APPclient
I don't like the two-step process, but it is working. I might receive some complaints from users. So, if you know of a more streamlined way of doing this, please let me know.
Again, Thanks!