mitchweaver / subs

:tv: YouTube subscription manager via dmenu and mpv, no Google account needed.
MIT License
68 stars 3 forks source link

Single quotes are not needed in SUBS_MENU_PROG setting #7

Closed an9wer closed 3 years ago

an9wer commented 3 years ago

Hi, there is an error occurred in line 215 when I run subs (my /bin/sh is linked to bash which version is 5.0.18):

$ ./subs
./subs: line 215: 'dmenu: command not found
Interrupted

I've install dmenu command, so why does this happen?

But then I noticed the dmenu is prefix with a single quote ('dmenu), I found that the cause of this error is the code in line 24:

: "${SUBS_MENU_PROG:='dmenu -p Subs:'}"

I think there is no need to wrap dmenu command with single quotes here.

Below is my proof:

Start an interactive bash, run with single quotes wrapped:

$ : "${SUBS_MENU_PROG:='dmenu -p Subs:'}"
$ declare -p SUBS_MENU_PROG
declare -- SUBS_MENU_PROG="'dmenu -p Subs:'"

Start ahother interactive bash, run without single quotes wrapped:

$ : "${SUBS_MENU_PROG:=dmenu -p Subs:}"
$ declare -p SUBS_MENU_PROG
declare -- SUBS_MENU_PROG="dmenu -p Subs:"
mitchweaver commented 3 years ago

You are correct, that is an oversight by me! Also needs the -l flag to list vertically.