RTEMS | libmisc/shell: Add -a to print all vars in the shell getenv command (!1241)
Chris Johns (@chris)
gitlab at rtems.org
Fri May 15 00:12:31 UTC 2026
Chris Johns commented on a discussion on cpukit/libmisc/shell/main_getenv.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1241#note_150139
>
> 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);
Fixed
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1241#note_150139
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/20260515/7a2866c0/attachment.htm>
More information about the bugs
mailing list