#!/bin/zsh # Determine number of lines n=$(pve-zsync status | awk 'END { print NR }') # For every line, run the command pve-zsync enable with their respective parameters for i in {2..$n..1} do SOURCE=$(pve-zsync status | awk 'NR == '$i' {print $1}') NAME=$(pve-zsync status | awk 'NR == '$i' {print $2}') pve-zsync enable --source $SOURCE --name $NAME done