Skip to content

Instantly share code, notes, and snippets.

@luisadha
Created November 2, 2022 16:21
Show Gist options
  • Save luisadha/fa1dc119f86a91f4448b5d627fa529a3 to your computer and use it in GitHub Desktop.
Save luisadha/fa1dc119f86a91f4448b5d627fa529a3 to your computer and use it in GitHub Desktop.
ft command for force output always true (0).
#!/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