SlideShare a Scribd company logo
1 of 1
18IS33-UNIX and Shell Programming (Scheme and Solution) Page 3
Signature of the QuestionPaperSetter:
:
Signature of Scrutinizer
Subject Titles: UNIX and Shell Programming. Subject Code: 18IS33
Q.No. Solutions Marks
Allotted
2.c) Pattern Matching – The Wild-Cards :-A pattern is framed using ordinary characters and a
metacharacter (like *) using well-defined rules. The pattern can then be used as an argument to the
command, and the shell will expand it suitably before the command is executed.The
metacharacters that are used to construct the generalized pattern for matching filenames
belong to a category called wild-cards. The following table lists them:
Wild-Card Matches
* Any number of characters including none
? A single character
[ijk] A single character – either an i, j or k
[x-z] A single character that is within the ASCII range of characters x and x
[!ijk] A single character that is not an i,j or k (Not in C shell)
[!x-z] A single character that is not within the ASCII range of the characters x
{pat1,pat2…} Pat1, pat2, etc. (Not in Bourne shell)
8M
3.a) MechanismofProcessCreation
There are three distinct phases in the creation of a process and uses three important system calls
viz., fork, exec, and wait. The three phases are discussed below:
Fork: A process in UNIX is created with the fork system call, which creates a copy of the process
that invokes it. The process image is identical to that of the calling process, except for a few
parameters like the PID. The child gets a new PID.
Exec: The forked child overwrites its own image with the code and data of the new
program. This mechanism is called exec, and the child process is said to exec a new program,
using one of the family of exec system calls. The PID and PPID of the exec’d process remain
unchanged.
Wait: The parent then executes the wait system call to wait for the child to complete. It picks
up the exit status of the child and continues with its other functions. Note that a parent need not
decide to wait for the child to terminate.
6M
3.b) i)PS1:- Holds the shell primary prompt string
ii)HOME :- Holds the user home directory
iii) SHELL :- Absolute path name of the login shell.
iv) PATH :- Sequence of directories to be searched in order to execute the command
v)USER :- Logi name of the user.
5M

More Related Content

Similar to 3

Linux kernel-rootkit-dev - Wonokaerun
Linux kernel-rootkit-dev - WonokaerunLinux kernel-rootkit-dev - Wonokaerun
Linux kernel-rootkit-dev - Wonokaerun
idsecconf
 
Auditing the Opensource Kernels
Auditing the Opensource KernelsAuditing the Opensource Kernels
Auditing the Opensource Kernels
Silvio Cesare
 
Assignment unix & shell programming
Assignment  unix  & shell programmingAssignment  unix  & shell programming
Assignment unix & shell programming
Mohit Aggarwal
 

Similar to 3 (20)

Systemcall1
Systemcall1Systemcall1
Systemcall1
 
Bc0056 unix operating system
Bc0056   unix operating systemBc0056   unix operating system
Bc0056 unix operating system
 
ch01-basic-java-programs.ppt
ch01-basic-java-programs.pptch01-basic-java-programs.ppt
ch01-basic-java-programs.ppt
 
Ch01 basic-java-programs
Ch01 basic-java-programsCh01 basic-java-programs
Ch01 basic-java-programs
 
Linux kernel-rootkit-dev - Wonokaerun
Linux kernel-rootkit-dev - WonokaerunLinux kernel-rootkit-dev - Wonokaerun
Linux kernel-rootkit-dev - Wonokaerun
 
Trap Handling in Linux
Trap Handling in LinuxTrap Handling in Linux
Trap Handling in Linux
 
Auditing the Opensource Kernels
Auditing the Opensource KernelsAuditing the Opensource Kernels
Auditing the Opensource Kernels
 
BioMake BOSC 2004
BioMake BOSC 2004BioMake BOSC 2004
BioMake BOSC 2004
 
Wildcards, Simple Shell Programs and Shell Variables
Wildcards, Simple Shell Programs and Shell VariablesWildcards, Simple Shell Programs and Shell Variables
Wildcards, Simple Shell Programs and Shell Variables
 
Unpack your troubles*: .NET packer tricks and countermeasures
Unpack your troubles*: .NET packer tricks and countermeasuresUnpack your troubles*: .NET packer tricks and countermeasures
Unpack your troubles*: .NET packer tricks and countermeasures
 
ipc.pptx
ipc.pptxipc.pptx
ipc.pptx
 
