小编use*_*882的帖子

bash脚本中的egrep不起作用

我有这组命令:

s3ls="aws s3 ls $ssyss3/ --recursive --human-readable --summarize"
egrepCommand="egrep '$currentDate|Total'"
totalSize=$(echo $s3ls|$egrepCommand| awk -F 'Total Size:' '{print $2}'|sed '/^$/d')
echo $totalSize
Run Code Online (Sandbox Code Playgroud)

但我收到此错误:

egrep '2019-05-11|Total': command not found
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

grep bash alias command-substitution amazon-s3

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

标签 统计

alias ×1

amazon-s3 ×1

bash ×1

command-substitution ×1

grep ×1