Valued Contributor
convert script to ksh93 (version 93 )

hello,

 

i want to convert a script to ksh93 ( korn shell version 93 ) .

 

Ksh93: https://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=Ksh93

 

i want to replace following warning(s) like :

 

warning: line 1: `...` obsolete, use $(...)


following options i find in scripts, but some option's aren't possible to handle (for me)
like "var6" variante 6  in attachment. also "var4" is not ok. 

 

has anybody an idea ?

here are some options, what can be listed in a script KSH88

1. replace :  =`
    by          :  =$(

2. replace :  `$
    by          :  )

3. replace :  `character
    by           :  $(

4. replace :   character`
   by             : character )

5. replace :  ?`
    by          :  ? )

6. replace :  "`
     by         :  " )

7. replace :  }`
     by        :  } )

 

here is my "sed" converter :

file="demo.sh"

sed -e "s|=\`|=$\(|g" \
    -e "s|\`$|\)|g" \
    -e "s|\`\([a-z]\)|\$( \1|g" \
    -e "s|\([a-z\?\"\?]\)\`|\1 \)|g" ${file}  > ${file}.ksh93



ksh -n ${file}.ksh93

 

testing : sed of attachment and test syntax of new file with version 93 : ksh -n

 

kind regards