Wondering if it is possible to write a shell script like this, and if possible, any reference/sample implementation I can refer to? Thanks.
- Step 1, scp a local file on a local box to a remote box ABC, may need input password or we can hard code password into script possible?
- Step 2, remote execute a script on box ABC, and leverage the file uploaded in Step 1
- Step 3, the output of Step 2 (which is on console/stdout) is redirected to local box.
I tried this:
scp ~/Downloads/data/1.dat root@host:/root/data /root/exercise/test /root/data/1.dat