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 schreibe gerade an einem Shellskript habe aber nun ein problem mit dem cut.

Ich habe eine Zeile in einer Variabele dessen Inhalt so aussieht:

<TITLE>text</TITLE>

Ich möchte nun nur den herausgeschnitten haben, d.h. der <title> soll wegfallen.

Könnt ihr mir helfen?

Wäre super.....

Danke im voraus

pLay

Originally posted by dr.disk

In der Zeile steht nur folgendes drin?

<TITLE>text</TITLE>

Dann geht's zum Beispiel damit:



echo "<TITLE>text</TITLE>" | cut -d> -f2 | cut -d< -f1

cut: option requires an argument -- d

Try `cut --help' for more information.

Es steht folgendes in der Variabele

<TITLE>Testserver IP 193.33.31.43</TITLE>

Das ist nur ein beispiel.

Dein Befehl hat leider nicht funktioniert.

echo $title | cut -d> -f2 | cut -d< -f1

Das habe ich eingebunden...

Originally posted by Terran Marine

Hallo,

wie ist den damit :

Gruß

Terran Marine

Das mti dem text war nur ein Beispiel.

Die Länge des Inhaltes variert.....

Originally posted by pLay

Das mti dem text war nur ein Beispiel.

Die Länge des Inhaltes variert.....

Asche über mein Haupt ...

Ich hätte ne Lösung mit sed,

aber die von dr.disk ist kürzer :

echo "<TITLE>text</TITLE>" | sed s/'<\/TITLE>'/""/ | sed s/'<TITLE>'/""/

Gruß

Terran Marine

Es funktioniert.

VIELEN VIELEN DANK!!!!

Einmal könnte ich noch eure Hilfe gebrauchen.

ich habe auch noch ein Tag das sieht so aus

[test,test,test]

das was in den klammern steht möchte ich in eine Variabele schreiben?

Wie geht das?

Und eine letzte Frage:

Wie kann ich aus einer HTML adresse das .html wegschneiden?

Ich brauche nur den Pfad ohne ".html" hinten dran.

Wenn ihr mir das noch sagt , dann seid ihr die besten :D :D

Sry aber ich kenn mich nicht so gut in shell progammierung aus.........

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.