Here is my script:
#!/bin/bash
nb_lines=30
expr 100 / $nb_lines
./test1.sh
3
1) How can i change this script to have '3.33333333' ? Variable 1
2) How can i change this script to have '4' (round superior) ? Variable 2
expr is only capable of integer arithmetic so it will never return you any fraction value.
To be able to use floating point calculations, you should get acquainted with some simple shell tool that can be utilized for that purpose such as