0
0
Bash Scriptingscripting~10 mins

Process substitution (<() and >()) 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 use process substitution to compare the contents of two files.

Bash Scripting
diff <([1] file1.txt) <(cat file2.txt)
Drag options to blanks, or click blank then click option'
Als
Bcat
Cecho
Dgrep
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands like ls which list files instead of reading contents.
Using echo which does not read file contents.
2fill in blank
medium

Complete the code to redirect the output of a command to a file using process substitution.

Bash Scripting
tee >( [1] > output.log ) < input.txt
Drag options to blanks, or click blank then click option'
Als
Becho
Ccat
Dgrep
Attempts:
3 left
💡 Hint
Common Mistakes
Using ls which lists directory contents instead of writing output.
Using echo which does not read from input.
3fill in blank
hard

Fix the error in the code to correctly use process substitution to sort and compare two files.

Bash Scripting
diff <(sort [1]) <(sort file2.txt)
Drag options to blanks, or click blank then click option'
Afile3.txt
Bfile2.txt
C-r
Dfile1.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong filename inside the process substitution.
Using options like -r without a filename.
4fill in blank
hard

Fill both blanks to create a command that compares the output of two commands using process substitution.

Bash Scripting
diff <([1]) <([2])
Drag options to blanks, or click blank then click option'
Aps aux
Bls -l
Ccat file.txt
Decho Hello
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands that produce no output or static text.
Using the same command twice without reason.
5fill in blank
hard

Fill all three blanks to create a pipeline that writes the output of a command to a file and also processes it.

Bash Scripting
command | tee >( [1] ) | [2] | [3]
Drag options to blanks, or click blank then click option'
Acat > output.txt
Bgrep error
Cwc -l
Dsort
Attempts:
3 left
💡 Hint
Common Mistakes
Not redirecting output properly to the file.
Using commands in the wrong order.