| | 79 | A nice feature of bash is that you can make the '''query.sql''' file executable. First add the executable in the first line preceded by {{{#!}}}. It might then look like: |
| | 80 | {{{ |
| | 81 | #!/path/to/rootifysql |
| | 82 | SELECT 'Hello World!' |
| | 83 | }}} |
| | 84 | |
| | 85 | Now make it executable for yourself |
| | 86 | {{{ |
| | 87 | user@machine> chmod u+x query.sql |
| | 88 | }}} |
| | 89 | |
| | 90 | and you can call your query like |
| | 91 | {{{ |
| | 92 | user@machine> ./query.sql [options] |
| | 93 | }}} |
| | 94 | |
| | 95 | with the ![options] from {{{rootifysql}}}. If you prefix your query file with |
| | 96 | {{{ |
| | 97 | #!/path/to/rootifysql -C /path/to/resources.rc |
| | 98 | }}} |
| | 99 | |
| | 100 | you can even have a dedicated resource file. |
| | 101 | |
| | 102 | |
| | 103 | |