From owner-freebsd-bugs@FreeBSD.ORG Wed Apr 25 19:57:08 2012 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C14F1106566B; Wed, 25 Apr 2012 19:57:08 +0000 (UTC) (envelope-from kes-kes@yandex.ru) Received: from forward19.mail.yandex.net (forward19.mail.yandex.net [IPv6:2a02:6b8:0:1402::4]) by mx1.freebsd.org (Postfix) with ESMTP id C90CF8FC0C; Wed, 25 Apr 2012 19:57:07 +0000 (UTC) Received: from smtp16.mail.yandex.net (smtp16.mail.yandex.net [95.108.252.16]) by forward19.mail.yandex.net (Yandex) with ESMTP id 51B861121B9E; Wed, 25 Apr 2012 23:57:06 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1335383826; bh=yAnqFmGiFKaZRl9UBOQa2EqgaDoxEg3wpMXea06KtIs=; h=Date:From:Reply-To:Message-ID:To:CC:Subject:In-Reply-To: References:MIME-Version:Content-Type:Content-Transfer-Encoding; b=rQzNIGrkTy9zdVtNQ/YWqQBH07qq2lYxvGaEY2+FXXhSD/bPq+pKI93Ng53m8+BJi g/QjapXJP3MiBZOdr1BRO0oF46JJ6TtzTgJkA9v1Ha117NHn3etG0BrAjsb8sZJRcv Nr+3nvKIjNaKbcQcmDIV+46+/Mx8KRxhF6lxgxoo= Received: from smtp16.mail.yandex.net (localhost [127.0.0.1]) by smtp16.mail.yandex.net (Yandex) with ESMTP id 31E6D6A0643; Wed, 25 Apr 2012 23:57:06 +0400 (MSK) Received: from unknown (unknown [77.93.52.20]) by smtp16.mail.yandex.net (nwsmtp/Yandex) with ESMTP id v22eO4Gb-v52420oR; Wed, 25 Apr 2012 23:57:05 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1335383826; bh=yAnqFmGiFKaZRl9UBOQa2EqgaDoxEg3wpMXea06KtIs=; h=Date:From:X-Mailer:Reply-To:Organization:X-Priority:Message-ID:To: CC:Subject:In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; b=G9oEfC9q9CoMEOm1zDX9YTh5Ug3157/3CCmUrPVMYdH2IdKpPxyuUCqhilT+7JYyE 6K3Z0PQ9D0LH3HNTf9LW2YFT1z6dd+7MjxDr+eqz6B4lt8Y3mk90Kr5rLSWPpeUPfP yMEsoFPpIDZ4UnkD16xWCH9IQ+XlE7ZmVmicXXxY= Date: Wed, 25 Apr 2012 22:57:02 +0300 From: Eugen Konkov X-Mailer: The Bat! (v4.0.24) Professional Organization: ISP FreeLine X-Priority: 3 (Normal) Message-ID: <1961834512.20120425225702@yandex.ru> To: Gary Palmer In-Reply-To: <201204251830.q3PIUED5005708@freefall.freebsd.org> References: <201204251830.q3PIUED5005708@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 8bit Cc: freebsd-bugs@FreeBSD.org Subject: Re[2]: bin/167288: mv can not copy files with '-' sign as first simbol X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eugen Konkov List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2012 19:57:08 -0000 Здравствуйте, Gary. Вы писали 25 апреля 2012 г., 21:30:14: GP> The following reply was made to PR bin/167288; it has been noted by GNATS. GP> From: Gary Palmer GP> To: Eugen Konkov GP> Cc: freebsd-gnats-submit@FreeBSD.org GP> Subject: Re: bin/167288: mv can not copy files with '-' sign as first simbol GP> Date: Wed, 25 Apr 2012 14:25:45 -0400 GP> On Wed, Apr 25, 2012 at 10:48:23AM +0000, Eugen Konkov wrote: >> >> >Number: 167288 >> >Category: bin >> >Synopsis: mv can not copy files with '-' sign as first simbol >> >Confidential: no >> >Severity: non-critical >> >Priority: low >> >Responsible: freebsd-bugs >> >State: open >> >Quarter: >> >Keywords: >> >Date-Required: >> >Class: sw-bug >> >Submitter-Id: current-users >> >Arrival-Date: Wed Apr 25 10:50:09 UTC 2012 >> >Closed-Date: >> >Last-Modified: >> >Originator: Eugen Konkov >> >Release: 10.0-CURRENT >> >Organization: >> ISP FreeLine >> >Environment: >> uname -a >> FreeBSD fastvpn.in.freeline.in.ua 10.0-CURRENT FreeBSD 10.0-CURRENT #2: Fri Dec 16 18:38:54 EET 2011 kes@fastvpn.in.freeline.in.ua:/usr/obj/usr/src/sys/KES_KERN_v9 i386 >> >> >Description: >> If I use glob symbol, then special symbols in file names must not be counted as special symbols >> >How-To-Repeat: >> : > -1.wav >> mv * /some/dir >> mv: illegal option -- 1 >> usage: mv [-f | -i | -n] [-v] source target >> mv [-f | -i | -n] [-v] source ... directory GP> GP> GP> Standard command line protocol says that you should use -- to GP> mark the end of command line options in this situation, so that any GP> - that comes after is not processed as an option GP> GP> e.g. GP> GP> mv -- * /some/dir GP> GP> Since the glob is done in the shell prior to being passed to mv as GP> arguments, there is no way for 'mv' to know any differently. GP> GP> Gary glob work on file names. so when shell expands glob it must expand it in right way: file names must not became options for programms Ok, if '--' sign is a special and mark the end of command line options why: echo -- hello echoing '-- hello' instead of 'hello'?? this also does not work: sox -c 2 -- * -c 1 ./../* -r 8000 result.wav because '-c' will be counted as 'file name' and what behaviour will be, if file name has ' '? For example: Saving all file names in directory to file: echo * > /some/file as a result I get 'aa aa bb bb' Which files are in current directory? 1) 'aa aa', 'bb bb' 2) 'aa' 'bb' 'aa bb' 3) your sugggestion PS. ugly behaviour to my mind or unclean spec/docs maybe -- С уважением, Eugen mailto:kes-kes@yandex.ru