Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Whom the gods would destroy, they first teach BASIC.


computers / comp.sys.raspberry-pi / history, sourced script problem

SubjectAuthor
* history, sourced script problemR.Wieser
`* Re: history, sourced script problemR.Wieser
 +* Re: history, sourced script problemnev young
 |`- Re: history, sourced script problemR.Wieser
 `* Re: history, sourced script problemJim Jackson
  +- Re: history, sourced script problemR.Wieser
  `- Re: history, sourced script problemThe Natural Philosopher

1
history, sourced script problem

<u37dp2$38n3e$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=6422&group=comp.sys.raspberry-pi#6422

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: address@is.invalid (R.Wieser)
Newsgroups: comp.sys.raspberry-pi
Subject: history, sourced script problem
Date: Sun, 7 May 2023 07:42:52 +0200
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <u37dp2$38n3e$1@dont-email.me>
Injection-Date: Sun, 7 May 2023 05:42:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d24835ed015e4ef25c3ee277ea98d593";
logging-data="3431534"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ptqgPYPYwTBxo08n2NTX45uMLJoe20m7J0XsSuq5R9g=="
Cancel-Lock: sha1:sIQNIkjXTucZ5J1Ac/Wvv0QUtFs=
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Priority: 3
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Sun, 7 May 2023 05:42 UTC

Hello all,

I've got a problem with running the "history" command in a sourced
(preloaded) function:

- - - - - - - - - -
histtest() {
history -c
history -s "foobar"
} histtest
- - - - - - - - - -

When I source this script the history gets cleared and the "foobar" entry is
added to it. IOW, it works as expected.

However, when I than afterwards just type "histtest" on the commandline the
history is cleared, but the "foobar" entry isn't added.

Question: what causes the difference and how do I fix it ?

Remark: the trouble seems to come from clearing the history. When I remove
that line the "foobar" entry is, in both cases, added as expected.

Regards,
Rudy Wieser

Re: history, sourced script problem

<u4f3f6$23mcc$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=6425&group=comp.sys.raspberry-pi#6425

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: address@is.invalid (R.Wieser)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: history, sourced script problem
Date: Mon, 22 May 2023 08:52:17 +0200
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <u4f3f6$23mcc$1@dont-email.me>
References: <u37dp2$38n3e$1@dont-email.me>
Injection-Date: Mon, 22 May 2023 06:52:23 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a4ed3124fb0e85bd4a1467b1128a09b1";
logging-data="2218380"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19SogvOGaW1+VMNNVT/Pp5g/NysD/0tsmbvnGt9ZdOqOQ=="
Cancel-Lock: sha1:yEG7+xn3p/GozDxo8mxRGlCvuSU=
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Original
 by: R.Wieser - Mon, 22 May 2023 06:52 UTC

Can someone at least test the script and tell me if it works the same
(unexpected to me) way for you ?

Regards,
Rudy Wieser

Re: history, sourced script problem

<u4fg6m$253uj$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=6426&group=comp.sys.raspberry-pi#6426

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: newsforpasiphae1953@yahoo.co.uk (nev young)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: history, sourced script problem
Date: Mon, 22 May 2023 11:29:42 +0100
Organization: newsforpasiphae1953
Lines: 18
Message-ID: <u4fg6m$253uj$1@dont-email.me>
References: <u37dp2$38n3e$1@dont-email.me> <u4f3f6$23mcc$1@dont-email.me>
Reply-To: newsforpasiphae1953@yahoo.co.uk
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 22 May 2023 10:29:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1a0b6f75763afc2f19ea1a2362305064";
logging-data="2265043"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX197cBdUoBo5ekYrq7SDsybJwEiH3mqtce/Z4vJay2AE1w=="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.10.0
Cancel-Lock: sha1:3VtjC+x8F6So2M5HxW6PB4UkRCA=
In-Reply-To: <u4f3f6$23mcc$1@dont-email.me>
Content-Language: en-GB
 by: nev young - Mon, 22 May 2023 10:29 UTC

On 22/05/2023 07:52, R.Wieser wrote:
> Can someone at least test the script and tell me if it works the same
> (unexpected to me) way for you ?
>
yes.
not tested on a pi but on x86 machine running mint.

when I type the commands it does clear the history then adds foobar but
when run with the command histtest it just clears the history.

almost looks as if the clear is performed on exit from the function.

--
Nev
It causes me a great deal of regret and remorse
that so many people are unable to understand what I write.

Re: history, sourced script problem

