awk/sed to modify /etc/fstab
I'm in the process of learning sed/awk so I need a little help with editing the /etc/fstab.
I need it to take a specific line Code:
/dev/group/mine /my/stuff ext3 defaults 1 2 Code:
/dev/group/mine /my/stuff ext3 defaults,noauto 0 0 |
So what have you actually tried?
|
Learning awk/sed and modify /etc/fstab both should not be mixed. Actually /etc/fstab is a critical file and should not be used for experiments. And even if you want, then better to be take it's backup first.
Code:
~$ awk 'BEGIN{FS=" "}; /\/dev\/group\/mine/ {gsub(/defaults/,"defaults,noauto", $4) && (/1/,"0",$5) && (/2/,"0",$6); print $0}' /etc/fstab |
Thank you and I will test it prior to using it.
I'm working in a lab so it is ok if I blow things up. I just needed a bit of guidance, because these statements can get long. |
All times are GMT -5. The time now is 11:52 AM. |