Linux HW

Exercises 6.3, 6.7, 6.10, 6.12, and 6.17      (5)

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Exercises 8.1, 8.9 (i and iii), 8.15, 8.18, and 8.19   (5) 

Exercises 9.1, 9.6, 9.12, and 9.17   (4)

[Spring 2018]

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

IFT 250: Shell & Script Programming with Unix

Lab Activity 3A: Shell, Environment, Simple Filters

Learnings

· The difference between shell and environment variables
· How shell variables interact and are used
· Advanced formatting techniques

Part I: Variable in the Shell

Give the one-line command that makes use of semicolons and redirection to complete the following tasks on bash:
1. Create a shell variable named var1 and initialize it to “twenty”:

2. Create a shell variable named var2 and initialize it to 21:

3. Create a shell variable named var3 and initialize it to “temp”:

4. Display the values of all three variables:

5. Display the list of local shell variables and determine if var1, var2, or var3 is in the listing:

6. Display the list of environmental variables and determine if var1, var2, or var3 is in the listing:

7. Use the export command to make var1 and var3 environmental variables:

8. Display the list of environmental variables and determine if either var1 or var3 is in the listing:

9. Remove the var3 variable with the unset command:

10. Display the list of local shell variables and determine if var1, var2, or var3 is in the listing:

11. Display the list of environmental variables and determine if var1, var2, or var3 is in the listing:

12. Start a new child shell:

13. In the new child shell, display the list of local shell variables and determine if either var1 or var2 is in the listing:

14. In the new child shell, display the list of environmental variables and determine if either var1 or var2 is in the listing:

Part II: Shell game

Execute the following commands in sequential order and give the output as it appears. Be sure to write “nothing” if the only thing that appears on the screen is the next prompt and write “blank line” if a blank line is printed before the prompt.
1) bash$ i=class; j=is; k=over

2) bash$ echo $i $j $k

3) bash$ sh

4) bash$ sh$ echo $i $j $k

5) bash$ sh$ i=Be; j=nice

6) bash$ sh$ exit

7) bash$ echo $i $j $k

8) bash$ sh

9) bash$ sh$ echo $i $j $k

10) bash$ sh$ export i j

11) bash$ sh$ i=enjoy; j=this

12) bash$ sh$ echo $i $j $k

13) bash$ sh$ exit

14) bash$ echo $i $j $k

15) bash$ export i j k

16) bash$ sh

17) bash$ sh$ echo $i $j $k

18) bash$ sh$ export i j

19) bash$ sh$ i=enjoy; j=this

20) bash$ sh$ sh

21) bash$ sh$ sh$ echo $i $j $k

22) bash$ sh$ sh$ exit

23) bash$ sh$ exit

24) bash$ echo $i $j $k

Part III: Process Data 2

Consider the files L2E1.iva, L2E2.iva, and L2E3.iva used in Lab 2E. For this lab, you will use the
techniques learned in Unit 3
to process the three files and format the data from these three files to obtain a single file named lab3a.3.prc that resembles the following:
F gge0001x gge0001y gge0001z
D 12-30-2006 12-30-2006 12-30-2006
T 14:15:20 14:15:55 14:16:27
S a69 a69 a69
B 15.8 16.1 15
M gge06001 gge06001 gge06001
P 30.1 29.6 29.9
Q 20.2 22.3 23.4
R 1006.2 1003.5 999.8
U 1011.8 1011.8 1005
X 34.7 35.2 35.1
A 38.994 38.994 38.994
G 107.71 107.71 107.71
H 8.395 8.406 8.368
O 37.141 36.823 36.621
C 7.55 7.532 7.437
K 28.193 27.902 27.856
W 212.86 210.15 207.15
L 68.3 67.9 67.6
You will use vi only to create a file called lab3A.1.sbs that explains the steps that you followed to create the processed file including all commands and pipelines.

Part IV: Advanced Formatting and Processing

