Javascript and Windows .bat (71 and 81)
Javascript and Windows .bat, 71 bytes and 81 bytes
f=()=>{console.log('echo f='+(f+';f()').replace(/(?=[>^\\])/g,'^'))};f()
and
echo f=()=^>{console.log('echo f='+(f+';f()').replace(/(?=[^>^^^\^\])/g,'^^'))};f()