diff -r 71038eb0e790 -r f2383fee6584 SEESenv/web/html/ch8ult_module_plan.html --- a/SEESenv/web/html/ch8ult_module_plan.html Mon Feb 22 00:37:50 2010 +0530 +++ b/SEESenv/web/html/ch8ult_module_plan.html Mon Feb 22 16:22:32 2010 +0530 @@ -4,8 +4,15 @@ Chapter. ult_module_plan - - + + + + + +
@@ -20,7 +27,7 @@
- +
@@ -28,7 +35,7 @@
- + 1. Introducing Linux @@ -37,21 +44,21 @@
- + 1.1. Historical Background
- + 1.2. Design and Implications
- + 1.3. Reasons for Using Linux @@ -60,7 +67,7 @@
- + 2. Getting Started @@ -69,7 +76,7 @@
- + 2.1. Logging in, activating the user interface and logging out @@ -78,7 +85,7 @@
- + 3. Basic Commands @@ -87,35 +94,35 @@
- + 3.1. ls
- + 3.2. date
- + 3.3. cd
- + 3.4. who
- + 3.5. mkdir @@ -124,7 +131,7 @@
- + 4. Getting Help @@ -133,28 +140,28 @@
- + 4.1. apropos and whatis
- + 4.2. man
- + 4.3. info
- + 4.4. --help @@ -163,7 +170,7 @@
- + 5. Basic file handling @@ -172,21 +179,21 @@
- + 5.1. cp
- + 5.2. mv
- + 5.3. rm @@ -195,14 +202,14 @@
- + 6. Command Line Arguments
- + 7. Basic Text Processing @@ -211,28 +218,28 @@
- + 7.1. head
- + 7.2. tail
- + 7.3. cut
- + 7.4. paste @@ -241,14 +248,14 @@
- + 8. Shell Meta Characters
- + 9. Looking At Files @@ -257,21 +264,21 @@
- + 9.1. cat
- + 9.2. more
- + 9.3. less @@ -280,7 +287,7 @@
- + 10. Directory Structure @@ -289,14 +296,14 @@
- + 10.1. man hier
- + 10.2. ls -l @@ -305,7 +312,7 @@
- + 11. Permissions and Ownership @@ -314,7 +321,7 @@
- + 11.1. chmod @@ -323,7 +330,7 @@
- + 12. Redirection and Piping @@ -332,35 +339,35 @@
- + 12.1. Redirecting standard input and standard output
- + 12.2. Piping
- + 12.3. Redirecting to and from the standard file handles
- + 12.4. Chained pipelines
- + 12.5. Redirect to multiple outputs @@ -369,7 +376,7 @@
- + 13. More Text Processing @@ -378,14 +385,14 @@
- + 13.1. grep
- + 13.2. tr @@ -394,7 +401,7 @@
- + 14. Elementary Regex @@ -403,7 +410,7 @@
- + 14.1. Lazy quantification @@ -412,7 +419,7 @@
- + 15. One Liners @@ -425,7 +432,7 @@
-

+

@@ -440,7 +447,7 @@
- + 1. Introducing Linux @@ -449,21 +456,21 @@
- + 1.1. Historical Background
- + 1.2. Design and Implications
- + 1.3. Reasons for Using Linux @@ -472,7 +479,7 @@
- + 2. Getting Started @@ -481,7 +488,7 @@
- + 2.1. Logging in, activating the user interface and logging out @@ -490,7 +497,7 @@
- + 3. Basic Commands @@ -499,35 +506,35 @@
- + 3.1. ls
- + 3.2. date
- + 3.3. cd
- + 3.4. who
- + 3.5. mkdir @@ -536,7 +543,7 @@
- + 4. Getting Help @@ -545,28 +552,28 @@
- + 4.1. apropos and whatis
- + 4.2. man
- + 4.3. info
- + 4.4. --help @@ -575,7 +582,7 @@
- + 5. Basic file handling @@ -584,21 +591,21 @@
- + 5.1. cp
- + 5.2. mv
- + 5.3. rm @@ -607,14 +614,14 @@
- + 6. Command Line Arguments
- + 7. Basic Text Processing @@ -623,28 +630,28 @@
- + 7.1. head
- + 7.2. tail
- + 7.3. cut
- + 7.4. paste @@ -653,14 +660,14 @@
- + 8. Shell Meta Characters
- + 9. Looking At Files @@ -669,21 +676,21 @@
- + 9.1. cat
- + 9.2. more
- + 9.3. less @@ -692,7 +699,7 @@
- + 10. Directory Structure @@ -701,14 +708,14 @@
- + 10.1. man hier
- + 10.2. ls -l @@ -717,7 +724,7 @@
- + 11. Permissions and Ownership @@ -726,7 +733,7 @@
- + 11.1. chmod @@ -735,7 +742,7 @@
- + 12. Redirection and Piping @@ -744,35 +751,35 @@
- + 12.1. Redirecting standard input and standard output
- + 12.2. Piping
- + 12.3. Redirecting to and from the standard file handles
- + 12.4. Chained pipelines
- + 12.5. Redirect to multiple outputs @@ -781,7 +788,7 @@
- + 13. More Text Processing @@ -790,14 +797,14 @@
- + 13.1. grep
- + 13.2. tr @@ -806,7 +813,7 @@
- + 14. Elementary Regex @@ -815,7 +822,7 @@
- + 14.1. Lazy quantification @@ -824,7 +831,7 @@
- + 15. One Liners @@ -836,7 +843,7 @@

- + 1.Introducing Linux

@@ -860,7 +867,7 @@

- + 1.1.Historical Background

@@ -872,7 +879,7 @@

- + 1.1.1.Events leading to the creation

@@ -899,7 +906,7 @@

- + 1.1.2.The Creation of Linux

@@ -919,7 +926,7 @@

- + 1.2.Design and Implications

@@ -934,7 +941,7 @@

- + 1.2.1.User Interface

@@ -953,7 +960,7 @@

- + 1.2.2.Development

@@ -975,7 +982,7 @@

- + 1.2.3.Community

@@ -997,7 +1004,7 @@

- + 1.2.4.Can I make a profit out of running a business involving Linux?

@@ -1013,7 +1020,7 @@

- + 1.2.5.Programming on Linux

@@ -1036,7 +1043,7 @@

- + 1.3.Reasons for Using Linux

@@ -1124,7 +1131,7 @@

- + 2.Getting Started

@@ -1136,7 +1143,7 @@

- + 2.1.Logging in, activating the user interface and logging out

@@ -1151,7 +1158,7 @@

- + 2.1.1.Graphical Mode

@@ -1274,7 +1281,7 @@

- + 2.1.2.Text Mode

@@ -1329,7 +1336,7 @@

- + 3.Basic Commands

@@ -1341,7 +1348,7 @@

- + 3.1.ls

@@ -1387,84 +1394,80 @@ displays files in a bare format. This bare format however makes it difficult to establish the type, permissions, and size of the files. The most common options to reveal this information or change the list of files are:

- - <block_quote> -
-
    -
  • -

    - - - -l - - - long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename -

    -
  • -
  • -

    - - - -F - - - appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix. -

    -
  • -
  • -

    - - - -a - - - lists all files in the given directory, including those whose names start with "." (which are hidden files in Unix). By default, these files are excluded from the list. -

    -
  • -
  • -

    - - - -R - - - recursively lists subdirectories. The command ls -R / would therefore list all files. -

    -
  • -
  • -

    - - - -d - - - shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory. -

    -
  • -
  • -

    - - - -t - - - sort the list of files by modification time. -

    -
  • -
  • -

    - - - -h - - - print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.) -

    -
  • -
