aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEuro20179 <f>2021-03-01 13:25:41 -0800
committerEuro20179 <f>2021-03-01 13:25:41 -0800
commitb22b2b56fd1a4f3dd316378281569fbb163cf09f (patch)
tree40b9c6dfb203031095f6f11331dc51af262b694e
parent39208f8d44006f3563b75e825732499b681484df (diff)
downloadytfzf-b22b2b56fd1a4f3dd316378281569fbb163cf09f.tar.gz
fixed bug when n was more than results found
-rwxr-xr-xytfzf5
1 files changed, 5 insertions, 0 deletions
diff --git a/ytfzf b/ytfzf
index 7f750d2..93b14c9 100755
--- a/ytfzf
+++ b/ytfzf
@@ -300,8 +300,13 @@ user_selection () {
[ -z "$shorturls" ] && exit;
urls=""
selected_data=""
+ #used so if n is more than results found it breaks
+ previous_url=""
while read surl; do
[ -z "$surl" ] && continue
+ # means it has found the last result
+ [ "$previous_url" = "$surl" ] && break
+ previous_url="$surl"
urls="$urls\nhttps://www.youtube.com/watch?v=$surl"
# to get back untrucated titles from formatting
selected_data="$selected_data\n$(echo "$videos_data" | grep -m1 -e "$surl" )"
Un proyecto texto-plano.xyz