No Next Item No Next Conference Can't Favor Can't Forget Item List Conference Home Entrance    Help
View Responses


Grex Info Item 6: Shells: bbs, cshell, bourne Differences, switching between them.
Entered by jeffk on Mon Nov 9 04:24:46 UTC 1992:

So far I would say that most of us have seen the bbs shell.  I know of the
C Shell and the Bourne Shell from the initial newuser stuff.  What are these
shells and how would we switch to them if we've already gotten setup with
bbs?

143 responses total.



#1 of 143 by aa8ij on Mon Nov 9 07:19:03 1992:

  I used to use bbs shell, but of late I use csh. I changed it by asking
popcoror remmers to do it for me. The thing I like about it is the alias
commands... which are useful. 

if ($?prompt) then
    set           history=200
    alias hi      history
    alias so      source
    alias p       bbs
    alias z       elm
    alias a       logout
    alias hi      history
    alias g       backgammon
    alias tset    '/usr/ucb/tset -s \!* >/tmp/ts.$$ ; source /tmp/ts.$$ ; rm
    /tmp/ts.$$'
endif

this is what I use for my commandsthey are easy, and quick.


#2 of 143 by power on Mon Nov 9 21:59:28 1992:

  You can also change your shell using the chsh command.  Just type
!chsh at any Picospan prompt (or just chsh at a Unix prompt), and enter
a new shell.  Valid shells are:

/bin/sh     - the Bourne shell
/bin/csh    - the c shell        <---- My personal favourite
/usr/local/bin/tcsh  - an improved c shell
/b          - Picospan

  If you're interested for a decent .login file for csh to get you
started on your own, look at mine: ~power/.login.


#3 of 143 by popcorn on Tue Nov 10 04:27:05 1992:

This response has been erased.



#4 of 143 by popcorn on Tue Nov 10 04:31:37 1992:

This response has been erased.



#5 of 143 by davel on Tue Nov 10 04:35:06 1992:

But the tip about gripe or help IDs has many other possible applications.


#6 of 143 by remmers on Tue Nov 10 12:16:54 1992:

Hmm...  Maybe we ought to put a wrapper around chsh that automatically
creates default initialization files for people.  Shouldn't be too hard
to do.


#7 of 143 by power on Wed Nov 11 01:21:00 1992:

  #6:  If someone does create a wrapper that checks and makes default
init files, make sure it checks for pre-existing ones!  It would be
pretty vexing to have my .login file overwriten because I switch to
sh for a few minutes and then back to csh...

  Also, for you silly IBMers out there, a Unix shell is something like
a DOS prompt (as in the C:\ prompt).  If you're competant with DOS, DOS
is basically a ripoff combining CP/M and Unix, so Unix should be fairly
easy to pick up.


#8 of 143 by popcorn on Wed Nov 11 04:26:30 1992:

This response has been erased.



#9 of 143 by kentn on Wed Nov 11 07:49:17 1992:

Heh...good point.  I've got my csh going now, but for a day I was
locked out of the bbs.  Still not sure what all I want in .cshrc and
.login, but for now it's working...  Apparently chsh totally wipes out
your old .login.


#10 of 143 by jeffk on Thu Nov 12 00:17:42 1992:

You can always try out a shell, just by typing ! by itself.  This will
stick you into a Bourne shell, I believe.  This is, of course, meant to be
typed coming from PicoSpan.


#11 of 143 by davel on Thu Nov 12 00:21:33 1992:

Hm.  I'd assumed it gave you your own default shell.  (I use sh, so the
difference was not apparent.)


#12 of 143 by remmers on Thu Nov 12 02:55:20 1992:

You're right, it gives you your standard shell.  (It gives me csh.)


#13 of 143 by popcorn on Thu Nov 12 05:53:30 1992:

This response has been erased.



#14 of 143 by kentn on Thu Nov 12 17:40:41 1992:

Could be...my .profile is okay, so maybe I just didn't have much in
.login.  Definitely didn't have a search path; I wonder why chsh
doesn't putin some sort of generic search path?  Anyway, it's working
now thanks to popcorn's help.  Time to explore the wonderful world of
Unix...


#15 of 143 by cwb on Tue Dec 15 20:17:37 1992:

     Forgive me if I'm being dense, but I'd like
to see a step-by-step procedure for setting up a
unix shell.  I know something about  unix,
but I wish to learn more, and I think it's time for
me to start using a unix shell rather than the bbs shell.  So what
do I have to do in order to set up a shell.  Which shell
should I use?  (What that means is: what benefits
are there in the different unix shells?)
     Chris


#16 of 143 by popcorn on Sun Dec 20 15:09:13 1992:

This response has been erased.



