The meaning of ./uvscan --version ?

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers The meaning of ./uvscan --version ?
# 1  
Old 09-09-2013
The meaning of ./uvscan --version ?

So I have been running uvscan and was wondering what the -- means. For instance:

./uvscan --version

# 2  
Old 09-09-2013
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.

For example:
# echo 'grep for -v, do not treat -v as an argument to grep' > hello

# grep -- -v hello
grep for -v, do not treat -v as an argument to grep

# 3  
Old 09-09-2013
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?
# 4  
Old 09-09-2013
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.
This User Gave Thanks to Scott For This Post:
# 5  
Old 09-10-2013
Maybe i can clear this up:

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:

command -a -b -c
command -ab -c
command -abc

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:

command -file

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:

command -file
command --file

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

uvscan -v
uvscan --version

will probably yield the same results.

I hope this helps.


Last edited by bakunin; 09-10-2013 at 06:50 AM.. Reason: getopts
These 2 Users Gave Thanks to bakunin For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Meaning of $1^

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)
Discussion started by: bibelo
4 Replies

2. Shell Programming and Scripting

Copy a file from directroy/ prior version to the directory/ new version

How to copy a file from directroy/ prior version to the directory/ new version automatically. (4 Replies)
Discussion started by: roy1912
4 Replies

3. UNIX for Dummies Questions & Answers

meaning of <<!

Hi all, I wanna know the meaning of the last word "<<! " sudo su - user <<! please help on this !!!! (1 Reply)
Discussion started by: sudharson
1 Replies

4. UNIX for Advanced & Expert Users

Advanced Search * View * Edit JAVA version to WORK in GLASSFISH Forum topic JAVA version

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)
Discussion started by: lhareigh890
1 Replies

5. Shell Programming and Scripting

meaning of !*

can someone please tell what !* means in shell syntax. Regards, (3 Replies)
Discussion started by: busyboy
3 Replies

6. Shell Programming and Scripting

What is the meaning of $_

Hi, Can somebody tell the usage of "$_" cd $_ ? and ls $_ ? (4 Replies)
Discussion started by: giri_luck
4 Replies

7. UNIX for Dummies Questions & Answers

what the meaning of #*

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)
Discussion started by: narang.mohit
1 Replies

8. UNIX for Dummies Questions & Answers

Use and meaning of $*

Can someone explain the use and meaning of "$*" expression. (2 Replies)
Discussion started by: sinpeak
2 Replies

9. AIX

meaning of ${0%${0##*/}}

. ${0%${0##*/}}Script_Name if i issue this command, it is executing the script. can any one tell what is the meaning of ${0%${0##*/}} (7 Replies)
Discussion started by: nyelavarthy
7 Replies

10. Solaris

Migrate unix version 8 to version 9

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)
Discussion started by: lsy
2 Replies
Login or Register to Ask a Question