coda ha le seguenti opzioni:Coda -f + grep?
-f The -f option causes tail to not stop when end of file is reached, but rather to wait for additional data to be appended to the
input. The -f option is ignored if the standard input is a pipe, but not if it is a FIFO.
mi piacerebbe grep solo per something
nell'output coda.
tail -f <FILE> | grep <SOMETHING>
Il problema è eseguire solo grep una volta ed è terminato. Nessun altro risultato si verifica. Come posso far funzionare grep correttamente con lo -f
?
Spesso faccio esattamente quello che stai descrivendo, e funziona. Il comando 'grep' non termina finché il processo' tail -f' non termina, ma ovviamente non produce alcun output fino a quando qualcosa contenente il pattern non viene aggiunto al file. –
Posso confermare lo stesso su diverse piattaforme. Non ho mai avuto problemi nell'usare tail + grep esattamente come descritto qui. Su quale piattaforma hai problemi? –
'Il problema è che esegue grep una volta sola e si fa? No non è giusto. – anubhava