Skip to content

Instantly share code, notes, and snippets.

@basilevs
Created August 6, 2015 06:58
Show Gist options
  • Save basilevs/42edabece826242a223a to your computer and use it in GitHub Desktop.
Save basilevs/42edabece826242a223a to your computer and use it in GitHub Desktop.
Fetches a latest distiributive over SCP and runs it
set [email protected]
set REM_PATH=/mnt/data/distr
set NAME=
FOR /F "tokens=* USEBACKQ" %%F IN (`plink %HOST% "ls -rt %REM_PATH%/*.exe | tail -n 1 | cut
-d / -f 5"`) DO (
SET NAME=%%F
)
pscp %HOST%:%REM_PATH%/%NAME% .
%NAME%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment