[Home] Zsh logo

match-Xcolours

Zsh Wizard

Download match-Xcolours Return to Examples
  1. #!/usr/local/bin/zsh
  2. # keep a copy of IFS so it can be restored afterwards
  3. local oldIFS=$IFS
  4. # set IFS to newline (only) so that spaces are not treated specially
  5. IFS="
  6. "
  7. # strip leading rubbish off rgb.txt file and treat them a line at a time.
  8. reply=($(sed 's/^[0-9 ]*[ ]*//' </usr/lib/X11/rgb.txt ))
  9. IFS=$oldIFS