system-config??? More like sissy-config!

Sissy is a pejorative for a boy or man to indicate that he fails to behave according to the traditional male gender role. Generally, it implies a lack of the courage and stoicism which are thought important to the male role.

wikipedia

We all love the ease of a nice graphical interface. Often times GUIs (and TUIs) are great because they lower the barriers of technology, but sometimes this ease of use has a price. In the Linux world my gripes with GUIs are that sometimes they:

  1. lack features of their command line counter parts
  2. are cumbersome
  3. difficult/impossible to script.

RHEL & Fedora ship with a nice set of system tools that begin with the name system-config-*. Sometimes these tools really come in handy, but most of the time I use them I’m really just being lazy. In fact, I often feel a little guilty for “cheating” with these tools. I decided that I could do something about it. I wrote a little script today to help encourage myself and others to limit their use of these utils. It’s not that there’s anything wrong with using them, but that there’s often more efficient methods of accomplishing the end results. Like so many things in life I decided to address this head-on using mockery and sarcasm. This little script will create a symbolic link to a more appropriate command name, and if you chicken out, it will mock you. :)

#!/bin/bash
cmds=(`ls /usr/bin/system-config-*`)
num=${#cmds[*]}
i=0
echo -e "There are $num potential \e[01;35m sissy-config\e[00m commands on this system."
echo "Do you wish to convirt them?"
select yn in "Yes" "No"; do
  case $yn in
    Yes)
       while [ $i -lt $num ]; do
       c=$(echo ${cmds[$i]} | sed "s/system-config/sissy-config/g")
       ln -s ${cmds[$1]} $c
       let i++
done; exit;;
    No) echo "OMFG! You are a sissy!!"; exit;;
   esac
done

You can download the script here. Don’t forget to run it as root or use sudo.

Cheers.

***Update***

While the script functions perfectly, the links do not execute properly. I’ve tried substituting cp & mv and I get the same result. I don’t understand what I’m missing. I hope someone can comment and shed some light on this for me.

***Update 2***

The problem with this script is that for some it creates a symlink to a symlink for some of these utilities. For this to work properly the script would need to search for the actual binaries. Maybe one day I’ll have time to fix this.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.