How to use grep to get anything just after `name=`?

前端 未结 5 1507
执念已碎
执念已碎 2020-12-07 18:45

I’m stuck in trying to grep anything just after name=, include only spaces and alphanumeric.

e.g.:

name=some value here
<
5条回答
  •  遥遥无期
    2020-12-07 18:57

    grep does not extract like you expect. What you need is

    grep "name=" file.txt | cut -d'=' -f1-
    

提交回复
热议问题