You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title says. You would use the "-n" flag to read the value of a variable and assign it to a shell variable xy=$(fw_printenv -n xz)
But in the case that the U-Boot environment is empty and the value is fetched from default environment. The output is:
Environment WRONG, copy 0
Cannot read environment, using default
<value of xy>
where i only wanted the part.
While the second line goes to stdout and can be filtered by "2>/dev/null" the first one goes to stdout and breaks my script.
So my suggestion is to print debug and non-critical messages to stderr by default or handle the "-n" flag as quiet flag that suppresses such these messages.
I know that one of these messages can be disabled, when compiling with a defined NDEBUG, but this is not always doable and doesn't resolve the basic problem.
The text was updated successfully, but these errors were encountered:
piro-pp
changed the title
fw_printenv: debug output enabled by default breaks -n flag ins some cases
fw_printenv: debug output enabled by default breaks -n flag in some cases
Nov 15, 2024
As the title says. You would use the "-n" flag to read the value of a variable and assign it to a shell variable
xy=$(fw_printenv -n xz)
But in the case that the U-Boot environment is empty and the value is fetched from default environment. The output is:
where i only wanted the part.
While the second line goes to stdout and can be filtered by "2>/dev/null" the first one goes to stdout and breaks my script.
So my suggestion is to print debug and non-critical messages to stderr by default or handle the "-n" flag as quiet flag that suppresses such these messages.
I know that one of these messages can be disabled, when compiling with a defined NDEBUG, but this is not always doable and doesn't resolve the basic problem.
The text was updated successfully, but these errors were encountered: