TextWrangler: This file doesn’t appear to contain a valid ‘shebang’ line

FranXh picture FranXh · Jun 18, 2013 · Viewed 11.9k times · Source

It is my first time working with TextWrangler. I am using it to open a .sql file. But when I try to run the file I get the following error:

 This file doesn’t appear to contain a valid ‘shebang’ line (application error code: 13304)

I tried to look at some other posts on StackOverflow, and I think I understood that the problem is the insertion of a line that contains the # symbol, but I cannot figure out how to fix it.

The file starts like this:

 BEGIN TRANSACTION;
 INSERT INTO ......

Answer

vilmoskörte picture vilmoskörte · Jul 13, 2013

Textwrangler is not a Database frontend nor can it execute SQL. You must specify a program to be executed when you select run from the menu. And this is done with the shebang line, which, for example, could be "#!/usr/bin/psql" (as first line of the file and w/o the quotes) if you want Postgresql's psql command to execute the SQL statements on a unixoid system.