Advertisement
tike

Lab9-q2

Nov 17th, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.17 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [[ $# -gt 0 ]]; then
  4.  
  5.     size=${#1}
  6.  
  7.     for (( i = 0; i < $size; i++ )); do
  8.         index=$(($size-$i))
  9.         result+=${1:$(($index-1)):1}
  10.     done
  11. fi
  12.  
  13. echo $result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement