in reply to extracting variables from regex
echo 66.218.71.112 | perl -pe 's/([\d]{1,3}(?:\.|$))/sprintf("%X",$1)/ge'
42DA4770
And though I don't think these are the best solutions in the world, they might make you dig into perlrun (I sure had to to come up with these!)
42DA4770echo 66.218.71.112 | perl -F'\.' -ane 'printf "%X%X%X%x\n",@F'
echo 66.218.71.112 | perl -0056 -ane 'printf "%X",$_'
42DA4770
blyman
setenv EXINIT 'set noai ts=2'
|
|---|