I have removed the two if statements from before and replaced them with a case statement and tried to remove all the error from the code. I am trying to run this code but i
Replace #!/bin/sh with #!/bin/bash.
#!/bin/sh
#!/bin/bash
Replace elif[ with elif [.
elif[
elif [
Add a fi line above the elif line.
fi
elif
Add a then line below the elif line.
then
Replace -gt with -ge.
-gt
-ge
Replace -lt with -le.
-lt
-le
Having done this your o variable may still end up empty, but you can debug that by adding echo +"$x-$n-$p".
o
echo +"$x-$n-$p"