Skip to contentSkip to conversation

src/mlmmj-make-ml.in: use the YES from -a

PATCH In review Geert Stappers 2 participants 4 messages May 11, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 src/mlmmj-make-ml.in: use the YES from -a

Replaced the test on non-zero lenght string
with an actual string compare.

---
 src/mlmmj-make-ml.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/mlmmj-make-ml.in +1 -1
index c93084f..58fba8d 100755
@@ -135,7 +135,7 @@ fi
 ALIAS="$LISTNAME:  \"|$MLMMJRECEIVE -L $SPOOLDIR/$LISTNAME/\""
 CRONENTRY="0 */2 * * * \"$MLMMJMAINTD -F -L $SPOOLDIR/$LISTNAME/\""
 
-if [ -n "$A_CREATE" ]; then
+if [ "$A_CREATE" = "YES" ]; then
 	echo "I want to add the following to your $ALIASFILE file:"
 	echo "$ALIAS"
 
Signature · 1 line
2.11.0
#1 lore raw

src/mlmmj-make-ml.in fi · line 140

Quoted 4 lines · Geert Stappers
src/mlmmj-make-ml.in +1 -1
-if [ -n "$A_CREATE" ]; then
+if [ "$A_CREATE" = "YES" ]; then
 	echo "I want to add the following to your $ALIASFILE file:"
 	echo "$ALIAS"

"=" is not portable, I suggest "=" for scripts run by /bin/sh (which may not be bash, Debian-based systems tend to use dash, there)

#2 lore raw
In reply to Geert Stappers
Quoted 11 lines · Geert Stappers

Replaced the test on non-zero lenght string
with an actual string compare.

---
 src/mlmmj-make-ml.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/mlmmj-make-ml.in +0 -0
index c93084f..58fba8d 100755

src/mlmmj-make-ml.in fi · line 138

Quoted 5 lines
src/mlmmj-make-ml.in +1 -1
@@ -135,7 +135,7 @@ fi
 ALIAS="$LISTNAME:  \"|$MLMMJRECEIVE -L $SPOOLDIR/$LISTNAME/\""
 CRONENTRY="0 */2 * * * \"$MLMMJMAINTD -F -L $SPOOLDIR/$LISTNAME/\""
 
-if [ -n "$A_CREATE" ]; then
+if [ "$A_CREATE" = "YES" ]; then

+if [ "$A_CREATE" = "YES" ]; then

src/mlmmj-make-ml.in fi · line 141

Quoted 3 lines
src/mlmmj-make-ml.in +0 -0
 	echo "I want to add the following to your $ALIASFILE file:"
 	echo "$ALIAS"
 

So s/=/=/ in the bash [ ] test

Groeten
Geert Stappers

Signature · 1 line
Leven en laten leven
#3 lore raw
In reply to Geert Stappers
Quoted 9 lines · Eric Wong

src/mlmmj-make-ml.in fi · line 140

Quoted 4 lines · Geert Stappers
src/mlmmj-make-ml.in +1 -1
-if [ -n "$A_CREATE" ]; then
+if [ "$A_CREATE" = "YES" ]; then
 	echo "I want to add the following to your $ALIASFILE file:"
 	echo "$ALIAS"

"=" is not portable, I suggest "=" for scripts run by /bin/sh (which may not be bash, Debian-based systems tend to use dash, there)

yes

(our mails did cross each other)

Groeten
Geert Stappers

Signature · 1 line
Leven en laten leven