Commit | Line | Data |
---|---|---|
59f0d218 FF |
1 | #!/bin/sh |
2 | ||
3 | if [ $# = 0 -o "$1" = "-h" ]; then | |
4 | echo 'usage: termux-fix-shebang <files>' | |
5 | echo 'Rewrite shebangs in specified files for running under Termux,' | |
6 | echo 'which is done by rewriting #!*/bin/binary to #!$PREFIX/bin/binary.' | |
7 | exit 1 | |
8 | fi | |
9 | ||
c4912801 FF |
10 | for file in $@; do |
11 | # Do realpath to avoid breaking symlinks (modify original file): | |
346477db | 12 | sed -i -E "1 s@^#\!(.*)/bin/(.*)@#\!/data/data/com.termux/files/usr/bin/\2@" `realpath $@` |
c4912801 | 13 | done |