【发布时间】:2016-02-19 06:08:54
【问题描述】:
好的,所以我不久前发布了此内容,但找不到太多帮助。但是我正在为我正在上课的虚拟盒子上为gentoo制作一个自动安装脚本。我的脚本可以正确分区、正确下载 tarball(& 解压),并且我也在正确地进行 CHROOTing。
无论如何,我正在尝试使用 sed 来更改我的 make.conf,如下所示:
sed -i 's/CFLAGS="-02 -pipe"/CFLAGS="-march=native -02 -pipe"/g' /mnt/gentoo/etc/portage/make.conf
运行后,我有一个“cat /mnt/gentoo/etc/portage/make.conf”来查看文件是否有效。它没有。如果有帮助的话,sed 的版本是 4.2.1。不知道我做错了什么。
【问题讨论】:
-
make.conf 的相关部分是什么?
-
@choroba 你是什么意思?
-
你能显示你想替换的 make.conf 中的确切行吗?
-
@choroba 这条线是:CFLAGS="-02 -pipe"
-
发布
[[ -w /mnt/gentoo/etc/portage/make.conf ]] && echo okay || echo "not okay"和sed -n '/CFLAGS="-02 -pipe"/p' /mnt/gentoo/etc/portage/make.conf和sed --version | head -n 1的输出。