RTEMS | libmisc/shell: Add -a to print all vars in the shell getenv command (!1241)

Kinsey Moore (@opticron) gitlab at rtems.org
Thu May 14 14:05:18 UTC 2026




Kinsey Moore started a new discussion on cpukit/libmisc/shell/main_getenv.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1241#note_150069

 >  
 >    if (argc != 2)
 >    {
 > -    printf ("error: only argument is the variable name\n");
 > +    printf ("error: -a or the variable name\n");
 >      return 1;
 >    }
 >  
 > +  if (strcmp("-a", argv[1]) == 0) {
 > +    char** e = environ;
 > +    while (e != NULL && *e != NULL) {
 > +      printf("%s\n", *e);

Formatting in this file appears to use a space between the function name and parameter list.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1241#note_150069
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260514/886495b9/attachment-0001.htm>


More information about the bugs mailing list