多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
tcl作为一种解释型语言,和bash,fish,python一样,具有很多相似的性质,我们可以使用tcl扩展自己的命令,参数的传递和fish shell类似,使用argv实现 ```tcl yhp@yhp-PC /m/y/_/t/tcl> cat ~/bin/t_bin #!/usr/bin/env tclsh set dir [pwd] puts "$dir" puts "argv:$argv" puts "len:[llength $argv]" ``` 运行结果: ```shell yhp@yhp-PC /m/y/_/t/tcl> t_bin yhp hello /media/yhp/_dde_data/temp/tcl argv:yhp hello len:2 ``` ![](https://img.kancloud.cn/8c/59/8c59a8cdbd939eb5b90185328099fd16_682x291.png)