From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25781 invoked by alias); 27 Dec 2016 20:33:26 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22291 Received: (qmail 9354 invoked from network); 27 Dec 2016 20:33:26 -0000 X-Qmail-Scanner-Diagnostics: from fw.sigpipe.cz by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(213.192.55.98):SA:0(-3.1/5.0):. Processed in 1.979024 secs); 27 Dec 2016 20:33:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: neuhauser@sigpipe.cz X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at sigpipe.cz does not designate permitted sender hosts) Date: Tue, 27 Dec 2016 21:23:55 +0100 From: Roman Neuhauser To: Akihiko Hohji Cc: "zsh-users@zsh.org" Subject: Re: newbie rm --^file question Message-ID: <20161227202355.GD4330@isis.sigpipe.cz> References: <161225131004.ZM26673@torch.brasslantern.com> <8789C49A-57C0-49FA-BC1A-52DCBFBF88FB@me.com> <4D563652-4349-4AEA-B92E-D5F0F1018C59@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8:iso-8859-2" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4D563652-4349-4AEA-B92E-D5F0F1018C59@me.com> User-Agent: Mutt/1.7.1 (2016-10-04) # akhst7@me.com / 2016-12-25 18:02:16 -0500: > Got it. Putting a space between “--“ and “-“ did it. I really > appreciate your explanation of the different usage of the “--” > argument for rm. I though it was specific to zsh like “^”. "--" is a POSIX thing. XCU 12.2 Utility Syntax Guidelines: Guideline 10: The first -- argument that is not an option-argument should be accepted as a delimiter indicating the end of options. Any following arguments should be treated as operands, even if they begin with the '-' character. (http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html) XCU 1.4 Utility Description Defaults: OPTIONS: [...] Default Behavior: When this section is listed as "None.", it means that the implementation need not support any options. Standard utilities that do not accept options, but that do accept operands, shall recognize "--" as a first argument to be discarded. The requirement for recognizing "--" is because conforming applications need a way to shield their operands from any arbitrary options that the implementation may provide as an extension. For example, if the standard utility foo is listed as taking no options, and the application needed to give it a pathname with a leading , it could safely do it as: foo -- -myfile and avoid any problems with -m used as an extension. (http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap01.html#tag_17_04) -- roman