Skip to content

Superfluous AWK helpers #3

@fjimenezone

Description

@fjimenezone

https://github.com/ibuetler/alpine-linux-setup/blob/d91492cc15ad9e83f70302e7b5237c8bc2890b5f/step1.sh#L3C1-L3C82

alpineversion=`cat /etc/alpine-release | cut -d "." -f 1-2 | awk '{print "v"$1}'`

In case you care about it, the AWK command can read a file by itself and also extract the fields that you tell it, eliminating the need for the commands cat and cut from the pipe.
e.i.

alpineversion=$(awk -F\. '{printf"v%s.%s", $1, $2}' /etc/alpine-release)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions