Profile

unixronin: Galen the technomage, from Babylon 5: Crusade (Default)
Unixronin

December 2012

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829
3031     

Most Popular Tags

Expand Cut Tags

No cut tags
Saturday, July 10th, 2010 08:02 pm

SO I've been doing Gentoo installs from a sysrescuecd, rather than from a Gentoo minimal install CD, simply because it works better (it has an nfs client, which the Gentoo minimal install CD doesn't, enabling me to do installs over the wire, plus — again unlike the Gentoo minimal CD — its kernel has libata and IDE-SCSI emulation built in, which means disks show up as /dev/sd* the same as they will on the live system).  But, well ...

Let's talk about shell aliases.  Aliases are one way of combining multiple shell commands, or a command with a particular set of standard options, into a single shorthand command.

There are common and useful ones.

There are also common and NOT-useful ones.

And then there are common and downright ANNOYING ones.

sysrescuecd comes with the following predefined shell aliases:

cl=clear
cp='cp -i'
cvs='cvs -z3'
l='ls -ail'
ll='ls -lah'
ls='ls --color=auto'
lsdir='for dir in *;do;if [ -d $dir ];then;du -hsL $dir;fi;done'
reboot='shutdown -r now'
rm='rm -i'
run-help=man
which-command=whence

Now, most of these I'm going to reserve comment on.  But 'cp -i'?  'rm -i'?  (For those of you unfamilar with the Unix command line, the -i option to these commands instructs the shell to ask you whether that's really what you meant to do.  EVERY.  GODDAMN.  TIME.)

These are "safety" aliases typically put there for the benefit of CLI newbies who have very little idea what they're doing in a Unix shell.

IF YOU KNOW ENOUGH ABOUT YOUR OS THAT YOU'VE BURNED A SYSTEM RESCUE CD AND BOOTED THE MACHINE FROM IT TO REPAIR A DAMAGED OS BY HAND, THERE IS AN OBVIOUS PRESUMPTION THAT YOU PROBABLY HAVE AT LEAST SOME CLUE ABOUT WHAT YOU'RE DOING.

(Forgive my shouting, please.)

On a system rescue CD, this is not "a safety feature".  To anyone capable of actually using the rescue CD for its intended purpose, it's just a stupid, pointless annoyance that requires the user of the rescue CD to take the extra step of typing 'unalias cp; unalias rm' in every new shell before being able to actually do any repair work without being nagged to death by your "safety" aliases.

Sunday, July 11th, 2010 04:40 pm (UTC)
Can you mount the *.iso to a loopback and alter it? I tend to put *.iso's on USB drives at this point, unless there is really something compelling I need the disc for. For about $10 I can get a 4GB drive, enough for most DVD *.iso's. I just keep it up to date. (I do have some older equipment, that will not boot from a USB drive. But I am [slowly] phasing them out.)
Sunday, July 11th, 2010 09:50 pm (UTC)
I tend to just forget that I changed it. The '-i' default drives me crazy. You just don't make the '# rm *' mistake more than once.
Monday, July 12th, 2010 10:35 pm (UTC)
Or at least add to your shell profile the unalias commands. Or does it take the profile from the disk instead of the memory resident version?