Hi,
folgendes Problem:
Ich suche eine Datei mittels locate, grep das Ergebnis durch und möchte die Datei dann per cat anzeigen.
Leider geht sowas wie
locate xy | grep bla | cat $1
nicht.
Kann mir jemand helfen?
Danke
Hi,
folgendes Problem:
Ich suche eine Datei mittels locate, grep das Ergebnis durch und möchte die Datei dann per cat anzeigen.
Leider geht sowas wie
locate xy | grep bla | cat $1
nicht.
Kann mir jemand helfen?
Danke
cat $(locate xy | grep bla)
MfG Peschmä
The greatest trick the Devil ever pulled was convincing the world he didn't exist. -- The Usual Suspects (1995)
Hey, I feel their pain. It's irritating as hell when people act like they have rights. The great old one (2006)
Stimmt, danke!
Aber gab es nicht eine Möglichkeit das Ergebnis mit $irgendwas zu übergeben?
Nein. Wozu sollte das auch gut sein?
Naja, es gibt natürlich xargs. Und noch jede Menge sonst Zeugs auch aber am Ende läufts ja aufs selbe raus
locate xy | grep bla | xargs cat
MfG Peschmä
The greatest trick the Devil ever pulled was convincing the world he didn't exist. -- The Usual Suspects (1995)
Hey, I feel their pain. It's irritating as hell when people act like they have rights. The great old one (2006)
Xargs sorgt noch dafür, dass die Kommandozeile nicht zu lang wird. Ist praktisch, wennwieder mal nicht geht.Code:rm *.cfg
Lesezeichen