Ptouch: Difference between revisions

From Cheatsheet
Jump to navigation Jump to search
Created page with ' #!/bin/bash #**************************# # Name: ptouch # # Version: 1.0 # # Author: Kevin M. Johsnon # #**************************# #-------------#…'
 
No edit summary
Line 2: Line 2:




#!/bin/bash
<pre>
#!/bin/bash


#**************************#
#**************************#
Line 31: Line 32:
chmod u+x $1;
chmod u+x $1;
vim $1;
vim $1;
</pre>

Revision as of 15:21, 23 May 2011


#!/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;