Re: Regularize shift $((OPTIND - 1)) after getopts

2023-08-30 Thread Andreas Kusalananda Kähäri
y, but still... I'm an academic. > > My patch changes all of these to the $((OPTIND - 1)) usage, which > encourages good shell practice and is clearly understandable. It > ignores src/gnu since I believe those files are vendored in, and there's > no reason to introd

Re: [PATCH] Add -executable, -readable, and -writable options to /usr/bin/find

2023-04-02 Thread Andreas Kusalananda Kähäri
-type f -perm -400 > > > > on linux, those flags make sense to have because they also take care of > > ACLs, while their -perm doesn't. OpenBSD doesn't have ACLs. > > > Note that e.g. -executable tests whether the current item is readable s/readable/executable duh -- Andreas (Kusalananda) Kähäri SciLifeLab, NBIS, ICM Uppsala University, Sweden .

Re: [PATCH] Add -executable, -readable, and -writable options to /usr/bin/find

2023-04-02 Thread Andreas Kusalananda Kähäri
external utility, which it is not on OpenBSD, so we would use something silly like "! -exec sh -c 'cd "$1"' sh {} \;" instead, unless we got either really creative or just ignored the fact that we can't enter that directory and redirect all diagnostic messages to /dev/null. Cheers, -- Andreas (Kusalananda) Kähäri SciLifeLab, NBIS, ICM Uppsala University, Sweden .

Re: Adding POSIX c99 compiler wrapper script

2022-02-11 Thread Andreas Kusalananda Kähäri
ly the place for it. > > > 0: https://github.com/freebsd/freebsd-src/blob/main/usr.bin/c99/c99.c > > Funny, it strips -lrt! > > > 1: https://github.com/NetBSD/src/blob/trunk/usr.bin/c99/c99.sh > > 2: https://salsa.debian.org/toolchain-team/gcc-defaults/-/blob/master/c99 > > -- Andreas (Kusalananda) Kähäri SciLifeLab, NBIS, ICM Uppsala University, Sweden .

Re: man sed(1) diff

2021-09-05 Thread Andreas Kusalananda Kähäri
rwise, delete the initial segment of the pattern space through the first , and start the next cycle with the resultant pattern space and without reading any new input. The difference is that the POSIX text explicitly says that "D" should act like "d" if there is no

Re: man sed(1) diff

2021-09-05 Thread Andreas Kusalananda Kähäri
uot;? Should it be moved to > directly follow that instead of following the "into a pattern space" > part? > Alternatively, would it be better to move the "(...)" part to a > separate subsequent sentence like this: > > (A newline character may be present in the

Re: sed(1): line addresses and next cycle

2021-08-15 Thread Andreas Kusalananda Kähäri
memmove(ps, p + 1, psl); > @@ -267,8 +271,9 @@ new: if (!nflag && !pd) > * (lastline, linenumber, ps). > */ > #define MATCH(a)\ > - (a)->type == AT_RE ? regexec_e((a)->u.r, ps, 0, 1, 0, psl) :\ > - (a)->type == AT_LINE ? linenum == (a)->u.l : lastline() > + (a)->type == AT_LINE ? linenum == (a)->u.l :\ > + (a)->type == AT_LAST ? lastline() : \ > + pd ? 0 : regexec_e((a)->u.r, ps, 0, 1, 0, psl) > > /* > * Return TRUE if the command applies to the current line. Sets the inrange > -- Andreas (Kusalananda) Kähäri SciLifeLab, NBIS, ICM Uppsala University, Sweden .

Re: /etc/netstart argument handling

2021-05-01 Thread Andreas Kusalananda Kähäri
+ netstart 30 Apr 2021 19:14:01 - > @@ -233,7 +233,7 @@ PRINT_ONLY=false > V4_DHCPCONF=false > V6_AUTOCONF=false > > -while getopts ":n" opt; do > +while getopts n opt; do > case $opt in > n) PRINT_ONLY=true;; > *) usage;; -- Andreas (Kusalananda) Kähäri SciLifeLab, NBIS, ICM Uppsala University, Sweden .

