C语言 Linux环境变量
2024-08-27 20:52:44
/*
*@author cody
*@date 2014-08-12
*@description
*/ /*
extern char **environ //environment values #include <stdlib.h>
char *getenv(const char *name);
int setenv(const char *name,const char *value,int rewrite); // set enviroment if exists rewrite - 0 do not rewrite not 0 rewrite
void unsetenv(const char *name); //delete env by name
*/ #include <stdio.h>
#include <stdlib.h> void environment(){
extern char **environ;
int i;
for(i = ;environ[i] != NULL;i ++){
printf("%s\n",environ[i] );
}
} void getPath(){ char *path = getenv("PATH");
printf("PATH = %s\n",path ); setenv("PATH","HELLO",);
path = getenv("PATH");
printf("PATH = %s\n",path ); } int main(int argc, char const *argv[])
{ //environment();
getPath();
return ;
}
最新文章
- UE4新手引导入门教程
- springMVC--@requestBody
- VirtualBox piix4_smbus Error
- c语言程序
- 我的面经(ing)
- dubbo源码分析1-reference bean创建
- B站运维团队成长的血泪史
- typedef (还需经常看看加深理解)
- ubuntu 错误 &; 解决
- [Angular 2 Router] Configure Your First Angular 2 Route
- iis启动网站提示 文件正在使用
- mvc给html扩展方法:
- Java 初学者帮助文档以及基础教程
- DataSet中取值(转)
- hdu4956 Poor Hanamichi
- crm使用soap删除实体
- UNIX网络编程——揭开网络编程常见API的面纱【上】
- HAOI(多省联考)2019退役记
- Qt Creator中根据为Windows系统还是Linux系统对源码进行条件编译
- <;基础>; PHP 进阶之 流程控制(Process)
热门文章
- appium+python自动化50-生成定位对象模板templet(jinja2)
- sql语句 -- 倒序 升序
- CDK上安装kube-dashboard
- [转]Understanding Integration Services Package Configurations
- yum安装 lnmp (linux+nginx+php7.1+mysql5.7)
- MFC 带Ribbonbar的窗口 实现全屏和取消全屏
- 绿化和卸载 DOS 批处理
- div 隐藏和显示
- 网页HTML代码:滚动文字的制作
- chrome浏览器 提示Adobe Flash Player未安装的解决方法