Update functions

Bash oneliners and make use of the cmdline variable.
Merge pull request #8 from CurlyMoo/patch-4

Update functions