| ||||||||
| ||||||||
Synopsis | ||||||||
| ||||||||
Documentation | ||||||||
shell_command | ||||||||
| ||||||||
shell_quote :: String -> String | ||||||||
Quote shell metacharacters. This function quotes strings, such that they are not misinterpreted by the shell. It tries to be friendly to a human reader - when special characters are present, then the string is quoted with double quotes. If not, it is left unchanged. The list of exacly which characters need to be quoted has been taken from the bash source code. Bash in turn, implements POSIX 1003.2. So the result produced should be correct. From the bash info pages: "... the rules for evaluation and quoting are taken from the POSIX 1003.2 specification for the standard Unix shell." Note: The quoted strings are correctly recognized in shell scripts. But the shell bash has an annoying history expansion "feature", which causes it to choke on exclamation marks, when in interactive mode, even when quoted with double quotes. You can turn it off with set +o histexpand. See quote. | ||||||||
quote0 :: String -> String | ||||||||
Quote special characters inside a string for the shell This quotes special characters inside a string, such that it is recognized as one string by the shell when enclosed in double quotes. Doesn't add the double quotes. Note: The quoted strings are correctly recognized in shell scripts. But the shell bash has an annoying history expansion "feature", which causes it to choke on exclamation marks, when in interactive mode, even when quoted with double quotes. You can turn it off with set +o histexpand. See quote, shell_quote. | ||||||||
quote :: String -> String | ||||||||
Quote a string for the shell This encloses a string in double quotes and quotes any special characters inside, such that it will be recognized as one string by a shell. The double quotes are added even when they aren't needed for this purpose. Note: The quoted strings are correctly recognized in shell scripts. But the shell bash has an annoying history expansion "feature", which causes it to choke on exclamation marks, when in interactive mode, even when quoted with double quotes. You can turn it off with set +o histexpand. See quote0, shell_quote. | ||||||||
Produced by Haddock version 2.4.2 |