Linux Ubuntu 下如何建立,編輯和運行*.tcl檔案__Linux

來源:互聯網
上載者:User

Linux Ubuntu 下如何建立,編輯和運行*.tcl檔案

 (2011-01-11 20:58:00)

1.建立

   例如想建立一個 *.tcl的檔案,只需在終端中輸入

   touch *.tcl 即可

 

註: 建立.tcl檔案的時候必須是在一般使用者下面建立,不要再root下面建立,否則許可權問題會很麻煩。 然後要開啟檔案進行編輯 gedit hellow.tcl 就可以進行編輯了 /// cat hellow.tcl其作用是在命令列中顯示裡  面的內容,而不是在編輯終端顯示。 save之後,直接  ./hellow.tcl 就可以運行了。 其中有些位置可能涉及到修改許可權的問題,直接chmod 777 directory 就可以

2.編譯

   可用不同的編譯器對 *.tcl檔案進行編譯

   1> vi *.tcl

   2> vim *.tcl

   3> gedit *.tcl

3.運行

   我是用ns2運行*.tcl檔案的

   所以運行時輸入的就是

   ns *.tcl

 

 

wrong # args: no script following"then" argument

在if else語句裡面,格式是一個比較Bug的問題,限制的比較死。

if {$x<0} then   {             //這裡的{必須要跟if在同一行中。。。

puts "The inputnumber $x less than 0"

}

extra characters after close-brace

 

}else   {                                //這裡出錯是因為else和前面的}之間沒有加上空格,導致識別不else

puts "The inputnumber $x ..."

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.