Consider the following file named addressbook:
yihuey@imap1.asu.edui Li,Yi-Huey
esolis@imap1.asu.edu Solis,Erica
eikochan@imap2.asu.edu Ismail,Eiko
calif213@imap3.asu.edu Rangel,Juvenal
tvole@imap1.asu.edu Vo-le,Trang
mwang3@imap3.asu.edu Wang,Meiping
jxiao@imap1.asu.edu Xiao,JunHui
lchen1@imap1.asu.edu Chen,Lihua
yluo4@imap1.asu.edu Luo,Yan
evraghv@imap2.asu.edu Raghuram,Edupuganti
wnatkin@imap2.asu.edu Natkin,William
carmstr@imap2.asu.edu Armstrong,Craig
rvanam@imap1.asu.edu Ram,PrasadVanam
skambam@imap1.asu.edu Kambam,SuneethaR
chr21@imap2.asu.edu Crawford,Chris
lisa60@imap3.asu.edu Robinson,Lisa
sadi1@imap1.asu.edu Adi,SrikanthReddy
dwfletc@imap1.asu.edu Fletcher,Derrick
bhancha@imap1.asu.edu Hanchate,Bhavaniprasad
rkambha@imap1.asu.edu Kambhampati,RamaKrishna
rkanumu@imap1.asu.edu Kanumuri,RangaRaju
pkotham@imap1.asu.edu Kothamachu,Pradeep
vkuruma@imap1.asu.edu Kurumaddali,Venkata
xmliu@imap3.asu.edui Liu,Xiaomei
rmahaka@imap1.asu.edu Mahakali,Radha
mmuruge@imap4.asu.edu Murugesan,Monikadevi
vpallet@imap1.asu.edu Palleti,Venkata
vshanmu@imap1.asu.edu Shanmugam,Viji
helenwei@imap2.asu.edu Wei,Helen
lxiao@imap4.asu.edu Xiao,Li
madhu@imap2.asu.edu HanumanthaReddy,Madhu
bchakka@imap2.asu.edu Chakkarabavi,Beena
ykang@imap1.asu.edu Kang,Yi
The structure of the entries is as follows:
Username@imapNumber.asu.edu LastName, FirstName

You are to use the techniques learned in Unit 3 to reformat the addressbook into a file named lab3.4.prc with the following format:
LastName FirstName Username EmailAddress

In addition to this, the data must be sorted by last name and the imap number must be removed from the email addresses.
For example, the entry:
yihuey@imap1.asu.edui Li,Yi-Huey
will become:
Li Yi-Huey yihuey yihuey@asu.edu
You will use vi to create a file called lab3.4.sbs that explains the steps that you followed to create the file including all commands and pipelines.

Submissions
Once you’ve completed all the activities, perform the following steps for submission:
1. Ensure that all your answers are correct and complete.
2. Download the files lab3.3.sbs, lab3.3.prc, lab3.4.sbs, and lab3.4.prc from the ASU file host:

https://webapp4.asu.edu/myfiles

3. Submit the Lab 3 file, as well as the files listed above and any other files you feel necessary, to BlackBoard
Page | 9

-Huey

Venkata

Li

Yi

yihuey@imap1.asu.edui

Li Yi
esolis@imap1.asu.edu Solis Erica
eikochan@imap2.asu.edu Ismail Eiko
calif213@imap3.asu.edu Rangel Juvenal
tvole@imap1.asu.edu Vo-le Trang
mwang3@imap3.asu.edu Wang Meiping
jxiao@imap1.asu.edu Xiao JunHui
lchen1@imap1.asu.edu Chen Lihua
yluo4@imap1.asu.edu Luo Yan
evraghv@imap2.asu.edu Raghuram Edupuganti
wnatkin@imap2.asu.edu Natkin William
carmstr@imap2.asu.edu Armstrong Craig
rvanam@imap1.asu.edu Ram PrasadVanam
skambam@imap1.asu.edu Kambam SuneethaR
chr21@imap2.asu.edu Crawford Chris
lisa60@imap3.asu.edu Robinson Lisa
sadi1@imap1.asu.edu Adi SrikanthReddy
dwfletc@imap1.asu.edu Fletcher Derrick
bhancha@imap1.asu.edu Hanchate Bhavaniprasad
rkambha@imap1.asu.edu Kambhampati RamaKrishna
rkanumu@imap1.asu.edu Kanumuri RangaRaju
pkotham@imap1.asu.edu Kothamachu Pradeep
vkuruma@imap1.asu.edu Kurumaddali Venkata
xmliu@imap3.asu.edui Liu Xiaomei
rmahaka@imap1.asu.edu Mahakali Radha
mmuruge@imap4.asu.edu Murugesan Monikadevi
vpallet@imap1.asu.edu Palleti
vshanmu@imap1.asu.edu Shanmugam Viji
helenwei@imap2.asu.edu Wei Helen
lxiao@imap4.asu.edu Xiao
madhu@imap2.asu.edu HanumanthaReddy Madhu
bchakka@imap2.asu.edu Chakkarabavi Beena
ykang@imap1.asu.edu Kang

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER