1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/bin/bash mkdir -p generated function genconfig() { for i in $(echo toys/*.c | sort) do # Grab the config block for Config.in echo "# $i" sed -n '/^\*\//q;/^config [A-Z]/,$p' $i || exit 1 echo done } genconfig > generated/Config.in