Sunday, October 23, 2016

Unix Aliases for Dummies

Per cent of users preferring given UNIX shells
It's said that "a little knowledge is a dangerous thing." Perhaps nowhere on the internet has the truth of that adage been given more clarity than in the Demand Media Studios family of websites, beginning with the oft-maligned (and deservedly so) eHow.com. That's where self-appointed freelancers like Micah McDunnigan leveraged their googling skills to "explain" all manner of technical topics in return for a small stipend. The ensuing rush to "perform" combined with the lack of knowledge of the site's fact-checkers was responsible for tens of thousands of posts full of misinformation and downright errors – rubbish like McDunnigan's own "How to Save an Alias in UNIX."¹

Micah, who is unlikely to have studied UNIX while picking up that "international relations" degree, displayed a serious lack of familiarity with UNIX systems in general and aliases in specific. We suspected this when he opened by explaining that
"While the terminal can be an incredibly useful tool, it has one draw back [sic]: if you regularly execute the same command with the same parameters, then typing out the same command can get tedious."
The fact that "drawback" is one word notwithstanding, we were taken aback (or in Micah's parlance, "a back") by the whole concept of the "terminal" as "an incredibly useful tool." He does mean "terminal window," right? Besides, doesn't Micah know about the up arrow? (rhetorical question...)

Whatever the case, McDunnigan proceeds to give steps for saving a UNIX alias. We asked our house UNIX guru to read through them... and he just snickered. Here's what Micah has to say, with his comments:
    
  1. "Open a terminal window. For Linux-based systems, you can find this program in the main menu."  I'd hope anyone who wants to save an alias already has a terminal window open. Oh, and you can probably open a terminal window by simply right-clicking on the background, assuming X-Windows is running...
  2. "Enter your home directory in the terminal by typing '~/' at the prompt." Umm, dude: by default, the terminal already opens in your home directory. 
  3. "Open your bash profile document by typing the command 'nano .bash_profile' into the terminal." Sorry, Charlie: I don't use bash (Macs suck). I also don't have nano loaded. Now what? Well, every UNIX system comes with the vi editor preloaded, so you edit the profile for your favorite shell -- me, I'd type in vi .cshrc. Other people use the k shell, etc., and the system resource or profile differs from shell to shell. Besides, you should not edit .bash_profile, you should edit .bashrc -- even your reference said so! 
  4. [nano commands] Umm, yeah, I just told you I don't have nano... now what?
     McDunnigan made a classic mistake here: he assumed that, since he had found references for Mac OS-X (which is UNIX-based), that those would work everywhere. Well, Micah, that's just plain bogus: UNIX existed long before Apple co-opted it, and millions of users everywhere who are not on Apple devices use UNIX every day. Your instructions are completely worthless to many of them: you gave them for an unpopular shell and used an editor not everyone has. And here you wondered why you were getting another Dumbass of the Day award!

¹ The original has been deleted by Leaf Group, but can still be accessed using the Wayback machine at archive.org. Its URL was   ehow.com/how_8742118_save-alias-unix.html
copyright © 2016-2022 scmrak

DD - COMPUTERS

No comments: