6

Eliminating newlines in ksh

view full story
linux-howto

http://www.linuxforums.org – Hi All, I am working with CentOS 4.8 and starting ksh scripting. current version is "pdksh-5.2.14-30.6". i have written a case statement, syntax and code is fine but still i am having " syntax error at line 4: `newline' unexpected" whereas there is no newline in there. Code: CASE() { case ${?} in 0 ) echo "SUCCESS" ;; * ) echo "FAIL" exit 1 ;; esac} Please let me know how can i check or what is the tool i can use to check these "^J^M" newlines and eliminate these. Secondly should i switch to use ksh instead pdksh ? and how to obtain ksh, if needed? Thanks (HowTos)