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.

String zerlegen und ausgeben (shell)

Empfohlene Antworten

Veröffentlicht

Moin leude,

ich habe einen String: VAR="nt::/tmp/xxx::/tmp/yyy" und möchte ihn in seine bestandteile zerlegen, blos das mag mir nicht recht gelingen *gg*

ich möchte z.B. nur das erster vor den ersten '::' angezeigt bekommen oder auch das in der mitte. usw.

bitte helft mir :ö)

P.S. kann auch mit awk gemacht werden .. is mir egal hauptsache wie? *g*

gruss Jake

Mit awk wäre dieses eine Möglicheit

> VAR="nt::/tmp/xxx::/tmp/yyy"

> echo $VAR | awk -F'::' '{print $1}'

nt

> echo $VAR | awk -F'::' '{print $2}'

/tmp/xxx

> echo $VAR | awk -F'::' '{print $3}'

/tmp/yyy

bingo :) danke

Ich hätte noch eine Lösung mit cut anzubieten:


# echo erster::zweiter::dritter::vierter | cut -d: -f1

erster

# echo erster::zweiter::dritter::vierter | cut -d: -f3

zweiter

# echo erster::zweiter::dritter::vierter | cut -d: -f7

vierter

Gruß Tobi

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.