| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Text.ShellEscape
Description
Typed shell escaping for Bourne Shell and Bash.
Synopsis
- class Escape t where
- data Sh
- sh :: ByteString -> Sh
- data Bash
- bash :: ByteString -> Bash
Documentation
A type class for objects that represent an intermediate state of escaping.
Methods
escape :: ByteString -> t #
Transform a ByteString into the escaped intermediate form.
unescape :: t -> ByteString #
Recover the original ByteString.
bytes :: t -> ByteString #
Yield the escaped ByteString.
Instances
| Escape ByteString # | |
Defined in Data.ByteString.ShellEscape.Escape Methods escape :: ByteString -> ByteString # unescape :: ByteString -> ByteString # bytes :: ByteString -> ByteString # | |
| Escape Bash # | |
Defined in Data.ByteString.ShellEscape.Bash | |
| Escape Sh # | |
Defined in Data.ByteString.ShellEscape.Sh | |
A Bourne Shell escaped ByteString. An oddity of Bourne shell escaping is
the absence of escape codes for newline and other ASCII control
characters. These bytes are simply placed literally in single quotes; the
effect is that a Bourne Shell escaped string may cover several lines and
contain non-ASCII bytes. Runs of bytes that must be escaped are wrapped in
'...'; bytes that are acceptable as literals in Bourne Shell are left
as is.
sh :: ByteString -> Sh #
Construct a Bourne Shell escaped intermediate form.
A Bash escaped ByteString. The strings are wrapped in $'...' if any
bytes within them must be escaped; otherwise, they are left as is.
Newlines and other control characters are represented as ANSI escape
sequences. High bytes are represented as hex codes. Thus Bash escaped
strings will always fit on one line and never contain non-ASCII bytes.
bash :: ByteString -> Bash #
Construct a Bash escaped intermediate form.