[Bug 409370] New: Adjustment of list results for easier postprocessing
https://bugzilla.novell.com/show_bug.cgi?id=409370 Summary: Adjustment of list results for easier postprocessing Product: openSUSE 11.0 Version: Final Platform: x86-64 OS/Version: openSUSE 11.0 Status: NEW Severity: Enhancement Priority: P5 - None Component: libzypp AssignedTo: zypp-maintainers@forge.provo.novell.com ReportedBy: Markus.Elfring@web.de QAContact: qa@suse.de Found By: --- A couple of software management subcommands return preformatted text tables. Example: Sonne:~ # zypper locks # | Name | Type | Repository ----+------------------------------+---------+----------- 1 | perl-SNMP | package | (any) 2 | libfmodex4 | package | (any) This default format is not easily useable for "foreach" loops in shell scripts. Would you like to provide additional command parameters for fine tuning of the list result? Use case: for XYZ in `zypper locks --name --list` ; do more_work $XYZ ; done I imagine that it will already help for some scripting languages if the horizontal delimiter for the table header could be omitted. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=409370
User jkupec@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=409370#c1
Ján Kupec
https://bugzilla.novell.com/show_bug.cgi?id=409370
User Markus.Elfring@web.de added comment
https://bugzilla.novell.com/show_bug.cgi?id=409370#c2
--- Comment #2 from Markus Elfring
Controlling the displayed columns with options is also an interesting idea.
I hope that this query interface will become smarter and more efficient than the following command. Example: Sonne:~ # date ; for XYZ in $(zypper locks | tail --lines +3 | cut --delimiter \| --fields 2) ; do echo unlock: $XYZ ; time zypper removelock $XYZ ; done Wed Jul 16 22:18:50 CEST 2008 unlock: perl-Set-Object Reading installed packages... Lock count has been succesfully decreased by: 1 real 0m40.951s user 0m10.324s sys 0m0.838s unlock: perl-Set-Scalar Reading installed packages... Lock count has been succesfully decreased by: 1 real 0m11.482s user 0m10.089s sys 0m0.640s unlock: perl-Socket6 Reading installed packages... Lock count has been succesfully decreased by: 1 real 0m11.314s user 0m9.945s sys 0m0.645s unlock: perl-Text-DelimMatch Reading installed packages... Lock count has been succesfully decreased by: 1 real 0m12.504s user 0m9.937s sys 0m0.733s unlock: perl-Time-Duration Reading installed packages... Lock count has been succesfully decreased by: 1 real 0m11.437s user 0m9.692s sys 0m0.690s unlock: perl-Time-Period Reading installed packages... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=409370
Ján Kupec
participants (1)
-
bugzilla_noreply@novell.com