Working with open source becomes easier after you’ve set the IBM i open source environment path: /QOpenSys/pkgs/bin. The PATH helps resolve program names to their absolute paths, so that you don’t have to specify the full path manually (similar to library lists).

To set up the /QOpenSys/pkgs/bin path, type these two commands:

PATH=/QOpenSys/pkgs/bin:$PATH
export PATH PASE_PATH

Explanation of the commands above:

  • PATH=/QOpenSys/pkgs/bin:$PATH adds the open source path to existing path
  • export PATH PASE_PATH makes the path available to programs started by this shell, whether SSH, QP2TERM, or QSHELL

Using .profile to make the path change permanent

Your PATH setting will remain during the current session only, unless you take one more step. To make the path commands run every time you log in, create a .profile file in your home directory (i.e. /home/JANE/.profile) and copy the commands into it. Your shell will run all the commands in it before displaying the initial $.

Setting the Default Shell

If you’re using SSH, you may prefer using bash as your default shell instead of the default AIX shell; bash provides command history and line editing that you’d miss out on with the default shell. If you found yourself starting bash every time you open a shell, this section is for you!

  1. Install chsh. You can do so from Yum (run the following command) or through the Open Source Package Management window in ACS.
    $ yum install chsh
  2. From a PASE session with the PATH set (see above), run the following command, substituting “user” with your username. If you want to use a shell other than bash, put in the path to that shell instead. You only need to run this once; it changes the user profile object.
    $ chsh -s /QOpenSys/pkgs/bin/bash user

Diagnosing issues with your path

You can show the contents of the PATH variable:

$ echo $PATH

The which command will resolve names on your PATH and print their full path.

$ which curl java
/QOpenSys/pkgs/bin/curl
/QOpenSys/usr/bin/java

Bash caches the results of resolving names on PATH. If you’ve done something to change this (for example, installing curl from Yum instead of OPS), then you might need to flush the cache:

$ hash -r

IBM i Development

  • RPG, COBOL, SQL, Node,
    PHP, Python, Valance, etc.
  • Modernization. Integration.
  • Web and API Solutions
  • Legacy Maintenance
    ...
(or call 201.447.2437)
Open source support for IBM i

Got PHP Issues?
GET ANSWERS!

Your PHP should be trouble-free. If your current PHP environment is anything less than perfect, we can help!

SSL /TLS for IBM i