if awk '/\[features\]/{p=1; next} /^\[/{p=0} p && /^derive =/{found=1; exit} END{exit !found}' Cargo.toml; then
# The crate has the feature we searched for
fi
/\[features\]/{p=1; next}
: When the line contains[features]
, set the variablep
to 1 to start processing the subsequent lines. Then, skip to the next line./^\[/{p=0}
: When the line starts with[
, set the variablep
to 0 to stop processing the lines.