[IBM i]

Configuring Qshell to run WebSphere scripts using wsadmin scripting

You can configure Qshell to run product scripts for IBM® i.

About this task

In a default installation, unless otherwise specified, all WebSphere® Application Server scripts are in the app_server_root/bin directory.

The scripts must be run from Qshell. To ensure that you use the correct version and directory, run QShell commands using one of the following methods:

Procedure

  • Invoke the fully qualified path name of the script:
    app_server_root/bin/script_name parameters
    where script_name is the name of the script and parameters represents the parameters that are passed to the script.
  • Invoke the script from the IBM i command line or from an IBM i CL program. To use this method, run the STRQSH command and specify the fully qualified path name of the script:
    STRQSH CMD('app_server_root/bin/script_name parameters')
    where script_name is the name of the script and parameters represents the parameters that are passed to the script.
  • Change directories to the app_server_root/bin directory and run the following script:
    cd app_server_root/bin 
    script_name parameters
    where script_name is the name of the script, and parameters represents the parameters that are passed to the script.
  • You can update the PATH environment variable to automatically locate the script when you run it. After you update the PATH variable, you can run these scripts from any directory. To update the PATH environment variable, perform the following steps:
    1. Edit the .profile file in the /home/user_profile_name directory, where user_profile_name is the name of your IBM i user profile.

      If this file does not exist, create it in this directory. You can use the EDTF command from an IBM i command line or use any editor from a workstation. Also note that .profile is the full name of the file. When you start Qshell, it searches for the .profile file, and runs the commands listed in it. You can use the .profile file to set persistent environment variables for your Qshell session.

    2. Add the following line to the .profile file:
      export PATH=app_server_root/bin:$PATH
    3. Save the file.

What to do next

The updates to .profile do not take effect until you restart Qshell (if you had a session open) or start .profile with the ./home/user_profile_name/.profile command.

To change the path for a single Qshell session instead of changing the default path for all Qshell sessions, run the export commands shown in the last step during the Qshell session, but do not edit the .profile.