<slrnu6mmm2.2i6.jj@iridium.wf32df>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=6427&group=comp.sys.raspberry-pi#6427

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jj@franjam.org.uk (Jim Jackson)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: history, sourced script problem
Date: Mon, 22 May 2023 12:06:26 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <slrnu6mmm2.2i6.jj@iridium.wf32df>
References: <u37dp2$38n3e$1@dont-email.me> <u4f3f6$23mcc$1@dont-email.me>
Injection-Date: Mon, 22 May 2023 12:06:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2c078d95ebb6264e10fc21be31a85a6e";
logging-data="2286131"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7rE/MIx2oOOoNN8agdkkjPBySTHciqWk="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:8TF9CKRKv1CPgC40d1XUdmnmJRo=
 by: Jim Jackson - Mon, 22 May 2023 12:06 UTC

On 2023-05-22, R.Wieser <address@is.invalid> wrote:
>
> Can someone at least test the script and tell me if it works the same
> (unexpected to me) way for you ?
>

Might be worth asking in comp.unix.shell ?

Re: history, sourced script problem

<u4fn6s$25t0s$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=6428&group=comp.sys.raspberry-pi#6428

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: address@is.invalid (R.Wieser)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: history, sourced script problem
Date: Mon, 22 May 2023 14:25:42 +0200
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <u4fn6s$25t0s$1@dont-email.me>
References: <u37dp2$38n3e$1@dont-email.me> <u4f3f6$23mcc$1@dont-email.me> <u4fg6m$253uj$1@dont-email.me>
Injection-Date: Mon, 22 May 2023 12:29:17 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a4ed3124fb0e85bd4a1467b1128a09b1";
logging-data="2290716"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PjVAtzGVakVBJWbJbOpNi25dXc4opfC7NqxaEbcWjDQ=="
Cancel-Lock: sha1:EransV5jmtoTM33fDF3dgtcmq20=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-Priority: 3
 by: R.Wieser - Mon, 22 May 2023 12:25 UTC

Nev,

>> Can someone at least test the script and tell me if it works the same
>> (unexpected to me) way for you ?
>>
> yes.

> not tested on a pi but on x86 machine running mint.

Even better ! It means (to me) that its common behaviour, not because of
some RPi specific adjustment.

> almost looks as if the clear is performed on exit from the function.

Yes, thats pretty-much the same conclusion I came to. On the other hand, I
do not know anything about the innards of bash, so it /could/ be something
else altogether .. :-)

Thanks for the testing.

Regards,
Rudy Wieser

Re: history, sourced script problem

<u4fn6u$25t0s$3@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=6429&group=comp.sys.raspberry-pi#6429

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: address@is.invalid (R.Wieser)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: history, sourced script problem
Date: Mon, 22 May 2023 14:29:10 +0200
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <u4fn6u$25t0s$3@dont-email.me>
References: <u37dp2$38n3e$1@dont-email.me> <u4f3f6$23mcc$1@dont-email.me> <slrnu6mmm2.2i6.jj@iridium.wf32df>
Injection-Date: Mon, 22 May 2023 12:29:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a4ed3124fb0e85bd4a1467b1128a09b1";
logging-data="2290716"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX180vOjFQbcUluScmb+huprRGK0kx7firCT8Z0PwKOysog=="
Cancel-Lock: sha1:+uJdT8sKkTGjZi5wR228CdQYCk8=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
 by: R.Wieser - Mon, 22 May 2023 12:29 UTC

Jim,

> Might be worth asking in comp.unix.shell ?

Thanks for that. Just copy-pasted the question into that newsgroup. Lets
see if they know what causes it ...

I also posted a similar/same question into alt.os.linux, but have not seen
any response. :-\

Regards,
Rudy Wieser

Re: history, sourced script problem

<u4gqo3$29jb2$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=6430&group=comp.sys.raspberry-pi#6430

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tnp@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: history, sourced script problem
Date: Mon, 22 May 2023 23:35:47 +0100
Organization: A little, after lunch
Lines: 20
Message-ID: <u4gqo3$29jb2$1@dont-email.me>
References: <u37dp2$38n3e$1@dont-email.me> <u4f3f6$23mcc$1@dont-email.me>
<slrnu6mmm2.2i6.jj@iridium.wf32df>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 22 May 2023 22:35:47 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="fb93c78b867bde6c0e0f7bac4078b2d1";
logging-data="2411874"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+L/PObmvG7lC+SD4eLi9v+wR7zgnzOBx8="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:HkCYaAQ4HmxgPdYCEhFYizk96+w=
Content-Language: en-GB
In-Reply-To: <slrnu6mmm2.2i6.jj@iridium.wf32df>
 by: The Natural Philosop - Mon, 22 May 2023 22:35 UTC

On 22/05/2023 13:06, Jim Jackson wrote:
> On 2023-05-22, R.Wieser <address@is.invalid> wrote:
>>
>> Can someone at least test the script and tell me if it works the same
>> (unexpected to me) way for you ?
>>
>
> Might be worth asking in comp.unix.shell ?
>
>
comp.os.linux.misc will have the answer
--
Socialism is the philosophy of failure, the creed of ignorance and the
gospel of envy.

Its inherent virtue is the equal sharing of misery.

Winston Churchill

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor