[HPADM] Scripting (counting number of times something shows up in a var)

From: Vance_Brasher@dril-quip.com
Date: Wed Sep 25 2002 - 16:16:03 EDT


Guys, can anyone think of a way in a korn shell to do the following.

I have a variable called TST.

TST="/test/test/test"

I need to be able to return the number of / marks in it. Any ideas on a
quick/easy way to do this?

Regards,

Vance.

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:20 EDT