Re: Jessie (8.0) - Unexpected behavior of "MATE Terminal" after reboot

2016-09-21 Thread Richard Owlett

On 9/21/2016 7:30 AM, Richard Owlett wrote:

On 9/21/2016 7:06 AM, David wrote:

On 21 September 2016 at 21:59, Richard Owlett
 wrote:

I'm learning the shell.


Which shell?


That may be an an even better question than meets the eye.

I have two use cases:
   1. the immediate one being whatever shell MATE terminal uses.
  Sub-question: When in an arbitrary terminal of an arbitrary
Desktop Environment,
 how would I determine which shell is in use?
   2. The motivation for learning shell is to create a custom
preseed.cfg file as per
  "B.5.3. Chainloading preconfiguration files" of
_Installation Manual_.




Thank you all for answers. They even prompted a few questions I 
didn't know I should have asked ;/


I have found:
  1. Mate Terminal uses bash.
  2. entering /bin/sh puts me in dash
 Which is what scripts placed in preseed.cfg use. [my 
motivation for journey]
 Makes the question of command history and variable 
persistence moot.


Later.



Re: Jessie (8.0) - Unexpected behavior of "MATE Terminal" after reboot

2016-09-21 Thread John Hasler
Gregg writes:
> imadev:~$ csh
> % echo "$0"
> No file for $0.

Well, that tells you that you are running something weird and
nonstandard such as csh.  But if you are running csh you already knew
that.

If

echo $0

doesn't produce satisfactory results run

ps

and examine the output.
-- 
John Hasler 
jhas...@newsguy.com
Elmwood, WI USA



Re: Jessie (8.0) - Unexpected behavior of "MATE Terminal" after reboot

2016-09-21 Thread Greg Wooledge
On Wed, Sep 21, 2016 at 08:18:36AM -0500, John Hasler wrote:
> To find out what shell you are running type
> 
> echo $0

imadev:~$ csh
% echo "$0"
No file for $0.

The world's a much bigger place than just the Bourne family of shells,
unfortunately.

ps -p $$   # works in csh too



Re: Jessie (8.0) - Unexpected behavior of "MATE Terminal" after reboot

2016-09-21 Thread John Hasler
Richard writes:
> When in an arbitrary terminal of an arbitrary Desktop Environment, how
> would I determine which shell is in use?

To find out what shell is the login shell type

echo $SHELL

To find out what shell you are running type

echo $0

To run the Korn shell type

ksh

To kill the shell you are currenting using type

control-D

To clear bash command history on logout truncate ~.bash_history in
~.bash_logout.


Note that desktop environments do not respect Unix conventions and
standards so some of the above may not work as expected in some DEs.
-- 
John Hasler 
jhas...@newsguy.com
Elmwood, WI USA



Re: Jessie (8.0) - Unexpected behavior of "MATE Terminal" after reboot

2016-09-21 Thread Greg Wooledge
On Wed, Sep 21, 2016 at 07:30:50AM -0500, Richard Owlett wrote:
>   1. the immediate one being whatever shell MATE terminal uses.

Unless it's completely diverging from Unix standards, it should launch
your user account's shell as defined either by the $SHELL environment
variable, or by your entry in the passwd database.

>  Sub-question: When in an arbitrary terminal of an arbitrary 
> Desktop Environment,
> how would I determine which shell is in use?

In my experience, the simplest way to see what shell you are in is to
run this command:

ps -p $$

This command "works" (for varying definitions) in Bourne-family shells,
csh-family shells, BSD systems, and System V systems.

But you'd also be well-served to check out the $SHELL variable, and
your own entry in /etc/passwd or whichever passwd database you happen
to be using, and to understand what it means.



Re: Jessie (8.0) - Unexpected behavior of "MATE Terminal" after reboot

2016-09-21 Thread Richard Owlett

On 9/21/2016 7:06 AM, David wrote:

On 21 September 2016 at 21:59, Richard Owlett  wrote:

