Couldn't this just instead be `tar xvzf $DIR/ld.tgz ...` and then drop the gunzip?