lecture6 - More About BASH Screen Lecture 6: Using BASH...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
More About BASH Screen Lecture 6: Using BASH Effectively CS2042 - UNIX Tools October 10, 2008 Lecture 6: BASH
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
More About BASH Screen Variables Making BASH Work for You Pattern Matching (Globbing) Lecture Outline 1 More About BASH Variables Making BASH Work for You Pattern Matching (Globbing) 2 Screen What Where Why? Handy Key Commands Lecture 6: BASH
Background image of page 2
More About BASH Screen Variables Making BASH Work for You Pattern Matching (Globbing) What Else Is There? There have been many shells created over the years for UNIX environments: bash - default shell for OSX and most Linux machines csh - default shell for BSD-based systems zsh - possibly the most fully-featured shell A frighteningly thorough comparison of the features of many shells can be found here. Since bash is the gold standard of shells and has more than enough features for this course, we’ll stick with it. Lecture 6: BASH
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
More About BASH Screen Variables Making BASH Work for You Pattern Matching (Globbing) How do we use BASH? The servers we use for this class will automatically put us into csh, not bash. If you are already logged in to the server, just type bash . If you want the server to automatically put you into bash, you may want to add the following to /.login . Convert to bash from csh on start up if ( -f /bin/bash ) exec /bin/bash -- login Note that /.login gets executed each time you log in to the server and csh starts up. Conversely, /.cshrc gets executed every time you enter the C-shell even if you were already logged in. Lecture 6: BASH
Background image of page 4
More About BASH Screen Variables Making BASH Work for You Pattern Matching (Globbing) BASH and Variables BASH is a full-fledged programming language in addition to a handy shell. If you wanted to, you could write a web server using BASH scripting. To get anything done in a programming language, you need support for variables. Variables in BASH are preceded by a dollar sign ($). The contents of any variable can be listed using the echo command. Example: echo $SHELL /bin/bash Lecture 6: BASH
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
More About BASH Screen Variables Making BASH Work for You Pattern Matching (Globbing) Environment Variables Environment variables are generally used by the system to define aspects of operation. Most of these should not (or cannot) be changed by the user. $SHELL - which shell will be used by default $PATH - a list of directories to search for binaries $HOSTNAME - the hostname of the machine $HOME - current user’s home directory ...and many others which don’t concern us Lecture 6: BASH
Background image of page 6
More About BASH Screen Variables
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 26

lecture6 - More About BASH Screen Lecture 6: Using BASH...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online