$ cat foo.sh #!/bin/kshecho fooehco foo2It doesn't warns for errors:$ /bin/ksh -n foo.sh $ echo $?0Question: How can I get the ksh -n to warn me about syntax errors? 
How to check a ksh script for syntax errors?
ksh
If you had syntax errors in that script, you'd see them on stderr. ksh -n is the right thing. An example:$ cat script.kshtouch tmpfilefor f in tmpfile   # missing do  rm $fdone$ ksh script.kshscript.ksh: syntax error at line 3: `rm' unexpected$ ls -l tmp*-rw-rw-r-- 1 glennj glennj 0 Jul 22 06:54 tmpfile$ rm tmpfile$ ksh -n script.kshscript.ksh: syntax error at line 3: `rm' unexpected$ ls -l tmp*ls: cannot access tmp*: No such file or directorySo, the script was parsed but not executed (the file was not created)