File mkisofs has the following one line string:
xorriso -as mkisofs -r -checksum_algorithm_iso sha256,sha512 -V 'Debian 12.0.0 amd64 n' -o /srv/cdbuilder.debian.org/dst/deb-cd/out/2bookwormamd64/debian-12.0.0-amd64-NETINST-1.iso -checksum-list /srv/cdbuilder.debian.org/src/deb-cd/tmp/2bookwormamd64/bookworm/checksum-check -jigdo-checksum-algorithm md5 -jigdo-force-checksum /pool/ -jigdo-min-file-size 1024 -jigdo-exclude 'README*' -jigdo-exclude /doc/ -jigdo-exclude /md5sum.txt -jigdo-exclude /.disk/ -jigdo-exclude /pics/ -jigdo-exclude 'Release*' -jigdo-exclude 'Packages*' -jigdo-exclude 'Sources*' -jigdo-jigdo /srv/cdbuilder.debian.org/dst/deb-cd/out/2bookwormamd64/debian-12.0.0-amd64-NETINST-1.jigdo -jigdo-template /srv/cdbuilder.debian.org/dst/deb-cd/out/2bookwormamd64/debian-12.0.0-amd64-NETINST-1.template -jigdo-map Debian=/srv/cdbuilder.debian.org/src/ftp/debian/ -jigdo-exclude boot1 -J -joliet-long -cache-inodes -isohybrid-mbr syslinux/usr/lib/ISOLINUX/isohdpfx.bin -b isolinux/isolinux.bin -c isolinux/boot.cat -boot-load-size 4 -boot-info-table -no-emul-boot -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -isohybrid-apm-hfsplus boot1 CD1
I need to remove every mode-flag with its options that start with "-jidgo". This is for part of the script I'm writing. Native or sed options preferred, but willing to expand resources to get the job done.
I was able to remove them after putting each mode-flag on a separate line, and then running:
sed -i 's/-jigdo-[^-]*//' mkisofs
sed -i 's/-jigdo[^-]*//' mkisofs
This doesn't work if left as one string. I also had to create two commands because it would only do a partial remove on "jigdo-exclude".
For a better view, this is what it looks like after spacing each line:
xorriso
-as mkisofs
-r
-checksum_algorithm_iso sha256,sha512
-V 'Debian 12.0.0 amd64 n'
-o /srv/cdbuilder.debian.org/dst/deb-cd/out/2bookwormamd64/debian-12.0.0-amd64-NETINST-1.iso
-checksum-list /srv/cdbuilder.debian.org/src/deb-cd/tmp/2bookwormamd64/bookworm/checksum-check
-jigdo-checksum-algorithm md5
-jigdo-force-checksum /pool/
-jigdo-min-file-size 1024
-jigdo-exclude 'README*'
-jigdo-exclude /doc/
-jigdo-exclude /md5sum.txt
-jigdo-exclude /.disk/
-jigdo-exclude /pics/
-jigdo-exclude 'Release*'
-jigdo-exclude 'Packages*'
-jigdo-exclude 'Sources*'
-jigdo-jigdo /srv/cdbuilder.debian.org/dst/deb-cd/out/2bookwormamd64/debian-12.0.0-amd64-NETINST-1.jigdo
-jigdo-template /srv/cdbuilder.debian.org/dst/deb-cd/out/2bookwormamd64/debian-12.0.0-amd64-NETINST-1.template
-jigdo-map Debian=/srv/cdbuilder.debian.org/src/ftp/debian/
-jigdo-exclude boot1
-J
-joliet-long
-cache-inodes
-isohybrid-mbr syslinux/usr/lib/ISOLINUX/isohdpfx.bin
-b isolinux/isolinux.bin
-c isolinux/boot.cat
-boot-load-size 4
-boot-info-table
-no-emul-boot
-eltorito-alt-boot
-e boot/grub/efi.img
-no-emul-boot
-isohybrid-gpt-basdat
-isohybrid-apm-hfsplus boot1 CD1
This is what it should look like when modified as a one line string:
xorriso -as mkisofs -r -checksum_algorithm_iso sha256,sha512 -V 'Debian 12.0.0 amd64 n' -o /srv/cdbuilder.debian.org/dst/deb-cd/out/2bookwormamd64/debian-12.0.0-amd64-NETINST-1.iso -checksum-list /srv/cdbuilder.debian.org/src/deb-cd/tmp/2bookwormamd64/bookworm/checksum-check -J -joliet-long -cache-inodes -isohybrid-mbr syslinux/usr/lib/ISOLINUX/isohdpfx.bin -b isolinux/isolinux.bin -c isolinux/boot.cat -boot-load-size 4 -boot-info-table -no-emul-boot -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -isohybrid-apm-hfsplus boot1 CD1