-
- </block_quote> -
+
+
    +
  • +

    + + + -l + + + long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename +

    +
  • +
  • +

    + + + -F + + + appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix. +

    +
  • +
  • +

    + + + -a + + + lists all files in the given directory, including those whose names start with "." (which are hidden files in Unix). By default, these files are excluded from the list. +

    +
  • +
  • +

    + + + -R + + + recursively lists subdirectories. The command ls -R / would therefore list all files. +

    +
  • +
  • +

    + + + -d + + + shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory. +

    +
  • +
  • +

    + + + -t + + + sort the list of files by modification time. +

    +
  • +
  • +

    + + + -h + + + print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.) +

    +
  • +
+

In some environments, providing the option @@ -1515,7 +1518,7 @@

- + 3.2.date

@@ -1571,7 +1574,7 @@

- + 3.3.cd

@@ -1593,13 +1596,9 @@

Absolute paths:

- - <block_quote> -

An absolute path is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.

- </block_quote>

For example to get to /boot/grub you would type:

@@ -1612,9 +1611,6 @@

Relative paths:

- - <block_quote> -

A relative path doesn't have a preceding slash. Use a relative path when you start from a directory below the top level directory structure. This is dependent on where you are in the filesystem.

@@ -1624,7 +1620,6 @@
        $ cd music
       
- </block_quote>

Please note that there is no / using the above cd command. Using a / would cause this to be an absolute path, working from the top of the hierarchy downward.

@@ -1634,7 +1629,7 @@

- + 3.4.who

@@ -1732,7 +1727,7 @@

- + 3.5.mkdir

@@ -1765,7 +1760,7 @@

- + 3.5.1.Options

@@ -1781,44 +1776,40 @@ takes options. Three of the most common options are:

- - <block_quote> -
-
    -
  • -

    - - - -p - - - : will also create all directories leading up to the given directory that do not exist already. If the given directory already exists, ignore the error. -

    -
  • -
  • -

    - - - -v - - - : display each directory that mkdir creates. Most often used with -p. -

    -
  • -
  • -

    - - - -m - - - : specify the octal permissions of directories created by mkdir. -

    -
  • -
-
- </block_quote> -
+
+
    +
  • +

    + + + -p + + + : will also create all directories leading up to the given directory that do not exist already. If the given directory already exists, ignore the error. +

    +
  • +
  • +

    + + + -v + + + : display each directory that mkdir creates. Most often used with -p. +

    +
  • +
  • +

    + + + -m + + + : specify the octal permissions of directories created by mkdir. +

    +
  • +
+

@@ -1833,7 +1824,7 @@

- + 3.5.2.Examples

@@ -1888,56 +1879,28 @@

This will create:

- - <definition_list> - - <definition_list_item> - - <term>tmpdir - branches</term> - - - <definition> + tmpdir - branches +
+
    +
  • +

    + tag +

    +
  • +
  • + trunk - sources - includes
    • -

      - tag +

      + docs

    • -
    • - - <definition_list> - - <definition_list_item> - - <term>trunk - sources - includes</term> - - - <definition> -
      -
        -
      • -

        - docs -

        -
      • -
      -
      - </definition> -
      - </definition_list_item> -
      - </definition_list> -
      -
    - </definition> - - </definition_list_item> - - </definition_list> - +
  • +
+
@@ -1946,7 +1909,7 @@

- + 4.Getting Help

@@ -1958,7 +1921,7 @@

- + 4.1.apropos and whatis

@@ -2040,7 +2003,7 @@

- + 4.2.man

@@ -2121,7 +2084,7 @@

- + 4.2.1.Layout

@@ -2131,80 +2094,26 @@

All man pages follow a common layout that is optimized for presentation on a simple ASCII text display, possibly without any form of highlighting or font control. Sections present may include:

- - <definition_list> - - <definition_list_item> - - <term>NAME</term> - - - <definition> - - - + NAME

The name of the command or function, followed by a one-line description of what it does.

- </definition> - </definition_list_item> - - <definition_list_item> - - <term>SYNOPSIS</term> - - - <definition> - - + SYNOPSIS