Os lab final
Os lab finalOs lab final
Os lab final
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 
Assignment unix & shell programming
Assignment  unix  & shell programmingAssignment  unix  & shell programming
Assignment unix & shell programming
 
Process and Threads in Linux - PPT
Process and Threads in Linux - PPTProcess and Threads in Linux - PPT
Process and Threads in Linux - PPT
 
N_Asm Assembly system calls (sol)
N_Asm Assembly system calls (sol)N_Asm Assembly system calls (sol)
N_Asm Assembly system calls (sol)
 
Ganesh naik linux_kernel_internals
Ganesh naik linux_kernel_internalsGanesh naik linux_kernel_internals
Ganesh naik linux_kernel_internals
 
Ganesh naik linux_kernel_internals
Ganesh naik linux_kernel_internalsGanesh naik linux_kernel_internals
Ganesh naik linux_kernel_internals
 
HackIM 2012 CTF Walkthrough
HackIM 2012 CTF WalkthroughHackIM 2012 CTF Walkthrough
HackIM 2012 CTF Walkthrough
 
Project report
Project reportProject report
Project report
 

More from satishbb (7)

10
1010
10
 
9
99
9
 
8
88
8
 
7
77
7
 
5
55
5
 
6
66
6
 
2
22
2
 

Recently uploaded

如何办理澳洲南澳大学毕业证(UniSA毕业证书)成绩单本科学位证原版一比一
如何办理澳洲南澳大学毕业证(UniSA毕业证书)成绩单本科学位证原版一比一如何办理澳洲南澳大学毕业证(UniSA毕业证书)成绩单本科学位证原版一比一
如何办理澳洲南澳大学毕业证(UniSA毕业证书)成绩单本科学位证原版一比一
0uyfyq0q4
 
Vina Score and Vin Min for almost all the models 2024
Vina Score and Vin Min for almost all the models 2024Vina Score and Vin Min for almost all the models 2024
Vina Score and Vin Min for almost all the models 2024
jipohal318
 
一比一原版北雷克斯学院毕业证成绩单原件一模一样
一比一原版北雷克斯学院毕业证成绩单原件一模一样一比一原版北雷克斯学院毕业证成绩单原件一模一样
一比一原版北雷克斯学院毕业证成绩单原件一模一样
CC
 
出售伯明翰大学毕业证研究生文凭证书原版质量
出售伯明翰大学毕业证研究生文凭证书原版质量出售伯明翰大学毕业证研究生文凭证书原版质量
出售伯明翰大学毕业证研究生文凭证书原版质量
kthcah
 
一比一定制加拿大新喀里多尼亚学院毕业证(UofL毕业证书)学位证书
一比一定制加拿大新喀里多尼亚学院毕业证(UofL毕业证书)学位证书一比一定制加拿大新喀里多尼亚学院毕业证(UofL毕业证书)学位证书
一比一定制加拿大新喀里多尼亚学院毕业证(UofL毕业证书)学位证书
egfdgfd
 
一比一原版(Rutgers毕业证书)罗格斯大学毕业证成绩单原件一模一样
一比一原版(Rutgers毕业证书)罗格斯大学毕业证成绩单原件一模一样一比一原版(Rutgers毕业证书)罗格斯大学毕业证成绩单原件一模一样
一比一原版(Rutgers毕业证书)罗格斯大学毕业证成绩单原件一模一样
A
 
原版定做(ncl学位证书)英国纽卡斯尔大学毕业证文凭学历证书-国外学历学位认证
原版定做(ncl学位证书)英国纽卡斯尔大学毕业证文凭学历证书-国外学历学位认证原版定做(ncl学位证书)英国纽卡斯尔大学毕业证文凭学历证书-国外学历学位认证
原版定做(ncl学位证书)英国纽卡斯尔大学毕业证文凭学历证书-国外学历学位认证
eehzz
 
一比一原版(Cumbria毕业证书)英国坎布里亚大学毕业证成绩单学位证书
一比一原版(Cumbria毕业证书)英国坎布里亚大学毕业证成绩单学位证书一比一原版(Cumbria毕业证书)英国坎布里亚大学毕业证成绩单学位证书
一比一原版(Cumbria毕业证书)英国坎布里亚大学毕业证成绩单学位证书
AD
 
一比一原版曼彻斯特城市大学毕业证成绩单原件一模一样
一比一原版曼彻斯特城市大学毕业证成绩单原件一模一样一比一原版曼彻斯特城市大学毕业证成绩单原件一模一样
一比一原版曼彻斯特城市大学毕业证成绩单原件一模一样
fsdfdsgf
 