Re: ksh(1): '[' and ']' chars disturbing substitution?

2020-12-26 Thread Andreas Kusalananda Kähäri
pattern to have it be interpeted as a string an not as a shell globbing pattern: ${str%"${str#??}"} You may also want to use printf to output variable data (it doesn't matter in this particular case though, but would matter with bash with the xpg_echo shell option set, if the two

Re: syspatch exit state

2020-12-06 Thread Andreas Kusalananda Kähäri
y the exit status of the script. No need for an if statement or explicit exit. Returning a non-zero exit status is generally a sign of some sort of failure. Not applying a patch due to already having the patch applied is not really a failure. Instead, you could run syspatch -c from a regular cro

Re: find -exec util {} arg + confusion

2020-11-20 Thread Andreas Kusalananda Kähäri
On Mon, Nov 16, 2020 at 09:15:11AM +0100, Paul de Weerd wrote: > Hi Andreas, > > On Mon, Nov 16, 2020 at 08:53:36AM +0100, Andreas Kusalananda Kähäri wrote: > | On Thu, Nov 12, 2020 at 08:51:22PM +0100, Paul de Weerd wrote: > | > Hi all, > | > > |

Re: find -exec util {} arg + confusion

2020-11-20 Thread Andreas Kusalananda Kähäri
On Thu, Nov 19, 2020 at 03:26:28PM -0800, Jordan Geoghegan wrote: > > > On 11/16/20 12:15 AM, Paul de Weerd wrote: > > Hi Andreas, > > > > On Mon, Nov 16, 2020 at 08:53:36AM +0100, Andreas Kusalananda Kähäri wrote: > > | On Thu, Nov 12, 2020 at 08:51:22PM +0100

Re: find -exec util {} arg + confusion

2020-11-15 Thread Andreas Kusalananda Kähäri
to -exec with +, I suspect there > to be dragons. So I'm proposing to change the error to point this out > to the unsuspecting user. > > Cheers, > > Paul 'WEiRD' de Weerd > > Index: function.c [cut] I quite like Alexander's proposed smaller diff. -- Andreas (Kusalananda) Kähäri SciLifeLab, NBIS, ICM Uppsala University, Sweden .

Re: Document that openlog's first paramater must continue to point to valid data

2020-02-03 Thread Andreas Kusalananda Kähäri
null-terminated identifier that shall be prepended (without the null terminator) to every message. The application shall ensure that the string pointed to by ident remains valid during the syslog() calls that will prepend this identifier; however, it is unspecif

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-29 Thread Andreas Kusalananda Kähäri
intention of ensnaring users of other shells: > >$ uname -a > OpenBSD isnote.usta.de 6.6 GENERIC.MP#583 amd64 >$ csh -c 'echo .*' > . .. Ah, you are correct. I see that it's a slight mischance that I've never had to use csh(1). Regards, -- Andreas (Kusalananda) Kähäri SciLifeLab, NBIS, ICM Uppsala University, Sweden .

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-29 Thread Andreas Kusalananda Kähäri
ter hidden directory names like .a, .b etc. As far as I know, neither ksh(1) nor sh(1) expands .* to .. (which I assume the ?? in .??* is a precaution against). $ ls -la total 4 drwxr-xr-x 2 kk wheel 512 Jan 29 18:03 . drwxr-xr-x 3 kk wheel 512 Jan 29 18:03 .. $ echo .* .* > .Sh SEE ALSO > .Xr df 1 , > .Xr fts_open 3 , -- Andreas (Kusalananda) Kähäri SciLifeLab, NBIS, ICM Uppsala University, Sweden .

Naive patch to allow amd(8) to mount NFS with wxallowed

2020-01-20 Thread Andreas Kusalananda Kähäri
I noticed that the following amd(8) map did not actually mount the remote NFS filesystem with the wxallowed mount option: /defaults sublink:=${key} * host==eeyore;type:=link;fs:=/vol/local/${host}; \ host!=eeyore;type:=nfs;rhost:=eeyore;rfs:=/vol/local/${host};\

Re: grep -R with no path

2019-12-03 Thread Andreas Kusalananda Kähäri
It Fl s > Silent mode. > Nonexistent and unreadable files are ignored Could I suggest using "the current working directory" or "the current directory" in place of "the working directory"? Regards, -- Andreas (Kusalananda) Kähäri SciLifeLab, NBIS, ICM Uppsala University, Sweden

Re: find.1: Use -delete in EXAMPLES

2019-08-22 Thread Andreas Kusalananda Kähäri
On Thu, Aug 22, 2019 at 12:37:28PM +0200, Klemens Nanni wrote: > We support -delete since the following and I see no reason to prefer the > current examples for the very same reasons tedu already outlined: > > find.c revision 1.21 > date: 2017/01/03 21:31:16; author: tedu; state: Exp

Re: Conditional sysupgrade

2019-04-27 Thread Andreas Kusalananda Kähäri
v touch SHA256.sig > +CUR_SHA=$(sha256 -q SHA256.sig) > + > +if [[ "${TMP_SHA}" = "${CUR_SHA}" ]]; then Why compare checksums? if cmp -s SHA256.sig SHA256.sig.tmp; then > + rm SHA256.sig.tmp > + return 0 > +fi > + > +unpriv cat SHA256.s

Re: bgpd use long long instead of int64_t

2019-02-18 Thread Andreas Kusalananda Kähäri
msg_rcvd_rrefresh; > > - u_int64_tmsg_sent_open; > > - u_int64_tmsg_sent_update; > > - u_int64_tmsg_sent_notification; > > - u_int64_tmsg_sent_keepalive; > > - u_int64_tmsg_sent_rrefresh; > > - u_int64_tprefix_rcvd_update; > > - u_int64_tprefix_rcvd_withdraw; > > - u_int64_tprefix_rcvd_eor; > > - u_int64_tprefix_sent_update; > > - u_int64_tprefix_sent_withdraw; > > - u_int64_tprefix_sent_eor; > > + unsigned long long msg_rcvd_open; > > + unsigned long long msg_rcvd_update; > > + unsigned long long msg_rcvd_notification; > > + unsigned long long msg_rcvd_keepalive; > > + unsigned long long msg_rcvd_rrefresh; > > + unsigned long long msg_sent_open; > > + unsigned long long msg_sent_update; > > + unsigned long long msg_sent_notification; > > + unsigned long long msg_sent_keepalive; > > + unsigned long long msg_sent_rrefresh; > > + unsigned long long prefix_rcvd_update; > > + unsigned long long prefix_rcvd_withdraw; > > + unsigned long long prefix_rcvd_eor; > > + unsigned long long prefix_sent_update; > > + unsigned long long prefix_sent_withdraw; > > + unsigned long long prefix_sent_eor; > > time_t last_updown; > > time_t last_read; > > u_int32_tprefix_cnt; > > > > -- Andreas Kusalananda Kähäri, National Bioinformatics Infrastructure Sweden (NBIS), Uppsala University, Sweden.

Re: man -> vim

2019-02-15 Thread Andreas Kusalananda Kähäri
ecial characters. looks very good. > > Is it possible to convert *raw* data of man page to normal format (for > *vim*) with one command? > > BR, > > -op man man | col -b | vim - See the col(1) manual. This is also mentioned in the mandoc(1) manual, in the "ASCII

Re: MySQL Server on OpenBSD

2017-12-11 Thread Andreas Kusalananda Kähäri
write the schema without the view's subquery in that FROM clause. Regards, -- Andreas Kusalananda Kähäri, National Bioinformatics Infrastructure Sweden (NBIS), Uppsala University, Sweden.

Re: bc -l wording

2017-10-06 Thread Andreas Kusalananda Kähäri
> +Load an arbitrary precision math library. > The definitions in the library are available to command line > expressions. > .El > -- Andreas Kusalananda Kähäri, National Bioinformatics Infrastructure Sweden (NBIS), Uppsala University, Sweden.

Re: Can not allocate memory for KERN_MSGBUF

2016-06-24 Thread Andreas Kusalananda Kähäri
On Fri, Jun 24, 2016 at 01:19:32PM +0200, Alexander Bluhm wrote: > On Fri, Jun 24, 2016 at 10:30:04AM +0200, Andreas Kusalananda K?h?ri wrote: > > I'm following -current on amd64, running in VirtualBox. I recompiled > > the kernel today with fresh sources, like I do a few times a week on > > slow

Can not allocate memory for KERN_MSGBUF

2016-06-24 Thread Andreas Kusalananda Kähäri
On Thu, Jun 23, 2016 at 07:15:21AM -0600, Alexander Bluhm wrote: > CVSROOT: /cvs > Module name: src > Changes by: bl...@cvs.openbsd.org 2016/06/23 07:15:21 > > Modified files: > sys/kern : subr_log.c > sys/sys: msgbuf.h > > Log message: > It is annoying that

Re: tr.1 -s wording

2016-04-18 Thread Andreas Kusalananda Kähäri
g2 ) > -in the input into a single instance of the character. > +from the input. > This occurs after all deletion and translation is completed. > .El > .Pp > -- Andreas Kusalananda Kähäri, Bioinformatics Developer (NBIS) Uppsala University, Uppsala, Sweden NBIS: http://nbis.se OpenPGP: url=https://db.tt/2zaB1E7y; id=46082BDF signature.asc Description: PGP signature

