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

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

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

php - What is the best way to get the URL of a 404'd file after redirect? -