simple-cmd-0.1.0.0: Simple String-based process commands

Safe HaskellSafe
LanguageHaskell2010

SimpleCmd

Synopsis

Documentation

cmd :: String -> [String] -> IO String Source #

Run a command in a process and return stdout

cmd_ :: String -> [String] -> IO () Source #

Run command in process, output goes to stdout and stderr

cmdBool :: String -> [String] -> IO Bool Source #

Run a command, and return Boolean status

cmdIgnoreErr :: String -> [String] -> String -> IO String Source #

Run a command, drop stderr, and return stdout

cmdlog :: String -> [String] -> IO () Source #

Log a command with a datestamp

cmdMaybe :: String -> [String] -> IO (Maybe String) Source #

Run a command in a process, maybe returning output if it succeeds

cmdN :: String -> [String] -> IO () Source #

Dry-run a command: print it to stdout - more used for debugging

cmdQuiet :: String -> [String] -> IO String Source #

Run a command hiding stderr, if it succeeds return stdout

cmdSilent :: String -> [String] -> IO () Source #

Run a command hiding stdout: stderr is only output if it fails.

cmdStdIn :: String -> [String] -> String -> IO String Source #

Run a command, passing input string as stdin, and return stdout

cmdStdErr :: String -> [String] -> IO (String, String) Source #

Run command in a process, returning stdout and stderr

egrep_ :: String -> FilePath -> IO Bool Source #

grep for extended regexp in file, and return Boolean status

grep_ :: String -> FilePath -> IO Bool Source #

grep a pattern in file and return Boolean status

removePrefix :: String -> String -> String Source #

Remove a prefix from a string if there

removeStrictPrefix :: String -> String -> String Source #

Remove prefix, or fail with error

removeSuffix :: String -> String -> String Source #

Remove a suffix from a string if there

shell :: String -> IO String Source #

Run a command string in a shell, and return stdout

shell_ :: String -> IO () Source #

Run a command string in a shell, output goes to stdout

sudo :: String -> [String] -> IO () Source #

sudo a command

(+-+) :: String -> String -> String infixr 4 Source #

Combine strings with a single space