Newer
Older
Import / code / Scripts / scriptify.sh
@John John on 29 Dec 2020 828 bytes bulk import from macbookpro checkouts
#!/bin/bash
#===============================================================================
#
#          FILE:  scriptify.sh
# 
#         USAGE:  ./scriptify.sh filename
# 
#   DESCRIPTION:  Turns a file into bash script code for embedding in a script
# 
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  Filename can't have any slashs or funny characters in it
#         NOTES:  ---
#        AUTHOR:  John Ryland (jryland@xiaofrog.com)
#       COMPANY:  InvertedLogic
#       VERSION:  1.0
#       CREATED:  12/26/07 14:05:38 CST
#      REVISION:  ---
#===============================================================================
cp $1 $1.sh
sed -i "" -e 's/\\/\\\\/g' $1.sh
sed -i "" -e 's/\$/\\\$/g' $1.sh
sed -i "" -e 's/"/\\"/g' $1.sh
sed -i "" -e 's/^/echo "/g' $1.sh
sed -i "" -e "s/\$/\" >> $1/g" $1.sh