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.

sed - Zeile anhand mehrerer Variablen aus Datei löschen

Empfohlene Antworten

Guten Morgen zusammen!

Ich hatte jetzt schon mehrere Fehlversuche und komme irgendwie nicht auf nen grünen Zweig.

Ich möchte mit sed in einem Script /etc/fstab automatisiert editieren. Mir geht es jetzt darum, Einträge zu löschen, die einem bestimmten Pfad entsprechen. Dieser wiederum ergibt sich aus mehreren Variablen.

Mein Konstrukt bringt aber keinen Erfolg...

# sed -i -e '/\/dev\/${vg_export}\/${lv}/d'   /etc/fstab
Per Hand geschrieben sollte das Kommando dann z.B. so aussehen...

# sed -i -e '/\/dev\/VolumeGroup01\/volume_bezeichnung/d' /etc/fstab'

Wie gesagt, bei mir hat die Version mit Variable keinen Erfolg, die händisch geschriebene dagegen schon.

Hat jmd. Tipps?

Danke!

gruß

zyclon

Problem gelöst!

War natürlich mal wieder viel zu einfach :/

Damit die Variablen interpretiert werden muss anstell von ' " benutzt werden...

Mit

# sed -i -e "/\/dev\/${vg_export}\/${lv}/d"   /etc/fstab

funktioniert es also...

viele Grüße

zyclon

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

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.