termux-packages/packages/termux-tools/termux-fix-shebang
Fredrik Fornwall 59f0d218a6 Initial push
2015-06-13 01:03:31 +02:00

11 lines
309 B
Bash
Executable File

#!/bin/sh
if [ $# = 0 -o "$1" = "-h" ]; then
echo 'usage: termux-fix-shebang <files>'
echo 'Rewrite shebangs in specified files for running under Termux,'
echo 'which is done by rewriting #!*/bin/binary to #!$PREFIX/bin/binary.'
exit 1
fi
sed -i -E "s@^#\!(.*)/bin/(.*)@#\!@TERMUX_PREFIX@/bin/\2@" $@