Shell Script To Concatenate Two String Given as Input including its length

in Categories Academic, Decision Making, String Management last updated October 20, 2008

Share this on:

5 comment

  1. get rid of the ` in your expr

    for instance, if you wanted to get the length of s3 in len, you;d do

    len= expr length $s3
    echo $len

  2. Why doesn’t this work?????

    echo “Enter first string:”
    read s1
    echo “Enter second string:”
    read s2
    len=echo $s3 | wc -c
    len=expr $len - 1
    echo “Concatenated string is $s3 of length $len “

  3. what is length in the expression “len=$(expr length $OUT)”
    did you write that function or SHELL has that function?

    Have a question? Post it on our forum!