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.

Shell Programmierung

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich habe ein kleines Skript geschrieben für die Shell. Ich bekomme immer die Fehlermeldung argument expected.


while [ $message != "Handling requests from UI clients on port 3572" ]
do
echo hallo
sleep 30
message=`tail logs.txt | grep "Handling requests from UI clients on port 3572"`
export message

done[/code]

Sieht jemand den Fehler?

Frank

diese Fehlermeldung kommt bei mir - ich weiß nicht ob das dir was hilft?

...

schlaubi@home:~> while [ $message != "Handling requests from UI clients on port 3572" ]

> do

> echo hallo

> sleep 30

> message=`tail logs.txt | grep "Handling requests from UI clients on port 3572"`

> export message

>

> done

[: !=: unary operator expected

versuchs einfach mal damit:

code:

#! /bin/bash

while test "$message" != "Handling requests from UI clients on port 3572"; do

echo hallo

sleep 30

message=$(tail logs.txt | grep "Handling requests from UI clients on port 35

72")

export message

done

bzw.

while [ "$message" != "Handling requests from UI clients on port 3572" ]

do

echo hallo

sleep 30

message=`tail logs.txt | grep "Handling requests from UI clients on port 3572"`

export message

done

du musstest einfach nur bei deiner Variablen $message zwei Hochkommas hinsetzen!

Original geschrieben von palvoelgyi

while [ $message != "Handling requests

Das $message musst Du so schreiben "$message"

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.