Switches on the command line

Switches on the command line

Post by Alex Cockel » Sun, 12 Oct 1997 04:00:00



Hi all,

With regard to using the forward slash as a switch, personally when I used Unix
once after being used to RSTS, VMS, CP/M and DOS, I was thrown, as I was
used to each switch being a separate entity on the command-line.

OK, so I am not using Linux at present (currently running W95a at home, but
getting fed up with it), but I intend to move across to it eventually, after my
Disabled Student Allowance technical assessment (where I hope to get a decent
laptop).  From what I gather, Unix uses a single switch character, then all options,
and finally the command's operands.  This can be VERY confusing to a mainframe
user (CP/M's commands  seemed to be based on RSTS; DOS copied CP/M).who
was used to commands like

$ PRINT FILE.LST;3 /FORM=A4LIST /AFTER=(DEC-date format)

or

$ MAIL DOC.TXT /SUBJECT="Subject" /TO= (recipient)

I know these are trivial examples, but I was an end-user on a VAX about 4 years ago.

I don't know the UNIX command options, but

$ cmd -optoptoptoptoptopt file

is not automatic even to DOS users.

I know this is no excuse, and please do not flame me, but I thought I'd just make
the point.  I intend to move to Linux on this tower eventually, but I need money
and time first.

I thank you for bearing with me.

Alex*ell


29 Egremont Road, Exmouth, Devon EX8 1RX, UK                    Phone   : +44 (0)1395 279970

 
 
 

Switches on the command line

Post by Alan Shutk » Sun, 12 Oct 1997 04:00:00


A> I know this is no excuse, and please do not flame me, but I thought
A> I'd just make the point.

I don't understand the point you were trying to make.  Although you
can do something like

ls -asldk

you can also do ls -l -r -a, putting each option separately.

--

In 1750 Issac Newton became discouraged when he fell up a flight of stairs.

 
 
 

Switches on the command line

Post by Russell Pri » Mon, 13 Oct 1997 04:00:00


: Incidentally, the term ``switch'' causes we Unix partisans to cringe.
: It's very MS-DOSsy. The proper term is ``option'' which ties in nicely
: with the getopt function to process these arguments.
:
: (This misnaming of things is typical of Microsoft and is discussed in
: another thread. In the bizarre, twisted world of Redmond newspeak,
: recognized, standard names such as ``directories'' mutate into terms
: like ``folders'').
:

Umm... back in 1980, I *very distinctly* remember the DEC RSTS/E manuals
referring to command line options as "switches".

I wouldn't be surprised if that was also true for CP/M...

 
 
 

Switches on the command line

Post by Brennan M Mullig » Mon, 13 Oct 1997 04:00:00


This all really depends one the implementation of the
command you are using.  Most programs that are distributed
with Linux are simply ported to Linux (written in ANSI C)
from other flavors of Unix.  The cool thing about Linux (if
you are energetic enough) is that the manual pages generally
come with extensive documentation on the functionality of a
given command (or program as it were) including a list of
the system calls invoked therein.  If you don't like
the way a command handles command line options, you can
usually write a shell or c-wrapper around the original and
thereby get a customized version.  If you're really
energetic, you can write your own from scratch on the basis
of what is in the manual for an existing command--and even
modify the manual to include your changes.  Linux is that cool.  

Brennan

[snipped]

 
 
 

Switches on the command line

Post by Erik Hense » Wed, 15 Oct 1997 04:00:00



>OK, so I am not using Linux at present (currently running W95a at home, but
>getting fed up with it), but I intend to move across to it eventually, after my
>Disabled Student Allowance technical assessment (where I hope to get a decent
>laptop).  From what I gather, Unix uses a single switch character, then all options,
>and finally the command's operands.  This can be VERY confusing to a mainframe
>user (CP/M's commands  seemed to be based on RSTS; DOS copied CP/M).who
>was used to commands like
>$ PRINT FILE.LST;3 /FORM=A4LIST /AFTER=(DEC-date format)
>I don't know the UNIX command options, but
>$ cmd -optoptoptoptoptopt file

Don't be afraight, cmd file -opt -opt -opt -opt will also work.
If you're lazy, and don't want to type to much dashes and spaces, you
can use your example.
It'll only work with one letter switches, _not_ will the long switches
(which usually start with --).
A slash obvious won't work, since it's the directory separator.

---
Erik Hensema
Please remove the "delete_me" from my address before replying.