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

I've been trying to decipher this command for disabling encryption on Android for a while now but I can't figure it out.

  • This is probably the most common use of sed. What have you come up with in your deciphering? – Sparhawk Mar 22 '17 at 22:13
2

from 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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.