Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Unix sed entwerten von Sonderzeichen

Empfohlene Antworten

Veröffentlicht

Hallo liebe Community,

ich muss gerade ne Übersicht erstellen dazu will ich per sed - Befehl alle Zeilen in einen Befehl umwandeln.

Mein Problem ist das ich wenn ich den Befehl absetze kommt nur ">" und weiter passiert nichts...

(das sollte doch dann der Modus sein in dem man sed normal als Editor verwendet oder?)

sed 's/^/grep "/' name | sed 's/$/" \/home\/do.100\/p3\/log\/druck_* | tail -1 | awk \'\{print \$2, \$3, \$4\}\'/' > nutzung

An sich soll der Befehl in der Datei dann wie folgt lauten.

grep "druckername" /home/do.100/p3/log/druck_* name | tail -1 | awk '{print $2, $3; $4}' > nutzung

Ich hoffe ich habe mich Verständlich genug ausgedrückt ^^

Danke für eure Hilfe schon im Voraus.

Gruß

Bummel

Bearbeitet von bummel

  • Autor

In der eigentlichen Datei sind nur die Namen der Drucker enthalten.

So sollen die 900+ Zeilen in meiner Datei aussehen.

grep "druckername" /home/do.100/p3/log/druck_* name | tail -1 | awk '{print $2, $3; $4}' > nutzung

Und damit ich das nicht x-mal tippen muss ^^ wollte ich das mit sed anpassen.

for drucker in $(cat eingabedatei); do 

  echo 'grep "${drucker}" pfad' >> ausgabedatei

done

wobei du natürlich mit dem for auch direkt die befehle absetzen könntest anstatt in eine datei zu lenken

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.