Forum Discussion
Commands in TMSH scripting
Hi all,
I'm looking automate the creation of nodes/pools/and virtual servers by creating a TMSH script which I can run, input values and create my virtual server.
I've already created a script through bash using such commands as echo and read to put out questions such as "Enter a node name = " and then reading in a variable titled NODE_NAME.
I want to do the same in TMSH scripting but I can't seem to find what commands to use.
For examples, what does "set" or "puts" do? What command can I use in place of the "read" command in bash.
Thanks!
- Kevin_StewartEmployee
I'll refer you to the TMSH wiki for information on TMSH-specific commands:
https://devcentral.f5.com/wiki/TMSH.Commands.ashx
and to the official TCL wiki for information on TCL commands like "set" and "puts":
TCL/TMSH isn't nearly as flexible as Bash (but then what is?), so you're likely going to have a difficult time with things like user prompts. The best alternative may simply be to craft command line arguments and helpful outputs to show the required syntax of the commands.
- vvc5042_164605Nimbostratus
For anyone who might also be interested in this question and further TMSH script learning, I've found the answer through further research under DevCentral articles on TMSH scripting.
This article will provide anyone with similar questions alternative options to using bash through the TMSH interface by using tcl.
https://devcentral.f5.com/articles/tmsh-scripting-in-v101
- Arnaud_LemaireEmployee
Why don't you keep your bash script and use directly tmsh command by prefixing your command line with tmsh ?
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com