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)

Drew
  • 75,699
  • 9
  • 109
  • 225

1 Answers1

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.

phils
  • 48,657
  • 3
  • 76
  • 115
  • thx! i should have realized this from run output where it says: /home/pradmin/test.sh:5: **command not found: ech** – pradesigner Aug 09 '23 at 01:10