On 13 August 2012 15:05, Ralph Corderoy <ra...@inputplus.co.uk> wrote:

>     $ by3() {
>     >     sed -rn '
>     >         h; s/[^147258]//g; y/147258/aaabbb/
>     >         :l; s/ab//g; s/ba//g; tl
>     >         G; s/^\n//p
>     >     ' "$@"
>     > }
>

I must have missed this conversation. I looked at your script and thought
"divisibke by 3? That's true if sum of digits is divisible by three, isn't
it?"  Then saw that that is essentially what your sed script is doing, only
without adding or dividing :-)




-- 
best regards,

Victor Churchill,
Bournemouth
--
Next meeting:  Dorchester, Tuesday 2012-09-04 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread on mailing list:  mailto:dorset@mailman.lug.org.uk
How to Report Bugs Effectively:  http://goo.gl/4Xue

Reply via email to