#17 of 143 by cwb on Tue Dec 29 05:26:44 1992:

  As Roger Rabbit would say: "P-P-P-P-P-P-Please!"


#18 of 143 by tsty on Tue Dec 29 08:06:02 1992:

About all I can sayis that there are 4 shells here; bbs, C-shell,
Bourne Shell and Korn Shell. There are probably others. bbs shell
"seems" to be the easiest to use, it immediately pops you into
a "something" rather than a "nothing."
  
You can "shell out" to any of the others (maybe you can create
your own) and use the associated commands. About the only difference
I can detect (and I'm *really* new at Unix) is that there are
more commands and easier syntax in C-shell. 
  
Quoting from _Unix in a Nutshell_ (O'Reilly and Associates, 2nd Ed,
(c) 1992) ISBN: 1-56592-001-5; "There are three main uses for
the shell: Interactive use; Customization of your UNIX session; and
Programming."
  
"A UNIX shell defines variables to control the behavior of your UNIX
session. ... Some variables are preset by the system, ... others
you define ... in start-up when you login."
  
A reference to DOS Batch files is made (and is accurate). 
  
"This quick reference describes the three most popular shells:
  
  The Bourne (or standaared) shell, the most compact but also
      the simplest.
  The Korn shell, a superset of the Bourne shell that lets you
      editthe command line.
  The C Shell, which uses C syntax and has many conveniences."
  
My perception, as primitive as it may be, is that unless you are
involved in some seriously intensive programming, the shell you
use is not all that relevant, objections welcome. 

  
It's almost the same as editor "wars," what you grew up on is what
you know best and, conswquently, prefer. Vi, Emacs, Jove, Ed, Ex, and
Marcus's Bbs editor all function well, within their parameters.
  
UNIX is a fairly "wild west" territory accessible to tons more
people than earlier Operating Systems, i.e. DOS, CP-M, 
main-frame OS's from main-frame maunfactureres, or micro-computer
Operating systems from Amiga, Apple, Macintosh, Atari, Etc ....
  
In summary, (geeze, have I typed THAT much), buy every O'Reilly
book you can find (and I <unfortunately> own NO stock). 
  
If you are comming from DOS, a book entitled, _DOS meets UNIX_ is
someplace to start.
  
Quoting from a friend of mine, UNIX is " a multi-tasking, multi-user,
interactive Operating System," which to me means a main-frame in 
the palm of as many users as there are tty ports connected.


#19 of 143 by davel on Tue Dec 29 14:51:36 1992:

Personally I found sh syntax easy to master, & every time I've tried to use
csh I've gotten tangled up.  Obviously a matter of taste and background.
(For the Unix I've worked with most there's a command-line editor available
for sh, removing my single largest temptation to tackle that learning curve.)

Whatever shell you use, expect to spend time hunting through the man until
you learn all the things you need to use regularly.


#20 of 143 by remmers on Tue Dec 29 16:53:26 1992:

The history mechanism and job control capabilities of the C shell are
plusses for interactive use.  It's nice to be able to re-execute a
recently entered command without typing it in again from scratch.
And it's convenient to be able to suspend a task, go do something else,
and then resume the suspended task from the point you left off.

But the C shell has too many syntactic exceptions and inconsistencies for
my taste.  Too many things that should work but don't because you're
bumping into some "feature".  The Bourne shell is much cleaner in this
respect, so I greatly prefer it to the C shell for programming.

The Korn shell combines the best of both, and if Grex had it I'd
probably use it as my login shell.


#21 of 143 by cwb on Wed Dec 30 02:25:51 1992:

     It sounds like the Bourne shell is the one I'm
most familiar with.  John, is it similar to the
shell on EMUNIX?
     I've actually used UNIX before, so what I need is
the how-to on setting up Bourne as my
login shell.  Sorry, I wasn't
clear.
     Chris


#22 of 143 by davel on Wed Dec 30 11:38:53 1992:

To permanently change your default shell, enter "chsh".  It will prompt
you for a new shell; give it sh or csh or whatever.  You can really tangle
yourself up if you do this wrong!  I believe that chsh checks that the
program you specify exists and that you have execute permission for it,
but it's not guaranteed to be anything that will actually work as a login
shell.

To *temporarily* change your shell:  If you're at a Unix shell prompt, just
enter the program name of the new shell.  exit (or something appropriate -
it's exit for sh and csh) will take you back where you were.  If you're
at a Picospan prompt, you have to prefix the new shell's name with !
(as usual).

If you make sh or csh your default shell, you can bring up Picospan on
top of it (as a new shell) by entering "bbs".  This takes an optional
conference name as a parameter.  If, say, you wanted Info as the conference
you see first (instead of Agora), you could enter "bbs info".


#23 of 143 by remmers on Wed Dec 30 14:11:07 1992:

Re #21:  The default shell on emunix is csh.

In everyday interactive use -- simple commands, pipelines, input-output
redirection -- there's little difference between the two shells.  I
prefer the C shell to Bourne for interactive use because of its history
mechanism and job control.  In the more complex situations encountered
in programming, I prefer the Bourne shell because it is much cleaner.


#24 of 143 by cwb on Wed Dec 30 19:12:15 1992:

     So, if I use sh as my login shell, I can then edit a file called
.login, putting UNIX commands in it to give me a custom setup right?


#25 of 143 by remmers on Wed Dec 30 22:17:45 1992:

No, .login is for csh, the C shell.  With the Bourne shell sh, the
equivalent file is .profile.


#26 of 143 by cwb on Tue Jun 1 05:02:41 1993:

     Ok, I'm ready to make the leap from sh to csh.  How do I make the chage
permanent?  What differences am I going to find other than the prompt?  Will
I have to make any changes in my various .*rc files?
     Chris, the fearfully ambitious.


#27 of 143 by davel on Tue Jun 1 10:47:11 1993:

Before you try it permanently, I'd suggest just running csh & trying stuff
to make sure you know what you're doing enough to get by.  Assuming you've
done that, the chsh command will let you change your login shell (stored
in /etc/passwd, the password file).  You can run it interactively by just
saying chsh at a shell prompt (or !chsh from a bbs prompt).  Or you can
give it a username (yours) and a shell on the command line, as:
chsh cwb csh
(though I think probably it had better be /bin/csh, as that's what a
quick scan of /etc/passwd shows for everyone else).

I *think* few if any of your *rc files should need changing; these are
commands local to a specific program, and to the extent that they give
shell commands they'd be mostly specifying other programs.

What I don't know about (since I've stuck with sh, myself) is how you
should set up control files such as .login and .cshrc and .logout.
I believe .login runs instead of the .profile that runs for sh users,
but it may be *in addition to* .profile
I'm sure someone will say something about these, but you can (make that
should) also find a few people around who use csh and look at theirs.


#28 of 143 by tsty on Tue Jun 1 23:33:55 1993:

This response has been erased.



#29 of 143 by tsty on Tue Jun 1 23:43:56 1993:

Ummmmmm, I just scribbled the above, pending a quick accuracy check from
a couple other folks ... When/if it gets put back in, it SHOULD provide
directions for a relatively painless, trouble free, (in Unix ... ha!) method
and specific directions for making the switch, he said ...


#30 of 143 by mju on Wed Jun 2 17:12:06 1993:

Csh runs .cshrc every time it starts up, login shell or not.  After
running .cshrc, it runs .login if and only if it's running as a login
shell.

To change your shell, just type "chsh".  It will say, "Changing shell
for <username>", print out your old shell, and let you enter a new
shell.  Type "/bin/csh" for csh, or "/usr/local/bin/tcsh" for tcsh,
or "/bin/sh" for sh.


#31 of 143 by tsty on Fri Jun 4 08:34:40 1993:

Well, no one replied to the email so just go for it and if it works by
establishing those necessary files, fine. If not, create a new ID and
email staff ..........


#32 of 143 by other on Mon Mar 14 07:14:59 1994:

        What is the difference between /bin/sh and /usr/bin/sh  ?
        I want to change my shell to one which uses .profile rather
        than .login (this may change later) and would like some help
        determining my route.  Thanks!


#33 of 143 by davel on Mon Mar 14 11:05:08 1994:

No difference at all - they are in fact the same physical file under
two names.


#34 of 143 by remmers on Mon Mar 14 11:37:47 1994:

However, if they're not both on your path, your .profile may be
non-portable.


#35 of 143 by kaplan on Mon Mar 14 23:32:18 1994:

I've used the "change" program, but this is the first I've heard of chsh.
Is there anything to the change program besides a call to chsh?



#36 of 143 by other on Tue Mar 15 00:21:29 1994:

And what is the meaning of "portable" within the context of #34?


#37 of 143 by davel on Tue Mar 15 03:25:27 1994:

I'm interested in that, too, John.


#38 of 143 by remmers on Tue Mar 15 04:05:45 1994:

I meant that if you exploit the fact that /usr/bin and /bin are the
same directory, by putting only one of them in your path, and then
try to install your .login or .profile on some other Unix system,
you'd be lacking some commands if /usr/bin and /bin are different
(which they often are).


#39 of 143 by other on Tue Mar 15 17:19:25 1994:

Ahh.  In other words, a rather simply repairable potential problem.  Thanks.


Next 40 Responses.
Last 40 Responses and Response Form.
No Next Item No Next Conference Can't Favor Can't Forget Item List Conference Home Entrance    Help

- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss