46 lines
971 B
JSON
46 lines
971 B
JSON
{
|
|
"name": "awk",
|
|
"section": 1,
|
|
"title": "pattern scanning and processing language",
|
|
"synopsis": [
|
|
"awk [OPTION]... [OPERAND]..."
|
|
],
|
|
"description": "Pattern-directed scanning and processing. Engine in lib/awk-engine.js; not full POSIX awk.",
|
|
"options": [],
|
|
"keywords": [
|
|
"awk",
|
|
"pattern",
|
|
"field",
|
|
"script"
|
|
],
|
|
"seeAlso": [
|
|
{
|
|
"name": "sed",
|
|
"section": 1
|
|
},
|
|
{
|
|
"name": "grep",
|
|
"section": 1
|
|
}
|
|
],
|
|
"bareOsNotes": "See handbook ch.9 for divergence from Issue 7.",
|
|
"examples": [
|
|
{
|
|
"caption": "print column 1",
|
|
"code": "awk '{print $1}' file.txt"
|
|
},
|
|
{
|
|
"caption": "field separator",
|
|
"code": "awk -F: '{print $1}' /etc/passwd"
|
|
},
|
|
{
|
|
"caption": "sum numbers in first column",
|
|
"code": "awk '{s+=$1} END{print s}' nums.txt"
|
|
},
|
|
{
|
|
"caption": "lines matching /re/",
|
|
"code": "awk '/error/{print NR\": \"$0}' log.txt"
|
|
}
|
|
]
|
|
}
|