From: eyvind.ness@hrp.NO (Eyvind Ness)
Subject: Re: An annoying feature of file completion, perhaps?
Reply-To: Eyvind.Ness@hrp.no
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 8 Apr 1992 07:22:00 GMT

  | Date: Tue, 7 April 1992, 10:01 -0400
  | From: Chet Ramey
  |
  | >   | on a completely unrelated note, when I use bash on top of csh using
  | >   | 
  | >   | bash -login
  | >   | 
  | >   | I get couple of copies of
  | >   | 
  | >   | setenv: command not found
  | >   | 
  | >   | As far as I can tell, it complains but has no problems.
  | >   | Could someone explain why this happens? Thanks.
  | 
  | Your diagnosis was on the mark, but there's a simpler cure:
  | 
  | setenv()
  | {
  | 	export $1="$2"
  | }

But you can't put this alias in /etc/profile before the offending `tset'
command, because /etc/profile is consulted by all Bourne shell like
shells, some of which might be ignorant about functions and aliases.

I suggest instead that you make a habit of typing:

	% env SHELL=/bin/bash bash -login

when switching from *csh to bash and when your login SHELL is *csh. And
vice versa:

	bash$ env SHELL=/bin/csh csh

when switching from bash to csh and when your login shell is bash. This
will make tset see the correct SHELL env var before it issues it
terminal specific and shell dependent initializations.


>From the manual entry of tset(1) on my system:

 NAME
      tset, reset - terminal-dependent initialization

 SYNOPSIS
      tset [options] [-m [ident] [test baudrate] :type] ...  [type]

      reset

      [...]

           -s      Generate appropriate commands (depending on current SHELL
                   environment variable) to set TERM.


Example bash->csh (Wrong!)

   dole(bash)$ echo $SHELL
   /bin/bash
   dole(bash)$ csh
   dole% tset -s
   export TERM;
   TERM=xterm;
   Erase is Delete
   Kill is Ctrl-U


Example bash->csh (Correct!):

   dole(bash)$ env SHELL=/bin/bash csh
   dole% tset -s
   set noglob;
   setenv TERM xterm ;
   unset noglob;
   Erase is Delete
   Kill is Ctrl-U


Example csh->bash (Wrong!)

   % echo $SHELL
   /bin/csh
   % bash -login
   dole(bash)$ tset -s
   set noglob;
   setenv TERM xterm ;
   unset noglob;
   Erase is Delete
   Kill is Ctrl-U


Example csh->bash (Correct!):

   % env SHELL=/bin/bash bash -login
   dole(bash)$ tset -s
   export TERM;
   TERM=xterm;
   Erase is Delete
   Kill is Ctrl-U


Above I have assumed that bash is found in /bin/bash, but of course it
may reside womewhere else on your system. Just substitute "/bin/bash"
with the full path to bash wherever you see "/bin/bash" above.

Eyvind.

 - a Bash lover.


+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
 Eyvind Ness                    Internet Email: Eyvind.Ness@HRP.No
 Research Scientist             Phone: +47 9 183100
 Control Room Systems Division  Fax: +47 9 187109
 OECD Halden Reactor Project    Surface Mail: P.O. Box 173, N-1751 Halden
 Norway
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

 -One of the problems for established companies is the entrenchment of
the Fred Flintstone Mainframe MIS person.

 -Hi! I am a .signature virus. Copy me into your .signature to join in!

Newsgroups: gnu.bash.bug