From owner-freebsd-current Tue Nov 12 17:13:25 2002 Delivered-To: freebsd-current@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id 6B7E937B401; Tue, 12 Nov 2002 17:13:24 -0800 (PST) Date: Tue, 12 Nov 2002 17:13:24 -0800 From: Juli Mallett To: Nate Lawson Cc: current@freebsd.org Subject: Re: sleep(1) behavior Message-ID: <20021112171324.A6608@FreeBSD.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from nate@root.org on Tue, Nov 12, 2002 at 04:37:41PM -0800 Organisation: The FreeBSD Project X-Alternate-Addresses: , , , , X-Towel: Yes X-LiveJournal: flata, jmallett X-Negacore: Yes Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * De: Nate Lawson [ Data: 2002-11-12 ] [ Subjecte: sleep(1) behavior ] > I've found an interesting contradiction and was wondering what behavior > sleep should have. It checks for a command line flag with getopt(3) and > exits with usage() if it finds one. However, it then checks for a '-' or > '+' sign. If negative, it behaves like "sleep 0" and exits > immediately. This case can almost never be triggered since the > getopt(3) will catch the minus sign, even if a digit follows it. > > Current behavior: > sleep 0 = exits immediately > sleep -1 = exits with usage() > sleep -f = exits with usage() > sleep " -1" = exits immediately and is the only way I know to trigger > the negative case. What about: sleep -- -1 ? -- Juli Mallett OpenDarwin, Mono, FreeBSD Developer. FreeBSD on MIPS-Anything on FreeBSD. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message