You are not logged in.
I have tried and tried to understand how to do this.
My brain just can't get the understanding it needs.
Here is what I want to do.
I want to change this line :
PRESETS=('default' 'fallback')
to be
PRESETS=('default')
It seems pretty easy , however the big problem is the single quotes.
I have read and tried every sed example but they don't work for me.
I either get no quotes or double "" quotes.
I can post all the things I have tried if you want me to.
I even tried the sed command to replace the line but I can't get that to work either.
Thanks
Offline
# sed -i '/^PRESETS=.*/ s/(.*)/('\'default\'')/' /etc/mkinitcpio.d/*.presetOffline
You don't need to use single quotes around the sed command:
sed "/^PRESETS=/s/'fallback'//""UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
That worked .
Thank you so much.
Is there a good resource to learn this sed commands?
I would like to dissect that command to understand how it works.
Offline
My favorite sed guide is also one of the greatest exemplars of the negative correlation between a website's aesthetic design and the quality of its content:
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
My favorite sed guide is also one of the greatest exemplars of the negative correlation between a website's aesthetic design and the quality of its content:
I second that, its a treasure trove of information for shell warriors
. But let me give you a free tip, @MAYBL8: never ever use shell scripting for configuration management, it is error-prone and time wasting. Use dedicated tools, start with ansible , it will cover 100% of your tasks you can think of. I will never go back to shell scripting for that even though I'm good at it.
Offline
I'm using it for an arch linux install script.
This is part of the script:
#Install polkit
yes | pacman -S polkit
#Decrease writes to the USB by using the noatime option in fstab
sed -i 's/relatime/noatime/' /etc/fstab
#Prevent the systemd journal from writing to the USB it will use RAM
mkdir -p /etc/systemd/journal.conf.d
echo [Journal] >> /etc/systemd/journal.conf.d/10-volatile.conf
echo Storage=volatile >> /etc/systemd/journal.conf.d/10-volatile.conf
echo SystemMaxUse=16M >> /etc/systemd/journal.conf.d/10-volatile.conf
echo RuntimeMaxUse=32M >> /etc/systemd/journal.conf.d/10-volatile.conf
#Disable the fallback image generation and remove it from PRESETS
sed -i '/^PRESETS=.*/ s/(.*)/('\'default\'')/' /etc/mkinitcpio.d/*.preset
#Remove the existing fallback image
rm /boot/initramfs-linux-fallback.imgI don't know how to put a link to my post here but it is in the Installation section called My installation script.
Thanks
Offline