Trouble scripting container launch

I prefer to avoid the temporary files by putting the config inline: example here. Care is needed if you need inner double quotes, or dollar literals.

Another way might be something bash-specific, like:

( incus launch ... -c user.network-config="$(cat <&3)" -c user.user-data="$(cat <&4)" ) 3<<EOS1 4<<EOS2
version: 2
foo...
EOS1
#cloud-config
bar...
EOS2
1 Like