find . -iname *.xml -print0 | xargs -0 grep -Eo ‘.{0,40}Peter.{0,40}’
对于我的搜索字符串,此命令非常适合搜索子目录,但是看不到名称中带有空格的文件夹,也不会返回任何结果。我已添加-print0
来查找,并向建议-0
添加了xargs
到protocol ArtNetDelegate: class {
func receivedFixtureControll(intS: Float, strobeS: Float, red: Float, green: Float, blue: Float)
}
class ServerArtNet: NSObject, ServerUDPDelegate {
weak var delegate: ArtNetDelegate?
let serverUDP: ServerUDP
override init() {
serverUDP = ServerUDP() //### Instatiate a new `ServerUDP` dedicated for this instance
super.init()
serverUDP.delegate = self
}
//### This class should manage all lower level events
func receiveData(data:Data, address: String) {
let DMX_Universe_Bytes: [UInt8] = [DMX_Universe, 0]
var received = [UInt8]()
received.append(contentsOf: data)
if (received.count > 17) {
let number_of_received_chanel = (UInt16(received[17]<<8) + UInt16(received[16]))
if (received[0...6] == ArtNetHead[0...6]) && (received[7...11] == OpOutput[0...4]) && (received[14...15] == DMX_Universe_Bytes[0...1]) && number_of_received_chanel>0 {
let intensityScreen:Float = received[18].fromDMX()
let shutter:Float = received[19].fromDMX()
let red:Float = received[20].fromDMX()
let green:Float = received[21].fromDMX()
let blue:Float = received[22].fromDMX()
delegate?.receivedFixtureControll(intS:intensityScreen, strobeS: shutter, red: red, green: green, blue: blue)
}
}
}
func stopServer() {
serverUDP.stopServer()
}
}
。将搜索名称中带有空格的FILES。是递归无效。我希望您想到如何在名称中带有空格的文件使递归在这里起作用时的任何想法。我想花点时间来谈谈在文件名中放置空格的悲剧。你懂得越多。谢谢。