Use cross-compatible local variable definition.

Declare local variables using syntax recognized by ksh and bash.