See the expr(1) man page
Code:
$ text=ThisIsMyDumbTextLine
$ expr $text : '\(.....\)'
ThisI
$ expr $text : '.*\(.....\)$'
tLine
$ expr $text : '.*'
20
The Midstring function:
Code:
$ text='1234567890'
$ expr $text : '.\{4\}\(.\{5\}\)'
56789.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Last edited by J65nko; 4th September 2008 at 10:19 PM.
Reason: Midstring equivalent added
|