0

emacs 29.1 flycheck 32

test.sh

#!/usr/bin/zsh
echo "test"
ech boo

C-c ! v gives

Syntax checkers for buffer test.sh in sh-mode:

First checker to run:

  sh-zsh
    - may enable:    yes
    - predicate:     t
    - executable:    Found at /usr/bin/zsh
    - next checkers: sh-shellcheck

but nothing shows up with syntax checking

nor does C-c ! C-c flycheck compile produce anything:

-*- mode: compilation; default-directory: "~/" -*-
Compilation started at Tue Aug  8 16:19:45

/usr/bin/zsh --no-exec --no-globalrcs --no-rcs /home/pradmin/test.sh

Compilation finished at Tue Aug  8 16:19:45

yet running the program through emacs C-c C-x gives:

-*- mode: compilation; default-directory: "~/" -*-
Comint started at Tue Aug  8 16:22:59

/home/pradmin/test.sh
test
/home/pradmin/test.sh:5: command not found: ech

Comint exited abnormally with code 127 at Tue Aug  8 16:22:59

how to get flycheck to work using sh-zsh? (it works fine with clojure btw)

0

1 Answer 1

1

It's not a syntax error. You're trying to run a program named ech (which is a perfectly valid thing to do), and the code linter can't possibly know whether or not ech will be installed on whichever machine(s) this script may ultimately be running on, so it's not going to even try to validate that.

1
  • thx! i should have realized this from run output where it says: /home/pradmin/test.sh:5: command not found: ech Commented Aug 9, 2023 at 1:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.