This lab covers the email utility and features of the shell
Lab 7-8 Linux Assignment Solution
**********
Module 7
**********
1. mesg n
2.
mail testUser
email 1 -- subject
~r clean.sh -- to bring file content into body of the email
the end -- write at the end of body of an email
control+d -- send email
cc: testUser@gmail.com
3. script lab7-8
4. mail
5.
1 - View message number 1
m testUser - to go to send mode
forwarding - subject line
~m 1 - bring forwarded message into current mail
~v - check content to make sure email is not empty
:q - quit from vi
control + d - send an email
testUser@gmail.com - cc email to you
6. d 1
7. exit
8. mail - you should have 2 emails
9.
R 1 - reply to message 1 (email 1)
Reply to email 1 (Module 7 Q9) - message body
control + d - send reply
10. s 2 Folder_Forwarded
11. quit
12. echo "exit command act as you had not open current session before quit"
13. mail -f Folder_Forwarded
14. quit
15. mail -f - email 1 from mbox (default mail box)
16. quit - quit from mail
17. exit - exit script
**********
Module 8
**********
1. script -a lab7-8
2. echo 'When you say "I wrote a program that crashed Windows"' > lab8text
cat lab8text
3. echo 'people say "Hey, I got those programs with the system ... for free.' >> lab8text
4. echo Written on $(date +%D) by $(whoami) >> lab8text
OR
echo Written on 'date' by 'whoami'
5. cat lab8text
6. ps -e | less - keep the screen small to reduce paper wastage
q - quit from less
7. exit
8. script -a lab7-8
9. cp /home/distribution/cnguyen/cis18a/count ~
10. count
11. control+z - suspend the job
bg - run suspended job in background
12.
$(count) > filename & -- correct answer but can't see anything in the file since command is not going to complete
OR
count > tempfile & -- Instructor's Answers
13. jobs
14. kill %1 %2
15. shellPrompt=$PS1
16. PS1=' Yes? '
17. PATH=$PATH:$HOME
18. mkdir lab8dir; cd lab8dir; pwd
19. cp ~/lab1-2 .
20. clean.sh lab1-2
21. PS1=$shellPrompt
22. alias myhistory='history 5'
23. myhistory
24. !1012 - change number to # output of 23 having command of Q20
25. exit - exit from script
26.
clean.sh lab7-8
- Clean typing error
- Check difference between lab7-8.cleaned and lab7-8
- Turn in lab