Unix Shell - Using dash and doubledash to end command line switches

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > December 2007 > Using dash and doubledash to end command line switches





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Using dash and doubledash to end command line switches
Mark Hobley

2007-12-09, 7:21 pm

Stephane Chazelas <stephane_chazelas@yahoo.fr> wrote:

> GNU and POSIX and every Unix. "-" states the "end of arguments"


Ok. That sound a bit nicer than the doubledash I was told about. Is this in
the Single Unix Specification somewhere? Which section am I looking at to find
this?

Mark.

--
Mark Hobley
393 Quinton Road West
QUINTON
Birmingham
B32 1QE

Email: markhobley at hotpop dot donottypethisbit com

http://markhobley.yi.org/

Stephane Chazelas

2007-12-10, 7:32 am

On Mon, 10 Dec 2007 01:08:36 GMT, Mark Hobley wrote:
> Stephane Chazelas <stephane_chazelas@yahoo.fr> wrote:
>
>
> Ok. That sound a bit nicer than the doubledash I was told about. Is this in
> the Single Unix Specification somewhere? Which section am I looking at to find
> this?

[...]

No,

it's really the "--" that ends the options. "-" refers to
stdin/stdout. In the SUS, AFAICS, only sh is meant to accept "-"
to mark the end of options (in addition to "--"), and that's
probably for backward compatibility with the Bourne shell
because for instance of the spread out usage of:

#! /bin/sh -

--
Stephane
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com