quote


Description:

public string quote (string unquoted_string)

Quotes a string so that the shell (/bin/sh) will interpret the quoted string to mean unquoted_string.

If you pass a filename to the shell, for example, you should first quote it with this function.

The return value must be freed with g_free.

The quoting style used is undefined (single or double quotes may be used).

Example: Quote a string:

public static int main (string[] args) {
// Output: ``'my str'``
string quote = Shell.quote ("my str");
print ("%s\n", quote);
return 0;
}

valac --pkg glib-2.0 GLib.Shell.quote.vala

Parameters:

unquoted_string

a literal string

Returns:

quoted string


Namespace: GLib.Shell
Package: glib-2.0