0
catch [list exec find /home/gusman/mp3 -name "*$title*" -type f -printf "%f,"] song

我是这样切分的: regsub -all "," $song "\n" song

并以这种方式发布它们
putserv "notice $nick :$song"

结果只发了一行
<Botnick>: Title song.mp3

而在搜索文件中有几首歌曲名称

我想这样发布:
<Botnick>:1 Title song.mp3
<Botnick>:2 Title song.mp3
<Botnick>:3 Title song.mp3
根据搜索结果的数量。

4

1 回答 1

1

为什么要打印多余的,字符,然后用换行符替换它们,而不是直接使用换行符?

我猜你也缺少一个split和一个foreach循环。

这对我有用:

catch [list exec find /home/gusman/mp3 -name "*$title*" -type f] songs
foreach song [split $songs \n] {
    putserv "notice $nick :$song"
}
于 2018-03-22T08:12:05.853 回答