I've been porting a bunch of scripts on AIX 7.1. I got no prior experience with this Unix system.
The scripts were ran under /bin/sh
and relied on /dev/stdout
, /dev/stdin
and /dev/stderr
. These files are known to be non-standardized and the AIX 7.1 does not seem to implement them.
As I discovered the /proc
VFS is present, so I tried to substitute the /dev/std{in|out|err}
with /proc/$$/fd/{0|1|2}
. This failed, since the descriptors are not links to a pts
but a real char file devices with permissions 000 (c---------
).
The /bin/bash
is known to emulate many devices in /dev
including /dev/std*
. My limited experiments with switching to /bin/bash
from /bin/sh
and using /dev/std*
were successful. However, switching & testing all the scripts to /bin/bash
would be time consuming.
Question:
How to handle the standard IO files in AIX 7.1 under /bin/sh
? Is employing eg. /dev/tty
the way?
// Example of a call in one of the scripts to be ported:
# param_protocol parameter apparently needs a file representation of the stdout
black_box_binary param1=$value1 param2=$value2 param_protocol=/dev/stdout