env.c 449 B

12345678910111213141516171819202122
  1. /* vim: tabstop=4 shiftwidth=4 noexpandtab
  2. * This file is part of ToaruOS and is released under the terms
  3. * of the NCSA / University of Illinois License - see LICENSE.md
  4. * Copyright (C) 2013-2018 K. Lange
  5. *
  6. * env - Print environment
  7. *
  8. * Prints all the environment values.
  9. */
  10. #include <stdio.h>
  11. #include <unistd.h>
  12. int main(int argc, char ** argv) {
  13. char ** env = environ;
  14. while (*env) {
  15. printf("%s\n", *env);
  16. env++;
  17. }
  18. return 0;
  19. }