h)8}1      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~3.6.4 Safe-Inferred%&'56  hsshellscriptDescribes whether an option takes an argument or not, and if so how the argument is injected into a value of type a. hsshellscriptno argument expected hsshellscriptoption requires argument hsshellscriptoptional argument hsshellscriptEach  describes a single option.The arguments to  are:list of short option characters*list of long option strings (without "--")argument descriptorexplanation of option for user hsshellscript-What to do with options following non-options hsshellscript+no option processing after first non-option hsshellscript*freely intersperse options and non-options hsshellscriptwrap non-options into options hsshellscriptReturn a string describing the usage of a command, derived from the header (first argument) and the options described by the second argument. hsshellscriptProcess the command-line, and return the list of values that matched (and those that didn't). The arguments are:The order requirements (see )The option descriptions (see ):The actual command line arguments (presumably got from ). returns a triple, consisting of the argument values, a list of options that didn't match, and a list of error messages.  Safe-Inferred%&'56The normalised path with the file prefix, and the file suffix.  hsshellscriptFilename to be split hsshellscriptBase name and the last suffix  hsshellscriptFile name prefix and suffix hsshellscriptPath hsshellscript Path to split hsshellscript3Directory part, base file name part and suffix part hsshellscript3Directory part, base file name part and suffix part hsshellscript'Path consisting of dir, base and suffix hsshellscriptSuffix to split off hsshellscript Path to test hsshellscriptPrefix without the suffix or Nothing hsshellscriptThe path to be made absolute hsshellscript Absulte path hsshellscriptIn case the path is relative, the directory relative to which it is hsshellscript/The path to be made absolute (must be absolute) hsshellscript Absolute path hsshellscriptThe path to be made absolute hsshellscript9The directory relative to which the path is made absolute hsshellscript Absolute path hsshellscriptList of path components hsshellscript+In case the path could be transformed, the ".."+-component free list of path components. hsshellscriptPath to be normalised hsshellscript7In case the path could be transformed, the normalised, ".."!-component free form of the path.   Safe-Inferred%&'56H/ hsshellscriptGenerate command (for a shell) which corresponds to the specified program name and argument list. The program name and arguments are the usual parameters for calling an external program, like when using  runProcess or run. The generated shell command would achieve the same effect. The name and the arguments are properly quoted, using .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. hsshellscriptQuote 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 . hsshellscript6Quote special characters inside a string for the shellThis 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 , . hsshellscriptQuote a string for the shellThis 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 , . hsshellscriptname or path of the executable hsshellscriptcommand line arguments hsshellscript shell command Safe-Inferred%&'56 hsshellscriptError thrown when there is an error in the command line arguments.The usage information is generated by the deprecated function usage_info. Better ignore this, and use the newer make_usage_info or print_usage_info.See a, b, ^. hsshellscript Error message  hsshellscriptDeprecated. Usage information, as generated by the now deprecated function ^.! hsshellscriptThis represents the parsed contents of the command line. It is returned by the getargs... functions, and passed on to the value extraction functions by the user.See K, L!, 'getargs'', 'getargs_ordered''." hsshellscriptA property of a command line argument. These are generated by the desc_?... functions, and condensed to argument descriptions of type ArgumentDescription by argdesc. This type is abstract.% hsshellscriptDescription of one command line argument. These are generated by argdesc from a list of argument properties, and subsequently used by one of the getargs... functions.' hsshellscriptShort option names( hsshellscriptLong option names) hsshellscript,What about a possible value of the argument?* hsshellscript3Minimum and maximum of number of occurences allowed+ hsshellscript1Name for argument's value, for message generation, hsshellscript2Descrition of the argument, for message generation- hsshellscriptArgument value tester. hsshellscriptArgument value tester function. This tests the format of an argument's value for errors. The tester function is specified by B. or such, as part of the argument description.The tester is passed the argument value. If the format is correct, then it returns Nothing). If there is an error, then it returns  Just msgf, with msgf being an error message generation function. This function gets passed the argument description, and produces the error message. The argument description typically is used to extract a descriptive name of the argument (using F or G&) to be included in the error message./ hsshellscript-Does the command line argument take an value?0 hsshellscriptNo value1 hsshellscriptValue required2 hsshellscriptValue optional3 hsshellscriptWhether the specified argument is the direct argument. Direct arguments are the ones which are specified without introducing "-" or "--", in the command line, or which occur after the special argument "--".See J, 6.4 hsshellscriptShort name of the argument. This specifies a character for a one letter style argument, like -x. There can be specified several for the same argument. Each argument needs at least either a short or a long name.5 hsshellscriptLong name of the argument. This specifies a GNU style long name for the argument, which is introduced by two dashes, like --arg or  --arg=.... There can be specified several names for the same argument. Each argument needs at least either a short or a long name. Except for direct arguments, which don't have a name.See 66 hsshellscriptSignal that this is the description of direct arguments. Direct arguments are the ones not introduced by any short or long argument names (like -x or --arg). After the special argument --, also everything is a direct argument, even when starting with - or --. The presence of  desc_direct) in the argument properties list signals argdesc that this is the description of the direct arguments. There may be at most one such description.The  is_direct function can be used in order to determine if a specific argument is the direct argument.See 3.7 hsshellscript*Signal that the argument requires a value.8 hsshellscriptSignal that the argument optionally has a value. The user may or may not specify a value to this argument.9 hsshellscriptSpecify lower and upper bound on the number of times an argument may occur.: hsshellscriptSignal that the argument must be present exactly once. This is meaningful only for arguments which can take a value.; hsshellscript6Signal that the argument must occur at least one time.< hsshellscript5Signal that the argument must occur at most one time.= hsshellscriptSignal that the argument must have at least the specified number of occurences, and has no upper limit of occurences.> hsshellscript7Signal that the argument may occur any number of times.? hsshellscriptSignal that the argument does not need to be present, and may occur at most the specified number of times.@ hsshellscriptSpecify the descriptive name for command line argument's value. Used for the generation of the usage message. The name should be very short.A hsshellscriptSpecify a description of what the argument does. Used for usage message generation. This can be arbitratily long, long lines are wrapped.B hsshellscriptSpecify a tester for this argument. The tester is a function which tests the argument value for format errors. Typically, it tests whether the value can be parsed to some target type. If the test fails, the tester produces an error message. When parsing the command line arguments (which getargs or related), all the testers are applied to the respective argument values, and an  is thrown in case of failure. By using a tester, it can be ensured that the argument values abide a specific format when extracting them, such that they can be parsed without errors, e.g. &myarg = read (reqarg_req args d_myarg).)An argument tester is a function of type ..See C, D, E, ..C hsshellscript Build an argument tester from a reads like function. Typically, a specialisation of the standard prelude function read is used. Example: 3readtester "Integer expected." (reads :: ReadS Int)D hsshellscriptSpecify that the value of this argument, if present, is a positive integer. This will cause an error when the command line is parsed, and the argument's value doesn't specify an integer. desc_integer = desc_tester (readtester (reads :: ReadS Int) "Integer expected.")See B.E hsshellscriptSpecify that the value of this argument, if present, is a non-negative integer. This will cause an error when the command line is parsed, and the value doesn't specify a non-negative integer. desc_nonneg_integer = desc_tester (readtester ((filter (\(a,_) -> a >= 0) . reads) :: ReadS Int) \ "Non-negative integer expected." )See B.F hsshellscriptGenerate a descriptive argument name from an argument description, suitable for use in error messages and usage information. This uses the long and short argument names (as specified by 4 and 5) and generates descriptive names of the argument like "-f", "--myflag", "-f/--myflag", etc. All the argument names are included. In case of direct arguments (see 6), the descriptive name is "(direct argument)".See J.G hsshellscriptGenerate a descriptive argument name from an argument description, beginning with "argument". This uses the long and short argument names (as specified by 4 and 5) and generates descriptive names of the argument like "argument -f", "argument --myflag", "argument -f/--myflag", etc. All the argument names are included. In case of direct arguments (see 6-), the descriptive name is "direct argument".See J.H hsshellscriptCreate a string, which lists the short forms of one command line argument. If it has an subargument, it's name is listed as well. For arguments without short form, the result is the empty string.For the illegal command line argument, with neither short nor long forms, and not being the direct argument either, the result is "yet unnamed argument". Such argument descriptions are incomplete, and will be rejected by getargs and unsafe_getargs.This is meant for refering to an argument, such as in error messages or usage information. Examples: argname_short (argdesc [ desc_short 'a' , desc_short 'b' , desc_value_required , desc_argname "Name" ]) == "-a/-b Name"See J, 6. I.I hsshellscriptCreate a string, which lists the long forms of one command line argument. If it has an subargument, it's name is listed as well. For arguments without long form, the result is the empty string.For the illegal command line argument, with neither short nor long forms, and not being the direct argument either, the result is "yet unnamed argument". Such argument descriptions are incomplete, and will be rejected by getargs and unsafe_getargs.This is meant for refering to an argument, such as in error messages or usage information. Examples: argname_long (argdesc [ desc_long "foo" , desc_long "bar" , desc_value_required , desc_argname "Name" ]) == "--foo/--bar Name"See J, 6. I.J hsshellscriptMake an argument description from a list of argument properties. This condenses the list to an argument description, which can be used by the getargs;... functions and the argument value extraction functions.K hsshellscriptParse command line arguments. The arguments are taken from a call to getArgs' and parsed. Any error is thrown as a ArgError exception. The result is a value from which the information in the command line can be extracted by the arg..., reqarg... and optarg... functions.*The header is used only by the deprecated  usage_info function. If you don't use it, you don't need to specify a header. Just pass an empty string.Named arguments (like -x or --arg/) and direct arguments may occur in any order.See ^, a, b.L hsshellscriptParse command line arguments. The arguments are taken from a call to getArgs' and parsed. Any error is thrown as a ArgError exception. The result is a value from which the information in the command line can be extracted by the arg..., reqarg... and optarg... functions.*The header is used only by the deprecated  usage_info function. If you don't use it, you don't need to specify a header. Just pass an empty string.All arguments after the first direct argument are regarded as direct arguments. This means that argument names introduced by - or -- no longer take effect.See ^, a, b.M hsshellscript;Parse the specified command line. Any error is returned as Left argerror1. In case of success, the result is returned as  Right res. From the result, the information in the command line can be extracted by the arg..., reqarg ... and optarg... functions.*The header is used only by the deprecated  usage_info function. If you don't use it, you don't need to specify a header. Just pass an empty string.Named arguments (like -x or --arg/) and direct arguments may occur in any order.See ^, a, b.N hsshellscript;Parse the specified command line. Any error is returned as Left argerror1. In case of success, the result is returned as  Right res. From the result, the information in the command line can be extracted by the arg..., reqarg ... and optarg... functions.*The header is used only by the deprecated  usage_info function. If you don't use it, you don't need to specify a header. Just pass an empty string.All arguments after the first direct argument are regarded as direct arguments. This means that argument names introduced by - or -- no longer take effect.See ^, a, b.O hsshellscriptQuery whether a certain switch is specified on the command line. A switch is an argument which is allowed zero or one time, and has no value.P hsshellscript.Query the number of occurences of an argument.Q hsshellscriptQuery the values of an argument with optional value. This is for arguments which take an optional value, and may occur several times. The occurences with value are represented as  Just value-, the occurences without are represented as Nothing.R hsshellscriptQuery the values of an argument with required value. This is for arguments which require a value, and may occur several times.S hsshellscriptQuery the optional value of a required argument. This is for arguments which must occur once, and may have a value. If the argument is specified, its value is returned as  Just value. If it isn't, the result is Nothing.T hsshellscriptQuery the value of a required argument. This is for arguments which must occur exactly once, and require a value.U hsshellscriptQuery the optional value of an optional argument. This is for arguments which may occur zero or one time, and which may or may not have a value. If the argument doesn't occur, the result is Nothing:. If it does occur, but has no value, then the result is  Just Nothing.. If it does occur with value, the result is Just (Just value).V hsshellscriptQuery the value of an optional argument. This is for optional arguments which require a value, and may occur at most once. The result is  Just value if the argument occurs, and Nothing if it doesn't occur.W hsshellscript.None of the specifed arguments may be present.7Throws an ArgError if any of the arguments are present.X hsshellscript/All of the specified arguments must be present.%Throws an ArgError if any is missing.Y hsshellscript7Exactly one of the specified arguments must be present.Otherwise throw an ArgError.Z hsshellscript6At most one of the specified arguments may be present.Otherwise throw an ArgError.[ hsshellscript8At least one of the specified arguments must be present.Otherwise throw an ArgError.\ hsshellscriptWhen the specified argument is present, then none of the other arguments may be present.Otherwise throw an ArgError.] hsshellscript:Whether the specified argument occurs in the command line.^ hsshellscript Deprecated. This is left here for backwards compatibility. New programs should use make_usage_info and/or print_usage_info.Get the usage information from the parsed arguments. The usage info contains the header specified to the corresponding  getargs...; function, and descriptions of the command line arguments.Descriptions can be several lines long. Lines get wrapped at column 80.See a, b, c._ hsshellscriptgetargs as a pure function, instead of an IO action. This allows to make evaluated command line arguments global values. This calls getargs& to parse the command line arguments. GHC.IO.unsafePerformIO0 is used to take the result out of the IO monad. unsafe_getargs header descs = GHC.IO.unsafePerformIO $ getargs "" descsThe getargs action is performed on demand, when the parse result is evaluated. It may result in an  being thrown. In order to avoid this happening at unexpected times, the main) function should, start with the line seq args (return ()), where args is the result of unsafe_getargs,. This will trigger any command line argument errors at the beginning of the program. (See section 6.2 of the Hakell Report for the definition of seq).*The header is used only by the deprecated  usage_info function. If you don't use it, you don't need to specify a header. Just pass an empty string.A typical use of unsafe_getargs looks like this: descs = [ d_myflag, ... ] d_myflag = argdesc [ ... ] args = unsafe_getargs "" descs myflag = arg_switch args d_myflag main = mainwrapper $ do seq args (return ()) ...See K, `.` hsshellscriptgetargs_ordered as a pure function, instead of an IO action. This is exactly like unsafe_getargs, but using getargs_ordered instead of getargs.*The header is used only by the deprecated  usage_info function. If you don't use it, you don't need to specify a header. Just pass an empty string.The definition is: unsafe_getargs_ordered = GHC.IO.unsafePerformIO $ getargs_ordered "" descsSee _, ^, a, b.a hsshellscriptGenerate pretty-printed information about the command line arguments. This function gives you much control on how the usage information is generated. print_usage_info" might be more like what you need.5The specified argument descriptions (as taken by the getargs... functions) are processed in the given order. Each one is formatted as a paragraph, detailing the argument. This is done according to the specified geometry.The direct argument, in case there is one, is omitted. You should detail the direct command line arguments separatly, such as in some header.The specified maximum breadths must fit in the specified width, or an error is raised. This happens, when 4colsleft + colsshort + 2 + colslong + 2 + 2 > width.See b, K, ^, %, A, J, , .b hsshellscriptPrint the usage information (about the command line arguments), for the specified header and arguments to the specified handle. When the handle is connected to a terminal, the terminal's width (in columns) is used to format the output, such that it fits the terminal. Both the header and the argument descriptions are adapted to the width of the terminal (by using wrap).When the handle does not connected to a terminal, 80 columns are used. This may happen to stdout or stderr, for instance, when the program is in a pipe, or the output has been redirected to a file.When the terminal is too narrow for useful output, then instead of the usage information, a short message ("Terminal too narrow") is printed. This applies to terminals with a width of less than 12.You should specify one long line for each paragraph in the header and the argument descriptions, and let print_usage_info do the wrapping. When you have several paragraphs, separate them by a double \n\n. This also applies for an empty line, which should be printed after the actual header.The arguments are printed in the order, in which they occur in the argument description list. This function is a front end to terminal_width and make_usage_info.See J, A, , a, ^, c.c hsshellscriptBreak down a text to lines, such that each one has the specified maximum width.Newline characters in the input text are respected. They terminate the line, without it being filled up to the width.The text is wrapped at space characters. Words remain intact, except when they are too long for one line.g hsshellscriptMake ArgError an instance of  Exception, so we can throw and catch it, using GHC-6.10's new exception library.*3 hsshellscript%Argument description, as returned by argdesc.4 hsshellscript#The character to name the argument. hsshellscript$The corresponding argument property.5 hsshellscriptThe long name of the argument. hsshellscript$The corresponding argument property.9 hsshellscript3Lower bound of the allowed number of argdesc_times. hsshellscript3Upper bound of the allowed number of argdesc_times. hsshellscript$The corresponding argument property.: hsshellscript$The corresponding argument property.; hsshellscript$The corresponding argument property.< hsshellscript$The corresponding argument property.= hsshellscriptNumber of times. hsshellscript$The corresponding argument property.> hsshellscript$The corresponding argument property.? hsshellscriptNumber of times. hsshellscript$The corresponding argument property.@ hsshellscriptName of the argument's value. hsshellscript$The corresponding argument property.A hsshellscript"Short description of the argument. hsshellscript$The corresponding argument property.B hsshellscript)Argument tester to apply to this argument hsshellscript$The corresponding argument property.F hsshellscript%Argument description, as returned by argdesc hsshellscriptPrintable name for the argumentG hsshellscript%Argument description, as returned by argdesc hsshellscriptPrintable name for the argumentH hsshellscript%Argument description, as returned by argdesc hsshellscriptPrintable name for the argumentI hsshellscript%Argument description, as returned by argdesc hsshellscriptPrintable name for the argumentJ hsshellscript=List of properties, which describe the command line argument. hsshellscript'The corresponding argument description.K hsshellscript$Header to be used by the deprecated  usage_info function. hsshellscriptThe argument descriptions. hsshellscript!The contents of the command line.L hsshellscript$Header to be used by the deprecated  usage_info function. hsshellscriptDescriptions of the arguments. hsshellscript!The contents of the command line.M hsshellscript$Header to be used by the deprecated  usage_info function. hsshellscriptCommand line to be parsed. hsshellscriptThe argument descriptions. hsshellscript!The contents of the command line.N hsshellscript$Header to be used by the deprecated  usage_info function. hsshellscriptCommand line to be parsed. hsshellscriptThe argument descriptions. hsshellscript!The contents of the command line.O hsshellscriptCommand line parse result. hsshellscript#Argument description of the switch. hsshellscript2Whether the switch is present in the command line.P hsshellscriptCommand line parse result. hsshellscriptDescription of the argument. hsshellscript$Number of times the argument occurs.Q hsshellscriptCommand line parse result. hsshellscriptDescription of the argument. hsshellscriptThe occurences of the argument.R hsshellscriptCommand line parse result. hsshellscriptDescription of the argument. hsshellscriptThe values of the argument.S hsshellscriptCommand line parse result. hsshellscriptDescription of the argument. hsshellscript(The value of the argument, if it occurs.T hsshellscriptCommand line parse result. hsshellscriptDescription of the argument. hsshellscriptThe value of the argument.U hsshellscriptCommand line parse result. hsshellscriptDescription of the argument. hsshellscript8The occurence of the argument and its value (see above).V hsshellscriptCommand line parse result. hsshellscriptDescription of the argument. hsshellscript(The value of the argument, if it occurs.W hsshellscript0List of the arguments which must not be present. hsshellscriptCommand line parse result.X hsshellscript,List of the arguments which must be present. hsshellscriptCommand line parse result.Y hsshellscript=?@ABDEC3!KLMN_`OPQRSTUV]WXYZ[\ ^abFGHIc"#$%&'()*+,-/012.J456789:;<>=?@ABDEC3!KLMN_`OPQRSTUV]WXYZ[\ ^abFGHIc Safe-Inferred%&'56 hsshellscript)Determine the terminal width in columns. If you want to run an external program, by calling one of the exec7 variants in the child action, you might want to call runprog instead of subproc. Examples:,Run a program with the environment replaced: /subproc (execpe "foobar" ["1","2","3"] new_env)This results in a  ProcessStatus exception: subproc (exec "/bin/false" [])This results in an IOError (unless you actually have /frooble): subproc (exec "/frooble" [])See |, v, ~, , , .u hsshellscriptExecute an IO action as a separate process, and wait for it to finish. Report errors as exceptions.This function is included only for backwards compatibility. New code should use t instead", which has better error handling.The program forks a child process and performs the specified action. Then it waits for the child process to finish. If it exits in any way which indicates an error, the  ProcessStatus is thrown.The parent process waits for the child processes, which have been stopped by a signal.See HsShellScript#subr for further details.See t, v.v hsshellscriptExecute an IO action as a separate process, and continue without waiting for it to finish.The program forks a child process, which performs the specified action and terminates. The child's process ID is returned.See HsShellScript#subr for further details.See t.w hsshellscriptRun an external program. This starts a program as a child process, and waits for it to finish. The executable is searched via the PATH.This function is included for backwards compatibility only. New code should use |', which has much better error handling.When the specified program can't be executed, an error message is printed, and the main process gets a  ProcessStatus thrown, with the value Exited (ExitFailure 1). This means that the main program can't distinguish between failure of calling the program and the program exiting with an exit code of 1. However, an error message "Error calling ...", including the description in the IOError produced by the failed execp call, is printed on stderr. run prog par is essentially call (execp prog par).Example: run "/usr/bin/foobar" ["some", "args"] `catch` (\ps -> do -- oops... )See |, t, v.x hsshellscriptMake a readable error message. This includes all the fields of RunError except for the environment.See k.y hsshellscript+Generate a human-readable description of a  ProcessStatus.See ~, | and System.Posix.ProcessStatus0 in the GHC hierarchical library documentation.z hsshellscript Convert a RunError to an IOError.The IOError type isn't capable of holding all the information which is contained in a RunError. The environment is left out, and most of the other fields are included only informally, in the description.The fields of the generated IOError are: The handle ( ioeGetHandle): NothingThe error type (ioeGetErrorType): GHC.IO.Exception.SystemError ioe_location:  "runprog"ioe_description$: The error message, as procuded by  show_runerror. ioe_filename : This is Just (shell_command prog pars), with prog and pars% being the program and its arguments.See {, |, x.{ hsshellscriptCall the specified IO action (which is expected to contain calls of runprog) and convert any RunError exceptions to IOErrors.The conversion is done by to_ioe.See z, |.| hsshellscriptRun an external program, and report errors as exceptions. The executable is searched via the PATH. In case the child process has been stopped by a signal, the parent blocks.In case the program exits in an way which indicates an error, or is terminated by a signal, a RunError6 is thrown. It contains the details of the call. The runprog( action can also be converted to throw IOErrors instaed, by applying as_ioe to it. Either can be used to generate an informative error message.2In case of starting the program itself failed, an IOError is thrown.runprog prog par is a simple front end to subproc. It is essentially subproc (execp prog par), apart from building a RunError from a  ProcessStatus. Example 1: do runprog "foo" ["some", "args"] ... `catch` (\re -> do errm (show_runerror re) ... ) Example 2: do as_ioe $ runprog "foo" ["some", "args"] ... `catch` (\ioe -> do errm (show_ioerror ioe) ... )See t, v, k, x, z, {.} hsshellscript4Print an action as a shell command, then perform it."This is used with actions such as |, ~ or t. For instance, echo runprog prog args is a variant of runprog prog args3, which prints what is being done before doing it.See |, t, ~.~ hsshellscriptExecute an external program. This replaces the running process. The path isn't searched, the environment isn't changed. In case of failure, an IOError is thrown. 8exec path args = execute_file path False args NothingSee , HsShellScript#exec. hsshellscriptExecute an external program. This replaces the running process. The path is searched, the environment isn't changed. In case of failure, an IOError is thrown. 8execp prog args = execute_file prog True args NothingSee , HsShellScript#exec. hsshellscriptExecute an external program. This replaces the running process. The path isn't searched, the environment of the program is set as specified. In case of failure, an IOError is thrown. exece path args env = execute_file path False args (Just env)See , HsShellScript#exec. hsshellscriptExecute an external program. This replaces the running process. The path is searched, the environment of the program is set as specified. In case of failure, an IOError is thrown. execpe prog args env = execute_file prog True args (Just env)See , HsShellScript#exec. hsshellscript!Build left handed pipe of stdout."p -|- q." builds an IO action from the two IO actions p and q. q< is executed in an external process. The standard output of p% is sent to the standard input of q> through a pipe. The result action consists of forking off q (connected with a pipe), and p.The result action does not run p in a separate process. So, the pipe itself can be seen as a modified action p, forking a connected q/. The pipe is called "left handed", because p remains unforked, and not q.'The exit code of q is silently ignored.) The process ID of the forked copy of q, isn't returned to the caller, so it's lost.The pipe, which connects p and q, is in  text mode$. This means that the output of p is converted from Unicode to the system character set, which is determined by the environment variable LANG.See HsShellScript#subr and HsShellScript#exec for further details. Examples: ;subproc (exec "/usr/bin/foo" [] -|- exec "/usr/bin/bar" []) sunproc ( execp "foo" ["..."] -|= ( -- Do something with foo's output do cnt <- lazy_contents "-" ... ) ) sunproc ( err_to_out foo -|- exec "/usr/bin/tee" ["-a", "/tmp/foo.log"] )See t, , ,  hsshellscript!Build left handed pipe of stderr."p =|- q." builds an IO action from the two IO actions p and q. q is executed in an external process. The standard error output of p% is sent to the standard input of q> through a pipe. The result action consists of forking off q (connected with a pipe), and p.The result action does not run p in a separate process. So, the pipe itself can be seen as a modified action p, forking a connected q/. The pipe is called "left handed", because p has this property, and not q.'The exit code of q is silently ignored.) The process ID of the forked copy of q, isn't returned to the caller, so it's lost.The pipe, which connects p and q, is in  text mode$. This means that the output of p is converted from Unicode to the system character set, which is determined by the environment variable LANG.See HsShellScript#subr and HsShellScript#exec for further details.Example: ;subproc (exec "/usr/bin/foo" [] =|- exec "/usr/bin/bar" [])See t, , . hsshellscript"Build right handed pipe of stdout."p -|= q." builds an IO action from the two IO actions p and q. p< is executed in an external process. The standard output of p% is sent to the standard input of q> through a pipe. The result action consists of forking off p (connected with a pipe), and q.The result action does not run q in a separate process. So, the pipe itself can be seen as a modified action q, forking a connected p3. The pipe is called "right handed", because q has this property, and not p.'The exit code of p is silently ignored.) The process ID of the forked copy of q, isn't returned to the caller, so it's lost.The pipe, which connects p and q, is in  text mode$. This means that the output of p is converted from Unicode to the system character set, which is determined by the environment variable LANG.See HsShellScript#subr and HsShellScript#exec for further details.Example: subproc (exec \"\/usr\/bin\/foo\" [] -|= exec \"\/usr\/bin\/bar\" [])See t, , . hsshellscript"Build right handed pipe of stderr."p =|= q." builds an IO action from the two IO actions p and q. p is executed in an external process. The standard error output of p% is sent to the standard input of q> through a pipe. The result action consists of forking off p (connected with a pipe), and q.The result action does not run q in a separate process. So, the pipe itself can be seen as a modified action q, forking a connected p3. The pipe is called "right handed", because q has this property, and not p.'The exit code of p is silently ignored.) The process ID of the forked copy of q, isn't returned to the caller, so it's lost.The pipe, which connects p and q, is in  text mode$. This means that the output of p is converted from Unicode to the system character set, which is determined by the environment variable LANG.See HsShellScript#subr and HsShellScript#exec for further details.Example: ;subproc (exec "/usr/bin/foo" [] =|= exec "/usr/bin/bar" [])See t, , . hsshellscriptTemporarily replace a handle. This makes a backup copy of the original handle (typically a standard handle), overwrites it with the specified one, runs the specified action, and restores the handle from the backup.Example:  h <- openFile "/tmp/log" WriteMode redirect stdout h io hClose hThis is the same as  io ->- "/tmp/log"See , . hsshellscriptRedirect the standard output of the specified IO action to a file. The file will be overwritten, if it already exists. What's actually modified is the stdout( handle, not the file descriptor 1. The exec functions know about this. See HsShellScript#fdpipes and HsShellScript#exec for details.The file is written in  text mode. This means that the output is converted from Unicode to the system character set, which is determined by the environment variable LANG.Example: ,runprog "/some/program" [] ->- "/tmp/output"Note: You can't redirect to  "/dev/null" this way, because GHC 6.4's openFile throws an "invalid argument" IOError. (This may be a bug in the GHC 6.4 libraries). Use ->>- instead.See t, |, , . hsshellscriptRedirect the standard output of the specified IO action to a file. If the file already exists, the output will be appended. What's actually modified is the stdout( handle, not the file descriptor 1. The exec functions know about this. See HsShellScript#fdpipes and HsShellScript#exec for details.The file is written in  text mode. This means that the output is converted from Unicode to the system character set, which is determined by the environment variable LANG.Example: -run "/some/noisy/program" [] ->>- "/dev/null"See t, |, , . hsshellscriptRedirect the standard error output of the specified IO action to a file. If the file already exists, it will be overwritten. What's actually modified is the stderr( handle, not the file descriptor 2. The exec functions know about this. See HsShellScript#fdpipes and HsShellScript#exec for details.Note: You can't redirect to  "/dev/null" this way, because GHC 6.4's openFile throws an "invalid argument" IOError. (This may be a bug in the GHC 6.4 libraries). Use =>>- instead.The file is written in  text mode. This means that the output is converted from Unicode to the system character set, which is determined by the environment variable LANG.Example: 'run "/path/to/foo" [] =>- "/tmp/errlog"See t, |, , . hsshellscriptRedirect the standard error output of the specified IO action to a file. If the file already exists, the output will be appended. What's actually modified is the stderr( handle, not the file descriptor 2. The exec functions know about this. See HsShellScript#fdpipes and HsShellScript#exec for details.The file is written in  text mode. This means that the output is converted from Unicode to the system character set, which is determined by the environment variable LANG.Example: 'run "/some/program" [] =>>- "/dev/null"See t, |, , . hsshellscriptRedirect both stdout and stderr to a file. This is equivalent to the shell's &>> operator. If the file already exists, it will be overwritten.!What's actually modified are the stdout and stderr0 handles, not the file descriptors 1 and 2. The exec functions know about this. See HsShellScript#fdpipes and HsShellScript#exec for details.Note: You can't redirect to  "/dev/null" this way, because GHC 6.4's openFile throws an "invalid argument" IOError. (This may be a bug in the GHC 6.4 libraries). Use -&>>- instead.The file is written in  text mode. This means that the output is converted from Unicode to the system character set, which is determined by the environment variable LANG. '(-&>-) io path = err_to_out io ->- pathExample: +subproc (exec "/path/to/foo" [] -&>- "log")See , . hsshellscriptRedirect both stdout and stderr to a file. If the file already exists, the output will be appended.!What's actually modified are the stdout and stderr0 handles, not the file descriptors 1 and 2. The exec functions know about this. See HsShellScript#fdpipes and HsShellScript#exec for details.The file is written in  text mode. This means that the output is converted from Unicode to the system character set, which is determined by the environment variable LANG. .(-&>>-) io path = (err_to_out >> io) ->>- pathExample: .run "/some/noisy/program" [] -&>>- "/dev/null"See , . hsshellscriptRedirect stdin from a file. This modifies the specified action, such that the standard input is read from a file. What's actually modified is the stdin+ handle, not the file descriptor 0. The exec# functions know about this. See HsShellScript#fdpipes and HsShellScript#exec for details.The file is read in  text mode. This means that the input is converted from the system character set to Unicode. The system's character set is determined by the environment variable LANG.Example: *subproc (exec "/path/to/foo" [] -<- "bar")See ~, |, , . hsshellscriptSend the error output of the specified action to its standard output. What's actually modified is the stdout( handle, not the file descriptor 1. The exec functions know about this. See HsShellScript#fdpipes and HsShellScript#exec for details. #err_to_out = redirect stderr stdoutSee . hsshellscriptSend the output of the specified action to its standard error output. What's actually modified is the stderr( handle, not the file descriptor 2. The exec functions know about this. See HsShellScript#fdpipes and HsShellScript#exec for details. redirect stdout stderrSee . hsshellscriptRun an IO action as a separate process, and pipe some text to its stdin. Then close the pipe and wait for the child process to finish.This forks a child process, which executes the specified action. The specified text is sent to the action's stdin through a pipe. Then the pipe is closed. In case the action replaces the process by calling an exec variant, it is made sure that the process gets the text on it's file descriptor 0.In case the action fails (exits with an exit status other than 0, or is terminated by a signal), the  ProcessStatus! is thrown, such as reported by . No attempt is made to create more meaningful exceptions, like it is done by runprog/subproc.7Exceptions in the action result in an error message on stderr7, and the termination of the child. The parent gets a  ProcessStatus exception, with the value of Exited (ExitFailure 1). The following exceptions are understood, and result in corresponding messages: ArgError,  ProcessStatus, RunError, IOError and ExitCode. Other exceptions result in the generic message, as produced by show.1Unless you replace the child process, calling an exec variant, the child should let the control flow leave the action normally. The child process is then properly terminated, such that no resources, which have been duplicated by the fork, cause problems. See HsShellScript#subr for details.The pipe is set to  text mode. This means that the Unicode characters in the text are converted to the system character set. If you need to pipe binary data, you should use  h_pipe_to, and set the returned handle to binary mode. This is accomplished by  h True. The system character set is determined by the environment variable LANG.Example: ,pipe_to "blah" (exec "/usr/bin/foo" ["bar"])Example: Access both stdin and stdout of an external program. import HsShellScript main = mainwrapper $ do res <- pipe_from $ pipe_to "2\n3\n1" $ exec "/usr/bin/sort" [] putStrLn resSee t, |, , . hsshellscriptRun an IO action as a separate process, and get a connection (a pipe) to its stdin as a file handle.This forks a subprocess, which executes the specified action. A file handle, which is connected to its stdin, is returned. The child's  ProcessID is returned as well. If the action replaces the child process, by calling an exec variant, it is made sure that its file descriptor 0 is connected to the returned file handle.This gives you full control of the pipe, and of the forked process. But you need to deal with the child process by yourself.1Unless you replace the child process, calling an exec variant, the child should let the control flow leave the action normally. The child process is then properly terminated, such that no resources, which have been duplicated by the fork, cause problems. See HsShellScript#subr for details.Errors can only be detected by examining the child's process status (using ). If the child action throws an exception, an error message is printed on stderr&, and the child process exits with a  ProcessStatus of Exited (ExitFailure 1). The following exceptions are understood, and result in corresponding messages: ArgError,  ProcessStatus, RunError, IOError and ExitCode. Other exceptions result in the generic message, as produced by show.If the child process exits in a way which signals an error, the corresponding  ProcessStatus is returned by getProcessStatus. See  for details.The pipe is set to  text mode. This means that the Unicode characters in the text are converted to the system character set. You can set the returned handle to binary mode, by calling  handle True. The system character set is determined by the environment variable LANG.Example: (handle, pid) <- h_pipe_to $ exec "/usr/bin/foo" ["bar"] hPutStrLn handle "Some text to go through the pipe" (Just ps) <- getProcessStatus True False pid when (ps /= Exited ExitSuccess) $ throw psSee , , , . See HsShellScript#fdpipes for more details. hsshellscript5Run an IO action as a separate process, and read its stdout strictly. Then wait for the child process to finish. This is like the backquote feature of shells.This forks a child process, which executes the specified action. The output of the child is read from its standard output. In case it replaces the process by calling an exec variant, it is make sure that the output is read from the new process' file descriptor 1.The end of the child's output is reached when either the standard output is closed, or the child process exits. The program blocks until the action exits, even if the child closes its standard output earlier. So the parent process always notices a failure of the action (when it exits in a way which indicates an error).When the child action exits in a way which indicates an error, the corresponding  ProcessStatus is thrown. See . No attempt is made to create more meaningful exceptions, like it is done by runprog/subproc.7Exceptions in the action result in an error message on stderr>, and the proper termination of the child. The parent gets a  ProcessStatus exception, with the value of Exited (ExitFailure 1). The following exceptions are understood, and result in corresponding messages: ArgError,  ProcessStatus, RunError, IOError and ExitCode. Other exceptions result in the generic message, as produced by show.1Unless you replace the child process, calling an exec variant, the child should let the control flow leave the action normally. The child process is then properly terminated, such that no resources, which have been duplicated by the fork, cause problems. See HsShellScript#subr for details."Unlike shells' backquote feature,  pipe_from does not remove any trailing newline characters. The entire output of the action is returned. You might want to apply chomp to the result.The pipe is set to  text mode. This means that the Unicode characters in the text, which is read from stdin, is converted from the system character set to Unicode. The system character set is determined by the environment variable LANG. If you need to read binary data from the forked process, you should use  h_pipe_from and set the returned handle to binary mode. This is accomplished by  h True.Example: *output <- pipe_from $ exec "/bin/mount" []Example: Access both stdin and stdout of an external program. import HsShellScript main = mainwrapper $ do res <- pipe_from $ pipe_to "2\n3\n1" $ exec "/usr/bin/sort" [] putStrLn resSee ~, , , , , , . hsshellscriptRun an IO action as a separate process, and read its standard error output strictly. Then wait for the child process to finish. This is like the backquote feature of shells. This function is exactly the same as  pipe_from, except that the standard error output is read, instead of the standard output.This forks a child process, which executes the specified action. The error output of the child is read from its standard error output. In case it replaces the process by calling an exec variant, it is made sure that the output is read from the new process' file descriptor 2.The end of the child's error output is reached when either the standard error output is closed, or the child process exits. The program blocks until the action exits, even if the child closes its standard error output earlier. So the parent process always notices a failure of the action (which means it exits in a way which indicates an error).When the child action exits in a way which indicates an error, the corresponding  ProcessStatus is thrown. See . No attempt is made to create more meaningful exceptions, like it is done by runprog/subproc.7Exceptions in the action result in an error message on stderr, and the proper termination of the child. This means that the error message is sent through the pipe, to the parent process. The message can be found in the text which has been read from the child process. It doesn't appear on the console.The parent gets a  ProcessStatus exception, with the value of Exited (ExitFailure 1). The following exceptions are understood, and result in corresponding messages: ArgError,  ProcessStatus, RunError, IOError and ExitCode. Other exceptions result in the generic message, as produced by show.1Unless you replace the child process, calling an exec variant, the child should let the control flow leave the action normally. The child process is then properly terminated, such that no resources, which have been duplicated by the fork, cause problems. See HsShellScript#subr for details."Unlike shells' backquote feature,  pipe_from2 does not remove any trailing newline characters. The entire error output of the action is returned. You might want to apply chomp to the result.The pipe is set to  text mode. This means that the Unicode characters in the text, which is read from stdin, is converted from the system character set to Unicode. The system character set is determined by the environment variable LANG. If you need to read binary data from the forked process, you should use  h_pipe_from and set the returned handle to binary mode. This is accomplished by  h True.Example: *output <- pipe_from $ exec "/bin/mount" []Example: Access both stdin and stdout of an external program. import HsShellScript main = mainwrapper $ do res <- pipe_from $ pipe_to "2\n3\n1" $ exec "/usr/bin/sort" [] putStrLn resSee ~, , , , , . See HsShellScript#fdpipes for more details. hsshellscript;Run an IO action as a separate process, and connect to its stdout with a file handle. This is like the backquote feature of shells.This forks a subprocess, which executes the specified action. A file handle, which is connected to its stdout, is returned. The child's  ProcessID is returned as well. If the action replaces the child process, by calling an exec variant, it is made sure that its file descriptor 1 is connected to the returned file handle.This gives you full control of the pipe, and of the forked process. But you need to deal with the child process by yourself.When you call getProcessStatus blockingly, you must first ensure that all data has been read, or close the handle. Otherwise you'll get a deadlock. When you close the handle before all data has been read, then the child gets a SIGPIPE signal.1Unless you replace the child process, calling an exec variant, the child should let the control flow leave the action normally. The child process is then properly terminated, such that no resources, which have been duplicated by the fork, cause problems. See HsShellScript#subr for details.Errors can only be detected by examining the child's process status (using ). No attempt is made to create more meaningful exceptions, like it is done by runprog/subproc. If the child action throws an exception, an error message is printed on stderr&, and the child process exits with a  ProcessStatus of Exited (ExitFailure 1). The following exceptions are understood, and result in corresponding messages: ArgError,  ProcessStatus, RunError, IOError and ExitCode. Other exceptions result in the generic message, as produced by show.The pipe is set to  text mode. This means that the Unicode characters in the text, which is read from stdin, is converted from the system character set to Unicode. The system character set is determined by the environment variable LANG. If you need to read binary data from the forked process, you can set the returned handle to binary mode. This is accomplished by  h True.Example: 4(h,pid) <- h_pipe_from $ exec "/usr/bin/foo" ["bar"]See ~, , , , , , . See HsShellScript#fdpipes for more details. hsshellscript;Run an IO action as a separate process, and connect to its stderr with a file handle.This forks a subprocess, which executes the specified action. A file handle, which is connected to its stderr, is returned. The child's  ProcessID is returned as well. If the action replaces the child process, by calling an exec variant, it is made sure that its file descriptor 2 is connected to the returned file handle.This gives you full control of the pipe, and of the forked process. But you need to deal with the child process by yourself.When you call getProcessStatus blockingly, you must first ensure that all data has been read, or close the handle. Otherwise you'll get a deadlock. When you close the handle before all data has been read, then the child gets a SIGPIPE signal.1Unless you replace the child process, calling an exec variant, the child should let the control flow leave the action normally. The child process is then properly terminated, such that no resources, which have been duplicated by the fork, cause problems. See HsShellScript#subr for details.Errors can only be detected by examining the child's process status (using ). No attempt is made to create more meaningful exceptions, like it is done by runprog/subproc. If the child action throws an exception, an error message is printed on stderr. This means that the message goes through the pipe to the parent process. Then the child process exits with a  ProcessStatus of Exited (ExitFailure 1). The following exceptions are understood, and result in corresponding messages: ArgError,  ProcessStatus, RunError, IOError and ExitCode. Other exceptions result in the generic message, as produced by show.The pipe is set to  text mode. This means that the Unicode characters in the text, which is read from stdin, is converted from the system character set to Unicode. The system character set is determined by the environment variable LANG. If you need to read binary data from the forked process, you can set the returned handle to binary mode. This is accomplished by  h True.Example: 4(h,pid) <- h_pipe_from $ exec "/usr/bin/foo" ["bar"]See ~, , , , , , , . hsshellscriptRun an IO action in a separate process, and read its standard output, The output is read lazily, as the returned string is evaluated. The child's output along with its process ID are returned.This forks a child process, which executes the specified action. The output of the child is read lazily through a pipe, which connncts to its standard output. In case the child replaces the process by calling an exec variant, it is make sure that the output is read from the new process' file descriptor 1.lazy_pipe_from calls , in order to read the pipe lazily. This means that the file handle goes to semi-closed state. The handle holds a file descriptor, and as long as the string isn't fully evaluated, this file descriptor won't be closed. For the file descriptor to be closed, first its standard output needs to be closed on the child side. This happens when the child explicitly closes it, or the child process exits. When afterwards the string on the parent side is completely evaluated, the handle, along with the file descritor it holds, are closed and freed.If you use the string in such a way that you only access the beginning of the string, the handle will remain in semi-closed state, holding a file descriptor, even when the pipe is closed on the child side. When you do that repeatedly, you may run out of file descriptors.Unless you're sure that your program will reach the string's end, you should take care for it explicitly, by doing something like this: (output, pid) <- lazy_pipe_from (exec "\/usr\/bin\/foobar" []) ... seq (length output) (return ())This will read the entire standard output of the child, even if it isn't needed. You can't cut the child process' output short, when you use lazy_pipe_from). If you need to do this, you should use  h_pipe_from;, which gives you the handle, which can then be closed by ., even if the child's output isn't completed: (h, pid) <- h_pipe_from io -- Lazily read io's output output <- hGetContents h ... -- Not eveyting read yet, but cut io short. hClose h -- Wait for io to finish, and detect errors (Just ps) <- System.Posix.getProcessStatus True False pid when (ps /= Exited ExitSuccess) $ throw psWhen you close the handle before all data has been read, then the child gets a SIGPIPE signal.4After all the output has been read, you should call getProcessStatus on the child's process ID, in order to detect errors. Be aware that you must evaluate the whole string, before calling getProcessStatus' blockingly, or you'll get a deadlock.You won't get an exception, if the child action exits in a way which indicates an error. Errors occur asynchronously, when the output string is evaluated. You must detect errors by yourself, by calling .In case the action doesn't replace the child process with an external program, an exception may be thrown out of the action. This results in an error message on stderr0, and the proper termination of the child. The  ProcessStatus2, which can be accessed in the parent process by getProcessStatus, is Exited (ExitFailure 1). The following exceptions are understood, and result in corresponding messages: ArgError,  ProcessStatus, RunError, IOError and ExitCode. Other exceptions result in the generic message, as produced by show.1Unless you replace the child process, calling an exec variant, the child should let the control flow leave the action normally. The child process is then properly terminated, such that no resources, which have been duplicated by the fork, cause problems. See HsShellScript#subr for details."Unlike shells' backquote feature, lazy_pipe_from does not remove any trailing newline characters. The entire output of the action is returned. You might want to apply chomp to the result.The pipe is set to  text mode. This means that the Unicode characters in the text, which is read from the IO action's stdout, are converted from the system character set to Unicode. The system character set is determined by the environment variable LANG. If you need to read binary data from the forked process, you should use h_pipe_from and set the returned handle to binary mode. This is accomplished by  h True. Then you can lazily read the output of the action from the handle.Example: Lazily read binary data from an IO action. Don't forget to collect the child process later, using  True False pid. (h, pid) <- h_pipe_from io hSetBinaryMode h True txt <- hGetContents h ... (Just ps) <- System.Posix.getProcessStatus True False pidSee ~, , , , , . hsshellscriptRun an IO action in a separate process, and read its standard error output, The output is read lazily, as the returned string is evaluated. The child's error output along with its process ID are returned.This forks a child process, which executes the specified action. The error output of the child is read lazily through a pipe, which connncts to its standard error output. In case the child replaces the process by calling an exec variant, it is make sure that the output is read from the new process' file descriptor 1.lazy_pipe_from calls , in order to read the pipe lazily. This means that the file handle goes to semi-closed state. The handle holds a file descriptor, and as long as the string isn't fully evaluated, this file descriptor won't be closed. For the file descriptor to be closed, first its standard error output needs to be closed on the child side. This happens when the child explicitly closes it, or the child process exits. When afterwards the string on the parent side is completely evaluated, the handle, along with the file descritor it holds, are closed and freed.If you use the string in such a way that you only access the beginning of the string, the handle will remain in semi-closed state, holding a file descriptor, even when the pipe is closed on the child side. When you do that repeatedly, you may run out of file descriptors.Unless you're sure that your program will reach the string's end, you should take care for it explicitly, by doing something like this: (errmsg, pid) <- lazy_pipe_from2 (exec "/usr/bin/foobar" []) ... seq (length errmsg) (return ())This will read the entire standard error output of the child, even if it isn't needed. You can't cut the child process' output short, when you use lazy_pipe_from). If you need to do this, you should use  h_pipe_from;, which gives you the handle, which can then be closed by ., even if the child's output isn't completed: (h, pid) <- h_pipe_from io -- Lazily read io's output output <- hGetContents h ... -- Not eveyting read yet, but cut io short. hClose h -- Wait for io to finish, and detect errors (Just ps) <- System.Posix.getProcessStatus True False pid when (ps /= Exited ExitSuccess) $ throw psWhen you close the handle before all data has been read, then the child gets a SIGPIPE signal.4After all the output has been read, you should call getProcessStatus on the child's process ID, in order to detect errors. Be aware that you must evaluate the whole string, before calling getProcessStatus' blockingly, or you'll get a deadlock.You won't get an exception, if the child action exits in a way which indicates an error. Errors occur asynchronously, when the output string is evaluated. You must detect errors by yourself, by calling .In case the action doesn't replace the child process with an external program, an exception may be thrown out of the action. This results in an error message on stderr. This means that the message is sent through the pipe, to the parent process. Then the child process is properly terminated. The  ProcessStatus2, which can be accessed in the parent process by getProcessStatus, is Exited (ExitFailure 1). The following exceptions are understood, and result in corresponding messages: ArgError,  ProcessStatus, RunError, IOError and ExitCode. Other exceptions result in the generic message, as produced by show.1Unless you replace the child process, calling an exec variant, the child should let the control flow leave the action normally. The child process is then properly terminated, such that no resources, which have been duplicated by the fork, cause problems. See HsShellScript#subr for details.The pipe is set to  text mode. This means that the Unicode characters in the text, which is read from stdin, is converted from the system character set to Unicode. The system character set is determined by the environment variable LANG. If you need to read binary data from the forked process, you can set the returned handle to binary mode. This is accomplished by  h True."Unlike shells' backquote feature, lazy_pipe_from does not remove any trailing newline characters. The entire output of the action is returned. You might want to apply chomp to the result.The pipe is set to  text mode. This means that the Unicode characters in the text, which is read from the IO action's stdout, are converted from the system character set to Unicode. The system character set is determined by the environment variable LANG. If you need to read binary data from the forked process' standard error output, you should use h_pipe_from2 and set the returned handle to binary mode. This is accomplished by  h True. Then you can lazily read the output of the action from the handle.Example: Lazily read binary data from an IO action. Don't forget to collect the child process later, using  True False pid. (h, pid) <- h_pipe_from2 io hSetBinaryMode h True txt <- hGetContents h ... (Just ps) <- System.Posix.getProcessStatus True False pidSee ~, , , , , . hsshellscript5Run an IO action as a separate process, and read its stdout strictly. All the output is read, until the action terminates. Contrary to , when the action signals an error (with a non-zero exit code), the error isn't thrown as an exception, but is returned alongside the output.The result consists of the output which has been read, alongside with the process status, with which the action has terminated. For success, the process status is Exited ExitSuccess. See .This is a frontend to the & function. See there for more details.See , ~, , , , , . hsshellscript5Run an IO action as a separate process, and read its stderr strictly. All the error output is read, until the action terminates. Contrary to , when the action signals an error (with a non-zero exit code), the error isn't thrown as an exception, but is returned alongside the output.The result consists of the error output which has been read, alongside with the process status, with which the action has terminated. For success, the process status is Exited ExitSuccess. See .This is a frontend to the & function. See there for more details.See , ~, , , , , . hsshellscriptRun an IO action as a separate process, and optionally connect to its stdin, its stdout and its stderr output with pipes.This forks a subprocess, which executes the specified action. The child's  ProcessID is returned. Some of the action's standard handles are made to connected to pipes, which the caller can use in order to communicate with the new child process. Which, this is determined by the first three arguments.You get full control of the pipes, and of the forked process. But you need to deal with the child process by yourself.Errors in the child process can only be detected by examining its process status (using ). If the child action throws an exception, an error message is printed on stderr&, and the child process exits with a  ProcessStatus of Exited (ExitFailure 1). The following exceptions are understood, and result in corresponding messages: ArgError,  ProcessStatus, RunError, IOError and ExitCode. Other exceptions result in the generic message, as produced by show.1Unless you replace the child process, calling an exec variant, the child should let the control flow leave the action normally. It is then properly take care of.The pipes are set to  text mode!. When connecting to the child's stdin, this means that the Unicode characters in the Haskell side text are converted to the system character set. When reading from the child's stdout or stderr, the text is converted from the system character set to Unicode in the Haskell-side strings. The system character set is determined by the environment variable LANG. If you need to read or write binary data, then this is no problem. Just call  handle True3. This sets the corresponding pipe to binary mode.See , , , , , , ,  hsshellscriptForcibly terminate the program, circumventing normal program shutdown. This is the _exit(2)0 system call. No cleanup actions installed with bracket are performed, no data buffered by file handles is written out, etc. hsshellscript"Generate an error message from an errno value. This is the POSIX strerror system library function.See the man page  strerror(3). hsshellscript7Read the global system error number. This is the POSIX errno) value. This function is redundant. Use Foreign.C.Error.getErrno instead. hsshellscript3Print error message corresponding to the specified errno error number. This is similar to the POSIX system library function perror.See the man page  perror(3). hsshellscript0Print error message corresponding to the global errno error number. This is the same as the POSIX system library function perror.See the man page  perror(3). hsshellscriptPrint a message to stderr1 and exit with an exit code indicating an error. 0failIO msg = hPutStrLn stderr msg >> exitFailure hsshellscriptModify an IO action to return the exit code of a failed program call, instead of throwing an exception.This is used to modify the error reporting behaviour of an IO action which uses w| or ut. When an external program exits with an exit code which indicates an error, normally an exception is thrown. After exitcode5 has been applied, the exit code is retruned instead.The caught exceptions are k and . Termination by a signal is still reported by an exception, which is passed through. Example: &ec <- exitcode $ runprog "foo" ["bar"]See |, t, w, u. hsshellscript Convert an IOError to a string.$There is an instance declaration of IOError in Show in the GHC.IO library, but  show_ioerror7 produces a more readable, and more complete, message. hsshellscriptCall the shell to execute a command. In case of an error, throw the  ProcessStatus (such as (Exited (ExitFailure ec))) as an exception. This is like the Haskell standard library function system, except that error handling is brought in accordance with HsShellScript's scheme.exitcode . system_throw is the same as the system function, except that when the called shell is terminated or stopped by a signal, this still lead to the  ProcessStatus being thrown. The Haskell library report says nothing about what happens in this case, when using the system function. 2system_throw cmd = run "/bin/sh" ["-c", "--", cmd]3This function is deprecated. You should rather use 1, which provides for much better error reporting. hsshellscript ProcessStatus -> IO () handler msgref ps = do hPutStrLn stderr ("Command failed with " ++ show ps ++ ". Actions so far: ") msg <- readIORef msgref hPutStrLn stderr msg exitWith (ExitFailure 1) msgref <- newIORef "" do silently msgref $ do putStrLn "Now doing foobar:" echo exec "/foo/bar" ["arguments"] silently msgref $ echo exec "/bar/baz" ["arguments"] `catch` (handler msgref)See , t, | , Data.IORef. hsshellscriptModify a subroutine action in order to make it suitable to run as a child process.This is used by functions like u, ,  etc. The action is executed. When it returns, the (child) process is terminated with  0 (after flushing stdout), circumventing normal program shutdown. When it throws an exception, an error message is printed and the (child) process is terminated with  1. hsshellscriptPrint text to stdout.This is a shorthand for putStrLn , except for stderr being flushed beforehand. This way normal output and error output appear in order, even when they aren't buffered as by default.,An additional newline is printed at the end. .outm msg = do hFlush stderr putStrLn msg hsshellscriptPrint text to stdout.This is a shorthand for putStr , except for stderr being flushed beforehand. This way normal output and error output appear in order, even when they aren't buffered as by default.!No newline is printed at the end. -outm_ msg = do hFlush stderr putStr msg hsshellscriptColorful log message to stderr.This prints a message to stderr. When stderr1 is connected to a terminal (as determined by  isatty(3)), additional escape sequences are printed, which make the message appear in cyan. Additionally, a newline character is output at the end.stdout is flushed beforehand. So normal output and error output appear in order, even when they aren't buffered as by default.See , , . hsshellscriptColorful log message to stderr.This prints a message to stderr. When stderr1 is connected to a terminal (as determined by  isatty(3)), additional escape sequences are printed, which make the message appear in cyan. No a newline character is output at the end.stdout is flushed beforehand. So normal output and error output appear in order, even when they aren't buffered as by default.See , , . hsshellscriptColorful error message to stderr.This prints a message to stderr. When stderr1 is connected to a terminal (as determined by  isatty(3)), additional escape sequences are printed, which make the message appear in red. Additionally, a newline character is output at the end.stdout is flushed beforehand. So normal output and error output appear in order, even when they aren't buffered as by default.See , , . hsshellscriptColorful error message to stderr.This prints a message to stderr. When stderr1 is connected to a terminal (as determined by  isatty(3)), additional escape sequences are printed, which make the message appear in red. No a newline character is output at the end.stdout is flushed beforehand. So normal output and error output appear in order, even when they aren't buffered as by default.See , , . hsshellscriptIn case the specified action throws an IOError, fill in its filename field. This way, more useful error messages can be produced.Example: -- Oh, the GHC libraries neglect to fill in the file name executeFile' prog a b c = fill_in_filename prog $ executeFile prog a b cSee , . hsshellscriptIn case the specified action throws an IOError, fill in its location field. This way, more useful error messages can be produced.Example: my_fun a b c = do -- ... fill_in_location "my_fun" $ -- Give the caller a more useful location information in case of failure rename "foo" "bar" -- ...See . hsshellscriptIn case the specified action throws an IOError, add a line to its location field. This way, more useful error messages can be produced. The specified string is prepended to the old location, separating it with a newline from the previous location, if any. When using this thoroughly, you get a reverse call stack in IOErrors.Example: 3my_fun = add_location "my_fun" $ do -- ...See , . hsshellscriptThis is a replacement for  System.Posix.Process.executeFile1. It does additional preparations, then calls  executeFile.  executeFile can't normally . A list of these is returned by the functions which read mount information.See , , . hsshellscript+Device file ("name of mounted file system") hsshellscript Mount point hsshellscript*Which kind of file system ("see mntent.h") hsshellscriptMount options ("see mntent.h") hsshellscriptDump frequency in days hsshellscript"Pass number on parallel fsck" hsshellscript Format an Int9 with leading zeros. If the string representation of the In is longer than the number of characters to fill up, this produces as many characters as needed. hsshellscript4Remove trailing newlines. This is silimar to perl's chomp procedure. hsshellscriptGet contents of a file or of stdin. This is a simple frontend to  hGetContents. A file name of "-" designates stdin. The contents are read lazily as the string is evaluated.(The handle which we read from will be in semi-closed state. Once all input has read, it is closed automatically (Haskell Library Report 11.2.1). Therefore we don't need to return it). lazy_contents path = do h <- if path == "-" then return stdin else openFile path ReadMode hGetContents h hsshellscriptGet contents of a file or of stdin eagerly. This is the same as  lazy_contents2, except for the contents being read immediately. hsshellscript=Test for the existence of a path. This is the disjunction of Directory.doesDirectoryExist and Directory.doesFileExist,. For an dangling symlink, this will return False. hsshellscript,Test for the existence of a path. This uses  System.Posix.Files.getFileStatus to determine whether the path exists in any form in the file system. For a dangling symlink, the result is True. hsshellscript5Test if path points to a directory. This will return True= for a symlink pointing to a directory. It's a shortcut for Directory.doesDirectoryExist. hsshellscript7Test if path points to a file. This is a shortcut for Directory.doesFileExist. hsshellscript This is the  System.Posix.Files.getFileStatus function from the GHC libraries, with improved error reporting. The GHC function doesn't include the file name in the IOError? when the call fails, making error messages much less useful. getFileStatus' rectifies this.See . hsshellscript This is the System.Posix.Files.fileAccess function from the GHC libraries, with improved error reporting. The GHC function doesn't include the file name in the IOError? when the call fails, making error messages much less useful.  fileAccess' rectifies this.See . hsshellscriptCreate a temporary file. This will create a new, empty file, with a path which did not previously exist in the file system. The path consists of the specified prefix, a sequence of random characters (digits and letters), and the specified suffix. The file is created with read-write permissions for the user, and no permissons for the group and others. The ownership is set to the effective user ID of the process. The group ownership is set either to the effective group ID of the process or to the group ID of the parent directory (depending on filesystem type and mount options on Linux - see open(2) for details).See , , . hsshellscriptCreate a temporary directory. This will create a new directory, with a path which did not previously exist in the file system. The path consists of the specified prefix, a sequence of random characters (digits and letters), and the specified suffix. The directory is normally created with read-write-execute permissions for the user, and no permissons for the group and others. But this may be further restricted by the process's umask in the usual way.The newly created directory will be owned by the effective uid of the process. If the directory containing the it has the set group id bit set, or if the filesystem is mounted with BSD group semantics, the new directory will inherit the group ownership from its parent; otherwise it will be owned by the effective gid of the process. (See mkdir(2))See , , . hsshellscriptCreate a temporary file. This will create a new, empty file, with read-write permissions for the user, and no permissons for the group and others. The path consists of the specified prefix, a dot, and six random characters (digits and letters). 0tmp_file prefix = temp_file 6 (prefix ++ ".") ""See , , . hsshellscriptCreate a temporary directory. This will create a new directory, with read-write-execute permissions for the user (unless further restricted by the process's umask), and no permissons for the group and others. The path consists of the specified prefix, a dot, and six random characters (digits and letters). .tmp_dir prefix = temp_dir 6 (prefix ++ ".") ""See , , . hsshellscriptCreate and open a temporary file, perform some action with it, and delete it afterwards. This is a front end to the  function. The file and its path are created in the same way. The IO action is passed a handle of the new file. When it finishes - normally or with an exception - the file is deleted.See , , . hsshellscriptCreate a temporary directory, perform some action with it, and delete it afterwards. This is a front end to the  function. The directory and its path are created in the same way. The IO action is passed the path of the new directory. When it finishes - normally or with an exception - the directory is deleted.The action must clean up any files it creates inside the directory by itself.  with_temp_dir doesn't delete any files inside, so the directory could be removed. If the directory isn't empty, an IOError results (with the path filled in). When the action throws an exception, and the temporary directory cannot be removed, then the exception is passed through, rather than replacing it with the IOError. (This is because it's probably exactly because of that exception that the directory isn't empty and can't be removed).See , , . hsshellscriptCreate and open a temporary file, perform some action with it, and delete it afterwards. This is a front end to the  function. The file and its path are created in the same way. The IO action is passed a handle of the new file. When it finishes - normally or with an exception - the file is deleted.See , , . hsshellscriptCreate a temporary directory, perform some action with it, and delete it afterwards. This is a front end to the  function. The directory and its path are created in the same way. The IO action is passed the path of the new directory. When it finishes - normally or with an exception - the directory is deleted.The action must clean up any files it creates inside the directory by itself.  with_temp_dir doesn't delete any files inside, so the directory could be removed. If the directory isn't empty, an IOError results (with the path filled in). When the action throws an exception, and the temporary directory cannot be removed, then the exception is passed through, rather than replacing it with the IOError. (This is because it's probably exactly because of that exception that the directory isn't empty and can't be removed). >with_tmp_dir prefix io = with_temp_dir 6 (prefix ++ ".") "" ioSee , , . hsshellscriptCreate a temporary path. This will generate a path which does not yet exist in the file system. It consists of the specified prefix, a sequence of random characters (digits and letters), and the specified suffix.Avoid relying on the generated path not to exist in the file system. Or else you'll get a potential race condition, since some other process might create the path after  temp_path, before you use it. This is a security risk. The global random number generator (Random.randomRIO) is used to generate the random characters. These might not be that random after all, and could potentially be guessed. Rather use  temp_file or temp_dir.See , . hsshellscript3Read mount information. This is a front end to the  setmntent(3),  getmntent(3),  endmntent(3) system library functions. When the  setmntent call fails, the errno value is converted to an IOError and thrown.See , . hsshellscript'Get the currently mounted file systems. #read_mtab = read_mounts "/etc/mtab"See . hsshellscript&Get the system wide file system table. %read_fstab = read_mounts "/etc/fstab"See . hsshellscript"This is an interface to the POSIX glob function, which does wildcard expansion in paths. The sorted list of matched paths is returned. It's empty for no match (rather than the original pattern). In case anything goes wrong (such as permission denied), an IOError is thrown. This does not do tilde expansion, which is done (among many unwanted other things) by wordexp%. The only flag used for the call to glob is GLOB_ERR.The behaviour in case of non-existing path components is inconsistent in the GNU version of the underlying glob function. glob "/doesnt_exist/foo"& will return the empty list, whereas glob "/doesnt_exist/*"/ causes a "No such file or directory" IOError.Note that it isn't clear if dangling symlinks are matched by glob. From the web: "Compared to other glob implementation (*BSD, bash, musl, and other shells as well), GLIBC seems the be the only one that does not match dangling symlinks. ... POSIX does not have any strict specification for dangling symlinks". You will have to work around this problem, probably using System.Directory.getDirectoryContents. See man pages glob(3) and  wordexp(3). hsshellscript*Quote special characters for use with the glob function.The characters *, ?, [ and \ must be quoted by preceding backslashs, when they souldn't have their special meaning. The  glob_quote function does this.You can't use quote or  shell_quote.See , ,  hsshellscriptHow many characters to fill up hsshellscriptValue to represent as a string hsshellscriptString representation of the value, using the specified number of characters hsshellscriptString to be chomped hsshellscript8Same string, except for no newline characters at the end hsshellscriptEither the name of a file, or "-" hsshellscript(The lazily read contents of the file or stdin. hsshellscripteither the name of a file, or "-" for stdin hsshellscript-the contents of the file or of standard input hsshellscriptPath hsshellscript*Whether the path exists in the file system hsshellscriptPath hsshellscript*Whether the path exists in the file system hsshellscriptPath hsshellscript2Whether the path exists and points to a directory. hsshellscriptPath hsshellscript-Whether the path exists and points to a file. hsshellscript/Path of the file, whose status is to be queried hsshellscriptStatus of the file hsshellscriptNumber of random characters to intersperse. Must be large enough, such that most combinations can't already exist. hsshellscript Prefix for the path to generate. hsshellscript Suffix for the path to generate. hsshellscriptPath of the created file. hsshellscriptNumber of random characters to intersperse. Must be large enough, such that most combinations can't already exist. hsshellscript Prefix for the path to generate. hsshellscript Suffix for the path to generate. hsshellscriptGenerated path. hsshellscript Prefix for the path to generate. hsshellscriptPath of the created file. hsshellscript Prefix for the path to generate. hsshellscriptPath of the created directory. hsshellscriptNumber of random characters to intersperse. Must be large enough, such that most combinations can't already exist. hsshellscript Prefix for the path to generate. hsshellscript Suffix for the path to generate. hsshellscriptAction to perform. hsshellscript)Returns the value returned by the action. hsshellscriptNumber of random characters to intersperse. Must be large enough, such that most combinations can't already exist. hsshellscript Prefix for the path to generate. hsshellscript Suffix for the path to generate. hsshellscriptAction to perform. hsshellscript)Returns the value returned by the action. hsshellscript Prefix for the path to generate. hsshellscriptAction to perform. hsshellscript)Returns the value returned by the action. hsshellscript Prefix for the path to generate. hsshellscriptAction to perform. hsshellscript)Returns the value returned by the action. hsshellscriptNumber of random characters to intersperse. Must be large enough, such that most combinations can't already exist. hsshellscript Prefix for the path to generate. hsshellscript Suffix for the path to generate. hsshellscriptGenerated path. hsshellscriptFile to read (typically  /etc/mtab or  /etc/fstab) hsshellscriptMount information in that file hsshellscriptPattern hsshellscriptSorted list of matching paths+  Safe-Inferred%&'56-[ hsshellscriptDo a call to the  realpath(3) system library function. This makes the path absolute, normalizes it and expands all symbolic links. In case of an error, an IOError is thrown. hsshellscript7Determine the target of a symbolic link. This uses the  readlink(2) system call. The result is a path which is either absolute, or relative to the directory which the symlink is in. In case of an error, an IOError; is thrown. The path is included and can be accessed with IO.ioeGetFileName. Note that, if the path to the symlink ends with a slash, this path denotes the directory pointed to, not the symlink. In this case the call to will fail because of "Invalid argument". hsshellscript7Determine the target of a symbolic link. This uses the  readlink(2) system call. The target is converted, such that it is relative to the current working directory, if it isn't absolute. Note that, if the path to the symlink ends with a slash, this path denotes the directory pointed to, not( the symlink. In this case the call to readlink will fail with an IOError because of "Invalid argument". In case of any error, a proper IOError is thrown. hsshellscriptDetermine whether a path is a symbolic link. The result for a dangling symlink is True. The path must exist in the file system. In case of an error, a proper IOError is thrown. hsshellscriptReturn the normalised, absolute version of a specified path. The path is made absolute with the current working directory, and is syntactically normalised afterwards. This is the same as what the realpath program reports with the -s option. It's almost the same as what it reports when called from a shell. The difference lies in the shell's idea of the current working directory. See  for details.See , . hsshellscript"Make a symbolic link. This is the  symlink(2)# function. Any error results in an IOError> thrown. The path of the intended symlink is included in the IOError and can be accessed with ioeGetFileName$ from the Haskell standard library IO. hsshellscript Call the du program. See du(1). hsshellscript)Create directory. This is a shorthand to  System.Directory.createDirectory from the Haskell standard library. In case of an error, the path is included in the IOError,, which GHC's implementation neglects to do. hsshellscriptRemove directory. This is Directory.removeDirectory from the Haskell standard library. In case of an error, the path is included in the IOError,, which GHC's implementation neglects to do. hsshellscriptRemove file. This is Directory.removeFile from the Haskell standard library, which is a direct frontend to the  unlink(2) system call in GHC. hsshellscript'Change directory. This is an alias for Directory.setCurrentDirectory from the Haskell standard library. In case of an error, the path is included in the IOError,, which GHC's implementation neglects to do. run "/bin/mv" ["--", src, tgt]) src tgtSee , . hsshellscriptRename a file with , or when necessary with , and manage read only issues.The necessary write permissions are set, then the file is renamed, then the permissions are restored. First, the  system call is tried, which is most efficient. If it fails, because source and target path point to different file systems (as indicated by the errno value EXDEV), then /bin/mv is called. force_rename_mv old new = fill_in_location "force_rename_mv" $ force_cmd rename_mv old newSee , , , . hsshellscriptCall a command which moves a file or directory, and manage read only issues.This function is for calling a command, which renames files. Beforehand, write permissions are set in order to enable the operation, and afterwards the permissions are restored. The command is meant to be something like rename or  run "/bin/mv".In order to change the name of a file or dirctory, but leave it in the super directory it is in, the super directory must be writeable. In order to move a file or directory to a different super directory, both super directories and the file/directory to be moved must be writeable. I don't know what this behaviour is supposed to be good for.This function concerns itself with the case that the file/directory to be moved or renamed, or the super directories are read only. It makes the necessary places writeable, calls the command, and makes them read only again, if they were before. The user needs the necessary permissions for changing the corresponding write permissions. If an error occurs (such as file not found, or insufficient permissions), then the write permissions are restored to the state before, before the exception is passed through to the caller.The command must take two arguments, the old path and the new path. It is expected to create the new path in the file system, such that the correct write permissions of the new path can be set by  force_cmd after executing it.The new path may be an existing directory. In this case, it is assumed that the old file is to be moved into this directory (like with mv). The new path is completed with the file name component of the old path, before it is passed to the command, such that the command is supplied the complete new path. Examples: force_cmd rename from to force_cmd (\from to -> run "/bin/mv" ["-i", "-v", "--", from, to]) from toSee , , . hsshellscriptMake a file or directory writeable for the user, perform an action, and restore its writeable status. An IOError is raised when the user doesn't have permission to make the file or directory writeable. force_writeable path io = force_writeable2 path (io >>= \res -> return (path, res))Example: -- Need to create a new directory in /foo/bar, even if that's write protected force_writeable "/foo/bar" $ mkdir "/foo/bar/baz"See , . hsshellscriptMake a file or directory writeable for the user, perform an action, and restore its writeable status. The action may change the name of the file or directory. Therefore it returns the new name, along with another return value, which is passed to the caller.The writeable status is only changed back if it has been changed by force_writeable2 before. An IOError is raised when the user doesn'h have permission to make the file or directory writeable, or when the new path doesn't exist.See , . hsshellscript Call the fdupes program in order to find identical files. It outputs a list of groups of file names, such that the files in each group are identical. Each of these groups is further analysed by the fdupes action. It is split to a list of lists of paths, such that each list of paths corresponds to one of the directories which have been searched by the fdupes program. If you just want groups of identical files, then apply  map concat to the result.The fdupes /program doesn't handle multiple occurences of the same directory, or in recursive mode one specified directory containing another, properly. The same file may get reported multiple times, and identical files may not get reported./ The paths are normalised (using ). hsshellscriptpath hsshellscript7noramlized, absolute path, with symbolic links expanded hsshellscriptPath of the symbolic link hsshellscript3The link target - where the symbolic link points to hsshellscriptpath of the symbolic link hsshellscript)target; where the symbolic link points to hsshellscriptpath hsshellscript$Whether the path is a symbolic link. hsshellscriptpath hsshellscript;noramlized, absolute path, with symbolic links not expanded hsshellscriptcontents of the symlink hsshellscriptpath of the symlink hsshellscriptblock size, this is the  --block-size option. hsshellscript6path of the file or directory to determine the size of hsshellscriptsize in blocks hsshellscriptpath hsshellscriptpath hsshellscriptpath hsshellscriptpath hsshellscriptNew working directory hsshellscript Action to run hsshellscriptCommand line arguments hsshellscriptCommand line arguments hsshellscriptsource hsshellscript destination hsshellscriptsource hsshellscript destination hsshellscriptfile and block number hsshellscriptOld path hsshellscriptNew path hsshellscriptOld path hsshellscriptNew path hsshellscriptOld path hsshellscriptNew path hsshellscriptOld path hsshellscriptNew path or target directory hsshellscriptOld path hsshellscriptNew path hsshellscript2Command to execute after preparing the permissions hsshellscriptOld path hsshellscriptNew path or target directory hsshellscript#File or directory to make writeable hsshellscriptAction to perform hsshellscript&Returns the return value of the action hsshellscript#File or directory to make writeable hsshellscriptAction to perform hsshellscriptOptions for the fdupes program hsshellscript!Directories with files to compare hsshellscriptFor each set of identical files, and each of the specified directories, the paths of the identical files in this directory." Safe-Inferred%&'56/ hsshellscript Error reporting wrapper for the main function. This catches any HsShellScript generated exceptions, and IOError-s, prints an error message and exits with  exitFailure. The main' function typically looks like this: main = mainwrapper $ do ...The exceptions caught are , k,  and IOError. hsshellscript Should be main hsshellscriptWrapped main"#$%-,+*)(&'/201.! J456789:;<>=?@ABDEC3KLMN_`OPQRSTUV]WXYZ[\^abFGHIc stv|klmnopqrxz{~}yuwstv|klmnopqrxz{~}yuw !"#$%&'()*+,-./012344567889::;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                               hsshellscript-3.6.4-inplaceHsShellScript.PathsHsShellScript.Shell HsShellScriptHsShellScript.Args hsshellscriptHsShellScript.GetOptSystem.EnvironmentgetArgsHsShellScript.Commandsrealpath realpath_sreadlink normaliseHsShellScript.ProcErrSystem.Posix.ProcessgetProcessStatusHsShellScript.Miscchomp ProcessStatusSystem.Posix.Files getFileStatus fileAccessquote shell_quote slice_path unslice_pathnormalise_pathslice_filenameslice_filename'unslice_filename split_pathdir_part filename_part unsplit_path unsplit_partssplit_filenamesplit_filename'unsplit_filenamesplit3unsplit3 test_suffix absolute_pathabsolute_path_byabsolute_path'guess_dotdot_comps guess_dotdot shell_commandquote0terminal_widthterminal_width_ioe throwErrno'ArgErrorargerror_messageargerror_usageinfo ArgumentsArgumentPropertyargumentpropertyArgumentDescriptionargdesc_short_argsargdesc_long_argsargdesc_argarg argdesc_timesargdesc_argargnameargdesc_descriptionargdesc_argarg_tester ArgtesterArgumentValueSpecArgumentValue_noneArgumentValue_requiredArgumentValue_optional is_direct desc_short desc_long desc_directdesc_value_requireddesc_value_optional desc_times desc_oncedesc_at_least_oncedesc_at_most_once desc_at_leastdesc_any_times desc_at_most desc_argnamedesc_description desc_tester readtester desc_integerdesc_nonneg_integerargname argname_a argname_short argname_longargdescgetargsgetargs_orderedgetargs'getargs_ordered' arg_switch arg_timesargs_optargs_req reqarg_opt reqarg_req optarg_opt optarg_req args_noneargs_allargs_oneargs_at_most_oneargs_at_least_one arg_conflicts arg_occurs usage_infounsafe_getargsunsafe_getargs_orderedmake_usage_infoprint_usage_infowrap$fOrdArgumentDescription$fEqArgumentDescription$fShowArgError$fExceptionArgError$fEqArgumentValueSpec$fShowArgumentValueSpec$fOrdArgumentValueSpecRunErrorre_progre_parsre_envre_wdre_psre_errno setFileMode'subproccallspawnrun show_runerrorexplain_processstatusto_ioeas_ioerunprogechoexecexecpexeceexecpe-|-=|--|==|=redirect->-->>-=>-=>>--&>--&>>--<- err_to_out out_to_errpipe_to h_pipe_to pipe_from pipe_from2 h_pipe_from h_pipe_from2lazy_pipe_fromlazy_pipe_from2pipe_from_fullpipe_from_full2pipes_exitstrerrorerrnoperror'perrorfailIOexitcode show_ioerror system_throwsystem_runprogsilentlychildoutmoutm_logmlogm_errmerrm_fill_in_filenamefill_in_location add_location execute_fileisattyMntent mnt_fsnamemnt_dirmnt_typemnt_optsmnt_freq mnt_passnozeros lazy_contentscontents path_exists path_exists'is_diris_filegetFileStatus' fileAccess' temp_filetemp_dirtmp_filetmp_dirwith_temp_file with_temp_dir with_tmp_file with_tmp_dir temp_path read_mounts read_mtab read_fstabglob glob_quote readlink' is_symlinksymlinkdumkdirrmdirrmcdpwdwith_wdchmodchowncpmv mt_statusrename rename_mv force_renameforce_mvforce_rename_mv force_cmdforce_writeableforce_writeable2fdupes mainwrapperArgDescrNoArgReqArgOptArgOptDescrOptionArgOrder RequireOrderPermute ReturnInOrder usageInfogetOpt unix-2.7.3System.Posix.Process.Commonbase GHC.IO.HandlehSetBinaryModeGHC.IO.Handle.Text hGetContentshCloseSystem.Posix.Process.Internals $fShowErrnoc_terminal_width hssh_c_isattydup2close c_fcntl_dupfdc_restore_fdflagsc_prepare_fd_flags_for_execc_save_fdflagsforeign_strerror _exit_primc_close_on_exec spawn_locredirect_helper pipe_fork_duphandleToFd_nocloseunsafeWithHandleFdunsafeWithHandleFd' flush_outerrreceive_ioerror send_ioerrorencode_ioerrordecode_ioerror ioe_types ioetype_num num_ioetypeglobfreedo_glob c_getmntent endmntent setmntentc_mkdirc_closehsshellscript_open_nonvariadico_EXCLo_CREATuntilIOforeign_renameforeign_symlinkhsshellscript_get_readlinkhsshellscript_get_realpathnumberparse_mt_statusreplace_location