direction the "tick" is slanted).
A Better Way
Although the basename and dirname commands embody the... stdin, stdout, and stderr.
${parameter:+word}
Alternative value. ${TMP:+"/mnt/tmp"}
use /mnt/tmp ... the string manipulation facilities of awk as an alternative to using its built-in operations.
Example 9-11. Alternate ways of extracting substrings
#!/bin/bash