Forum Discussion

vvc5042_164605's avatar
vvc5042_164605
Icon for Nimbostratus rankNimbostratus
Jul 28, 2014

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!

 

3 Replies

  • Why don't you keep your bash script and use directly tmsh command by prefixing your command line with tmsh ?

     

  • 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

     

  • 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":

     

    http://www.tcl.tk/man/tcl8.4/

     

    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.