Created
November 2, 2022 16:21
-
-
Save luisadha/fa1dc119f86a91f4448b5d627fa529a3 to your computer and use it in GitHub Desktop.
ft command for force output always true (0).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/system/bin/sh | |
# | |
# FT stands for (force true) to use Disableprecmd in prompt | |
# MIT License, Copyleft (c) 2021 Luis Adha. | |
# This is asset of kalip.sh | |
# Usage: ft [command] | |
# or: ft ./file | |
# or: ft sh [file] | |
# | |
# ex: ft adb #with status successfully | |
echo "$(realpath $0): Needs 1 argument (see "ft -h")"; #gantiprompt Don't rtl | |
while getopts ":h" option; do # Don't rtl | |
case $option in | |
h) | |
print -r -- "E: Usage: ft [COMMAND] -- ft [sh FILE] -- ft [./FILE] "; | |
print -r -- "I: Run COMMAND or FILE force them to show exit status always 0"; | |
exit 0 | |
;; | |
\?) | |
echo "Error: Invalid option" | |
exit;; | |
esac | |
done | |
cmd="$*" | |
${cmd} | true && ${cmd} 2>/dev/null; | |
return 0 | |
# FT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment