/* Determine if a valid string is a valid number for the 'for' command. */
BOOLEAN ShellIsValidForNumber(IN CONST CHAR16 *Number)
/* Determine if a valid string is a valid number for the 'for' command. */
BOOLEAN ShellIsValidForNumber(IN CONST CHAR16 *Number)
{
  if ((Number == NULL) || (*Number == CHAR_NULL)) {
    return (FALSE);
  }
  if (*Number == L'-') {
    Number++;
  }
  if (StrLen (Number) == 0) {
    return (FALSE);
  }
  if (StrLen (Number) >= 7) {
    if ((StrStr (Number, L" ") == NULL) || (((StrStr (Number, L" ") != NULL) && ((StrStr (Number, L" ") - Number) >= 7)))) {
      return (FALSE);
    }
  }
  if (!ShellIsDecimalDigitCharacter (*Number)) {
    return (FALSE);
  }
  return (TRUE);
}