while and cats

Nathan Aubrey nathan at paysonlinux.org
Mon Feb 5 13:37:08 MST 2007


On Monday 05 February 2007, Eric "Shubes" wrote:
> Darrin Chandler wrote:
> > On Mon, Feb 05, 2007 at 01:23:32PM -0700, Eric Shubes wrote:
> >>> Check the manpage for bash to see about alternate
> >>> forms of <<EOF which ignore leading whitespace...
> >>
> >> Are there any? I hate the way inline files screw up my pretty
> >> formatting. :)
> >
> > Yes, at least in ksh. I'm sure bash can do it, too. In ksh you use "<<-"
> > instead of "<<" and it will strip any leading tabs from there here doc.
> > Note that it's TABS not WHITESPACE. So it's possible to have internal
> > indenting with spaces, but tab indented shell script.
>
> I just looked it up for yuks. bash appears to be the same. So, indent the
> EOF with tabs, and meaningful indentation should be done with spaces. I
> wonder how long I can remember that. ;)

Ahh, see that makes sense. I used TABS, but kwrite converts my tabs to 
whitespace, and I don't feel like changing that, so I will just have to lose 
some pretty formatting.  Oh well.


More information about the PLUG-discuss mailing list