Skip to content

Instantly share code, notes, and snippets.

@andykais
Last active August 29, 2015 14:19
Show Gist options
  • Save andykais/d016d9aae9aec8fc8687 to your computer and use it in GitHub Desktop.
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)
#!/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