unexpectedksh:----Error received
I am new to Linux. We have a server that is used primarily for ssh but would like to add running some ksh scripts. I am running one but am getting this error: ' unexpectedksh: line 87: syntax error at line 90: `in
line 87=ARS_OPTS=$@ line 90=case "$1" in THIS IS THE CODE: ARS_OPTS=$@ while [ $# -gt 0 ] do case "$1" in -h|-\?) #display help info and exit Usage;; -s) #severity SEVERITY=$2; shift; shift;; -g) #assignment group GROUP=$2; shift; shift;; -d) #description DESC=$2; shift; shift;; -c) #config file ARS_CONFIGFILE=$2; shift; shift;; -*) #invalid options - show error and exit echo "Invalid option: $1 use -h for help"; exit 1;; *) #notes (stick everything else in notes) ARS_NOTES="$ARS_NOTES $1"; shift;; esac done Any ideas? |
Difficult to tell from that; try putting
Code:
set -xv This shows what the parser is doing ie the 'before' & 'after' parsing of each line; very good for debugging. Also, next time, please use code tags when posting https://www.linuxquestions.org/quest...do=bbcode#code to preserve formatting & makes it easier to read. |
usually you have something mistyped before line 87....
|
Thanks for your help! I did a od on the file. It contained \r\n...Removed the \r...Works now..
|
If you did that manually, you may like to know about this http://linux.die.net/man/1/dos2unix; very handy when there's a lot to fix and/or you want to automate it.
|
All times are GMT -5. The time now is 12:04 PM. |