It would be nice if we could support script execution, bash / sh scripts are a common way to automate something, simply upload a script via SCP or download it via wget/curl and execute it.
This is easier said than done, first step is to recognize when we call scripts. We should consider that a client is attempting to call a file on the FS like ./somescript.sh or via bash somescript.sh. In the first case we have to check for the shebang line #!/bin/bash or #!/bin/sh. We don't have to do this if the script is envoked directly by the bash command.
Bash/sh scripts must be parsed and evaluated since it can contain commands(cat somefile), builtins(echo or alias) and even logic like for and if statements. Support for these features will likely be added gradually, but having some rudimentary support would be handy.
It would be nice if we could support script execution, bash / sh scripts are a common way to automate something, simply upload a script via SCP or download it via wget/curl and execute it.
This is easier said than done, first step is to recognize when we call scripts. We should consider that a client is attempting to call a file on the FS like
./somescript.sh
or viabash somescript.sh
. In the first case we have to check for the shebang line#!/bin/bash
or#!/bin/sh
. We don't have to do this if the script is envoked directly by thebash
command.Bash/sh scripts must be parsed and evaluated since it can contain commands(
cat somefile
), builtins(echo
oralias
) and even logic likefor
andif
statements. Support for these features will likely be added gradually, but having some rudimentary support would be handy.