171 reputation
5
bio website
location United Kingdom
age
visits member for 5 years, 1 month
seen Nov 18 at 9:08

I am a programmer. My principal language is C++. I've also done commercial work in Java, C, Perl, Python, Javascript and APL. I've also been known to dabble in python, lisp, Haskell, assembler (ARM, x86, amd64) and probably a few other languages that haven't left as big a mark.

I'm a member of the ACCU, and I spoke at accu2012 in April.


Jul
20
comment Setting the group of a Unix process
@Kaarel: Oops, yes.
Jul
19
comment What is the simplest scriptable way to check whether a shell variable is exported?
Also there's an inconsistency, -z "$1" assumes I'm passing the value of a variable to test_var (as I was) whereas declare -p expects its name. I came up with this test which takes the name of a shell variable: test_exported_notnull () { re='^declare -\w*x'; [[ -n $(eval echo \$$1) ]] && [[ $(declare -p "$1") =~ $re ]]; } .
Jul
19
comment What is the simplest scriptable way to check whether a shell variable is exported?
It looks like attempting to quote the regular expression stops it working as a regular expression in bash >= 3.2.
Jul
19
comment What is the simplest scriptable way to check whether a shell variable is exported?
I think that this is what I'm looking for. In theory, the re might need to be more flexible, e.g. if I had a read-only exported variable, but in practice I never use other typeset attributes.
Jul
19
comment What is the simplest scriptable way to check whether a shell variable is exported?
This does work but I was hoping for a lighter answer with fewer implied forks (hence "Short of [...] grepping the output of export") as my planned use is in my prompt.
Apr
27
comment Copy the contents of one partition to another partition hardrive
possible duplicate of stackoverflow.com/questions/2719186/…