1. How do you write a while loop in shell?

while {condition} do {statement} done

2. How does a case statement look in shell scripts?

case {variable} in {possible-value-1}) {statement};; {possible-value-2}) {statement};; esac

4. How do you define a function in a shell script?

function-name() { #some code here return }