How does this shebang that starts with a double hyphen (--) work?
17
votes
2
answers
1624
views
I have found the following kind of shebang in the RosettaCode page:
--() { :; }; exec db2 -txf "$0"
It works for Db2, and a similar thing for Postgres. However, I do not understand the whole line.
I know the double dash is a comment in SQL, and after that it calls the Db2 executable with some parameters passing the file itself as file. But what about the parenthesis, the curly brakets, the colon and semi-colon, and how can replace a real shebang #! ?
https://rosettacode.org/wiki/Multiline_shebang#PostgreSQL
Asked by AngocA
(295 rep)
Dec 14, 2018, 09:47 PM
Last activity: Dec 15, 2018, 03:29 PM
Last activity: Dec 15, 2018, 03:29 PM