Re: How To Run Shell Script

Hi ,

  I Have Installed Red Hat Linux 5\(Guest O.S\) In Vmware And Host O.S Is Windows 7 .I Am Unable To Run Script File In It Is Giving Error E32: No File Name.For All Basic Commands It's Working 

Fine Like Cat ,Cmp.,etc .
I Logging As Root User And Working Under The Directory I Am Using KSH Shell .

This Are The Steps I Am Following For Creating A Script .

1). vi ( To Open Vi Editor )

2). vi filename ( vi firstprog.ksh)
#!bin\kash
date

3) !wq :frowning: Saving And Quit) When I Am Saving The Scrpit I Am Getting The Below Error E32:No File Name

Thanks&Regards

You don't need "!" - it's for calling a subshell command. Just type <ESC>:wq
You can use "!" after w or q command to force execution of these commands.

Well, use (#!/bin/sh instead of #!bin\kash):

$ vi filename

Now press these keys in vi editor:

i
#!/bin/sh
date 
<ESC>
:wq

Then in shell:

$ chmod +x filename
$ ./filename

Hi ,

   Thanks For Quick Reply ,Now File Is  Getting Save But When I Am Executing

The Script I Am Getting The Below Error

!/bin/ksh: not found [no such file or directory]

Thanks

---------- Post updated at 07:56 PM ---------- Previous update was at 07:54 PM ----------

Hi ,

   Thanks For Quick Reply ,Now File Is  Getting Save But When I Am Executing

The Script I Am Getting The Below Error

!/bin/ksh: not found [no such file or directory]

Thanks

---------- Post updated at 07:56 PM ---------- Previous update was at 07:56 PM ----------

Execute

What are you trying to execute (script content...)?