You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Bash script uses the OpenAI API to generate a response to a user-specified
query using the GPT-3 language model. The response is appended to a specified
context file, which contains the history of messages and responses.
"You got your markdown in my shell script!" "No, you got your shell script in my markdown!"
Mixed Markdown and Shell Scripting
: By the power of this magic string: ex: set ft=markdown ;:<<'```shell' #, this file is now both a markdown document and an executable shell script. chmod +x it and try running it!
The above line does just what it says. More specifically, when placed within in the first 5 lines and preceded only by blank lines or #-prefixed markdown headers:
The first part of the magic string makes github and various editors (e.g. atom with the vim-modeline packge) treat the file as having markdown syntax (even if the file doesn't have an extension)
The second part (if run in a shell), makes the shell skip execution until it encounters the next ```shell block.
(The line also has to start with a : so that it's valid shell code.)