haideralipunjabi/polybar-kdeconnect

"Syntax error: redirection unexpected" - script uses sh instead bash

fuzxi opened this issue · 1 comments

fuzxi commented

Hello,
When I run polybar with the module, the following shows on my bar:
/bin/sh: 60: /home/user/git/polybar-kdeconnect/polybar-kdeconnect.sh: Syntax error: redirection unexpected

Line 60 is:
menu="$(rofi -sep "|" -dmenu -i -p "$1" -location $LOCATION -yoffset $YOFFSET -xoffset $XOFFSET -theme $THEME -width $WIDTH -hide-scrollbar -line-padding 4 -padding 20 -lines 5 <<< "Battery: $3%|Ping|Find Device|Send File|Unpair")"

I believe the issue is with the <<< operator. The script seems to be running in sh shell instead of bash. I do have bash installed, but neither #!/usr/bin/env bash nor #!/bin/bash affect the script.

I do have all the other dependencies installed.

My polybar config does include the space between . and the script path.

fuzxi commented

Fixed by symlinking bash to /bin/sh.
sudo ln -sf bash /bin/sh