]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/utilsunx.cpp
Use system default font for all platforms
[wxWidgets.git] / src / unix / utilsunx.cpp
index d8925aba2bd6be084936205a46233e56551251e7..fb8c58bc9022092d6faa86f42c20a2c9caf3a4b6 100644 (file)
@@ -205,15 +205,37 @@ long wxExecute( const wxString& command, bool sync, wxProcess *process )
     return lRc;
 }
 
-bool wxShell(const wxString& command)
+// ----------------------------------------------------------------------------
+// wxShell
+// ----------------------------------------------------------------------------
+
+static wxString wxMakeShellCommand(const wxString& command)
 {
     wxString cmd;
     if ( !command )
+    {
+        // just an interactive shell
         cmd = _T("xterm");
+    }
     else
-        cmd = command;
+    {
+        // execute command in a shell
+        cmd << _T("/bin/sh -c '") << command << _T('\'');
+    }
+
+    return cmd;
+}
+
+bool wxShell(const wxString& command)
+{
+    return wxExecute(wxMakeShellCommand(command), TRUE /* sync */) == 0;
+}
+
+bool wxShell(const wxString& command, wxArrayString& output)
+{
+    wxCHECK_MSG( !!command, FALSE, _T("can't exec shell non interactively") );
 
-    return wxExecute(cmd) != 0;
+    return wxExecute(wxMakeShellCommand(command), output);
 }
 
 #if wxUSE_GUI