Advertisement
Guest User

Reverse the String using Shell Programming-tips inside

a guest
Jun 12th, 2012
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.23 KB | None | 0 0
  1. clear
  2. echo “Enter the string:-”
  3. Read str
  4. len =  `  $str  |  wc-w  `
  5. while [  $len  –gt  0  ]
  6. do
  7. temp = ` $str | wt-c $ len `
  8. rev= `  $rev $temp  `
  9. len=  ` expr $len-1 `
  10. done
  11. echo “The reversed string is :-   $rev
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement