#!/bin/bash set -x for f in *.torrent ; do pgrep -f "ctorrent.*$f" && continue ctorrent -e -1 -E -1 -d "$f" done