SlideShare una empresa de Scribd logo
1 de 12
Descargar para leer sin conexión
Laboratory Experiment IV




 PRINTING AND METACHARACTERS
 by Alex Shaw III




 Unedited Version




May 3, 2005
TABLE OF CONTENTS

Introduction                   ii

Laboratory Sheets             iii
Procedures                    iii

Data Sheets                   1
Results                        1
   Part I                      1
   Part II                     2

Analysis                      4
Explanations                   4
   Part I                      4
   Part II                     4
   Metacharacters              5
Discoveries                    6
   Part II                     6
New Commands                   7
References                     8




Printing and Metacharacters     i
INTRODUCTION

                              This experiment involves printing and metacharacters.
                              The first part focuses on printing files using various
                              techniques. Redirections, basic metacharacters, and
                              appending to files are the focal point in the second part of
                              the experiment.

                              The main commands used in this experiment are cat, lpr,
                              and pr. Other commands, like cd and ls, which facilitate
                              file and directory navigation, assist in the performance of
                              tasks.




Printing and Metacharacters                                                              ii
1
                                                                             LABORATORY SHEETS
LABORATORY EXPERIMENT IV


Procedures
The procedures (Sheet 1-1 and Sheet 1-2) below provide the steps performed during this experiment.




Sheet 1-1 Part I of the laboratory procedures—focuses on printing and      Sheet 1-2 Part II of the laboratory procedures—focuses on basic
utilizing redirection and piping to provide output to a printer or file.   metacharacters, listing and viewing files, and appending to files.




Printing and Metacharacters                                                                                                                     iii
2
                                                                                                            DATA SHEETS
LABORATORY EXPERIMENT IV


                                                                            Results
                                                                            This section provides the results for each task. Some
                                                                            tasks require in-depth explanations, while others present
                                                                            simple results.
                                                                            Part I
Output 2-1 Contents of prtfile1.
                                                                            Task 1
                                                                            Logged into home directory.
                                                                            Task 2
                                                                            Created prtfile1 (Output 2-1) in home directory.
                                                                            Task 3
Output 2-2 Contents of prtfile2. This file is actually takes up an entire
                                                                            The pr prtfile1 command seems to display the contents
screen because the pr command generated it, which is discussed in the       of the prtfile1 to the standard output (screen), which
Analysis section.
                                                                            actually scrolls off the screen.

This file is created for Experiment 4.                                      Task 4
It focuses on printing and metacharacters.                                  The pr prtfile1 > prtfile2 displays no visible results, but
I guess this file should contain more                                       produces prtfile2 (Output 2-2).
than three lines to make
                                                                            Task 5
Output 2-3 This is a printout of prtfile1 from Task 7.
                                                                            The pr prtfile1 | more command pipes the results of
                                                                            pr prtfile1 to the more command, which in turn displays
This file is created for Experiment 4.                                      the results one screenful at a time.
It focuses on printing and metacharacters.
I guess this file should contain more                                       Task 6
than three lines to make                                                    Results of pr prtfile1, pr prtfile1 > prtfile2, and
Output 2-4 This is a printout of prtfile1 from Task 8.                      pr prtfile1 | more are analyzed in the Analysis section.

2005-04-05 19:21                     prtfile1                     Page 1
                                                                            Task 7
                                                                            The cat prtfile1 | lpr -Ppr2191 pipes the results of
This file is created for Experiment 4.                                      cat prtfile1 to lpr -Ppr219, which prints the contents of
It focuses on printing and metacharacters.
I guess this file should contain more                                       prtfile1 to printer 219 (Output 2-3).
than three lines to make

Output 2-5 This is a printout of prtfile1 from Task 9.                      Task 8
                                                                            The lpr -Ppr219 prtfile1 prints prtfile1 to printer 219
                                                                            (Output 2-4).
                                                                            Task 9
                                                                            The pr prtfile1 | lpr command pipes the results of pr prtfile1
                                                                            to lpr, which prints those results to the default printer
                                                                            (Output 2-5).
                                                                                                                          continue on next page…



                                                                            1
                                                                                Printer 219 is located in Lehman College. Your printer may have a different
                                                                                name or location.



