12.Write a shell to reverse a string

 #!/bin/bash

read -p "Enter a string: " input

# Reverse the string

reversed=$(echo "$input" | rev)

echo "Reversed string: $reversed"


Comments

Popular posts from this blog

3.Write a shell script to print below pattern 1 1 2 1 1 3 3 1