Category Archives: Programming

New Linux CLI Tricks for Old Dogs

Bash Cookbook
Bash Cookbook

I’ve been slowly making my way through O’Reilly’s Bash Cookbook: Solutions and Examples for Bash Users, 2nd edition, by Carl Albing & JP Vossen. It’s a great book but is enormous and not really structured for reading from beginning to end, as much as for referring to to solve a specific problem. I doubt I will ever finish it.  But, there are a lot of great factoids in there!  Last year, I read Packt’s Mastering Embedded Linux Programming, second edition, by Chris Simmonds, as well as Embedded Linux Development Using Yocto Project, second edition, by Alex Gonzalez (both of which I should do reviews on), and picked up a few of the commands I mention below in those books.

I learned Unix shell commands first on a DEC Vax 11-780 starting about 1984 at college, and then more over time using various distros of Linux from maybe 1997 onward. I’ll admit that most of what I know about ‘sh’ and ‘bash’ are from long ago.

Continue reading New Linux CLI Tricks for Old Dogs

GCC Mayhem

I tend to use gcc and gcc-derived tools quite often in my work; examples include the Arduino environment, LPCXpresso, and WinAVR. While not the best compiler in the world performance-wise, it wins hands down when you factor in its portability, ubiquity, and stability — as well as cost.

Sometimes weird stuff happens though. Recently I upgraded my main desktop machine from Windows XP to Windows 7. Since then, I have been unable to run any of the above toolchains successfully. What gives?

Turns out the problem was caused by a recent installation of a gcc toolchain, Ride7, from Raisonance, for the EM Micro 6819 processor family. That’s right, one gcc toolchain killed 3 others!

The solution (at least to make the first 3 work again) was to remove the GCC_EXEC_PREFIX environment variable that Ride7 created. Turns out that is a variable used in older gcc implementations that now causes havoc with newer ones. And Ride7’s gcc is OLD! 2.80! Current gcc versions are in the 4.3 range or higher.

Despite my initial fear that the trouble was Windows 7 itself, it turned out to be a combination of things — I never tried those other tools again after installing Ride7.