You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
425 B
13 lines
425 B
#!/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
|
|
|
|
for file in $@; do
|
|
# Do realpath to avoid breaking symlinks (modify original file):
|
|
sed -i -E "s@^#\!(.*)/bin/(.*)@#\!/data/data/com.termux/files/usr/bin/\2@" `realpath $@`
|
|
done
|
|
|