In the case of a command, you get a formal description of how to run it and what command line options it takes. For program functions, a list of the parameters the function takes and which header file contains its definition. For experienced users, this may be all the documentation they need.

- </definition> - </definition_list_item> - - <definition_list_item> - - <term>DESCRIPTION</term> - - - <definition> - - + DESCRIPTION

A textual description of the functioning of the command or function.

- </definition> - </definition_list_item> - - <definition_list_item> - - <term>EXAMPLES</term> - - - <definition> - - + EXAMPLES

Some examples of common usage.

- </definition> - </definition_list_item> - - <definition_list_item> - - <term>SEE ALSO</term> - - - <definition> - - + SEE ALSO

A list of related commands or functions.

- </definition> - </definition_list_item> - </definition_list>

Other sections may be present, but these are not well standardized across man pages. Common examples include: OPTIONS, EXIT STATUS, ENVIRONMENT, KNOWN BUGS, FILES, AUTHOR, REPORTING BUGS, HISTORY and COPYRIGHT.

@@ -2236,7 +2145,7 @@

- + 4.3.info

@@ -2265,63 +2174,55 @@ processes info files, which are Texinfo formatted files, and presents the documentation as a tree, with simple commands to traverse the tree and to follow cross references. For instance

- - <block_quote> -
-
    -
  • -

    - - - n - - - goes to the next page. -

    -
  • -
  • -

    - - - p - - - goes to the previous page. -

    -
  • -
  • -

    - - - u - - - goes to the upper page. -

    -
  • -
  • -

    - - - l - - - goes to the last(visited) node -

    -
  • -
  • -

    - To follow a cross reference, the cursor can be moved over a link (a word preceded by a - - <title_reference>*</title_reference> - - ) and enter pressed. -

    -
  • -
-
- </block_quote> -
+
+
    +
  • +

    + + + n + + + goes to the next page. +

    +
  • +
  • +

    + + + p + + + goes to the previous page. +

    +
  • +
  • +

    + + + u + + + goes to the upper page. +

    +
  • +
  • +

    + + + l + + + goes to the last(visited) node +

    +
  • +
  • +

    + To follow a cross reference, the cursor can be moved over a link (a word preceded by a *) and enter pressed. +

    +
  • +
+

info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.

@@ -2331,7 +2232,7 @@

- + 4.4.--help

@@ -2380,7 +2281,7 @@

- + 5.Basic file handling

@@ -2392,7 +2293,7 @@

- + 5.1.cp

@@ -2412,7 +2313,7 @@

- + 5.1.1.Usage

@@ -2444,7 +2345,7 @@

- + 5.1.2.Flags

@@ -2483,29 +2384,25 @@ (preserve) duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:

- - <block_quote> -
-
    -
  • -

    - The time of the last data modification and the time of the last access. -

    -
  • -
  • -

    - The user ID and group ID (only if it has permissions to do this) -

    -
  • -
  • -

    - The file permission bits and the SUID and SGID bits. -

    -
  • -
-
- </block_quote> -
+
+
    +
  • +

    + The time of the last data modification and the time of the last access. +

    +
  • +
  • +

    + The user ID and group ID (only if it has permissions to do this) +

    +
  • +
  • +

    + The file permission bits and the SUID and SGID bits. +

    +
  • +
+

@@ -2520,7 +2417,7 @@

- + 5.1.3.Examples

@@ -2602,13 +2499,9 @@

To copy a directory, including all its files and subdirectories, to another directory, enter:

- - <block_quote> -

$ cp -R /home/hhgg/clients /home/hhgg/customers

- </block_quote>

This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.

@@ -2667,7 +2560,7 @@

- + 5.2.mv

@@ -2693,7 +2586,7 @@

- + 5.2.1.Conflicting existing file

@@ -2709,7 +2602,7 @@

- + 5.2.2.Differences with copy and delete

@@ -2725,7 +2618,7 @@

- + 5.2.3.Examples

@@ -2786,7 +2679,7 @@

- + 5.3.rm

@@ -2813,7 +2706,7 @@