Printing and Metacharacters                                                                                                                              1
Data Sheets



                                                                            Task 10
                                                                            The pr prtfile1 > lpr command redirects the output of
                                                                            pr prtfile1 to the lpr file.

                                                                            Task 11
                                                                            The difference between pr prtfile1 | lpr and
                                                                            pr prtfile1 > lpr are discussed in the Analysis section.


                                                                            Part II

                                                                            Task 1
                                                                            The cd ~ changes to the home directory.

Output 2-6 Contents of list.files. This file was generated from the         Task 2
ls > list.files command.                                                    The ls > list.files command displays no results to the screen.

                                                                            Task 3
                                                                            The cat list.files command displays the contents of
                                                                            list.files (Output 2-6) to the screen or standard output.

Output 2-7 Results of the ls c* command, performed in the /bin directory.
                                                                            Task 4
                                                                            Issuing ls > list.files redirects the output of ls to the
                                                                            list.files file.
                                                                            The "greater than" (>) sign is presented in Task 2 is
                                                                            discussed in the Analysis section.

                                                                            Task 5
                                                                            The cd /bin command changed the current director to /bin.

                                                                            Task 6
                                                                            Issuing ls c* displays a listing of all the files in the
                                                                            current directory (/bin) starting with 'c' (Output 2-7).

                                                                            Task 7
                                                                            See the Analysis section for a discussion on the asterisk (*).

                                                                            Task 8
                                                                            The cd $HOME command returns to the home directory.

                                                                            Task 9
                                                                            The ls /bin/c* >> list.files command displays no results
                                                                            to the screen.
Output 2-8 Contents of the list.files after issuing the
ls /bin/c* >> list.files command.                                           Task 10
                                                                            The cat list.files command displays the contents of
                                                                            list.files (Output 2-8) to the screen.
                                                                                                                 continue on next page…




Printing and Metacharacters                                                                                                              2
Data Sheets




                                                          Task 11
                                                          A discussion of what happened with list.files after task 2
                                                          and task 9 is in the Analysis section.

                                                          Task 12
                                                          The ls /bin/c* > list.files command displays no results on
                                                          the screen.

                                                          Task 13
                                                          Issuing ls /bin/c* > list.files redirects output from
Output 2-9 Contents of the list.files after issuing the   ls /bin/c* the list.files (Output 2-9) file. More discussion
ls /bin/c* > list.files command.
                                                          on this task is in the Analysis section.

                                                          Task 14
                                                          Along with the metacharacters presented in this
                                                          experiment, the brackets "[ ]" metacharacter is also
                                                          discussed in the Analysis section.




Printing and Metacharacters                                                                                            3
3
                                                                                                ANALYSIS
LABORATORY EXPERIMENT IV


                                                              Explanations
                                                              Part I

                                                              Task 6
                                                              The pr prtfile1 command displays the contents of prtfile1
                                                              to the screen one page at a time. Even if there is only one
Output 3-1 Contents of prtfile1.
                                                              line of text, an entire page is still display; therefore, the
                                                              screen may scroll beyond the contents of the file.

                                                              The pr prtfile1 > prtfile2 redirects the output of
                                                              pr prtfile1 to the prtfile2 file. That does not mean
                                                              prtfile1 and prtfile2 will be identical; the pr prtfile1
                                                              command adds a header to the prtfile1 file. You can see
Output 3-2 Contents of prtfile2.                              the difference in Output 3-1 and Output 3-2.

                                                              The pr prtfile1 | more command pipes the results of
                                                              pr prtfile1 to the more command, which allows the user
                                                              to view the file one screenful at a time. It fixes the result
Output 3-3 Results of the ls command in the home directory.
                                                              encountered with the pr prtfile1 command.

                                                              Task 11
                                                              The pr prtfile1 | lpr command pipes the results of
                                                              pr prtfile1 to the lpr command, which prints those
                                                              results; and pr prtfile1 > lpr redirects the output of
                                                              pr prtfile1 to the lpr file.

                                                              Part II
                                                              Task 4
                                                              Issuing ls > list.files redirects the output of the ls
                                                              command to the list.files file. In previous experiments,
                                                              output redirection created a file identical to the
                                                              command's result.
