0
0
Bash Scriptingscripting~10 mins

Brace expansion ({1..10}) in Bash Scripting - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to print numbers from 1 to 10 using brace expansion.

Bash Scripting
echo [1]
Drag options to blanks, or click blank then click option'
A[1..10]
B(1..10)
C<1..10>
D{1..10}
Attempts:
3 left
💡 Hint
Common Mistakes
Using square brackets [] instead of curly braces.
Using parentheses () instead of curly braces.
Using angle brackets <> instead of curly braces.
2fill in blank
medium

Complete the code to create files named file1 to file10 using brace expansion.

Bash Scripting
touch file[1]
Drag options to blanks, or click blank then click option'
A{1..10}
B[1..10]
C(1..10)
D<1..10>
Attempts:
3 left
💡 Hint
Common Mistakes
Using square brackets instead of curly braces.
Using parentheses instead of curly braces.
Using angle brackets instead of curly braces.
3fill in blank
hard

Fix the error in the code to print numbers 1 to 10 using brace expansion.

Bash Scripting
echo {1.[1]10}
Drag options to blanks, or click blank then click option'
A.
B...
C..
D,
Attempts:
3 left
💡 Hint
Common Mistakes
Using a single dot instead of two dots.
Using three dots or a comma instead of two dots.
4fill in blank
hard

Fill both blanks to create a sequence of letters from a to j using brace expansion.

Bash Scripting
echo [1][2]
Drag options to blanks, or click blank then click option'
A[a..j]
B{a..j}
C{1..10}
D(a..j)
Attempts:
3 left
💡 Hint
Common Mistakes
Using square brackets or parentheses instead of curly braces.
Adding extra characters after the brace expansion.
5fill in blank
hard

Fill the blank to create files named img01.jpg to img10.jpg using brace expansion.

Bash Scripting
touch img[1].jpg
Drag options to blanks, or click blank then click option'
A{01..10}
B1
Cjpg
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using {1..10} without leading zero padding.
Using incorrect brace expansion syntax.
Wrong file extension.