Search results
For example most programs look like this: relaxer -dtd toc.xml toc_gr.xml toc_jp.xml. Whereas some programs look like this: xmllint --valid toc.xml --noout. What's the reason that some requires two dashes instead of one? Doesn't it make sense for everyone to stick to one standard (i.e. a single dash will do). linux. windows. command-line. unix.
The first solo dash means 'write to stdout'; the second means 'read file names from stdin'. Some programs use other conventions — that is, options not preceded by a dash. Many of these are from the oldest days of Unix. For example, 'tar' and 'ar' both accept options without a dash, so: tar cvzf /tmp/somefile.tgz some/directory
The most common is GNU getopt style, with one dash for short options and two dashes for long options. Initially, Unix programs took single-letter options preceded by a single dash and optionally bundled: ls -laF. ls -l -a -F. The two commands above are equal.
Dec 13, 2023 · short options with single dash vs long options with double dash. short options can be combined into a single argument; for example: ls -lrt #instead of ls -l -r -t If we allow long options with single dash, it causes ambiguity. To resolve this we use double dash for long options.
May 7, 2022 · Fairly quickly, the developers of Unix found that many programs would be more useful if the user could choose between minor variations of function. For example, the sort program could provide the option to order input lines without consideration to upper and lower case of text. The command line option was added.
Jul 7, 2014 · dd is an example of a POSIX standard utility which doesn't have any hyphenated options at all. find is the classic example of a POSIX standard utility that has word options with single hyphens - nearly all of find's options are multiple characters long. ps supports multiple option styles:
People also ask
What are some examples of Unix programs without a dash?
What does a solo dash mean in Unix?
Should a program have a dash?
Why do we use a double dash for long options?
What are the different types of options in Linux?
What does -H -a mean in Unix?
Lynx, for example, uses multi-character options without allowing abbreviations. Not all programs used getopt : tar and ps did not. Nor did rcs (or sccs ), as you can see by noting where the dash was optional, and option values were optional.