--- config.cfg.new 2023-04-26 06:52:40.000000000 +0100
+++ /mnt/tmp/config.cfg 2023-11-06 12:37:47.976345000 +0000
--- config.cfg.new 2023-04-26 06:52:40.000000000 +0100
+++ $MOUNTDIR/config.cfg 2023-11-06 12:37:47.976345000 +0000
export MOUNTDIR="/mnt/tmp"
mkdir $MOUNTDIR
gpart destroy -F $USB
gpart create -s mbr $USB
gpart add -t fat32 $USB
gpart set -a active -i 1 $USB
newfs_msdos /dev/${USB}s1
mount -t msdosfs /dev/${USB}s1 $MOUNTDIR
fetch --no-verify-peer -o - $SRCFILE | unzip -d $MOUNTDIR -
patch < /config.cfg.diff
Many thanks for that. I was originally trying to include the variable in the patchfie, but your suggestion works just as I wanted, so I'll mark the thread as solved using this as the solution:patch -d $MOUNTDIR < /config.cfg.diff ?
patch -d $MYDIR < patchfile