I have a file 'imei_01.txt' having the following contents:
$ cat imei_01.txt
a123456
bbr22135
yet223
where I want to check whether the expression 'first single alphabet followed by 6 digits' is present in the file (here it is the first record 'a123456')
I am using the following script, but it does not give output
sed '/[0-9]\{6\}/p' imei_01.txt
awk '/[a-z][0-9]\{6\}/ {print}' imei_01.txt
% ./s1
(Versions displayed with local utility "version")
Linux 2.6.11-x1
GNU bash 2.05b.0
GNU Awk 3.1.4
Data file data1:
a123456
bbr22135
yet223
Not at beginning of line: a123456
Results, enabling interval expressions:
a123456
Not at beginning of line: a123456
Results, enabling interval expressions, simplified:
a123456
Not at beginning of line: a123456
Results, enabling interval expressions, simplified, anchors:
a123456