No color output in iocage jail shell

CJRoss

Contributor
Joined
Aug 7, 2017
Messages
139
I've created a jail in order to use rmlint to help clean up my storage. Running the rmlint command produces colorized output. However, when I run the rmlint.sh script that the rmlint command creates, I get a bunch of control characters instead of color output. This happens whether I use the web shell or the iocage console command.

I've tried setting IOCAGE_COLOR to TRUE but that doesn't seem to have any effect.
 
Joined
Oct 22, 2019
Messages
3,641
What “shell” is the configured for the user?

I see color output when I use it. My shell is /bin/csh

Code:
echo $SHELL


- - -


UPDATE: I figured it out.

You need to specifically invoke bash when running the script:

Code:
bash rmlint.sh


Looks like the authors of rmlint set /bin/sh as the interpreter for the auto-generated script file.
 
Last edited:

CJRoss

Contributor
Joined
Aug 7, 2017
Messages
139
What “shell” is the configured for the user?

I see color output when I use it. My shell is /bin/csh

Code:
echo $SHELL


- - -


UPDATE: I figured it out.

You need to specifically invoke bash when running the script:

Code:
bash rmlint.sh


Looks like the authors of rmlint set /bin/sh as the interpreter for the auto-generated script file.

I'm using the root user of the jail and my shell is csh. Did you just pkg install bash?
 
Joined
Oct 22, 2019
Messages
3,641
I'm using the root user of the jail and my shell is csh. Did you just pkg install bash?

Correct. If you don't have bash installed, then yes you need to install it with pkg install bash
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Looks like the authors of rmlint set /bin/sh as the interpreter for the auto-generated script file.
Typical LInux script authors assuming /bin/sh is just a symlink to bash.
 
Top