My end-game here is to have the following:
$ python3 -c "print(\"Hello, world!\")"
Hello, world!
$ >>> print("Hello, world!")
Hello, world!
Basically, every time my command line starts with >>>, I want the rest of the command line to be fed to python3 with the -c switch.
If it was possible to declare (and use) a >>> function, it would be implemented as follow:
>>>() {
python3 -c "$@"
}
For the record, I'm using zsh.
My first try was to create an alias named >>>, but it's not valid on any of the two shells. Next I tried to create a >>> function, and even though it's valid on ZSH, there is seemingly no way to call it (be it with >>> or \>\>\>).
How can I achieve this?