The remote FS root of the node will be the working directory for the script. If your shell script has no header line like #!/bin/sh —, then the shell configured system-wide will be used, but you can also use the header line to write script in another language (like #!/bin/perl) or control the options that shell uses.
By default, the shell will be invoked with the "-ex" option. So all of the commands are printed before being executed, and the script is considered a failure if any of the commands exits with a non-zero exit code. Again, add the #!/bin/... line to change this behavior.