一比一定制加拿大安大略理工大学毕业证(UOIT毕业证书)学位证书
一比一定制加拿大安大略理工大学毕业证(UOIT毕业证书)学位证书一比一定制加拿大安大略理工大学毕业证(UOIT毕业证书)学位证书
一比一定制加拿大安大略理工大学毕业证(UOIT毕业证书)学位证书
egfdgfd
 

Recently uploaded (20)

What Could Cause Your Audi To Keep Cutting Out
What Could Cause Your Audi To Keep Cutting OutWhat Could Cause Your Audi To Keep Cutting Out
What Could Cause Your Audi To Keep Cutting Out
 
Charging Forward: Bringing Electric Vehicle Charging Infrastructure to Rural ...
Charging Forward: Bringing Electric Vehicle Charging Infrastructure to Rural ...Charging Forward: Bringing Electric Vehicle Charging Infrastructure to Rural ...
Charging Forward: Bringing Electric Vehicle Charging Infrastructure to Rural ...
 
How Do I Know If My Volvo Has Throttle Position Sensor Problems
How Do I Know If My Volvo Has Throttle Position Sensor ProblemsHow Do I Know If My Volvo Has Throttle Position Sensor Problems
How Do I Know If My Volvo Has Throttle Position Sensor Problems
 
Preparing for Transportation Electrification: The Electric Coop Perspective
Preparing for Transportation Electrification: The Electric Coop PerspectivePreparing for Transportation Electrification: The Electric Coop Perspective
Preparing for Transportation Electrification: The Electric Coop Perspective
 
如何办理澳洲南澳大学毕业证(UniSA毕业证书)成绩单本科学位证原版一比一
如何办理澳洲南澳大学毕业证(UniSA毕业证书)成绩单本科学位证原版一比一如何办理澳洲南澳大学毕业证(UniSA毕业证书)成绩单本科学位证原版一比一
如何办理澳洲南澳大学毕业证(UniSA毕业证书)成绩单本科学位证原版一比一
 
Vina Score and Vin Min for almost all the models 2024
Vina Score and Vin Min for almost all the models 2024Vina Score and Vin Min for almost all the models 2024
Vina Score and Vin Min for almost all the models 2024
 
一比一原版北雷克斯学院毕业证成绩单原件一模一样
一比一原版北雷克斯学院毕业证成绩单原件一模一样一比一原版北雷克斯学院毕业证成绩单原件一模一样
一比一原版北雷克斯学院毕业证成绩单原件一模一样
 
出售伯明翰大学毕业证研究生文凭证书原版质量
出售伯明翰大学毕业证研究生文凭证书原版质量出售伯明翰大学毕业证研究生文凭证书原版质量
出售伯明翰大学毕业证研究生文凭证书原版质量
 
一比一定制加拿大新喀里多尼亚学院毕业证(UofL毕业证书)学位证书
一比一定制加拿大新喀里多尼亚学院毕业证(UofL毕业证书)学位证书一比一定制加拿大新喀里多尼亚学院毕业证(UofL毕业证书)学位证书
一比一定制加拿大新喀里多尼亚学院毕业证(UofL毕业证书)学位证书
 
一比一原版(Rutgers毕业证书)罗格斯大学毕业证成绩单原件一模一样
一比一原版(Rutgers毕业证书)罗格斯大学毕业证成绩单原件一模一样一比一原版(Rutgers毕业证书)罗格斯大学毕业证成绩单原件一模一样
一比一原版(Rutgers毕业证书)罗格斯大学毕业证成绩单原件一模一样
 
Auto Glass Repair in Redwood City What to Do When Disaster Strikes.pdf
Auto Glass Repair in Redwood City What to Do When Disaster Strikes.pdfAuto Glass Repair in Redwood City What to Do When Disaster Strikes.pdf
Auto Glass Repair in Redwood City What to Do When Disaster Strikes.pdf
 
Why Is The Glow Plug Light Flashing In My VW & What Does It Indicate
Why Is The Glow Plug Light Flashing In My VW & What Does It IndicateWhy Is The Glow Plug Light Flashing In My VW & What Does It Indicate
Why Is The Glow Plug Light Flashing In My VW & What Does It Indicate
 
Microscope of ppt for botany major this is a project
Microscope of ppt for botany major this is a projectMicroscope of ppt for botany major this is a project
Microscope of ppt for botany major this is a project
 
