Your first line (#!/bin/sh) should be telling the computer to execute the remainder of the script as if it were in the Bourne shell (sh). Most Linux distributions have a link from sh to bash (Bourne Again Shell). (This is why I had assumed that you were using bash.) If you want to run it in Korn, it should read
I don't do much in Korn (ok, nothing actually), but have tried the same commands, and it should work. The error that you are getting makes it look like you are trying to run something called "wrongcommand" from the command line.
Did you remember to change the permissions on your script so that it can be run? If your script is say age.sh, then you would want to add execute permissions to it.
Then run the script.