quote_shell_arg Function

public function quote_shell_arg(raw_path) result(quoted_path)

Wrap a filesystem path for the shell used by execute_command_line.

Wraps the path in double quotes, blocking word-splitting on whitespace. Paths containing " are rejected because the double-quote cannot be escaped inside double-quoted shell arguments on all POSIX shells. Paths containing $ or a backtick (`) are also rejected because both characters expand inside double quotes (covering ${, $(, and command-substitution forms), making the path unsafe to quote-and-invoke.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: raw_path

Return Value character(len=len_trim)