Programmer Guide/Command Reference/PWD: Difference between revisions
From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import) |
No edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
<var>var</var> := PWD [ <var>directory</var> ] | |||
Set and or get current working directory. The directory is not changed if <var>directory</var> is omitted. | |||
Either way, the command will return the current working directory on success, or an empty string on failure (e.g. when you have tried to change to a non-existent directory). | |||
Note that if you are working with scripts, the script directory is stored in the shell variable <var>scriptDirectory</var>. See also [[XXX|@ROOT]] and [[XXX|@WORK]]. | |||
Revision as of 17:43, 25 April 2014
var := PWD [ directory ]
Set and or get current working directory. The directory is not changed if directory is omitted.
Either way, the command will return the current working directory on success, or an empty string on failure (e.g. when you have tried to change to a non-existent directory).
Note that if you are working with scripts, the script directory is stored in the shell variable scriptDirectory. See also @ROOT and @WORK.