after typing the script in vi editor use :wq for saving the file (in command mode) then make the file executable chmod +x filename execute using ksh ksh filename Happy scripting