Paths

A user or script can request access to a file using an absolute file specification or a relative file specification. An absolute file specification provides the directory and subdirectory hierarchy path to locate the target file. A relative file specification locates the target file relative to the current working directory. The following example starts by accessing a file using a relative file specification. After changing the default directory, the relative file spec no longer works, but an absolute file spec will always work no matter where your directory default is currently.

The following example successfully uses a relative file specification, changes the default directory, and then fails when attempting to re-execute the same command ...

Get Korn Shell Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.