Difference between revisions of "Programmer Guide/Command Reference/PWD"

From STX Wiki
Jump to navigation Jump to search
Line 6: Line 6:
 
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).
 
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]].
+
Note that if you are working with scripts, the script directory is stored in the shell variable <var>scriptDirectory</var>. See also [[Programmer_Guide/General_Descriptions/Global_Environment_(first_character_%3D_@)#.40ROOT|@ROOT]] and [[Programmer_Guide/General_Descriptions/Global_Environment_(first_character_%3D_@)#.40WORK|@WORK]].

Revision as of 18:50, 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.