如何用c预处理器或unix脚本区分redhat和ubuntu?

时间:2012-07-23 09:25:08

标签: c ubuntu c-preprocessor preprocessor-directive

我是c编码的新手。我想知道c预处理器或unix脚本方法,当我编写跨平台代码时,我可以区分ubuntu和redhat。

还有其他方法可以区分redhat和ubuntu吗?

3 个答案:

答案 0 :(得分:1)

我希望以下链接能为您提供帮助。

http://www.novell.com/coolsolutions/feature/11251.html

答案 1 :(得分:0)

cat /etc/issue如果以“Ubuntu”开头,你可能正在使用Ubuntu。

答案 2 :(得分:0)

您可以查看/etc/lsb-release