|Advanced Topics: Automating Tenup ||
While reading this manual you might have noticed that most, if not all, Tenup commands contain the same information. For instance, every example Tenup command in this guide contains -u [USERNAME] as part of the command. This is fine if you're only sending a single command. But what if you want to use Tenup to send 10 queries to 1010data? Or 100? In such a case, the easiest thing to do is set your username once so you don't have to include it in every single command. To help you do this, Tenup uses numerous Environment Variables that you can set to valid 1010data values as shown in the table below. This means that once you've set these values, you no longer have to include them in subsequent Tenup commands. The following table describes the available Tenup environment variables:
|Environment Variable||Equivelent Tenup Option/Switch||Description|
|TENTENGW||-g||Sets your 1010data gateway. You need to specify this value if you use a custom corporate gateway to access 1010data, or if you are interested in using specific version of 1010data. The default value is: https://www2.1010data.com/cgi-bin/gw.k|
|TENTENUID||-u||Your 1010data username. There is no default value for this variable.|
|TENTENPW||-p||Your 1010data password. No default for this variable.|
|TENTENPROXY||-P||Sets the proxy server for your Tenup session. No default for this variable.|
|TENTENSID||-s||Your 1010data Session ID. A unique identifier assigned to you when you begin your 1010data session. This can be used as an alternate method to authenticate with 1010data, so long as you have the same session open. We will go into greater detail about Session IDs in the next session.|
C:\> set TENTENGW=www.examplegateway.comOnce you send this command to Windows, this environment variable will be available to Tenup as long as you keep your command prompt open. If you include this line as part of a batch script, then the environment variable will be set every time you run the script. You can also permanently add any evironment variable to your Command Prompt by going to the Environment Variables dialog. This is found on the Advanced tab of the System Properties dialog.
$ export TENTENGW=www.examplegateway.comYou can also add environment variables to your shell environment permanently by adding an environment variable, like the example above, to your .profile or .bashrc file.
No matter which operating system you're working with, you should get in the habit of setting your environment variables at the very beginning of your shell script.