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.

Empfohlene Antworten

Veröffentlicht

Hallo, ich brauch mal nen Tip. Ich bin absoluter Linus-Neuling (2Tage installiert und schon mind 10mal abgeschmiert)

Ich muss ein Shell-Script programmieren, das folgendes kann:

Es soll alle Dateien in einem verzeichnis durchsuchen, ob das Wort "Linux" drin ist und wenn ja, dann an die Datei die Endung *.lx dranhängen.

Bin mittlerweile so weit, dass ich weiß, dass ich grep einsetzen muss, aber wie würde so ein fertiges Script ausschauen?

Plz help.

Gruß

Hallo,

find /home/user -type f -maxdepth 1 -exec bash -c "grep -i Linux {} && mv {} {}.lx" \;

Sucht nach Dateien im Verzeichns /home/user (nicht in Unterverzeichnissen) mit dem Inhalt Linux (Groß- und Kleinschreibung egal), und benennt dieses in die Endung .lx um.

Anpassungen entsprechend.

Gruß

Terran Marine

Hallo,

um die Ausgabe ein wenig einzudämmen, sollte man bei grep noch die Option "-l" mitverwenden (da ansonsten jede einzelne Zeile, in der der String vorkommt, auf dem Bildschirm ausgegeben wird. "-l" beschränkt die Ausgabe auf den Dateinamen).

Nic

Erstmal danke für eure hilfen. KLappt zwar noch nicht ganz (kleiner Error), aber das krieg ich schon noch hin. ansonsten geh ich jetzt erstmal in wohlverdienten Winterurlaub => 3 Wochen *juhuuuuu*

Ciao

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.