4
rated 0 times
[
4]
[
0]
/ answers: 1 / hits: 3569
/ 2 Years ago, wed, august 17, 2022, 5:49:26
Im using read in a while loop to automatically change a makefile after download.
Here is part of the script,
while read a; do
if [[ "$a" = "FCOMPL=g77" ]]
then echo "FCOMPL=gfortran" >> makefile
elif [[ "$a" = "FFLAGC=-Wall -O" ]]
then echo "FFLAGC=-Wall -O -fno-backslash" >> makefile
else
echo $a >> makefile
fi
done <makefile.orig
The problem is that I lose the tabulation.
Any idea of how I can avoid that?
More From » bash