Database Reference
In-Depth Information
Five Types of Command-Line Tools
We employ the term “command-line tool” a lot, but we have not yet explained what
we actually mean by it. We use it as an umbrella term for anything that can be exe‐
cuted from the command line. Under the hood, each command-line tool is one of the
following five types:
• A binary executable
• A shell builtin
• An interpreted script
• A shell function
• An alias
It's good to know the difference between the types. The command-line tools that
come pre-installed with the Data Science Toolbox mostly comprise the first two types
(binary executable and shell builtin). The other three types (interpreted script, shell
function, and alias) allow us to further build up our own data science toolbox 2 and
become more efficient and more productive data scientists.
Binary executable
Binary executables are programs in the classical sense. A binary executable is cre‐
ated by compiling source code to machine code. This means that when you open
the file in a text editor you cannot read its source code.
Shell builtin
Shell builtins are command-line tools provided by the shell, which is Bash in our
case. Examples include cd and help . These cannot be changed. Shell builtins may
differ between shells. Like binary executables, they cannot be easily inspected or
changed.
Interpreted script
An interpreted script is a text file that is executed by a binary executable. Exam‐
ples include: Python, R, and Bash scripts. One great advantage of an interpreted
script is that you can read and change it. Example 2-3 shows a script named ~/
book/ch02/fac.py . This script is interpreted by Python not because of the file
extension .py , but because the first line of the script specifies the binary that
should execute it.
2 Here, we do not refer to the literal Data Science Toolbox we just installed, but to having your own set of tools
in a figurative sense.
 
Search WWH ::




Custom Search