Bash: Split One String Into Multiple Variables

Split “abc-123” into two variables by – Using awk Using cut Using IFS and read Using Shell Parameter Expansion/Substitution See: https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html https://tldp.org/LDP/abs/html/parameter-substitution.html ${var%Pattern} Remove from $var the shortest part of Pattern that matches the back end (right) of $var. ${var%%Pattern} Remove from $var the longest part of Pattern that matches the back end (right) of $var. ${var#Pattern} Remove from $var the shortest part of $Pattern that matches the front end (left) of $var. ${var##Pattern} Remove from $var the longest part of $Pattern that matches the front end (left) of $var.