You can have the interpretor check your syntax (Korn) by adding one of the following lines below the "magic number" in your script. Also note that the options can be enabled or disabled by using (+) or (-) signs.
set -x (Show commands and arguments during execution)
set -n (Read the commands but dont execute - syntax check)
Hello i have question that i want check syntax from my script shell with sh -n filename
but it's not show something even i have wrong syntax in my file. why can this happened or any other way to check it?
i use on header of file :
#!/bin/sh
thx before :) (7 Replies)
Hi everyone, i'd like someone chechk this script, i know it's very simple but it doesn't work good, let me tell you this script works over huge directories, maybe that's the problem, if somebody can give me other way to develop, or show me where it's the problem, i'll appreciate it.
... (9 Replies)
Hello All,
I looking for a way to verify the correction of shell script syntax.
Is there any switch like -c in perl which do this in shell ?
Thank You. (1 Reply)
I've made an awk command that works successfully.
However I'd like to add one character to it.
For example instead of /what_i_have_now/
I'd like to change just ONE field to the opposite with an exclamation point.
Like this: ! /what_i_have_now/
My question, where am I supposed to place... (1 Reply)