On Tue, Feb 18, 2025 at 09:10:44AM -0500, enh wrote:
> fwiw, one reason i never bothered implementing strverscmp() for
> Android is that (a) basic testing showed that the gnu documentation
> didn't match their implementation and (b) no two existing
> implementations appeared to behave the same.
It
On Thu, Oct 31, 2024 at 12:35:01AM +0100, Steffen Nurpmeso wrote:
> наб wrote in
>.xyz>:
> |You can still write this portably:
> | echo crontab > ./-
> | crontab - < -
> | rm -
> |unideal, sure, but.
> OpenIndiana says
> #?1|oi-2024:steffen$ cr
On Wed, Oct 30, 2024 at 06:29:57PM +0100, Edgar Fuß wrote:
> > If NetBSD "crontab" errors with
> > "use crontab - to replace your crontab from the standard input stream"
> > then that's an improvement over both the standard and the status quo IMO
> While I agree that what POSIX demands is not idea
On Tue, Oct 29, 2024 at 07:11:10PM +0100, Edgar Fuß wrote:
> > Those are not inconsistent, unless SUS specifies other behaviour for
> > the case of a bare -, or NetBSD's version doesn't read from stdin when
> > no (pseudo-)filename is given.
They are, POSIX says something like
97851 STDIN
9785
cf. src/sys/kern/vfs_syscalls.c#do_sys_linkat:
/* Prevent hard links on directories. */
if (vp->v_type == VDIR) {
error = EPERM;
goto abortop;
}
This happens before any call to the VFS, so NetBSD simply refuses links
to directories (this is l
On Sat, Jul 06, 2024 at 06:09:16PM +0200, tlaro...@kergis.com wrote:
> With sh(1), and specially on NetBSD, I tend to expect this behavior:
>
> $ line=$(printf "a\tb")
> $ echo $line | od -a
> 000a sp b nl
> 004
line has the value a, tab, b.
Given the default value of IFS (space,
On Fri, Jul 05, 2024 at 10:03:05AM -0400, Mouse wrote:
> In...C++, I think it is?, you can do this by declaring the unused arg
> without a name, as in
>
> void fxn(int arg1, int)
> {
> ...
> }
>
> but as far as I know nobody's picked that up in C. (It strikes me as a
> very sensible approach.)
is not a proper value, or the resulting
file offset would
46260be negative for a regular file, block special file, or
directory.
Best,
наб
signature.asc
Description: PGP signature
For my personal use and tail, I've arrived at:
if(argv[0] && argv[1] && (!argv[2] || !argv[3]) &&
(*argv[1] == '-' || *argv[1] == '+') &&
(*argv[1] != '-' || (*(argv[1] + 1) != 'c' && *(argv[1] + 1) != 'f'
&& *(argv[1] + 1) != 'r')) && (!argv[2] || *argv[2] != '-')) {
On Mon, Jul 03, 2023 at 06:13:45AM +, David Holland wrote:
> On Fri, Jun 30, 2023 at 05:51:13PM +0200, tlaro...@polynum.com wrote:
> > For this one I will go with the established behavior, but what should I
> > do when someone is passing, in octal or in hexa: "\000" ou "\x00"?
> If you don't
g indicates "Extension to the ISO C standard").
Funnily, one place in the teletype definitions still uses "bits per byte"
instead of "bits per character" as a historical artifact.
uudecode is defined as undefined if the encoder and decoder have
different byte widths.
Best,
наб
signature.asc
Description: PGP signature
anges existing behaviour.
OTOH if you add a
&& !(p->fts_statp->st_mode & 07000)
then that's probably fine.
Best,
наб
signature.asc
Description: PGP signature
ns
that the implementation need not support any options. Standard
utilities that do not accept options, but that do accept operands,
shall recognize "--" as a first argument to be discarded.
Best,
наб
signature.asc
Description: PGP signature
Right now, doshell() with -c always falls down to fail(),
which SIGTERMs the process group, so the exit code is always 143:
$ script -ec 'echo a; exit 12'
Script started, output file is typescript
a
Script done, output file is typescript
$ echo $?
143
Instead, handle non-error returns
use the string is subject to shell expansion.
> Sure, it could say "is run by /bin/sh", but there's no need to
> have people race off to the sh manual to find out what -c means,
> if they don't already know.
I mean, I wouldn't say I necessarily agree because that'
-c /actually/ took a command, like FreeBSD
script does. As it stands, and, for compatibility, presumably as it will
stand, script takes a shell program, not a command, and
script -c 'for i in 0 1 2 3 4 5 6; do echo $i; done; exec ls'
is valid. Admittedly, saying "-c script" or "-c shell-program" /would/
be too much, but as it stands, it's still important to note this,
because the string is subject to shell expansion.
Best,
наб
signature.asc
Description: PGP signature
atomic as possible;
there are, of course, ways to meld them together if you'd rather
them be bigger; it's possible, also, that you'd prefer passthrough
to happen always: in this case 5/6 needs to be dropped and 6/6 reworded.
Best,
наб (6):
script.c: fix usage string
script.c: use
#x27;s) dd: the "ibm" and "oldibm" tables
are identical, because POSIX just standardised the table from V7.
No-body, including the original authors, seeems to have noticed this.
This patch merges them and notes this fact in the manual
(and also fixes the odd, inconsistent, spellin
---
script.1 | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/script.1 b/script.1
index 07d01f0..6e8dc87 100644
--- a/script.1
+++ b/script.1
@@ -37,7 +37,7 @@
.Nd make typescript of terminal session
.Sh SYNOPSIS
.Nm
-.Op Fl adfpqr
+.Op Fl adefpqr
.Op Fl c Ar command
.
---
script.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/script.c b/script.c
index 4899d35..407793f 100644
--- a/script.c
+++ b/script.c
@@ -81,6 +81,7 @@ static intusesleep, rawout;
static int quiet, flush;
static const char *fname;
+static int e
---
script.c | 37 +++--
1 file changed, 15 insertions(+), 22 deletions(-)
diff --git a/script.c b/script.c
index 1b42a3b..4899d35 100644
--- a/script.c
+++ b/script.c
@@ -84,7 +84,7 @@ static const char *fname;
static int isterm;
static struct termios tt;
---
script.1 | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/script.1 b/script.1
index 51c76d8..07d01f0 100644
--- a/script.1
+++ b/script.1
@@ -29,7 +29,7 @@
.\"
.\"@(#)script.18.1 (Berkeley) 6/6/93
.\"
-.Dd October 17, 2009
+.Dd January 3, 2022
.Dt SCRIPT
---
script.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/script.c b/script.c
index 209505c..1b42a3b 100644
--- a/script.c
+++ b/script.c
@@ -293,12 +293,12 @@ doshell(const char *command)
if (shell == NULL)
shell = _PATH_BSHELL;
---
script.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/script.c b/script.c
index 0c60922..209505c 100644
--- a/script.c
+++ b/script.c
@@ -139,7 +139,7 @@ main(int argc, char *argv[])
case '?':
default:
(void)fprintf
24 matches
Mail list logo