Created
August 19, 2015 00:59
-
-
Save rtrouton/81985ffb4865085724c8 to your computer and use it in GitHub Desktop.
Figuring out if a home folder was created today or not.
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
#!/bin/bash | |
homefolder="$(mdls -raw -name kMDItemFSCreationDate $HOME | awk '{ print $1 }')" | |
if [[ "$homefolder" == $(date +"%Y-%m-%d") ]]; then | |
echo "Created today!" | |
fi | |
if [[ "$homefolder" != $(date +"%Y-%m-%d") ]]; then | |
echo "Not created today!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment