On Fri, 19 Jan 2024, Thomas Schmitt wrote: > Hi, > > Greg Wooledge wrote: >> unicorn:~$ string="apple,banana,cherry,date" >> unicorn:~$ commas=${string//[!,]/} >> unicorn:~$ echo "${#commas}" >> 3 > > Always astonishing what a good bashism can do. > > >> But at this point, we have to wonder what the *actual* goal is.
to exclude phrases with commas for seperate examination > > Up to now we only know about the astonishment of fxkl4...@protonmail.com > that grep -c does not count characters. i DID know that that brain cell was offline at the moment it needed a reminder to refresh the connection > > For a more complicated use case i would write a little C program where > i'd be in control of every single bit of throughput. > (Ok, C causes scars on the programmer's self esteem. But what does not > kill me makes me just stronger. I'm a vim user.) vi is the only way to go i programmed c on hp/ux for 20+ years had a room full of k200's that was a lifetime ago