Quoting ${CC} expansion in libiberty Makefile

2016-01-19 Thread Andreas Kusalananda Kähäri
Previously sent to misc@, but I was told to send it here instead. Cheers, Andreas - Forwarded message from Andreas Kusalananda Kähäri - Date: Mon, 18 Jan 2016 16:33:34 +0100 From: Andreas Kusalananda Kähäri To: openbsd-misc Subject: Quoting ${CC} expansion in libiberty Makefile Hi

ntpd pledge, needs "unix" to talk to ntpctl

2015-11-19 Thread Andreas Kusalananda Kähäri
(5,0x7f7c2630,0x7f7c262c) 29946 ntpd PLDG accept, "unix", errno 1 Operation not permitted 29946 ntpd PSIG SIGABRT SIG_DFL [...] I also get ntpd(): syscall 30 "unix" in the console. Cheer, ps. is tech@ the right list for these sorts of things? -- :: Andreas Kusalananda Kähä

On console: newsyslog(3865): sycall 59 "exec"

2015-11-18 Thread Andreas Kusalananda Kähäri
ning "newsyslog -F" seems to set off one of those messages per rotated log file(?). My system is an amd64 system with sources from this morning. Andreas -- :: Andreas Kusalananda Kähäri :: Bioinformatics Developer :: Uppsala, Sweden ::--

