Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@travishen
Created June 28, 2021 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save travishen/b70fb01130fb4131ee9b151313a941d8 to your computer and use it in GitHub Desktop.
Save travishen/b70fb01130fb4131ee9b151313a941d8 to your computer and use it in GitHub Desktop.
模式 操作 說明
1 模式為真,默認為打印
NR > 0 { print } 有紀錄時打印(恆真)
1 { print } 模式為真,則打印(預設值)
{ print } 無模式則為真,明確的打印
$1 ~ /jones/ 選定字段 1 包含 jones 的紀錄
(FNR == 3), (FNR == 10) 選定每個輸入文件的第 3 至第 10 筆紀錄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment