haideralipunjabi / polybar-kdeconnect

KDEConnect module for Polybar
https://blog.haideralipunjabi.com/posts/making-modules-for-polybar-shell-python/
164 stars 11 forks source link

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

Closed fuzxi closed 5 years ago

fuzxi commented 5 years ago

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 5 years ago

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