AK2: fix patch_fstab substring replacement
- the 'original string' ($5) was not being used, instead the entire part was always being replaced with the 'replacement string' ($6) - replace the target 'original string' of the entry part with 'replacement string' as expected/intended NOTE: any properly written patch_fstab commands with original string as the complete original part WILL remain working as this is a backwards compatible change
This commit is contained in:
1 parent
65019b0f49
commit
aa1377c9ab
1 file changed
+2
-1
+2
-1
@@ -364,7 +364,8 @@ patch_fstab() {
|
||||
options) part=$(echo "$entry" | awk '{ print $4 }');;
|
||||
flags) part=$(echo "$entry" | awk '{ print $5 }');;
|
||||
esac;
|
||||
newentry=$(echo "$entry" | sed "s;${part};${6};");
|
||||
newpart=$(echo "$part" | sed "s;${5};${6};");
|
||||
newentry=$(echo "$entry" | sed "s;${part};${newpart};");
|
||||
sed -i "s;${entry};${newentry};" $1;
|
||||
fi;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user