.profile scripts under Q2PTERM and SSH
Issue #42
resolved
I am finding inconsistencies from .profile scripts running when call Q2PTERM and when I use SSH into my LPAR or basically any script.
For example: HOST=$(uname -n) -- works fine with Q2PTERM but throws an error with SSH session
Thoughts?
Comments (3)
-
-
Perfect thanks, changed the *dft shell for ssh to ksh looks way better
-
- changed status to resolved
Awesome! I would have changed it to bash, but whatever floats your boat :D
- Log in to comment
The shell used by QP2TERM is /QOpenSys/usr/bin/ksh, while SSH will use the user's shell if one is set or fall back to /QOpenSys/usr/bin/bsh. The problem is that user's don't have their shells set by default, so you must set it yourself: http://ibmsystemsmag.com/blogs/open-your-i/august-2017/tech-tip-be-like-a-turtle/
bsh is very old and doesn't support "advanced" features like
$()
syntax. Instead, you would need to use portable backticks syntax instead. (Or just change your shell appropriately).