Output 3-4 Contents of list.files.
                                                              However, list.files displays the directory structure in a
                                                              manner similar to the way ls -l would. ls alone display
                                                              the directory structure horizontally.

                                                              See Output 3-3 and Output 3-4 for the difference
                                                              between ls and list.files.

                                                              The '>' symbol is discussed on page 5.
                                                                                                 continue on next page…




Printing and Metacharacters                                                                                               4
Analysis




                                                          Task 7
                                                          The '*' symbol is discussed in Metacharacters.

                                                          Task 11
                                                          After issuing the ls /bin/c* >> list.files command,
                                                          list.files is concatenated with the old list.files, as shown in
                                                          Output 3-6.

                                                          The '>>' symbol is discussed on page 5.

                                                          Task 13
                                                          Issuing a command with output redirection to an existing
                                                          file causing the file to be replaced with the results of the
                                                          command. Therefore, ls /bin/c* > list.files replaces
Output 3-5 Contents of list.files before issuing the      list.files with the results of ls /bin/c*.
ls /bin/c* >> list.files command.


                                                          Metacharacters
                                                          The *, >, and >>, and | are metacharacters used in this
                                                          experiment. Their purpose is in the table below:

                                                          Metacharacter Purpose
                                                          *                        Matches zero or more characters
                                                          >                        Output redirection
                                                          >>                       Redirect by appendage
                                                          |                        Pipe between commands
                                                          []1                      Insert wildcards




Output 3-6 Contents of the list.files after issuing the
ls /bin/c* >> list.files command.




                                                          1
                                                              Not used in this experiment.



Printing and Metacharacters                                                                                              5
Analysis




                              Discoveries

                              Part II

                              Task 2
                              Issuing the ls command lists the directory contents
                              horizontally; however, when redirected to a file, it places
                              the contents of a directory line-by-line (vertically).




Printing and Metacharacters                                                             6
Analysis




                              New Commands
                              Below is a list of new commands used in this experiment:

                              Command           Purpose
                                  1
                              pr                Format files page-by-page and display to
                                                standard output or printer.




                              1
                                  For a complete syntax of the pr command type pr --help or man pr at the
                                  LINUX shell prompt.



Printing and Metacharacters                                                                                 7
Analysis




                              References
                              1.   Sarwar, Syed Mansoor, Robert Koretsky, Syed
                                   Aqeel Sarwar. Linux: The Textbook. Boston:
                                   Addison Wesley Longman Inc., 2002.




Printing and Metacharacters                                                        8

Más contenido relacionado

Destacado

Using Google Analytics in T-Trendset 1.1
Using Google Analytics in T-Trendset 1.1Using Google Analytics in T-Trendset 1.1
Using Google Analytics in T-Trendset 1.1Techronology Inc.
 
Tutorial—In-cell Dropdown List with Challenge
Tutorial—In-cell Dropdown List with ChallengeTutorial—In-cell Dropdown List with Challenge
Tutorial—In-cell Dropdown List with ChallengeTechronology Inc.
 
Unix interview questions
Unix interview questionsUnix interview questions
Unix interview questionsKalyan Hadoop
 

Destacado (9)

Overview of T-Trendset 1.1
Overview of T-Trendset 1.1Overview of T-Trendset 1.1
Overview of T-Trendset 1.1
 
Using Google Analytics in T-Trendset 1.1
Using Google Analytics in T-Trendset 1.1Using Google Analytics in T-Trendset 1.1
Using Google Analytics in T-Trendset 1.1
 
Input and Output Control
Input and Output ControlInput and Output Control
Input and Output Control
 
Tutorial—In-cell Dropdown List with Challenge
Tutorial—In-cell Dropdown List with ChallengeTutorial—In-cell Dropdown List with Challenge
Tutorial—In-cell Dropdown List with Challenge
 
Dynamic Chart Switcher
Dynamic Chart SwitcherDynamic Chart Switcher
Dynamic Chart Switcher
 
Unix interview questions
Unix interview questionsUnix interview questions
Unix interview questions
 
The Elevator
The ElevatorThe Elevator
The Elevator
 
Vi And Linux Environment
Vi And Linux EnvironmentVi And Linux Environment
Vi And Linux Environment
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
 

Similar a Printing and Metacharacters Lab

Shell Scripting With Arguments
Shell Scripting With ArgumentsShell Scripting With Arguments
Shell Scripting With ArgumentsAlex Shaw III
 
Input And Output Control
Input And Output ControlInput And Output Control
Input And Output ControlAlex Shaw III
 
11_UNIX_Processes_Including_Select.ppt
11_UNIX_Processes_Including_Select.ppt11_UNIX_Processes_Including_Select.ppt
11_UNIX_Processes_Including_Select.pptSIDDHARTHANANDCSE202
 
20051019 automating regression testing for evolving gui software
20051019 automating regression testing for evolving gui software20051019 automating regression testing for evolving gui software
20051019 automating regression testing for evolving gui softwareWill Shen
 
CrashCourse: Python with DataCamp and Jupyter for Beginners
CrashCourse: Python with DataCamp and Jupyter for BeginnersCrashCourse: Python with DataCamp and Jupyter for Beginners
CrashCourse: Python with DataCamp and Jupyter for BeginnersOlga Scrivner
 
fileop report
fileop reportfileop report
fileop reportJason Lu
 
Migration from Firebird 1.5 to Firebird 2.5
Migration from Firebird 1.5 to Firebird 2.5Migration from Firebird 1.5 to Firebird 2.5
Migration from Firebird 1.5 to Firebird 2.5Mind The Firebird
 
PuppetConf 2016: Getting to the Latest Puppet – Nate McCurdy & Elizabeth Witt...
PuppetConf 2016: Getting to the Latest Puppet – Nate McCurdy & Elizabeth Witt...PuppetConf 2016: Getting to the Latest Puppet – Nate McCurdy & Elizabeth Witt...
PuppetConf 2016: Getting to the Latest Puppet – Nate McCurdy & Elizabeth Witt...Puppet
 
Chapter 02 modified
Chapter 02 modifiedChapter 02 modified
Chapter 02 modifiedJugal Doshi
 
Tackling repetitive tasks with serial or parallel programming in R
Tackling repetitive tasks with serial or parallel programming in RTackling repetitive tasks with serial or parallel programming in R
Tackling repetitive tasks with serial or parallel programming in RLun-Hsien Chang
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonmckennadglyn
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentPapp Laszlo
 
The Ring programming language version 1.6 book - Part 8 of 189
The Ring programming language version 1.6 book - Part 8 of 189The Ring programming language version 1.6 book - Part 8 of 189
The Ring programming language version 1.6 book - Part 8 of 189Mahmoud Samir Fayed
 
sphinx demo
sphinx demosphinx demo
sphinx demoak013
 
A Feature-Complete Petri Net A Feature-Complete Petri Net Semantics for WS-BP...
A Feature-Complete Petri Net A Feature-Complete Petri Net Semantics for WS-BP...A Feature-Complete Petri Net A Feature-Complete Petri Net Semantics for WS-BP...
A Feature-Complete Petri Net A Feature-Complete Petri Net Semantics for WS-BP...Universität Rostock
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughgabriellekuruvilla
 
Using SWIG to Control, Prototype, and Debug C Programs with Python
Using SWIG to Control, Prototype, and Debug C Programs with PythonUsing SWIG to Control, Prototype, and Debug C Programs with Python
Using SWIG to Control, Prototype, and Debug C Programs with PythonDavid Beazley (Dabeaz LLC)
 

Similar a Printing and Metacharacters Lab (20)

Shell Scripting With Arguments
Shell Scripting With ArgumentsShell Scripting With Arguments
Shell Scripting With Arguments
 
Input And Output Control
Input And Output ControlInput And Output Control
Input And Output Control
 
11_UNIX_Processes_Including_Select.ppt
11_UNIX_Processes_Including_Select.ppt11_UNIX_Processes_Including_Select.ppt
11_UNIX_Processes_Including_Select.ppt
 
20051019 automating regression testing for evolving gui software
20051019 automating regression testing for evolving gui software20051019 automating regression testing for evolving gui software
20051019 automating regression testing for evolving gui software
 
CrashCourse: Python with DataCamp and Jupyter for Beginners
CrashCourse: Python with DataCamp and Jupyter for BeginnersCrashCourse: Python with DataCamp and Jupyter for Beginners
CrashCourse: Python with DataCamp and Jupyter for Beginners
 
fileop report
fileop reportfileop report
fileop report
 
