Artificial intelligent assistant

Is there a way to condense ../.. parts of a path out programmatically? Say for example I have these types of paths to files in a script: /path/to/some/file/../../file1.txt Is there a command I can call such as `readlink` that will convert this path to its actual physical form: /path/to/file1.txt

Ah, asked too quickly. On Linux, the answer is to use `readlink` with the `-m` switch:


$ readlink -m /home/saml/web/../web_login_form_examples/basic-php-parsing.zip
/home/saml/web_login_form_examples/basic-php-parsing.zip


_readlink man page_


-m, --canonicalize-missing
canonicalize by following every symlink in every component of the
given name recursively, without requirements on components existence

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 23ffb63bc1acf2ad442ab88a1b09818b