$ cat foo.sh
#!/bin/ksh
echo foo
ehco foo2
It doesn't warns for errors:
$ /bin/ksh -n foo.sh
$ echo $?
0
Question: How can I get the "ksh -n" to warn me about syntax errors?
It doesn't warns for errors:
Question: How can I get the "ksh -n" to warn me about syntax errors? |
||||
|
If you had syntax errors in that script, you'd see them on stderr.
So, the script was parsed but not executed (the file was not created) |
|||
|
This is not a syntax error for actual ksh syntax, it's syntax error for invalid command name which only catched at run time. When you run it, you will get command not found error. If you add:
Then run:
|
|||
|