Script File Extensions and Shebangs

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/4

flashcard set

Earn XP

Description and Tags

Flashcards cover appropriate and inappropriate file extensions for scripts using the #!/bin/bash shebang and explain the role of the shebang line.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

5 Terms

1
New cards

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.

2
New cards

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.

3
New cards

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.

4
New cards

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.

5
New cards

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).