New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"lsblk -P -f" output cannot be parsed by shell #1201
Comments
Good point, it seems we have the same thing in lsipc and findmnt. The question if we need to care about it as there is always non-% variant of the number and you should not blindly use defaults (like -P) in your scripts as it is subject to change (as described in the man page). Now when I think about it then the column rename is a backwardly incompatible change, let's imagine you have
in your script. I think we should not touch the name, maybe improve the way how libsmartcols prints the variable name for -P: https://github.com/karelzak/util-linux/blob/master/libsmartcols/src/print.c#L474-L479 maybe remove % (and other bad chars) in from variable name or use some escape for %, or so. |
Maybe a search-replace for % -> PCT? Sucky I know |
The shells are very restrictive about variable names, only [:alnum:] chars are allowed (and alphabetic chars as the first char). The library will replace "bad" chars with "_". The char '%' at the end is replaced by _PCT. Addresses: #1201 Signed-off-by: Karel Zak <kzak@redhat.com>
Fixed. Note that we had an issue also with many variables (column names) like MIN-IO. |
Given:
Output is:
Given:
Error is:
Suggest removing the
%
from the variable name. Will send patch later if I have some free timeThe text was updated successfully, but these errors were encountered: