Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-14-2017, 09:12 AM   #16
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,357
Blog Entries: 4

Rep: Reputation: 3821Reputation: 3821Reputation: 3821Reputation: 3821Reputation: 3821Reputation: 3821Reputation: 3821Reputation: 3821Reputation: 3821Reputation: 3821Reputation: 3821
My two cents ... "Tinkertoys"

JM2CW™ ...

This scenario smacks of what I un-affectionately refer to as "Tinkertoys." (Or maybe, "kit-bashing.")

You are confronted with a whole bunch of bash scripts, all studiously implemented in Bash, all closely related to one another because they are manipulating the same files and so on, but none of them sharing any common code. And "they work, sort of, as long as you hold your mouth just right." But, if you "tinker" with one of them, you break another. And, when you "tinker" with another to fix that break, the cycle repeats. The whole damned thing is fragile. Far too much staff time is spent wasted fixing stupid breaks.

Therefore, be sure to step back and reconsider the whole picture from a business point-of-view. These things can suck up a lot of maintenance time, and as for me, I don't like calls at 2 am.

In many past lives, I have rewritten blocks of such recalcitrant code, say, in Perl-5. The scripts are reduced to one use statement referencing a common .pm file containing all of the common code, including (in this file or in another one) the "guts" of all the various once-independent scripts. Now, you can see them together, you can edit them together, and you can write test-suites to verify that everything continues to work. Furthermore, you can avail yourself of the contributed libraries that these languages readily provide.

Originally Posted by
The Comprehensive Perl Archive Network (CPAN) currently has 180,090 Perl modules in 35,058 distributions, written by 13,013 authors, mirrored on 249 servers.
(This is typical ...)

The most ridiculous example of "kit-bashing" that I encountered out in the field appeared to be an earnest attempt to implement a web server in Bash. It never did work. I proceeded to tell the client that Perl's CPAN library has a fully-tested web server (object) that lets you implement a HTTP(S) server in about 10 lines of your-code. (They didn't know that.) It took about half a day to replace their "Rube Goldberg contraption" with something that caused no further trouble. The trouble was simply that a previous programmer had the attitude of, "there goes a white rabbit! Let's chase it!" And he did so, without further thought, using what was apparently the one-and-only programming tool he knew well. I guess it never occurred to him that someone else had already seen the same rabbit.

Last edited by sundialsvcs; 03-14-2017 at 09:21 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting a block of text into a text file on system boot krptodr Linux - Newbie 5 02-14-2012 07:11 PM
Remove lines in a text file based on another text file asiandude Programming 10 01-29-2009 10:59 AM
Adding lines of text to beginning of a text file BillKat Programming 2 01-19-2009 10:40 AM
Inserting blank lines in text file David the H. Linux - General 5 11-24-2007 03:34 PM
Grab text lines in text file LULUSNATCH Programming 1 12-02-2005 10:55 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:51 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration