Navigation

Operators and Keywords

Function List:

C++ API

: tilde_expand (string)
: tilde_expand (cellstr)

Perform tilde expansion on string.

If string begins with a tilde character, (‘~’), all of the characters preceding the first slash (or all characters, if there is no slash) are treated as a possible user name, and the tilde and the following characters up to the slash are replaced by the home directory of the named user. If the tilde is followed immediately by a slash, the tilde is replaced by the home directory of the user running Octave.

If the input is a cell array of strings cellstr then tilde expansion is performed on each string element.

Examples:

tilde_expand ("~joeuser/bin")
    ⇒ "/home/joeuser/bin"
tilde_expand ("~/bin")
    ⇒ "/home/jwe/bin"

Package: octave