Expect Script Import Format

This section shows examples of import files containing multiline scripts. The purpose of these examples are to show the format of the scripts in such files.

The JSON file format shows the line break characters (\n) in the multiline script. Note that the example here shows expect_script with three line breaks for display purposes.

{
 "meta": {},
 "resources": [
   {
     "meta": {
       "model_type": "data/ConfigurationTemplate",
       "pkid": "[pkid]",
       "schema_version": "0.1.8",
       "hierarchy": "sys",
       "tags": []
     },
     "data": {
       "target_model_type": "device/ios/Script",
       "name": "Multiline Test",
       "merge_strategy": "additive",
       "template": {
         "description": "Multiline Test",
         "expect_script": "ssh\nhost\npassword\n{{data.Countries.iso_country_code |
           country_name:'South Africa'}}\nping\nping {{data.Countries.iso_country_code |
           country_name:'South Africa'}}"
       }
     }
   }
 ]
}

A MS Excel sheet cell that contains a multiline script would display in the spreadsheet editor across multiple lines (Using <Alt>-<Enter> for line breaks in MS Excel). The content of the cell would then display as:

ssh
host
password
{{data.Countries.iso_country_code | country_name:'South Africa'}}
ping
ping {{data.Countries.iso_country_code | country_name:'South Africa'}}

These formats can also be obtained by exporting an existing expect script in either JSON or Excel.