Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » Homework HelpRSS Feeds

Program to count length of user input string

Posted By: Adalbert Fischer     Category: Unix / Linux / Ubuntu     Views: 8743

Program to count length of user input string

Code for Program to count length of user input string in Unix / Linux / Ubuntu

echo "Enter string "
read str
len=`echo $str | wc -c`
if [ $len -le 10 ]
then
    echo "LEss then 10"else
    echo "More than 10"
fi


echo "Length of string is " $len
  
Share: 

 
 

Didn't find what you were looking for? Find more on Program to count length of user input string Or get search suggestion and latest updates.

Adalbert Fischer
Adalbert Fischer author of Program to count length of user input string is from Frankfurt, Germany.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!