30/03/2022, 01:11 TYU - Shell and Shell’s Interpretive Cycle : 21VMT0C102: Operating System & Unix Shell Programming
ll’s Interpretive Cycle : 21VMT0C102: Operating System & Unix Shell Programming - Great Learning
Courses / 21VMT0C102: Operating System & Unix Shell Programming / TYU - Shell and Shell’s Interpretive Cycle
Content TYU - Shell and Shell’s Interpretive Cycle
Course Overview Type : Practice Quiz Attempts : 1/1
Questions : 2 Time : 5m
Reference Books List -
Supplementary Your Score : 1/2
Final Exam Model Paper -
Objective Questions Instructions
Graded Assessments
Assignment - 3 Attempt History
Unit 1: Introduction to
Operating Systems and System Attempt #1
Marks: 1
Structures Mar 30, 1:11 AM
Unit 2: Process Management
Q No: 1 Incorrect Answer Marks: 0/1
Unit 3: Process Synchronization
Which of the following shells allows different levels of access to applications based on user type? Applications will be shown/hidden based on the
user trying to access it.
Unit 4: Deadlock
Korn Shell You Selected
Unit 5: Memory Management
Unit 6 : Virtual Memory Csh shell
Management
Unit 7: File System Restricted shell Correct Option
Unit 8: File Attributes
None of the Above
Unit 9: Introduction to Shell
Restricted shell allows to put "restrictions" on the level of access that needs to be provided. Applications are shown/hidden based on the type of
user trying to access it.
Agenda-Introduction to Shell -
Mandatory
Shell and Shell’s Interpretive Q No: 2 Correct Answer Marks: 1/1
Cycle
Statement 1: Sh was the earliest shell.
TYU - Shell and Shell’s
Interpretive Cycle Statement 2 : Csh came after Sh, to provide support to a number of programming languages
Which of the above statements is/are true?
Pattern Matching
TYU - Pattern Matching Both 1 & 2
Quoting & Substitution
Only 1 You Selected
TYU - Quoting and Substitution
Recording
Only 2
Redirection
TYU - Redirection None of the above
Pipe Symbol, Tee Command Sh was the earliest shell. After Sh came Ksh that provided support to a number of programming languages. Later with the rising popularity of C-
and Virtual Terminal
programming Csh was introduced to provide specific support to C - language.
TYU - Pipe Operator, Tee
Command , TTY Command and
dev/null
Unit 9 - Introduction to
SHELL.pdf
Previous Next
Introduction to Shell - Let's learn
and discuss together
End of Unit Quiz - Unit 9
Unit 10: The Process in Unix
Unit 11: Simple Filters and
Filters using Regular Expression
Unit 12: Essential Shell
Programming
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
© 2022 All rights reserved. Help
https://olympus.mygreatlearning.com/courses/55576/quizzes/274802?module_item_id=2091439 1/1
30/03/2022, 01:12 TYU - Pattern Matching : 21VMT0C102: Operating System & Unix Shell Programming - Great Learning
Courses / 21VMT0C102: Operating System & Unix Shell Programming / TYU - Pattern Matching
Content TYU - Pattern Matching
Course Overview Type : Practice Quiz Attempts : 1/1
Questions : 2 Time : 5m
Reference Books List -
Supplementary Your Score : 0/2
Final Exam Model Paper -
Objective Questions Instructions
Graded Assessments
Assignment - 3 Attempt History
Unit 1: Introduction to
Operating Systems and System Attempt #1
Marks: 0
Structures Mar 30, 1:12 AM
Unit 2: Process Management
Q No: 1 Incorrect Answer Marks: 0/1
Unit 3: Process Synchronization
Which of the following is a valid search parameter for searching iiitBanglore.txt ?
Unit 4: Deadlock
iiit*.* You Selected
Unit 5: Memory Management
iiit*.???
Unit 6 : Virtual Memory
Management
iiit*.t[x-z]?
Unit 7: File System
All of the Above Correct Option
Unit 8: File Attributes
A wildcard can be used to search in case you know partially about it. Wildcards such as "*" could be used to represent all characters with any
Unit 9: Introduction to Shell
number of times whereas "?" used for searching any character, but only one time. Thus seeing all options all the given options are correct.
Agenda-Introduction to Shell -
Mandatory
Q No: 2 Incorrect Answer Marks: 0/1
Shell and Shell’s Interpretive
Shyam was asked to make a validation function for age. The function will be using a pattern, which will be used to compare patterns with the input
Cycle
argument. If that pattern matches, the function should return true or false. Which among the following patterns can shyam use if the age should be
greater than 9 and less than 60 ?
TYU - Shell and Shell’s
Interpretive Cycle
[12345]?
Pattern Matching
[012345]* You Selected
TYU - Pattern Matching
Quoting & Substitution [12345][0-9] Correct Option
TYU - Quoting and Substitution
Recording All of the Above
Redirection
[ijk] is a wildcard used to represent a single character with a constraint of selecting from ijk. Since the age should be greater than 9 and less than
TYU - Redirection
60. We are searching for a number in the range of 10-59. Thus the first integer should be in the range*(1,2,3,4,5,), and the second digit should be
any integer,
Pipe Symbol, Tee Command
and Virtual Terminal
TYU - Pipe Operator, Tee
Both wildcards ? and * cannot be used since apart from representing integers, they can also represent alphabets.
Command , TTY Command and
dev/null
Unit 9 - Introduction to
SHELL.pdf
Introduction to Shell - Let's learn
and discuss together
Previous Next
End of Unit Quiz - Unit 9
Unit 10: The Process in Unix
Unit 11: Simple Filters and
Filters using Regular Expression
Unit 12: Essential Shell
Programming
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
© 2022 All rights reserved. Help
https://olympus.mygreatlearning.com/courses/55576/quizzes/274796?module_item_id=2091442 1/1
30/03/2022, 01:13 TYU - Quoting and Substitution Recording: 21VMT0C102: Operating System & Unix Shell Programming - Great Learning
Courses / 21VMT0C102: Operating System & Unix Shell Programming / TYU - Quoting and Substitution Recording
Content TYU - Quoting and Substitution Recording
Assignment - 3
Type : Practice Quiz Attempts : 1/1
Unit 1: Introduction to Questions : 2 Time : 5m
Operating Systems and System
Structures Your Score : 1/2
Unit 2: Process Management
Instructions
Unit 3: Process Synchronization
Unit 4: Deadlock
Attempt History
Unit 5: Memory Management
Unit 6 : Virtual Memory Attempt #1
Marks: 1
Management Mar 30, 1:13 AM
Unit 7: File System
Q No: 1 Correct Answer Marks: 1/1
Unit 8: File Attributes
Mark the correct statement among the following.
Unit 9: Introduction to Shell Shell quoting implies hiding of characters for the shell
Agenda-Introduction to Shell -
Semicolon is a meta character
Mandatory
Shell and Shell’s Interpretive Both are true You Selected
Cycle
TYU - Shell and Shell’s
None of the above are true
Interpretive Cycle
Pattern Matching
Meta characters are characters that hold special significance to shell. For example semicolon is used for statement termination. Shell quoting is
disabling the meaning of a special character. For example if you wish to print My;Name as it is (without using semicolon for statement termination),
TYU - Pattern Matching
you could enclose it within single quotes or double quotes. "My;Name" or 'My;Name'
Quoting & Substitution
Hence both the statements are true.
TYU - Quoting and
Substitution Recording
Redirection Q No: 2 Incorrect Answer Marks: 0/1
Which of the following is used for command substitution?
TYU - Redirection
Single quote
Pipe Symbol, Tee Command
and Virtual Terminal
Double quote You Selected
TYU - Pipe Operator, Tee
Command , TTY Command and
dev/null
Backslash
Unit 9 - Introduction to
SHELL.pdf Back quote Correct Option
Introduction to Shell - Let's learn
and discuss together Back quote is used for command substitution. In command substitution anything enclosed within back quotes is treated as a command.
End of Unit Quiz - Unit 9
Unit 10: The Process in Unix
Unit 11: Simple Filters and
Filters using Regular Expression
Previous Next
Unit 12: Essential Shell
Programming
Unit 13: AWK - An Advanced
Filter
Unit 14: Advanced Shell
Programing
Unit 15: Multiprocessor
Systems
All Notes
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
© 2022 All rights reserved. Help
https://olympus.mygreatlearning.com/courses/55576/quizzes/274803?module_item_id=2091445 1/1
30/03/2022, 01:14 TYU - Redirection: 21VMT0C102: Operating System & Unix Shell Programming - Great Learning
Courses / 21VMT0C102: Operating System & Unix Shell Programming / TYU - Redirection
Content TYU - Redirection
Assignment - 3
Type : Practice Quiz Attempts : 1/1
Unit 1: Introduction to Questions : 2 Time : 5m
Operating Systems and System
Structures Your Score : 0/2
Unit 2: Process Management
Instructions
Unit 3: Process Synchronization
Unit 4: Deadlock
Attempt History
Unit 5: Memory Management
Unit 6 : Virtual Memory Attempt #1
Marks: 0
Management Mar 30, 1:14 AM
Unit 7: File System
Q No: 1 Incorrect Answer Marks: 0/1
Unit 8: File Attributes
Which among the following is the correct chronology of redirection for standard error operation.
Unit 9: Introduction to Shell Error → device → standerror → device
Agenda-Introduction to Shell -
Error → standerror → device Correct Option
Mandatory
Shell and Shell’s Interpretive
Cycle
Error → device → standarderror → Error → device You Selected
TYU - Shell and Shell’s
Interpretive Cycle None of the Above
Pattern Matching
Standard error from the operating system must be notified to the system. For this the error must be redirected first to standerror file before
TYU - Pattern Matching passing it further to devices.
Quoting & Substitution
TYU - Quoting and
Substitution Recording
Q No: 2 Incorrect Answer Marks: 0/1
Redirection
Both > & >> redirect standard output to a file. > ____ the existing content. And >> ____ the existing content.
TYU - Redirection
overwrites, appends new content to Correct Option
Pipe Symbol, Tee Command
and Virtual Terminal
appends new content to, overwrites You Selected
TYU - Pipe Operator, Tee
Command , TTY Command and
dev/null None of the options
Unit 9 - Introduction to Both > & >> operators are used for redirection. However the difference lies in the manner of redirecting. > overwrites the existing content while
SHELL.pdf
>> appends the new content to the existing content.
Introduction to Shell - Let's learn
and discuss together
End of Unit Quiz - Unit 9
Unit 10: The Process in Unix
Previous Next
Unit 11: Simple Filters and
Filters using Regular Expression
Unit 12: Essential Shell
Programming
Unit 13: AWK - An Advanced
Filter
Unit 14: Advanced Shell
Programing
Unit 15: Multiprocessor
Systems
All Notes
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
© 2022 All rights reserved. Help
https://olympus.mygreatlearning.com/courses/55576/quizzes/274800?module_item_id=2091448 1/1
30/03/2022, 01:15 TYU - Pipe Operator, Tee Command , TTY Command and dev/null : 21VMT0C102: Operating System & Unix Shell Programming - Great Learning
Courses / 21VMT0C102: Operating System & Unix Shell Programming / TYU - Pipe Operator, Tee Command , TTY Command and dev/null
Content TYU - Pipe Operator, Tee Command , TTY Command and dev/null
Assignment - 3
Type : Practice Quiz Attempts : 1/1
Unit 1: Introduction to Questions : 2 Time : 5m
Operating Systems and System
Structures Your Score : 1/2
Unit 2: Process Management
Instructions
Unit 3: Process Synchronization
Unit 4: Deadlock
Attempt History
Unit 5: Memory Management
Unit 6 : Virtual Memory Attempt #1
Marks: 1
Management Mar 30, 1:15 AM
Unit 7: File System
Q No: 1 Incorrect Answer Marks: 0/1
Unit 8: File Attributes
Which among the following could be used to count the number of words in a file listing command (ls). (Note : the result should be printed in the
terminal ).
Unit 9: Introduction to Shell
ls | wc -l Correct Option
Agenda-Introduction to Shell -
Mandatory
ls >> file You Selected
Shell and Shell’s Interpretive
Cycle
ls -l > file
TYU - Shell and Shell’s
Interpretive Cycle
ls command command could be used for listing. Similarly wc common could be used to count the number of words. Since we were asked to print
Pattern Matching
the number of word in terminal rather than redirecting it to file, we could use | rather than >> symbol. Thus option one.
TYU - Pattern Matching
Q No: 2 Correct Answer Marks: 1/1
Quoting & Substitution
You can navigate among virtual terminals using __ to __ from 1st to 6th virtual terminals.
TYU - Quoting and
Substitution Recording F1, F6 You Selected
Redirection
F2, F7
TYU - Redirection
F3, F8
Pipe Symbol, Tee Command
and Virtual Terminal
Ctrl + Alt + F1 opens up your first virtual terminal. You can navigate among virtual terminals using F1 to F6 from 1st to 6th virtual terminals.
TYU - Pipe Operator, Tee
Command , TTY Command and
dev/null
Unit 9 - Introduction to
SHELL.pdf
Previous Next
Introduction to Shell - Let's learn
and discuss together
End of Unit Quiz - Unit 9
Unit 10: The Process in Unix
Unit 11: Simple Filters and
Filters using Regular Expression
Unit 12: Essential Shell
Programming
Unit 13: AWK - An Advanced
Filter
Unit 14: Advanced Shell
Programing
Unit 15: Multiprocessor
Systems
All Notes
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
© 2022 All rights reserved. Help
https://olympus.mygreatlearning.com/courses/55576/quizzes/274807?module_item_id=2091451 1/1
30/03/2022, 01:18 End of Unit Quiz - Unit 9: 21VMT0C102: Operating System & Unix Shell Programming - Great Learning
Courses / 21VMT0C102: Operating System & Unix Shell Programming / End of Unit Quiz - Unit 9
Content End of Unit Quiz - Unit 9
Course Overview Type : Practice Quiz Questions : 10
Time : 20m Scoring Policy : Highest Score
Reference Books List -
Supplementary Your Score : 10/10
Final Exam Model Paper -
Objective Questions Instructions
Graded Assessments
RETAKE
Assignment - 3
Attempt History
Unit 1: Introduction to
Operating Systems and System
Structures
Attempt #2
Marks: 10
Unit 2: Process Management Mar 30, 1:18 AM
Unit 3: Process Synchronization
Q No: 1 Correct Answer Marks: 1/1
Unit 4: Deadlock Mark the correct life cycle for the execution of commands in Linux/Unix-based Operating systems.
Unit 5: Memory Management Enter Command → Kernel → Error Checking → Shell waiting for Execution → Shell Receives and prompt reappears.
Unit 6 : Virtual Memory
Management Enter Command → Error Checking → Kernel → Shell Receives and prompt reappears → Shell waiting for execution → Shell Recipes and prompt
reappear
Unit 7: File System
Enter Command → Error Checking → Kernel → Shell wait for the Execution → Shell Receives and prompt reappears You Selected
Unit 8: File Attributes
Unit 9: Introduction to Shell Enter Command → kernel → Error Checking → Shell Receives and prompt reappears→ Shell waiting for execution → Shell Receives and
prompt reappears
Agenda-Introduction to Shell -
Mandatory The execution life cycle of command consists of the shell interacting with the kernel and getting a response. Before passing the command directly
to the kernel, the commands are error checked and then passed. Then only after execution, the results are handed over to the shell.
Shell and Shell’s Interpretive
Cycle
TYU - Shell and Shell’s Q No: 2 Correct Answer Marks: 1/1
Interpretive Cycle
Which of the following shells allows the combined feature of nearly all of the shells given below?
Pattern Matching
Ksh shell
TYU - Pattern Matching
Csh shell
Quoting & Substitution
TYU - Quoting and Substitution Bourne again shell You Selected
Recording
Redirection Restricted Shell
TYU - Redirection Bourne again shell (Bash) is one of the advanced shells among Ksh shell, csh shell, and Restricted shell which allows nearly all the feature in itself.
Along with having the capability of supporting various programming languages, it also allows the use of multi-users to work in a single terminal.
Pipe Symbol, Tee Command and
Virtual Terminal
TYU - Pipe Operator, Tee Q No: 3 Correct Answer Marks: 1/1
Command , TTY Command and
Sharmaji wanted to make a registration page for his website. For this, he added jquery validation to his website. Thus he came up with a jquery
dev/null
validation. His validation allows either to set any 5 digit number, or any 4 characters followed by ‘?’. Which of the following patterns did Sharma Ji
use? Mark the most appropriate option.
Unit 9 - Introduction to
SHELL.pdf
[[0-9][0-9][0-9][0-9][0-9], *?]
Introduction to Shell - Let's learn
and discuss together
[[0-9][0-9][0-9][0-9][0-9], ????*\?] You Selected
End of Unit Quiz - Unit 9
[[0-9][0-9][0-9][0-9][0-9],*\?]
Unit 10: The Process in Unix
Unit 11: Simple Filters and None of the Above
Filters using Regular Expression
As the pattern first requires accepting 5 digits, thus [0-9][0-9][0-9][0-9][0-9] is an appropriate option. For the case of accepting a string having 4
Unit 12: Essential Shell characters followed by ?, we can use ???? and a wildcard for accepting? character. As ? is also a wildcard, thus we can use *\? . Thus b is the correct
Programming answer
Unit 13: AWK - An Advanced
Filter
Q No: 4 Correct Answer Marks: 1/1
Unit 14: Advanced Shell Saroj, a lead internet operator in BSNL Fiber Optics center. As a lead operator, she was informed about some criminal activity in one of her regions.
Programing She took the matter into her own hands and tried to list down all the possible ip addresses in the network to get to the culprit. All the IP addresses in
her allotted ips start with 112.233.212.xxx. Based on the Host ids, the last *** is alloted. Having some idea about the region of attack origination, she
https://olympus.mygreatlearning.com/courses/55576/quizzes/274808?module_item_id=2091454 1/3
30/03/2022, 01:18 End of Unit Quiz - Unit 9: 21VMT0C102: Operating System & Unix Shell Programming - Great Learning
Unit 15: Multiprocessor Systems was sure that the first digit from the last section will be one out of [8,7,3], and the last digit will not be among [7,6,5]. Which among the following
patterns is an appropriate search parameter for filtering out Ip address?
All Notes
112.233.212.[1-9][1-9][1-9]
112.233.212.[873]*[?567]
112.233.212.[873]?[^567] You Selected
112.233.212.[873]*[^567]
As the starting digit is in [8,7,3], thus we can use [873]. For the second digit, it could be anything hence we use "?". For the last digit, as it should
not be 5,6 or 7 we use [^567]
Q No: 5 Correct Answer Marks: 1/1
Evander works for the Women and Child Protection Office His job is also to make sure that the websites which show explicit content verify the age
of the user before giving access. So, before giving certification, he asks the website Developers to submit the age validation pattern for certification.
Which among the following will be an appropriate age validation pattern ?
[12]?
[023456789][0-9]
[[^10][0-9] , [1][8,9]] You Selected
As the age should be 18 and above, thus we should only select a pattern that allows websites following 18+ guidelines. Only Option d follows the
criteria. We can not opt for options A and C as it allows age below 18 and option B allows nonnumeric age.
Q No: 6 Correct Answer Marks: 1/1
Sriram is writing a code for his programming assignment. Along with that, he is getting execution results onto his monitor. Considering basic
input/output flow, which among the following correctly depict the redirection of data ?
[Keyboard → stdin → Command] and [command → stdout→ Monitor] , vice versa You Selected
[Keyboard → stdout → Command] and [Command → stdin → Monitor], vice versa
[Keyboard → stdout → Command] and [Error → standerror → Monitor] and vice versa
None of the Above.
As the command should be passed from the keyboard to the system and then from the system to Monitor, we need to set redirection based on it
only. Thus, taking the first half, the data from the input device keyboard should be first passed to the Command (OS in this case). Thus [Keyboard
→ stdin → Command]. Further, then it should be passed from the Command to the Device. Thus [command → stdout→ Monitor].
Q No: 7 Correct Answer Marks: 1/1
Shristi, a school teacher, wants to execute homework scripts for all the students. For this, she has given a bash scripting question as homework. For
saving time on execution of each file, she passed all the files in a loop. Which among the following commands can she use to copy all the errors into a
respective file for giving a performance report later ? Mark the most appropriate option among the following. ( Note: student[x]Error.txt represents
error for bash script written by each student.)
Command for file execution 1> student[x]Error.txt
Command for file execution > student[x]Error.txt
Command for file execution 2> student[x]Error.txt You Selected
None of the Above
You can use a file descriptor for solving this question. As number 2 represents file descriptor for standard error, thus during redirection, you can
use 2> for redirecting error from the execution to file student[x]Error.txt
Q No: 8 Correct Answer Marks: 1/1
Mark the most appropriate answer among the following.
One can use ls > filename to append the result of ls to filename.
A console which takes input from the Operating system to display the data can use stdout file for redirecting data (to itself) You Selected
Numeric 1 is used as a File Descriptor for error redirection
https://olympus.mygreatlearning.com/courses/55576/quizzes/274808?module_item_id=2091454 2/3
30/03/2022, 01:18 End of Unit Quiz - Unit 9: 21VMT0C102: Operating System & Unix Shell Programming - Great Learning
All of the Above
As console is an output device, so redirecting data from operating system to console device. Thus we can use a stdout file for passing the data.
Q No: 9 Correct Answer Marks: 1/1
As students are using a single system for accessing all 6 virtual terminals, what parameter can Siri use for assigning the system within a system?
Tty number You Selected
Inode number
Date time of activity
None of the Above .
tty number would be the most appropriate option among the other. During allocation of the system, Siri could note own the terminal tty. She
could later map to know the progress.
Q No: 10 Correct Answer Marks: 1/1
Ramu was asked to delete the content of millions of files. Rather than manually opening the file, deleting the file and saving the file, Ramu made a
bash script. A bash script to loop through files and do the same. Which among the following commands could Raju use for doing the same?
cat dev/null >> data[x].txt
cat dev/null > data[x].txt You Selected
Cat Empty > data[x].txt
None of the Above.
As dev/null represents dustbin, thus copying itself onto file will delete the content. Thus option B is the correct answer. Option A wont work as
appending empty file will still leave content.
Attempt #1
Marks: 2
Mar 30, 1:16 AM
Previous Next
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
© 2022 All rights reserved. Help
https://olympus.mygreatlearning.com/courses/55576/quizzes/274808?module_item_id=2091454 3/3