-
Notifications
You must be signed in to change notification settings - Fork 0
awk
Amadeusz Wieczorek edited this page Aug 1, 2018
·
1 revision
Transforming flat list of nuget packages into a package\version\package.version.nupkg
For example: Microsoft.VisualStudio.CodeLens.Service.16.0.47-g2845e446ab.nupkg
-
ls -1 | awk -F '.' '{for (i=NF-3; i<(NF-1); i++) printf $i "." ; printf $(NF-1) "\n" }'
gets the version number -
ls -1 | awk -F '.' '{for (i=1; i<(NF-4); i++) printf $i "." ; printf $(NF-4) "\n" }'
gets the package name -
awk -F '.' '{for (i=1; i<(NF-4); i++) printf $i "." ; printf $(NF-4) "/"; for (i=NF-3; i<(NF-1); i++) printf $i "." ; printf $(NF-1) "\n"}'
gets the target path in the hierarchy