11.07.2015 Views

NetEx EFT213 Reference Manual Rel 5.4

NetEx EFT213 Reference Manual Rel 5.4

NetEx EFT213 Reference Manual Rel 5.4

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

To invoke the alias with the same parameters that were embedded in the alias earlier, a user would type:eFT> fetch guest netex sourcefileParameter 1, represented as {1}, gets replaced by ‘guest’, parameter 2, represented as {2}, gets replaced by‘netex’, and parameter 3, represented as {3}, gets replaced by ‘sourcefile’. The actual commands that get executedwould be equivalent to typing the following:eFT> connect hosta guest netexeFT> receive sourcefileeFT> disconnectNow refer back to the empty ‘{}’ used in the definition of FETCH earlier. This special notation is used to tell<strong>NetEx</strong>/eFT to “turn off” parameter substitution while the alias is being defined. The empty ‘{}’ is crucialwhen defining aliases that use positional parameters or any string substitution (refer to “<strong>NetEx</strong>/eFT StringSubstitution” on page 62). If parameter substitution is not turned off <strong>NetEx</strong>/eFT will attempt to replace thepositional parameters with their values at the time the alias is defined (which generally means they get replacedwith a null string). The empty ‘{}’ may be placed anywhere within the alias definition and turns offstring substitution until the alias definition ends or another ‘{}’ is encountered.Notice that the empty ‘{}’ appears only on the first line even though the second line is referencing positionalparameter 3. The empty ‘{}’ is really a toggle that turns string substitution from off to on (or from on to off)each time it is encountered within a definition. See the section entitled “Disabling String Substitution” onpage 88 for further details.Accepting Input within a <strong>NetEx</strong>/eFT AliasAlthough aliases that accept parameters are more flexible than those that do not, it may become confusing to anew user which parameters to pass and in what order. Therefore, a more desirable solution is to create aliasesthat prompt for input. Refer once again to the FETCH alias defined in the previous section. It was set up totake three parameters: userid, password, and file name. FETCH can be made much more usable by having itprompt for the required parameters, as follows:eFT> set alias fetch {} -More>> ask -prompt "User Id? " uidMore>> ask -prompt "Password? " -secure pw !More>> ask -prompt "File Name? " fname !More>> connect hosta {uid} {pw} !More>> receive {fname} !More>>disconnectNote the empty ‘{}’ again. These tell <strong>NetEx</strong>/eFT not to perform string substitution (in this case on variablesuid, pw, and fname), until the alias is actually executed. The dash (-) on the first line is used to tell<strong>NetEx</strong>/eFT to continue the definition on the next line.Quickly breaking this alias apart, the first line simply prompts the user for a userid and reads the response intovariable uid. The next line prompts for a password and reads the result into variable pw. (The SECUREqualifier is used to tell <strong>NetEx</strong>/eFT not to echo the response back to the terminal. It should be noted that someversions of <strong>NetEx</strong>/eFT cannot support this feature due to operating system limitations. For more information,refer to the ASK command in the “Command Descriptions” on page 115.) Next, the file name is requestedand read into variable fname. The CONNECT and RECEIVE commands are then issued with the appropriatevariables to be substituted. Finally the DISCONNECT is performed.To run the new FETCH alias, a user need not know anything about the parameters; the alias will take care ofthat by prompting for them. Below is an example execution of FETCH, including user responses:REF-eFT213-R<strong>5.4</strong>-08 Advanced Local User’s Guide Page 99

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!