You are on page 1of 15

Assignment

(Shell Programming)

Name: Saifullah
Registration No: FA20-BCS-077
Section: B21-B

Submitted to:
Mam Yasmeen Jana

COMSATS University Islamabad


(Vehari Campus)
Table of Contents
IF-ELSE STATEMENT ............................................................................................4
Program # 1 .............................................................................................................4
Output ..................................................................................................................5
Program # 2 .............................................................................................................5
Output ..................................................................................................................6
Program # 3 .............................................................................................................6
Output ..................................................................................................................7
Switch statement program..........................................................................................7
Program #1 ..............................................................................................................7
Output ..................................................................................................................8
Program # 2 .............................................................................................................8
Output ..................................................................................................................9
Program # 3 ...........................................................................................................10
Output ................................................................................................................10
While Loop ..............................................................................................................11
Program # 1 ...........................................................................................................11
Figure 13 Program # 1 ..........................................................................................11
Output ................................................................................................................11
Program # 2 ...........................................................................................................12
Output ...................................................................................................................12
For Loop in Shell .....................................................................................................13
Program # 1 ...........................................................................................................13
Output ................................................................................................................13
Program # 2 ...........................................................................................................14
Output ................................................................................................................14
Program # 3 ...........................................................................................................15
Output ................................................................................................................15
List Of Figures

Figure 1: program 1....................................................................................................4


Figure 2: output from 1 ..............................................................................................5
Figure 3 Program 2 ....................................................................................................5
Figure 4 Output from 2 ..............................................................................................6
Figure 5 Program # 3 .................................................................................................6
Figure 6 output from 3 ...............................................................................................7
Figure 7 Program # 4 .................................................................................................7
Figure 8 output from 1 ...............................................................................................8
Figure 9 Program # 2 .................................................................................................8
Figure 10 Output from 2 ............................................................................................9
Figure 11 Program # 3 .............................................................................................10
Figure 12 Output from 3 ..........................................................................................10
Figure 13 Program # 1 .............................................................................................11
Figure 14 Output from 1 ..........................................................................................11
Figure 15 program # 2..............................................................................................12
Figure 16 Output from 2 ..........................................................................................12
Figure 17 Program # 1 .............................................................................................13
Figure 18 Output from 1 ..........................................................................................13
Figure 19 Program # 2 .............................................................................................14
Figure 20 Output from 2 ..........................................................................................14
Figure 21 Program # 3 .............................................................................................15
Figure 22 Output from 3 ..........................................................................................15
IF-ELSE STATEMENT
Program # 1

Figure 1: program 1
Output

Figure 2: output from 1

Program # 2

Figure 3 Program 2
Output

Figure 4 Output from 2


Program # 3

Figure 5 Program # 3
Output

Figure 6 output from 3

Switch statement program


Program #1

Figure 7 Program # 4
Output

Figure 8 output from 1

Program # 2

Figure 9 Program # 2
Output

Figure 10 Output from 2


Program # 3

Figure 11 Program # 3
Output

Figure 12 Output from 3


While Loop
Program # 1

Figure 13 Program # 1
Output

Figure 14 Output from 1


Program # 2

Figure 15 program # 2
Output

Figure 16 Output from 2


For Loop in Shell
Program # 1

Figure 17 Program # 1
Output

Figure 18 Output from 1


Program # 2

Figure 19 Program # 2
Output

Figure 20 Output from 2


Program # 3

Figure 21 Program # 3

Output

Figure 22 Output from 3

You might also like