A script is just an interpreted (non-compiled) piece of code. The syntax is unique to the interpreter. The interpreter could be a Unix Shell like "sh" or "csh" that is reading the script and executing the commands or it could be a Perl, Ruby or Java executable that is reading the script and executing commands.
I would not call "Java source file" a "script", just because Java source is technically not interpreted but rather than compiled into an intermediate code which is then executed (interpreted). Most syntax errors would be detected during this "compile" phase.
Unix (sh, bash, etc) or Windows (cmd.exe, PowerShell) scripts are interpreted in their source form. Syntax errors would be detected when execution reaches that line.