# Fixup for, while and until statements.
# for i in wordlist foreach i ( wordlist )
# do -->
# : :
# done end
# while list while ({ list })
# do -->
# : :
# done end
# until list while (! { list })
# do -->
# : :
# done end
/^[ ]*for.*;[ ]*"\{,1\}do"\{,1\}$/s/[ ]*;[ ]*"\{,1\}do"\{,1\}$//
/^[ ]*while.*;[ ]*"\{,1\}do"\{,1\}$/s/[ ]*;[ ]*"\{,1\}do"\{,1\}$//
/^[ ]*until.*;[ ]*"\{,1\}do"\{,1\}$/s/[ ]*;[ ]*"\{,1\}do"\{,1\}$//
/^[ ]*for/s/for[ ]*\([^ ][^ ]*\)[ ]*in[ ]*\([^ ].*\)$/foreach \1 (\2)/
/^[ ]*while/s/while[ ]*\([^( ].*\)$/while ({ \1 })/
/^[ ]*until/s/until[ ]*\([^( ].*\)$/while (! { \1 })/
/^[ ]*do$/d
/^[ ]*done/s/done/end/
Previous | Sh_2_csh.csh | Next
Copyright © 1988-2003 by
Hamilton Laboratories.
All rights reserved.