In this post, I’ll discuss some lessons learned from BASH programming, in particular, how to pass return values from BASH’s “functions”. BASH does not provide support scoped variables by default, so variables declared in a function are available everywhere once the function has been called. BASH will let you declare local variables within a function through the local
keyword. Returning values is then a matter of echoing them out.
Monthly Archives: October 2014
Watching Processes with ps
In this post I’ll look at how you would monitor a process on a system in a BASH script. In particular, we’ll consider the case where we want to determine if a file is done uploading via scp
. If you have lsof
or fuser
installed on your system, this is not difficult, but you can’t always count on these tools being installed.
Using the GNU Scientific Library on a Mac
This morning I installed, compiled, and ran a simple example program using the GNU Scientific Library. This took me a while to figure out, so I’ll share the process here. I am assuming that the reader, like the author, has only vague familiarity with C.
Getting Started on a Mac
In this post I’ll talk about how to set up your Scipy stack on a Mac, and make some recommendations for other tools: Homebrew for general package management, iTerm2 for a terminal, Solarized for a text editing color scheme, and pathogen for vim package management.