false###File.txt
many rows
###online = false --> ONE SHOT import (delete all table contents before importing)
###online = true --> DIFFERENTIAL import (import without clean the table contents)
###online = true
many rows
I want to select lines having online alone and replace true with false but it need not be row number 3 it can come anywhere in the file
My attempt : test.sh
online=true
perl -i -p -e "s/^(online[ ]*=[ ]*).*$/\1 $online/" File.txt
It does the work but adds a space before false. Can someone correct above command so that it doesnt add a space before the word true