[ale] Determining a scripts language?

leam hall leamhall at gmail.com
Wed Apr 6 18:34:24 EDT 2016


Both. I'm going to write a script in X language, and put comments in that
help document things. That script will be in a tools directory, or similar.
I'll then run make_doc.sh tools/my_script.sh and it will pull all the
comment into HOWTO/my_script.txt. The issue is the sed of sh, rb, pl, py,
etc to txt.

Make sense? It will only run one script at a time.


On Wed, Apr 6, 2016 at 6:27 PM, Pete Hardie <pete.hardie at gmail.com> wrote:

> Is the issue that you don't want a separate command for each suffix, or
> that you will not know all the suffixes ahead of time?
>
> On Wed, Apr 6, 2016 at 6:22 PM, Scott M. Jones <eff at dragoncon.org> wrote:
>
>> Great answers in Stack Overflow, including a bash-only solution.
>>
>>
>> http://stackoverflow.com/questions/15060384/one-liner-in-bash-using-perl-or-awk-to-change-extension-of-multiple-files
>>
>> On 4/6/16 5:52 PM, leam hall wrote:
>> > 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
>>
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo
>>
>
>
>
> --
> Pete Hardie
> --------
> Better Living Through Bitmaps
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>


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


More information about the Ale mailing list