Migration from Firebird 1.5 to Firebird 2.5
Migration from Firebird 1.5 to Firebird 2.5Migration from Firebird 1.5 to Firebird 2.5
Migration from Firebird 1.5 to Firebird 2.5
 
PuppetConf 2016: Getting to the Latest Puppet – Nate McCurdy & Elizabeth Witt...
PuppetConf 2016: Getting to the Latest Puppet – Nate McCurdy & Elizabeth Witt...PuppetConf 2016: Getting to the Latest Puppet – Nate McCurdy & Elizabeth Witt...
PuppetConf 2016: Getting to the Latest Puppet – Nate McCurdy & Elizabeth Witt...
 
Chapter 02 modified
Chapter 02 modifiedChapter 02 modified
Chapter 02 modified
 
Tackling repetitive tasks with serial or parallel programming in R
Tackling repetitive tasks with serial or parallel programming in RTackling repetitive tasks with serial or parallel programming in R
Tackling repetitive tasks with serial or parallel programming in R
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Unit 7
Unit 7Unit 7
Unit 7
 
The Ring programming language version 1.6 book - Part 8 of 189
The Ring programming language version 1.6 book - Part 8 of 189The Ring programming language version 1.6 book - Part 8 of 189
The Ring programming language version 1.6 book - Part 8 of 189
 
Lab3 s2
Lab3 s2Lab3 s2
Lab3 s2
 
sphinx demo
sphinx demosphinx demo
sphinx demo
 
A Feature-Complete Petri Net A Feature-Complete Petri Net Semantics for WS-BP...
A Feature-Complete Petri Net A Feature-Complete Petri Net Semantics for WS-BP...A Feature-Complete Petri Net A Feature-Complete Petri Net Semantics for WS-BP...
A Feature-Complete Petri Net A Feature-Complete Petri Net Semantics for WS-BP...
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
 
Process
ProcessProcess
Process
 
Using SWIG to Control, Prototype, and Debug C Programs with Python
Using SWIG to Control, Prototype, and Debug C Programs with PythonUsing SWIG to Control, Prototype, and Debug C Programs with Python
Using SWIG to Control, Prototype, and Debug C Programs with Python
 

Último

Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMVoces Mineras
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Pereraictsugar
 
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptxContemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptxMarkAnthonyAurellano
 
Annual General Meeting Presentation Slides
Annual General Meeting Presentation SlidesAnnual General Meeting Presentation Slides
Annual General Meeting Presentation SlidesKeppelCorporation
 
Digital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdfDigital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdfJos Voskuil
 
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / NcrCall Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncrdollysharma2066
 
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...ShrutiBose4
 
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort ServiceCall US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Servicecallgirls2057
 
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607dollysharma2066
 
APRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdfAPRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdfRbc Rbcua
 
Marketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent ChirchirMarketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent Chirchirictsugar
 
MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?Olivia Kresic
 
Innovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdfInnovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdfrichard876048
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03DallasHaselhorst
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Riya Pathan
 
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607dollysharma2066
 
PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationAnamaria Contreras
 
India Consumer 2024 Redacted Sample Report
India Consumer 2024 Redacted Sample ReportIndia Consumer 2024 Redacted Sample Report
India Consumer 2024 Redacted Sample ReportMintel Group
 

Último (20)

Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQM
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Perera
 
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptxContemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
 
Annual General Meeting Presentation Slides
Annual General Meeting Presentation SlidesAnnual General Meeting Presentation Slides
Annual General Meeting Presentation Slides
 
Digital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdfDigital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdf
 
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / NcrCall Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
 
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
 
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort ServiceCall US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
 
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
 
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
 
APRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdfAPRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdf
 
Marketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent ChirchirMarketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent Chirchir
 
MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?
 
Innovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdfInnovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdf
 
Call Us ➥9319373153▻Call Girls In North Goa
Call Us ➥9319373153▻Call Girls In North GoaCall Us ➥9319373153▻Call Girls In North Goa
Call Us ➥9319373153▻Call Girls In North Goa
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737
 
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
 
PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement Presentation
 
India Consumer 2024 Redacted Sample Report
India Consumer 2024 Redacted Sample ReportIndia Consumer 2024 Redacted Sample Report
India Consumer 2024 Redacted Sample Report
 

