shell Scripts Instances

Extract substring from string I want to extract MM-ABC-19-97-12-12 from 559268 clusterA jobB usersmith R 0:12 1 20-00:00:00 gpu:1 MM-ABC-19-97-12-12 solution (surpose the string is stored in file output.txt): cat output.txt | grep -P 'MM-ABC-19-97-12-12' -o here -P means Perl-style, and -o means match only. If we want to match arbitary number after ‘MM-ABC’, use […]