https://www.eduonix.com/courses/system-programming/learn-linux-from-scratch
https://www.eduonix.com/blog/category/shell-scripting/page/2/
use strict; my $string = "userid_ci_backport_23220998_11.1.2.3.0oiibp"; if( $string =~ m/^[a-z]+_[a-z]+_[a-z]+_([0-9]+)_.+/ ){ print "$1\n"; }
output :
23220998
# Returns the jars containing the missing class.
$ for i in `find $OIM_HOME -name '*.jar'`; do unzip -t $i | grep com/thortech/xl/util/tcUtilityFactoryInternal && echo $i; done 2>/dev/null
# echo after a grep search
$ echo "$(grep -R $id) found in the file"
# show several surrounding lines
grep -B 3 -A 2 foo README.txt
If you want the same number of lines before and after you can use -C num.
Text you want to be red
Your text here
for x in 0 1 2 3 4 5 6 7 8 9 do for y in 0 1 2 3 4 5 6 7 8 9 do echo "$x$y" done done