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.

Altes Skript Array in for schleife

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich habe mir eben mal ein paar Skripte angeschaut die ich damals geschrieben habe.

Jetzt ist es so das ich mich nicht mehr genau erinnern kann was folgende Zeile bewirkt:

Hier der Auschnitt:

for patch in ${liste[@]}

do

opatch lsinventory | grep ${patch##*/}

y=`echo $?`

if [ $y -ne 0 ]; then

echo "Kein Patch gefunden fuer" ${patch##*/}

fi

done

Was genau bewirkt bei grep ${patch##*/} dieses ##*/ ??? es hätte doch gereicht wenn ich einfach nach $patch gegrept hätte

Hallo,

also es ist schon ein großer Unterschied, ob du noch $patch oder nach $patch##*/ grepst.

Das "##*/" bedeutet das nach der Variable noch 2-n mal die Raute mit einem Slash am Ende kommt.

Folgende Erläuterung ist evtl. leichter zu verstehen.

An asterisk matches zero or more of the preceding character, class, or subpattern. For example, a* matches ab and aaab. It also matches at the very beginning of any string that contains no "a" at all.

Wildcard: The dot-star pattern .* is one of the most permissive because it matches zero or more occurrences of any character (except newline: `r and `n). For example, abc.*123 matches abcAnything123 as well as abc123.

Gruß

Bummel

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.