Somewhat new to bash.
I've experimented with parameter expansions, grep, sed and echo to solve this problem, but cannot quite work it out.
I'm trying to extract a certain pattern from $PWD in a bash script.
Let's say there could be a variety of full paths:
/home/files/tmp8
/home/tmp28/essential
/home/tmp2/essential/log
/home/files/tmp10/executables
/tmp8/files/whatever/etc
In every instance, I want to extract any string that contains "tmp" followed by 1 or more integers.
So, in each instance in which $PWD is processed, it will return "tmp8", "tmp28", "tmp2" etc.
Explanations for how the functions/operators work in regards to solving this issue would also be greatly appreciated.