这个 sed 命令有什么作用?

这个 sed 命令有什么作用?
sed -i "s/\bforceencrypt=/encryptable=/g;s/\bforcefdeorfbe=/encryptable=/g;s/\b,encryptable=footer//" "$fstab"

我一直试图破译这个在 Android 上禁用加密的命令有一段时间了,但我无法弄清楚。

答案1

来自信息 sed:

's/REGEXP/REPLACEMENT/[FLAGS]'
     (substitute) Match the regular-expression against the content of
     the pattern space.  If found, replace matched string with
     REPLACEMENT.

 The 's' command can be followed by zero or more of the following
FLAGS:

'g'
     Apply the replacement to _all_ matches to the REGEXP, not just the
     first.

'NUMBER'
     Only replace the NUMBERth match of the REGEXP.
...................................................................

Command Line Options: 
'-i[SUFFIX]'
'--in-place[=SUFFIX]'
     This option specifies that files are to be edited in-place.  GNU
     'sed' does this by creating a temporary file and sending output to
     this file rather than to the standard output.(1).

相关内容