SED failed
-
This post is deleted!
-
@Rudy-Trujillo
Using double quotes in the sed command worked on my end:root@Omega-18C2:/# echo "'0''0'" | sed -e "s/'0'/'1'/g" '1''1'
-
This post is deleted!
-
@Rudy-Trujillo what's the intent of the script? can you show me the current line in the code and what you want to change it to?
-
@Lazar-Demin My guess is that what @Rudy-Trujillo is trying to do is to write a script that modifies /etc/config/fstab after performing a pivot-overlay method from https://wiki.onion.io/Tutorials/Using-USB-Storage-as-Rootfs
There, in Step 4 it says that after running block detect > /etc/config/fstab it is necessary to:
a. Change option target '/mnt/sda1' to option target '/overlay'
b. Change option enabled '0' to option enabled '1'I think he wants a script to automate this. I could be wrong, but that's my guess.
-
Ah ok, here's what I would do:
cat /etc/config/fstab | sed -e 's/\/mnt\/sda1/\/overlay/' -e "s/enabled[[:space:]]*'0'/enabled '1'/"
Seemed to work on my end. To write it back to the file, add
| tee /etc/config/fstab
to the end of the line
-
This post is deleted!
-
@Rudy-Trujillo no problem,
I love getting people hooked onsed