Search code examples
sqldatabaseshebangtextwrangler

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


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 ......

Solution

  • 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.