Skip to content

Instantly share code, notes, and snippets.

@nfreader
Forked from prophile/delete-or-create.sh
Created September 30, 2011 17:51
Show Gist options
  • Save nfreader/1254475 to your computer and use it in GitHub Desktop.
Save nfreader/1254475 to your computer and use it in GitHub Desktop.
#!/bin/bash
DATE=$(date +%Y-%m-%d-%Hh%M);
if [ -e $1 ]; then
rm -f $1
EVENT="removed"
else
touch $1
EVENT="placed"
fi
MSG="$DATE $EVENT $1"
echo $MSG >> errorlog.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment