diff options
author | Jovina | 2012-08-08 13:15:35 +0530 |
---|---|---|
committer | Jovina | 2012-08-08 13:15:35 +0530 |
commit | 55c87f72e138006d614ab814becf6f5b36a4699b (patch) | |
tree | 0da4e89d68b2e55b21343e861b7c25543ac0203a | |
parent | 644ce971ef1f6b833f1139e7e7a5b137d9895823 (diff) | |
download | sdes-stscripts-55c87f72e138006d614ab814becf6f5b36a4699b.tar.gz sdes-stscripts-55c87f72e138006d614ab814becf6f5b36a4699b.tar.bz2 sdes-stscripts-55c87f72e138006d614ab814becf6f5b36a4699b.zip |
Added ult part 6.
-rw-r--r-- | ult/ult_6/script.rst | 279 | ||||
-rw-r--r-- | ult/ult_6/ult_6.tex | 244 |
2 files changed, 523 insertions, 0 deletions
diff --git a/ult/ult_6/script.rst b/ult/ult_6/script.rst new file mode 100644 index 0000000..020f3a6 --- /dev/null +++ b/ult/ult_6/script.rst @@ -0,0 +1,279 @@ +.. Objectives +.. ---------- + + .. At the end of this tutorial, you will be able to: + + .. 1. Understand various features of shell + .. 2. Learn about shell meta characters + +.. Prerequisites +.. ------------- + +.. 1. Getting started with Linux +.. 2. Basic File Handling +.. 4. Advanced file handling + +Script +------ + +.. L1 + +{{{ Show the first slide containing title, name of the production +team along with the logo of MHRD }}} + +.. R1 + +Hello friends and Welcome to the tutorial on +'Redirection and Piping'. + +.. L2 + +{{{ Show slide with objectives }}} + +.. R2 + +At the end of this tutorial, you will be able to, + + 1. Understand various features of shell + #. Learn about shell meta characters + +.. L3 + +{{{ Switch to the pre-requisite slide }}} + +.. R3 + +Before beginning this tutorial,we would suggest you to complete the +former tutorials as being displayed currently. + +.. L4 + +{{{ Show slide, with Tab-completion }}} + +.. R4 + +The Bash shell has some nice features, that make our job of using the shell +easier and much more pleasant. We shall look at a few of them, here. + + +Bash provides the feature of tab completion. What does tab completion mean? +When you are trying to type a word, bash can complete the word for you, if you +have entered enough portion of the word (to complete it unambiguously) and +then hit the tab key. + +If on hitting the tab key, the word doesn't get completed, either the word +doesn't exist or the word cannot be decided unambiguously. If the case is the +latter one, hitting the tab key a second time, will list the possibilities. + +.. L5 + +{{{ Show slide, with Tab-completion.. }}} + +.. R5 + +Bash provides tab completion for the following. + + File Names + Directory Names + Executable Names + User Names (when they are prefixed with a ~) + Host Names (when they are prefixed with a @) + Variable Names (when they are prefixed with a $) + +.. R6 + +For example, + +.. L6 + +{{{ Switch to terminal }}} +:: + + + pas<TAB><TAB> + PA<TAB> + ~/<TAB><TAB> + +.. L7 + +{{{ Show slide, with History }}} + +.. R7 + +Bash also saves the history of the commands you have typed. So, you can go +back to a previously typed command. Use the up and down arrow keys to navigate +in your bash history. +You can also search incrementally, for commands in your bash history. Ctrl-r +search for the commands that you have typed before. But, note that the number +of commands saved in the history is limited, generally upto a 1000 commands. + +.. L8 + +{{{ Switch to terminal }}} +:: + + <Ctrl-r> pas + +.. R8 + +.. L9 + +{{{ Show slide, with Shell Meta Characters }}} + +.. R9 + +Unix recognizes certain special characters, called "meta characters," as +command directives. The shell meta characters are recognized anywhere they +appear in the command line, even if they are not surrounded by blank space. +For that reason, it is safest to only use the characters A-Z, a-z, 0-9, and +the period, dash, and underscore characters when naming files and directories + on Unix. If your file or directory has a shell meta character in the name, +you will find it difficult to use the name in a shell command. + +The characters that you see on the slide are the shell meta characters + + / < > ! $ % ^ & * | { } [ ] " ' ` ~ ; + +.. R10 + +Let's take an example, + +.. L10 + +{{{ Switch to terminal }}} +:: + + ls file.* + +.. R11 + +It means, run on a directory containing the files file, file.c, file.lst, and +myfile would list the files file.c and file.lst. However, + +.. L11 + +:: + + ls file.? + +.. R12 + +Run on the same directory would only list file.c because the ? only +matches one character, no more, no less. This can save you a great deal of +typing time. + +For example, if there is a file called california_cornish_hens_with_wild_rice +and no other files whose names begin with 'c', you could view the file without +typing the whole name by typing this + +.. L12 + +:: + + more c* + +.. R13 + +Here, the c* matches that long file name. + +File-names containing metacharacters can pose many problems and should never +be intentionally created. + +.. L13 + +.. L14 + +{{{ Switch to Summary slide }}} + +.. R14 + +This brings us to the end of the end of this tutorial. +In this tutorial, we have learnt to, + +1. Implement features of tab-completion and history. +#. Make use of the shell meta characters. + +.. L15 + +{{{ Show self assessment questions slide }}} + +.. R15 + +Here are some self assessment questions for you to solve: + +1. Bash does not provide tab completion for Host Names. True of False? + +2. State the command which will list all the files in the current working + directory that end in either .c or .h + +.. L16 + +{{{ Solutions for the self assessment questions on slide }}} + +.. R16 + +And the answers: + +1. False. Bash provides tab completion for Host Names when they are prefixed + with a @ sign. + + +2. The command which will find the files ending either in .c or .h is, +:: + + ls *.[ch] + + +.. L17 + +{{{ Show the SDES & FOSSEE slide }}} + +.. R17 + +Software Development techniques for Engineers and Scientists - SDES, is an +initiative by FOSSEE. For more information, please visit the given link. + +Free and Open-source Software for Science and Engineering Education - FOSSEE, is +based at IIT Bombay which is funded by MHRD as part of National Mission on +Education through ICT. + +.. L18 + +{{{ Show the ``About the Spoken Tutorial Project'' slide }}} + +.. R18 + +Watch the video available at the following link. It summarises the Spoken +Tutorial project.If you do not have good bandwidth, you can download and +watch it. + +.. L19 + +{{{ Show the `` Spoken Tutorial Workshops'' slide }}} + +.. R19 + +The Spoken Tutorial Project Team conducts workshops using spoken tutorials, +gives certificates to those who pass an online test. + +For more details, contact contact@spoken-tutorial.org + +.. L20 + +{{{ Show the ``Acknowledgements'' slide }}} + +.. R20 + +Spoken Tutorial Project is a part of the "Talk to a Teacher" project. +It is supported by the National Mission on Education through ICT, MHRD, +Government of India. More information on this mission is available at the +given link. + +.. L21 + +{{{ Show the Thank you slide }}} + +.. R21 + +Hope you have enjoyed this tutorial and found it useful. +Thank you! diff --git a/ult/ult_6/ult_6.tex b/ult/ult_6/ult_6.tex new file mode 100644 index 0000000..c42fa21 --- /dev/null +++ b/ult/ult_6/ult_6.tex @@ -0,0 +1,244 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Using Linux Tools +% +% Author: FOSSEE +% Copyright (c) 2009, FOSSEE, IIT Bombay +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\documentclass[17pt,compress]{beamer} +\usepackage{beamerthemesplit} +\mode<presentation> +{ + \usetheme{Warsaw} + \useoutertheme{infolines} + \setbeamercovered{transparent} + \setbeamertemplate{navigation symbols}{} +} +% Taken from Fernando's slides. +\usepackage{ae,aecompl} +\usepackage[scaled=.95]{helvet} + +\usepackage[english]{babel} +\usepackage[latin1]{inputenc} +\usepackage[T1]{fontenc} + +% change the alerted colour to LimeGreen +\definecolor{LimeGreen}{RGB}{50,205,50} +\setbeamercolor{structure}{fg=LimeGreen} +\author[FOSSEE]{} +\institute[IIT Bombay]{} +\date[]{} +% \setbeamercovered{transparent} + +% theme split +\usepackage{verbatim} +\newenvironment{colorverbatim}[1][]% +{% +\color{blue} +\verbatim +}% +{% +\endverbatim +}% + +\usepackage{mathpazo,courier,euler} +\usepackage{listings} +\lstset{language=sh, + basicstyle=\ttfamily\bfseries, + showstringspaces=false, + keywordstyle=\color{black}\bfseries} + +% logo +\logo{\includegraphics[height=1.30 cm]{../images/3t-logo.pdf}} +\logo{\includegraphics[height=1.30 cm]{../images/fossee-logo.pdf} + +\hspace{7.5cm} +\includegraphics[scale=0.99]{../images/fossee-logo.pdf}\\ +\hspace{281pt} +\includegraphics[scale=0.80]{../images/3t-logo.pdf}} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% DOCUMENT STARTS +\begin{document} + +\sffamily \bfseries +\title +[Features of the Shell] +{Features of the Shell} +\author +[FOSSEE] +{\small Talk to a Teacher\\{\color{blue}\url{http://spoken-tutorial.org}}\\\vspace{0.25cm}National Mission on Education + through ICT\\{\color{blue}\url{ http://sakshat.ac.in}} \\ [1.65cm] + Contributed by FOSSEE Team \\IIT Bombay \\[0.3cm] +} + +% slide 1 +\begin{frame} + \titlepage +\end{frame} + +\begin{frame} +\frametitle{Objectives} +\label{sec-2} + +At the end of this tutorial, you will be able to, +\begin{itemize} +\item Understand various features of the shell +\item Learn about shell meta characters +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{Pre-requisites} +\label{sec-3} + +Spoken tutorial on, +\begin{itemize} +\item Getting started with Linux +\item Basic File Handling +\end{itemize} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Tab-completion} +\begin{itemize} +\item Hit tab to complete an incompletely typed word +\item Tab twice to list all possibilities when ambiguous completion +\end{itemize} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Tab-completion..} + \begin{itemize} + \item Bash provides tab completion for the following + \begin{enumerate} + \item File Names + \item Directory Names + \item Executable Names + \item User Names (when prefixed with a \~{}) + \item Host Names (when prefixed with a @) + \item Variable Names (when prefixed with a \$) + \end{enumerate} + \end{itemize} +\end{frame} + +\begin{frame}[fragile] +\frametitle{History} +\begin{itemize} +\item Bash saves history of commands typed +\item Up and down arrow keys allow to navigate history +\item \texttt{Ctrl-r} searches for commands used +\item No. of commands limited, generally upto 1000 +\end{itemize} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Shell Meta Characters} + \begin{itemize} + \item ``meta characters'' are special command directives + \item No meta-characters in file-names + \item While naming files, use characters A-Z, a-z, 0-9, . , - , \_ + \item shell meta characters -- \\ + \verb+/<>!$%^&*|{}[]"'`~;+ + \end{itemize} +\end{frame} + +\begin{frame} +\frametitle{Summary} +\label{sec-8} + + In this tutorial, we have learnt to, + + +\begin{itemize} +\item Implement features of shell like tab-completion and history +\item Make use of the shell meta characters +\end{itemize} +\end{frame} +\begin{frame}[fragile] +\frametitle{Evaluation} +\label{sec-9} + + +\begin{enumerate} +\item Bash does not provide tab completion for Host Names. True or False? +\vspace{12pt} +\item State the command which will list all the files in the current working + directory that end in either \verb~.c~ or \verb~.h~ +\end{enumerate} +\end{frame} +\begin{frame} +\frametitle{Solutions} +\label{sec-10} + + +\begin{enumerate} +\item False +\vspace{15pt} +\item \$ ls *.[ch] +\end{enumerate} +\end{frame} + +\begin{frame} +\frametitle{SDES \& FOSSEE} +\begin{center} +\begin{itemize} +\item \small{SDES}\\ +\small{\color{LimeGreen}Software Development techniques for Engineers and Scientists} \\ +\scriptsize An initiative by FOSSEE. \\ +\vspace{3pt} +\scriptsize For more information on SDES, please visit {\color{blue}\url{http://fossee.in/sdes}}\\ +\vspace{10pt} +\item \small{FOSSEE}\\ +\small {\color{LimeGreen}Free and Open-source Software for \\Science and Engineering Education} \\ +\scriptsize Based at IIT Bombay, Funded by MHRD.\\ +\vspace{3pt} +\scriptsize Part of National Mission on Education through ICT \\(NME-ICT) \\ +\end{itemize} +\end{center} +\end{frame} + +\begin{frame} +\frametitle{About the Spoken Tutorial Project} +\begin{itemize} +\item Watch the video available at {\color{blue}\url{http://spoken-tutorial.org /What\_is\_a\_Spoken\_Tutorial}} +\item It summarises the Spoken Tutorial project +\item If you do not have good bandwidth, you can download and watch it +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{Spoken Tutorial Workshops}The Spoken Tutorial Project Team +\begin{itemize} +\item Conducts workshops using spoken tutorials +\item Gives certificates to those who pass an online test +\item For more details, please write to \\ \hspace {0.5cm}{\color{blue}contact@spoken-tutorial.org} +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{Acknowledgements} +\begin{itemize} +\item Spoken Tutorial Project is a part of the Talk to a Teacher project +\item It is supported by the National Mission on Education through ICT, MHRD, Government of India +\item More information on this Mission is available at: \\{\color{blue}\url{http://spoken-tutorial.org/NMEICT-Intro}} +\end{itemize} +\end{frame} + +\begin{frame} + + \begin{block}{} + \begin{center} + {\Large THANK YOU!} + \end{center} + \end{block} +\begin{block}{} + \begin{center} + For more Information, visit our website\\ + {\color{blue}\url{http://fossee.in/}} + \end{center} + \end{block} +\end{frame} + + +\end{document} + |