Re: tar command dangerously written

From: Bruce Barnett (spamhater113+U050519195928_at_grymoire.com)
Date: 05/20/05


Date: 20 May 2005 00:22:54 GMT


"danson" <danwatts@gmail.com> writes:

> My original point still stands though that it would make good sense to
> prompt an overwrite with the tar command - most user friendly tools
> will prompt on an overwrite (unless a 'force' is used).

I disagree.

If I ask tar to create an archive every night, and I discover that my
nightly backups have failed except for the first time when no file was
there, I would be very upset and it's unfriendlyness.

You also should realize that tar is one of the old commands, and the
user interface violates nearly every convention. (Perhaps it was
created before shells did globbing?) It's one of those mistakes that
we had to live with, like using "umount" instead of "unmount."

Besides, It only takes a few shell lines to make tar more friendly.
It could prompt you for missing arguments, warn you if you might
overwrite a file, etc. And the best part - you can do this to any
command. I usually give them a name with a capital letter i.e. Tar,
etc. Alternately, you could keep the same names, and put, say,
/usr/friendly/bin first in your search path.

Or, you may want to make different commands to do different tar
options, like CreateTar and DumpTar.

If the command REQUIRES a friendly interface, there is often no way to
turn off the friendlyness. In other words, it's much easier to add
functionality that to disable built-in functionality.

I once used a GUI that forced me to confirm each and every delete when
I asked it to delete 500 files. I had to find a different tool to
actually finish the task without developing carpal tunnel.
I did not consider this friendly.

If you want to see an example of a dangerous command, consider
        tee *
Just be aware that it can destroy every file in your directory.

-- 
Sending unsolicited commercial e-mail to this account incurs a fee of 
$500 per message, and acknowledges the legality of this contract.


Relevant Pages

  • usb2 port gets very slow on 2-gig Flash Drive.
    ... I needed to reload the flash drive on a Zenstone 2-gig mp3 ... It is July 24 and ps ax -Olstart shows me that tar has ... several minutes between the rm -r -f command to wipe the FAT ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: usb2 port gets very slow on 2-gig Flash Drive.
    ... You make all the filesystem changes to a disk image on your hard disk, ... It is July 24 and ps ax -Olstart shows me that tar has ... several minutes between the rm -r -f command to wipe the FAT ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: GNU tar problem
    ... ancient version of 'tar' might have been. ... executed when you call "tar" on the command line. ... of your tar program. ... I had a copy of the Gnu tar source so I built a ...
    (comp.arch.embedded)
  • Re: usb2 port gets very slow on 2-gig Flash Drive.
    ... It should be that CPU hungry I think. ... It is July 24 and ps ax -Olstart shows me that tar has ... several minutes between the rm -r -f command to wipe the FAT ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Need help create a multi-volume with Tar (without tape)
    ... I need to create a multi-volume archive with tar in a directory. ... If I use this command line: ... I obtain a prompt to change the volume ... Prev by Date: ...
    (comp.unix.shell)