我在看lnmp安装脚本的时候,有一段修改配置文件libc6-xen.conf的代码,不是特别理解。

php中文网
发布: 2016-12-01 00:56:55
原创
1873人浏览过

lnmp.org V1.3版本

有一个方法xen_hwcap_setting,我看把配置文件libc6-xen.confhwcap 1 nosegneg改为了hwcap 0 nosegneg,这样有什么作用吗?代码如下:

<code>Xen_Hwcap_Setting()
{
    if [ -s /etc/ld.so.conf.d/libc6-xen.conf ]; then
        sed -i 's/hwcap 1 nosegneg/hwcap 0 nosegneg/g' /etc/ld.so.conf.d/libc6-xen.conf
    fi
}</code>
登录后复制

到网上搜了一下,但不是特别明白,期待大家能给我解答,谢谢

============== 补充下 ===========

可能我问题提的有点问题,我更想知道的是,这个配置hwcap 1 nosegneg起什么作用?为什么要修改这个配置为hwcap 0 nosegneg

图改改
图改改

在线修改图片文字

图改改 455
查看详情 图改改

来自apt-browse的一段话.

# This directive teaches ldconfig to search in nosegneg subdirectories
# and cache the DSOs there with extra bit 1 set in their hwcap match
# fields. In Xen guest kernels, the vDSO tells the dynamic linker to
# search in nosegneg subdirectories and to match this extra hwcap bit
# in the ld.so.cache file.
hwcap 1 nosegneg

回复内容:

lnmp.org V1.3版本

有一个方法xen_hwcap_setting,我看把配置文件libc6-xen.confhwcap 1 nosegneg改为了hwcap 0 nosegneg,这样有什么作用吗?代码如下:

<code>Xen_Hwcap_Setting()
{
    if [ -s /etc/ld.so.conf.d/libc6-xen.conf ]; then
        sed -i 's/hwcap 1 nosegneg/hwcap 0 nosegneg/g' /etc/ld.so.conf.d/libc6-xen.conf
    fi
}</code>
登录后复制

到网上搜了一下,但不是特别明白,期待大家能给我解答,谢谢

============== 补充下 ===========

可能我问题提的有点问题,我更想知道的是,这个配置hwcap 1 nosegneg起什么作用?为什么要修改这个配置为hwcap 0 nosegneg

来自apt-browse的一段话.

# This directive teaches ldconfig to search in nosegneg subdirectories
# and cache the DSOs there with extra bit 1 set in their hwcap match
# fields. In Xen guest kernels, the vDSO tells the dynamic linker to
# search in nosegneg subdirectories and to match this extra hwcap bit
# in the ld.so.cache file.
hwcap 1 nosegneg

-s在shell文件判断中的意思是文件是否有内容,如果没有内容,就执行下面的sed
至于最开始的

<code>test_name()
{

}</code>
登录后复制

其实就是一个函数!

sed使用参数

<code>
-i :直接修改读取的文件内容,而不是输出到终端

   </code>
登录后复制

数据的搜寻并替换
除了整行的处理模式之外, sed 还可以用行为单位进行部分数据的搜寻并取代。基本上 sed 的搜寻与替代的与 vi 相当的类似!他有点像这样:

<code>
sed 's/要被取代的字串/新的字串/g'

</code>
登录后复制

所以你这句代码的意思是

<code>全局把hwcap 1 nosegneg替换成hwcap 0 nosegneg</code>
登录后复制
相关标签:
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门推荐
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号