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

Die Frage ist natürlich erst einmal unter welcher Shell du das programmieren möchtest.

Für die Bourne-Shell hier ein Beispiel:



if [ -f $1 ]; then

  echo "Datei existiert."

elif [ -d $1 ]; then

  echo "Datei ist ein Verzeichnis."

else

  echo "Datei existiert nicht."

fi


Beim Aufruf dieses Scripts gibst du einen Dateinamen als Paramter mit. Dieser wird für $1 genommen. (1. Parameter) ... $9 wäre der 9. Parameter.

Abfrage von Dateicharakeristika in eckigen Klammern (test) [ ]:

-f : Datei existiert und ist eine normale Datei

-d : Datei ist ein Verzeichnis

Hm, dann schreib das doch bitte nächstes Mal direkt ;):rolleyes:

Aber die bash ist ja die Bourne Again Shell... Also ich glaube, der Nachfolger?!

Weiß jetzt nicht, ob das auch da so funktioniert. Musst du mal probieren.

Jupp, roax hat recht.

Und der Code ist fein wie er ist.

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.