I try to check file existence on a remote server. Everything works fine for me, except that I want to pass the file path as a variable.
Here is what I do
_,stdout,_=ssh.exec_command("[ -f d:/tryssh/1.txt ] && echo OK")
and I need this d:/tryssh/1.txt
to be a variable that I specify in the python script to be used later in the bash, something like this
`_,stdout,_=ssh.exec_command("[ -f $filePath ] && echo OK")`