Bash Scripting - BasicsWhich of the following is the correct shebang line to run a script with Zsh?A#!/bin/bashB#!/bin/shC#!/usr/bin/fishD#!/usr/bin/env zshCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand shebang purposeShebang specifies which shell runs the script.Step 2: Identify correct path for ZshUsing /usr/bin/env zsh is portable and correct for Zsh scripts.Final Answer:#!/usr/bin/env zsh -> Option DQuick Check:Correct Zsh shebang = #!/usr/bin/env zsh [OK]Quick Trick: Use /usr/bin/env for portable shebangs [OK]Common Mistakes:MISTAKESUsing bash shebang for Zsh scriptsUsing sh shebang for ZshIncorrect path for fish shell
Master "Basics" in Bash Scripting9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Bash Scripting Quizzes Bash Scripting Basics - Making scripts executable (chmod +x) - Quiz 2easy Conditionals - if-elif-else - Quiz 4medium Conditionals - if-then-fi structure - Quiz 1easy Conditionals - Logical operators (-a, -o, !) - Quiz 2easy Quoting and Expansion - Escape characters (\) - Quiz 2easy Quoting and Expansion - Backticks and $() for command substitution - Quiz 5medium Quoting and Expansion - Why quoting rules prevent errors - Quiz 7medium Quoting and Expansion - Single quotes (literal strings) - Quiz 10hard User Input - read command - Quiz 4medium Variables - Environment variables vs local variables - Quiz 12easy