From owner-freebsd-questions@FreeBSD.ORG Tue Dec 2 09:51:07 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58CC0106567C for ; Tue, 2 Dec 2008 09:51:07 +0000 (UTC) (envelope-from talk@holon.urwis.cc) Received: from holon.urwis.cc (urwis.cc [82.177.38.81]) by mx1.freebsd.org (Postfix) with ESMTP id 208448FC1B for ; Tue, 2 Dec 2008 09:51:07 +0000 (UTC) (envelope-from talk@holon.urwis.cc) Received: from [82.177.38.80] (artax.pwsz.elblag.pl [82.177.38.80]) (Authenticated sender: talk) by holon.urwis.cc (Postfix) with ESMTP id 93C1632B222 for ; Tue, 2 Dec 2008 10:33:05 +0100 (CET) Message-ID: <493500C0.3030202@holon.urwis.cc> Date: Tue, 02 Dec 2008 10:32:48 +0100 From: Adam Zaleski User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Subject: Problem with permissions and vi X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2008 09:51:07 -0000 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@unixlab ~]$ echo "some text" > some_file.txt [netlest@unixlab ~]$ chmod 000 some_file.txt [netlest@unixlab ~]$ ls -l some_file.txt ---------- 1 netlest staff 10 2 gru 09:55 some_file.txt [netlest@unixlab ~]$ echo "some other text" >> some_file.txt -bash: some_file.txt: Permission denied [netlest@unixlab ~]$ cat some_file.txt cat: some_file.txt: Permission denied [netlest@unixlab ~]$ chmod 600 some_file.txt [netlest@unixlab ~]$ cat some_file.txt some text [netlest@unixlab ~]$ Everythink was ok... And now.. another one [netlest@unixlab ~]$ echo "some text" > some_file.txt [netlest@unixlab ~]$ chmod 000 some_file.txt [netlest@unixlab ~]$ ls -l some_file.txt ---------- 1 netlest staff 10 2 gru 09:55 some_file.txt [netlest@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@unixlab ~]$ ls -l some_file.txt ---------- 1 netlest staff 33 2 gru 10:23 some_file.txt [netlest@unixlab ~/t]$ cat some_file.txt cat: some_file.txt: Permission denied [netlest@unixlab ~/t]$ chmod 600 some_file.txt [netlest@unixlab ~/t]$ cat some_file.txt aasda sd a some texs asdas d as [netlest@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???