Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
FCFS_done
read -a pro read -a burst declare -a wat_time=() declare -a turn_aro=() sum=0 len=${#pro[@]} echo "////////////////////////" echo "FCFS" #/////////////////// wating time wat_time[0]=0 for ((i=1; i<$len; i++)) do sum=$(( ${burst[$i-1]}+${wat_time[$i-1]} )) wat_time=("${wat_time[@]}" "$sum") done echo "wating time" echo ${wat_time[@]} #////////////////Turn around time for ((i=0; i<$len; i++)) do sum=$(( ${burst[$i]}+${wat_time[$i]} )) turn_aro=("${turn_aro[@]}" "$sum") done echo "turn around" echo ${turn_aro[@]} #//////////////////// avg_wat=0 avg_tut=0 for ((i=0; i<$len; i++)) do avg_wat=$(( ${avg_wat}+${wat_time[$i]} )) avg_tut=$(( ${avg_tut}+${turn_aro[$i]} )) done echo "avg wating time =" echo $((avg_wat / len)) echo "avg turn around =" echo $((avg_tut / len)) echo "////////////////////////"
run
|
edit
|
history
|
help
0
Example
deneme2
Check regex
basc1
dico.txt
gsup awk
How do I view all available HDD's/partitions?
..
learning bash 101
Search for 3 5's in given 6 digit number