Printing and Metacharacters Lab

  • 1. Laboratory Experiment IV PRINTING AND METACHARACTERS by Alex Shaw III Unedited Version May 3, 2005
  • 2. TABLE OF CONTENTS Introduction ii Laboratory Sheets iii Procedures iii Data Sheets 1 Results 1 Part I 1 Part II 2 Analysis 4 Explanations 4 Part I 4 Part II 4 Metacharacters 5 Discoveries 6 Part II 6 New Commands 7 References 8 Printing and Metacharacters i
  • 3. INTRODUCTION This experiment involves printing and metacharacters. The first part focuses on printing files using various techniques. Redirections, basic metacharacters, and appending to files are the focal point in the second part of the experiment. The main commands used in this experiment are cat, lpr, and pr. Other commands, like cd and ls, which facilitate file and directory navigation, assist in the performance of tasks. Printing and Metacharacters ii
  • 4. 1 LABORATORY SHEETS LABORATORY EXPERIMENT IV Procedures The procedures (Sheet 1-1 and Sheet 1-2) below provide the steps performed during this experiment. Sheet 1-1 Part I of the laboratory procedures—focuses on printing and Sheet 1-2 Part II of the laboratory procedures—focuses on basic utilizing redirection and piping to provide output to a printer or file. metacharacters, listing and viewing files, and appending to files. Printing and Metacharacters iii
  • 5. 2 DATA SHEETS LABORATORY EXPERIMENT IV Results This section provides the results for each task. Some tasks require in-depth explanations, while others present simple results. Part I Output 2-1 Contents of prtfile1. Task 1 Logged into home directory. Task 2 Created prtfile1 (Output 2-1) in home directory. Task 3 Output 2-2 Contents of prtfile2. This file is actually takes up an entire The pr prtfile1 command seems to display the contents screen because the pr command generated it, which is discussed in the of the prtfile1 to the standard output (screen), which Analysis section. actually scrolls off the screen. This file is created for Experiment 4. Task 4 It focuses on printing and metacharacters. The pr prtfile1 > prtfile2 displays no visible results, but I guess this file should contain more produces prtfile2 (Output 2-2). than three lines to make Task 5 Output 2-3 This is a printout of prtfile1 from Task 7. The pr prtfile1 | more command pipes the results of pr prtfile1 to the more command, which in turn displays This file is created for Experiment 4. the results one screenful at a time. It focuses on printing and metacharacters. I guess this file should contain more Task 6 than three lines to make Results of pr prtfile1, pr prtfile1 > prtfile2, and Output 2-4 This is a printout of prtfile1 from Task 8. pr prtfile1 | more are analyzed in the Analysis section. 2005-04-05 19:21 prtfile1 Page 1 Task 7 The cat prtfile1 | lpr -Ppr2191 pipes the results of This file is created for Experiment 4. cat prtfile1 to lpr -Ppr219, which prints the contents of It focuses on printing and metacharacters. I guess this file should contain more prtfile1 to printer 219 (Output 2-3). than three lines to make Output 2-5 This is a printout of prtfile1 from Task 9. Task 8 The lpr -Ppr219 prtfile1 prints prtfile1 to printer 219 (Output 2-4). Task 9 The pr prtfile1 | lpr command pipes the results of pr prtfile1 to lpr, which prints those results to the default printer (Output 2-5). continue on next page… 1 Printer 219 is located in Lehman College. Your printer may have a different name or location. Printing and Metacharacters 1
  • 6. Data Sheets Task 10 The pr prtfile1 > lpr command redirects the output of pr prtfile1 to the lpr file. Task 11 The difference between pr prtfile1 | lpr and pr prtfile1 > lpr are discussed in the Analysis section. Part II Task 1 The cd ~ changes to the home directory. Output 2-6 Contents of list.files. This file was generated from the Task 2 ls > list.files command. The ls > list.files command displays no results to the screen. Task 3 The cat list.files command displays the contents of list.files (Output 2-6) to the screen or standard output. Output 2-7 Results of the ls c* command, performed in the /bin directory. Task 4 Issuing ls > list.files redirects the output of ls to the list.files file. The "greater than" (>) sign is presented in Task 2 is discussed in the Analysis section. Task 5 The cd /bin command changed the current director to /bin. Task 6 Issuing ls c* displays a listing of all the files in the current directory (/bin) starting with 'c' (Output 2-7). Task 7 See the Analysis section for a discussion on the asterisk (*). Task 8 The cd $HOME command returns to the home directory. Task 9 The ls /bin/c* >> list.files command displays no results to the screen. Output 2-8 Contents of the list.files after issuing the ls /bin/c* >> list.files command. Task 10 The cat list.files command displays the contents of list.files (Output 2-8) to the screen. continue on next page… Printing and Metacharacters 2
  • 7. Data Sheets Task 11 A discussion of what happened with list.files after task 2 and task 9 is in the Analysis section. Task 12 The ls /bin/c* > list.files command displays no results on the screen. Task 13 Issuing ls /bin/c* > list.files redirects output from Output 2-9 Contents of the list.files after issuing the ls /bin/c* the list.files (Output 2-9) file. More discussion ls /bin/c* > list.files command. on this task is in the Analysis section. Task 14 Along with the metacharacters presented in this experiment, the brackets "[ ]" metacharacter is also discussed in the Analysis section. Printing and Metacharacters 3
  • 8. 3 ANALYSIS LABORATORY EXPERIMENT IV Explanations Part I Task 6 The pr prtfile1 command displays the contents of prtfile1 to the screen one page at a time. Even if there is only one Output 3-1 Contents of prtfile1. line of text, an entire page is still display; therefore, the screen may scroll beyond the contents of the file. The pr prtfile1 > prtfile2 redirects the output of pr prtfile1 to the prtfile2 file. That does not mean prtfile1 and prtfile2 will be identical; the pr prtfile1 command adds a header to the prtfile1 file. You can see Output 3-2 Contents of prtfile2. the difference in Output 3-1 and Output 3-2. The pr prtfile1 | more command pipes the results of pr prtfile1 to the more command, which allows the user to view the file one screenful at a time. It fixes the result Output 3-3 Results of the ls command in the home directory. encountered with the pr prtfile1 command. Task 11 The pr prtfile1 | lpr command pipes the results of pr prtfile1 to the lpr command, which prints those results; and pr prtfile1 > lpr redirects the output of pr prtfile1 to the lpr file. Part II Task 4 Issuing ls > list.files redirects the output of the ls command to the list.files file. In previous experiments, output redirection created a file identical to the command's result. Output 3-4 Contents of list.files. However, list.files displays the directory structure in a manner similar to the way ls -l would. ls alone display the directory structure horizontally. See Output 3-3 and Output 3-4 for the difference between ls and list.files. The '>' symbol is discussed on page 5. continue on next page… Printing and Metacharacters 4
  • 9. Analysis Task 7 The '*' symbol is discussed in Metacharacters. Task 11 After issuing the ls /bin/c* >> list.files command, list.files is concatenated with the old list.files, as shown in Output 3-6. The '>>' symbol is discussed on page 5. Task 13 Issuing a command with output redirection to an existing file causing the file to be replaced with the results of the command. Therefore, ls /bin/c* > list.files replaces Output 3-5 Contents of list.files before issuing the list.files with the results of ls /bin/c*. ls /bin/c* >> list.files command. Metacharacters The *, >, and >>, and | are metacharacters used in this experiment. Their purpose is in the table below: Metacharacter Purpose * Matches zero or more characters > Output redirection >> Redirect by appendage | Pipe between commands []1 Insert wildcards Output 3-6 Contents of the list.files after issuing the ls /bin/c* >> list.files command. 1 Not used in this experiment. Printing and Metacharacters 5
  • 10. Analysis Discoveries Part II Task 2 Issuing the ls command lists the directory contents horizontally; however, when redirected to a file, it places the contents of a directory line-by-line (vertically). Printing and Metacharacters 6
  • 11. Analysis New Commands Below is a list of new commands used in this experiment: Command Purpose 1 pr Format files page-by-page and display to standard output or printer. 1 For a complete syntax of the pr command type pr --help or man pr at the LINUX shell prompt. Printing and Metacharacters 7
  • 12. Analysis References 1. Sarwar, Syed Mansoor, Robert Koretsky, Syed Aqeel Sarwar. Linux: The Textbook. Boston: Addison Wesley Longman Inc., 2002. Printing and Metacharacters 8