Why Won't My Mercedes Key Fob Function After A Battery Swap
Why Won't My Mercedes Key Fob Function After A Battery SwapWhy Won't My Mercedes Key Fob Function After A Battery Swap
Why Won't My Mercedes Key Fob Function After A Battery Swap
 
原版定做(ncl学位证书)英国纽卡斯尔大学毕业证文凭学历证书-国外学历学位认证
原版定做(ncl学位证书)英国纽卡斯尔大学毕业证文凭学历证书-国外学历学位认证原版定做(ncl学位证书)英国纽卡斯尔大学毕业证文凭学历证书-国外学历学位认证
原版定做(ncl学位证书)英国纽卡斯尔大学毕业证文凭学历证书-国外学历学位认证
 
一比一原版(Cumbria毕业证书)英国坎布里亚大学毕业证成绩单学位证书
一比一原版(Cumbria毕业证书)英国坎布里亚大学毕业证成绩单学位证书一比一原版(Cumbria毕业证书)英国坎布里亚大学毕业证成绩单学位证书
一比一原版(Cumbria毕业证书)英国坎布里亚大学毕业证成绩单学位证书
 
What Might Be Behind Your Mercedes' Inoperative Cruise Control
What Might Be Behind Your Mercedes' Inoperative Cruise ControlWhat Might Be Behind Your Mercedes' Inoperative Cruise Control
What Might Be Behind Your Mercedes' Inoperative Cruise Control
 
一比一原版曼彻斯特城市大学毕业证成绩单原件一模一样
一比一原版曼彻斯特城市大学毕业证成绩单原件一模一样一比一原版曼彻斯特城市大学毕业证成绩单原件一模一样
一比一原版曼彻斯特城市大学毕业证成绩单原件一模一样
 
What Causes The BMW X7 Power Supply Warning To Illuminate
What Causes The BMW X7 Power Supply Warning To IlluminateWhat Causes The BMW X7 Power Supply Warning To Illuminate
What Causes The BMW X7 Power Supply Warning To Illuminate
 
一比一定制加拿大安大略理工大学毕业证(UOIT毕业证书)学位证书
一比一定制加拿大安大略理工大学毕业证(UOIT毕业证书)学位证书一比一定制加拿大安大略理工大学毕业证(UOIT毕业证书)学位证书
一比一定制加拿大安大略理工大学毕业证(UOIT毕业证书)学位证书
 

3

  • 1. 18IS33-UNIX and Shell Programming (Scheme and Solution) Page 3 Signature of the QuestionPaperSetter: : Signature of Scrutinizer Subject Titles: UNIX and Shell Programming. Subject Code: 18IS33 Q.No. Solutions Marks Allotted 2.c) Pattern Matching – The Wild-Cards :-A pattern is framed using ordinary characters and a metacharacter (like *) using well-defined rules. The pattern can then be used as an argument to the command, and the shell will expand it suitably before the command is executed.The metacharacters that are used to construct the generalized pattern for matching filenames belong to a category called wild-cards. The following table lists them: Wild-Card Matches * Any number of characters including none ? A single character [ijk] A single character – either an i, j or k [x-z] A single character that is within the ASCII range of characters x and x [!ijk] A single character that is not an i,j or k (Not in C shell) [!x-z] A single character that is not within the ASCII range of the characters x {pat1,pat2…} Pat1, pat2, etc. (Not in Bourne shell) 8M 3.a) MechanismofProcessCreation There are three distinct phases in the creation of a process and uses three important system calls viz., fork, exec, and wait. The three phases are discussed below: Fork: A process in UNIX is created with the fork system call, which creates a copy of the process that invokes it. The process image is identical to that of the calling process, except for a few parameters like the PID. The child gets a new PID. Exec: The forked child overwrites its own image with the code and data of the new program. This mechanism is called exec, and the child process is said to exec a new program, using one of the family of exec system calls. The PID and PPID of the exec’d process remain unchanged. Wait: The parent then executes the wait system call to wait for the child to complete. It picks up the exit status of the child and continues with its other functions. Note that a parent need not decide to wait for the child to terminate. 6M 3.b) i)PS1:- Holds the shell primary prompt string ii)HOME :- Holds the user home directory iii) SHELL :- Absolute path name of the login shell. iv) PATH :- Sequence of directories to be searched in order to execute the command v)USER :- Logi name of the user. 5M