org.kde.koala
public class KShell extends Object
See Also: KStringHandler
UNKNOWN: \namespace KShell Provides some basic POSIX shell and bash functionality.
Field Summary | |
---|---|
static int | AbortOnMeta |
static int | BadQuoting |
static int | FoundMeta |
static int | NoError
Status codes from splitArgs() |
static int | NoOptions
Flags for splitArgs(). |
static int | TildeExpand |
Method Summary | |
---|---|
static String | homeDir(String user)
Obtain a user 's home directory. |
static String | joinArgs(String[] args)
Quotes and joins args together according to POSIX shell rules. |
static String | joinArgsDQ(String[] args)
Same as above, but $'' is used instead of '' for the quoting.
|
static ArrayList | splitArgs(String cmd, int flags, int[] err)
Splits cmd according to POSIX shell word splitting and quoting rules.
|
static ArrayList | splitArgs(String cmd, int flags) |
static ArrayList | splitArgs(String cmd) |
static String | tildeExpand(String path)
Performs tilde expansion on path. Interprets "~/path" and
"~user/path". |
UNKNOWN: Status codes from splitArgs()
UNKNOWN: Flags for splitArgs().
user
's home directory.Parameters: user The name of the user whose home dir should be obtained. An empty string denotes the current user.
Returns: The user's home directory.
UNKNOWN: Obtain a user
's home directory.
args
together according to POSIX shell rules.Parameters: args a list of strings to quote and join
Returns: a command suitable for shell execution
UNKNOWN: Quotes and joins args
together according to POSIX shell rules.
Parameters: args a list of strings to quote and join
Returns: a command suitable for shell execution
UNKNOWN: Same as above, but $'' is used instead of '' for the quoting.
cmd
according to POSIX shell word splitting and quoting rules.
Can optionally perform tilde expansion and/or abort if it finds shell
meta characters it cannot process.Parameters: cmd the command to split flags operation flags, see Options err if not NULL, a status code will be stored at the pointer target, see Errors
Returns: a list of unquoted words or an empty list if an error occurred
UNKNOWN: Splits cmd
according to POSIX shell word splitting and quoting rules.
path.
Interprets "~/path" and
"~user/path".Parameters: path the path to tilde-expand
Returns: the expanded path
UNKNOWN: Performs tilde expansion on path.