Hello, i am currently taking a intro to Linux course at my local community college. We have a final coming up and im freaking out about it. It's rather simple to most but not so much for me. I try my best to read and practice as much as i can without life interfering. I struggle extremely hard trying to figure this stuff out but it just doesn't click. I developed my own study guide for the final, that is composed of some questions and example scripts. I was wondering if anyone could help me with some questions or even push me in the right direction. Final is on Wednesday and i am becoming desperate, which is why i am here

. Here is my study guide and some example scripts. Ill put the questions i am really struggling with.
1.) How do you set up an alias?
ex :
Code:
alias TODAY='date +%Y%m%d%H%M%S%N'
2.) Write a script that will email all logged in users fortune.
Code:
#!/bin/bash
F=$ who | sort | uniq | awk '{print $1}'
for x in $F
do fortune | mail | $print $1
done
3.) Create and html header and footer environmental variable. (I will then be asked to do something with that) (Very confused on this one)
4.) Create a log file
5.) Parse the etc password
Code:
awk -F:'$7 == :/bin/bash" {print $1}' /etc/passwd
6.)IFS (not entirely sure what he wants us to do with this)
7.) Write 3 short scripts that demonstrate sequence, iteration, and selection.
Sequence :
Code:
#!/bin/bash
for i in 1 2 3 4 5
do
echo "Welcome $i times"
done
Iteration :
Code:
for (( expr1; expr2; expr3 ))
do
command 1
command 2
..
done
Selection :
Code:
PS3 = "Enter the space shuttle to get more information:"
select shuttle in columbia endeavour challenger discovery atlantis enterprise pathfinder
do
echo "$shuttle selected"
done
8.) Write a script that displays the current lines of uptime
Code:
uptime >> up.log
cat up.log | tail -5
9.) Write a script that calculates and equation he will give in class.
10.)And he gave us this code that he says will be a trick question give the output (code will be slightly different on test.
Code:
Let x=0
Let y=10
While [ $x -lt $y ]
Do
Echo -n “*”
x-$((x+1))
Done
Echo “*”
./while1 | wc -c
I know its alot to ask and not sure if any can or will help me. But at least i can try. I appreciate all of your time. Thanks