Use POSIX shell constructs instead

This commit is contained in:
Augusto Gunsch 2021-10-27 20:13:51 -03:00
parent 7feb65e8f9
commit 29c7b3e72f
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
1 changed files with 8 additions and 8 deletions

16
fsub
View File

@ -12,14 +12,14 @@ usage() {
[ -z "$1" ] && usage
for arg in "$@"; do
if [ ! -f "$arg" ]; then
echo "$arg is not a file"
usage
fi
if [ "${arg: -4}" != ".srt" ]; then
echo "$arg is not a .srt file"
usage
fi
case "$arg" in
*.srt )
if [ ! -f "$arg" ]; then
echo "$arg is not a file"
usage
fi ;;
*) echo "$arg is not a .srt file"; usage ;;
esac
done
[ -f "$FSUBRC" ] || touch $FSUBRC