Update functions

Bash oneliners and make use of the cmdline variable.

UNTESTED