[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#322848: lintian: false positive on possible bashism



On Fri, Aug 12, 2005 at 10:54:24PM -0300, Gustavo Noronha Silva wrote:
> While checking my package I got these:
> 
> W: devhelp: possible-bashism-in-maintainer-script preinst:5 '[ "$1" = "upgrade" -o '
> W: devhelp: possible-bashism-in-maintainer-script postrm:16 '&>'
> W: devhelp: possible-bashism-in-maintainer-script postrm:17 '&>'
> 
> The first one is a real problem, but the other two are not. The
> significant lines are:
> 
>     rmdir /etc/emacs/site-start.d > /dev/null 2&>1 || true
>     rmdir /etc/emacs > /dev/null 2&>1 || true
> 
> I believe lintian may be confusing that with simply using >&. I tried
> that kind of redirection on dash and surveyed #debian-devel. IIRC that
> kind was used exactly because of being POSIX compliant.

No, lintian is right. What you want to write is 2>&1. 2&>1 is completly
broken:
djpig@djpigpb:~/debian/tmp$ perl -e 'print STDERR "test\n";print "@ARGV\n"' 2&>1
djpig@djpigpb:~/debian/tmp$ cat 1
test
2

2 is interpreted as an option to the program here an &>1 redirects both
output file descriptors to the file 1 !

See also section 2.7.6 of POSIX for reference...

Gruesse,
-- 
Frank Lichtenheld <djpig@debian.org>
www: http://www.djpig.de/



Reply to: