Shell Script Not Running

Hi ,

I Am Getting The Following Error When Executing Shell Script E32 :No File This Are Steps I Have Done For Running The .

1) VI Command So It Opened Vi Editor

2) VI FILENAME.KSH In The File I Have Written A Program Like Below
#!/bin/ksh
echo date

3):WQ For Quit And Save. Hear I Am Getting The Error As E32:No File Name.

I Am Running Red Hat Linux 5.0 In VMWARE With Koren Shell .

Thanks&Regards

By default you script "FILENAME.KSH" might not be having executable permission.
Run this command.

chmod 777 FILENAME.KSH

Then run the script.

This is vi message. Very strange, if you are really execute it as "vi filename.ksh".
Try in vi

:w filename.ksh
:q

Hi ,

 Clarifying My Question In The VI Editor I Have Written A File Please Correct If My Procedure If Wring For Executing .

STEP 1. Opened VI Editor
STEP 2. VI FileName.KSH (eg :Test.ksh) In The Text.ksh I Have Return A Sample
Script As Below
#!/bin/ksh
echo date
STEP 3: Esc ---->:wq! Hear I Am Getting A Error As E32 :No File Name .

Thanks&Regards

---------- Post updated at 01:25 PM ---------- Previous update was at 01:16 PM ----------

The First Thing The Script Is Its Not Getting Saved
When I Issued A Command :wq! To save And Quit I Am Getting The Below
E32:No File Name

I suspect UR use of upper case has cause the error try lower case.
Possibly U reentered vi and did not see a warning and U could have a .filnam.txt.swp file existing.
In step 3 if U actually typed what U show after "3:" then that is the problem. To save a file or an edit of a file with vi use ":wq" in lower case.

When you are in vi in command mode, type :

exclamation mark twice (only one should appear) then "date"
Enter this in command mode:
!!date
Only one "!" willl be displayed so what you will see is :
!date

Press<Enter>
The current date will be inserted in the opened file, at the the place where your cursor is

To make the result of a command be printed into your vi opened file, use bang (exclamation mark)