Script to extract numbers from gecos field

welcome to the community, @JCM !
We usually ask the OPs to post their own attempt(s) at solving their issue, but I'm going to bend the rules a bit, and get you started:

$ echo 'joanjett0123456' | sed 's/[0-9]//g'
joanjett

P.S. going forward.... please use the markdown tags when posting data/code samples - it's the rule here.

2 Likes