From 4007e22c288a6868af1cb2767ce8eb0251feb223 Mon Sep 17 00:00:00 2001 From: NRK Date: Sat, 1 May 2021 02:56:50 +0600 Subject: [PATCH] refactor $LINK checking --- sxbm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sxbm b/sxbm index 43542a9..c6206c5 100755 --- a/sxbm +++ b/sxbm @@ -152,9 +152,10 @@ bm_open(){ esac done - [ -z "$LINK" ] && die "No links found" - local LINK_NUM=$( printf "$LINK" | wc -l ) + [ -n "$LINK" ] && + local LINK_NUM=$( printf "$LINK" | wc -l ) || + die "No links found" if [ "$LINK_NUM" -gt 0 ]; then die "Too many links\nUse 'sxbm open -f' to force open them all\n\n$(bm_list "-c" "$@")"