Code cleanup

4 commits that cleanup code by using more shell built-ins.
Then that line is incorrect - I'll have to remove it.