Anyone have a good console one liner to output the patch-info for all available patches?
something like:
zypper lp | cut ??? | zypper patch-info
Anyone have a good console one liner to output the patch-info for all available patches?
something like:
zypper lp | cut ??? | zypper patch-info
While you can of course make every bunch of bash commands into a one liner by putting everything on one line with ; at the end of each command, that does not make it more understandable ;).
The following does shoe nice results here:
#!/bin/bash
zypper ref
zypper lp | grep 'Update' | while IFS='|' read X P X
do zypper patch-info ${P}
done
And that can be typed in one long line as:
zypper ref ; zypper lp | grep 'Update' | while IFS='|' read X P X ; do zypper patch-info ${P} ; done
Well, the forums software may brake down this into two lines, but it is in facct one line.
nice one, thanks
Hi,
This is my version, without the grep.
zypper lp | while IFS='|' read -ra line; do ${line[0]} = *update* ]] && zypper patch-info "${line[1]}"; done
or
while IFS='|' read -ra line; do ${line[0]} = *update* ]] && zypper patch-info "${line[1]}"; done < <(zypper lp)