Page 1 of 1
					
				UnixCmdOA witth specific shell
				Posted: Wed Mar 26, 2025 8:08 pm
				by stefan@tageson.se
				Hi!
I would like to use /QOpenSys/pkgs/bin/bash as shell in unixcmdoa.
There's references on a "raw" option - any examples available on how to use this?
Thanks!
Stefan
			 
			
					
				Re: UnixCmdOA witth specific shell
				Posted: Fri Apr 04, 2025 10:52 pm
				by Scott Klement
				I don't think the raw option is what you're looking for.  With raw, whatever you pass as the command is treated as a program to load and run in the spawned job.  I don't think there's a way to make that work for what you're trying to do.
Take a look at the pipe_open() subproc in UNIXPIPER4.  Find the code that looks like this:
Code: Select all
         select;
         when myType = 'Q';
           arg(1) = '/qsys.lib/qshell.lib/qzshsh.pgm' + x'00';
           arg(2) = '-c' + x'00';
           arg(3) = cmd + x'00';
           argc   = 3;
         when myType = 'P';
           arg(1) = '/qsys.lib/qp2shell.pgm' + x'00';
           arg(2) = '/qopensys/usr/bin/sh' + x'00';
           arg(3) = '-c' + x'00';
           arg(4) = cmd + x'00';
           argc   = 4;
         other;
           arg(1) = cmd + x'00';
           argc   = 1;
         endsl;
It seems to me that you want to add a 4th option thats 'B' (for bash) .  It would be a copy of the 'P' code above, except replacing the /qopensys/usr/bin/sh shell with your path to bash.
Once you've added that, you'd edit UNIXCMDOA and add a 'bash' type in there that translates to 'B' before calling pipe_open().