Re: Fwd: Re: interactive shell detection in shrc

2024-10-01 Thread RVP
On Tue, 1 Oct 2024, RVP wrote: Ugly, but, works--after a fashion: - Only for DIRs in the CWD. - no `/' allowed in DIR. - if CMD with the same name as DIR is found in $PATH, that will be executed. (I tried defining a command_not_found_handle function but that doesn't seem to work if the comm

Re: Fwd: Re: interactive shell detection in shrc

2024-10-01 Thread RVP
On Tue, 1 Oct 2024, Rhialto wrote: In bash, I use an alias '..' for 'cd ..', and '...' for 'cd ../..', and a few levels more. It is a very poor approximation of the AmigaShell feature where typing a directory name as a command does a 'cd' to that directory. I wish (ba)sh had such a feature...

Re: Fwd: Re: interactive shell detection in shrc

2024-10-01 Thread Rhialto
In bash, I use an alias '..' for 'cd ..', and '...' for 'cd ../..', and a few levels more. It is a very poor approximation of the AmigaShell feature where typing a directory name as a command does a 'cd' to that directory. I wish (ba)sh had such a feature... (I tried defining a command_not_found_ha

Re: Fwd: Re: interactive shell detection in shrc

2024-09-30 Thread RVP
On Mon, 30 Sep 2024, Robert Elz wrote: | This is _very_ surprising; esp. when /bin/sh doesn't allow chars. | like `/' and `.' in the function name. Huh? sh $ a.v() echo I have a dot in my name sh $ a.v I have a dot in my name Ah, that's right. It's FreeBSD's /bin/sh (and dash) which doesn

Re: Fwd: Re: interactive shell detection in shrc

2024-09-29 Thread Mouse
> But in general, no, there's probably not a lot of use for it, but nor > is there any particular reason to add special case code to prohibit > it. I was thinking, most languages have names for functions and such, but sh is one of the few languages in which a zero-length routine name is even repre

Re: Fwd: Re: interactive shell detection in shrc

2024-09-29 Thread Robert Elz
Date:Sun, 29 Sep 2024 23:59:48 + (UTC) From:RVP Message-ID: | This is _very_ surprising; esp. when /bin/sh doesn't allow chars. | like `/' and `.' in the function name. Huh? sh $ a.v() echo I have a dot in my name sh $ a.v I have a dot in my name You can

Re: Fwd: Re: interactive shell detection in shrc

2024-09-29 Thread RVP
On Wed, 25 Sep 2024, Robert Elz wrote: In NetBSD's sh you can actually do ''() { echo nothing; } (where the function body can be anything of course), then the empty-string command (as distinct from absent command) does exist, and works, but I would not recommend this to anyone, it isn'

Re: Fwd: Re: interactive shell detection in shrc

2024-09-25 Thread Steffen Nurpmeso
Robert Elz wrote in <6599.1727248...@jacaranda.noi.kre.to>: |Date:Tue, 24 Sep 2024 23:54:13 + (UTC) |From:RVP |Message-ID: <4d7cdca7-fcf4-8985-7c1d-79ef63125...@sdf.org> | || On Tue, 24 Sep 2024, Steffen Nurpmeso wrote: | |I replied to Steffen's (pre-forwar

Re: Fwd: Re: interactive shell detection in shrc

2024-09-25 Thread Steffen Nurpmeso
RVP wrote in <4d7cdca7-fcf4-8985-7c1d-79ef63125...@sdf.org>: |On Tue, 24 Sep 2024, Steffen Nurpmeso wrote: |> Robert Elz wrote in |> <7132.1727161...@jacaranda.noi.kre.to>: |>|Date:Tue, 24 Sep 2024 00:56:40 +0200 |> [...] |>| if $___SHRC |> |> Oh, i would be afraid of doing thi

Re: Fwd: Re: interactive shell detection in shrc

2024-09-25 Thread Robert Elz
Date:Wed, 25 Sep 2024 14:17:07 +0700 From:Robert Elz Message-ID: <6599.1727248...@jacaranda.noi.kre.to> | Not a syntax error, an execution error, Sorry, saw your following message correcting that after I replied. | In NetBSD's sh you can actually do | ''()

Re: Fwd: Re: interactive shell detection in shrc

2024-09-25 Thread Robert Elz
Date:Tue, 24 Sep 2024 23:54:13 + (UTC) From:RVP Message-ID: <4d7cdca7-fcf4-8985-7c1d-79ef63125...@sdf.org> | On Tue, 24 Sep 2024, Steffen Nurpmeso wrote: I replied to Steffen's (pre-forwarded) message off list, but: | Yes, this surprised me too. This test is

Re: Fwd: Re: interactive shell detection in shrc

2024-09-24 Thread RVP
On Tue, 24 Sep 2024, RVP wrote: | if "${___SHRC:-:}" A syntax error of yours? No, that becomes `if ":" ...' $___SHRC is undefined or empty. You need to write it that way, else it's a syntax error. Sorry, I meant to say a "command not found" error (when trying to execute an empty string

Re: Fwd: Re: interactive shell detection in shrc

2024-09-24 Thread RVP
On Tue, 24 Sep 2024, Steffen Nurpmeso wrote: Robert Elz wrote in <7132.1727161...@jacaranda.noi.kre.to>: |Date:Tue, 24 Sep 2024 00:56:40 +0200 [...] | if $___SHRC Oh, i would be afraid of doing this implicit test. I no longer have many shells around, not even as source code, so i w

Fwd: Re: interactive shell detection in shrc

2024-09-24 Thread Steffen Nurpmeso
--- Forwarded from Steffen Nurpmeso --- Date: Tue, 24 Sep 2024 22:26:34 +0200 Author: Steffen Nurpmeso From: Steffen Nurpmeso To: Robert Elz Cc: Valery Ushakov Subject: Re: interactive shell detection in shrc Message-ID: <20240924202634.-Z-0KGXP@steffen%sdaoden.eu> Robert Elz wrote in <7132.