Skip to content

Instantly share code, notes, and snippets.

@lyndell

lyndell/by.sh

Last active Jul 10, 2016
Embed
What would you like to do?
Open a new file in ByWord
#/bin/bash -x
#
# Copyright (c) 2015 Lyndell Rottmann
#
# Debug mode on/off: (default off)
set +x
if [[ "$OSTYPE" == "darwin"* ]]; then
if [ ! $1 ]
then
echo "No file specified."
exit;
else
file=$1
# if file doesn't exist, create it.
if [ ! -e $file ]
then
touch $file
fi
open -a byword $file
fi
else
# Not a Mac
echo "Byword is a Mac only application.\n"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment