#!/bin/bash # Write a shell program to concatenate to two String given as input and display the # resultant string along with its string length. # -------------------------------------------------------------------- # This is a free shell script under GNU GPL version 2.0 or above # Copyright (C) 2005 nixCraft project. # Feedback/comment/suggestions : http://cyberciti.biz/fb/ # ------------------------------------------------------------------------- # This script is part of nixCraft shell script collection (NSSC) # Visit http://bash.cyberciti.biz/ for more information. # ------------------------------------------------------------------------- STR1=$1 STR1=$2 OUT="$1$2" if [ $# -eq 0 ] then echo "$0 string1 string2" exit 1 fi len=$(expr length $OUT) echo "Concatenate string is - $OUT" echo "String Length is - $len"
Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our email newsletter to make sure you don't miss a single tip/tricks.
- Download Script
- Email this to a friend
- Printable version
- Rss Feed
{ 0 comments… add one now }