Regarding Steven Orr's letter in the September 2012 issue: a few months ago, I happened to be looking at the find man page and discovered they fixed -exec. If you use the old format, it's still broken. However, if you end the command with a + instead of an escaped semicolon, it works correctly. They've also added an action -execdir, which behaves exactly like exec, except it'll chdir to the directory the file is in. If you've ended the command it's exec-ing with a +, it will run one copy of it per directory containing matching files. The man page didn't say what it does about excessive numbers of matches, but I haven't run into any issues yet. I'm pretty sure I've at least come near the pertinent limits, but I'm not certain I've actually crossed them yet.
In other news, if you use zsh, and turn on the extendedglob option, you can mostly do away with find, so long as you're willing to go with some line noise.
That being said, sometimes, I partially agree with Dave Taylor about the
legibility issue, so I go with a find <parameters> | while { read file } { do
stuff } approach. (For those of you who use bash, that's
basically find
<parameters> | while read file; do; do stuff; done, except.) As an old C
programmer, I find it more legible, as well as easier to type (zsh takes either
form).
—
Ed Grimm
I work as a software engineer, but I'm studying mechanical engineering. In mechanical engineering, we often represent systems in a simple blackbox input/output diagram. When we break the system down further, we create subsystems that also are interconnected blackboxes with clear definitions of inputs and outputs.
Some mechanical engineering design researchers are trying to represent these systems (which preform functions) in a standardized way so that the conceptual design of the product can be systematically archived. This also allows a computer to try to make new designs by matching up inputs with outputs. For example, let's say the input to a system is chemical energy and the output is rotational energy. Someone is designing a car. Traditionally, we would input gasoline, have an engine convert it to torque, and output rotational energy. A new innovative engineer thinks that a battery-powered drill has the same basic function as the car—input chemical energy and output rotational energy. So this new innovative engineer designs a battery-powered car.
Okay, that is dumb example, and abstraction is nothing new to software developers, but I hope you see the idea of how we can represent function abstractly with inputs and outputs.
Why not take the same idea and document all the inputs and outputs of all the software in the Open Source world in a very systematic way? Then, we can more easily reuse existing code, and we can have computers help us search for new innovative combinations of existing code. I'm tired of endlessly searching open-source repositories for existing code so that I don't have to re-invent the wheel.
Any thoughts on the idea?
—
Anthony
Anthony, I'm not sure I understand where you're going here—it sounds like you're describing reusable libraries? I agree, it's a great way to prevent the re-invention of wheels. Most languages have a fairly good selection of reusable code available, although some have a more robust “catalog” from which to choose.—Ed.
I like the “old-school” coding option. Dave's scripts are
clear, and even a new
guy can follow along most of the time. Keep up the good work. I look forward to
reading Dave's next article.
—
Lucius Wilson
I would love to see a story on the uses of Linux in some of the more
spectacular applications. I know you've run stories like this from time to
time, but I'm thinking more of an annual feature that updates us on the use
of Linux in supercomputing, major research projects or highly critical
applications. I'm prompted to suggest this after learning (or at least, I
think this is true) that Linux is at the base of the Space X Falcon 9
avionics system that saved the latest launch (as I write this) when an
engine depressurized and flight trajectory had to be recalculated
instantly in real time.
—
Greg Laden
Greg, I love to read about Linux running the world as well. As we hear about such things and have someone to cover them, we try to mention them. Sometimes, we get the heads-up from Letters to the Editor referencing Space X...—Ed.
I have to wholeheartedly agree with Dave's opinion that clarity is way more
important than efficiency for those one-shot scripts. Even if you need the
efficiency, it sometimes really is better to switch to another language than
to stay in the shell. And then, even though I have a few fairly up-to-date Linux
installations, at $WORK, I also have to administer AIX, Solaris and HP-UX,
so the smallest common subset is often mandatory. And, it spares you a lot
of interoperability problems and searching man pages and Google for the
meaning of some obscure command (and, by the way, how does one search this command
on Google?).
—
Klaus
As Dave Taylor requested comments, here are two remarks: 1) please keep clarity over efficiency, and 2) FORTRAN 77—spaces in variable names? Variable names in FORTRAN consist of 1–6 characters chosen from the letters a–z and the digits 0–9 to my knowledge and experience.
PS.
I belong to the generation having heard of APL and having seen APL
keyboards.
—
Fred
Dave Taylor replies: FORTRAN definitely didn't have good variable names, but F77 had arbitrarily long names and spaces were allowed. That's what made it so much more interesting than old FORTRAN—or perhaps I'm getting my old languages confused and I was programming in Ada at the time.
As a Linux fan, I (of course) have an Android phone and tablet.
I subscribe to the digital edition of LJ because I get it immediately after
release. But one thing annoys me: whenever I leave the app, I have to log in
again with my e-mail address. That's quite annoying.
Otherwise, the content is perfect.
—
Klaus Kolle
Klaus, that isn't normal. Something must be going wrong. Perhaps try deleting the app and removing its data, then re-installing it and see if that helps. Sorry it's been acting up on you. I agree, that would be frustrating!—Ed.
In Dave Taylor's September Work the Shell column, he wrote: “Drop me a note and tell me if you would prefer us publishing sample scripts with all of these notational tricks, even at the risk of broad portability across environments and systems, or do you prefer more ‘standard’ old-school scripting techniques that will even work on that clunky old server you administer?”
My short answer: please publish sample scripts “with all of these notational tricks”.
My longer answer: as a 30-year veteran of writing shell programs (why demean a program written in a particular language by calling it a “script?”) in C shell, Bourne, Korn, Bash and others, I think it is important to demonstrate clear, concise and efficient solutions to problems. The last is best accomplished in a shell programming language by employing built-ins, so long as they are not obfuscated.
In closing, the first programming language I used (8th grade) was APL. I wrote ray tracing code for optical system design and loved it. However, I agree. Although APL is semantically dense, it is the closest to a write-only language ever invented!
Keep up the good work Dave.
—
Andrew Piziali
I really enjoy your magazine and understand why it went digital. However, the Android reader app, especially on the Nexus 7, brings me no joy. It crashes often, has trouble working over Bluetooth networks on the Nexus 7, and sometimes it gets stuck while downloading, and pages end up missing. It's also quite slow. I have been grabbing the PDFs, but having a central reader as intended would be nice.
Anyhoo, hope it gets fixed soon.
—
Kwan
I don't have my Nexus 7 yet (but I'm referring to it as “my Nexus 7”, so perhaps I'm one step closer!), but I haven't heard of too many issues with crashing. I'm not sure very many people use Bluetooth networking, so that might be a lesser-tested scenario. Thanks for letting us know. As to the crashing, like I said in my note to Klaus, if you haven't tried removing and re-installing the app, be sure to give that a go.—Ed.
Having just bought one of those rinky-dink little ARM-based USB computers,
I'd love to see an article on getting Linux running on them (instead of the
Android they ship with). Special kudos would be for leading me to images
running MythTV.
There are some sources and wikis here and there, but a well-written and
researched article would be appreciated.
—
Bob Hepple
We're open to such an article, but we haven't gotten much in the way of article submissions or projects related to those Android computers yet. I think folks are still Raspberry Pi-crazy! If we come across anything great, we'll be sure to publish it.—Ed.
I recently read Dave Taylor's column titled “Bash Notational Shortcuts:
Efficiency over Clarity” and the letter to the editor that caused him to write
the column. I strongly agree with Dave's emphasis on portability and clarity.
In an average day, I use Linux, Windows and OS X. On unusual days, you can add
in AIX and maybe even one of IBM's non-UNIX systems. Although scripts don't
necessarily need to be portable, knowledge does need to be portable, as I don't
want to spend the time to acquire a system-admin level of understanding on each
release of each OS. I want to spend my time on things that are more important
to my specialty.
—
Bruce Moore
I initially was unhappy about the change to digital-only, but now I love it and read more of the magazine than I ever did with my print subscription. I read issues more or less cover to cover—something I never did before. I'm using the .epub format on a Barnes & Noble NOOK, so the ads are pretty much unreadable, but reading text examples and even illustrations is just fine. I am surprised to say that I miss the ads—they are helpful for keeping up with what vendors are offering.
I don't necessarily read an issue the moment it arrives, but I do load them on my NOOK regularly. I read them when I have a block of uninterrupted time—like an 11-hour flight home from Europe, when I read the August, September and October issues cover to cover. I never would have considered taking the print editions with me.
I have decided that a 10" tablet is in my future (primarily for reading magazines), and I second the requests for a user survey and perhaps a buyers guide article for tablets.
I also would like an easier way to download an issue. Right now I download it, add it to Calibre and then sync my device to Calibre. My preferred method would be a Calibre plug-in/news recipe that downloads new issues automatically whenever I start Calibre and sync my NOOK.
I would love to have access to back issues in .epub format, but I realize that this is a pretty big challenge and not likely to happen.
Thanks for publishing a great magazine.
—
Bruce Moore
I'm happy to see you're enjoying the digital edition. I think there are some serious contenders for “good tablet” now, so perhaps a buyer's guide makes sense. We'll have to see what we can come up with.
As far as getting it on the device, in previous Letters sections, readers sent in a few scripts for automatically sucking it off the e-mail link. If you combine that with Calibre's e-mail feature, I know the process is pretty simple for Kindle for reading as a personal document. I'm not sure if the NOOK has a similar e-mail feature or not, but it's worth checking into. Usually, I just store my .epubs in my Dropbox and locate them with the Dropbox app on my Android device.
Hopefully something will work well for your NOOK. Oh, and for back issues, you do have access to all the digital issues as a subscriber, but indeed they don't go all the way back to the beginning.
Just an addition to my letter in the November 2012 issue.
Why not brew your own? BrewPi (brewpi.com) can help.
—
jschiavon
My four-month-old granddaughter, Dylan, getting introduced to CrunchBang
Linux. She likes to keyboard!
She just may be the youngest CrunchBanger ever.
—
Vrai Chevalier
Note: please send your Linux-related photos to info@linuxjournal.com!