IWETHEY v. 0.3.0 | TODO
1,095 registered users | 1 active user | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Probably because the dash IS an option on its own, to tar?
New Nice try, but
..all commands take - as an option - meaning this is the last option and the rest of the command line entries are arguments.

Something about tar's origin in ye olden UNIX times..could be before standardization of getopt().
-drl
New No, for many (most?) old commands, that's DOUBLE dash. (*)
Because the dash is, to some commands, NOT an option/argument delimiter, but a GENUINE, (more or less) meaningful option of its own. (Then again, SOME of the "old" commands -- I forget which ones, but I have a vague idea tar might not be among them -- accept BOTH double- and single-dash as a delimiter; I think they were aiming for both standardisation and ease-of-use at the same time... And made a right mish-mash of it all.)

Anyway, for tar, the single-dash option-not-delimiter means -- IIRC, for which there's no guarantee -- something like "DO take input from standard input", or perhaps "DON'T route output to tape device but to standard output"; something in that general direction.




(*): At least on HP-UX 11.mumble, that is.


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
You know you're doing good work when you get flamed by an idiot. -- [link|http://www.theregister.co.uk/content/35/34218.html|Andrew Wittbrodt]
New Re: No, for many (most?) old commands, that's DOUBLE dash. (
For bash at least, - and -- are synonymous.
-drl
New WTF is "bash"?!?
Wrong forum -- that's Loonix, or whatever that newfangled viral-cancer thing from Estonia, or Hungary or wherever, is called! Real Unix[TM] uses sh, ksh, or csh. (And someone -- the weirdoes at Sun? -- has something called "zsh", too.) HTH!

But personally, I don't think it has much to do with the shell, per se, at all -- AFAICS, the shell just gives the command line in its entirety to whatever program you're trying to invoke, and lets that figure out for itself what's a flag, what's an option, and what's an argument.

Hey, BTW: Why the fuck do you ask in the first place, if you then refuse to believe the answer you're given?!? Fuck knows, is it really worth the trouble of typing in a reply to you... :-(


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
You know you're doing good work when you get flamed by an idiot. -- [link|http://www.theregister.co.uk/content/35/34218.html|Andrew Wittbrodt]
New Bzzt, wrong.
Look at the [link|http://www.faqs.org/faqs/unix-faq/shell/bash/|FAQ]. Like most of the GNU toolset, bash is not shipped by default on most variations of Unix, but is readily available, and can also be placed on a few non-Unixlike things as well.

In fact bash originally was a Unix program. It would have been hard to develop it on Linux considering that Brian Fox wrote the first version in 1988.

Cheers,
Ben
"good ideas and bad code build communities, the other three combinations do not"
- [link|http://archives.real-time.com/pipermail/cocoon-devel/2000-October/003023.html|Stefano Mazzocchi]
New Go buy a sense of humour, nitwit.
Then maybe you'll recognize a joke when you see it.


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
You know you're doing good work when you get flamed by an idiot. -- [link|http://www.theregister.co.uk/content/35/34218.html|Andrew Wittbrodt]
Expand Edited by CRConrad Feb. 12, 2004, 02:43:29 AM EST
New I recognize *funny* jokes perfectly well
The humor gets lost after you throw enough fucks in.

Ben
"good ideas and bad code build communities, the other three combinations do not"
- [link|http://archives.real-time.com/pipermail/cocoon-devel/2000-October/003023.html|Stefano Mazzocchi]
New Re: WTF is "bash"?!?
Damn CRC, I'm looking for the answer! Calm down!

I don't KNOW the ANSWER YET. I'm curious. There must be a good reason but I'm damned if I know it.

Actually you're on the right track most likely, because traditionally tar would naturally be followed by some command to control the tape drive, but we haven't yet nailed this down.


-drl
New blow me read the quoted man pages I cited!!!
CRC bash ijans, there is one usefull shell csh and one programmers use because they need assistance ksh and variants of the latter
thanx,
bill
and everywhere the great Curse of the New World, the American Child, in all its raucous, spoiled, undiciplined, selfish ghastliness, the female specimens keeping up an incessant high-pitched whine and the male infants racketing like cowpokes on payday. There's nothing wrong with grown Americans, by and large you wont find heartier men or bonnier women anywhere, but the only remedy I can see for the children is to run Herod for President.
Sir Harold Flashman esquire VC OBE

questions, help? [link|mailto:pappas@catholic.org|email pappas at catholic.org]
New Re: blow me read the quoted man pages I cited!!!
You misinterpreted the syntax of the page...

You'll notice that it starts

tar [-]{cvf...}

This means, optional dash, then come any number of options. The tar options MUST come first, and they can be preceded by a dash or not.

tar is one of the oldest things in UNIX. I'm almost certain that the funny option behavior is a consequence of the context you would find tar operating in - dumping and restoring files from tapes - and the dash was needed to allow tar to understand what kind of tape drive it was dealing with. A tar command from that day probably bore little resemblance to a standard UNIX command of today, and looked more like a TSO tape operation with explicit blocking and record layouts.
-drl
New also notice the description of the flags
One of the following flags must be present:

-c Create new archive, or overwrite an existing archive,
adding the specified files to it.
if it must be present what part of optional are you seeing?
berkely needs - unix does not, back in the day.
thanx,
bill
and everywhere the great Curse of the New World, the American Child, in all its raucous, spoiled, undiciplined, selfish ghastliness, the female specimens keeping up an incessant high-pitched whine and the male infants racketing like cowpokes on payday. There's nothing wrong with grown Americans, by and large you wont find heartier men or bonnier women anywhere, but the only remedy I can see for the children is to run Herod for President.
Sir Harold Flashman esquire VC OBE

questions, help? [link|mailto:pappas@catholic.org|email pappas at catholic.org]
New Re: also notice the description of the flags
Just the dash is optional. Apparently original tar only had the non-dashed ganged options. The dashes were added for people aready afflicted with automatic switch prefix disease. See docs for gnu tar "Styles".

-drl
New /me/bangs head on floor
bsd man page indicated by example dash required, 1979 unix hard copy shows no such animal. In Xenix dash required, forpro another unix/bsd mix dash required prime MIPS unix dash required unix no dash needed linux eithr or sys5 either or. Evolution at work.
thanx,
bill
and everywhere the great Curse of the New World, the American Child, in all its raucous, spoiled, undiciplined, selfish ghastliness, the female specimens keeping up an incessant high-pitched whine and the male infants racketing like cowpokes on payday. There's nothing wrong with grown Americans, by and large you wont find heartier men or bonnier women anywhere, but the only remedy I can see for the children is to run Herod for President.
Sir Harold Flashman esquire VC OBE

questions, help? [link|mailto:pappas@catholic.org|email pappas at catholic.org]
New s'one send email to ESR or Moen
-drl
New Then shut the f...heck up and listen, f...numbskull!
Ross gibbers:
Damn CRC, I'm looking for the answer! Calm down!
Like fucking hell I will -- I GAVE you your fucking answer already!


I don't KNOW the ANSWER YET. I'm curious. There must be a good reason but I'm damned if I know it.
Yes, fuckwit, you DO KNOW the fucking ANSWER ALREADY! If you would only SHUT THE FUCK UP AND LISTEN, you'd have noticed I gave it to you!


Actually you're on the right track most likely, because traditionally tar would naturally be followed by some command to control the tape drive, but we haven't yet nailed this down.
I'm not just "likely" but most definitely right; I HAVE nailed this down for you.

Holy fucking fucking fuck, why the fucking fucking fuck would I have commented on this shit, you think, when I've never piped up on any subject like this before, if I didn't happen to fucking KNOW what I'm talking about???


Here, with the exception of a few lines like
 tar(1)                                                               tar(1)
and
 Hewlett-Packard Company            - 1 -  HP-UX Release 11.00: October 1997
, is the complete output of man tar on a HP-UX system (pay special attention to the emphasised, strong-emphasised, and underlined bits):
NAME\n     tar - tape file archiver\n\nSYNOPSIS\n     tar [-]key [arg ...] [file | -C directory] ...\n\nDESCRIPTION\n     The tar command saves and restores archives of files on a magnetic\n     tape, a flexible disk, or a regular file.  The default archive file is\n     /dev/rmt/0m.  See the -f option below.  Its actions are controlled by\n     the key argument.\n\n   Arguments\n     key           is a string of characters containing an optional version\n                   letter, exactly one function letter, and possibly one or\n                   more function modifiers, specified in any order.\n                   Whitespace is not permitted in key.  The key string can\n                   be preceded by a hyphen (-), as when specifying options\n                   in other HP-UX commands, but it is not necessary.\n\n     arg ...       The b and f function modifiers each require an arg\n                   argument (see below).  If both b and f are specified,\n                   the order of the arg arguments must match the order of\n                   the modifiers.  If specified, the arg arguments must be\n                   separated from the key and each other by whitespace.\n\n     file          specifies a file being saved or restored.  If file is a\n                   directory name, it refers to the files and (recursively)\n                   the subdirectories contained in that directory.\n\n     -C directory  causes tar to perform a chdir() to directory (see\n                   chdir(2)).  Subsequent file and -C directory arguments\n                   must be relative to directory.  This allows multiple\n                   directories not related by a close or common parent to\n                   be archived using short relative path names.\n\n     The value of file is stored in the archive.  The value of directory is\n     not stored.\n\n   Version Keys\n     The version portion of the key determines the format in which tar\n     writes the archive.  tar can read either format regardless of the\n     version.  The version is specified by one of the following letters:\n\n          N    Write a POSIX format archive.  This format allows file names\n               of up to 256 characters in length, and correctly archives\n               and restores the following file types: regular files,\n               character and block special devices, links, symbolic links,\n               directories, and FIFO special files.  It also stores the\n               user and group name of each file and attempts to use these\n               names to determine the user-ID and group-ID of a file when\n               restoring it with the p function modifier.  This is the\n               default format.\n\n          O    Write a pre-POSIX format archive.\n\n   Function Keys\n     The function portion of the key is specified by exactly one of the\n     following letters:\n\n          c    Create a new archive.  Write from the beginning of the\n               archive instead of appending after the last file.  Any\n               previous information in the archive is overwritten.\n\n          r    Add the named file to the end of the archive.  The same\n               blocking factor used to create the archive must be used to\n               append to it. This option cannot be used if the archive is a\n               tape.\n\n          t    List the names of all the files in the archive.  Adding the\n               v function modifier expands this listing to include the file\n               modes and owner numbers.  The names of all files are listed\n               each time they occur on the tape.\n\n          u    Add any named file to the archive if it is not already\n               present or has been modified since it was last written in\n               the archive.  The same blocking factor used to create the\n               archive must be used to update it.\n\n          x    Extract the named file from the archive and restore it to\n               the system.  If a named file matches a directory whose\n               contents were written to the archive, this directory is\n               (recursively) extracted.  If a named file on tape does not\n               exist on the system, the file is created as follows:\n\n                    +  The user, group, and other protections are restored\n                       from the tape.\n\n                    +  The modification time is restored from the tape\n                       unless the m function modifier is specified.\n\n                    +  The file user ID and group ID are normally those of\n                       the restoring process.\n\n                    +  The set-user-ID, set-group-ID, and sticky bits are\n                       not set automatically.  The o and p function\n                       modifiers control the restoration of protection; see\n                       below for more details.\n\n               If the files exist, their modes are not changed, but the\n               set-user-id, set-group-id and sticky bits are cleared.  If\n               no file argument is given, the entire content of the archive\n               is extracted.  Note that if several files with the same name\n               are on the archive, the last one overwrites all earlier\n               ones.\n\n   Function Modifier Keys\n     The following function modifiers can be used in addition to the\n     function letters listed above (note that some modifiers are\n     incompatible with some functions):\n\n          A    Suppress warning messages that tar did not archive a file's\n               access control list.  By default, tar writes a warning\n               message for each file with optional ACL entries.\n\n          b    Use the next arg argument as the blocking factor for archive\n               records.  The default is 20; the maximum is at least 20.\n               However, if the f - modifier is used to specify standard\n               input, the default blocking factor is 1.\n\n               The blocking factor is determined automatically when reading\n               nine-track tapes (key letters x and t).  On nine-track\n               tapes, the physical tape record length is the same as the\n               block size.  The block size is defined as the logical record\n               size times the blocking factor (number of logical records\n               per block).\n\n               The blocking factor must be specified when reading flexible\n               disks and cartridge tapes if they were written with a\n               blocking factor other than the default.\n\n               If a tar file is read using a blocking factor not equal to\n               the one used when the file was written, an error may occur\n               at the end of the file but there may or may not be an actual\n               error in the read.  To prevent this problem, a blocking\n               factor of 1 can be used, although performance may be reduced\n               somewhat.\n\n               tar writes logical records of 512 bytes, independent of how\n               logical records may be defined elsewhere by other programs\n               (such as variable-length records (lines) within an ASCII\n               text file).\n\n          e    Fail if the extent attributes are present in the files to be\n               archived.  If tar fails for this reason, the partially\n               created destination file is not be removed.\n\n          f    Use the next arg argument as the name of the archive instead\n               of the default, /dev/rmt/0m.  If the name of the file is -,\n               tar writes to standard output or reads from standard input,\n               whichever is appropriate, and the default blocking factor\n               becomes 1.  Thus, tar can be used as the head or tail of a\n               pipeline (see EXAMPLES).\n\n          h    Force tar to follow symbolic links as if they were normal\n               files or directories.  Normally, tar does not follow\n               symbolic links.\n\n          l    Tell tar to complain if it cannot resolve all of the links\n               to the files being saved.  If l is not specified, no error\n               messages are printed.\n\n          m    Tell tar not to restore the modification time written on the\n               archive.  The modification time of the file will be the time\n               of extraction.\n\n          o    Suppress writing certain directory information that older\n               versions of tar cannot handle on input.  tar normally writes\n               information specifying owners and modes of directories in\n               the archive.  Earlier versions of tar, when encountering\n               this information, give error messages of the form:\n\n                    name - cannot create\n\n               When o is used for reading, it causes the extracted file to\n               take on the user and group IDs of the user running the\n               program rather than those on the tape.  This is the default\n               for the ordinary user and can be overridden, to the extent\n               that system protections allow, by using the p function\n               modifier.\n\n          p    Cause file to be restored to the original modes and\n               ownerships written on the archive, if possible.  This is the\n               default for the superuser, and can be overridden by the o\n               function modifier.  If system protections prevent the\n               ordinary user from executing chown(), the error is ignored,\n               and the ownership is set to that of the restoring process\n               (see chown(2)).  The set-user-id, set-group-id, and sticky\n               bit information are restored as allowed by the protections\n               defined by chmod() if the chown() operation above succeeds.\n\n          nd   Specify a particular nine-track tape drive and density,\n               where n is a tape drive number: 0-7, and d is the density: l\n               = low (800 bpi); m = medium (1600 bpi); h = high (6250 bpi).\n               This modifier selects the drive on which the nine-track tape\n               is mounted.  The default is 0m.\n\n          v    Normally, tar does its work silently.  The v (verbose)\n               function modifier causes tar to type the name of each file\n               it treats, preceded by the function letter.  With the t\n               function, v gives more information about the archive entries\n               than just the name.\n\n          V    Same as the v function modifier except that, when using the\n               t option, tar also prints out a letter indicating the type\n               of the archived file.\n\n          w    Cause tar to print the action being taken, followed by the\n               name of the file, then wait for the user's confirmation.  If\n               the user answers y, the action is performed.  Any other\n               input means "no".\n\n     When end-of-tape is reached, tar prompts the user for a new special\n     file and continues.\n\n     If a nine-track tape drive is used as the output device, it must be\n     configured in Berkeley-compatibility mode (see mt(7)).\n\nEXTERNAL INFLUENCES\n   Environment Variables\n     LC_TIME determines the format and contents of date and time strings\n     output when listing the contents of an archive with the -v option.\n\n     LANG determines the language equivalent of y (for yes/no queries).\n\n     If LC_TIME is not specified in the environment or is set to the empty\n     string, the value of LANG is used as the default.\n\n     If LANG is not specified or is set to the empty string, it defaults to\n     "C" (see lang(5)).\n\n     If any internationalization variable contains an invalid setting, tar\n     behaves as if all internationalization variables are set to "C".  See\n     environ(5).\n\n   International Code Set Support\n     Single- and multibyte character code sets are supported.\n\nERRORS\n     tar issues self-explanatory messages about bad key characters, tape\n     read/write errors, and if not enough memory is available to hold the\n     link tables.\n\nEXAMPLES\n     Create a new archive on /dev/rfd.0 and copy file1 and file2 onto it,\n     using the default blocking factor of 20.  The key is made up of one\n     function letter (c) and two function modifiers (v and f):\n\n          tar cvf /dev/rfd.0 file1 file2\n\n     Archive files from /usr/include and /etc:\n\n          tar cv -C /usr/include -C /etc\n\n     Use tar in a pipeline to copy the entire file system hierarchy under\n     fromdir to todir:\n\n          cd fromdir ; tar cf - . | ( cd todir ; tar xf -i )\n\n     Archive all files and directories in directory my_project in the\n     current directory to a file called my_project.TAR, also in the current\n     directory:\n\n          tar -cvf my_project.TAR my_project\n\nWARNINGS\n     Because of industry standards and interoperability goals, tar does not\n     support the archival of files larger than 2GB or files that have\n     user/group IDs greater than 60K.  Files with user/group IDs greater\n     than 60K are archived and restored under the user/group ID of the\n     current process.\n\n     The default version has changed from O to N, beginning with HP-UX\n     Release 8.0.\n\n     Due to internal limitations in the header structure, not all file\n     names of fewer than 256 characters fit when using the N version key.\n     If a file name does not fit, tar prints a message and does not archive\n     the file.\n\n     Link names are still limited to 100 characters when using the N\n     version key.\n\n     There is no way to ask for the n-th occurrence of a file.\n\n     Tape errors are handled ungracefully.\n\n     The u function key can be slow.\n\n     If the archive is a file on disk, flexible disk, or cartridge tape,\n     and if the blocking factor specified on output is not the default, the\n     same blocking factor must be specified on input, because the blocking\n     factor is not explicitly stored in the archive.  Updating or appending\n     to the archive without following this rule can destroy it.\n\n     Some previous versions of tar have claimed to support the selective\n     listing of file names using the t function key with a list.  This\n     appears to be an error in the documentation because the capability\n     does not appear in the original source code.\n\n     There is no way to restore an absolute path name to a relative\n     position.\n\n     tar always pads information written to an archive up to the next\n     multiple of the block size.  Therefore, if you are creating a small\n     archive and write out one block of information, tar reports that one\n     block was written, but the actual size of the archive might be larger\n     if the b function modifier is used.\n\n     Note that tar c0m is not the same as tar cm0.\n\n     Do not create archives on block special devices.  Attempting to do so\n     can causes excessive wear, leading to premature drive hardware\n     failure.\n\nDEPENDENCIES\n   Series 700/800\n     The r and u function keys are not supported on QIC or 8mm devices.  If\n     these options are used with QIC or 8mm devices, tar fails and displays\n     the message:\n\n          tar: option not supported for this device\n\nAUTHOR\n     tar was developed by AT&T, the University of California, Berkeley, HP,\n     and POSIX.\n\nFILES\n     /dev/rmt/*\n     /dev/rfd.*\n     /tmp/tar*\n\nSEE ALSO\n     ar(1), cpio(1), acl(5), mt(7).\n\nSTANDARDS CONFORMANCE\n     tar: SVID2, SVID3, XPG2, XPG3\n\n Hewlett-Packard Company            - 7 -  HP-UX Release 11.00: October 1997
There. It's a fake file name that means standard input/output, just like I fucking said.

Now guess who got his hands on an old copy of "Unix in a Nutshell System V Edition" (Copyright (c) 1992 O'Reilly & Associates, Inc) a few months ago, and has since been unofficially named "our Unix shell script guy"? Who added, a couple of weeks ago, tar-and-compress archiving of old input files to the client's DW system? Who fucking pored over those "Nutshell" and "man" tar entries for hours, and created a few weird tar files before he got the hang of it...?

WILL you fucking believe me and shut the fucking fuck up now, please?

Thank you.


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
You know you're doing good work when you get flamed by an idiot. -- [link|http://www.theregister.co.uk/content/35/34218.html|Andrew Wittbrodt]
New jEEEz
-drl
     Question for heads - (deSitter) - (23)
         Probably because the dash IS an option on its own, to tar? -NT - (CRConrad) - (16)
             Nice try, but - (deSitter) - (15)
                 No, for many (most?) old commands, that's DOUBLE dash. (*) - (CRConrad) - (14)
                     Re: No, for many (most?) old commands, that's DOUBLE dash. ( - (deSitter) - (13)
                         WTF is "bash"?!? - (CRConrad) - (12)
                             Bzzt, wrong. - (ben_tilly) - (2)
                                 Go buy a sense of humour, nitwit. - (CRConrad) - (1)
                                     I recognize *funny* jokes perfectly well - (ben_tilly)
                             Re: WTF is "bash"?!? - (deSitter) - (8)
                                 blow me read the quoted man pages I cited!!! - (boxley) - (5)
                                     Re: blow me read the quoted man pages I cited!!! - (deSitter) - (4)
                                         also notice the description of the flags - (boxley) - (3)
                                             Re: also notice the description of the flags - (deSitter) - (2)
                                                 /me/bangs head on floor - (boxley) - (1)
                                                     s'one send email to ESR or Moen -NT - (deSitter)
                                 Then shut the f...heck up and listen, f...numbskull! - (CRConrad) - (1)
                                     jEEEz -NT - (deSitter)
         Unix Programmers Manual Volume 1 Bell Labs - (boxley) - (5)
             Re: Unix Programmers Manual Volume 1 Bell Labs - (a6l6e6x) - (4)
                 My edition is 1979 and doesnt state that? what edition are - (boxley)
                 Re: Unix Programmers Manual Volume 1 Bell Labs - (deSitter) - (2)
                     No it doesn't. - (pwhysall)
                     Dash by itself is meaningless in tar - (Arkadiy)

I'll let that picture pass...
92 ms