Last active
June 28, 2018 15:19
-
-
Save 7rin0/4d05e35ced811f4998d2447b4844d84b to your computer and use it in GitHub Desktop.
Shell > Keep the last 3 revisions
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
# oneline | |
RELEASE_NB=$(ls -tdr -- */ | cut -d'/' -f1 | wc -w) && RELEASE_NB_DIFF=$(echo $RELEASE_NB-3 | bc) && if test $RELEASE_NB > 3 ; then rm -rf $(ls -tdr -- */ | head -$RELEASE_NB_DIFF | cut -d'/' -f1) ; fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment