I am trying to get the lines of held emails with grep or egrep that contain an exclamation point / bang
root@server:~# mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
0528561D88 878 Wed Feb 1 21:46:12 [email protected]
[email protected]
0D14161E2B 657 Wed Feb x xx:47:01 [email protected]
[email protected]
0798C61E0F 657 Wed Feb x xx:45:02 [email protected]
[email protected]
14AF361E2F! 657 Wed Feb x xx:48:01 [email protected]
[email protected]
next
root@server:~# mailq |grep "[[:alnum:]]\!"
3658861E66! 657 Wed Feb x xx:48:01 [email protected]
root@server:~# mailq |grep "^[[:alnum:]]\!"
root@server:~#
The first grep works provides the expected result, but the second one does not work at all
Any thoughts?
[[:alnum:]]
matches precisely one character. How many characters are there between the beginning of the line and the bang?3658861E66! 657 Wed Feb x xx:48:01 [email protected]