When I boot into single-user mode and list the ZFS snapshots I'm interested in, I want to revert to the "xfcedesktop" snapshot. However, this requires me to manually type the command zfs rollback snapshotname@xfcedesktop for each snapshot, like this:
# zfs list -t snapshot -o name | grep xfcedesktop
zroot@xfcedesktop
zroot/ROOT@xfcedesktop
zroot/ROOT/default@xfcedesktop
zroot/home@xfcedesktop
zroot/home/zoliky@xfcedesktop
zroot/tmp@xfcedesktop
zroot/usr@xfcedesktop
zroot/usr/ports@xfcedesktop
zroot/usr/src@xfcedesktop
zroot/var@xfcedesktop
zroot/var/audit@xfcedesktop
zroot/var/crash@xfcedesktop
zroot/var/log@xfcedesktop
zroot/var/mail@xfcedesktop
zroot/var/tmp@xfcedesktop
# now I need to type this for each line:
zfs rollback zroot@xfcedesktop
zfs rollback zroot/ROOT@xfcedesktop
zfs rollback zroot/ROOT/default@xfcedesktop
.. and so on
This is time consuming and prone to mistakes. I'm wondering if there's a shell trick or a one-liner that would let me loop through the output of grep and execute the rollback commands for each snapshot. I'm using sh (not bash) on FreeBSD, running in single-user mode. Ideally, I'd like it to be a one-liner rather than a script.