How to give permissions to an open file in vi editor?

Hi all,

I have a shell script that i started editing, only in the midst of which i tried to save the changes i found that the file wasnt been provided with write/execute permissions.

I later have redone the changes and saved the file-

Just curious to know if there was any command wherein i could have imparted chmod 777 permissions to an open file in Vi? :confused:

Thanks

Pankajakshan

:! chmod 777 yourfile

If you are the owner of the file and lack write permissions, you can force the saving of file in vi as:

:w!

or to write and quite with forced saving of file:

:wq!

Thanks

HI,
This Should Work!!!!!!!!!!!!!!!!

ESC :!chmod 777 %

where %-> represents the current file

Cheers,
aajan

Hey
chmod 777 then your file should work !!!!!
Dy