junegunn / fzf-git.sh

bash and zsh key bindings for Git objects, powered by fzf
612 stars 53 forks source link

sh: 1: Syntax error: redirection unexpected #37

Closed hanoii closed 6 months ago

hanoii commented 6 months ago

I keep getting sh: 1: Syntax error: redirection unexpected on the preview window this on a docker container when using _fzf_git_branches.

I tracked this down to to

$(sed s/^..// <<< {} | cut -d" " -f1)

Changing it with

$(echo {} | sed s/^..// | cut -d" " -f1) works

Any idea why?

hanoii commented 6 months ago

I realized that although I was on bash, SHELL was not exported so it was picking up sh for the preview command. Odd, anyway, now fixed with making sure export SHELL happens.