Skip to content

Commit 56f63e8

Browse files
committed
Updated notes on setting bash
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
1 parent 4296c9a commit 56f63e8

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

src/content/docs/tips/bash.mdx

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,50 @@ This should return `/QOpenSys/pkgs/bin/bash`. If it doesn't then you need to ta
1818

1919
## Setting Bash as the Default Shell
2020

21+
*Some techniques come directly from the official [IBM i OSS docs page](https://ibmi-oss-docs.readthedocs.io/en/latest/troubleshooting/SETTING_BASH.html)*
22+
23+
### Technique #1: Code for IBM i
24+
2125
When you connect to a server, _Code for IBM i_ checks that bash is your default shell. If bash is not the default shell, it will offer to set bash as the default.
2226

2327
![bash set offer](../../../assets/Tips_Bash_Offer.png)
2428

2529
This is the most convenient way to set bash as your default shell. You can ignore this prompt, but be aware that not all capabalities may work.
2630

27-
You can get information on setting bash as your default shell [from IBM here](https://ibmi-oss-docs.readthedocs.io/en/latest/troubleshooting/SETTING_BASH.html).
31+
### Technique #2: chsh
32+
33+
1. Use yum to install the `chsh` package (for instamce, `yum install chsh`)
34+
35+
2. From a shell, use the `chsh` command to set your shell
36+
(for instance, `/QOpenSys/pkgs/bin/chsh -s /QOpenSys/pkgs/bin/bash`).
37+
You can set the shell for another user via the `-u` option
38+
(for instance, `/QOpenSys/pkgs/bin/chsh -s /QOpenSys/pkgs/bin/bash -u otherusr`).
39+
40+
### Technique #3: sql
41+
42+
You can set bash to be your default shell by running the following command from
43+
anywhere you have an SQL context, such as the Run SQL Scripts tool:
44+
45+
```sql
46+
CALL QSYS2.SET_PASE_SHELL_INFO('*CURRENT', '/QOpenSys/pkgs/bin/bash')
47+
```
48+
49+
You can also set bash to be the default shell for all users, by running:
50+
51+
```sql
52+
CALL QSYS2.SET_PASE_SHELL_INFO('*DEFAULT', '/QOpenSys/pkgs/bin/bash')
53+
```
54+
55+
Or, for a specific user:
56+
57+
```sql
58+
CALL QSYS2.SET_PASE_SHELL_INFO('OTHRUSR', '/QOpenSys/pkgs/bin/bash')
59+
```
60+
61+
More information on this IBM i service can be found on [developerWorks](https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/IBM%20i%20Technology%20Updates/page/QSYS2.SET_PASE_SHELL_INFO%20Procedure)
62+
63+
Also, the default shell setting can be queried out with [QSYS2.USER_INFO](https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/IBM%20i%20Technology%20Updates/page/QSYS2.USER_INFO%20catalog)
64+
2865

2966
## Adding Bash to your PATH
3067

0 commit comments

Comments
 (0)