Aardvark Shell Utils is a handy package containing three utilities that are specifically designed to assist with writing shell scripts.
The collection includes the following three utilities:
- realpath: This utility is an implementation of the realpath function that returns the canonicalized absolute pathname of an input path. With this, you can generate an absolute pathname with all symlinks resolved and all “.” and “..” characters removed. This utility is particularly useful as many commands do not work well with relative paths or paths containing symlinks, and it can be used in a sequence of piped commands or with a command line argument, which makes it friendly for shell script authors and interactive shell users. For more information, consult the included manpage in the man/ directory. Please note that you will need a system with a realpath function, which is standard ANSI C.
- filebase: Filebase returns the base portion of a filename, which means that it returns the filename with its extension (e.g. .txt) removed. It works by returning everything that precedes the last period in the input string, and the period itself is not returned.
- fileext: Fileext returns the extension portion of a filename (e.g. txt). It works by returning everything that follows the last period in the input string, and the period itself is not returned.
Overall, the Aardvark Shell Utils package is a helpful and user-friendly collection of utilities for anyone working with shell scripts or from the shell command line. Each utility performs a specific function that can be used in a sequence of piped commands or with a command line argument, and they all come with their own man pages to provide additional information.
Version 1.0: N/A