How to put sshpass command inside a bash script?
bash, ssh
Solution
Do `which sshpass` in your command line to get the absolute path to `sshpass` and replace it in the bash script.
You should also probably do the same with the `command` you are trying to run.
The problem might be that it is not finding it.
Problem
I am trying to run a sshpass command inside a bash script but it isn't working. If I run the same command from the terminal it works fine but running it in a bash script it doesn't. ``` #! /bin/bash sshpass -p 'password' ssh user@host command ``` I am aware of the security issues but its not important now. Can someone help? Am I missing something. Thanks