Bash - change path to the folder with the highest version number
问题 I have the below folder structure MyPackage └── versions └── MyPackage-1.0 └── src MyPackage-1.0.1 └── src MyPackage-2.0 └── src I am writing a bash script to build the latest version of the package and retrieve the build artifact. Part of that step is to change to the directory of the latest package: cd MyPackage/versions/MyPackage-2.0/src How can I write my bash script such that it will always choose the highest version subfolder (so in this case MyPackage-2.0 but in the future it could