Code In Tech - The Ultimate World of Computer Technology

Saturday 12 May 2012

Shell script to concate two strings and find the length of resulting string.

SOURCE CODE:

echo “Enter 1st string:”
read s1
echo “ Enter 2nd string”
read s2

s=$s1$s2
l =`expr length $s`
 echo “string:” $s “ length :” $l
OUTPUT:

Enter 1st string:
123
Enter 2nd string:
456
string:123456
length:6
 
 

No comments :

Post a Comment