Hamilton LaboratoriesHamilton C shell 2012User guideSamplessh2csh.csh

if.sed

Oregon Coast

if.sed
Previous | Next

#  Fixup if statements.
#  Copyright (c) 1992-2012 by Hamilton Laboratories.  All rights reserved.

#     if [ expr ]             if ( expr ) then
#     then              -->
#        :                       :
#     fi                      end

/^[   ]*then[  ]*$/d
/^[   ]*if[[(  ].*;[    ]*"\{,1\}then"\{,1\}/s/[   ]*;[  ]*"\{,1\}then"\{,1\}//
/^[   ]*if/s/[[(]\(.*\)[])]$/(\1) then/
/^[   ]*fi[    ]*$/s/fi/end/}

Previous | Next