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
			
			
									
						
										
						UnixCmdOA witth specific shell
- 
				stefan@tageson.se
 - Posts: 23
 - Joined: Wed Jul 28, 2021 7:55 am
 - Location: Viken, Sweden
 - Contact:
 
- 
				Scott Klement
 - Site Admin
 - Posts: 935
 - Joined: Sun Jul 04, 2021 5:12 am
 
Re: UnixCmdOA witth specific shell
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:
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().
			
			
									
						
										
						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;
Once you've added that, you'd edit UNIXCMDOA and add a 'bash' type in there that translates to 'B' before calling pipe_open().