Re: Pledge shutdown halt

2015-11-17 Thread Andreas Kusalananda Kähäri
connection to xxx.xxx.xx.xxx closed. Connection to xxx.xxx.xx.xxx closed by remote host. I do not run X. -- :: Andreas Kusalananda Kähäri :: Bioinformatics Developer :: Uppsala, Sweden ::--

Re: Pledge shutdown halt

2015-11-17 Thread Andreas Kusalananda Kähäri
gt; OpenBSD 5.8-current (GENERIC.MP) #0: Wed Nov 18 14:15:33 AEDT 2015 > >   >   r...@ianm-openbsd.xxx.edu.au:/usr/src/sys/arch/amd64/compile/GENERIC.MP > > Machine still shuts down and powers off. > > Ian McWilliam > -- :: Andreas Kusalananda Kähäri :: Bioinformatics Developer :: Uppsala, Sweden ::--

[Patch] Quoting ${CC} in Makefile wrapper, libiberty

2015-05-06 Thread Andreas Kusalananda Kähäri
Hi, The Makefile.bsd-wrapper for src/gnu/lib/libiberty is the only such Makefile (that I could find) that does not quote ${CC} properly. A trivial patch is attached. Cheers, -- :: Andreas Kusalananda Kähäri, Bioinformatics Developer, BILS, :: Uppsala University, Sweden