1/4
Flashcards cover appropriate and inappropriate file extensions for scripts using the #!/bin/bash shebang and explain the role of the shebang line.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What file extension is appropriate for a script that begins with "#!/bin/bash"?
.sh — This shebang specifies the Bash shell; Bash scripts conventionally use the .sh extension.
Why is the .vbs extension not appropriate for a script that begins with "#!/bin/bash"?
.vbs is for VBScript on Windows, which runs under Windows Script Host and does not use a shebang or the Bash shell.
Why is the .py extension not appropriate for a script that begins with "#!/bin/bash"?
.py denotes a Python script, typically using a shebang such as #!/usr/bin/python3; Python is a different language and interpreter from Bash.
Why is the .bat extension not appropriate for a script that begins with "#!/bin/bash"?
.bat files are Windows batch scripts executed by cmd.exe, not by the Bash interpreter, and they use different syntax and platforms.
What is the purpose of the shebang (#!) line at the top of a script?
It tells the operating system which interpreter to use (e.g., #!/bin/bash invokes the Bash shell).