Update sh snippets to use single-line "if; then" and "while; do".