O que esse comando sed faz?

0
sed -i "s/\bforceencrypt=/encryptable=/g;s/\bforcefdeorfbe=/encryptable=/g;s/\b,encryptable=footer//" "$fstab"

Estou tentando decifrar este comando para desativar a criptografia no Android há algum tempo, mas não consigo descobrir.

    
por Lightn1ng 22.03.2017 / 22:15

1 resposta

2

do info 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).
    
por 22.03.2017 / 23:11

Tags