Prev: crontab environment problem
Next: print head and tail
From: CSM 'illovae' Seldon on 8 May 2010 10:28 rvaede <rvaedex23(a)gmail.com> writes: > How can I extract the number from this line? > > <process_id>25752</process_id> > > I want to extract "25752" > > regards You can use too GNU Sed : $ echo "<process_id>25753</process_id>" | sed 's/<[^>]*>//g' -- illovae. -- CSM 'illovae' Seldon druuna (at) dud-t.org | Member of dud-t group gopher://12.dud-t.org | ----------------------------------------------------{,_,"> | ---- Sic transit hominis regnum. Gens nova omnipoten. -----+
From: Sidney Lambe on 9 May 2010 01:13 On comp.unix.shell, rvaede <rvaedex23(a)gmail.com> wrote: > How can I extract the number from this line? > ><process_id>25752</process_id> > > I want to extract "25752" > > regards echo "<process_id>25752</process_id>" | sed -n 's|\(<[^>]*>\)\(.*\)\(<[^>]*>\)|\2|p' Sid
From: andrew on 9 May 2010 02:03
On 2010-05-06, rvaede <rvaedex23(a)gmail.com> wrote: > How can I extract the number from this line? > ><process_id>25752</process_id> > > I want to extract "25752" A sed variant: echo "<process_id>25752</process_id>" | sed "s/[^0-9]//g" Andrew -- Do you think that's air you're breathing? |