1 / 18

DAY 2

DAY 2. COP 3502 Fall term 2004. UNIX Versions. The UNIX Shell.

kerem
Télécharger la présentation

DAY 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DAY 2 COP 3502 Fall term 2004

  2. UNIX Versions

  3. The UNIX Shell • Bourne Shell- In the near beginning there was the Bourne shell /bin/sh (written by S. R. Bourne). It had (and still does) a very strong powerful syntactical language built into it, with all the features that are commonly considered to produce structured programs; it has particularly strong provisions for controlling input and output and in its expression matching facilities. But no matter how strong its input language is, it had one major drawback; it made nearly no concessions to the interactive user (the only real concession being the use of shell functions and these were only added later) and so there was a gap for something better.

  4. The UNIX Shell C-Shell - Along came the people from UCB and the C-shell /bin/csh was born. Into this shell they put several concepts which were new, (the majority of these being job control and aliasing) and managed to produce a shell that was much better for interactive use. The new shell was simply too buggy to produce robust shell scripts and so everybody stayed with the Bourne shell for that, but it was considerably better for interactive use so changed to the C shell, this resulted in the stupid situation where people use a different shell for interactive work than for non-interactive, a situation which a large number of people still find themselves in today.

  5. The UNIX Shell Korne Shell - Eventually David Korn from AT&T had the bright idea to sort out this mess and the Korn shell /bin/ksh made its appearance. This quite sensibly junked the C shells language and reverted back to the bourne shell language, but it also added in the many features that made the C shell good for interactive work (you could say it was the best of both worlds), on top of this, it also added a some features from other operating. The Korn shell became part of System V but had one major problem; unlike the rest of the UNIX shells it wasn't free, you had to pay AT&T for it.

  6. The UNIX Shell TCSH - The T C-shell (tcsh) is a command interpreter that is similar to the C-shell (csh). The syntax for writing scripts in the tcsh is the same as for the csh. Unlike the csh, this shell is not available on every Unix system. However, it is available on Sun, SGI, and HP workstations. The tcsh shell is the default when you log on to a Linux Intel system. The location for tcsh varies between the architectures.  It is the default Department of Computer Science shell for all new users.

  7. Files in your directory • .login – A shell script that is run after .tcshrc and sets up your environment and path names. Leave it alone. (csh only) • .tcshrc – Specific to the tcsh shell, this runs startup scripts that set additional path names, terminals, database connections. Leave it alone for right now. • .plan – Place to put personal information. Can be seen by using the “finger” command which is disabled in our department. • .forward – If you are using UNIX mail, placing an email address ( or more ) will have your email forwarded to that address. • .profile – Commands to be run when you log in (sh & ksh only) • .xinitrc – Commands to configure X Window System • .mwmrc – Commands to configure the Motif Window Manager • .logout – Commands to run when you log out (csh only ) • ,. - Dot Dot file is the location of the root directory of where you are currently positioned. • . - Dot file has the lists of the lower directories.

  8. Standard Environment Variables To see environment variables enter: setenv<r>

  9. Standard Environment Variables • USER=gaitrosd • LOGNAME=gaitrosd • HOME=/home/faculty/gaitrosd • PATH=/home/faculty/gaitrosd/.bin:/home/faculty/gaitrosd/.scripts:/usr/local/bin:/usr/local/jdk1.2.2/bin:/usr/lang:/bin:/usr/bin:/usr/ucb:/usr/local/gnat/bin:/usr/etc:/usr/local/bin/X11:/usr/bin/X11:/usr/openwin/bin:/usr/ccs/bin:/usr/sbin:. • MAIL=/var/mail//gaitrosd • SHELL=/bin/tcsh • TZ=US/Eastern • SSH_TTY=/dev/pts/25 • TERM=vt100 • DISPLAY=localhost:43.0 • HOSTTYPE=sun4 • VENDOR=sun • OSTYPE=solaris • MACHTYPE=sparc • SHLVL=1 • PWD=/home/faculty/gaitrosd • GROUP=fac • HOST=diablo • REMOTEHOST=staffpc8.cs.fsu.edu • MACHINE=diablo • CLASSPATH=.:/usr/include/java/classes:/home/courses/cop4710/classes • MANPATH=/usr/man:/usr/local/man:/opt/SUNWspro/man • EDITOR=pico • LD_LIBRARY_PATH=/usr/lib:/usr/local/lib • OPENWINHOME=/usr/openwin • NNTPSERVER=news.fsu.edu • DOMAINNAME=cs.fsu.edu • ORGANIZATION=FSU Computer Science Department

  10. Login • From home you need to be running ssh ( Secure Shell) • See http://sl.us.fsu.edu/ssh.html for download instructions and license agreement. You must be connected to a campus computer in order to get this. • Once you have the SSH program you can install it on any machine. • See demonstration of ssh.

  11. Login • At the Login screen enter your user name. • Remember that UNIX is case sensitive. • Once the username is accepted, enter the password. Be careful not to make a mistake. Most of the time, backspace will not work. • You should be at the opening prompt. • To make sure you are at your home directory, enter the change directory command • cd ~username<r> (Where username is your account name and <r> is the return key. • Example cd ~gaitrosd<r>

  12. Logout • To logout of the system you can enter either • logout <r> • exit <r>

  13. Changing your password Command: passwd Description:Asks you to type in a new password. You can only do this for you own account. Sample: passwd Note:The command will then prompt you to enter you old password and the new one twice. The new one must consist of a minimum number of characters one of which has to be an upper case letter, one has to be a digit, and one has to be a special character.

  14. Directories and File Names Directories are basically a special kind of file that contains the names of other files and directors. Some OS call them folders. At any given moment you have a current directory When you first login you are placed in your home directory ~ ( tilde ) is the shorthand for your home directory. As with filenames, you can use upper and lower case letters, digits, periods, and underscores in directory names.

  15. Filenames Filenames can user upper and lower case letters, digits, periods and underscores. Filenames are case sensitive Do not use odd characters in filenames and don't use spaces.

  16. Pine Email • See demonstration in class • See help on Pine Email from the ACNS web pages at: http://www.acns.fsu.edu/docs/pine.html HOMEWORK: • Login with your account • Change your password • Email me at gaitrosd@cs.fsu.edu with your CS mail account from pine and tell me you have changed your password. • Be sure and make the subject PASSWORD CHANGED

  17. Another Useful Feature • Standard input-output redirection • There are times we would like to take the standard output that goes to the screen and place it in a file. We can do this with the ">" symbol. Let us say we want to put the list of a directory in a file. • SEE DEMONSTRATION

  18. Another Useful Feature • Standard input-output redirection • Also, there are times when we want input usually coming from the keyboard to come from a file. This is done with the "<" symbol. • DEMONSTRATION

More Related