dirname

Returns the directory name from a path name.

dirname <strvar> <path>

Remarks

Given a <path> pathname, this macro will delete any suffix beginning with the last slash('/') character and return the result into the <strvar> variable name.
The pathname will need not be existed.

Example

dirname dir 'c:\teraterm\test.txt'
; dir = "c:\teraterm"
dirname dir 'c:\teraterm\'
; dir = "c:"
dirname dir 'c:\teraterm'
; dir = "c:"

See also