With --version it's the long option equivalent of (typically) -v, or -V. Both sets of such arguments are described in the info / man page for the program, if available.
On its own, -- usually means "end of arguments", meaning that any "arguments" that follow it are not treated as arguments by the program.
Thanks for the quick response Scott. From the output and what your saying in the example above, the argument is basically saying run uvscan but only for the version information, do not actually fully run uvscan? The -- means disregard the prior?
Yes, show only the version information, then exit.
--usually means ignore all of the following options. I say usually because it depends on the program. Most common Unix commands will honour that, but third party program and applications may not.
-- and long options (i.e. those options beginning with --) are not related in the slightest.
Originally, UNIX commands had only one-character options, some of which could take an argument. The options were introduced with a dash ("-") to distinguish them from arguments, but it is possible to group such options behind a single dash. The following lines are equivalent:
The rules for interpreting the command line are implemented in a system call, getopts(), which every program should use. There is also a command getopts, which can be used to build shell scripts using the same mechanism and rule set. See man getopts for details.
(Corollary: the difference between an "option" and an "argument" is that the option changes the way the invoked command works, while arguments are input data. This is why the dash is necessary. command -abc abc will invoke option a, option b and option c, then pass "abc" as data to the invoked command.)
Now, the GNU initiative formed and they thought that one-character-options are quite unintuitive. They sought to improve on this and came up with the "long options". These are real words (like "--version", instead of "-v") and the idea was that they are easier to remember and more intuitive to understand.
Alas, this led to a problem: long options could not be introduced by a single dash like the classical options, because there would be no way to distinguish between grouped options and long options. Consider this:
should this be interpreted as invoke command with options "f", "i", "l" and "e" or should it mean invoke command with long option "file"?
Therefore the double-dash were created, which introduces long options. Single long options, because they cannot be grouped like the traditional options they were aimed to replace. So, the ambiguity above would be alleviated by:
The first means 4 single-char options, "f", "i", "l" and "e" and the second means one single long option.
Most GNU-commands (and third-party products adopting their idea) understand both variants and for most (or even all) of the long options there are single-character equivalents. In your case
will probably yield the same results.
I hope this helps.
bakunin
Last edited by bakunin; 09-10-2013 at 05:50 AM..
Reason: getopts
These 2 Users Gave Thanks to bakunin For This Post:
Hello everyone,
I'm looking for the meaning of this expression, as I don't understand it quite clearly : $1^
What do you think it could be?
I thought either:
- match lines starting with argument 1 but it should be ^$1
- turn line around : word becomes drow
Thanks in advance for your... (4 Replies)
Would like to confirm the ff. I got confused actually with the version I needed to download that will work on glassfish 3.0.1
a. Debian Squeeze (HP DL360). Need to use java version6
On Debian, I did apt-get install sun-java6-jdk. So when I check it's
java version "1.6.0_22"
Java(TM) SE... (1 Reply)
can some one please tell the meaning of the second statement i.e
n=${m#*=}
i couldnt get the meaning of the #*=
1.) m="mohit=/c/main/issue"
echo $m
result
-----------
mohit=/c/main/issue
2.) n=${m#*=}
echo $n
RESULT
-------
/c/main/issue (1 Reply)
i have a program writing in PRO C which currently running in unix version 8 tie with oracle 8i, but in the future company gonna migrate this OS to version 9.
Anything i have to prepare for my PRO C program to run in unix version 9? or anything would that impact my program couldn't run well?
what... (2 Replies)