I want to grep 'run' numbers in some files e.g.
files/run3/testlog
files/run14/testlog
files/run28/testlog
I have the following code:
for f in $(find . -name testlog)
do
echo $(pwd) | egrep -o run[0-9]{*}
done
I want my code to output:
run3
run14
run28
However I am not getting any output.
I think the problem are the curly brackets around *, just try egrep -o run[0-9]*
.
If you don't want to match "run", try egrep -o run[0-9]+
.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments