I'm trying to make the following script loop over the part_arr
array elements and depending on the value the script should execute the commands. In this case I just used a echo
statement. It doesn't seem to detect the paths. part_arr
is the size and path of each partition starting with a /
or [
.
part_arr=$(lsblk -b | awk '/.*[\/\[].*/{ print $4, $7 }')
tmp=''
for i in "${part_arr[@]}"; do
case "$i" in
"/boot/efi" )
echo $i $tmp;;
"/boot" )
echo $i $tmp;;
"/var")
echo $1 $tmp;;
"/tmp")
echo $1 $tmp;;
"/home")
echo $1 $tmp;;
"[SWAP]")
echo $1 $tmp;;
"/")
echo $1 $tmp;;
esac
tmp=i
done