Not working commands in UCI page

in this page below commands not working (anymore?) is it wrong or outdated?

Generating a full uci section with a simple copy-paste

This block of code catches the code printed by uci when you add a new section (see above) and reuses it in all the new keys you want to add after it. This automates what would be a very fun typing or copy-paste job. You can also do this in your scripts.

Generic version:

rule_name=$(uci add <config> <section-type>) 
uci batch << EOF
set <config>.$rule_name.<option1>='value'
set <config>.$rule_name.<option2>='value'
set <config>.$rule_name.<option3>='value'
uci commit

A working example:

rule_name=$(uci add firewall rule) 
uci batch << EOF
set firewall.$rule_name.enabled='1'
set firewall.$'ACCEPT'
set firewall.$rule_name.src='wan'
set firewall.$rule_name.proto='tcp udp'
set firewall.$rule_name.dest_port='111'
set firewall.$'NFS_share'
uci commit

Works here.