Questions tagged «mawk»

5
如何在mawk中打​​印自己的脚本名称?
在bash中$0包含脚本的名称,但是在awk中,如果我使用以下内容创建名为myscript.awk的脚本: #!/usr/bin/awk -f BEGIN{ print ARGV[0] } 并运行它,它只会打印“ awk”。此外,i> 0的ARGV [i]仅用于命令行中的脚本参数。那么,如何使其打印脚本名称,在本例中为“ myscript.awk”?
13 awk  scripting  mawk 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.