- + 5.3.1.Options

@@ -2823,54 +2716,50 @@

Common options that rm accepts include:

- - <block_quote> -
-
    -
  • -

    - - - -r - - - , which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive") -

    -
  • -
  • -

    - - - -i - - - , which asks for every deletion to be confirmed ("interactive") -

    -
  • -
  • -

    - - - -f - - - , which ignores non-existent files and overrides any confirmation prompts ("force") -

    -
  • -
  • -

    - - - -v - - - , which shows what is being removed as it happens ("verbose") -

    -
  • -
-
- </block_quote> -
+
+
    +
  • +

    + + + -r + + + , which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive") +

    +
  • +
  • +

    + + + -i + + + , which asks for every deletion to be confirmed ("interactive") +

    +
  • +
  • +

    + + + -f + + + , which ignores non-existent files and overrides any confirmation prompts ("force") +

    +
  • +
  • +

    + + + -v + + + , which shows what is being removed as it happens ("verbose") +

    +
  • +
+

@@ -2885,11 +2774,7 @@ rm -rf - (variously, rm -rf /, rm -rf - - <title_reference>*</title_reference> - - , and others) is frequently used in jokes and anecdotes about Unix disasters. The rm -rf variant of the command, if run by a superuser on the root directory, would cause the contents of every writable mounted filesystem on the computer to be deleted. + (variously, rm -rf /, rm -rf *, and others) is frequently used in jokes and anecdotes about Unix disasters. The rm -rf variant of the command, if run by a superuser on the root directory, would cause the contents of every writable mounted filesystem on the computer to be deleted.

@@ -2917,7 +2802,7 @@

- + 5.3.2.Permissions

@@ -2941,7 +2826,7 @@

- + 6.Command Line Arguments

@@ -3026,7 +2911,7 @@

- + 7.Basic Text Processing

@@ -3038,7 +2923,7 @@

- + 7.1.head

@@ -3088,7 +2973,7 @@

- + 7.1.1.Flags

@@ -3128,7 +3013,7 @@

- + 7.2.tail

@@ -3194,7 +3079,7 @@

- + 7.2.1.File monitoring

@@ -3243,7 +3128,7 @@

- + 7.3.cut

@@ -3322,7 +3207,7 @@

- + 7.4.paste

@@ -3407,7 +3292,7 @@

- + 8.Shell Meta Characters

@@ -3448,11 +3333,7 @@ because the c* matches that long file name.

