From d4e34ad096cfc15b9c537463dd3c08becc5dc84e Mon Sep 17 00:00:00 2001 From: iceyrazor Date: Sun, 24 May 2026 01:25:07 -0500 Subject: posix shell changes removed ls | grep fixed miss spelled word --- getytmd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'getytmd') diff --git a/getytmd b/getytmd index 4c9a563..93cbfa4 100755 --- a/getytmd +++ b/getytmd @@ -1,9 +1,9 @@ -#!/bin/bash -script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +#!/bin/sh +script_dir="$( cd "$( dirname "$0" )" > /dev/null 2>&1 && pwd )" playlist=$1 -if [ "$playlist" == "" ]; then +if [ "$playlist" = "" ]; then ytid_arr="$(sqlite3 "$script_dir/youtube_stuffs.db" "select id from ytlist")" else ytid_arr="$(sqlite3 "$script_dir/youtube_stuffs.db" "select id from ytlist where category='$playlist'")" @@ -15,7 +15,7 @@ printf "# yt list gen\n\n" > ytlist-thumb.md for ytid in $ytid_arr; do item="$(sqlite3 -- "$script_dir/youtube_stuffs.db" "select rowid,title from ytlist where id='$ytid'" | sed 's/*/\\*/g')" - thumb="$(find -- $script_dir/thumbnails/$ytid*)" + thumb="$(find -- "$script_dir"/thumbnails/"$ytid"*)" printf -- "- [%s](https://youtube.com/watch?v=%s)\n" "$item" "$ytid" >> ytlist.md printf -- "- [%s](https://youtube.com/watch?v=%s)\n - ![thumb](%s)\n" "$item" "$ytid" "$thumb" >> ytlist-thumb.md done -- cgit v1.3