Voglio grep per i file contenenti le parole Dansk, Svenskao Norsksu qualsiasi riga, con un codice di ritorno utilizzabile (dato che mi piace solo avere le informazioni che le stringhe sono contenute, il mio one-liner va un po 'oltre questo).
Ho molti file con righe come questa:
Disc Title: unknown
Title: 01, Length: 01:33:37.000 Chapters: 33, Cells: 31, Audio streams: 04, Subpictures: 20
Subtitle: 01, Language: ar - Arabic, Content: Undefined, Stream id: 0x20,
Subtitle: 02, Language: bg - Bulgarian, Content: Undefined, Stream id: 0x21,
Subtitle: 03, Language: cs - Czech, Content: Undefined, Stream id: 0x22,
Subtitle: 04, Language: da - Dansk, Content: Undefined, Stream id: 0x23,
Subtitle: 05, Language: de - Deutsch, Content: Undefined, Stream id: 0x24,
(...)
Ecco lo pseudocodice di quello che voglio:
for all files in directory;
if file contains "Dansk" AND "Norsk" AND "Svenska" then
then echo the filename
end
Qual è il modo migliore per farlo? Può essere fatto su una riga?