count specific word in line in bash -


I have the variable like "1,2,3,4"

I should count

What you want:

  echo "1,2,3" | Tr -cd ',' | Wc -c  

Comments

Popular posts from this blog

.net - C# List<T>.Find(x=>x.Rectangle.Contains(Point)) FAIL -

c++ - QtQuick: QQmlApplicationEngine failed to load component qrc:/main.qml:23 Invalid attached object assignment -

iphone - Smoothing a rounded stroke in Core Graphics -