Advertisement
Guest User

Reverse the String using Shell Programming-tips inside

a guest
Jun 12th, 2012
290
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data Copied
Advertisement