Last active
March 14, 2018 14:53
-
-
Save seppestas/bd89be591be694e683b0cf2bb8aeb634 to your computer and use it in GitHub Desktop.
Get the last $n characters of a variable $foo in a posix-compatible shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
${foo:$((${#foo}-$n))} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment