For the the life of me, I can't find the cause, or workaround, to the fact that the read line is not parsing correctly. ![]()
specifications="./partitions_sdg_specs.conf"
cat >"${specifications}" <<EnDoFfIlE
# partNum:partFsType:partStart:partEnd:partName:partMount
1 swap 4MiB 8GiB HIBERNATE none
2 ext4 8GiB 12GiB BOOT /boot
3 ext4 12GiB 200GiB DB007_F1 /
4 ext4 200GiB 100% DB007_F2 /DB007_F2
EnDoFfIlE
IFSorig="${IFS}"
grep -v '^#' "${specifications}" |
while [ true ]
do
#read line
IFS=':' read partNum partFsType partStart partEnd partName partMount
if [ $? -ne 0 ] ; then break ; fi
echo " partNum = ${partNum}
partFsType = ${partFsType}
partStart = ${partStart}
partEnd = ${partEnd}
partName = ${partName}
partMount = ${partMount}"
done
IFS="${IFSorig}"
I've tried that with and without the -r option for read. ![]()
The output I am getting is this, instead of the expected distribution of values:
partNum = 1 swap 4MiB 8GiB HIBERNATE none
partFsType =
partStart =
partEnd =
partName =
partMount =
partNum = 2 swap 8GiB 12GiB BOOT /boot
partFsType =
partStart =
partEnd =
partName =
partMount =
partNum = 3 ext4 12GiB 200GiB DB007_F1 /
partFsType =
partStart =
partEnd =
partName =
partMount =
partNum = 4 ext4 200GiB 100% DB007_F2 /DB007_F2
partFsType =
partStart =
partEnd =
partName =
partMount =