<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Have you looked at basename and dirname?<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 6, 2016 at 5:52 PM, leam hall <span dir="ltr">&lt;<a href="mailto:leamhall@gmail.com" target="_blank">leamhall@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>I&#39;m trying to do something simple, change the ending of a script to &quot;.txt&quot;. So if it&#39;s my_script.sh it becomes my_script.txt. Likewise for my_script.rb, etc. The .txt version will have the documentation and comments. <br><br></div>So far all I&#39;ve some up with is:<br><br>  IS_SH=`echo ${SCRIPTNAME} | grep -c sh$`<br><br></div>For each expected script ending. Which seems a really ugly thing to do. Is there a better way in Bourne shell to do this?<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">Leam<br clear="all"><div><div><div><div><div><br>-- <br><div><div><a href="http://leamhall.blogspot.com/" target="_blank">Mind on a Mission</a></div></div>
</div></div></div></div></div></font></span></div>
<br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Pete Hardie<br>--------<br>Better Living Through Bitmaps</div>
</div>