Skip to content
This repository

eval "$(sub init -)" in .bash_profile throws errors #13

Closed
xCette opened this Issue October 09, 2012 · 6 comments

3 participants

xCette Mislav Marohnić Nick Quaranto
xCette

When I add the proper line from sub init to my bash_profile it spews the following error:
-bash: eval: line 31: syntax error near unexpected token )'
-bash: eval: line 31:
)'

This is definitely coming from the sub call. I also tried this format instead, but get the same error.
subb=sub init -
eval "$subb"

I can manually call this sequence and it will not produce the same error.
sub init- > foo; eval < foo; rm foo

This is all on OSX, in case that is relevant.

Mislav Marohnić

It would be useful to paste your output of sub init - here so we can see what bash tries to eval and fails.

sub init - | pbcopy
# then paste to GitHub
xCette
~/kiva/streams/kiva $ kiva init -

export PATH="${PATH}:/Users/mwaxler/kiva/streams/kiva/bin"
source "/Users/mwaxler/kiva/streams/kiva/libexec/../completions/kiva.bash"
kiva() {
  local command="$1"
  if [ "$#" -gt 0 ]; then
    shift
  fi

  case "$command" in
  )
    eval `kiva "sh-$command" "$@"`;;
  *)
    command kiva "$command" "$@";;
  esac
}
Mislav Marohnić

You should edit your comment and wrap all code between triple tilde (~) signs at beginning and end. This transforms it into code block.

xCette

Any idea what is going on here?

Nick Quaranto
Owner

It looks like somehow the shell after the case statement got removed. Can you add it back in? Here's the output of sub init - from inside of the sub dir for me:

export PATH="${PATH}:/Users/qrush/dev/sub/bin"
source "/Users/qrush/dev/sub/libexec/../completions/sub.zsh"
sub() {
  local command="$1"
  if [ "$#" -gt 0 ]; then
    shift
  fi

  case "$command" in
  shell)
    eval `sub "sh-$command" "$@"`;;
  *)
    command sub "$command" "$@";;
  esac
}
xCette

Yes, that fixed it. Thanks so much for the assistance. I have no idea how that got broken, going back in my source control I dont see it ever being present. I'm going to chalk it up to a stray keystroke at some point.

Thanks again.

xCette xCette closed this November 01, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.