日期:2014-05-16  浏览次数:20609 次

语句“LD_DEBUG=libs /u01/memcached/bin/memcached -h”的中间为啥不用分号?
在看memcache安装的一帖子,其中有如下一句
[root@centos2 ADunion]# LD_DEBUG=libs /u01/memcached/bin/memcached -h
我想,前面一句LD_DEBUG=libs应该是给变量赋值,后面一句应是调用memcache的命令。但根据常理,两句连写,中间应用 ;隔开,写成这样:
[root@centos2 ADunion]# LD_DEBUG=libs; /u01/memcached/bin/memcached -h

但作者为什么没加分号呢?这样写又包含什么含义呢?哪位明白人给解释下,先谢了。

------解决方案--------------------
这样用是只为这个进程定义一个环境变量的意思,等于先fork,再putenv,再exec。
------解决方案--------------------
LD_DEBUG
(glibc since 2.1) Output verbose debugging information about the dynamic linker. If set to all prints all debugging information it has, if set to help prints a help message about which categories can be specified in this environment variable. Since glibc 2.3.4, LD_DEBUG is ignored for set-user-ID/set-group-ID binaries. 
恩,确实是这样。