<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--Rendered using the Haskell Html Library v0.2--> <HTML ><HEAD ><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" ><TITLE >System.Cmd</TITLE ><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" ><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" ></SCRIPT ><SCRIPT TYPE="text/javascript" >window.onload = function () {setSynopsis("mini_System-Cmd.html")};</SCRIPT ></HEAD ><BODY ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="topbar" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD ><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " ></TD ><TD CLASS="title" >process-1.0.1.1: Process libraries</TD ><TD CLASS="topbut" ><A HREF="index.html" >Contents</A ></TD ><TD CLASS="topbut" ><A HREF="doc-index.html" >Index</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="modulebar" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD ><FONT SIZE="6" >System.Cmd</FONT ></TD ><TD ALIGN="right" ><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="infohead" >Portability</TD ><TD CLASS="infoval" >portable</TD ></TR ><TR ><TD CLASS="infohead" >Stability</TD ><TD CLASS="infoval" >provisional</TD ></TR ><TR ><TD CLASS="infohead" >Maintainer</TD ><TD CLASS="infoval" >libraries@haskell.org</TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Description</TD ></TR ><TR ><TD CLASS="doc" ><P >Executing an external command. </P ><P >This module provides a simple interface for executing external commands. For a more complex, but more powerful, interface, see the <A HREF="System-Process.html" >System.Process</A > module. </P ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Synopsis</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" ><A HREF="#v%3Asystem" >system</A > :: <A HREF="../base/Data-Char.html#t%3AString" >String</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Exit.html#t%3AExitCode" >ExitCode</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3ArawSystem" >rawSystem</A > :: <A HREF="../base/Data-Char.html#t%3AString" >String</A > -> [<A HREF="../base/Data-Char.html#t%3AString" >String</A >] -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Exit.html#t%3AExitCode" >ExitCode</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Documentation</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:system" ><A NAME="v%3Asystem" ></A ></A ><B >system</B > :: <A HREF="../base/Data-Char.html#t%3AString" >String</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Exit.html#t%3AExitCode" >ExitCode</A ></TD ></TR ><TR ><TD CLASS="doc" ><P >Computation <TT >system cmd</TT > returns the exit code produced when the operating system runs the shell command <TT >cmd</TT >. </P ><P >This computation may fail with </P ><UL ><LI > <TT >PermissionDenied</TT >: The process has insufficient privileges to perform the operation. </LI ><LI > <TT >ResourceExhausted</TT >: Insufficient resources are available to perform the operation. </LI ><LI > <TT >UnsupportedOperation</TT >: The implementation does not support system calls. </LI ></UL ><P >On Windows, <TT ><A HREF="System-Cmd.html#v%3Asystem" >system</A ></TT > passes the command to the Windows command interpreter (<TT >CMD.EXE</TT > or <TT >COMMAND.COM</TT >), hence Unixy shell tricks will not work. </P ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:rawSystem" ><A NAME="v%3ArawSystem" ></A ></A ><B >rawSystem</B > :: <A HREF="../base/Data-Char.html#t%3AString" >String</A > -> [<A HREF="../base/Data-Char.html#t%3AString" >String</A >] -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Exit.html#t%3AExitCode" >ExitCode</A ></TD ></TR ><TR ><TD CLASS="doc" ><P >The computation <TT ><TT ><A HREF="System-Cmd.html#v%3ArawSystem" >rawSystem</A ></TT > cmd args</TT > runs the operating system command <TT >cmd</TT > in such a way that it receives as arguments the <TT >args</TT > strings exactly as given, with no funny escaping or shell meta-syntax expansion. It will therefore behave more portably between operating systems than <TT ><A HREF="System-Cmd.html#v%3Asystem" >system</A ></TT >. </P ><P >The return codes and possible failures are the same as for <TT ><A HREF="System-Cmd.html#v%3Asystem" >system</A ></TT >. </P ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="botbar" >Produced by <A HREF="http://www.haskell.org/haddock/" >Haddock</A > version 2.4.2</TD ></TR ></TABLE ></BODY ></HTML >