diff options
Diffstat (limited to 'ult/ult_4/ult4.tex')
-rw-r--r-- | ult/ult_4/ult4.tex | 285 |
1 files changed, 143 insertions, 142 deletions
diff --git a/ult/ult_4/ult4.tex b/ult/ult_4/ult4.tex index 7181db5..396dceb 100644 --- a/ult/ult_4/ult4.tex +++ b/ult/ult_4/ult4.tex @@ -5,178 +5,132 @@ % Copyright (c) 2009, FOSSEE, IIT Bombay %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\documentclass[12pt,compress]{beamer} +\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{times} \usepackage[T1]{fontenc} -% Taken from Fernando's slides. -\usepackage{ae,aecompl} -\usepackage{mathpazo,courier,euler} -\usepackage[scaled=.95]{helvet} - -\definecolor{darkgreen}{rgb}{0,0.5,0} +% 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, - commentstyle=\color{red}\itshape, - stringstyle=\color{darkgreen}, showstringspaces=false, - keywordstyle=\color{blue}\bfseries} + keywordstyle=\color{black}\bfseries} + +% logo +\logo{\includegraphics[height=1.30 cm]{3t-logo.pdf}} +\logo{\includegraphics[height=1.30 cm]{fossee-logo.pdf} + +\hspace{7.5cm} +\includegraphics[scale=0.99]{fossee-logo.pdf}\\ +\hspace{281pt} +\includegraphics[scale=0.80]{3t-logo.pdf}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % DOCUMENT STARTS \begin{document} -\begin{frame} +\sffamily \bfseries +\title +[Advanced File Handling] +{Advanced File Handling} +\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] +} -\begin{center} -\vspace{12pt} -\textcolor{blue}{\huge Using Linux Tools\\Part IV} -\end{center} -\vspace{18pt} -\begin{center} -\vspace{10pt} -\includegraphics[scale=0.95]{../images/fossee-logo.png}\\ -\vspace{5pt} -\scriptsize Developed by FOSSEE Team, IIT-Bombay. \\ -\scriptsize Funded by National Mission on Education through ICT\\ -\scriptsize MHRD,Govt. of India\\ -\includegraphics[scale=0.30]{../images/iitb-logo.png}\\ -\end{center} +% 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 what is Redirection and Piping. -\item Learn various features of the shell. +\item Display the contents of files +\item Read only parts of a file +\item Look at the statistical information of a file \end{itemize} \end{frame} \begin{frame} -\frametitle{Pre-requisite} +\frametitle{Pre-requisites} \label{sec-3} -Spoken tutorial on - +Spoken tutorial on, \begin{itemize} -\item Using Linux tools -- Part I -\item Using Linux tools -- Part II -\item Using Linux tools -- Part III +\item Getting started with Linux +\item Basic File Handling \end{itemize} \end{frame} \begin{frame}[fragile] - \frametitle{Redirection} - - \begin{itemize} - \item The standard output (stdout) stream goes to the display - \item Not always, what we need - \item First solution, redirects output to a file - \item \texttt{>} states that output is redirected; It is - followed by location to redirect - \end{itemize} - \begin{lstlisting} - $ command > file1 - \end{lstlisting} % $ - \begin{itemize} - \item \texttt{>} creates a new file at specified location - \item \texttt{>>} appends to a file at specified location - \end{itemize} -\end{frame} - -\begin{frame}[fragile] - \frametitle{Redirection \ldots} - \begin{itemize} - \item Similarly, the standard input (stdin) can be redirected - \end{itemize} - \begin{lstlisting} - $ command < file1 - \end{lstlisting} % $ - \begin{itemize} - \item input and the output redirection could be combined - \end{itemize} - \begin{lstlisting} - $ command < infile > outfile - \end{lstlisting} % $ - \begin{itemize} - \item Standard error (stderr) is the third standard stream - \item All error messages come through this stream - \item \texttt{stderr} can also be redirected - \end{itemize} -\end{frame} - -\begin{frame}[fragile] - \frametitle{Piping} - \begin{lstlisting} - $ cut -d " " -f 2- marks1.txt \ - | paste -d " " students.txt - - \end{lstlisting} % $ - \begin{itemize} - \item \texttt{-} instead of FILE asks \texttt{paste} to read from - \texttt{stdin} - \item \texttt{cut} command is a normal command - \item the \texttt{|} seems to be joining the two commands - \item Redirects output of first command to \texttt{stdin}, which - becomes input to the second command - \item This is called piping; \texttt{|} is called a pipe - \end{itemize} -\end{frame} - -\begin{frame}[fragile] - \frametitle{Piping \ldots} - \begin{itemize} - \item Roughly same as -- 2 redirects and a temporary file - \end{itemize} - \begin{lstlisting} - $ command1 > tempfile - $ command2 < tempfile - $ rm tempfile - \end{lstlisting} % $ - \begin{itemize} - \item Any number of commands can be piped together + \frametitle{\texttt{less}} + \begin{itemize} + \item q: Quit + \item Arrows/Page Up/Page Down/Home/End: Navigation + \item ng: Jump to line number n + \item /pattern: Search. Regular expressions can be used + \item h: Help \end{itemize} \end{frame} -\subsection{Features of the Shell} - -\begin{frame}[fragile] - \frametitle{Tab-completion} +\begin{frame} + \frametitle{Exercise 1} \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 they are prefixed with a \~{}) - \item Host Names (when they are prefixed with a @) - \item Variable Names (when they are prefixed with a \$) - \end{enumerate} + \item Print only the first, fifth and the seventh fields of the file \verb~/etc/passwd~ \end{itemize} \end{frame} \begin{frame}[fragile] - \frametitle{Shell Meta Characters} - \begin{itemize} - \item ``meta characters'' are special command directives - \item File-names shouldn't have meta-characters - \item The following are the shell meta characters -- - \begin{itemize} - \item \verb+/<>!$%^&*|{}[]"'`~;+ - \end{itemize} - \end{itemize} + \frametitle{\texttt{paste}} + \begin{center} + \begin{tabular}{l|l} + \verb~students.txt~ & \verb~marks.txt~ \\ + Hussain & 89 92 85 \\ + Dilbert & 98 47 67 \\ + Anne & 67 82 76 \\ + Raul & 78 97 60 \\ + Sven & 67 68 69 \\ + \end{tabular} + \end{center} \end{frame} \begin{frame} @@ -185,31 +139,31 @@ Spoken tutorial on - In this tutorial, we have learnt to, +\begin{itemize} +\item Display the contents of files using the ``cat'' command. +\item View the contents of a file one screen at a time using the + ``less'' command. +\end{itemize} +\end{frame} +\begin{frame} +\frametitle{Summary...} \begin{itemize} -\item Use the ``cut'' and ``paste'' commands in redirection. -\item Use the pipe ( | ) character. -\item Implement features of shell like tab-completion and history. +\item Display specific contents of file using the ``head'' and + ``tail'' commands. +\item Use the ``cut'', ``paste'' and ``wc'' commands. \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 In a file /home/test.txt ,first line is "data:myscripts:20:30".How to - view only minutes(last field, 30). -\vspace{5pt} -\begin{itemize} -\item cut -d : -f 4 /home/test.txt -\item cut -f 3 /home/test.txt -\item cut -d : -f 3 /home/test.txt -\item None of these -\end{itemize} +\item How to view lines from 1 to 15 in \verb~wonderland.txt~ ? +\vspace{15pt} +\item In ``cut'' command, how to specify space as the delimiter ? \end{enumerate} \end{frame} \begin{frame} @@ -218,22 +172,69 @@ Spoken tutorial on - \begin{enumerate} -\item False +\item \$ head -15 \verb~wonderland.txt~ \vspace{15pt} -\item cut -d : -f 4 /home/test.txt +\item \$ cut -d " " <filename> \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} - \textcolor{blue}{\Large THANK YOU!} + {\Large THANK YOU!} \end{center} \end{block} \begin{block}{} \begin{center} For more Information, visit our website\\ - \url{http://fossee.in/} + {\color{blue}\url{http://fossee.in/}} \end{center} \end{block} \end{frame} |