Skip to content

0.5.12

Compare
Choose a tag to compare
@linux-china linux-china released this 19 Aug 16:09
· 261 commits to master since this release

awk file help support

You can add help information in awk file to make awk friendly, example as following:

#!/usr/bin/env zawk -f

# @desc this is a demo awk
# @meta author linux_china
# @meta version 0.1.0
# @var nick current user nick
# @var email current user email
# @env DB_NAME database name

then you can use ./demo.awk --help to get help support.

  • @desc: description for awk file
  • @meta: metadata for script, such as author, version etc.
  • @var: variable for script, email? means that the variable is optional. Access by awk -v varName="$PWD" ' END {print varName}'.
  • @env: environment variable, access by ENVIRON["USER"].