Regex-Style Path Extraction Tricks in Linux Shell
To extract parts of a path in Shell scripts, use ${variable#...}, ${variable##...}, ${variable%...}, and ${variable%%...} pattern matching to quickly strip directory components or extensions.
To extract parts of a path in Shell scripts, use ${variable#...}, ${variable##...}, ${variable%...}, and ${variable%%...} pattern matching to quickly strip directory components or extensions.