On Wed, Dec 31, 2008 at 06:26:43PM +0000, Adam D. Barratt wrote:
> It does, but only if it's one of the forms "source ./foo",
> "source /foo/bar" or "source $foo". I can't see any obvious reason from
> the changelog, that "source bar" isn't flagged, but I'm not currently
> sure whether there was a good reason it's not, or simply an omission.

Actually, it appears that it doesn't work for anything in quotes
either:

servo:/tmp/cdtemp.XcoaZB 0$ cat ./foo
#!/bin/sh
source "./bar"
servo:/tmp/cdtemp.XcoaZB 0$ checkbashisms -p ./foo
servo:/tmp/cdtemp.XcoaZB 0$ 

I guess I should have used that, since that was how I discovered it.

> > I must say I'm a bit surprised this hasn't come up before.  Why would
> > that be?  Makes me wonder...
> 
> Wonder what? Basically, you've found a corner case that's not currently
> covered; it's not entirely missing.

I didn't realize that those other cases were caught.  But also I would
have thought the quoted case would have come up more frequently as
well.  I pretty much always use quotes around variables, and I thought
that was a fairly common practice, which would mean something like
this would not be caught:

source "$DIR"/bar

But you're right, it is still a bit of a corner case.

Thanks for the response.

jamie.

Attachment: signature.asc
Description: Digital signature

Reply via email to