[SOLVED] scripts in UNIX & scripts in JAVA

shaharhada

Reputable
Jul 27, 2020
302
6
4,685
What are the different between them?
Is the terminology is the same in both software: the operating system UNIX and the programing language JAVA?
 
Solution
What are the different between them?
Is the terminology is the same in both software: the operating system UNIX and the programing language JAVA?
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.

kanewolf

Titan
Moderator
What are the different between them?
Is the terminology is the same in both software: the operating system UNIX and the programing language JAVA?
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.
 
Solution
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.