#!/usr/bin/env bash if [ -s "$sel" ]; then list=$(tr '\0' '\n' < "$sel") while read -r item;do if [ -z "$things" ];then things="\"$item\"" else things="$things \"$item\"" fi done <<< "$list" echo "$things" | xargs mpv fi