小编jus*_*ing的帖子

Bash:“屏蔽返回值”是什么意思?

shellcheck 产生了以下警告

SC2155: Declare and assign separately to avoid masking return
values
Run Code Online (Sandbox Code Playgroud)

对于这行代码

local key_value=$(echo "$current_line" | mawk '/.+=.+/ {print $1 }')
Run Code Online (Sandbox Code Playgroud)

“屏蔽返回值”是什么意思,它与上述警告有什么关系?

bash shell-script shellcheck

12
推荐指数
1
解决办法
3135
查看次数

如何使用 mawk 指定正则表达式量词?

我熟悉指定有界正则表达式量词的概念如下:

Quantifier  Legend               Example    Sample Match

{3}         Exactly three times  \D{3}      ABC
{2,4}       Two to four times    \d{2,4}    156
{3,}        Three or more times  \w{3,}     regex_tutorialer
Run Code Online (Sandbox Code Playgroud)

但是,我无法mawk在手册页或在线找到与上述类似的内容。

mawk命令是否具有此功能,或者是否有不同的方式来实现相同的效果?

我正在使用版本 1.3.3

regular-expression mawk

3
推荐指数
1
解决办法
498
查看次数