Sponsored Content
Top Forums UNIX for Dummies Questions & Answers The meaning of ./uvscan --version ? Post 302851913 by bakunin on Tuesday 10th of September 2013 04:46:12 AM
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:

Code:
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:

Code:
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:

Code:
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

Code:
uvscan -v
uvscan --version

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:
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. Shell Programming and Scripting

meaning of !*

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

7. 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

8. 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

9. 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

10. 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
All times are GMT -4. The time now is 01:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy