NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
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)