Somehow the following code isnt working. The echo shows the right command, but doesnt do the replacement in the file.
file abcd.txt:
\overviewfalse
\part1false
\part2false
\part3false
\part4false
\part5false
\part6false
\part7false
Code:
function convert_to_true()
{
sed -i 's/overviewfalse/overviewtrue/' abcd.txt
for iterator in `seq 1 10`; do
match=part${iterator}false
replace=part${iterator}true
command="sed -i 's/${match}/${replace}/' abcd.txt"
echo $command
$(command)
done
}
TeXis a programming language; factor out thefalseinto a single parameter that is passed to the other commands so that you have only one place to changefalsetotrue.TeXskills are too rusty to suggest how to parameterize\overviewand\part1et al, but tex.stackexchange.com can help you out.