wagoodman / dive

A tool for exploring each layer in a docker image
MIT License
44.53k stars 1.69k forks source link

Alternative to sed regexp #514

Open dxcSithLord opened 4 months ago

dxcSithLord commented 4 months ago

Not a bug, but have you considered, for readability,

curl -sL "https://api.github.com/repos/wagoodman/dive/releases/latest" | \
     grep '"tag_name":' | \
     awk -F'"' '{print $(NF-1)}'

with awk instead of using sed? The awk statement uses quote (") as the field separator, making the version one less than the NF (number of fields) Consider, also using "\" to wrap the lines so they can be seen more easily. The "\" must be followed by return and be the last character on the line (in case you did not know).

https://github.com/wagoodman/dive/blob/925cdd86482edec42185794620a1e616b79bbee5/README.md?plain=1#L100-L115

Just a suggestion.