What is wrong with %%1? This should translate to %1 after first sformat and it is good. It is used in subsequent Execute. The function works, I've tested it by hand.

I've thought about similar way like your suggestion and decided not to do it this way. For example bcs you need to create properly formated output of getent which can be also subject of change. Also, .target.bash_output can be needed to mock for different part of code too - it is very commont.