Skip to content

Commit

Permalink
doc: update awk.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Oct 30, 2022
1 parent e145ecc commit 333891b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/awk.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ awk 'BEGIN {
fruits["mango"] = "yellow";
fruits["orange"] = "orange"
for(fruit in fruits) {
print "The color of " fruit " is " fruits[fruit]
print fruit " 的颜色是 " fruits[fruit]
}
}'
```
Expand Down Expand Up @@ -367,27 +367,27 @@ Awk 函数

```shell
awk '
# Returns minimum number
# 返回最小数量
function find_min(num1, num2){
if (num1 < num2)
return num1
return num2
}
# Returns maximum number
# 返回最大数量
function find_max(num1, num2){
if (num1 > num2)
return num1
return num2
}
# Main function
# 主功能
function main(num1, num2){
result = find_min(num1, num2)
print "Minimum =", result
result = find_max(num1, num2)
print "Maximum =", result
}
# Script execution starts here
# 脚本执行从这里开始
BEGIN {
main(10, 60)
}
Expand Down

0 comments on commit 333891b

Please sign in to comment.