Hier geht es um das Unix-Dienstprogramm "test", das auch als "[" aufgerufen wird, oder um die Shell-Syntaxvariante [[…]]. Verwenden Sie bei Fragen zum Testen von Software und Setups das Tag "testing".
Dies war Teil eines Fetchmail-Daemon-Skripts. if [ ! "x$START_DAEMON" = "xyes" -a ! "$1" = "status" ]; then Was ist der Sinn der Verwendung x$START_DAEMON = "xyes"; warum nicht einfach benutzen $START_DAEMON = "yes"?
Wenn ich die folgende Zeile ausführe test -n && echo not empty es wird "nicht leer" gedruckt. Dies tritt auf, wenn Sie eine leere Variable haben und auf Nicht-Leere testen, während Sie vergessen, den Wert anzugeben: VAR= test -n $VAR && echo wrong 1 test -n "$VAR" && echo wrong …
We use cookies and other tracking technologies to improve your browsing experience on our website,
to show you personalized content and targeted ads, to analyze our website traffic,
and to understand where our visitors are coming from.
By continuing, you consent to our use of cookies and other tracking technologies and
affirm you're at least 16 years old or have consent from a parent or guardian.