tech-userlevel archive

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

Alternative to hash-bang



There is currently a discussion in the PostgreSQL list about how to get
unix systems to read an SQL script and run it without choking on
invalid statements such as "#! usr/whatever/bin/psql" at the top of the
file.  It occurred to me that the old hash-bang thing was a little
restrictive and perhaps it is time to add to the list of magic numbers
that run commands using alternative commenting character.  I am
thinking "--!!" for SQL scripts.  The ';' character is also common so
perhaps ";!" as well.  Those two, with "#!" probably cover 99% of the
possible commenting methods.  Would doing this interfere with anything
else?  Or should it be PostgreSQL's job to ignore the shebang if it sees
it at the start of its input?

By the way, "man magic" points to /usr/share/misc/magic which doesn't
actually exist.  There is a binary file /usr/share/misc/magic.mgc which
I assume has the data in a format that reads faster but maybe the
source information should be put into the file mentioned by the man
page.  If not then I think the man page should be fixed.

-- 
D'Arcy J.M. Cain <darcy%NetBSD.org@localhost>
http://www.NetBSD.org/ IM:darcy%Vex.Net@localhost


Home | Main Index | Thread Index | Old Index