## Get the last n characters of a string in Bash

Posted: 7th June 2012 by Tim in Bash, Linux
Tags: , , , , , , , ,

If you want to get the last n characters of a string in bash, you can simply mix bash substrings – \${string:offset[:length]} – with bash string lengths – \${#string}. For example: str=”abcde” n=3 echo \${str:\${#str} – \$n} will print: cde

## LaTeX length units

Posted: 26th May 2010 by Tim in LaTeX
Tags: , , , , , , , , , , ,

There are many configurations and commands in LaTeX which require lengths to be set. The following length units can be used: in – imperial inch pt – point (1/72 of an inch) cm – metric centimeter mm – metric millimeter em – width of a capital “M” in the current font settings ex – width […]