I'm a novice at bash
(more like less than a novice). Trying to get the results of this into a variable
ssh root@HOST "ls -tr /path/to/files/Backups | tail -1"
This is what I have
#!/bin/bash
STR=ssh root@HOST "ls -tr /path/to/files/Backups | tail -1"
echo $STR
It returns myscript.sh: command not found
Script is located in the ~/Desktop/scripts
I am running it in that directory by typing test.sh
How do I format the line for the variable?
./myscript.sh
) otherwise the error would be./myscript.sh: command not found
– jesse_b Jan 10 '20 at 16:41.sh
. There should be no file-name-extension. – ctrl-alt-delor Jan 10 '20 at 17:02