- Filenames containing metacharacters can pose many problems and should never be intentionally created. If you do find that you've created a file with metacharacters, and you would like to remove it, you have three options. You may use wildcards to match metacharacter, use the to directly enter the filename, or put the command in double quotes (except in the case of double quotes within the file name, these must be captured with one of the first two methods). For example, deleting a file named - - <title_reference>"``*`|more</title_reference> - - "` can be accomplished with: + Filenames containing metacharacters can pose many problems and should never be intentionally created. If you do find that you've created a file with metacharacters, and you would like to remove it, you have three options. You may use wildcards to match metacharacter, use the to directly enter the filename, or put the command in double quotes (except in the case of double quotes within the file name, these must be captured with one of the first two methods). For example, deleting a file named "``*`|more"` can be accomplished with:

       $ rm ??more
@@ -3475,7 +3356,7 @@
       

- + 9.Looking At Files

@@ -3487,7 +3368,7 @@

- + 9.1.cat

@@ -3532,7 +3413,7 @@

- + 9.1.1.Jargon File Definition

@@ -3576,7 +3457,7 @@

- + 9.1.2.Useless Use of 'cat'

@@ -3628,7 +3509,7 @@

- + 9.1.3.zcat

@@ -3679,7 +3560,7 @@

- + 9.2.more

@@ -3700,7 +3581,7 @@

- + 9.2.1.Usage

@@ -3803,7 +3684,7 @@

- + 9.3.less

@@ -3835,7 +3716,7 @@

- + 9.3.1.Usage

@@ -3889,139 +3770,131 @@

- + 9.3.2.Frequently Used Options

- - <block_quote> -
-
    -
  • -

    - -g: Highlights just the current match of any searched string. -

    -
  • -
  • -

    - -I: Case-insensitive searches. -

    -
  • -
  • -

    - -M: Shows more detailed prompt, including file position. -

    -
  • -
  • -

    - -N: Shows line numbers (useful for source code viewing). -

    -
  • -
  • -

    - -S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling. -

    -
  • -
  • -

    - -?: Shows help. -

    -
  • -
-
- </block_quote> -
+
+
    +
  • +

    + -g: Highlights just the current match of any searched string. +

    +
  • +
  • +

    + -I: Case-insensitive searches. +

    +
  • +
  • +

    + -M: Shows more detailed prompt, including file position. +

    +
  • +
  • +

    + -N: Shows line numbers (useful for source code viewing). +

    +
  • +
  • +

    + -S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling. +

    +
  • +
  • +

    + -?: Shows help. +

    +
  • +
+

- + 9.3.3.Frequently Used Commands

- - <block_quote> -
-
    -
  • -

    - [Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation. -

    -
  • -
  • -

    - [Space bar]: Next page. -

    -
  • -
  • -

    - b: Previous page. -

    -
  • -
  • -

    - ng: Jump to line number n. Default is the start of the file. -

    -
  • -
  • -

    - nG: Jump to line number n. Default is the end of the file. -

    -
  • -
  • -

    - /pattern: Search for pattern. Regular expressions can be used. -

    -
  • -
  • -

    - '^ or g: Go to start of file. -

    -
  • -
  • -

    - '$ or G: Go to end of file. -

    -
  • -
  • -

    - s: Save current content (got from another program like grep) in a file. -

    -
  • -
  • -

    - =: File information. -

    -
  • -
  • -

    - h: Help. -

    -
  • -
  • -

    - q: Quit. -

    -
  • -
-
- </block_quote> -
+
+
    +
  • +

    + [Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation. +

    +
  • +
  • +

    + [Space bar]: Next page. +

    +
  • +
  • +

    + b: Previous page. +

    +
  • +
  • +

    + ng: Jump to line number n. Default is the start of the file. +

    +
  • +
  • +

    + nG: Jump to line number n. Default is the end of the file. +

    +
  • +
  • +

    + /pattern: Search for pattern. Regular expressions can be used. +

    +
  • +
  • +

    + '^ or g: Go to start of file. +

    +
  • +
  • +

    + '$ or G: Go to end of file. +

    +
  • +
  • +

    + s: Save current content (got from another program like grep) in a file. +

    +
  • +
  • +

    + =: File information. +

    +
  • +
  • +

    + h: Help. +

    +
  • +
  • +

    + q: Quit. +

    +
  • +
+

- + 9.3.4.Examples

@@ -4042,7 +3915,7 @@

- + 10.Directory Structure

@@ -4068,7 +3941,7 @@

- + 10.1.man hier

@@ -4087,7 +3960,7 @@

- + 10.2.ls -l

@@ -4110,7 +3983,7 @@

- + 11.Permissions and Ownership

@@ -4122,7 +3995,7 @@

- + 11.1.chmod

@@ -4143,7 +4016,7 @@

- + 11.1.1.Usage

@@ -4174,7 +4047,7 @@

- + 11.1.2.Command line options

@@ -4190,30 +4063,26 @@ command has a number of command line options that affect its behavior. The most common options are:

- - <block_quote> -
-
    -
  • -

    - -R: Changes the modes of directories and files recursively -

    -
  • -
  • -

    - -v: Verbose mode; lists all files as they are being processed -

    -
  • -
-
- </block_quote> -
+
+
    +
  • +

    + -R: Changes the modes of directories and files recursively +

    +
  • +
  • +

    + -v: Verbose mode; lists all files as they are being processed +

    +
  • +
+
- + 11.1.2.1.Symbolic modes
@@ -4284,7 +4153,7 @@
- + 11.1.2.2.Symbolic examples
@@ -4333,7 +4202,7 @@
- + 11.1.2.3.Octal numbers
@@ -4384,7 +4253,7 @@
- + 11.1.2.4.Special modes
@@ -4436,7 +4305,7 @@

- + 12.Redirection and Piping

@@ -4478,7 +4347,7 @@

- + 12.1.Redirecting standard input and standard output

@@ -4553,7 +4422,7 @@

- + 12.2.Piping

@@ -4611,7 +4480,7 @@

- + 12.3.Redirecting to and from the standard file handles

@@ -4733,7 +4602,7 @@

- + 12.4.Chained pipelines

@@ -4767,7 +4636,7 @@

- + 12.5.Redirect to multiple outputs

@@ -4802,7 +4671,7 @@

- + 13.More Text Processing

@@ -4814,7 +4683,7 @@

- + 13.1.grep

@@ -4852,7 +4721,7 @@

- + 13.1.1.Usage

@@ -4927,7 +4796,7 @@
- + 13.1.1.1.Variations
@@ -5022,7 +4891,7 @@

- + 13.2.tr

@@ -5164,7 +5033,7 @@

- + 14.Elementary Regex

@@ -5214,7 +5083,7 @@

- + 14.1.Lazy quantification

@@ -5228,11 +5097,7 @@ Another whale explosion occurred on <January 26>, <2004>.

- ...would likely come up with the pattern <.*>, or similar. However, this pattern will actually return "<January 26>, <2004>" instead of the "<January 26>" which might be expected, because the - - <title_reference>*</title_reference> - - quantifier is greedy it will consume as many characters as possible from the input, and "January 26>, <2004" has more characters than "January 26". + ...would likely come up with the pattern <.*>, or similar. However, this pattern will actually return "<January 26>, <2004>" instead of the "<January 26>" which might be expected, because the * quantifier is greedy it will consume as many characters as possible from the input, and "January 26>, <2004" has more characters than "January 26".

Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: <[^>]*>), modern regular expression tools allow a quantifier to be specified as @@ -5250,7 +5115,7 @@

- + 15.One Liners

@@ -5269,30 +5134,26 @@

The one liner can be

- - <block_quote> -
-
    -
  1. -

    - An expression written in the language of the shell. -

    -
  2. -
  3. -

    - The invocation of an interpreter together with program source for the interpreter to run. -

    -
  4. -
  5. -

    - The invocation of a compiler together with source to compile and +

    +
      +
    1. +

      + An expression written in the language of the shell. +

      +
    2. +
    3. +

      + The invocation of an interpreter together with program source for the interpreter to run. +

      +
    4. +
    5. +

      + The invocation of a compiler together with source to compile and instructions for executing the compiled program. -

      -
    6. -
    -
    - </block_quote> - +

    +
  6. +
+

Certain dynamic scripting languages such as AWK, sed, and perl have traditionally been adept at expressing one-liners. Specialist shell interpreters such as these Unix shells or the Windows PowerShell, allow for the construction of powerful one-liners.

@@ -5326,38 +5187,34 @@

Here are the first few of them:

- - <block_quote> -
-
    -
  1. -

    - Print the total number of input lines: -

    -

    - END { print NR } -

    -
  2. -
  3. -

    - Print the tenth input line: -

    -

    - NR == 10 -

    -
  4. -
  5. -

    - Print the last field of every input line: -

    -

    - { print $NF } -

    -
  6. -
-
- </block_quote> -
+
+
    +
  1. +

    + Print the total number of input lines: +

    +

    + END { print NR } +

    +
  2. +
  3. +

    + Print the tenth input line: +

    +

    + NR == 10 +

    +
  4. +
  5. +

    + Print the last field of every input line: +

    +

    + { print $NF } +

    +
  6. +
+

One-liners are also used to show off the differential expressive power of programming languages. Frequently, one-liners are used to demonstrate programming ability. Contests are often held to see who can create the most exceptional one-liner.