• Mike Hibler's avatar
    The Joy of Sed. · a861dd6c
    Mike Hibler authored
    We were parsing the disk number out with:
    
      dunit=`echo $disk | sed -e 's/..\([0-7]\)/\1/'`
    
    which works fine with "ad0", giving a dunit of "0"
    but with "ada0" you get a dunit of "a0"
    
    And, after misinterpreting through another sed command:
    
    dunit=`echo $dunit | sed -e 'y/01234567/abcdefgh/'`
    
    we get "aa" instead of "a". Append that to "sd" and your disk
    becomes "sdaa" instead of "sda". Next thing you know I'm blaming
    Emacs for inserting an extra character in /etc/fstab!
    a861dd6c
Name
Last commit
Last update
..
autoconf Loading commit data...
event Loading commit data...
lib Loading commit data...
os Loading commit data...
protogeni Loading commit data...
sensors Loading commit data...
tmcc Loading commit data...
tools Loading commit data...
GNUmakefile.in Loading commit data...
GNUmakerules Loading commit data...
Makeconf.in Loading commit data...
config.h.in Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...
setversion.in Loading commit data...
shadow.spec Loading commit data...