I have following string
â â³ eGalax Inc. USB TouchController id=9 [slave pointer (2)]
â â³ eGalax Inc. USB TouchController id=10 [slave pointer (2)]
and would like to get the list of id ? How this can be done using sed or something else ?
I pasted the contents of your example into a file named
so.txt.Explanation:
cat so.txtwill print the contents of the file tostdout.awk '{ print $7 }'will print the seventh column, i.e. the one containingid=ncut -f2 -d"="will cut the output of step #2 using=as the delimiter and get the second column (-f2)If you’d rather get
id=also, then: