Unable to access local variable on remote host using sshpass. Can you please help me to pass local variable to pass on remote host using ssh pass for the below code snippet expected result: Answer Try this: You need to double quote your command line and right escaping.