Differences

This shows you the differences between the selected revisions of the page.

2014-10-24 2014-10-24
is exist (martin) scripting#arguments and scripting#variables (martin)
Line 28: Line 28:
If you need to repeat the same task against multiple servers, instead of writing separate and almost identical [[scripting|scripts]] for each server, you can write one parametrized script. If you need to repeat the same task against multiple servers, instead of writing separate and almost identical [[scripting|scripts]] for each server, you can write one parametrized script.
-Following example is parametrized script that accepts one [[scripting#syntax|parameter]] with [[session_url|session URL]] and uploads a fixed local file to a fixed remote directory:+Following example is parametrized script that accepts one [[scripting#arguments|parameter]] with [[session_url|session URL]] and uploads a fixed local file to a fixed remote directory:
<code winscp> <code winscp>
Line 47: Line 47:
If the script has also other variable parts, like file to upload or remote directory, just replace those parts with additional parameters (''%2%'', ''%3%'', etc). If the script has also other variable parts, like file to upload or remote directory, just replace those parts with additional parameters (''%2%'', ''%3%'', etc).
-//Alternative to using ''/parameter'' switch is [[scripting#syntax|using environment variable in the script]].//+//Alternative to using ''/parameter'' switch is [[scripting#variables|using environment variable in the script]].//
Line 120: Line 120:
//Note that the expression after ''set STAMP='' shows how to extract individual date/time components, in case you need to interleave them by some punctuation. If not, you can replace it by simple ''%LDT:~0,14%''.// //Note that the expression after ''set STAMP='' shows how to extract individual date/time components, in case you need to interleave them by some punctuation. If not, you can replace it by simple ''%LDT:~0,14%''.//
-The ''script.txt'' should make use of the variable ''STAMP'' using ''%STAMP%'' [[scripting#syntax|syntax]]. For example:+The ''script.txt'' should make use of the variable ''STAMP'' using ''%STAMP%'' [[scripting#variables|syntax]]. For example:
<code winscp> <code winscp>

Last modified: by martin