Ptouch

From Cheatsheet
Revision as of 15:21, 23 May 2011 by 69.16.222.26 (talk)
Jump to navigation Jump to search


#!/bin/bash

#**************************#
# Name: ptouch             #
# Version: 1.0             #
# Author: Kevin M. Johsnon #
#**************************#

#-------------#--------------------------------------------#
#  Change Log |                                            |
#-------------#--------------------------------------------#
# Date        # Change Description                         |
#-------------#--------------------------------------------#
# 2011-05-21  | Original utility creation.                 |
#-------------#--------------------------------------------#

if [ -e $1 ]
then 
   echo "The file $1 already exists. Launching vim." ;
   sleep 2;
   vim $1;
   exit;
fi

perl=`which perl`;

echo "#!$perl" > $1;
chmod u+x $1;
vim $1;