Reverse a String

Another “classic” programming interview question. The Question Given a random string as input, write a script which reverses it character-for-character. The Answer First off, I feel I should mention that the following is cheating! $ echo “This is a sentence” | rev ecnetnes a si sihT The equivalent BASH script: … Continue reading