ion − Input/Output Normalizer
ion PROGRAM [ARGS...]
Ion runs the supplied program with its three standard streams connected to a tty. Normally this means that the program’s stdin, stdout, and stderr will be line-buffered.
Admittedly, there’s not much sense in that when started from the command line. However, there is a scenario when the use of ian becomes necessary. It is when an interactive PROGRAM is invoked from another program, which communicates with it via pipes. Unless the invoked PROGRAM takes special precautions, its standard streams would become fully buffered, which would make any interactive use meaningless. In this scenario, the calling program is supposed to run ion with its command line being the PROGRAM name and its arguments. When invoked so, the calling program would be able to communicate with the PROGRAM just as a human being would using the console.
One example of such usage is xfs_db(8), which, when called from an interactive program such as xfs_irecover(8) from Jan Engelhardt’s hxtools fails to communicate because it uses full buffering by default.
Often it is not possible or desirable to alter the calling program so, that it would run ion instead of the intended PROGRAM. Taking into account this, ion implements a special calling convention. Namely, unless invoked as ion it tries to spawn the program it is invoked as with the arguments from its command line. The PROGRAM (unless started with an absolute pathname) is then searched in the system PATH, excluding the directory where the invoked copy of ion itself is located.
To use this feature, make sure you link ion to a program name in a directory preceding the one where the actual program is located in the PATH. For example, suppose you want to run xfs_db which is normally located in /usr/bin. Then, supposing that /usr/local/bin precedes /usr/bin in the path, install ion there and link it to xfs_db:
$ cp ion /usr/local/bin $ cd /usr/local/bin $ ln -s ion xfs_db
Once done, invoking xfs_db from your program will first invoke ion, which will invoke xfs_db from /usr/bin.
Ion is available in source form from its git repository.
Recent news, changes and bugfixes can be tracked from the project's development page.
Report bugs to <firstname.lastname@example.org>.
© 2013 Sergey Poznyakoff
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Manpage server at Ulysses.gnu.org.ua.
Powered by mansrv 1.0