Last active
August 29, 2015 14:19
-
-
Save andykais/d016d9aae9aec8fc8687 to your computer and use it in GitHub Desktop.
my bash code to prevent overwriting a file (and taking a screenshot with the filename)
This file contains hidden or 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 | |
i="0" | |
FILE="/home/andrew/Pictures/screenshots/screenshot($i).png" | |
while [ -f $FILE ]; | |
do | |
i=$[$i+1] | |
FILE="/home/andrew/Pictures/screenshots/screenshot($i).png" | |
done | |
import -window root $FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment