# class KShellProcess | A class derived from KProcess to start child processes through a shell. More...
Definition | `#include <kprocess.h>`
Inherits | KProcess [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- KShellProcess (const char *shellname=0)
- ~KShellProcess ()
- virtual bool start (RunMode runmode = NotifyOnExit, Communication comm = NoCommunication)

#### Public Static Methods

- static QString quote (const QString &arg)

## Detailed Description

This class is similar to KProcess. The only difference is that KShellProcess runs the specified executable through a UN*X shell so that standard shell mechanisms like wildcard matching, use of pipes and environment variable expansion will work.

For example, you could run commands like the following through KShellProcess:

       ls ~/HOME/ *.lyx | sort | uniq |wc -l

KShellProcess tries really hard to find a valid executable shell. Here is the algorithm used for finding an executable shell:

- Try the executable pointed to by the "SHELL" environment variable with whitespaces stripped off

- If your process runs with uid != euid or gid != egid, a shell not listed in /etc/shells will not used.

- If no valid shell could be found, "/bin/sh" is used as a last resort.

KShellProcess (const char *shellname=0) | ### KShellProcess

Constructor

By specifying the name of a shell (like "/bin/bash") you can override the mechanism for finding a valid shell as described in the detailed description of this class.

~KShellProcess () | ### ~KShellProcess

Descructor.

bool start (RunMode runmode = NotifyOnExit, Communication comm = NoCommunication) | ### start

[virtual]

Starts up the process. -- For a detailed description have a look at the "start" member function and the detailed description of KProcess .

Reimplemented from KProcess.

QString quote (const QString &arg) | ### quote

[static]

This function can be used to quote an argument string such that the shell processes it properly. This is e. g. necessary for user-provided file names which may contain spaces or quotes. It also prevents expansion of wildcards and environment variables.

- Version: $Id: kprocess.h,v 1.37 2001/01/04 23:53:26 waba Exp $
- Author: Christian Czezakte <e9025461@student.tuwien.ac.at>
- Generated: root@sparc.ports.openbsd.org on Wed May 2 09:34:58 2001, using kdoc 2.0a53.