fix bad bash reply (reported in issue #2)
remove trailing whitespaces
fix manual-bash - write to local directory
sanitize bash function names. Fixes issue #2