Determine whether an argument requires quoting for safe shell parsing.
A conservative check: any whitespace or quotes trigger quoting.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | a |
pure logical function needs_quotes(a) result(q) character(len=*), intent(in) :: a q = (index(a, ' ') /= 0) .or. (index(a, char(9)) /= 0) .or. (index(a, '"') /= 0) .or. (index(a, "'") /= 0) end function needs_quotes