From f6107116e8ae610d68c975fc2f6eded410857b77 Mon Sep 17 00:00:00 2001 From: Zaira <33151350+zairahira@users.noreply.github.com> Date: Wed, 2 Jul 2025 20:18:01 +0500 Subject: [PATCH] chore(curriculum): audit bash scripting quiz (#60462) --- .../66f1afbd9998e9c985d8e73b.md | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/curriculum/challenges/english/25-front-end-development/quiz-bash-scripting/66f1afbd9998e9c985d8e73b.md b/curriculum/challenges/english/25-front-end-development/quiz-bash-scripting/66f1afbd9998e9c985d8e73b.md index dbadd37341a..21b6df8e235 100644 --- a/curriculum/challenges/english/25-front-end-development/quiz-bash-scripting/66f1afbd9998e9c985d8e73b.md +++ b/curriculum/challenges/english/25-front-end-development/quiz-bash-scripting/66f1afbd9998e9c985d8e73b.md @@ -61,45 +61,45 @@ Which command would define `MY_VAR` and print it to the console? #### --text-- -How do you declare a numeric variable? +Which command is used to view all variables in the shell? #### --distractors-- -`declare -n MY_VAR=1` +`declare -n env` --- -`declare -d MY_VAR=1` +`declare -p env` --- -`declare -x MY_VAR=1` +`declare -x bashrc` #### --answer-- -`declare -i MY_VAR=1` +`declare -p` ### --question-- #### --text-- -Which command would not run a `script.sh` file? +Which command would run a `script.sh` file? #### --distractors-- -`./script.sh` +`script.sh bash` --- -`/tmp/script.sh` +`zsh ./script.sh` --- -`bash script.sh` +`./sh script.sh` #### --answer-- -`script.sh` +`./script.sh` ### --question-- @@ -127,7 +127,7 @@ How to view the manual for the `less` command in bash? #### --text-- -How would you call `print_arguments` to print `a` and `b` to the terminal? +How would you call the `print_arguments` function to print `a` and `b` to the terminal? ```bash print_arguments() { @@ -348,7 +348,7 @@ How would you assign the result of the sum of variables `A` and `B` to the varia --- -`C=$(( A + B ))` +`C=$( A + B )` --- @@ -356,29 +356,29 @@ How would you assign the result of the sum of variables `A` and `B` to the varia #### --answer-- -`C=$(( $A + $B ))` +`C=$(( A + B ))` ### --question-- #### --text-- -What keyword in a loop skips the rest of the current iteration and begins the next iteration? +Which command is used to create a new file? #### --distractors-- -`break` +`newfile` --- -`until` +`echo new_file` --- -`done` +`fileargs` #### --answer-- -`continue` +`touch` ### --question-- @@ -406,23 +406,23 @@ Prints the exit code of the last executed command. #### --text-- -What value of `MY_VAR` would satisfy the condition `[[ $MY_VAR =~ ^[A-Z]{1}[a-z]+$ ]]` ? +What advantage does Bash provide when testing parts of a script? #### --distractors-- -`freeCodeCamp` +Bash scripts must be compiled before testing --- -`FreeCodeCamp` +You can only test scripts using an IDE --- -`freecodecamp` +Bash automatically generates test cases #### --answer-- -`Freecodecamp` +Script sections can be pasted directly into the terminal for testing ### --question--