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.

Datei auslesen mit while

Empfohlene Antworten

Veröffentlicht

Hi @all,

ich hab ein kleines Prob, ich möchte eine datei auslesen mit einer While schleife, aber das format ist nicht so wie ich ihn erwarte.

Das File mit dem Daten heist CMD_ALIAS in dem Folgendes Drin steht:

Cmnd_Alias RCMYSQL_RECHTE = /usr/sbin/rcmysql status, \

                            /usr/sbin/rcmysql start, \

                            /usr/sbin/rcmysql stop, \

                            /usr/sbin/rcmysql restart

Ich hab Test haber folgendes Versucht:
Datei_Cmd_Alias=CMD_ALIAS


while read LINE

 do

   echo "$LINE"

 done < $Datei_Cmd_Alias

Die Ausgabe der While Schleife siht aber dann folgendermasen aus:
Cmnd_Alias RCMYSQL_RECHTE = /usr/sbin/rcmysql status,                             /usr/sbin/rcmysql start,                             /usr/sbin/rcmysql stop,                             /usr/sbin/rcmysql restart

Und nicht so wie ich es erwartet habe und zwar so:
Cmnd_Alias RCMYSQL_RECHTE = /usr/sbin/rcmysql status, \

                            /usr/sbin/rcmysql start, \

                            /usr/sbin/rcmysql stop, \

                            /usr/sbin/rcmysql restart

Hat vielleicht jemand eine idee wie ich das lösen könnte ?

Danke schon mal im voraus.

Ich weiß zwar nicht für was das gut sein soll (irgendwie doppelt-gemoppelt), aber würde dir eine Here-Document hier weiterhelfen? Ich weiß leider nicht für was du dieses Konstrukt benötigst??


cat <<EOF <$Datei_cmd_Alias

EOF

dann sieht meine Ausgabe so aus:

Cmnd_Alias RCMYSQL_RECHTE = /usr/sbin/rcmysql status, \

                            /usr/sbin/rcmysql start, \

                            /usr/sbin/rcmysql stop, \

                            /usr/sbin/rcmysql restart

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.