[ale] Determining a scripts language?

leam hall leamhall at gmail.com
Wed Apr 6 17:52:27 EDT 2016


I'm trying to do something simple, change the ending of a script to ".txt".
So if it's my_script.sh it becomes my_script.txt. Likewise for
my_script.rb, etc. The .txt version will have the documentation and
comments.

So far all I've some up with is:

  IS_SH=`echo ${SCRIPTNAME} | grep -c sh$`

For each expected script ending. Which seems a really ugly thing to do. Is
there a better way in Bourne shell to do this?

Leam

-- 
Mind on a Mission <http://leamhall.blogspot.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20160406/a5d3fde1/attachment.html>


More information about the Ale mailing list