• Tcl之Intro


      Tool command language, a widely used scripting tool that was deveoped for controlling and extending appliations.

    1  Run

      When you have installed Tcl, the program you will then call to utilize it is tclsh.

      For instance, if you write some code to a file "hello.tcl", and you want to execute it, you would do it like so: tclsh hello.tcl

    2  UNIX Tcl scripts (type "tclsh")

       1) putswrites the string to I/O steam 

     1 puts "Hello, World - In quotes"    ; # This is a comment after the command.
     2 puts {Hello, World - In Braces}
     3 puts {Bad comment syntax example}   # *Error* - there is no semicolon 
     4  
     5 puts "line 1"; puts "line 2"
     6  
     7 puts "Hello, World; - With  a semicolon inside the quotes"
     8  
     9 # Words don't need to be quoted unless they contain white space:
    10 puts HelloWorld

      

       2) set - assign a value to a variable

      The dollar sign $ tells Tcl to use the value of the variable - in this case X or Y.

     1 set X "This is a string"
     2 
     3 set Y 1.24
     4 
     5 puts $X
     6 puts $Y
     7 
     8 puts "..............................."
     9 
    10 set label "The value in Y is: "
    11 puts "$label $Y"
  • 相关阅读:
    redis数据结构-list
    reids数据结构1-string
    jedis工具类
    静态资源放行
    SpringMVC拦截器
    xinetd
    Linux-open函数
    Linux简单的文件读取
    复习ssm02
    springMVC文件上传
  • 原文地址:https://www.cnblogs.com/mengdie/p/4347943.html
Copyright © 2020-2023  润新知