1
0

env.c 452 B

12345678910111213141516171819202122
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2010-11-17 Bernard first version
  9. */
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include <finsh.h>
  13. int libc_env()
  14. {
  15. printf("PATH=%s\n", getenv("PATH"));
  16. putenv("foo=bar");
  17. printf("foo=%s\n", getenv("foo"));
  18. return 0;
  19. }
  20. FINSH_FUNCTION_EXPORT(libc_env, get/set_env test);