Problem with permissions and vi
Adam Zaleski
talk at holon.urwis.cc
Tue Dec 2 01:51:07 PST 2008
Hello,
I have a problem setting up some permissions to file
and editing this file with vi.. I have two different
examples to show you what I mean... First one:
[netlest at unixlab ~]$ echo "some text" > some_file.txt
[netlest at unixlab ~]$ chmod 000 some_file.txt
[netlest at unixlab ~]$ ls -l some_file.txt
---------- 1 netlest staff 10 2 gru 09:55 some_file.txt
[netlest at unixlab ~]$ echo "some other text" >> some_file.txt
-bash: some_file.txt: Permission denied
[netlest at unixlab ~]$ cat some_file.txt
cat: some_file.txt: Permission denied
[netlest at unixlab ~]$ chmod 600 some_file.txt
[netlest at unixlab ~]$ cat some_file.txt
some text
[netlest at unixlab ~]$
Everythink was ok...
And now.. another one
[netlest at unixlab ~]$ echo "some text" > some_file.txt
[netlest at unixlab ~]$ chmod 000 some_file.txt
[netlest at unixlab ~]$ ls -l some_file.txt
---------- 1 netlest staff 10 2 gru 09:55 some_file.txt
[netlest at unixlab ~]$ vi some_file.txt
Now ignore warnings with permission denied showing in vim..
and put some text into the some_file.txt and then :wq!
[netlest at unixlab ~]$ ls -l some_file.txt
---------- 1 netlest staff 33 2 gru 10:23 some_file.txt
[netlest at unixlab ~/t]$ cat some_file.txt
cat: some_file.txt: Permission denied
[netlest at unixlab ~/t]$ chmod 600 some_file.txt
[netlest at unixlab ~/t]$ cat some_file.txt
aasda
sd
a some texs
asdas
d
as
[netlest at unixlab ~/t]$
Why I am able to put some text into some_file.txt with
chmod 000 using vi editor and why i can not do the same
using echo???
More information about the freebsd-questions
mailing list