#!/usr/local/bin/perl -w use strict; use v5.10;
my $torrent = shift; foreach ( `btcheck -li 2>/dev/null $torrent` ) { /Torrent Hash : ([a-f0-9]{40})$/i; next unless $1; chomp $1; say "magnet:?xt=urn:btih:$1"; last; }
btcheck -li 2>/dev/null $torrent
無法在tcsh中執行,因為redirection 2>/dev/null在tcsh中不支援。只能在bash中執行