Created
May 18, 2012 18:11
-
-
Save tachi-hi/2726806 to your computer and use it in GitHub Desktop.
A way to find the latest excel file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# >> ls *.xls | |
# xxx_v1.xls xxx_v10.xls xxx_v2.xls xxx_v3.xls | |
# | |
# we'd like to find the latest version. | |
ls *.xls | sed -e 's/.*_v\([0-9]*\).*/\1/g' | sort -n | tail -n 1 | |
# or | |
ls xxx*.xls | sed -e 's/.*_v\([0-9]*\).*/\1/g' | sort -n | tail -n 1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment