Artificial intelligent assistant

Expand parameter in quotes in zsh I want to pass function arguments to zsh’s `emulate` to evaluate a command in bash emulation: $ .bash() { emulate bash -c "$*" } $ .bash 'source /path/to/script.sh' It’s ok but I want this without quotes like a precommand modifier (to use syntax highlighting, completion, etc.) as in $ .bash source /path/to/script.sh The problem arises when a command line contains quoted spaces: $ .bash source /path/to/"script with spaces".sh $ # I want it to expand to $ emulate bash -c 'source /path/to/"script with spaces".sh' $ # or the like I tried to play with different quotes and with `${(qq)*}` expansion flags. No good so far. Is there any way to achieve this?

You might have some success with


.bash() { emulate bash -c "$(echo ${(qq)@})" }

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy cb1673ca8552c87847a940152dc8a21d