From bb5fc2ce97df3fcbc834fcd7963baa25ffe58cbd Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Sun, 11 Feb 2024 02:49:26 +0000 Subject: [PATCH 01/19] [doc/ysh-faq] conclude "unmolested" thread in consistent way --- doc/ysh-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index 5dd60760e8..f66c82b335 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -113,7 +113,7 @@ We could have chosen to respect `echo -- $x`, but YSH already has: write -- $x # print $x "unmolested" in YSH -That means YSH has: +And that allowed YSH to have an "unmolested": echo $x # an even shorter way From 95779e4e4a0d6250ac8880859ef2dd3d842d7a8f Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Sun, 11 Feb 2024 03:19:45 +0000 Subject: [PATCH 02/19] thead consistency --- doc/ysh-faq.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index f66c82b335..7a023fab6f 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -109,11 +109,11 @@ So portable shell scripts use: printf '%s\n' "$x" # print $x "unmolested" in POSIX shell -We could have chosen to respect `echo -- $x`, but YSH already has: +We could have chosen to respect `echo -- $x`, but since YSH already has: write -- $x # print $x "unmolested" in YSH -And that allowed YSH to have an "unmolested": +That allowed YSH to have an "unmolested": echo $x # an even shorter way From 2964853d554364168eabd94aa8458b12fc40b966 Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Sun, 11 Feb 2024 03:33:39 +0000 Subject: [PATCH 03/19] reasoning --- doc/ysh-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index 7a023fab6f..69775e6e33 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -111,7 +111,7 @@ So portable shell scripts use: We could have chosen to respect `echo -- $x`, but since YSH already has: - write -- $x # print $x "unmolested" in YSH + write -- $x # fully-featured "unmolested" print $x That allowed YSH to have an "unmolested": From 59eaefb2127c7a6a3b431c0d35cd9208c7865fd5 Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Sun, 11 Feb 2024 03:35:40 +0000 Subject: [PATCH 04/19] shorten --- doc/ysh-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index 69775e6e33..273c02a45a 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -109,7 +109,7 @@ So portable shell scripts use: printf '%s\n' "$x" # print $x "unmolested" in POSIX shell -We could have chosen to respect `echo -- $x`, but since YSH already has: +We could have chosen to respect `echo -- $x`, but as YSH already has: write -- $x # fully-featured "unmolested" print $x From 85a5d40b7f0aa3927fdfadc3dc8214cdb1c7a737 Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Sun, 11 Feb 2024 03:43:43 +0000 Subject: [PATCH 05/19] shorten --- doc/ysh-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index 273c02a45a..5cf5548fd5 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -115,7 +115,7 @@ We could have chosen to respect `echo -- $x`, but as YSH already has: That allowed YSH to have an "unmolested": - echo $x # an even shorter way + echo $x # optionless shortcut So `echo` is technically superfluous in YSH, but it's also short, familiar, and correct. From 25ebb588552723532bfb13d119b260c2cab6fe5f Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Sun, 11 Feb 2024 03:53:06 +0000 Subject: [PATCH 06/19] show echo equivalence --- doc/ysh-faq.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index 5cf5548fd5..4b0f828f94 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -115,7 +115,9 @@ We could have chosen to respect `echo -- $x`, but as YSH already has: That allowed YSH to have an "unmolested": - echo $x # optionless shortcut + echo $x # optionless shortcut + +Which is equivalent to `write --sep ' ' -- $x`. So `echo` is technically superfluous in YSH, but it's also short, familiar, and correct. From 8722d3865fa4764d26eaab9439d5980ca5d4cbf9 Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Sun, 11 Feb 2024 03:54:23 +0000 Subject: [PATCH 07/19] align comment --- doc/ysh-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index 4b0f828f94..6fae0c910c 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -115,7 +115,7 @@ We could have chosen to respect `echo -- $x`, but as YSH already has: That allowed YSH to have an "unmolested": - echo $x # optionless shortcut + echo $x # optionless shortcut Which is equivalent to `write --sep ' ' -- $x`. From 48ec70bf6880026638b594af95d3acbebf688034 Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Sun, 11 Feb 2024 03:56:20 +0000 Subject: [PATCH 08/19] shorten --- doc/ysh-faq.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index 6fae0c910c..29593af312 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -113,9 +113,9 @@ We could have chosen to respect `echo -- $x`, but as YSH already has: write -- $x # fully-featured "unmolested" print $x -That allowed YSH to have an "unmolested": +YSH can have an "unmolested": - echo $x # optionless shortcut + echo $x # an optionless shortcut Which is equivalent to `write --sep ' ' -- $x`. From 86bb2a8b399c1849adf71f687ccd107fd7a7acb6 Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Sun, 11 Feb 2024 04:08:19 +0000 Subject: [PATCH 09/19] optionless -> flagless echo --- doc/ysh-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index 29593af312..83199af744 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -115,7 +115,7 @@ We could have chosen to respect `echo -- $x`, but as YSH already has: YSH can have an "unmolested": - echo $x # an optionless shortcut + echo $x # a flagless shortcut Which is equivalent to `write --sep ' ' -- $x`. From c2f3050cf82c23a20a8dd38763dd72e86ff41833 Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Sun, 11 Feb 2024 21:54:43 +0000 Subject: [PATCH 10/19] minimize changes --- doc/ysh-faq.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index 83199af744..632c2e07cd 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -113,9 +113,9 @@ We could have chosen to respect `echo -- $x`, but as YSH already has: write -- $x # fully-featured "unmolested" print $x -YSH can have an "unmolested": +That means YSH can have an "unmolested": - echo $x # a flagless shortcut + echo $x # an even shorter way Which is equivalent to `write --sep ' ' -- $x`. From a534a63a88b9eab6ed456b135b9ef929b0c94d9b Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Sun, 11 Feb 2024 22:04:25 +0000 Subject: [PATCH 11/19] echo's reason to be --- doc/ysh-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index 632c2e07cd..c9ff8e68f2 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -115,7 +115,7 @@ We could have chosen to respect `echo -- $x`, but as YSH already has: That means YSH can have an "unmolested": - echo $x # an even shorter way + echo $x # an even shorter, flagless way Which is equivalent to `write --sep ' ' -- $x`. From 4f25d328244c13ce9a150eaa053a410bfa4088ed Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Sun, 11 Feb 2024 22:08:24 +0000 Subject: [PATCH 12/19] minimize changes --- doc/ysh-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index c9ff8e68f2..4e2946f59d 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -111,7 +111,7 @@ So portable shell scripts use: We could have chosen to respect `echo -- $x`, but as YSH already has: - write -- $x # fully-featured "unmolested" print $x + write -- $x # print $x "unmolested" in YSH That means YSH can have an "unmolested": From 8aef13805464282810e9984211a31ee26ad2b49f Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Sun, 11 Feb 2024 22:30:12 +0000 Subject: [PATCH 13/19] minimize changes --- doc/ysh-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index 4e2946f59d..ccf4483ed4 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -113,7 +113,7 @@ We could have chosen to respect `echo -- $x`, but as YSH already has: write -- $x # print $x "unmolested" in YSH -That means YSH can have an "unmolested": +That means YSH can have: echo $x # an even shorter, flagless way From 519d70313a03cf5219c71520cf39bdd2ddcf39bc Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Tue, 13 Feb 2024 21:23:58 +0000 Subject: [PATCH 14/19] switch to YES / synonym examples --- doc/ysh-faq.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index ccf4483ed4..883b33e1d6 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -111,15 +111,14 @@ So portable shell scripts use: We could have chosen to respect `echo -- $x`, but as YSH already has: - write -- $x # print $x "unmolested" in YSH + write -- $x # print $x "unmolested" in YSH That means YSH can have: - echo $x # an even shorter, flagless way + echo $x # YES: an even shorter way + write --sep ' ' -- $x # synonym -Which is equivalent to `write --sep ' ' -- $x`. - -So `echo` is technically superfluous in YSH, but it's also short, familiar, and +So `echo` is technically superfluous in YSH, but it's short, familiar, and correct. YSH isn't intended to be compatible with POSIX shell; only OSH is. From 7fd26b4c78428325435b262db3b96691910866ad Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Tue, 13 Feb 2024 21:25:29 +0000 Subject: [PATCH 15/19] use orig words --- doc/ysh-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index 883b33e1d6..ad45207aea 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -118,7 +118,7 @@ That means YSH can have: echo $x # YES: an even shorter way write --sep ' ' -- $x # synonym -So `echo` is technically superfluous in YSH, but it's short, familiar, and +So `echo` is technically superfluous in YSH, but it's also short, familiar, and correct. YSH isn't intended to be compatible with POSIX shell; only OSH is. From 14cc9213f8908d09954dda8ab00bcbc91f1e3eea Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Tue, 13 Feb 2024 21:38:18 +0000 Subject: [PATCH 16/19] finally making good sense --- doc/ysh-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index ad45207aea..d632401c0e 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -113,7 +113,7 @@ We could have chosen to respect `echo -- $x`, but as YSH already has: write -- $x # print $x "unmolested" in YSH -That means YSH can have: +This allowed YSH to have: echo $x # YES: an even shorter way write --sep ' ' -- $x # synonym From c61202ec80db675fc537edd48c5e2eba04498308 Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Sun, 18 Feb 2024 09:26:12 +0000 Subject: [PATCH 17/19] This -> It --- doc/ysh-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index d632401c0e..4d3cb8113f 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -113,7 +113,7 @@ We could have chosen to respect `echo -- $x`, but as YSH already has: write -- $x # print $x "unmolested" in YSH -This allowed YSH to have: +It allowed YSH to have: echo $x # YES: an even shorter way write --sep ' ' -- $x # synonym From e3b5422417b131bc23dc3b1c53c85b69db67c7ac Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Tue, 20 Feb 2024 14:18:10 +0000 Subject: [PATCH 18/19] align all comments in section --- doc/ysh-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index 4d3cb8113f..9d53e4d7c6 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -107,7 +107,7 @@ That is, `echo "$flag"` always has a few bugs: when `$flag` is `-e`, `-n`, So portable shell scripts use: - printf '%s\n' "$x" # print $x "unmolested" in POSIX shell + printf '%s\n' "$x" # print $x "unmolested" in POSIX shell We could have chosen to respect `echo -- $x`, but as YSH already has: From 1035cc4536492961de3a50a42737f7727cabb496 Mon Sep 17 00:00:00 2001 From: bar-g <105970722+bar-g@users.noreply.github.com> Date: Wed, 28 Feb 2024 19:32:58 +0000 Subject: [PATCH 19/19] write example for comparison --- doc/ysh-faq.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/ysh-faq.md b/doc/ysh-faq.md index 9d53e4d7c6..281a9f87cc 100644 --- a/doc/ysh-faq.md +++ b/doc/ysh-faq.md @@ -107,7 +107,7 @@ That is, `echo "$flag"` always has a few bugs: when `$flag` is `-e`, `-n`, So portable shell scripts use: - printf '%s\n' "$x" # print $x "unmolested" in POSIX shell + printf '%s\n' "$x" # print "unmolested" in POSIX shell We could have chosen to respect `echo -- $x`, but as YSH already has: @@ -117,6 +117,7 @@ It allowed YSH to have: echo $x # YES: an even shorter way write --sep ' ' -- $x # synonym + write -- $x $y # alternative (one line per arg) So `echo` is technically superfluous in YSH, but it's also short, familiar, and correct.