I'm learning the shell.


Which shell?


That may be an an even better question than meets the eye.

I have two use cases:
  1. the immediate one being whatever shell MATE terminal uses.
 Sub-question: When in an arbitrary terminal of an arbitrary 
Desktop Environment,

how would I determine which shell is in use?
  2. The motivation for learning shell is to create a custom 
preseed.cfg file as per
 "B.5.3. Chainloading preconfiguration files" of 
_Installation Manual_.





Try 'man whatever.shell.you.are.using' and read what it says about "history".

In bash for example, you can set HISTFILESIZE to zero.






Re: Jessie (8.0) - Unexpected behavior of "MATE Terminal" after reboot

2016-09-21 Thread Brad Rogers
On Wed, 21 Sep 2016 07:18:50 -0500
Richard Owlett  wrote:

Hello Richard,

>Is this a systemd thing?

No, it's a bash thing.  If you're not using bash (IDK what Mate's
terminal is based on) then it won't exist.  Look for something like
equivalent to see what you've got, if anything.

-- 
 Regards  _
 / )   "The blindingly obvious is
/ _)radnever immediately apparent"
Keep your drink just give 'em the money
U & Ur Hand - P!nk


pgpjh_gvyHbsw.pgp
Description: OpenPGP digital signature


Re: Jessie (8.0) - Unexpected behavior of "MATE Terminal" after reboot

2016-09-21 Thread Peter Ludikovsky
Hello,

Not a bug, but a feature since the first C shell release in 1978 [1],
which was copied to pretty much every shell created since (Korn
shell/ksh, Bourne again shell/bash, Z shell/zsh, …). The reason behind
it is that – since Unix predates most graphical user interfaces, and
most of the time the computers were accessed over slow modem lines – in
case of a disconnect you might want to know which commands you entered
last, and maybe re-run them with different parameters.

But really, this shouldn't influence your learning. After all, the shell
only remembers the history of entered commands, it does neither replay
those commands, nor save the state of the shell upon exit. Think of it
as kind of the URL history a browser saves. Just because the URL is
saved, it doesn't automatically load the page on startup. Depending on
the shell you're actually using, it might even be possible to
temporarily disable the shell history, akin to “Incognito Mode”.

Regards
/peter

[1] https://en.wikipedia.org/wiki/C_shell#History

On 09/21/2016 01:59 PM, Richard Owlett wrote:
> I'm learning the shell.
> I experiment with test cases in "MATE Terminal"
> The "up arrow" key is useful to recall previous command for editing.
> I hadn't expected it when I found all instances of "MATE Terminal" share
> same history.
> 
> *HOWEVER* I found that history remains after a "power off", "boot" cycle.
> That is *UNACCEPTABLE* for my purposes.
> To start FRESH was the purpose of "power off", "boot" cycle.
> 
> BUG?
> Workaround?
> 
> TIA
> 



signature.asc
Description: OpenPGP digital signature


Re: Jessie (8.0) - Unexpected behavior of "MATE Terminal" after reboot

2016-09-21 Thread Richard Owlett

On 9/21/2016 7:04 AM, humbert.olivie...@free.fr wrote:

De: "Richard Owlett" 

Workaround?


rm ~/.bash_history

HTH


It didn't :<
No such file seems to exist in any directory.
Is this a systemd thing?




Re: Jessie (8.0) - Unexpected behavior of "MATE Terminal" after reboot

2016-09-21 Thread David
On 21 September 2016 at 21:59, Richard Owlett  wrote:
> I'm learning the shell.

Which shell?

Try 'man whatever.shell.you.are.using' and read what it says about "history".

In bash for example, you can set HISTFILESIZE to zero.



Re: Jessie (8.0) - Unexpected behavior of "MATE Terminal" after reboot

2016-09-21 Thread humbert . olivier . 1
De: "Richard Owlett" 
> Workaround?

rm ~/.bash_history

HTH