     #
 
     {username,newPassword} = options
-
-    chpw = exec "echo '#{newPassword}' | /usr/bin/passwd --stdin #{username}", (err,stdout,stderr)=>
+    userInputs = [newPassword]
+    cmd = bash "echo %s | /usr/bin/passwd --stdin #{username}", userInputs
+    chpw = exec cmd, (err,stdout,stderr)=>
       if err?
         log.error "[ERROR] can't set password for #{username}: #{stderr}"
         callback? "[ERROR] can't set password for #{username}: #{stderr}"

Kite      = require 'kite-amqp'
mkdirp    = require 'mkdirp'
coffee    = require 'coffee-script'

createTmpDir = require './createtmpdir'


      callback? new AuthorizationError username
      return false

    exec bash("test -d %s", [kpmAppPath]), (err, stdout, stderr)->
      if err or stderr.length
        cb "[ERROR] App files not found! Download cancelled."
      else
        userInputs = [userAppPath, backupPath, kpmAppPath, userAppPath, userAppPath]
        cmd = bash("mv %s %s && cp -r %s/ %s && chown -R #{username}: %s", userInputs)
        exec cmd, (err, stdout, stderr)->
          if err or stderr then cb err
          else
            cb null
