Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGmrn-0005RW-W1 for pgsql-general@arkaria.postgresql.org; Thu, 10 May 2018 14:48:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fGmrm-0000sK-N9 for pgsql-general@arkaria.postgresql.org; Thu, 10 May 2018 14:48:22 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGmrm-0000rf-Bq for pgsql-general@lists.postgresql.org; Thu, 10 May 2018 14:48:22 +0000 Received: from 23-25-19-49-static.hfc.comcastbusiness.net ([23.25.19.49] helo=jeeves.wrkhors.com) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fGmrg-0001LE-Sw for pgsql-general@lists.postgresql.org; Thu, 10 May 2018 14:48:20 +0000 Received: from wrkhors.com (localhost [127.0.0.1]) by jeeves.wrkhors.com (Postfix) with ESMTP id A816331C753; Thu, 10 May 2018 09:59:15 -0500 (CDT) Date: Thu, 10 May 2018 09:46:40 -0500 From: Steven Lembark To: pgsql-general@lists.postgresql.org Cc: lembark@wrkhors.com Subject: Re: Enhancement to psql command, feedback. Message-ID: <20180510094640.29cd4d76@wrkhors.com> In-Reply-To: <090b3dc0-b817-0368-c437-ef85d20cb67d@gmail.com> References: <090b3dc0-b817-0368-c437-ef85d20cb67d@gmail.com> Organization: Workhorse Computing MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk The whole point of "#!" working in shell is that the two-bytes (a) mark the file as executable by a specific shell command and (b) are a shell comment. One fairly simple fix that would make annotating here scripts and the like simpler for shell(ish) execution would be simply ignoring all text from "\n#" to the first "\n", which would allow the #! to function as a comment -- just as it does in the shell. Another way to do it would be adding a '#' command to psql, similar to '\', that accepts a one-line directive and ignores it entirely. This would use the existing framework for detecting the context of '\' as a command, just with a different magic char. -- Steven Lembark 1505 National Ave Workhorse Computing Rockford, IL 61103 lembark@wrkhors.com +1 888 359 3508