Virtual enviroment for SEES-hacks added ...
authoramit@thunder
Fri, 12 Feb 2010 01:11:21 +0530
changeset 2 52d12eb31c30
parent 1 672eaaab9204
child 3 6cee07c589cb
Virtual enviroment for SEES-hacks added ...
SEESenv/scripts/autoid.py
SEESenv/scripts/docbook2html.py
SEESenv/scripts/html-single.xsl
SEESenv/scripts/index.config
SEESenv/scripts/myrst2xml.py
SEESenv/scripts/p_list.py
SEESenv/scripts/rst2docbook.py
SEESenv/web/README
SEESenv/web/genindex.py
SEESenv/web/hgbook.conf
SEESenv/web/hgbook.conf~
SEESenv/web/hgbook/.database.sqlite3
SEESenv/web/hgbook/__init__.py
SEESenv/web/hgbook/__init__.pyc
SEESenv/web/hgbook/admin.py
SEESenv/web/hgbook/admin.pyc
SEESenv/web/hgbook/admin.py~
SEESenv/web/hgbook/comments/__init__.py
SEESenv/web/hgbook/comments/__init__.pyc
SEESenv/web/hgbook/comments/feeds.py
SEESenv/web/hgbook/comments/feeds.pyc
SEESenv/web/hgbook/comments/models.py
SEESenv/web/hgbook/comments/models.pyc
SEESenv/web/hgbook/comments/models.py~
SEESenv/web/hgbook/comments/p_list.py
SEESenv/web/hgbook/comments/p_list.pyc
SEESenv/web/hgbook/comments/p_list.py~
SEESenv/web/hgbook/comments/sql/comment.mysql.sql
SEESenv/web/hgbook/comments/sql/element.mysql.sql
SEESenv/web/hgbook/comments/test
SEESenv/web/hgbook/comments/test~
SEESenv/web/hgbook/comments/urls.py
SEESenv/web/hgbook/comments/urls.pyc
SEESenv/web/hgbook/comments/urls.py~
SEESenv/web/hgbook/comments/views.py
SEESenv/web/hgbook/comments/views.pyc
SEESenv/web/hgbook/comments/views.py~
SEESenv/web/hgbook/converter.py
SEESenv/web/hgbook/dbutil.py
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/flintlock
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/iamflint
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/position.DB
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/position.baseA
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/position.baseB
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/postlist.DB
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/postlist.baseA
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/postlist.baseB
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/record.DB
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/record.baseA
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/record.baseB
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/spelling.DB
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/spelling.baseA
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/spelling.baseB
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/termlist.DB
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/termlist.baseA
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/termlist.baseB
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/value.DB
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/value.baseA
SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/value.baseB
SEESenv/web/hgbook/load_elements.py
SEESenv/web/hgbook/manage.py
SEESenv/web/hgbook/reviewers.py
SEESenv/web/hgbook/run.wsgi
SEESenv/web/hgbook/run.wsgi~
SEESenv/web/hgbook/secrets.py.gpg
SEESenv/web/hgbook/settings.py
SEESenv/web/hgbook/settings.pyc
SEESenv/web/hgbook/settings.py~
SEESenv/web/hgbook/templates/404.html
SEESenv/web/hgbook/templates/500.html
SEESenv/web/hgbook/templates/boilerplate.html
SEESenv/web/hgbook/templates/comment.html
SEESenv/web/hgbook/templates/comment.html~
SEESenv/web/hgbook/templates/feeds/comments_description.html
SEESenv/web/hgbook/templates/feeds/comments_title.html
SEESenv/web/hgbook/templates/index.html
SEESenv/web/hgbook/templates/index.html~
SEESenv/web/hgbook/templates/simple.html
SEESenv/web/hgbook/templates/single_com.html
SEESenv/web/hgbook/templates/single_com.html~
SEESenv/web/hgbook/urls.py
SEESenv/web/hgbook/urls.pyc
SEESenv/web/hgbook/urls.py~
SEESenv/web/html/backup/abc.html
SEESenv/web/html/backup/abc.py
SEESenv/web/html/backup/abcd.html
SEESenv/web/html/backup/ar01.html
SEESenv/web/html/backup/autoid.py
SEESenv/web/html/backup/ch01-intro.html
SEESenv/web/html/backup/ch02-list_tuples.html
SEESenv/web/html/backup/ch03-oop.html
SEESenv/web/html/backup/chap_intro.py
SEESenv/web/html/backup/func.html
SEESenv/web/html/backup/paragraphlist.py
SEESenv/web/html/ch1Introduction.html
SEESenv/web/html/ch2intro.html
SEESenv/web/html/ch3list_tuples.html
SEESenv/web/html/ch4strings_dicts.html
SEESenv/web/html/ch5func.html
SEESenv/web/html/ch6oop.html
SEESenv/web/html/ch7interim_assessment.html
SEESenv/web/html/ch8ult_module_plan.html
SEESenv/web/html/ch9Using_Linux_Tools.html
SEESenv/web/html/chn10session4.html
SEESenv/web/html/chn11Section_5.html
SEESenv/web/html/support/figs/bad-merge-1.png
SEESenv/web/html/support/figs/bad-merge-2.png
SEESenv/web/html/support/figs/bad-merge-3.png
SEESenv/web/html/support/figs/bad-merge-4.png
SEESenv/web/html/support/figs/bad-merge-5.png
SEESenv/web/html/support/figs/caution.png
SEESenv/web/html/support/figs/feature-branches.png
SEESenv/web/html/support/figs/filelog.png
SEESenv/web/html/support/figs/kdiff3.png
SEESenv/web/html/support/figs/metadata.png
SEESenv/web/html/support/figs/mq-stack.png
SEESenv/web/html/support/figs/note.png
SEESenv/web/html/support/figs/revlog.png
SEESenv/web/html/support/figs/rss.png
SEESenv/web/html/support/figs/snapshot.png
SEESenv/web/html/support/figs/tip.png
SEESenv/web/html/support/figs/tour-history.png
SEESenv/web/html/support/figs/tour-merge-conflict.png
SEESenv/web/html/support/figs/tour-merge-merge.png
SEESenv/web/html/support/figs/tour-merge-pull.png
SEESenv/web/html/support/figs/tour-merge-sep-repos.png
SEESenv/web/html/support/figs/undo-manual-merge.png
SEESenv/web/html/support/figs/undo-manual.png
SEESenv/web/html/support/figs/undo-non-tip.png
SEESenv/web/html/support/figs/undo-simple.png
SEESenv/web/html/support/figs/wdir-after-commit.png
SEESenv/web/html/support/figs/wdir-branch.png
SEESenv/web/html/support/figs/wdir-merge.png
SEESenv/web/html/support/figs/wdir-pre-branch.png
SEESenv/web/html/support/figs/wdir.png
SEESenv/web/html/support/form-min.js
SEESenv/web/html/support/form.js
SEESenv/web/html/support/hsbook.js
SEESenv/web/html/support/icons/caution.png
SEESenv/web/html/support/icons/favicon.png
SEESenv/web/html/support/icons/important.png
SEESenv/web/html/support/icons/note.png
SEESenv/web/html/support/icons/remark.png
SEESenv/web/html/support/icons/rss.png
SEESenv/web/html/support/icons/shell.png
SEESenv/web/html/support/icons/source.png
SEESenv/web/html/support/icons/throbber.gif
SEESenv/web/html/support/icons/tip.png
SEESenv/web/html/support/icons/warning.png
SEESenv/web/html/support/javascript/form-min.js
SEESenv/web/html/support/javascript/form.js
SEESenv/web/html/support/javascript/hsbook.js
SEESenv/web/html/support/javascript/jquery-min.js
SEESenv/web/html/support/javascript/jquery.js
SEESenv/web/html/support/jquery-min.js
SEESenv/web/html/support/jquery.js
SEESenv/web/html/support/styles.css
SEESenv/web/html/support/styles/styles.css
SEESenv/web/index.html.in
SEESenv/web/javascript/hsbook.js
SEESenv/web/robots.txt
SEESenv/web/support/figs/bad-merge-1.png
SEESenv/web/support/figs/bad-merge-2.png
SEESenv/web/support/figs/bad-merge-3.png
SEESenv/web/support/figs/bad-merge-4.png
SEESenv/web/support/figs/bad-merge-5.png
SEESenv/web/support/figs/caution.png
SEESenv/web/support/figs/feature-branches.png
SEESenv/web/support/figs/filelog.png
SEESenv/web/support/figs/kdiff3.png
SEESenv/web/support/figs/metadata.png
SEESenv/web/support/figs/mq-stack.png
SEESenv/web/support/figs/note.png
SEESenv/web/support/figs/revlog.png
SEESenv/web/support/figs/rss.png
SEESenv/web/support/figs/snapshot.png
SEESenv/web/support/figs/tip.png
SEESenv/web/support/figs/tour-history.png
SEESenv/web/support/figs/tour-merge-conflict.png
SEESenv/web/support/figs/tour-merge-merge.png
SEESenv/web/support/figs/tour-merge-pull.png
SEESenv/web/support/figs/tour-merge-sep-repos.png
SEESenv/web/support/figs/undo-manual-merge.png
SEESenv/web/support/figs/undo-manual.png
SEESenv/web/support/figs/undo-non-tip.png
SEESenv/web/support/figs/undo-simple.png
SEESenv/web/support/figs/wdir-after-commit.png
SEESenv/web/support/figs/wdir-branch.png
SEESenv/web/support/figs/wdir-merge.png
SEESenv/web/support/figs/wdir-pre-branch.png
SEESenv/web/support/figs/wdir.png
SEESenv/web/support/form-min.js
SEESenv/web/support/form.js
SEESenv/web/support/form.js~
SEESenv/web/support/hsbook.js
SEESenv/web/support/hsbook.js~
SEESenv/web/support/icons/caution.png
SEESenv/web/support/icons/favicon.png
SEESenv/web/support/icons/important.png
SEESenv/web/support/icons/note.png
SEESenv/web/support/icons/remark.png
SEESenv/web/support/icons/rss.png
SEESenv/web/support/icons/shell.png
SEESenv/web/support/icons/source.png
SEESenv/web/support/icons/throbber.gif
SEESenv/web/support/icons/tip.png
SEESenv/web/support/icons/warning.png
SEESenv/web/support/javascript/form-min.js
SEESenv/web/support/javascript/form.js
SEESenv/web/support/javascript/hsbook.js
SEESenv/web/support/javascript/jquery-min.js
SEESenv/web/support/javascript/jquery.js
SEESenv/web/support/jquery-min.js
SEESenv/web/support/jquery.js
SEESenv/web/support/styles.css
SEESenv/web/support/styles/styles.css
SEESenv/web/texpand.py
SEESenv/web/texpand.py~
scripts/autoid.py
scripts/docbook2html.py
scripts/html-single.xsl
scripts/index.config
scripts/myrst2xml.py
scripts/p_list.py
scripts/rst2docbook.py
web/README
web/genindex.py
web/hgbook.conf
web/hgbook.conf~
web/hgbook/.database.sqlite3
web/hgbook/__init__.py
web/hgbook/__init__.pyc
web/hgbook/admin.py
web/hgbook/admin.pyc
web/hgbook/admin.py~
web/hgbook/comments/__init__.py
web/hgbook/comments/__init__.pyc
web/hgbook/comments/feeds.py
web/hgbook/comments/feeds.pyc
web/hgbook/comments/models.py
web/hgbook/comments/models.pyc
web/hgbook/comments/models.py~
web/hgbook/comments/p_list.py
web/hgbook/comments/p_list.pyc
web/hgbook/comments/p_list.py~
web/hgbook/comments/sql/comment.mysql.sql
web/hgbook/comments/sql/element.mysql.sql
web/hgbook/comments/test
web/hgbook/comments/test~
web/hgbook/comments/urls.py
web/hgbook/comments/urls.pyc
web/hgbook/comments/urls.py~
web/hgbook/comments/views.py
web/hgbook/comments/views.pyc
web/hgbook/comments/views.py~
web/hgbook/converter.py
web/hgbook/dbutil.py
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/flintlock
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/iamflint
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/position.DB
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/position.baseA
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/position.baseB
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/postlist.DB
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/postlist.baseA
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/postlist.baseB
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/record.DB
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/record.baseA
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/record.baseB
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/spelling.DB
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/spelling.baseA
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/spelling.baseB
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/termlist.DB
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/termlist.baseA
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/termlist.baseB
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/value.DB
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/value.baseA
web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/value.baseB
web/hgbook/load_elements.py
web/hgbook/manage.py
web/hgbook/reviewers.py
web/hgbook/run.wsgi
web/hgbook/run.wsgi~
web/hgbook/secrets.py.gpg
web/hgbook/settings.py
web/hgbook/settings.pyc
web/hgbook/settings.py~
web/hgbook/templates/404.html
web/hgbook/templates/500.html
web/hgbook/templates/boilerplate.html
web/hgbook/templates/comment.html
web/hgbook/templates/comment.html~
web/hgbook/templates/feeds/comments_description.html
web/hgbook/templates/feeds/comments_title.html
web/hgbook/templates/index.html
web/hgbook/templates/index.html~
web/hgbook/templates/simple.html
web/hgbook/templates/single_com.html
web/hgbook/templates/single_com.html~
web/hgbook/urls.py
web/hgbook/urls.pyc
web/hgbook/urls.py~
web/html/backup/abc.html
web/html/backup/abc.py
web/html/backup/abcd.html
web/html/backup/ar01.html
web/html/backup/autoid.py
web/html/backup/ch01-intro.html
web/html/backup/ch02-list_tuples.html
web/html/backup/ch03-oop.html
web/html/backup/chap_intro.py
web/html/backup/func.html
web/html/backup/paragraphlist.py
web/html/ch1Introduction.html
web/html/ch2intro.html
web/html/ch4strings_dicts.html
web/html/ch5func.html
web/html/ch6oop.html
web/html/ch7interim_assessment.html
web/html/ch8ult_module_plan.html
web/html/ch9Using_Linux_Tools.html
web/html/chn10session4.html
web/html/chn11Section_5.html
web/html/support/figs/bad-merge-1.png
web/html/support/figs/bad-merge-2.png
web/html/support/figs/bad-merge-3.png
web/html/support/figs/bad-merge-4.png
web/html/support/figs/bad-merge-5.png
web/html/support/figs/caution.png
web/html/support/figs/feature-branches.png
web/html/support/figs/filelog.png
web/html/support/figs/kdiff3.png
web/html/support/figs/metadata.png
web/html/support/figs/mq-stack.png
web/html/support/figs/note.png
web/html/support/figs/revlog.png
web/html/support/figs/rss.png
web/html/support/figs/snapshot.png
web/html/support/figs/tip.png
web/html/support/figs/tour-history.png
web/html/support/figs/tour-merge-conflict.png
web/html/support/figs/tour-merge-merge.png
web/html/support/figs/tour-merge-pull.png
web/html/support/figs/tour-merge-sep-repos.png
web/html/support/figs/undo-manual-merge.png
web/html/support/figs/undo-manual.png
web/html/support/figs/undo-non-tip.png
web/html/support/figs/undo-simple.png
web/html/support/figs/wdir-after-commit.png
web/html/support/figs/wdir-branch.png
web/html/support/figs/wdir-merge.png
web/html/support/figs/wdir-pre-branch.png
web/html/support/figs/wdir.png
web/html/support/form-min.js
web/html/support/form.js
web/html/support/hsbook.js
web/html/support/icons/caution.png
web/html/support/icons/favicon.png
web/html/support/icons/important.png
web/html/support/icons/note.png
web/html/support/icons/remark.png
web/html/support/icons/rss.png
web/html/support/icons/shell.png
web/html/support/icons/source.png
web/html/support/icons/throbber.gif
web/html/support/icons/tip.png
web/html/support/icons/warning.png
web/html/support/javascript/form-min.js
web/html/support/javascript/form.js
web/html/support/javascript/hsbook.js
web/html/support/javascript/jquery-min.js
web/html/support/javascript/jquery.js
web/html/support/jquery-min.js
web/html/support/jquery.js
web/html/support/styles.css
web/html/support/styles/styles.css
web/index.html.in
web/javascript/hsbook.js
web/robots.txt
web/support/figs/bad-merge-1.png
web/support/figs/bad-merge-2.png
web/support/figs/bad-merge-3.png
web/support/figs/bad-merge-4.png
web/support/figs/bad-merge-5.png
web/support/figs/caution.png
web/support/figs/feature-branches.png
web/support/figs/filelog.png
web/support/figs/kdiff3.png
web/support/figs/metadata.png
web/support/figs/mq-stack.png
web/support/figs/note.png
web/support/figs/revlog.png
web/support/figs/rss.png
web/support/figs/snapshot.png
web/support/figs/tip.png
web/support/figs/tour-history.png
web/support/figs/tour-merge-conflict.png
web/support/figs/tour-merge-merge.png
web/support/figs/tour-merge-pull.png
web/support/figs/tour-merge-sep-repos.png
web/support/figs/undo-manual-merge.png
web/support/figs/undo-manual.png
web/support/figs/undo-non-tip.png
web/support/figs/undo-simple.png
web/support/figs/wdir-after-commit.png
web/support/figs/wdir-branch.png
web/support/figs/wdir-merge.png
web/support/figs/wdir-pre-branch.png
web/support/figs/wdir.png
web/support/form-min.js
web/support/form.js
web/support/form.js~
web/support/hsbook.js
web/support/hsbook.js~
web/support/icons/caution.png
web/support/icons/favicon.png
web/support/icons/important.png
web/support/icons/note.png
web/support/icons/remark.png
web/support/icons/rss.png
web/support/icons/shell.png
web/support/icons/source.png
web/support/icons/throbber.gif
web/support/icons/tip.png
web/support/icons/warning.png
web/support/javascript/form-min.js
web/support/javascript/form.js
web/support/javascript/hsbook.js
web/support/javascript/jquery-min.js
web/support/javascript/jquery.js
web/support/jquery-min.js
web/support/jquery.js
web/support/styles.css
web/support/styles/styles.css
web/texpand.py
web/texpand.py~
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/scripts/autoid.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+#
+# Add unique ID attributes to para tags.  This script should only be
+# run by one person, since otherwise it introduces the possibility of
+# chaotic conflicts among tags.
+
+import glob, os, re, sys
+
+tagged = re.compile('<para[^>]* id="x_([0-9a-f]+)"[^>]*>', re.M)
+untagged = re.compile('<para>')
+
+names = glob.glob('ch*.docbook') 
+# First pass: find the highest-numbered paragraph ID.
+
+
+chapter=None
+seen = set()
+errs = 0
+beginning="p_list= "
+
+id_file=open('p_list.py','w')
+dictionary={}
+id_list=[]
+for name in names:
+    for m in tagged.finditer(open(name).read()):
+        i = int(m.group(1),16)
+        if i in seen:
+            print >> sys.stderr, '%s: duplication of ID %s' % (name, i)
+            errs += 1
+        seen.add(i)
+        if i > biggest_id:
+            biggest_id = i
+
+
+def retag(s):
+    global biggest_id
+    global chapter   
+    biggest_id += 1
+     
+    id_name="%s_%x" % (chapter,biggest_id)   
+    id_list.append(id_name)    
+    
+    return '<para id="%s">' %id_name
+
+# Second pass: add IDs to paragraphs that currently lack them.
+
+for name in names:
+    biggest_id=0 
+    chapter=name.split('.')[0]    
+    id_list=[]    
+    f = open(name).read()
+    f1 = untagged.sub(retag, f )
+    dictionary[chapter]=id_list       
+    if f1 != f:
+        tmpname = name + '.tmp'
+        fp = open(tmpname, 'w')
+        fp.write(f1)
+        fp.close()
+        os.rename(tmpname, name)
+p_lists_string=beginning+str(dictionary)
+id_file.write(p_lists_string)
+sys.exit(errs)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/scripts/docbook2html.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,9 @@
+import glob, os, re, sys
+import subprocess
+import time
+names = glob.glob('ch*.docbook')
+for name in names:
+	command="xsltproc html-single.xsl %s > %s.html" %(name ,name.split('.')[0])
+	print command	
+	subprocess.Popen(command,shell=True)
+	time.sleep(10)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/scripts/html-single.xsl	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
+
+  <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
+
+  <xsl:param name="draft.mode" select="no"/>
+
+  <!-- xsltproc can't support these extensions
+  <xsl:param name="use.extensions">1</xsl:param>
+  <xsl:param name="callouts.extension">1</xsl:param>
+  <xsl:param name="linenumbering.extension">1</xsl:param>
+  <xsl:param name="tablecolumns.extension">1</xsl:param>
+  <xsl:param name="textinsert.extension">1</xsl:param>
+  -->
+
+  <xsl:param name="admon.graphics" select="1" />
+  <xsl:param name="admon.graphics.extension">.png</xsl:param>
+  <xsl:param name="admon.graphics.path">figs/</xsl:param>
+  <xsl:param name="callout.graphics" select="1" />
+  <xsl:param name="callout.graphics.extension">.png</xsl:param>
+  <xsl:param name="callout.graphics.path">images/callouts/</xsl:param>
+
+  <xsl:param name="section.autolabel" select="1" />
+  <xsl:param name="section.label.includes.component.label">1</xsl:param>
+
+  <xsl:output method="html" encoding="utf-8" indent="yes"/>     <!-- html only -->
+  <xsl:param name="use.id.as.filename">0</xsl:param>            <!-- html only -->
+  <xsl:param name="chunk.section.depth">0</xsl:param>           <!-- html only -->
+  <xsl:param name="chunker.output.indent">yes</xsl:param>       <!-- html only -->
+  <xsl:param name="html.stylesheet">hgbook.css</xsl:param>      <!-- html only -->
+
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/scripts/index.config	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,14 @@
+Introduction/Introduction.rst
+basic_python/intro.rst	
+basic_python/list_tuples.rst
+basic_python/strings_dicts.rst
+basic_python/func.rst
+basic_python/oop.rst
+basic_python/interim_assessment.rst
+ult/ult_module_plan.rst
+ult/Using_Linux_Tools.rst
+ult/session4.rst
+ult/Section_5.rst
+versionControl/index.rst
+versionControl/versionControl.rst
+versionControl/handOut.rst
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/scripts/myrst2xml.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,88 @@
+#!/usr/bin/python
+"""
+Just a hack to convert rst to xml and then docbook . 
+May not containt all the required elements of a docbook .
+Just done to make it run for the specific rst for our 
+sees documentation.
+"""
+import xml.etree.ElementTree as ET
+import os 
+import re
+import subprocess
+import os
+import pkg_resources
+import time
+from docutils.core import publish_file 
+chapterno=0
+
+
+
+
+
+
+
+
+
+def convert2xml(file):
+#    print folder,subfolder,file
+    file=file.split("\n")[0]
+    file= file.split("\t")[0]  
+    global chapterno
+    name=file.split('/')[-1]
+    name='ch'+str(chapterno)+name.split('.')[0]
+#    full_file=os.path.join(folder,file)    
+#    if file.endswith('.rst'):    
+    print file	    
+    xml_file=name+'.xml'        
+    a=open(xml_file,'w')
+#    a.close()
+#    command="rst2xml.py %s > %s" %(file , xml_file)
+          
+#    a=subprocess.Popen(command , shell=True)
+#    time.sleep(10) 	   	
+#    a.kill()
+    publish_file(source_path=file, destination_path=xml_file,parser_name='restructuredtext', writer_name='xml') 
+def walk(repo):
+    global chapterno
+    mainfolder='/home/amit/sttp_latest/'    
+    for readline in open('index.config','r').readlines():
+        chapterno+=1		
+        filename=mainfolder+readline
+        convert2xml(filename)
+
+
+
+
+
+if __name__=='__main__':
+    repo='/home/amit/sphinxvirt/review/'
+    walk(repo)
+#    convert(1,2,3)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/scripts/p_list.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1 @@
+p_list= {'ch12index': [], 'ch6oop': ['ch6oop_1', 'ch6oop_2', 'ch6oop_3', 'ch6oop_4', 'ch6oop_5', 'ch6oop_6'], 'ch9Using_Linux_Tools': ['ch9Using_Linux_Tools_1', 'ch9Using_Linux_Tools_2', 'ch9Using_Linux_Tools_3', 'ch9Using_Linux_Tools_4', 'ch9Using_Linux_Tools_5', 'ch9Using_Linux_Tools_6', 'ch9Using_Linux_Tools_7', 'ch9Using_Linux_Tools_8', 'ch9Using_Linux_Tools_9', 'ch9Using_Linux_Tools_a', 'ch9Using_Linux_Tools_b', 'ch9Using_Linux_Tools_c', 'ch9Using_Linux_Tools_d', 'ch9Using_Linux_Tools_e', 'ch9Using_Linux_Tools_f', 'ch9Using_Linux_Tools_10', 'ch9Using_Linux_Tools_11', 'ch9Using_Linux_Tools_12', 'ch9Using_Linux_Tools_13', 'ch9Using_Linux_Tools_14', 'ch9Using_Linux_Tools_15', 'ch9Using_Linux_Tools_16', 'ch9Using_Linux_Tools_17', 'ch9Using_Linux_Tools_18', 'ch9Using_Linux_Tools_19', 'ch9Using_Linux_Tools_1a', 'ch9Using_Linux_Tools_1b', 'ch9Using_Linux_Tools_1c', 'ch9Using_Linux_Tools_1d', 'ch9Using_Linux_Tools_1e', 'ch9Using_Linux_Tools_1f', 'ch9Using_Linux_Tools_20', 'ch9Using_Linux_Tools_21', 'ch9Using_Linux_Tools_22', 'ch9Using_Linux_Tools_23', 'ch9Using_Linux_Tools_24', 'ch9Using_Linux_Tools_25', 'ch9Using_Linux_Tools_26', 'ch9Using_Linux_Tools_27', 'ch9Using_Linux_Tools_28', 'ch9Using_Linux_Tools_29', 'ch9Using_Linux_Tools_2a', 'ch9Using_Linux_Tools_2b', 'ch9Using_Linux_Tools_2c', 'ch9Using_Linux_Tools_2d', 'ch9Using_Linux_Tools_2e', 'ch9Using_Linux_Tools_2f', 'ch9Using_Linux_Tools_30', 'ch9Using_Linux_Tools_31', 'ch9Using_Linux_Tools_32', 'ch9Using_Linux_Tools_33', 'ch9Using_Linux_Tools_34', 'ch9Using_Linux_Tools_35', 'ch9Using_Linux_Tools_36', 'ch9Using_Linux_Tools_37', 'ch9Using_Linux_Tools_38', 'ch9Using_Linux_Tools_39', 'ch9Using_Linux_Tools_3a', 'ch9Using_Linux_Tools_3b', 'ch9Using_Linux_Tools_3c', 'ch9Using_Linux_Tools_3d', 'ch9Using_Linux_Tools_3e', 'ch9Using_Linux_Tools_3f', 'ch9Using_Linux_Tools_40', 'ch9Using_Linux_Tools_41', 'ch9Using_Linux_Tools_42', 'ch9Using_Linux_Tools_43', 'ch9Using_Linux_Tools_44', 'ch9Using_Linux_Tools_45', 'ch9Using_Linux_Tools_46', 'ch9Using_Linux_Tools_47', 'ch9Using_Linux_Tools_48', 'ch9Using_Linux_Tools_49', 'ch9Using_Linux_Tools_4a', 'ch9Using_Linux_Tools_4b', 'ch9Using_Linux_Tools_4c', 'ch9Using_Linux_Tools_4d', 'ch9Using_Linux_Tools_4e', 'ch9Using_Linux_Tools_4f', 'ch9Using_Linux_Tools_50', 'ch9Using_Linux_Tools_51', 'ch9Using_Linux_Tools_52', 'ch9Using_Linux_Tools_53', 'ch9Using_Linux_Tools_54', 'ch9Using_Linux_Tools_55', 'ch9Using_Linux_Tools_56', 'ch9Using_Linux_Tools_57', 'ch9Using_Linux_Tools_58', 'ch9Using_Linux_Tools_59', 'ch9Using_Linux_Tools_5a', 'ch9Using_Linux_Tools_5b', 'ch9Using_Linux_Tools_5c', 'ch9Using_Linux_Tools_5d', 'ch9Using_Linux_Tools_5e', 'ch9Using_Linux_Tools_5f', 'ch9Using_Linux_Tools_60', 'ch9Using_Linux_Tools_61', 'ch9Using_Linux_Tools_62', 'ch9Using_Linux_Tools_63', 'ch9Using_Linux_Tools_64', 'ch9Using_Linux_Tools_65', 'ch9Using_Linux_Tools_66', 'ch9Using_Linux_Tools_67', 'ch9Using_Linux_Tools_68', 'ch9Using_Linux_Tools_69', 'ch9Using_Linux_Tools_6a', 'ch9Using_Linux_Tools_6b', 'ch9Using_Linux_Tools_6c', 'ch9Using_Linux_Tools_6d', 'ch9Using_Linux_Tools_6e', 'ch9Using_Linux_Tools_6f', 'ch9Using_Linux_Tools_70', 'ch9Using_Linux_Tools_71', 'ch9Using_Linux_Tools_72', 'ch9Using_Linux_Tools_73', 'ch9Using_Linux_Tools_74', 'ch9Using_Linux_Tools_75', 'ch9Using_Linux_Tools_76', 'ch9Using_Linux_Tools_77', 'ch9Using_Linux_Tools_78', 'ch9Using_Linux_Tools_79', 'ch9Using_Linux_Tools_7a', 'ch9Using_Linux_Tools_7b', 'ch9Using_Linux_Tools_7c', 'ch9Using_Linux_Tools_7d', 'ch9Using_Linux_Tools_7e', 'ch9Using_Linux_Tools_7f', 'ch9Using_Linux_Tools_80', 'ch9Using_Linux_Tools_81', 'ch9Using_Linux_Tools_82', 'ch9Using_Linux_Tools_83', 'ch9Using_Linux_Tools_84', 'ch9Using_Linux_Tools_85', 'ch9Using_Linux_Tools_86', 'ch9Using_Linux_Tools_87', 'ch9Using_Linux_Tools_88', 'ch9Using_Linux_Tools_89', 'ch9Using_Linux_Tools_8a', 'ch9Using_Linux_Tools_8b', 'ch9Using_Linux_Tools_8c', 'ch9Using_Linux_Tools_8d', 'ch9Using_Linux_Tools_8e', 'ch9Using_Linux_Tools_8f', 'ch9Using_Linux_Tools_90', 'ch9Using_Linux_Tools_91', 'ch9Using_Linux_Tools_92', 'ch9Using_Linux_Tools_93', 'ch9Using_Linux_Tools_94', 'ch9Using_Linux_Tools_95', 'ch9Using_Linux_Tools_96', 'ch9Using_Linux_Tools_97', 'ch9Using_Linux_Tools_98', 'ch9Using_Linux_Tools_99', 'ch9Using_Linux_Tools_9a', 'ch9Using_Linux_Tools_9b', 'ch9Using_Linux_Tools_9c', 'ch9Using_Linux_Tools_9d', 'ch9Using_Linux_Tools_9e', 'ch9Using_Linux_Tools_9f', 'ch9Using_Linux_Tools_a0', 'ch9Using_Linux_Tools_a1', 'ch9Using_Linux_Tools_a2', 'ch9Using_Linux_Tools_a3', 'ch9Using_Linux_Tools_a4', 'ch9Using_Linux_Tools_a5', 'ch9Using_Linux_Tools_a6', 'ch9Using_Linux_Tools_a7', 'ch9Using_Linux_Tools_a8', 'ch9Using_Linux_Tools_a9', 'ch9Using_Linux_Tools_aa', 'ch9Using_Linux_Tools_ab', 'ch9Using_Linux_Tools_ac', 'ch9Using_Linux_Tools_ad', 'ch9Using_Linux_Tools_ae', 'ch9Using_Linux_Tools_af', 'ch9Using_Linux_Tools_b0', 'ch9Using_Linux_Tools_b1', 'ch9Using_Linux_Tools_b2', 'ch9Using_Linux_Tools_b3', 'ch9Using_Linux_Tools_b4', 'ch9Using_Linux_Tools_b5', 'ch9Using_Linux_Tools_b6', 'ch9Using_Linux_Tools_b7', 'ch9Using_Linux_Tools_b8', 'ch9Using_Linux_Tools_b9', 'ch9Using_Linux_Tools_ba', 'ch9Using_Linux_Tools_bb', 'ch9Using_Linux_Tools_bc', 'ch9Using_Linux_Tools_bd', 'ch9Using_Linux_Tools_be', 'ch9Using_Linux_Tools_bf', 'ch9Using_Linux_Tools_c0', 'ch9Using_Linux_Tools_c1', 'ch9Using_Linux_Tools_c2', 'ch9Using_Linux_Tools_c3', 'ch9Using_Linux_Tools_c4', 'ch9Using_Linux_Tools_c5', 'ch9Using_Linux_Tools_c6', 'ch9Using_Linux_Tools_c7', 'ch9Using_Linux_Tools_c8', 'ch9Using_Linux_Tools_c9', 'ch9Using_Linux_Tools_ca', 'ch9Using_Linux_Tools_cb', 'ch9Using_Linux_Tools_cc', 'ch9Using_Linux_Tools_cd', 'ch9Using_Linux_Tools_ce', 'ch9Using_Linux_Tools_cf', 'ch9Using_Linux_Tools_d0', 'ch9Using_Linux_Tools_d1', 'ch9Using_Linux_Tools_d2', 'ch9Using_Linux_Tools_d3', 'ch9Using_Linux_Tools_d4', 'ch9Using_Linux_Tools_d5', 'ch9Using_Linux_Tools_d6', 'ch9Using_Linux_Tools_d7', 'ch9Using_Linux_Tools_d8', 'ch9Using_Linux_Tools_d9', 'ch9Using_Linux_Tools_da', 'ch9Using_Linux_Tools_db', 'ch9Using_Linux_Tools_dc', 'ch9Using_Linux_Tools_dd', 'ch9Using_Linux_Tools_de', 'ch9Using_Linux_Tools_df', 'ch9Using_Linux_Tools_e0', 'ch9Using_Linux_Tools_e1', 'ch9Using_Linux_Tools_e2', 'ch9Using_Linux_Tools_e3', 'ch9Using_Linux_Tools_e4', 'ch9Using_Linux_Tools_e5', 'ch9Using_Linux_Tools_e6', 'ch9Using_Linux_Tools_e7', 'ch9Using_Linux_Tools_e8', 'ch9Using_Linux_Tools_e9', 'ch9Using_Linux_Tools_ea', 'ch9Using_Linux_Tools_eb', 'ch9Using_Linux_Tools_ec', 'ch9Using_Linux_Tools_ed', 'ch9Using_Linux_Tools_ee', 'ch9Using_Linux_Tools_ef', 'ch9Using_Linux_Tools_f0', 'ch9Using_Linux_Tools_f1', 'ch9Using_Linux_Tools_f2', 'ch9Using_Linux_Tools_f3', 'ch9Using_Linux_Tools_f4', 'ch9Using_Linux_Tools_f5', 'ch9Using_Linux_Tools_f6', 'ch9Using_Linux_Tools_f7', 'ch9Using_Linux_Tools_f8', 'ch9Using_Linux_Tools_f9', 'ch9Using_Linux_Tools_fa', 'ch9Using_Linux_Tools_fb', 'ch9Using_Linux_Tools_fc', 'ch9Using_Linux_Tools_fd', 'ch9Using_Linux_Tools_fe', 'ch9Using_Linux_Tools_ff', 'ch9Using_Linux_Tools_100', 'ch9Using_Linux_Tools_101', 'ch9Using_Linux_Tools_102', 'ch9Using_Linux_Tools_103', 'ch9Using_Linux_Tools_104', 'ch9Using_Linux_Tools_105', 'ch9Using_Linux_Tools_106', 'ch9Using_Linux_Tools_107', 'ch9Using_Linux_Tools_108', 'ch9Using_Linux_Tools_109', 'ch9Using_Linux_Tools_10a', 'ch9Using_Linux_Tools_10b', 'ch9Using_Linux_Tools_10c', 'ch9Using_Linux_Tools_10d', 'ch9Using_Linux_Tools_10e', 'ch9Using_Linux_Tools_10f', 'ch9Using_Linux_Tools_110', 'ch9Using_Linux_Tools_111', 'ch9Using_Linux_Tools_112', 'ch9Using_Linux_Tools_113', 'ch9Using_Linux_Tools_114', 'ch9Using_Linux_Tools_115', 'ch9Using_Linux_Tools_116', 'ch9Using_Linux_Tools_117', 'ch9Using_Linux_Tools_118', 'ch9Using_Linux_Tools_119', 'ch9Using_Linux_Tools_11a', 'ch9Using_Linux_Tools_11b', 'ch9Using_Linux_Tools_11c', 'ch9Using_Linux_Tools_11d', 'ch9Using_Linux_Tools_11e', 'ch9Using_Linux_Tools_11f', 'ch9Using_Linux_Tools_120', 'ch9Using_Linux_Tools_121', 'ch9Using_Linux_Tools_122', 'ch9Using_Linux_Tools_123', 'ch9Using_Linux_Tools_124', 'ch9Using_Linux_Tools_125', 'ch9Using_Linux_Tools_126', 'ch9Using_Linux_Tools_127', 'ch9Using_Linux_Tools_128', 'ch9Using_Linux_Tools_129', 'ch9Using_Linux_Tools_12a', 'ch9Using_Linux_Tools_12b', 'ch9Using_Linux_Tools_12c', 'ch9Using_Linux_Tools_12d', 'ch9Using_Linux_Tools_12e', 'ch9Using_Linux_Tools_12f', 'ch9Using_Linux_Tools_130', 'ch9Using_Linux_Tools_131', 'ch9Using_Linux_Tools_132', 'ch9Using_Linux_Tools_133', 'ch9Using_Linux_Tools_134', 'ch9Using_Linux_Tools_135', 'ch9Using_Linux_Tools_136', 'ch9Using_Linux_Tools_137', 'ch9Using_Linux_Tools_138', 'ch9Using_Linux_Tools_139', 'ch9Using_Linux_Tools_13a', 'ch9Using_Linux_Tools_13b', 'ch9Using_Linux_Tools_13c', 'ch9Using_Linux_Tools_13d', 'ch9Using_Linux_Tools_13e', 'ch9Using_Linux_Tools_13f', 'ch9Using_Linux_Tools_140', 'ch9Using_Linux_Tools_141', 'ch9Using_Linux_Tools_142', 'ch9Using_Linux_Tools_143', 'ch9Using_Linux_Tools_144', 'ch9Using_Linux_Tools_145', 'ch9Using_Linux_Tools_146', 'ch9Using_Linux_Tools_147', 'ch9Using_Linux_Tools_148', 'ch9Using_Linux_Tools_149', 'ch9Using_Linux_Tools_14a', 'ch9Using_Linux_Tools_14b', 'ch9Using_Linux_Tools_14c', 'ch9Using_Linux_Tools_14d', 'ch9Using_Linux_Tools_14e', 'ch9Using_Linux_Tools_14f', 'ch9Using_Linux_Tools_150', 'ch9Using_Linux_Tools_151', 'ch9Using_Linux_Tools_152', 'ch9Using_Linux_Tools_153', 'ch9Using_Linux_Tools_154', 'ch9Using_Linux_Tools_155', 'ch9Using_Linux_Tools_156', 'ch9Using_Linux_Tools_157', 'ch9Using_Linux_Tools_158', 'ch9Using_Linux_Tools_159', 'ch9Using_Linux_Tools_15a', 'ch9Using_Linux_Tools_15b', 'ch9Using_Linux_Tools_15c', 'ch9Using_Linux_Tools_15d', 'ch9Using_Linux_Tools_15e', 'ch9Using_Linux_Tools_15f', 'ch9Using_Linux_Tools_160', 'ch9Using_Linux_Tools_161', 'ch9Using_Linux_Tools_162', 'ch9Using_Linux_Tools_163', 'ch9Using_Linux_Tools_164', 'ch9Using_Linux_Tools_165', 'ch9Using_Linux_Tools_166', 'ch9Using_Linux_Tools_167', 'ch9Using_Linux_Tools_168', 'ch9Using_Linux_Tools_169', 'ch9Using_Linux_Tools_16a', 'ch9Using_Linux_Tools_16b', 'ch9Using_Linux_Tools_16c', 'ch9Using_Linux_Tools_16d', 'ch9Using_Linux_Tools_16e', 'ch9Using_Linux_Tools_16f', 'ch9Using_Linux_Tools_170', 'ch9Using_Linux_Tools_171', 'ch9Using_Linux_Tools_172', 'ch9Using_Linux_Tools_173', 'ch9Using_Linux_Tools_174', 'ch9Using_Linux_Tools_175', 'ch9Using_Linux_Tools_176', 'ch9Using_Linux_Tools_177', 'ch9Using_Linux_Tools_178', 'ch9Using_Linux_Tools_179', 'ch9Using_Linux_Tools_17a', 'ch9Using_Linux_Tools_17b', 'ch9Using_Linux_Tools_17c', 'ch9Using_Linux_Tools_17d', 'ch9Using_Linux_Tools_17e', 'ch9Using_Linux_Tools_17f', 'ch9Using_Linux_Tools_180', 'ch9Using_Linux_Tools_181', 'ch9Using_Linux_Tools_182', 'ch9Using_Linux_Tools_183', 'ch9Using_Linux_Tools_184', 'ch9Using_Linux_Tools_185', 'ch9Using_Linux_Tools_186', 'ch9Using_Linux_Tools_187', 'ch9Using_Linux_Tools_188', 'ch9Using_Linux_Tools_189', 'ch9Using_Linux_Tools_18a', 'ch9Using_Linux_Tools_18b', 'ch9Using_Linux_Tools_18c', 'ch9Using_Linux_Tools_18d', 'ch9Using_Linux_Tools_18e', 'ch9Using_Linux_Tools_18f', 'ch9Using_Linux_Tools_190', 'ch9Using_Linux_Tools_191', 'ch9Using_Linux_Tools_192', 'ch9Using_Linux_Tools_193', 'ch9Using_Linux_Tools_194', 'ch9Using_Linux_Tools_195', 'ch9Using_Linux_Tools_196', 'ch9Using_Linux_Tools_197', 'ch9Using_Linux_Tools_198', 'ch9Using_Linux_Tools_199', 'ch9Using_Linux_Tools_19a', 'ch9Using_Linux_Tools_19b', 'ch9Using_Linux_Tools_19c', 'ch9Using_Linux_Tools_19d', 'ch9Using_Linux_Tools_19e', 'ch9Using_Linux_Tools_19f', 'ch9Using_Linux_Tools_1a0', 'ch9Using_Linux_Tools_1a1', 'ch9Using_Linux_Tools_1a2', 'ch9Using_Linux_Tools_1a3', 'ch9Using_Linux_Tools_1a4', 'ch9Using_Linux_Tools_1a5', 'ch9Using_Linux_Tools_1a6', 'ch9Using_Linux_Tools_1a7', 'ch9Using_Linux_Tools_1a8', 'ch9Using_Linux_Tools_1a9', 'ch9Using_Linux_Tools_1aa', 'ch9Using_Linux_Tools_1ab', 'ch9Using_Linux_Tools_1ac', 'ch9Using_Linux_Tools_1ad', 'ch9Using_Linux_Tools_1ae', 'ch9Using_Linux_Tools_1af', 'ch9Using_Linux_Tools_1b0', 'ch9Using_Linux_Tools_1b1', 'ch9Using_Linux_Tools_1b2', 'ch9Using_Linux_Tools_1b3', 'ch9Using_Linux_Tools_1b4', 'ch9Using_Linux_Tools_1b5', 'ch9Using_Linux_Tools_1b6', 'ch9Using_Linux_Tools_1b7', 'ch9Using_Linux_Tools_1b8', 'ch9Using_Linux_Tools_1b9', 'ch9Using_Linux_Tools_1ba', 'ch9Using_Linux_Tools_1bb', 'ch9Using_Linux_Tools_1bc', 'ch9Using_Linux_Tools_1bd', 'ch9Using_Linux_Tools_1be', 'ch9Using_Linux_Tools_1bf', 'ch9Using_Linux_Tools_1c0', 'ch9Using_Linux_Tools_1c1', 'ch9Using_Linux_Tools_1c2', 'ch9Using_Linux_Tools_1c3', 'ch9Using_Linux_Tools_1c4', 'ch9Using_Linux_Tools_1c5', 'ch9Using_Linux_Tools_1c6', 'ch9Using_Linux_Tools_1c7', 'ch9Using_Linux_Tools_1c8', 'ch9Using_Linux_Tools_1c9', 'ch9Using_Linux_Tools_1ca', 'ch9Using_Linux_Tools_1cb', 'ch9Using_Linux_Tools_1cc', 'ch9Using_Linux_Tools_1cd', 'ch9Using_Linux_Tools_1ce', 'ch9Using_Linux_Tools_1cf', 'ch9Using_Linux_Tools_1d0', 'ch9Using_Linux_Tools_1d1', 'ch9Using_Linux_Tools_1d2', 'ch9Using_Linux_Tools_1d3', 'ch9Using_Linux_Tools_1d4', 'ch9Using_Linux_Tools_1d5', 'ch9Using_Linux_Tools_1d6', 'ch9Using_Linux_Tools_1d7', 'ch9Using_Linux_Tools_1d8', 'ch9Using_Linux_Tools_1d9', 'ch9Using_Linux_Tools_1da', 'ch9Using_Linux_Tools_1db', 'ch9Using_Linux_Tools_1dc', 'ch9Using_Linux_Tools_1dd', 'ch9Using_Linux_Tools_1de', 'ch9Using_Linux_Tools_1df', 'ch9Using_Linux_Tools_1e0', 'ch9Using_Linux_Tools_1e1'], 'ch1Introduction': ['ch1Introduction_1', 'ch1Introduction_2', 'ch1Introduction_3', 'ch1Introduction_4', 'ch1Introduction_5', 'ch1Introduction_6', 'ch1Introduction_7', 'ch1Introduction_8', 'ch1Introduction_9', 'ch1Introduction_a', 'ch1Introduction_b', 'ch1Introduction_c', 'ch1Introduction_d'], 'ch5func': ['ch5func_1', 'ch5func_2', 'ch5func_3', 'ch5func_4', 'ch5func_5', 'ch5func_6', 'ch5func_7', 'ch5func_8', 'ch5func_9', 'ch5func_a', 'ch5func_b', 'ch5func_c', 'ch5func_d', 'ch5func_e', 'ch5func_f', 'ch5func_10', 'ch5func_11', 'ch5func_12', 'ch5func_13', 'ch5func_14', 'ch5func_15', 'ch5func_16', 'ch5func_17', 'ch5func_18', 'ch5func_19', 'ch5func_1a', 'ch5func_1b', 'ch5func_1c', 'ch5func_1d', 'ch5func_1e', 'ch5func_1f'], 'ch3list_tuples': ['ch3list_tuples_1', 'ch3list_tuples_2', 'ch3list_tuples_3', 'ch3list_tuples_4', 'ch3list_tuples_5', 'ch3list_tuples_6', 'ch3list_tuples_7', 'ch3list_tuples_8', 'ch3list_tuples_9', 'ch3list_tuples_a', 'ch3list_tuples_b', 'ch3list_tuples_c', 'ch3list_tuples_d', 'ch3list_tuples_e', 'ch3list_tuples_f', 'ch3list_tuples_10', 'ch3list_tuples_11', 'ch3list_tuples_12', 'ch3list_tuples_13', 'ch3list_tuples_14', 'ch3list_tuples_15', 'ch3list_tuples_16', 'ch3list_tuples_17', 'ch3list_tuples_18', 'ch3list_tuples_19', 'ch3list_tuples_1a', 'ch3list_tuples_1b', 'ch3list_tuples_1c', 'ch3list_tuples_1d', 'ch3list_tuples_1e', 'ch3list_tuples_1f', 'ch3list_tuples_20', 'ch3list_tuples_21', 'ch3list_tuples_22', 'ch3list_tuples_23', 'ch3list_tuples_24', 'ch3list_tuples_25', 'ch3list_tuples_26', 'ch3list_tuples_27', 'ch3list_tuples_28', 'ch3list_tuples_29', 'ch3list_tuples_2a', 'ch3list_tuples_2b', 'ch3list_tuples_2c', 'ch3list_tuples_2d', 'ch3list_tuples_2e', 'ch3list_tuples_2f', 'ch3list_tuples_30', 'ch3list_tuples_31', 'ch3list_tuples_32', 'ch3list_tuples_33', 'ch3list_tuples_34', 'ch3list_tuples_35', 'ch3list_tuples_36', 'ch3list_tuples_37'], 'ch2intro': ['ch2intro_1', 'ch2intro_2', 'ch2intro_3', 'ch2intro_4', 'ch2intro_5', 'ch2intro_6', 'ch2intro_7', 'ch2intro_8', 'ch2intro_9', 'ch2intro_a', 'ch2intro_b', 'ch2intro_c', 'ch2intro_d', 'ch2intro_e', 'ch2intro_f', 'ch2intro_10', 'ch2intro_11', 'ch2intro_12', 'ch2intro_13', 'ch2intro_14', 'ch2intro_15', 'ch2intro_16', 'ch2intro_17', 'ch2intro_18', 'ch2intro_19', 'ch2intro_1a', 'ch2intro_1b', 'ch2intro_1c', 'ch2intro_1d', 'ch2intro_1e', 'ch2intro_1f', 'ch2intro_20', 'ch2intro_21', 'ch2intro_22', 'ch2intro_23', 'ch2intro_24', 'ch2intro_25', 'ch2intro_26', 'ch2intro_27', 'ch2intro_28', 'ch2intro_29', 'ch2intro_2a', 'ch2intro_2b', 'ch2intro_2c', 'ch2intro_2d', 'ch2intro_2e', 'ch2intro_2f', 'ch2intro_30', 'ch2intro_31', 'ch2intro_32', 'ch2intro_33', 'ch2intro_34', 'ch2intro_35', 'ch2intro_36', 'ch2intro_37', 'ch2intro_38', 'ch2intro_39', 'ch2intro_3a', 'ch2intro_3b', 'ch2intro_3c', 'ch2intro_3d', 'ch2intro_3e', 'ch2intro_3f', 'ch2intro_40', 'ch2intro_41', 'ch2intro_42', 'ch2intro_43', 'ch2intro_44', 'ch2intro_45', 'ch2intro_46', 'ch2intro_47', 'ch2intro_48', 'ch2intro_49', 'ch2intro_4a', 'ch2intro_4b', 'ch2intro_4c', 'ch2intro_4d', 'ch2intro_4e', 'ch2intro_4f', 'ch2intro_50', 'ch2intro_51', 'ch2intro_52', 'ch2intro_53', 'ch2intro_54', 'ch2intro_55', 'ch2intro_56', 'ch2intro_57', 'ch2intro_58', 'ch2intro_59', 'ch2intro_5a', 'ch2intro_5b', 'ch2intro_5c', 'ch2intro_5d', 'ch2intro_5e', 'ch2intro_5f', 'ch2intro_60', 'ch2intro_61', 'ch2intro_62', 'ch2intro_63', 'ch2intro_64', 'ch2intro_65', 'ch2intro_66', 'ch2intro_67'], 'ch4strings_dicts': ['ch4strings_dicts_1', 'ch4strings_dicts_2', 'ch4strings_dicts_3', 'ch4strings_dicts_4', 'ch4strings_dicts_5', 'ch4strings_dicts_6', 'ch4strings_dicts_7', 'ch4strings_dicts_8', 'ch4strings_dicts_9', 'ch4strings_dicts_a', 'ch4strings_dicts_b', 'ch4strings_dicts_c', 'ch4strings_dicts_d', 'ch4strings_dicts_e', 'ch4strings_dicts_f', 'ch4strings_dicts_10', 'ch4strings_dicts_11', 'ch4strings_dicts_12', 'ch4strings_dicts_13', 'ch4strings_dicts_14', 'ch4strings_dicts_15', 'ch4strings_dicts_16', 'ch4strings_dicts_17', 'ch4strings_dicts_18', 'ch4strings_dicts_19', 'ch4strings_dicts_1a', 'ch4strings_dicts_1b', 'ch4strings_dicts_1c', 'ch4strings_dicts_1d', 'ch4strings_dicts_1e', 'ch4strings_dicts_1f', 'ch4strings_dicts_20', 'ch4strings_dicts_21', 'ch4strings_dicts_22', 'ch4strings_dicts_23', 'ch4strings_dicts_24', 'ch4strings_dicts_25', 'ch4strings_dicts_26', 'ch4strings_dicts_27', 'ch4strings_dicts_28', 'ch4strings_dicts_29', 'ch4strings_dicts_2a', 'ch4strings_dicts_2b', 'ch4strings_dicts_2c', 'ch4strings_dicts_2d', 'ch4strings_dicts_2e', 'ch4strings_dicts_2f', 'ch4strings_dicts_30'], 'ch11Section_5': ['ch11Section_5_1', 'ch11Section_5_2', 'ch11Section_5_3', 'ch11Section_5_4', 'ch11Section_5_5', 'ch11Section_5_6', 'ch11Section_5_7', 'ch11Section_5_8', 'ch11Section_5_9', 'ch11Section_5_a', 'ch11Section_5_b', 'ch11Section_5_c', 'ch11Section_5_d', 'ch11Section_5_e', 'ch11Section_5_f', 'ch11Section_5_10', 'ch11Section_5_11', 'ch11Section_5_12', 'ch11Section_5_13', 'ch11Section_5_14', 'ch11Section_5_15', 'ch11Section_5_16', 'ch11Section_5_17', 'ch11Section_5_18', 'ch11Section_5_19', 'ch11Section_5_1a', 'ch11Section_5_1b', 'ch11Section_5_1c', 'ch11Section_5_1d', 'ch11Section_5_1e', 'ch11Section_5_1f', 'ch11Section_5_20', 'ch11Section_5_21', 'ch11Section_5_22', 'ch11Section_5_23', 'ch11Section_5_24', 'ch11Section_5_25', 'ch11Section_5_26', 'ch11Section_5_27', 'ch11Section_5_28', 'ch11Section_5_29', 'ch11Section_5_2a', 'ch11Section_5_2b', 'ch11Section_5_2c', 'ch11Section_5_2d', 'ch11Section_5_2e', 'ch11Section_5_2f', 'ch11Section_5_30', 'ch11Section_5_31', 'ch11Section_5_32', 'ch11Section_5_33', 'ch11Section_5_34', 'ch11Section_5_35', 'ch11Section_5_36', 'ch11Section_5_37', 'ch11Section_5_38', 'ch11Section_5_39', 'ch11Section_5_3a', 'ch11Section_5_3b', 'ch11Section_5_3c', 'ch11Section_5_3d', 'ch11Section_5_3e', 'ch11Section_5_3f', 'ch11Section_5_40', 'ch11Section_5_41', 'ch11Section_5_42', 'ch11Section_5_43', 'ch11Section_5_44', 'ch11Section_5_45', 'ch11Section_5_46', 'ch11Section_5_47', 'ch11Section_5_48', 'ch11Section_5_49', 'ch11Section_5_4a', 'ch11Section_5_4b', 'ch11Section_5_4c', 'ch11Section_5_4d', 'ch11Section_5_4e', 'ch11Section_5_4f', 'ch11Section_5_50', 'ch11Section_5_51', 'ch11Section_5_52', 'ch11Section_5_53', 'ch11Section_5_54', 'ch11Section_5_55', 'ch11Section_5_56', 'ch11Section_5_57', 'ch11Section_5_58', 'ch11Section_5_59', 'ch11Section_5_5a', 'ch11Section_5_5b', 'ch11Section_5_5c', 'ch11Section_5_5d', 'ch11Section_5_5e', 'ch11Section_5_5f', 'ch11Section_5_60', 'ch11Section_5_61', 'ch11Section_5_62', 'ch11Section_5_63', 'ch11Section_5_64', 'ch11Section_5_65', 'ch11Section_5_66', 'ch11Section_5_67', 'ch11Section_5_68', 'ch11Section_5_69', 'ch11Section_5_6a', 'ch11Section_5_6b', 'ch11Section_5_6c', 'ch11Section_5_6d', 'ch11Section_5_6e'], 'ch7interim_assessment': [], 'ch8ult_module_plan': ['ch8ult_module_plan_1', 'ch8ult_module_plan_2', 'ch8ult_module_plan_3', 'ch8ult_module_plan_4', 'ch8ult_module_plan_5', 'ch8ult_module_plan_6', 'ch8ult_module_plan_7', 'ch8ult_module_plan_8', 'ch8ult_module_plan_9', 'ch8ult_module_plan_a', 'ch8ult_module_plan_b', 'ch8ult_module_plan_c', 'ch8ult_module_plan_d', 'ch8ult_module_plan_e', 'ch8ult_module_plan_f', 'ch8ult_module_plan_10', 'ch8ult_module_plan_11', 'ch8ult_module_plan_12', 'ch8ult_module_plan_13', 'ch8ult_module_plan_14', 'ch8ult_module_plan_15', 'ch8ult_module_plan_16', 'ch8ult_module_plan_17', 'ch8ult_module_plan_18', 'ch8ult_module_plan_19', 'ch8ult_module_plan_1a', 'ch8ult_module_plan_1b', 'ch8ult_module_plan_1c', 'ch8ult_module_plan_1d', 'ch8ult_module_plan_1e', 'ch8ult_module_plan_1f', 'ch8ult_module_plan_20', 'ch8ult_module_plan_21', 'ch8ult_module_plan_22', 'ch8ult_module_plan_23', 'ch8ult_module_plan_24', 'ch8ult_module_plan_25', 'ch8ult_module_plan_26', 'ch8ult_module_plan_27', 'ch8ult_module_plan_28', 'ch8ult_module_plan_29', 'ch8ult_module_plan_2a', 'ch8ult_module_plan_2b', 'ch8ult_module_plan_2c', 'ch8ult_module_plan_2d', 'ch8ult_module_plan_2e', 'ch8ult_module_plan_2f', 'ch8ult_module_plan_30', 'ch8ult_module_plan_31', 'ch8ult_module_plan_32', 'ch8ult_module_plan_33', 'ch8ult_module_plan_34', 'ch8ult_module_plan_35', 'ch8ult_module_plan_36', 'ch8ult_module_plan_37', 'ch8ult_module_plan_38', 'ch8ult_module_plan_39', 'ch8ult_module_plan_3a', 'ch8ult_module_plan_3b', 'ch8ult_module_plan_3c', 'ch8ult_module_plan_3d', 'ch8ult_module_plan_3e', 'ch8ult_module_plan_3f', 'ch8ult_module_plan_40', 'ch8ult_module_plan_41', 'ch8ult_module_plan_42', 'ch8ult_module_plan_43', 'ch8ult_module_plan_44'], 'ch10session4': ['ch10session4_1', 'ch10session4_2', 'ch10session4_3', 'ch10session4_4', 'ch10session4_5', 'ch10session4_6', 'ch10session4_7', 'ch10session4_8', 'ch10session4_9', 'ch10session4_a', 'ch10session4_b', 'ch10session4_c', 'ch10session4_d', 'ch10session4_e', 'ch10session4_f', 'ch10session4_10', 'ch10session4_11', 'ch10session4_12', 'ch10session4_13', 'ch10session4_14', 'ch10session4_15', 'ch10session4_16', 'ch10session4_17', 'ch10session4_18', 'ch10session4_19', 'ch10session4_1a', 'ch10session4_1b', 'ch10session4_1c', 'ch10session4_1d', 'ch10session4_1e', 'ch10session4_1f', 'ch10session4_20', 'ch10session4_21', 'ch10session4_22', 'ch10session4_23', 'ch10session4_24', 'ch10session4_25', 'ch10session4_26', 'ch10session4_27', 'ch10session4_28', 'ch10session4_29', 'ch10session4_2a', 'ch10session4_2b', 'ch10session4_2c', 'ch10session4_2d', 'ch10session4_2e', 'ch10session4_2f', 'ch10session4_30', 'ch10session4_31', 'ch10session4_32', 'ch10session4_33', 'ch10session4_34', 'ch10session4_35', 'ch10session4_36', 'ch10session4_37', 'ch10session4_38', 'ch10session4_39', 'ch10session4_3a', 'ch10session4_3b', 'ch10session4_3c', 'ch10session4_3d', 'ch10session4_3e', 'ch10session4_3f', 'ch10session4_40', 'ch10session4_41', 'ch10session4_42', 'ch10session4_43', 'ch10session4_44', 'ch10session4_45', 'ch10session4_46', 'ch10session4_47', 'ch10session4_48', 'ch10session4_49', 'ch10session4_4a', 'ch10session4_4b', 'ch10session4_4c', 'ch10session4_4d', 'ch10session4_4e', 'ch10session4_4f', 'ch10session4_50', 'ch10session4_51', 'ch10session4_52', 'ch10session4_53', 'ch10session4_54', 'ch10session4_55', 'ch10session4_56', 'ch10session4_57', 'ch10session4_58', 'ch10session4_59', 'ch10session4_5a', 'ch10session4_5b', 'ch10session4_5c', 'ch10session4_5d', 'ch10session4_5e', 'ch10session4_5f', 'ch10session4_60', 'ch10session4_61', 'ch10session4_62', 'ch10session4_63', 'ch10session4_64', 'ch10session4_65', 'ch10session4_66', 'ch10session4_67', 'ch10session4_68', 'ch10session4_69', 'ch10session4_6a', 'ch10session4_6b', 'ch10session4_6c', 'ch10session4_6d', 'ch10session4_6e', 'ch10session4_6f', 'ch10session4_70', 'ch10session4_71', 'ch10session4_72', 'ch10session4_73', 'ch10session4_74', 'ch10session4_75', 'ch10session4_76', 'ch10session4_77', 'ch10session4_78', 'ch10session4_79', 'ch10session4_7a', 'ch10session4_7b', 'ch10session4_7c', 'ch10session4_7d', 'ch10session4_7e', 'ch10session4_7f', 'ch10session4_80', 'ch10session4_81', 'ch10session4_82', 'ch10session4_83', 'ch10session4_84', 'ch10session4_85', 'ch10session4_86', 'ch10session4_87', 'ch10session4_88', 'ch10session4_89', 'ch10session4_8a', 'ch10session4_8b', 'ch10session4_8c', 'ch10session4_8d', 'ch10session4_8e', 'ch10session4_8f', 'ch10session4_90', 'ch10session4_91', 'ch10session4_92', 'ch10session4_93', 'ch10session4_94', 'ch10session4_95', 'ch10session4_96', 'ch10session4_97', 'ch10session4_98', 'ch10session4_99', 'ch10session4_9a', 'ch10session4_9b', 'ch10session4_9c', 'ch10session4_9d', 'ch10session4_9e', 'ch10session4_9f', 'ch10session4_a0', 'ch10session4_a1', 'ch10session4_a2', 'ch10session4_a3', 'ch10session4_a4', 'ch10session4_a5', 'ch10session4_a6', 'ch10session4_a7', 'ch10session4_a8', 'ch10session4_a9', 'ch10session4_aa', 'ch10session4_ab', 'ch10session4_ac', 'ch10session4_ad', 'ch10session4_ae', 'ch10session4_af', 'ch10session4_b0', 'ch10session4_b1', 'ch10session4_b2', 'ch10session4_b3', 'ch10session4_b4', 'ch10session4_b5', 'ch10session4_b6']}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/scripts/rst2docbook.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,126 @@
+#!/usr/bin/python
+"""
+Just a hack to convert rst to xml and then docbook . 
+May not containt all the required elements of a docbook .
+Just done to make it run for the specific rst for our 
+sees documentation.
+"""
+import xml.etree.ElementTree as ET
+import os 
+import re
+import subprocess
+import os
+import pkg_resources
+import glob, os, re, sys
+names = glob.glob('ch*.xml')
+"""
+chapterno=0
+
+def convert2xml(file):
+#    print folder,subfolder,file
+    global chapterno
+    name=file.split('/')[-1]
+    name=str(chapterno)+name.split('.')[0]
+#    full_file=os.path.join(folder,file)    
+#    if file.endswith('.rst'):    
+    print file	    
+    xml_file=name+'.xml'        
+    command="rst2xml.py %s > %s" %(file , xml_file)
+    print command        
+    a=subprocess.Popen(command , shell=True)
+	   	
+
+
+def walk(repo):
+    global chapterno
+    mainfolder='/home/amit/sttp_latest/'    
+    for readline in open('index.config','r').readlines():
+        chapterno+=1		
+        filename=mainfolder+readline
+        convert2xml(filename)
+
+
+"""
+def convert2docbook(xml_string):
+#    xml_file_obj=open(file,'r')
+#    xml_string=xml_file_obj.read() 
+#    xml_file_obj.close()       
+    try:
+        xml_string=re.sub('<strong>','<emphasis role="strong">', xml_string)   
+        xml_string=re.sub('<literal_block','<programlisting>',xml_string)
+        xml_string=re.sub('</literal_block>','</programlisting>',xml_string)
+        xml_string=re.sub('xml:space="preserve">','',xml_string)
+        xml_string=re.sub('<paragraph>' ,'<para>',xml_string)
+        xml_string=re.sub('</paragraph>' ,'</para>',xml_string)  
+        xml_string=re.sub('</strong>' ,'</emphasis>',xml_string)
+        chapter= ET.Element("chapter")
+        article=ET.SubElement(chapter,"article")
+        articleinfo=ET.SubElement(article,"articleinfo")
+        tree = ET.fromstring(xml_string)
+        title= ET.SubElement(articleinfo,"title")   
+        try:    
+            title.text=tree.items()[1][1]
+        except:
+                pass    
+        article.insert(1,tree)
+        xml_string=ET.tostring(chapter)
+        xml_string=re.sub('<document ids=.*">' ,'',xml_string)
+        xml_string=re.sub('</document>' ,'',xml_string)
+        return xml_string
+#    docbook_file=file.split('.')[0]+'.docbook'
+#    f=open(docbook_file,'w')
+#    f.write(xml_string)
+#    xml_string=None
+    except :
+        pass
+
+
+
+
+if __name__=='__main__':
+#    repo='/home/amit/sphinxvirt/review/'
+#    walk(repo)
+#    convert(1,2,3)
+    for name in names:
+        print name        
+        xml_string=open(name,'r').read()
+         
+        xml_string=convert2docbook(xml_string)
+        docbook_file=name.split('.')[0]+'.docbook'
+        f=open(docbook_file,'w')
+        try:        
+            f.write(xml_string)
+        except:
+                pass
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/README	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,5 @@
+This directory contains web-related files.  Surprise!
+
+javascript - files used by the comment system, based on jQuery
+hgbook     - Django app that acts as the comment back end
+styles.css - style file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/genindex.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+
+import glob, os, re
+
+chapter_re = re.compile(r'<(chapter|appendix|preface)\s+id="([^"]+)">')
+filename_re = re.compile(r'<\?dbhtml filename="([^"]+)"\?>')
+title_re = re.compile(r'<title>(.*)</title>')
+
+chapters = (sorted(glob.glob('../en/ch*.xml')) +
+            sorted(glob.glob('../en/app*.xml')))
+
+fp = open('index-read.html.in', 'w')
+
+print >> fp, '''<!-- -*- html -*- -->
+{% extends "boilerplate.html" %}
+{% block bodycontent %}
+<div class="navheader"><h1 class="booktitle">Mercurial: The Definitive Guide<div class="authors">by Bryan O'Sullivan</div></h1></div>
+<div class="book"><ul class="booktoc">'''
+
+ch = 0
+app = 0
+ab = 0
+for c in chapters:
+    filename = None
+    title = None
+    chapid = None
+    chaptype = None
+    for line in open(c):
+        m = chapter_re.search(line)
+        if m:
+            chaptype, chapid = m.groups()
+        m = filename_re.search(line)
+        if m:
+            filename = m.group(1)
+        m = title_re.search(line)
+        if m:
+            title = m.group(1)
+        if filename and title and chapid:
+            if chaptype == 'appendix':
+                num = chr(ord('A') + app)
+                app += 1
+            else:
+                num = ch
+                ch += 1
+            ab += 1
+            date = os.popen('hg log -l1 --template "{date|isodate}" ' + c).read().split(None, 1)[0]
+            args = {
+                'ab': "ab"[ab % 2],
+                'date': date,
+                'chapid': chapid,
+                'num': num,
+                'filename': filename,
+                'title': title,
+                }
+            print >> fp, '<li class="zebra_%(ab)s"><span class="chapinfo">%(date)s<a href="/feeds/comments/%(chapid)s/"><img src="/support/figs/rss.png"/></a></span>%(num)s. <a href="%(filename)s">%(title)s</a></li>' % args
+            break
+
+print >> fp, '''</ul></div>
+{% endblock %}'''
+
+fp.close()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook.conf	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,111 @@
+# -*- apache -*-
+
+<VirtualHost *:80>
+#    ServerName hgbook.red-bean.com
+#    ServerAdmin bos@serpentine.com
+    ServerAdmin webmaster@localhost
+    ErrorLog /var/log/apache2/error.log
+#    ErrorLog logs/hgbook-error_log
+    # Debian:
+    # CustomLog logs/hgbook-access_log full
+    # Fedora:
+#    CustomLog logs/hgbook-access_log combined
+	CustomLog /var/log/apache2/access.log combined
+#    Options +MultiViews
+#    DirectoryIndex index.html.var index.html
+    DocumentRoot "/home/amit/hgbook-alqua/web/html"
+
+
+#    Redirect permanent /hgbook.html /index.html
+#    Redirect permanent /hgbookch1.html /read/preface.html
+#    Redirect permanent /hgbookch2.html /read/a-tour-of-mercurial-the-basics.html
+#    Redirect permanent /hgbookch3.html /read/a-tour-of-mercurial-merging-work.html
+#    Redirect permanent /hgbookch4.html /read/behind-the-scenes.html
+#    Redirect permanent /hgbookch5.html /read/mercurial-in-daily-use.html
+#    Redirect permanent /hgbookch6.html /read/file-names-and-pattern-matching.html
+#    Redirect permanent /hgbookch6.html /read/managing-releases-and-branchy-development.html
+#    Redirect permanent /hgbookch7.html /read/finding-and-fixing-mistakes.html
+#    Redirect permanent /hgbookch8.html /read/handling-repository-events-with-hooks.html
+#    Redirect permanent /hgbookch9.html /read/customizing-the-output-of-mercurial.html
+#    Redirect permanent /hgbookch10.html /read/managing-change-with-mercurial-queues.html
+#    Redirect permanent /hgbookch11.html /read/advanced-uses-of-mercurial-queues.html
+#    Redirect permanent /hgbookch12.html /read/adding-functionality-with-extensions.html
+#    Redirect permanent /hgbookap1.html /read/command-reference.html
+#    Redirect permanent /hgbookap2.html /read/mercurial-queues-reference.html
+#    Redirect permanent /hgbookap3.html /read/installing-mercurial-from-source.html
+#    Redirect permanent /hgbookap4.html /read/open-publication-license.html
+#    Redirect permanent /hgbookli1.html /read/index.html
+#    Redirect permanent /hgbookli2.html /read/index.html
+#    Redirect permanent /hgbookli3.html /read/index.html
+#    Redirect permanent /hgbookli4.html /read/index.html
+
+	WSGIScriptAlias /review /home/amit/hgbook-alqua/web/hgbook/run.wsgi
+
+
+
+    # Actively redirect requests via a ServerAlias to the canonical hostname.
+    RewriteEngine On
+#    RewriteCond %{HTTP_HOST} !=hgbook.red-bean.com
+#    RewriteRule ^(.*) http://hgbook.red-bean.com$1 [R]
+
+#    <Location "/">
+#        SetHandler python-program
+	# hg clone http://bitbucket.org/mirror/django-trunk/
+#        PythonPath "['/home/amit/hgbook-alqua/web/hgbook'] + sys.path"
+#        PythonHandler django.core.handlers.modpython
+#       PythonAutoReload Off
+#        SetEnv DJANGO_SETTINGS_MODULE hgbook.settings
+#        PythonDebug Off
+#    </Location>
+
+
+	
+    <Location ~ "^/$">
+        SetHandler None
+        DirectoryIndex index.html
+    </Location>
+
+    <Location ~ "^/index.html">
+        SetHandler None
+    </Location>
+
+    <Location ~ "^/robots.txt">
+        SetHandler None
+    </Location>
+
+    <Location "/read">
+        SetHandler None
+    </Location>
+
+    <Location "/support">
+        SetHandler None
+    </Location>
+
+    <Location "/media">
+        SetHandler None
+    </Location>
+
+#    Alias /media /home/bos/hg/django-trunk/django/contrib/admin/media
+
+    <Directory "/home/amit/hgbook-alqua/en/html">
+        Options Indexes FollowSymlinks
+        AllowOverride None
+        Order allow,deny
+        Allow from all
+    </Directory>
+
+    <Directory "/home/amit/hgbook-alqua/en/html">
+        AllowOverride AuthConfig
+    </Directory>
+
+    <Directory "/home/amit/hgbook-alqua/web/support">
+        Options None
+    </Directory>
+</VirtualHost>
+
+#<Directory "/home/bos/hg/django-trunk/django/contrib/admin/media">
+#    Options None
+#    AllowOverride None
+#    Order allow,deny
+#    Allow from all
+#</Directory>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook.conf~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,111 @@
+# -*- apache -*-
+
+<VirtualHost *:80>
+#    ServerName hgbook.red-bean.com
+#    ServerAdmin bos@serpentine.com
+    ServerAdmin webmaster@localhost
+    ErrorLog /var/log/apache2/error.log
+#    ErrorLog logs/hgbook-error_log
+    # Debian:
+    # CustomLog logs/hgbook-access_log full
+    # Fedora:
+#    CustomLog logs/hgbook-access_log combined
+	CustomLog /var/log/apache2/access.log combined
+#    Options +MultiViews
+#    DirectoryIndex index.html.var index.html
+#    DocumentRoot "/home/amit/hgbook-alqua/web/html"
+
+
+#    Redirect permanent /hgbook.html /index.html
+#    Redirect permanent /hgbookch1.html /read/preface.html
+#    Redirect permanent /hgbookch2.html /read/a-tour-of-mercurial-the-basics.html
+#    Redirect permanent /hgbookch3.html /read/a-tour-of-mercurial-merging-work.html
+#    Redirect permanent /hgbookch4.html /read/behind-the-scenes.html
+#    Redirect permanent /hgbookch5.html /read/mercurial-in-daily-use.html
+#    Redirect permanent /hgbookch6.html /read/file-names-and-pattern-matching.html
+#    Redirect permanent /hgbookch6.html /read/managing-releases-and-branchy-development.html
+#    Redirect permanent /hgbookch7.html /read/finding-and-fixing-mistakes.html
+#    Redirect permanent /hgbookch8.html /read/handling-repository-events-with-hooks.html
+#    Redirect permanent /hgbookch9.html /read/customizing-the-output-of-mercurial.html
+#    Redirect permanent /hgbookch10.html /read/managing-change-with-mercurial-queues.html
+#    Redirect permanent /hgbookch11.html /read/advanced-uses-of-mercurial-queues.html
+#    Redirect permanent /hgbookch12.html /read/adding-functionality-with-extensions.html
+#    Redirect permanent /hgbookap1.html /read/command-reference.html
+#    Redirect permanent /hgbookap2.html /read/mercurial-queues-reference.html
+#    Redirect permanent /hgbookap3.html /read/installing-mercurial-from-source.html
+#    Redirect permanent /hgbookap4.html /read/open-publication-license.html
+#    Redirect permanent /hgbookli1.html /read/index.html
+#    Redirect permanent /hgbookli2.html /read/index.html
+#    Redirect permanent /hgbookli3.html /read/index.html
+#    Redirect permanent /hgbookli4.html /read/index.html
+
+	WSGIScriptAlias /review /home/amit/hgbook-alqua/web/hgbook/run.wsgi
+
+
+
+    # Actively redirect requests via a ServerAlias to the canonical hostname.
+    RewriteEngine On
+#    RewriteCond %{HTTP_HOST} !=hgbook.red-bean.com
+#    RewriteRule ^(.*) http://hgbook.red-bean.com$1 [R]
+
+#    <Location "/">
+#        SetHandler python-program
+	# hg clone http://bitbucket.org/mirror/django-trunk/
+#        PythonPath "['/home/amit/hgbook-alqua/web/hgbook'] + sys.path"
+#        PythonHandler django.core.handlers.modpython
+#       PythonAutoReload Off
+#        SetEnv DJANGO_SETTINGS_MODULE hgbook.settings
+#        PythonDebug Off
+#    </Location>
+
+
+	
+    <Location ~ "^/$">
+        SetHandler None
+        DirectoryIndex index.html
+    </Location>
+
+    <Location ~ "^/index.html">
+        SetHandler None
+    </Location>
+
+    <Location ~ "^/robots.txt">
+        SetHandler None
+    </Location>
+
+    <Location "/read">
+        SetHandler None
+    </Location>
+
+    <Location "/support">
+        SetHandler None
+    </Location>
+
+    <Location "/media">
+        SetHandler None
+    </Location>
+
+#    Alias /media /home/bos/hg/django-trunk/django/contrib/admin/media
+
+    <Directory "/home/amit/hgbook-alqua/en/html">
+        Options Indexes FollowSymlinks
+        AllowOverride None
+        Order allow,deny
+        Allow from all
+    </Directory>
+
+    <Directory "/home/amit/hgbook-alqua/en/html">
+        AllowOverride AuthConfig
+    </Directory>
+
+    <Directory "/home/amit/hgbook-alqua/web/support">
+        Options None
+    </Directory>
+</VirtualHost>
+
+#<Directory "/home/bos/hg/django-trunk/django/contrib/admin/media">
+#    Options None
+#    AllowOverride None
+#    Order allow,deny
+#    Allow from all
+#</Directory>
Binary file SEESenv/web/hgbook/.database.sqlite3 has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/__init__.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1 @@
+import admin
Binary file SEESenv/web/hgbook/__init__.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/admin.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,24 @@
+from django.contrib import admin
+from hgbook.comments.models import Comment, Element
+
+class CommentAdmin(admin.ModelAdmin):
+    list_display = ['element', 'submitter_name', 'comment', 'reviewed',
+                    'hidden', 'date']
+    search_fields = ['comment']
+    date_hierarchy = 'date'
+    list_filter = ['date', 'submitter_name']
+    search_fields = ['title', 'submitter_name', 'submitter_url']
+    fieldsets = (
+        (None, {'fields': ('submitter_name', 'element', 'comment')}),
+        ('Review and presentation state', {'fields': ('reviewed', 'hidden')}),
+        ('Other info', {'fields': ('submitter_url', 'ip')}),
+        )
+    # XXX: adding 'date' to the 'Other info' fieldset results in a
+    # ImproperlyConfigured error. :S
+
+class ElementAdmin(admin.ModelAdmin):
+    search_fields = ['id', 'chapter']
+    list_filter = ['chapter', 'title']
+#    search_fields = ['id'
+admin.site.register(Comment, CommentAdmin)
+admin.site.register(Element, ElementAdmin)
Binary file SEESenv/web/hgbook/admin.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/admin.py~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,24 @@
+from django.contrib import admin
+from hgbook.comments.models import Comment, Element
+
+class CommentAdmin(admin.ModelAdmin):
+    list_display = ['element', 'submitter_name', 'comment', 'reviewed',
+                    'hidden', 'date']
+    search_fields = ['comment']
+    date_hierarchy = 'date'
+    list_filter = ['date', 'submitter_name']
+    search_fields = ['title', 'submitter_name', 'submitter_url']
+    fieldsets = (
+        (None, {'fields': ('submitter_name', 'element', 'comment')}),
+        ('Review and presentation state', {'fields': ('reviewed', 'hidden')}),
+        ('Other info', {'fields': ('submitter_url', 'ip')}),
+        )
+    # XXX: adding 'date' to the 'Other info' fieldset results in a
+    # ImproperlyConfigured error. :S
+
+class ElementAdmin(admin.ModelAdmin):
+    search_fields = ['id']
+#    list_filter = ['chapter', 'title']
+
+admin.site.register(Comment, CommentAdmin)
+admin.site.register(Element, ElementAdmin)
Binary file SEESenv/web/hgbook/comments/__init__.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/comments/feeds.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,35 @@
+from django.core.exceptions import ObjectDoesNotExist
+from django.utils.feedgenerator import Atom1Feed
+from django.contrib.syndication.feeds import Feed
+from hgbook.comments.models import Comment, Element
+
+class MyAtomFeed(Atom1Feed):
+    title_type = u'html'
+    
+class Comments(Feed):
+    feed_type = MyAtomFeed
+    title = 'Mercurial - The Definitive Guide: recent comments'
+    subtitle = ('Recent comments on the text of &#8220;Mercurial: The '
+                'Definitive Guide&#8221;, from our readers')
+    link = '/feeds/comments/'
+    author_name = 'Our readers'
+
+    def feedfilter(self, queryset):
+        return queryset.order_by('-date')[:20]
+
+    def items(self):
+        return self.feedfilter(Comment.objects)
+
+    def item_author_name(self, obj):
+        return obj.submitter_name
+
+    def item_pubdate(self, obj):
+        return obj.date
+
+    def get_object(self, bits):
+        if len(bits) == 0:
+            return self.items()
+        elif len(bits) > 1:
+            raise ObjectDoesNotExist
+        return self.feedfilter(Comment.objects.filter(element__chapter=bits[0],
+                                                      hidden=False))
Binary file SEESenv/web/hgbook/comments/feeds.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/comments/models.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,86 @@
+from django.db import models
+import hashlib
+from django.conf import settings
+from django.contrib.flatpages.models import FlatPage
+import os
+from BeautifulSoup import BeautifulSoup
+import django
+from django.utils.html import strip_tags
+import djapian
+from djapian.indexer import CompositeIndexer ,Indexer
+mutable = True
+#standard_url='localhost/review/html/'
+
+
+
+class Element(models.Model):
+    id = models.CharField('ID attribute', max_length=64, editable=False,
+                          primary_key=True)
+    	
+    chapter = models.CharField('Chapter ID', max_length=100, editable=False,
+                               db_index=True)
+    title = models.CharField('Section title', max_length=256, editable=False)
+
+    def __unicode__(self):
+        return self.id
+    
+class Comment(models.Model):
+    element = models.ForeignKey(Element,
+        help_text='ID of paragraph that was commented on')
+    comment = models.TextField(editable=mutable,
+        help_text='Text of submitted comment (please do not modify)')
+    submitter_name = models.CharField('Submitter', max_length=64,
+        help_text='Self-reported name of submitter (may be bogus)')
+    submitter_url = models.URLField('URL', blank=True, editable=mutable,
+        help_text='Self-reported URL of submitter (may be empty or bogus)')
+    ip = models.IPAddressField('IP address', editable=mutable,
+        help_text='IP address from which comment was submitted')
+    date = models.DateTimeField('date submitted', auto_now=True,
+                                auto_now_add=True)
+    reviewed = models.BooleanField(default=False, db_index=True,
+        help_text='Has this comment been reviewed by an author?')
+    hidden = models.BooleanField(default=False, db_index=True,
+        help_text='Has this comment been hidden from public display?')
+
+    def __unicode__(self):
+        return self.comment[:32]
+
+#    def get_absolute_url(self):
+#        s = hashlib.new()
+#        s.update(repr(self.comment))
+#        s.update(repr(self.submitter_name))
+#        s.update(str(self.date))
+#	print '/read/%s.html#%s?comment=%s&uuid=%s' % (
+#            self.element.chapter, self.element.id, self.id, s.hexdigest()[:20]
+#            )        
+#	return '/read/%s.html#%s?comment=%s&uuid=%s' % (
+#            self.element.chapter, self.element.id, self.id, s.hexdigest()[:20]
+#            )
+
+
+"""
+for directory,lists,files in os.walk('../html'):
+	if directory=='../html':
+		for file in files:
+			if file.endswith('.html'):
+				filename=os.path.join('../html/'+file)			
+				f=open(filename,'r')			
+				soup = BeautifulSoup(''.join(f.read()))
+				titletag=soup.html.head.title
+				body=strip_tags(soup.html.body)				
+				c=FlatPage(url=standard_url+file,title=titletag.string,content=body)
+				c.save()		
+	
+class FlatPageIndexer( djapian.Indexer ):
+    fields = [ 'title', 'content' ]
+    
+
+djapian.space.add_index(FlatPage, FlatPageIndexer, attach_as="indexer")
+FlatPage.indexer.update()
+result = FlatPage.indexer.search('lists')
+for row in result :
+	print row.instance.url
+print result.count()
+
+"""	
+
Binary file SEESenv/web/hgbook/comments/models.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/comments/models.py~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,86 @@
+from django.db import models
+import hashlib
+from django.conf import settings
+from django.contrib.flatpages.models import FlatPage
+import os
+from BeautifulSoup import BeautifulSoup
+import django
+from django.utils.html import strip_tags
+import djapian
+from djapian.indexer import CompositeIndexer ,Indexer
+mutable = True
+standard_url='localhost/review/html/'
+
+
+
+class Element(models.Model):
+    id = models.CharField('ID attribute', max_length=64, editable=False,
+                          primary_key=True)
+    	
+    chapter = models.CharField('Chapter ID', max_length=100, editable=False,
+                               db_index=True)
+    title = models.CharField('Section title', max_length=256, editable=False)
+
+    def __unicode__(self):
+        return self.id
+    
+class Comment(models.Model):
+    element = models.ForeignKey(Element,
+        help_text='ID of paragraph that was commented on')
+    comment = models.TextField(editable=mutable,
+        help_text='Text of submitted comment (please do not modify)')
+    submitter_name = models.CharField('Submitter', max_length=64,
+        help_text='Self-reported name of submitter (may be bogus)')
+    submitter_url = models.URLField('URL', blank=True, editable=mutable,
+        help_text='Self-reported URL of submitter (may be empty or bogus)')
+    ip = models.IPAddressField('IP address', editable=mutable,
+        help_text='IP address from which comment was submitted')
+    date = models.DateTimeField('date submitted', auto_now=True,
+                                auto_now_add=True)
+    reviewed = models.BooleanField(default=False, db_index=True,
+        help_text='Has this comment been reviewed by an author?')
+    hidden = models.BooleanField(default=False, db_index=True,
+        help_text='Has this comment been hidden from public display?')
+
+    def __unicode__(self):
+        return self.comment[:32]
+
+#    def get_absolute_url(self):
+#        s = hashlib.new()
+#        s.update(repr(self.comment))
+#        s.update(repr(self.submitter_name))
+#        s.update(str(self.date))
+#	print '/read/%s.html#%s?comment=%s&uuid=%s' % (
+#            self.element.chapter, self.element.id, self.id, s.hexdigest()[:20]
+#            )        
+#	return '/read/%s.html#%s?comment=%s&uuid=%s' % (
+#            self.element.chapter, self.element.id, self.id, s.hexdigest()[:20]
+#            )
+
+
+"""
+for directory,lists,files in os.walk('../html'):
+	if directory=='../html':
+		for file in files:
+			if file.endswith('.html'):
+				filename=os.path.join('../html/'+file)			
+				f=open(filename,'r')			
+				soup = BeautifulSoup(''.join(f.read()))
+				titletag=soup.html.head.title
+				body=strip_tags(soup.html.body)				
+				c=FlatPage(url=standard_url+file,title=titletag.string,content=body)
+				c.save()		
+	
+class FlatPageIndexer( djapian.Indexer ):
+    fields = [ 'title', 'content' ]
+    
+
+djapian.space.add_index(FlatPage, FlatPageIndexer, attach_as="indexer")
+FlatPage.indexer.update()
+result = FlatPage.indexer.search('lists')
+for row in result :
+	print row.instance.url
+print result.count()
+
+"""	
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/comments/p_list.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1 @@
+p_list= {'ch6oop': ['ch6oop_1', 'ch6oop_2', 'ch6oop_3', 'ch6oop_4', 'ch6oop_5', 'ch6oop_6', 'ch6oop_7', 'ch6oop_8', 'ch6oop_9', 'ch6oop_a', 'ch6oop_b', 'ch6oop_c', 'ch6oop_d', 'ch6oop_e', 'ch6oop_f', 'ch6oop_10', 'ch6oop_11', 'ch6oop_12', 'ch6oop_13', 'ch6oop_14', 'ch6oop_15', 'ch6oop_16', 'ch6oop_17', 'ch6oop_18', 'ch6oop_19', 'ch6oop_1a', 'ch6oop_1b', 'ch6oop_1c', 'ch6oop_1d', 'ch6oop_1e', 'ch6oop_1f', 'ch6oop_20', 'ch6oop_21', 'ch6oop_22', 'ch6oop_23', 'ch6oop_24', 'ch6oop_25', 'ch6oop_26', 'ch6oop_27', 'ch6oop_28', 'ch6oop_29', 'ch6oop_2a', 'ch6oop_2b', 'ch6oop_2c', 'ch6oop_2d', 'ch6oop_2e', 'ch6oop_2f', 'ch6oop_30', 'ch6oop_31', 'ch6oop_32', 'ch6oop_33', 'ch6oop_34', 'ch6oop_35', 'ch6oop_36', 'ch6oop_37', 'ch6oop_38', 'ch6oop_39', 'ch6oop_3a', 'ch6oop_3b', 'ch6oop_3c', 'ch6oop_3d', 'ch6oop_3e', 'ch6oop_3f', 'ch6oop_40', 'ch6oop_41', 'ch6oop_42', 'ch6oop_43', 'ch6oop_44', 'ch6oop_45', 'ch6oop_46', 'ch6oop_47', 'ch6oop_48', 'ch6oop_49', 'ch6oop_4a', 'ch6oop_4b', 'ch6oop_4c', 'ch6oop_4d', 'ch6oop_4e', 'ch6oop_4f', 'ch6oop_50', 'ch6oop_51', 'ch6oop_52', 'ch6oop_53', 'ch6oop_54', 'ch6oop_55', 'ch6oop_56', 'ch6oop_57', 'ch6oop_58', 'ch6oop_59', 'ch6oop_5a', 'ch6oop_5b', 'ch6oop_5c', 'ch6oop_5d', 'ch6oop_5e', 'ch6oop_5f', 'ch6oop_60', 'ch6oop_61', 'ch6oop_62', 'ch6oop_63', 'ch6oop_64', 'ch6oop_65', 'ch6oop_66', 'ch6oop_67', 'ch6oop_68', 'ch6oop_69', 'ch6oop_6a', 'ch6oop_6b', 'ch6oop_6c', 'ch6oop_6d', 'ch6oop_6e', 'ch6oop_6f', 'ch6oop_70', 'ch6oop_71', 'ch6oop_72', 'ch6oop_73', 'ch6oop_74', 'ch6oop_75', 'ch6oop_76', 'ch6oop_77', 'ch6oop_78', 'ch6oop_79', 'ch6oop_7a', 'ch6oop_7b', 'ch6oop_7c', 'ch6oop_7d', 'ch6oop_7e', 'ch6oop_7f', 'ch6oop_80', 'ch6oop_81', 'ch6oop_82', 'ch6oop_83', 'ch6oop_84', 'ch6oop_85', 'ch6oop_86', 'ch6oop_87', 'ch6oop_88', 'ch6oop_89', 'ch6oop_8a', 'ch6oop_8b', 'ch6oop_8c', 'ch6oop_8d', 'ch6oop_8e', 'ch6oop_8f', 'ch6oop_90', 'ch6oop_91', 'ch6oop_92', 'ch6oop_93', 'ch6oop_94', 'ch6oop_95', 'ch6oop_96', 'ch6oop_97', 'ch6oop_98', 'ch6oop_99', 'ch6oop_9a', 'ch6oop_9b', 'ch6oop_9c', 'ch6oop_9d', 'ch6oop_9e', 'ch6oop_9f', 'ch6oop_a0', 'ch6oop_a1', 'ch6oop_a2', 'ch6oop_a3', 'ch6oop_a4', 'ch6oop_a5', 'ch6oop_a6', 'ch6oop_a7', 'ch6oop_a8', 'ch6oop_a9', 'ch6oop_aa', 'ch6oop_ab', 'ch6oop_ac', 'ch6oop_ad', 'ch6oop_ae', 'ch6oop_af', 'ch6oop_b0', 'ch6oop_b1', 'ch6oop_b2', 'ch6oop_b3', 'ch6oop_b4', 'ch6oop_b5', 'ch6oop_b6', 'ch6oop_b7', 'ch6oop_b8', 'ch6oop_b9', 'ch6oop_ba', 'ch6oop_bb', 'ch6oop_bc', 'ch6oop_bd', 'ch6oop_be', 'ch6oop_bf', 'ch6oop_c0', 'ch6oop_c1', 'ch6oop_c2', 'ch6oop_c3', 'ch6oop_c4', 'ch6oop_c5', 'ch6oop_c6', 'ch6oop_c7', 'ch6oop_c8', 'ch6oop_c9', 'ch6oop_ca', 'ch6oop_cb', 'ch6oop_cc', 'ch6oop_cd', 'ch6oop_ce', 'ch6oop_cf', 'ch6oop_d0', 'ch6oop_d1', 'ch6oop_d2', 'ch6oop_d3', 'ch6oop_d4', 'ch6oop_d5', 'ch6oop_d6', 'ch6oop_d7', 'ch6oop_d8', 'ch6oop_d9', 'ch6oop_da', 'ch6oop_db', 'ch6oop_dc', 'ch6oop_dd', 'ch6oop_de', 'ch6oop_df', 'ch6oop_e0', 'ch6oop_e1', 'ch6oop_e2', 'ch6oop_e3', 'ch6oop_e4', 'ch6oop_e5', 'ch6oop_e6', 'ch6oop_e7', 'ch6oop_e8', 'ch6oop_e9', 'ch6oop_ea', 'ch6oop_eb', 'ch6oop_ec', 'ch6oop_ed', 'ch6oop_ee', 'ch6oop_ef', 'ch6oop_f0', 'ch6oop_f1', 'ch6oop_f2', 'ch6oop_f3', 'ch6oop_f4', 'ch6oop_f5', 'ch6oop_f6', 'ch6oop_f7', 'ch6oop_f8', 'ch6oop_f9', 'ch6oop_fa', 'ch6oop_fb', 'ch6oop_fc', 'ch6oop_fd', 'ch6oop_fe', 'ch6oop_ff', 'ch6oop_100', 'ch6oop_101', 'ch6oop_102', 'ch6oop_103', 'ch6oop_104', 'ch6oop_105', 'ch6oop_106', 'ch6oop_107', 'ch6oop_108', 'ch6oop_109', 'ch6oop_10a', 'ch6oop_10b', 'ch6oop_10c', 'ch6oop_10d', 'ch6oop_10e', 'ch6oop_10f', 'ch6oop_110', 'ch6oop_111', 'ch6oop_112', 'ch6oop_113', 'ch6oop_114', 'ch6oop_115', 'ch6oop_116', 'ch6oop_117', 'ch6oop_118', 'ch6oop_119', 'ch6oop_11a', 'ch6oop_11b', 'ch6oop_11c', 'ch6oop_11d', 'ch6oop_11e', 'ch6oop_11f', 'ch6oop_120', 'ch6oop_121', 'ch6oop_122', 'ch6oop_123', 'ch6oop_124', 'ch6oop_125', 'ch6oop_126', 'ch6oop_127', 'ch6oop_128', 'ch6oop_129', 'ch6oop_12a', 'ch6oop_12b', 'ch6oop_12c', 'ch6oop_12d', 'ch6oop_12e', 'ch6oop_12f', 'ch6oop_130', 'ch6oop_131', 'ch6oop_132', 'ch6oop_133', 'ch6oop_134', 'ch6oop_135', 'ch6oop_136', 'ch6oop_137', 'ch6oop_138', 'ch6oop_139', 'ch6oop_13a', 'ch6oop_13b', 'ch6oop_13c', 'ch6oop_13d', 'ch6oop_13e', 'ch6oop_13f', 'ch6oop_140', 'ch6oop_141', 'ch6oop_142', 'ch6oop_143', 'ch6oop_144', 'ch6oop_145', 'ch6oop_146', 'ch6oop_147', 'ch6oop_148', 'ch6oop_149', 'ch6oop_14a', 'ch6oop_14b', 'ch6oop_14c', 'ch6oop_14d', 'ch6oop_14e', 'ch6oop_14f', 'ch6oop_150', 'ch6oop_151', 'ch6oop_152', 'ch6oop_153', 'ch6oop_154', 'ch6oop_155', 'ch6oop_156', 'ch6oop_157', 'ch6oop_158', 'ch6oop_159', 'ch6oop_15a', 'ch6oop_15b', 'ch6oop_15c', 'ch6oop_15d', 'ch6oop_15e', 'ch6oop_15f', 'ch6oop_160', 'ch6oop_161', 'ch6oop_162', 'ch6oop_163', 'ch6oop_164', 'ch6oop_165', 'ch6oop_166', 'ch6oop_167', 'ch6oop_168', 'ch6oop_169', 'ch6oop_16a', 'ch6oop_16b', 'ch6oop_16c', 'ch6oop_16d', 'ch6oop_16e', 'ch6oop_16f', 'ch6oop_170', 'ch6oop_171', 'ch6oop_172', 'ch6oop_173', 'ch6oop_174', 'ch6oop_175', 'ch6oop_176', 'ch6oop_177', 'ch6oop_178', 'ch6oop_179', 'ch6oop_17a', 'ch6oop_17b', 'ch6oop_17c', 'ch6oop_17d', 'ch6oop_17e', 'ch6oop_17f', 'ch6oop_180', 'ch6oop_181', 'ch6oop_182', 'ch6oop_183', 'ch6oop_184', 'ch6oop_185', 'ch6oop_186', 'ch6oop_187', 'ch6oop_188', 'ch6oop_189', 'ch6oop_18a', 'ch6oop_18b', 'ch6oop_18c', 'ch6oop_18d', 'ch6oop_18e', 'ch6oop_18f', 'ch6oop_190', 'ch6oop_191', 'ch6oop_192', 'ch6oop_193', 'ch6oop_194', 'ch6oop_195', 'ch6oop_196', 'ch6oop_197', 'ch6oop_198', 'ch6oop_199', 'ch6oop_19a', 'ch6oop_19b', 'ch6oop_19c', 'ch6oop_19d', 'ch6oop_19e', 'ch6oop_19f', 'ch6oop_1a0', 'ch6oop_1a1', 'ch6oop_1a2', 'ch6oop_1a3', 'ch6oop_1a4', 'ch6oop_1a5', 'ch6oop_1a6', 'ch6oop_1a7', 'ch6oop_1a8', 'ch6oop_1a9', 'ch6oop_1aa', 'ch6oop_1ab', 'ch6oop_1ac', 'ch6oop_1ad', 'ch6oop_1ae', 'ch6oop_1af', 'ch6oop_1b0', 'ch6oop_1b1', 'ch6oop_1b2', 'ch6oop_1b3', 'ch6oop_1b4', 'ch6oop_1b5', 'ch6oop_1b6', 'ch6oop_1b7', 'ch6oop_1b8', 'ch6oop_1b9', 'ch6oop_1ba', 'ch6oop_1bb', 'ch6oop_1bc', 'ch6oop_1bd', 'ch6oop_1be', 'ch6oop_1bf', 'ch6oop_1c0', 'ch6oop_1c1', 'ch6oop_1c2', 'ch6oop_1c3', 'ch6oop_1c4', 'ch6oop_1c5', 'ch6oop_1c6', 'ch6oop_1c7', 'ch6oop_1c8', 'ch6oop_1c9', 'ch6oop_1ca', 'ch6oop_1cb', 'ch6oop_1cc', 'ch6oop_1cd', 'ch6oop_1ce', 'ch6oop_1cf', 'ch6oop_1d0', 'ch6oop_1d1', 'ch6oop_1d2', 'ch6oop_1d3', 'ch6oop_1d4', 'ch6oop_1d5', 'ch6oop_1d6', 'ch6oop_1d7', 'ch6oop_1d8', 'ch6oop_1d9', 'ch6oop_1da', 'ch6oop_1db', 'ch6oop_1dc', 'ch6oop_1dd', 'ch6oop_1de', 'ch6oop_1df', 'ch6oop_1e0', 'ch6oop_1e1'], 'ch9Using_Linux_Tools': ['ch9Using_Linux_Tools_1', 'ch9Using_Linux_Tools_2', 'ch9Using_Linux_Tools_3', 'ch9Using_Linux_Tools_4', 'ch9Using_Linux_Tools_5', 'ch9Using_Linux_Tools_6', 'ch9Using_Linux_Tools_7', 'ch9Using_Linux_Tools_8', 'ch9Using_Linux_Tools_9', 'ch9Using_Linux_Tools_a', 'ch9Using_Linux_Tools_b', 'ch9Using_Linux_Tools_c', 'ch9Using_Linux_Tools_d', 'ch9Using_Linux_Tools_e', 'ch9Using_Linux_Tools_f', 'ch9Using_Linux_Tools_10', 'ch9Using_Linux_Tools_11', 'ch9Using_Linux_Tools_12', 'ch9Using_Linux_Tools_13', 'ch9Using_Linux_Tools_14', 'ch9Using_Linux_Tools_15', 'ch9Using_Linux_Tools_16', 'ch9Using_Linux_Tools_17', 'ch9Using_Linux_Tools_18', 'ch9Using_Linux_Tools_19', 'ch9Using_Linux_Tools_1a', 'ch9Using_Linux_Tools_1b', 'ch9Using_Linux_Tools_1c', 'ch9Using_Linux_Tools_1d', 'ch9Using_Linux_Tools_1e', 'ch9Using_Linux_Tools_1f', 'ch9Using_Linux_Tools_20', 'ch9Using_Linux_Tools_21', 'ch9Using_Linux_Tools_22', 'ch9Using_Linux_Tools_23', 'ch9Using_Linux_Tools_24', 'ch9Using_Linux_Tools_25', 'ch9Using_Linux_Tools_26', 'ch9Using_Linux_Tools_27', 'ch9Using_Linux_Tools_28', 'ch9Using_Linux_Tools_29', 'ch9Using_Linux_Tools_2a', 'ch9Using_Linux_Tools_2b', 'ch9Using_Linux_Tools_2c', 'ch9Using_Linux_Tools_2d', 'ch9Using_Linux_Tools_2e', 'ch9Using_Linux_Tools_2f', 'ch9Using_Linux_Tools_30', 'ch9Using_Linux_Tools_31', 'ch9Using_Linux_Tools_32', 'ch9Using_Linux_Tools_33', 'ch9Using_Linux_Tools_34', 'ch9Using_Linux_Tools_35', 'ch9Using_Linux_Tools_36', 'ch9Using_Linux_Tools_37', 'ch9Using_Linux_Tools_38', 'ch9Using_Linux_Tools_39', 'ch9Using_Linux_Tools_3a', 'ch9Using_Linux_Tools_3b', 'ch9Using_Linux_Tools_3c', 'ch9Using_Linux_Tools_3d', 'ch9Using_Linux_Tools_3e', 'ch9Using_Linux_Tools_3f', 'ch9Using_Linux_Tools_40', 'ch9Using_Linux_Tools_41', 'ch9Using_Linux_Tools_42', 'ch9Using_Linux_Tools_43', 'ch9Using_Linux_Tools_44', 'ch9Using_Linux_Tools_45', 'ch9Using_Linux_Tools_46', 'ch9Using_Linux_Tools_47', 'ch9Using_Linux_Tools_48', 'ch9Using_Linux_Tools_49', 'ch9Using_Linux_Tools_4a', 'ch9Using_Linux_Tools_4b', 'ch9Using_Linux_Tools_4c', 'ch9Using_Linux_Tools_4d', 'ch9Using_Linux_Tools_4e', 'ch9Using_Linux_Tools_4f', 'ch9Using_Linux_Tools_50', 'ch9Using_Linux_Tools_51', 'ch9Using_Linux_Tools_52', 'ch9Using_Linux_Tools_53', 'ch9Using_Linux_Tools_54', 'ch9Using_Linux_Tools_55', 'ch9Using_Linux_Tools_56', 'ch9Using_Linux_Tools_57', 'ch9Using_Linux_Tools_58', 'ch9Using_Linux_Tools_59', 'ch9Using_Linux_Tools_5a', 'ch9Using_Linux_Tools_5b', 'ch9Using_Linux_Tools_5c', 'ch9Using_Linux_Tools_5d', 'ch9Using_Linux_Tools_5e', 'ch9Using_Linux_Tools_5f', 'ch9Using_Linux_Tools_60', 'ch9Using_Linux_Tools_61', 'ch9Using_Linux_Tools_62', 'ch9Using_Linux_Tools_63', 'ch9Using_Linux_Tools_64', 'ch9Using_Linux_Tools_65', 'ch9Using_Linux_Tools_66', 'ch9Using_Linux_Tools_67', 'ch9Using_Linux_Tools_68', 'ch9Using_Linux_Tools_69', 'ch9Using_Linux_Tools_6a', 'ch9Using_Linux_Tools_6b', 'ch9Using_Linux_Tools_6c', 'ch9Using_Linux_Tools_6d', 'ch9Using_Linux_Tools_6e', 'ch9Using_Linux_Tools_6f', 'ch9Using_Linux_Tools_70', 'ch9Using_Linux_Tools_71', 'ch9Using_Linux_Tools_72', 'ch9Using_Linux_Tools_73', 'ch9Using_Linux_Tools_74', 'ch9Using_Linux_Tools_75', 'ch9Using_Linux_Tools_76', 'ch9Using_Linux_Tools_77', 'ch9Using_Linux_Tools_78', 'ch9Using_Linux_Tools_79', 'ch9Using_Linux_Tools_7a', 'ch9Using_Linux_Tools_7b', 'ch9Using_Linux_Tools_7c', 'ch9Using_Linux_Tools_7d', 'ch9Using_Linux_Tools_7e', 'ch9Using_Linux_Tools_7f', 'ch9Using_Linux_Tools_80', 'ch9Using_Linux_Tools_81', 'ch9Using_Linux_Tools_82', 'ch9Using_Linux_Tools_83', 'ch9Using_Linux_Tools_84', 'ch9Using_Linux_Tools_85', 'ch9Using_Linux_Tools_86', 'ch9Using_Linux_Tools_87', 'ch9Using_Linux_Tools_88', 'ch9Using_Linux_Tools_89', 'ch9Using_Linux_Tools_8a', 'ch9Using_Linux_Tools_8b', 'ch9Using_Linux_Tools_8c', 'ch9Using_Linux_Tools_8d', 'ch9Using_Linux_Tools_8e', 'ch9Using_Linux_Tools_8f', 'ch9Using_Linux_Tools_90', 'ch9Using_Linux_Tools_91', 'ch9Using_Linux_Tools_92', 'ch9Using_Linux_Tools_93', 'ch9Using_Linux_Tools_94', 'ch9Using_Linux_Tools_95', 'ch9Using_Linux_Tools_96', 'ch9Using_Linux_Tools_97', 'ch9Using_Linux_Tools_98', 'ch9Using_Linux_Tools_99', 'ch9Using_Linux_Tools_9a', 'ch9Using_Linux_Tools_9b', 'ch9Using_Linux_Tools_9c', 'ch9Using_Linux_Tools_9d', 'ch9Using_Linux_Tools_9e', 'ch9Using_Linux_Tools_9f', 'ch9Using_Linux_Tools_a0', 'ch9Using_Linux_Tools_a1', 'ch9Using_Linux_Tools_a2', 'ch9Using_Linux_Tools_a3', 'ch9Using_Linux_Tools_a4', 'ch9Using_Linux_Tools_a5', 'ch9Using_Linux_Tools_a6', 'ch9Using_Linux_Tools_a7', 'ch9Using_Linux_Tools_a8', 'ch9Using_Linux_Tools_a9', 'ch9Using_Linux_Tools_aa', 'ch9Using_Linux_Tools_ab', 'ch9Using_Linux_Tools_ac', 'ch9Using_Linux_Tools_ad', 'ch9Using_Linux_Tools_ae', 'ch9Using_Linux_Tools_af', 'ch9Using_Linux_Tools_b0', 'ch9Using_Linux_Tools_b1', 'ch9Using_Linux_Tools_b2', 'ch9Using_Linux_Tools_b3', 'ch9Using_Linux_Tools_b4', 'ch9Using_Linux_Tools_b5', 'ch9Using_Linux_Tools_b6', 'ch9Using_Linux_Tools_b7', 'ch9Using_Linux_Tools_b8', 'ch9Using_Linux_Tools_b9', 'ch9Using_Linux_Tools_ba', 'ch9Using_Linux_Tools_bb', 'ch9Using_Linux_Tools_bc', 'ch9Using_Linux_Tools_bd', 'ch9Using_Linux_Tools_be', 'ch9Using_Linux_Tools_bf', 'ch9Using_Linux_Tools_c0', 'ch9Using_Linux_Tools_c1', 'ch9Using_Linux_Tools_c2', 'ch9Using_Linux_Tools_c3', 'ch9Using_Linux_Tools_c4', 'ch9Using_Linux_Tools_c5', 'ch9Using_Linux_Tools_c6', 'ch9Using_Linux_Tools_c7', 'ch9Using_Linux_Tools_c8', 'ch9Using_Linux_Tools_c9', 'ch9Using_Linux_Tools_ca', 'ch9Using_Linux_Tools_cb', 'ch9Using_Linux_Tools_cc', 'ch9Using_Linux_Tools_cd', 'ch9Using_Linux_Tools_ce', 'ch9Using_Linux_Tools_cf', 'ch9Using_Linux_Tools_d0', 'ch9Using_Linux_Tools_d1', 'ch9Using_Linux_Tools_d2', 'ch9Using_Linux_Tools_d3', 'ch9Using_Linux_Tools_d4', 'ch9Using_Linux_Tools_d5', 'ch9Using_Linux_Tools_d6', 'ch9Using_Linux_Tools_d7', 'ch9Using_Linux_Tools_d8', 'ch9Using_Linux_Tools_d9', 'ch9Using_Linux_Tools_da', 'ch9Using_Linux_Tools_db', 'ch9Using_Linux_Tools_dc', 'ch9Using_Linux_Tools_dd', 'ch9Using_Linux_Tools_de', 'ch9Using_Linux_Tools_df', 'ch9Using_Linux_Tools_e0', 'ch9Using_Linux_Tools_e1', 'ch9Using_Linux_Tools_e2', 'ch9Using_Linux_Tools_e3', 'ch9Using_Linux_Tools_e4', 'ch9Using_Linux_Tools_e5', 'ch9Using_Linux_Tools_e6', 'ch9Using_Linux_Tools_e7', 'ch9Using_Linux_Tools_e8', 'ch9Using_Linux_Tools_e9', 'ch9Using_Linux_Tools_ea', 'ch9Using_Linux_Tools_eb', 'ch9Using_Linux_Tools_ec', 'ch9Using_Linux_Tools_ed', 'ch9Using_Linux_Tools_ee', 'ch9Using_Linux_Tools_ef', 'ch9Using_Linux_Tools_f0', 'ch9Using_Linux_Tools_f1', 'ch9Using_Linux_Tools_f2', 'ch9Using_Linux_Tools_f3', 'ch9Using_Linux_Tools_f4', 'ch9Using_Linux_Tools_f5', 'ch9Using_Linux_Tools_f6', 'ch9Using_Linux_Tools_f7', 'ch9Using_Linux_Tools_f8', 'ch9Using_Linux_Tools_f9', 'ch9Using_Linux_Tools_fa', 'ch9Using_Linux_Tools_fb', 'ch9Using_Linux_Tools_fc', 'ch9Using_Linux_Tools_fd', 'ch9Using_Linux_Tools_fe', 'ch9Using_Linux_Tools_ff', 'ch9Using_Linux_Tools_100', 'ch9Using_Linux_Tools_101', 'ch9Using_Linux_Tools_102', 'ch9Using_Linux_Tools_103', 'ch9Using_Linux_Tools_104', 'ch9Using_Linux_Tools_105', 'ch9Using_Linux_Tools_106', 'ch9Using_Linux_Tools_107', 'ch9Using_Linux_Tools_108', 'ch9Using_Linux_Tools_109', 'ch9Using_Linux_Tools_10a', 'ch9Using_Linux_Tools_10b', 'ch9Using_Linux_Tools_10c', 'ch9Using_Linux_Tools_10d', 'ch9Using_Linux_Tools_10e', 'ch9Using_Linux_Tools_10f', 'ch9Using_Linux_Tools_110', 'ch9Using_Linux_Tools_111', 'ch9Using_Linux_Tools_112', 'ch9Using_Linux_Tools_113', 'ch9Using_Linux_Tools_114', 'ch9Using_Linux_Tools_115', 'ch9Using_Linux_Tools_116', 'ch9Using_Linux_Tools_117', 'ch9Using_Linux_Tools_118', 'ch9Using_Linux_Tools_119', 'ch9Using_Linux_Tools_11a', 'ch9Using_Linux_Tools_11b', 'ch9Using_Linux_Tools_11c', 'ch9Using_Linux_Tools_11d', 'ch9Using_Linux_Tools_11e', 'ch9Using_Linux_Tools_11f', 'ch9Using_Linux_Tools_120', 'ch9Using_Linux_Tools_121', 'ch9Using_Linux_Tools_122', 'ch9Using_Linux_Tools_123', 'ch9Using_Linux_Tools_124', 'ch9Using_Linux_Tools_125', 'ch9Using_Linux_Tools_126', 'ch9Using_Linux_Tools_127', 'ch9Using_Linux_Tools_128', 'ch9Using_Linux_Tools_129', 'ch9Using_Linux_Tools_12a', 'ch9Using_Linux_Tools_12b', 'ch9Using_Linux_Tools_12c', 'ch9Using_Linux_Tools_12d', 'ch9Using_Linux_Tools_12e', 'ch9Using_Linux_Tools_12f', 'ch9Using_Linux_Tools_130', 'ch9Using_Linux_Tools_131', 'ch9Using_Linux_Tools_132', 'ch9Using_Linux_Tools_133', 'ch9Using_Linux_Tools_134', 'ch9Using_Linux_Tools_135', 'ch9Using_Linux_Tools_136', 'ch9Using_Linux_Tools_137', 'ch9Using_Linux_Tools_138', 'ch9Using_Linux_Tools_139', 'ch9Using_Linux_Tools_13a', 'ch9Using_Linux_Tools_13b', 'ch9Using_Linux_Tools_13c', 'ch9Using_Linux_Tools_13d', 'ch9Using_Linux_Tools_13e', 'ch9Using_Linux_Tools_13f', 'ch9Using_Linux_Tools_140', 'ch9Using_Linux_Tools_141', 'ch9Using_Linux_Tools_142', 'ch9Using_Linux_Tools_143', 'ch9Using_Linux_Tools_144', 'ch9Using_Linux_Tools_145', 'ch9Using_Linux_Tools_146', 'ch9Using_Linux_Tools_147', 'ch9Using_Linux_Tools_148', 'ch9Using_Linux_Tools_149', 'ch9Using_Linux_Tools_14a', 'ch9Using_Linux_Tools_14b', 'ch9Using_Linux_Tools_14c', 'ch9Using_Linux_Tools_14d', 'ch9Using_Linux_Tools_14e', 'ch9Using_Linux_Tools_14f', 'ch9Using_Linux_Tools_150', 'ch9Using_Linux_Tools_151', 'ch9Using_Linux_Tools_152', 'ch9Using_Linux_Tools_153', 'ch9Using_Linux_Tools_154', 'ch9Using_Linux_Tools_155', 'ch9Using_Linux_Tools_156', 'ch9Using_Linux_Tools_157', 'ch9Using_Linux_Tools_158', 'ch9Using_Linux_Tools_159', 'ch9Using_Linux_Tools_15a', 'ch9Using_Linux_Tools_15b', 'ch9Using_Linux_Tools_15c', 'ch9Using_Linux_Tools_15d', 'ch9Using_Linux_Tools_15e', 'ch9Using_Linux_Tools_15f', 'ch9Using_Linux_Tools_160', 'ch9Using_Linux_Tools_161', 'ch9Using_Linux_Tools_162', 'ch9Using_Linux_Tools_163', 'ch9Using_Linux_Tools_164', 'ch9Using_Linux_Tools_165', 'ch9Using_Linux_Tools_166', 'ch9Using_Linux_Tools_167', 'ch9Using_Linux_Tools_168', 'ch9Using_Linux_Tools_169', 'ch9Using_Linux_Tools_16a', 'ch9Using_Linux_Tools_16b', 'ch9Using_Linux_Tools_16c', 'ch9Using_Linux_Tools_16d', 'ch9Using_Linux_Tools_16e', 'ch9Using_Linux_Tools_16f', 'ch9Using_Linux_Tools_170', 'ch9Using_Linux_Tools_171', 'ch9Using_Linux_Tools_172', 'ch9Using_Linux_Tools_173', 'ch9Using_Linux_Tools_174', 'ch9Using_Linux_Tools_175', 'ch9Using_Linux_Tools_176', 'ch9Using_Linux_Tools_177', 'ch9Using_Linux_Tools_178', 'ch9Using_Linux_Tools_179', 'ch9Using_Linux_Tools_17a', 'ch9Using_Linux_Tools_17b', 'ch9Using_Linux_Tools_17c', 'ch9Using_Linux_Tools_17d', 'ch9Using_Linux_Tools_17e', 'ch9Using_Linux_Tools_17f', 'ch9Using_Linux_Tools_180', 'ch9Using_Linux_Tools_181', 'ch9Using_Linux_Tools_182', 'ch9Using_Linux_Tools_183', 'ch9Using_Linux_Tools_184', 'ch9Using_Linux_Tools_185', 'ch9Using_Linux_Tools_186', 'ch9Using_Linux_Tools_187', 'ch9Using_Linux_Tools_188', 'ch9Using_Linux_Tools_189', 'ch9Using_Linux_Tools_18a', 'ch9Using_Linux_Tools_18b', 'ch9Using_Linux_Tools_18c', 'ch9Using_Linux_Tools_18d', 'ch9Using_Linux_Tools_18e', 'ch9Using_Linux_Tools_18f', 'ch9Using_Linux_Tools_190', 'ch9Using_Linux_Tools_191', 'ch9Using_Linux_Tools_192', 'ch9Using_Linux_Tools_193', 'ch9Using_Linux_Tools_194', 'ch9Using_Linux_Tools_195', 'ch9Using_Linux_Tools_196', 'ch9Using_Linux_Tools_197', 'ch9Using_Linux_Tools_198', 'ch9Using_Linux_Tools_199', 'ch9Using_Linux_Tools_19a', 'ch9Using_Linux_Tools_19b', 'ch9Using_Linux_Tools_19c', 'ch9Using_Linux_Tools_19d', 'ch9Using_Linux_Tools_19e', 'ch9Using_Linux_Tools_19f', 'ch9Using_Linux_Tools_1a0', 'ch9Using_Linux_Tools_1a1', 'ch9Using_Linux_Tools_1a2', 'ch9Using_Linux_Tools_1a3', 'ch9Using_Linux_Tools_1a4', 'ch9Using_Linux_Tools_1a5', 'ch9Using_Linux_Tools_1a6', 'ch9Using_Linux_Tools_1a7', 'ch9Using_Linux_Tools_1a8', 'ch9Using_Linux_Tools_1a9', 'ch9Using_Linux_Tools_1aa', 'ch9Using_Linux_Tools_1ab', 'ch9Using_Linux_Tools_1ac', 'ch9Using_Linux_Tools_1ad', 'ch9Using_Linux_Tools_1ae', 'ch9Using_Linux_Tools_1af', 'ch9Using_Linux_Tools_1b0', 'ch9Using_Linux_Tools_1b1', 'ch9Using_Linux_Tools_1b2', 'ch9Using_Linux_Tools_1b3', 'ch9Using_Linux_Tools_1b4', 'ch9Using_Linux_Tools_1b5', 'ch9Using_Linux_Tools_1b6', 'ch9Using_Linux_Tools_1b7', 'ch9Using_Linux_Tools_1b8', 'ch9Using_Linux_Tools_1b9', 'ch9Using_Linux_Tools_1ba', 'ch9Using_Linux_Tools_1bb', 'ch9Using_Linux_Tools_1bc', 'ch9Using_Linux_Tools_1bd', 'ch9Using_Linux_Tools_1be', 'ch9Using_Linux_Tools_1bf', 'ch9Using_Linux_Tools_1c0', 'ch9Using_Linux_Tools_1c1', 'ch9Using_Linux_Tools_1c2', 'ch9Using_Linux_Tools_1c3', 'ch9Using_Linux_Tools_1c4', 'ch9Using_Linux_Tools_1c5', 'ch9Using_Linux_Tools_1c6', 'ch9Using_Linux_Tools_1c7', 'ch9Using_Linux_Tools_1c8', 'ch9Using_Linux_Tools_1c9', 'ch9Using_Linux_Tools_1ca', 'ch9Using_Linux_Tools_1cb', 'ch9Using_Linux_Tools_1cc', 'ch9Using_Linux_Tools_1cd', 'ch9Using_Linux_Tools_1ce', 'ch9Using_Linux_Tools_1cf', 'ch9Using_Linux_Tools_1d0', 'ch9Using_Linux_Tools_1d1', 'ch9Using_Linux_Tools_1d2', 'ch9Using_Linux_Tools_1d3', 'ch9Using_Linux_Tools_1d4', 'ch9Using_Linux_Tools_1d5', 'ch9Using_Linux_Tools_1d6', 'ch9Using_Linux_Tools_1d7', 'ch9Using_Linux_Tools_1d8', 'ch9Using_Linux_Tools_1d9', 'ch9Using_Linux_Tools_1da', 'ch9Using_Linux_Tools_1db', 'ch9Using_Linux_Tools_1dc', 'ch9Using_Linux_Tools_1dd', 'ch9Using_Linux_Tools_1de', 'ch9Using_Linux_Tools_1df', 'ch9Using_Linux_Tools_1e0', 'ch9Using_Linux_Tools_1e1'], 'ch1Introduction': ['ch1Introduction_1', 'ch1Introduction_2', 'ch1Introduction_3', 'ch1Introduction_4', 'ch1Introduction_5', 'ch1Introduction_6', 'ch1Introduction_7', 'ch1Introduction_8', 'ch1Introduction_9', 'ch1Introduction_a', 'ch1Introduction_b', 'ch1Introduction_c', 'ch1Introduction_d', 'ch1Introduction_e', 'ch1Introduction_f', 'ch1Introduction_10', 'ch1Introduction_11', 'ch1Introduction_12', 'ch1Introduction_13', 'ch1Introduction_14', 'ch1Introduction_15', 'ch1Introduction_16', 'ch1Introduction_17', 'ch1Introduction_18', 'ch1Introduction_19', 'ch1Introduction_1a', 'ch1Introduction_1b', 'ch1Introduction_1c', 'ch1Introduction_1d', 'ch1Introduction_1e', 'ch1Introduction_1f', 'ch1Introduction_20', 'ch1Introduction_21', 'ch1Introduction_22', 'ch1Introduction_23', 'ch1Introduction_24', 'ch1Introduction_25', 'ch1Introduction_26', 'ch1Introduction_27', 'ch1Introduction_28', 'ch1Introduction_29', 'ch1Introduction_2a', 'ch1Introduction_2b', 'ch1Introduction_2c', 'ch1Introduction_2d', 'ch1Introduction_2e', 'ch1Introduction_2f', 'ch1Introduction_30', 'ch1Introduction_31', 'ch1Introduction_32', 'ch1Introduction_33', 'ch1Introduction_34', 'ch1Introduction_35', 'ch1Introduction_36', 'ch1Introduction_37', 'ch1Introduction_38', 'ch1Introduction_39', 'ch1Introduction_3a', 'ch1Introduction_3b', 'ch1Introduction_3c', 'ch1Introduction_3d', 'ch1Introduction_3e', 'ch1Introduction_3f', 'ch1Introduction_40', 'ch1Introduction_41', 'ch1Introduction_42', 'ch1Introduction_43', 'ch1Introduction_44', 'ch1Introduction_45', 'ch1Introduction_46', 'ch1Introduction_47', 'ch1Introduction_48', 'ch1Introduction_49', 'ch1Introduction_4a', 'ch1Introduction_4b', 'ch1Introduction_4c', 'ch1Introduction_4d', 'ch1Introduction_4e', 'ch1Introduction_4f', 'ch1Introduction_50', 'ch1Introduction_51', 'ch1Introduction_52', 'ch1Introduction_53', 'ch1Introduction_54', 'ch1Introduction_55', 'ch1Introduction_56', 'ch1Introduction_57', 'ch1Introduction_58', 'ch1Introduction_59', 'ch1Introduction_5a', 'ch1Introduction_5b', 'ch1Introduction_5c', 'ch1Introduction_5d', 'ch1Introduction_5e', 'ch1Introduction_5f', 'ch1Introduction_60', 'ch1Introduction_61', 'ch1Introduction_62', 'ch1Introduction_63', 'ch1Introduction_64', 'ch1Introduction_65', 'ch1Introduction_66', 'ch1Introduction_67', 'ch1Introduction_68', 'ch1Introduction_69', 'ch1Introduction_6a', 'ch1Introduction_6b', 'ch1Introduction_6c', 'ch1Introduction_6d', 'ch1Introduction_6e', 'ch1Introduction_6f', 'ch1Introduction_70', 'ch1Introduction_71', 'ch1Introduction_72', 'ch1Introduction_73', 'ch1Introduction_74', 'ch1Introduction_75', 'ch1Introduction_76', 'ch1Introduction_77', 'ch1Introduction_78', 'ch1Introduction_79', 'ch1Introduction_7a', 'ch1Introduction_7b', 'ch1Introduction_7c', 'ch1Introduction_7d', 'ch1Introduction_7e', 'ch1Introduction_7f', 'ch1Introduction_80', 'ch1Introduction_81', 'ch1Introduction_82', 'ch1Introduction_83', 'ch1Introduction_84', 'ch1Introduction_85', 'ch1Introduction_86', 'ch1Introduction_87', 'ch1Introduction_88', 'ch1Introduction_89', 'ch1Introduction_8a', 'ch1Introduction_8b', 'ch1Introduction_8c', 'ch1Introduction_8d', 'ch1Introduction_8e', 'ch1Introduction_8f', 'ch1Introduction_90', 'ch1Introduction_91', 'ch1Introduction_92', 'ch1Introduction_93', 'ch1Introduction_94', 'ch1Introduction_95', 'ch1Introduction_96', 'ch1Introduction_97', 'ch1Introduction_98', 'ch1Introduction_99', 'ch1Introduction_9a', 'ch1Introduction_9b', 'ch1Introduction_9c', 'ch1Introduction_9d', 'ch1Introduction_9e', 'ch1Introduction_9f', 'ch1Introduction_a0', 'ch1Introduction_a1', 'ch1Introduction_a2', 'ch1Introduction_a3', 'ch1Introduction_a4', 'ch1Introduction_a5', 'ch1Introduction_a6', 'ch1Introduction_a7', 'ch1Introduction_a8', 'ch1Introduction_a9', 'ch1Introduction_aa', 'ch1Introduction_ab', 'ch1Introduction_ac', 'ch1Introduction_ad', 'ch1Introduction_ae', 'ch1Introduction_af', 'ch1Introduction_b0', 'ch1Introduction_b1', 'ch1Introduction_b2', 'ch1Introduction_b3', 'ch1Introduction_b4', 'ch1Introduction_b5', 'ch1Introduction_b6', 'ch1Introduction_b7', 'ch1Introduction_b8', 'ch1Introduction_b9', 'ch1Introduction_ba', 'ch1Introduction_bb', 'ch1Introduction_bc', 'ch1Introduction_bd', 'ch1Introduction_be', 'ch1Introduction_bf', 'ch1Introduction_c0', 'ch1Introduction_c1', 'ch1Introduction_c2', 'ch1Introduction_c3', 'ch1Introduction_c4', 'ch1Introduction_c5', 'ch1Introduction_c6', 'ch1Introduction_c7', 'ch1Introduction_c8', 'ch1Introduction_c9', 'ch1Introduction_ca', 'ch1Introduction_cb', 'ch1Introduction_cc', 'ch1Introduction_cd', 'ch1Introduction_ce', 'ch1Introduction_cf', 'ch1Introduction_d0', 'ch1Introduction_d1', 'ch1Introduction_d2', 'ch1Introduction_d3', 'ch1Introduction_d4', 'ch1Introduction_d5', 'ch1Introduction_d6', 'ch1Introduction_d7', 'ch1Introduction_d8', 'ch1Introduction_d9', 'ch1Introduction_da', 'ch1Introduction_db', 'ch1Introduction_dc', 'ch1Introduction_dd', 'ch1Introduction_de', 'ch1Introduction_df', 'ch1Introduction_e0', 'ch1Introduction_e1', 'ch1Introduction_e2', 'ch1Introduction_e3', 'ch1Introduction_e4', 'ch1Introduction_e5', 'ch1Introduction_e6', 'ch1Introduction_e7', 'ch1Introduction_e8', 'ch1Introduction_e9', 'ch1Introduction_ea', 'ch1Introduction_eb', 'ch1Introduction_ec', 'ch1Introduction_ed', 'ch1Introduction_ee', 'ch1Introduction_ef', 'ch1Introduction_f0', 'ch1Introduction_f1', 'ch1Introduction_f2', 'ch1Introduction_f3', 'ch1Introduction_f4', 'ch1Introduction_f5', 'ch1Introduction_f6', 'ch1Introduction_f7', 'ch1Introduction_f8', 'ch1Introduction_f9', 'ch1Introduction_fa', 'ch1Introduction_fb', 'ch1Introduction_fc', 'ch1Introduction_fd', 'ch1Introduction_fe', 'ch1Introduction_ff', 'ch1Introduction_100', 'ch1Introduction_101', 'ch1Introduction_102', 'ch1Introduction_103', 'ch1Introduction_104', 'ch1Introduction_105', 'ch1Introduction_106', 'ch1Introduction_107', 'ch1Introduction_108', 'ch1Introduction_109', 'ch1Introduction_10a', 'ch1Introduction_10b', 'ch1Introduction_10c', 'ch1Introduction_10d', 'ch1Introduction_10e', 'ch1Introduction_10f', 'ch1Introduction_110', 'ch1Introduction_111', 'ch1Introduction_112', 'ch1Introduction_113', 'ch1Introduction_114', 'ch1Introduction_115', 'ch1Introduction_116', 'ch1Introduction_117', 'ch1Introduction_118', 'ch1Introduction_119', 'ch1Introduction_11a', 'ch1Introduction_11b', 'ch1Introduction_11c', 'ch1Introduction_11d', 'ch1Introduction_11e', 'ch1Introduction_11f', 'ch1Introduction_120', 'ch1Introduction_121', 'ch1Introduction_122', 'ch1Introduction_123', 'ch1Introduction_124', 'ch1Introduction_125', 'ch1Introduction_126', 'ch1Introduction_127', 'ch1Introduction_128', 'ch1Introduction_129', 'ch1Introduction_12a', 'ch1Introduction_12b', 'ch1Introduction_12c', 'ch1Introduction_12d', 'ch1Introduction_12e', 'ch1Introduction_12f', 'ch1Introduction_130', 'ch1Introduction_131', 'ch1Introduction_132', 'ch1Introduction_133', 'ch1Introduction_134', 'ch1Introduction_135', 'ch1Introduction_136', 'ch1Introduction_137', 'ch1Introduction_138', 'ch1Introduction_139', 'ch1Introduction_13a', 'ch1Introduction_13b', 'ch1Introduction_13c', 'ch1Introduction_13d', 'ch1Introduction_13e', 'ch1Introduction_13f', 'ch1Introduction_140', 'ch1Introduction_141', 'ch1Introduction_142', 'ch1Introduction_143', 'ch1Introduction_144', 'ch1Introduction_145', 'ch1Introduction_146', 'ch1Introduction_147', 'ch1Introduction_148', 'ch1Introduction_149', 'ch1Introduction_14a', 'ch1Introduction_14b', 'ch1Introduction_14c', 'ch1Introduction_14d', 'ch1Introduction_14e', 'ch1Introduction_14f', 'ch1Introduction_150', 'ch1Introduction_151', 'ch1Introduction_152', 'ch1Introduction_153', 'ch1Introduction_154', 'ch1Introduction_155', 'ch1Introduction_156', 'ch1Introduction_157', 'ch1Introduction_158', 'ch1Introduction_159', 'ch1Introduction_15a', 'ch1Introduction_15b', 'ch1Introduction_15c', 'ch1Introduction_15d', 'ch1Introduction_15e', 'ch1Introduction_15f', 'ch1Introduction_160', 'ch1Introduction_161', 'ch1Introduction_162', 'ch1Introduction_163', 'ch1Introduction_164', 'ch1Introduction_165', 'ch1Introduction_166', 'ch1Introduction_167', 'ch1Introduction_168', 'ch1Introduction_169', 'ch1Introduction_16a', 'ch1Introduction_16b', 'ch1Introduction_16c', 'ch1Introduction_16d', 'ch1Introduction_16e', 'ch1Introduction_16f', 'ch1Introduction_170', 'ch1Introduction_171', 'ch1Introduction_172', 'ch1Introduction_173', 'ch1Introduction_174', 'ch1Introduction_175', 'ch1Introduction_176', 'ch1Introduction_177', 'ch1Introduction_178', 'ch1Introduction_179', 'ch1Introduction_17a', 'ch1Introduction_17b', 'ch1Introduction_17c', 'ch1Introduction_17d', 'ch1Introduction_17e', 'ch1Introduction_17f', 'ch1Introduction_180', 'ch1Introduction_181', 'ch1Introduction_182', 'ch1Introduction_183', 'ch1Introduction_184', 'ch1Introduction_185', 'ch1Introduction_186', 'ch1Introduction_187', 'ch1Introduction_188', 'ch1Introduction_189', 'ch1Introduction_18a', 'ch1Introduction_18b', 'ch1Introduction_18c', 'ch1Introduction_18d', 'ch1Introduction_18e', 'ch1Introduction_18f', 'ch1Introduction_190', 'ch1Introduction_191', 'ch1Introduction_192', 'ch1Introduction_193', 'ch1Introduction_194', 'ch1Introduction_195', 'ch1Introduction_196', 'ch1Introduction_197', 'ch1Introduction_198', 'ch1Introduction_199', 'ch1Introduction_19a', 'ch1Introduction_19b', 'ch1Introduction_19c', 'ch1Introduction_19d', 'ch1Introduction_19e', 'ch1Introduction_19f', 'ch1Introduction_1a0', 'ch1Introduction_1a1', 'ch1Introduction_1a2', 'ch1Introduction_1a3', 'ch1Introduction_1a4', 'ch1Introduction_1a5', 'ch1Introduction_1a6', 'ch1Introduction_1a7', 'ch1Introduction_1a8', 'ch1Introduction_1a9', 'ch1Introduction_1aa', 'ch1Introduction_1ab', 'ch1Introduction_1ac', 'ch1Introduction_1ad', 'ch1Introduction_1ae', 'ch1Introduction_1af', 'ch1Introduction_1b0', 'ch1Introduction_1b1', 'ch1Introduction_1b2', 'ch1Introduction_1b3', 'ch1Introduction_1b4', 'ch1Introduction_1b5', 'ch1Introduction_1b6', 'ch1Introduction_1b7', 'ch1Introduction_1b8', 'ch1Introduction_1b9', 'ch1Introduction_1ba', 'ch1Introduction_1bb', 'ch1Introduction_1bc', 'ch1Introduction_1bd', 'ch1Introduction_1be', 'ch1Introduction_1bf', 'ch1Introduction_1c0', 'ch1Introduction_1c1', 'ch1Introduction_1c2', 'ch1Introduction_1c3', 'ch1Introduction_1c4', 'ch1Introduction_1c5', 'ch1Introduction_1c6', 'ch1Introduction_1c7', 'ch1Introduction_1c8', 'ch1Introduction_1c9', 'ch1Introduction_1ca', 'ch1Introduction_1cb', 'ch1Introduction_1cc', 'ch1Introduction_1cd', 'ch1Introduction_1ce', 'ch1Introduction_1cf', 'ch1Introduction_1d0', 'ch1Introduction_1d1', 'ch1Introduction_1d2', 'ch1Introduction_1d3', 'ch1Introduction_1d4', 'ch1Introduction_1d5', 'ch1Introduction_1d6', 'ch1Introduction_1d7', 'ch1Introduction_1d8', 'ch1Introduction_1d9', 'ch1Introduction_1da', 'ch1Introduction_1db', 'ch1Introduction_1dc', 'ch1Introduction_1dd', 'ch1Introduction_1de', 'ch1Introduction_1df', 'ch1Introduction_1e0', 'ch1Introduction_1e1'], 'ch5func': ['ch5func_1', 'ch5func_2', 'ch5func_3', 'ch5func_4', 'ch5func_5', 'ch5func_6', 'ch5func_7', 'ch5func_8', 'ch5func_9', 'ch5func_a', 'ch5func_b', 'ch5func_c', 'ch5func_d', 'ch5func_e', 'ch5func_f', 'ch5func_10', 'ch5func_11', 'ch5func_12', 'ch5func_13', 'ch5func_14', 'ch5func_15', 'ch5func_16', 'ch5func_17', 'ch5func_18', 'ch5func_19', 'ch5func_1a', 'ch5func_1b', 'ch5func_1c', 'ch5func_1d', 'ch5func_1e', 'ch5func_1f', 'ch5func_20', 'ch5func_21', 'ch5func_22', 'ch5func_23', 'ch5func_24', 'ch5func_25', 'ch5func_26', 'ch5func_27', 'ch5func_28', 'ch5func_29', 'ch5func_2a', 'ch5func_2b', 'ch5func_2c', 'ch5func_2d', 'ch5func_2e', 'ch5func_2f', 'ch5func_30', 'ch5func_31', 'ch5func_32', 'ch5func_33', 'ch5func_34', 'ch5func_35', 'ch5func_36', 'ch5func_37', 'ch5func_38', 'ch5func_39', 'ch5func_3a', 'ch5func_3b', 'ch5func_3c', 'ch5func_3d', 'ch5func_3e', 'ch5func_3f', 'ch5func_40', 'ch5func_41', 'ch5func_42', 'ch5func_43', 'ch5func_44', 'ch5func_45', 'ch5func_46', 'ch5func_47', 'ch5func_48', 'ch5func_49', 'ch5func_4a', 'ch5func_4b', 'ch5func_4c', 'ch5func_4d', 'ch5func_4e', 'ch5func_4f', 'ch5func_50', 'ch5func_51', 'ch5func_52', 'ch5func_53', 'ch5func_54', 'ch5func_55', 'ch5func_56', 'ch5func_57', 'ch5func_58', 'ch5func_59', 'ch5func_5a', 'ch5func_5b', 'ch5func_5c', 'ch5func_5d', 'ch5func_5e', 'ch5func_5f', 'ch5func_60', 'ch5func_61', 'ch5func_62', 'ch5func_63', 'ch5func_64', 'ch5func_65', 'ch5func_66', 'ch5func_67', 'ch5func_68', 'ch5func_69', 'ch5func_6a', 'ch5func_6b', 'ch5func_6c', 'ch5func_6d', 'ch5func_6e', 'ch5func_6f', 'ch5func_70', 'ch5func_71', 'ch5func_72', 'ch5func_73', 'ch5func_74', 'ch5func_75', 'ch5func_76', 'ch5func_77', 'ch5func_78', 'ch5func_79', 'ch5func_7a', 'ch5func_7b', 'ch5func_7c', 'ch5func_7d', 'ch5func_7e', 'ch5func_7f', 'ch5func_80', 'ch5func_81', 'ch5func_82', 'ch5func_83', 'ch5func_84', 'ch5func_85', 'ch5func_86', 'ch5func_87', 'ch5func_88', 'ch5func_89', 'ch5func_8a', 'ch5func_8b', 'ch5func_8c', 'ch5func_8d', 'ch5func_8e', 'ch5func_8f', 'ch5func_90', 'ch5func_91', 'ch5func_92', 'ch5func_93', 'ch5func_94', 'ch5func_95', 'ch5func_96', 'ch5func_97', 'ch5func_98', 'ch5func_99', 'ch5func_9a', 'ch5func_9b', 'ch5func_9c', 'ch5func_9d', 'ch5func_9e', 'ch5func_9f', 'ch5func_a0', 'ch5func_a1', 'ch5func_a2', 'ch5func_a3', 'ch5func_a4', 'ch5func_a5', 'ch5func_a6', 'ch5func_a7', 'ch5func_a8', 'ch5func_a9', 'ch5func_aa', 'ch5func_ab', 'ch5func_ac', 'ch5func_ad', 'ch5func_ae', 'ch5func_af', 'ch5func_b0', 'ch5func_b1', 'ch5func_b2', 'ch5func_b3', 'ch5func_b4', 'ch5func_b5', 'ch5func_b6', 'ch5func_b7', 'ch5func_b8', 'ch5func_b9', 'ch5func_ba', 'ch5func_bb', 'ch5func_bc', 'ch5func_bd', 'ch5func_be', 'ch5func_bf', 'ch5func_c0', 'ch5func_c1', 'ch5func_c2', 'ch5func_c3', 'ch5func_c4', 'ch5func_c5', 'ch5func_c6', 'ch5func_c7', 'ch5func_c8', 'ch5func_c9', 'ch5func_ca', 'ch5func_cb', 'ch5func_cc', 'ch5func_cd', 'ch5func_ce', 'ch5func_cf', 'ch5func_d0', 'ch5func_d1', 'ch5func_d2', 'ch5func_d3', 'ch5func_d4', 'ch5func_d5', 'ch5func_d6', 'ch5func_d7', 'ch5func_d8', 'ch5func_d9', 'ch5func_da', 'ch5func_db', 'ch5func_dc', 'ch5func_dd', 'ch5func_de', 'ch5func_df', 'ch5func_e0', 'ch5func_e1', 'ch5func_e2', 'ch5func_e3', 'ch5func_e4', 'ch5func_e5', 'ch5func_e6', 'ch5func_e7', 'ch5func_e8', 'ch5func_e9', 'ch5func_ea', 'ch5func_eb', 'ch5func_ec', 'ch5func_ed', 'ch5func_ee', 'ch5func_ef', 'ch5func_f0', 'ch5func_f1', 'ch5func_f2', 'ch5func_f3', 'ch5func_f4', 'ch5func_f5', 'ch5func_f6', 'ch5func_f7', 'ch5func_f8', 'ch5func_f9', 'ch5func_fa', 'ch5func_fb', 'ch5func_fc', 'ch5func_fd', 'ch5func_fe', 'ch5func_ff', 'ch5func_100', 'ch5func_101', 'ch5func_102', 'ch5func_103', 'ch5func_104', 'ch5func_105', 'ch5func_106', 'ch5func_107', 'ch5func_108', 'ch5func_109', 'ch5func_10a', 'ch5func_10b', 'ch5func_10c', 'ch5func_10d', 'ch5func_10e', 'ch5func_10f', 'ch5func_110', 'ch5func_111', 'ch5func_112', 'ch5func_113', 'ch5func_114', 'ch5func_115', 'ch5func_116', 'ch5func_117', 'ch5func_118', 'ch5func_119', 'ch5func_11a', 'ch5func_11b', 'ch5func_11c', 'ch5func_11d', 'ch5func_11e', 'ch5func_11f', 'ch5func_120', 'ch5func_121', 'ch5func_122', 'ch5func_123', 'ch5func_124', 'ch5func_125', 'ch5func_126', 'ch5func_127', 'ch5func_128', 'ch5func_129', 'ch5func_12a', 'ch5func_12b', 'ch5func_12c', 'ch5func_12d', 'ch5func_12e', 'ch5func_12f', 'ch5func_130', 'ch5func_131', 'ch5func_132', 'ch5func_133', 'ch5func_134', 'ch5func_135', 'ch5func_136', 'ch5func_137', 'ch5func_138', 'ch5func_139', 'ch5func_13a', 'ch5func_13b', 'ch5func_13c', 'ch5func_13d', 'ch5func_13e', 'ch5func_13f', 'ch5func_140', 'ch5func_141', 'ch5func_142', 'ch5func_143', 'ch5func_144', 'ch5func_145', 'ch5func_146', 'ch5func_147', 'ch5func_148', 'ch5func_149', 'ch5func_14a', 'ch5func_14b', 'ch5func_14c', 'ch5func_14d', 'ch5func_14e', 'ch5func_14f', 'ch5func_150', 'ch5func_151', 'ch5func_152', 'ch5func_153', 'ch5func_154', 'ch5func_155', 'ch5func_156', 'ch5func_157', 'ch5func_158', 'ch5func_159', 'ch5func_15a', 'ch5func_15b', 'ch5func_15c', 'ch5func_15d', 'ch5func_15e', 'ch5func_15f', 'ch5func_160', 'ch5func_161', 'ch5func_162', 'ch5func_163', 'ch5func_164', 'ch5func_165', 'ch5func_166', 'ch5func_167', 'ch5func_168', 'ch5func_169', 'ch5func_16a', 'ch5func_16b', 'ch5func_16c', 'ch5func_16d', 'ch5func_16e', 'ch5func_16f', 'ch5func_170', 'ch5func_171', 'ch5func_172', 'ch5func_173', 'ch5func_174', 'ch5func_175', 'ch5func_176', 'ch5func_177', 'ch5func_178', 'ch5func_179', 'ch5func_17a', 'ch5func_17b', 'ch5func_17c', 'ch5func_17d', 'ch5func_17e', 'ch5func_17f', 'ch5func_180', 'ch5func_181', 'ch5func_182', 'ch5func_183', 'ch5func_184', 'ch5func_185', 'ch5func_186', 'ch5func_187', 'ch5func_188', 'ch5func_189', 'ch5func_18a', 'ch5func_18b', 'ch5func_18c', 'ch5func_18d', 'ch5func_18e', 'ch5func_18f', 'ch5func_190', 'ch5func_191', 'ch5func_192', 'ch5func_193', 'ch5func_194', 'ch5func_195', 'ch5func_196', 'ch5func_197', 'ch5func_198', 'ch5func_199', 'ch5func_19a', 'ch5func_19b', 'ch5func_19c', 'ch5func_19d', 'ch5func_19e', 'ch5func_19f', 'ch5func_1a0', 'ch5func_1a1', 'ch5func_1a2', 'ch5func_1a3', 'ch5func_1a4', 'ch5func_1a5', 'ch5func_1a6', 'ch5func_1a7', 'ch5func_1a8', 'ch5func_1a9', 'ch5func_1aa', 'ch5func_1ab', 'ch5func_1ac', 'ch5func_1ad', 'ch5func_1ae', 'ch5func_1af', 'ch5func_1b0', 'ch5func_1b1', 'ch5func_1b2', 'ch5func_1b3', 'ch5func_1b4', 'ch5func_1b5', 'ch5func_1b6', 'ch5func_1b7', 'ch5func_1b8', 'ch5func_1b9', 'ch5func_1ba', 'ch5func_1bb', 'ch5func_1bc', 'ch5func_1bd', 'ch5func_1be', 'ch5func_1bf', 'ch5func_1c0', 'ch5func_1c1', 'ch5func_1c2', 'ch5func_1c3', 'ch5func_1c4', 'ch5func_1c5', 'ch5func_1c6', 'ch5func_1c7', 'ch5func_1c8', 'ch5func_1c9', 'ch5func_1ca', 'ch5func_1cb', 'ch5func_1cc', 'ch5func_1cd', 'ch5func_1ce', 'ch5func_1cf', 'ch5func_1d0', 'ch5func_1d1', 'ch5func_1d2', 'ch5func_1d3', 'ch5func_1d4', 'ch5func_1d5', 'ch5func_1d6', 'ch5func_1d7', 'ch5func_1d8', 'ch5func_1d9', 'ch5func_1da', 'ch5func_1db', 'ch5func_1dc', 'ch5func_1dd', 'ch5func_1de', 'ch5func_1df', 'ch5func_1e0', 'ch5func_1e1'], 'ch3list_tuples': ['ch3list_tuples_1', 'ch3list_tuples_2', 'ch3list_tuples_3', 'ch3list_tuples_4', 'ch3list_tuples_5', 'ch3list_tuples_6', 'ch3list_tuples_7', 'ch3list_tuples_8', 'ch3list_tuples_9', 'ch3list_tuples_a', 'ch3list_tuples_b', 'ch3list_tuples_c', 'ch3list_tuples_d', 'ch3list_tuples_e', 'ch3list_tuples_f', 'ch3list_tuples_10', 'ch3list_tuples_11', 'ch3list_tuples_12', 'ch3list_tuples_13', 'ch3list_tuples_14', 'ch3list_tuples_15', 'ch3list_tuples_16', 'ch3list_tuples_17', 'ch3list_tuples_18', 'ch3list_tuples_19', 'ch3list_tuples_1a', 'ch3list_tuples_1b', 'ch3list_tuples_1c', 'ch3list_tuples_1d', 'ch3list_tuples_1e', 'ch3list_tuples_1f', 'ch3list_tuples_20', 'ch3list_tuples_21', 'ch3list_tuples_22', 'ch3list_tuples_23', 'ch3list_tuples_24', 'ch3list_tuples_25', 'ch3list_tuples_26', 'ch3list_tuples_27', 'ch3list_tuples_28', 'ch3list_tuples_29', 'ch3list_tuples_2a', 'ch3list_tuples_2b', 'ch3list_tuples_2c', 'ch3list_tuples_2d', 'ch3list_tuples_2e', 'ch3list_tuples_2f', 'ch3list_tuples_30', 'ch3list_tuples_31', 'ch3list_tuples_32', 'ch3list_tuples_33', 'ch3list_tuples_34', 'ch3list_tuples_35', 'ch3list_tuples_36', 'ch3list_tuples_37', 'ch3list_tuples_38', 'ch3list_tuples_39', 'ch3list_tuples_3a', 'ch3list_tuples_3b', 'ch3list_tuples_3c', 'ch3list_tuples_3d', 'ch3list_tuples_3e', 'ch3list_tuples_3f', 'ch3list_tuples_40', 'ch3list_tuples_41', 'ch3list_tuples_42', 'ch3list_tuples_43', 'ch3list_tuples_44', 'ch3list_tuples_45', 'ch3list_tuples_46', 'ch3list_tuples_47', 'ch3list_tuples_48', 'ch3list_tuples_49', 'ch3list_tuples_4a', 'ch3list_tuples_4b', 'ch3list_tuples_4c', 'ch3list_tuples_4d', 'ch3list_tuples_4e', 'ch3list_tuples_4f', 'ch3list_tuples_50', 'ch3list_tuples_51', 'ch3list_tuples_52', 'ch3list_tuples_53', 'ch3list_tuples_54', 'ch3list_tuples_55', 'ch3list_tuples_56', 'ch3list_tuples_57', 'ch3list_tuples_58', 'ch3list_tuples_59', 'ch3list_tuples_5a', 'ch3list_tuples_5b', 'ch3list_tuples_5c', 'ch3list_tuples_5d', 'ch3list_tuples_5e', 'ch3list_tuples_5f', 'ch3list_tuples_60', 'ch3list_tuples_61', 'ch3list_tuples_62', 'ch3list_tuples_63', 'ch3list_tuples_64', 'ch3list_tuples_65', 'ch3list_tuples_66', 'ch3list_tuples_67', 'ch3list_tuples_68', 'ch3list_tuples_69', 'ch3list_tuples_6a', 'ch3list_tuples_6b', 'ch3list_tuples_6c', 'ch3list_tuples_6d', 'ch3list_tuples_6e', 'ch3list_tuples_6f', 'ch3list_tuples_70', 'ch3list_tuples_71', 'ch3list_tuples_72', 'ch3list_tuples_73', 'ch3list_tuples_74', 'ch3list_tuples_75', 'ch3list_tuples_76', 'ch3list_tuples_77', 'ch3list_tuples_78', 'ch3list_tuples_79', 'ch3list_tuples_7a', 'ch3list_tuples_7b', 'ch3list_tuples_7c', 'ch3list_tuples_7d', 'ch3list_tuples_7e', 'ch3list_tuples_7f', 'ch3list_tuples_80', 'ch3list_tuples_81', 'ch3list_tuples_82', 'ch3list_tuples_83', 'ch3list_tuples_84', 'ch3list_tuples_85', 'ch3list_tuples_86', 'ch3list_tuples_87', 'ch3list_tuples_88', 'ch3list_tuples_89', 'ch3list_tuples_8a', 'ch3list_tuples_8b', 'ch3list_tuples_8c', 'ch3list_tuples_8d', 'ch3list_tuples_8e', 'ch3list_tuples_8f', 'ch3list_tuples_90', 'ch3list_tuples_91', 'ch3list_tuples_92', 'ch3list_tuples_93', 'ch3list_tuples_94', 'ch3list_tuples_95', 'ch3list_tuples_96', 'ch3list_tuples_97', 'ch3list_tuples_98', 'ch3list_tuples_99', 'ch3list_tuples_9a', 'ch3list_tuples_9b', 'ch3list_tuples_9c', 'ch3list_tuples_9d', 'ch3list_tuples_9e', 'ch3list_tuples_9f', 'ch3list_tuples_a0', 'ch3list_tuples_a1', 'ch3list_tuples_a2', 'ch3list_tuples_a3', 'ch3list_tuples_a4', 'ch3list_tuples_a5', 'ch3list_tuples_a6', 'ch3list_tuples_a7', 'ch3list_tuples_a8', 'ch3list_tuples_a9', 'ch3list_tuples_aa', 'ch3list_tuples_ab', 'ch3list_tuples_ac', 'ch3list_tuples_ad', 'ch3list_tuples_ae', 'ch3list_tuples_af', 'ch3list_tuples_b0', 'ch3list_tuples_b1', 'ch3list_tuples_b2', 'ch3list_tuples_b3', 'ch3list_tuples_b4', 'ch3list_tuples_b5', 'ch3list_tuples_b6', 'ch3list_tuples_b7', 'ch3list_tuples_b8', 'ch3list_tuples_b9', 'ch3list_tuples_ba', 'ch3list_tuples_bb', 'ch3list_tuples_bc', 'ch3list_tuples_bd', 'ch3list_tuples_be', 'ch3list_tuples_bf', 'ch3list_tuples_c0', 'ch3list_tuples_c1', 'ch3list_tuples_c2', 'ch3list_tuples_c3', 'ch3list_tuples_c4', 'ch3list_tuples_c5', 'ch3list_tuples_c6', 'ch3list_tuples_c7', 'ch3list_tuples_c8', 'ch3list_tuples_c9', 'ch3list_tuples_ca', 'ch3list_tuples_cb', 'ch3list_tuples_cc', 'ch3list_tuples_cd', 'ch3list_tuples_ce', 'ch3list_tuples_cf', 'ch3list_tuples_d0', 'ch3list_tuples_d1', 'ch3list_tuples_d2', 'ch3list_tuples_d3', 'ch3list_tuples_d4', 'ch3list_tuples_d5', 'ch3list_tuples_d6', 'ch3list_tuples_d7', 'ch3list_tuples_d8', 'ch3list_tuples_d9', 'ch3list_tuples_da', 'ch3list_tuples_db', 'ch3list_tuples_dc', 'ch3list_tuples_dd', 'ch3list_tuples_de', 'ch3list_tuples_df', 'ch3list_tuples_e0', 'ch3list_tuples_e1', 'ch3list_tuples_e2', 'ch3list_tuples_e3', 'ch3list_tuples_e4', 'ch3list_tuples_e5', 'ch3list_tuples_e6', 'ch3list_tuples_e7', 'ch3list_tuples_e8', 'ch3list_tuples_e9', 'ch3list_tuples_ea', 'ch3list_tuples_eb', 'ch3list_tuples_ec', 'ch3list_tuples_ed', 'ch3list_tuples_ee', 'ch3list_tuples_ef', 'ch3list_tuples_f0', 'ch3list_tuples_f1', 'ch3list_tuples_f2', 'ch3list_tuples_f3', 'ch3list_tuples_f4', 'ch3list_tuples_f5', 'ch3list_tuples_f6', 'ch3list_tuples_f7', 'ch3list_tuples_f8', 'ch3list_tuples_f9', 'ch3list_tuples_fa', 'ch3list_tuples_fb', 'ch3list_tuples_fc', 'ch3list_tuples_fd', 'ch3list_tuples_fe', 'ch3list_tuples_ff', 'ch3list_tuples_100', 'ch3list_tuples_101', 'ch3list_tuples_102', 'ch3list_tuples_103', 'ch3list_tuples_104', 'ch3list_tuples_105', 'ch3list_tuples_106', 'ch3list_tuples_107', 'ch3list_tuples_108', 'ch3list_tuples_109', 'ch3list_tuples_10a', 'ch3list_tuples_10b', 'ch3list_tuples_10c', 'ch3list_tuples_10d', 'ch3list_tuples_10e', 'ch3list_tuples_10f', 'ch3list_tuples_110', 'ch3list_tuples_111', 'ch3list_tuples_112', 'ch3list_tuples_113', 'ch3list_tuples_114', 'ch3list_tuples_115', 'ch3list_tuples_116', 'ch3list_tuples_117', 'ch3list_tuples_118', 'ch3list_tuples_119', 'ch3list_tuples_11a', 'ch3list_tuples_11b', 'ch3list_tuples_11c', 'ch3list_tuples_11d', 'ch3list_tuples_11e', 'ch3list_tuples_11f', 'ch3list_tuples_120', 'ch3list_tuples_121', 'ch3list_tuples_122', 'ch3list_tuples_123', 'ch3list_tuples_124', 'ch3list_tuples_125', 'ch3list_tuples_126', 'ch3list_tuples_127', 'ch3list_tuples_128', 'ch3list_tuples_129', 'ch3list_tuples_12a', 'ch3list_tuples_12b', 'ch3list_tuples_12c', 'ch3list_tuples_12d', 'ch3list_tuples_12e', 'ch3list_tuples_12f', 'ch3list_tuples_130', 'ch3list_tuples_131', 'ch3list_tuples_132', 'ch3list_tuples_133', 'ch3list_tuples_134', 'ch3list_tuples_135', 'ch3list_tuples_136', 'ch3list_tuples_137', 'ch3list_tuples_138', 'ch3list_tuples_139', 'ch3list_tuples_13a', 'ch3list_tuples_13b', 'ch3list_tuples_13c', 'ch3list_tuples_13d', 'ch3list_tuples_13e', 'ch3list_tuples_13f', 'ch3list_tuples_140', 'ch3list_tuples_141', 'ch3list_tuples_142', 'ch3list_tuples_143', 'ch3list_tuples_144', 'ch3list_tuples_145', 'ch3list_tuples_146', 'ch3list_tuples_147', 'ch3list_tuples_148', 'ch3list_tuples_149', 'ch3list_tuples_14a', 'ch3list_tuples_14b', 'ch3list_tuples_14c', 'ch3list_tuples_14d', 'ch3list_tuples_14e', 'ch3list_tuples_14f', 'ch3list_tuples_150', 'ch3list_tuples_151', 'ch3list_tuples_152', 'ch3list_tuples_153', 'ch3list_tuples_154', 'ch3list_tuples_155', 'ch3list_tuples_156', 'ch3list_tuples_157', 'ch3list_tuples_158', 'ch3list_tuples_159', 'ch3list_tuples_15a', 'ch3list_tuples_15b', 'ch3list_tuples_15c', 'ch3list_tuples_15d', 'ch3list_tuples_15e', 'ch3list_tuples_15f', 'ch3list_tuples_160', 'ch3list_tuples_161', 'ch3list_tuples_162', 'ch3list_tuples_163', 'ch3list_tuples_164', 'ch3list_tuples_165', 'ch3list_tuples_166', 'ch3list_tuples_167', 'ch3list_tuples_168', 'ch3list_tuples_169', 'ch3list_tuples_16a', 'ch3list_tuples_16b', 'ch3list_tuples_16c', 'ch3list_tuples_16d', 'ch3list_tuples_16e', 'ch3list_tuples_16f', 'ch3list_tuples_170', 'ch3list_tuples_171', 'ch3list_tuples_172', 'ch3list_tuples_173', 'ch3list_tuples_174', 'ch3list_tuples_175', 'ch3list_tuples_176', 'ch3list_tuples_177', 'ch3list_tuples_178', 'ch3list_tuples_179', 'ch3list_tuples_17a', 'ch3list_tuples_17b', 'ch3list_tuples_17c', 'ch3list_tuples_17d', 'ch3list_tuples_17e', 'ch3list_tuples_17f', 'ch3list_tuples_180', 'ch3list_tuples_181', 'ch3list_tuples_182', 'ch3list_tuples_183', 'ch3list_tuples_184', 'ch3list_tuples_185', 'ch3list_tuples_186', 'ch3list_tuples_187', 'ch3list_tuples_188', 'ch3list_tuples_189', 'ch3list_tuples_18a', 'ch3list_tuples_18b', 'ch3list_tuples_18c', 'ch3list_tuples_18d', 'ch3list_tuples_18e', 'ch3list_tuples_18f', 'ch3list_tuples_190', 'ch3list_tuples_191', 'ch3list_tuples_192', 'ch3list_tuples_193', 'ch3list_tuples_194', 'ch3list_tuples_195', 'ch3list_tuples_196', 'ch3list_tuples_197', 'ch3list_tuples_198', 'ch3list_tuples_199', 'ch3list_tuples_19a', 'ch3list_tuples_19b', 'ch3list_tuples_19c', 'ch3list_tuples_19d', 'ch3list_tuples_19e', 'ch3list_tuples_19f', 'ch3list_tuples_1a0', 'ch3list_tuples_1a1', 'ch3list_tuples_1a2', 'ch3list_tuples_1a3', 'ch3list_tuples_1a4', 'ch3list_tuples_1a5', 'ch3list_tuples_1a6', 'ch3list_tuples_1a7', 'ch3list_tuples_1a8', 'ch3list_tuples_1a9', 'ch3list_tuples_1aa', 'ch3list_tuples_1ab', 'ch3list_tuples_1ac', 'ch3list_tuples_1ad', 'ch3list_tuples_1ae', 'ch3list_tuples_1af', 'ch3list_tuples_1b0', 'ch3list_tuples_1b1', 'ch3list_tuples_1b2', 'ch3list_tuples_1b3', 'ch3list_tuples_1b4', 'ch3list_tuples_1b5', 'ch3list_tuples_1b6', 'ch3list_tuples_1b7', 'ch3list_tuples_1b8', 'ch3list_tuples_1b9', 'ch3list_tuples_1ba', 'ch3list_tuples_1bb', 'ch3list_tuples_1bc', 'ch3list_tuples_1bd', 'ch3list_tuples_1be', 'ch3list_tuples_1bf', 'ch3list_tuples_1c0', 'ch3list_tuples_1c1', 'ch3list_tuples_1c2', 'ch3list_tuples_1c3', 'ch3list_tuples_1c4', 'ch3list_tuples_1c5', 'ch3list_tuples_1c6', 'ch3list_tuples_1c7', 'ch3list_tuples_1c8', 'ch3list_tuples_1c9', 'ch3list_tuples_1ca', 'ch3list_tuples_1cb', 'ch3list_tuples_1cc', 'ch3list_tuples_1cd', 'ch3list_tuples_1ce', 'ch3list_tuples_1cf', 'ch3list_tuples_1d0', 'ch3list_tuples_1d1', 'ch3list_tuples_1d2', 'ch3list_tuples_1d3', 'ch3list_tuples_1d4', 'ch3list_tuples_1d5', 'ch3list_tuples_1d6', 'ch3list_tuples_1d7', 'ch3list_tuples_1d8', 'ch3list_tuples_1d9', 'ch3list_tuples_1da', 'ch3list_tuples_1db', 'ch3list_tuples_1dc', 'ch3list_tuples_1dd', 'ch3list_tuples_1de', 'ch3list_tuples_1df', 'ch3list_tuples_1e0', 'ch3list_tuples_1e1'], 'ch2intro': ['ch2intro_1', 'ch2intro_2', 'ch2intro_3', 'ch2intro_4', 'ch2intro_5', 'ch2intro_6', 'ch2intro_7', 'ch2intro_8', 'ch2intro_9', 'ch2intro_a', 'ch2intro_b', 'ch2intro_c', 'ch2intro_d', 'ch2intro_e', 'ch2intro_f', 'ch2intro_10', 'ch2intro_11', 'ch2intro_12', 'ch2intro_13', 'ch2intro_14', 'ch2intro_15', 'ch2intro_16', 'ch2intro_17', 'ch2intro_18', 'ch2intro_19', 'ch2intro_1a', 'ch2intro_1b', 'ch2intro_1c', 'ch2intro_1d', 'ch2intro_1e', 'ch2intro_1f', 'ch2intro_20', 'ch2intro_21', 'ch2intro_22', 'ch2intro_23', 'ch2intro_24', 'ch2intro_25', 'ch2intro_26', 'ch2intro_27', 'ch2intro_28', 'ch2intro_29', 'ch2intro_2a', 'ch2intro_2b', 'ch2intro_2c', 'ch2intro_2d', 'ch2intro_2e', 'ch2intro_2f', 'ch2intro_30', 'ch2intro_31', 'ch2intro_32', 'ch2intro_33', 'ch2intro_34', 'ch2intro_35', 'ch2intro_36', 'ch2intro_37', 'ch2intro_38', 'ch2intro_39', 'ch2intro_3a', 'ch2intro_3b', 'ch2intro_3c', 'ch2intro_3d', 'ch2intro_3e', 'ch2intro_3f', 'ch2intro_40', 'ch2intro_41', 'ch2intro_42', 'ch2intro_43', 'ch2intro_44', 'ch2intro_45', 'ch2intro_46', 'ch2intro_47', 'ch2intro_48', 'ch2intro_49', 'ch2intro_4a', 'ch2intro_4b', 'ch2intro_4c', 'ch2intro_4d', 'ch2intro_4e', 'ch2intro_4f', 'ch2intro_50', 'ch2intro_51', 'ch2intro_52', 'ch2intro_53', 'ch2intro_54', 'ch2intro_55', 'ch2intro_56', 'ch2intro_57', 'ch2intro_58', 'ch2intro_59', 'ch2intro_5a', 'ch2intro_5b', 'ch2intro_5c', 'ch2intro_5d', 'ch2intro_5e', 'ch2intro_5f', 'ch2intro_60', 'ch2intro_61', 'ch2intro_62', 'ch2intro_63', 'ch2intro_64', 'ch2intro_65', 'ch2intro_66', 'ch2intro_67', 'ch2intro_68', 'ch2intro_69', 'ch2intro_6a', 'ch2intro_6b', 'ch2intro_6c', 'ch2intro_6d', 'ch2intro_6e', 'ch2intro_6f', 'ch2intro_70', 'ch2intro_71', 'ch2intro_72', 'ch2intro_73', 'ch2intro_74', 'ch2intro_75', 'ch2intro_76', 'ch2intro_77', 'ch2intro_78', 'ch2intro_79', 'ch2intro_7a', 'ch2intro_7b', 'ch2intro_7c', 'ch2intro_7d', 'ch2intro_7e', 'ch2intro_7f', 'ch2intro_80', 'ch2intro_81', 'ch2intro_82', 'ch2intro_83', 'ch2intro_84', 'ch2intro_85', 'ch2intro_86', 'ch2intro_87', 'ch2intro_88', 'ch2intro_89', 'ch2intro_8a', 'ch2intro_8b', 'ch2intro_8c', 'ch2intro_8d', 'ch2intro_8e', 'ch2intro_8f', 'ch2intro_90', 'ch2intro_91', 'ch2intro_92', 'ch2intro_93', 'ch2intro_94', 'ch2intro_95', 'ch2intro_96', 'ch2intro_97', 'ch2intro_98', 'ch2intro_99', 'ch2intro_9a', 'ch2intro_9b', 'ch2intro_9c', 'ch2intro_9d', 'ch2intro_9e', 'ch2intro_9f', 'ch2intro_a0', 'ch2intro_a1', 'ch2intro_a2', 'ch2intro_a3', 'ch2intro_a4', 'ch2intro_a5', 'ch2intro_a6', 'ch2intro_a7', 'ch2intro_a8', 'ch2intro_a9', 'ch2intro_aa', 'ch2intro_ab', 'ch2intro_ac', 'ch2intro_ad', 'ch2intro_ae', 'ch2intro_af', 'ch2intro_b0', 'ch2intro_b1', 'ch2intro_b2', 'ch2intro_b3', 'ch2intro_b4', 'ch2intro_b5', 'ch2intro_b6', 'ch2intro_b7', 'ch2intro_b8', 'ch2intro_b9', 'ch2intro_ba', 'ch2intro_bb', 'ch2intro_bc', 'ch2intro_bd', 'ch2intro_be', 'ch2intro_bf', 'ch2intro_c0', 'ch2intro_c1', 'ch2intro_c2', 'ch2intro_c3', 'ch2intro_c4', 'ch2intro_c5', 'ch2intro_c6', 'ch2intro_c7', 'ch2intro_c8', 'ch2intro_c9', 'ch2intro_ca', 'ch2intro_cb', 'ch2intro_cc', 'ch2intro_cd', 'ch2intro_ce', 'ch2intro_cf', 'ch2intro_d0', 'ch2intro_d1', 'ch2intro_d2', 'ch2intro_d3', 'ch2intro_d4', 'ch2intro_d5', 'ch2intro_d6', 'ch2intro_d7', 'ch2intro_d8', 'ch2intro_d9', 'ch2intro_da', 'ch2intro_db', 'ch2intro_dc', 'ch2intro_dd', 'ch2intro_de', 'ch2intro_df', 'ch2intro_e0', 'ch2intro_e1', 'ch2intro_e2', 'ch2intro_e3', 'ch2intro_e4', 'ch2intro_e5', 'ch2intro_e6', 'ch2intro_e7', 'ch2intro_e8', 'ch2intro_e9', 'ch2intro_ea', 'ch2intro_eb', 'ch2intro_ec', 'ch2intro_ed', 'ch2intro_ee', 'ch2intro_ef', 'ch2intro_f0', 'ch2intro_f1', 'ch2intro_f2', 'ch2intro_f3', 'ch2intro_f4', 'ch2intro_f5', 'ch2intro_f6', 'ch2intro_f7', 'ch2intro_f8', 'ch2intro_f9', 'ch2intro_fa', 'ch2intro_fb', 'ch2intro_fc', 'ch2intro_fd', 'ch2intro_fe', 'ch2intro_ff', 'ch2intro_100', 'ch2intro_101', 'ch2intro_102', 'ch2intro_103', 'ch2intro_104', 'ch2intro_105', 'ch2intro_106', 'ch2intro_107', 'ch2intro_108', 'ch2intro_109', 'ch2intro_10a', 'ch2intro_10b', 'ch2intro_10c', 'ch2intro_10d', 'ch2intro_10e', 'ch2intro_10f', 'ch2intro_110', 'ch2intro_111', 'ch2intro_112', 'ch2intro_113', 'ch2intro_114', 'ch2intro_115', 'ch2intro_116', 'ch2intro_117', 'ch2intro_118', 'ch2intro_119', 'ch2intro_11a', 'ch2intro_11b', 'ch2intro_11c', 'ch2intro_11d', 'ch2intro_11e', 'ch2intro_11f', 'ch2intro_120', 'ch2intro_121', 'ch2intro_122', 'ch2intro_123', 'ch2intro_124', 'ch2intro_125', 'ch2intro_126', 'ch2intro_127', 'ch2intro_128', 'ch2intro_129', 'ch2intro_12a', 'ch2intro_12b', 'ch2intro_12c', 'ch2intro_12d', 'ch2intro_12e', 'ch2intro_12f', 'ch2intro_130', 'ch2intro_131', 'ch2intro_132', 'ch2intro_133', 'ch2intro_134', 'ch2intro_135', 'ch2intro_136', 'ch2intro_137', 'ch2intro_138', 'ch2intro_139', 'ch2intro_13a', 'ch2intro_13b', 'ch2intro_13c', 'ch2intro_13d', 'ch2intro_13e', 'ch2intro_13f', 'ch2intro_140', 'ch2intro_141', 'ch2intro_142', 'ch2intro_143', 'ch2intro_144', 'ch2intro_145', 'ch2intro_146', 'ch2intro_147', 'ch2intro_148', 'ch2intro_149', 'ch2intro_14a', 'ch2intro_14b', 'ch2intro_14c', 'ch2intro_14d', 'ch2intro_14e', 'ch2intro_14f', 'ch2intro_150', 'ch2intro_151', 'ch2intro_152', 'ch2intro_153', 'ch2intro_154', 'ch2intro_155', 'ch2intro_156', 'ch2intro_157', 'ch2intro_158', 'ch2intro_159', 'ch2intro_15a', 'ch2intro_15b', 'ch2intro_15c', 'ch2intro_15d', 'ch2intro_15e', 'ch2intro_15f', 'ch2intro_160', 'ch2intro_161', 'ch2intro_162', 'ch2intro_163', 'ch2intro_164', 'ch2intro_165', 'ch2intro_166', 'ch2intro_167', 'ch2intro_168', 'ch2intro_169', 'ch2intro_16a', 'ch2intro_16b', 'ch2intro_16c', 'ch2intro_16d', 'ch2intro_16e', 'ch2intro_16f', 'ch2intro_170', 'ch2intro_171', 'ch2intro_172', 'ch2intro_173', 'ch2intro_174', 'ch2intro_175', 'ch2intro_176', 'ch2intro_177', 'ch2intro_178', 'ch2intro_179', 'ch2intro_17a', 'ch2intro_17b', 'ch2intro_17c', 'ch2intro_17d', 'ch2intro_17e', 'ch2intro_17f', 'ch2intro_180', 'ch2intro_181', 'ch2intro_182', 'ch2intro_183', 'ch2intro_184', 'ch2intro_185', 'ch2intro_186', 'ch2intro_187', 'ch2intro_188', 'ch2intro_189', 'ch2intro_18a', 'ch2intro_18b', 'ch2intro_18c', 'ch2intro_18d', 'ch2intro_18e', 'ch2intro_18f', 'ch2intro_190', 'ch2intro_191', 'ch2intro_192', 'ch2intro_193', 'ch2intro_194', 'ch2intro_195', 'ch2intro_196', 'ch2intro_197', 'ch2intro_198', 'ch2intro_199', 'ch2intro_19a', 'ch2intro_19b', 'ch2intro_19c', 'ch2intro_19d', 'ch2intro_19e', 'ch2intro_19f', 'ch2intro_1a0', 'ch2intro_1a1', 'ch2intro_1a2', 'ch2intro_1a3', 'ch2intro_1a4', 'ch2intro_1a5', 'ch2intro_1a6', 'ch2intro_1a7', 'ch2intro_1a8', 'ch2intro_1a9', 'ch2intro_1aa', 'ch2intro_1ab', 'ch2intro_1ac', 'ch2intro_1ad', 'ch2intro_1ae', 'ch2intro_1af', 'ch2intro_1b0', 'ch2intro_1b1', 'ch2intro_1b2', 'ch2intro_1b3', 'ch2intro_1b4', 'ch2intro_1b5', 'ch2intro_1b6', 'ch2intro_1b7', 'ch2intro_1b8', 'ch2intro_1b9', 'ch2intro_1ba', 'ch2intro_1bb', 'ch2intro_1bc', 'ch2intro_1bd', 'ch2intro_1be', 'ch2intro_1bf', 'ch2intro_1c0', 'ch2intro_1c1', 'ch2intro_1c2', 'ch2intro_1c3', 'ch2intro_1c4', 'ch2intro_1c5', 'ch2intro_1c6', 'ch2intro_1c7', 'ch2intro_1c8', 'ch2intro_1c9', 'ch2intro_1ca', 'ch2intro_1cb', 'ch2intro_1cc', 'ch2intro_1cd', 'ch2intro_1ce', 'ch2intro_1cf', 'ch2intro_1d0', 'ch2intro_1d1', 'ch2intro_1d2', 'ch2intro_1d3', 'ch2intro_1d4', 'ch2intro_1d5', 'ch2intro_1d6', 'ch2intro_1d7', 'ch2intro_1d8', 'ch2intro_1d9', 'ch2intro_1da', 'ch2intro_1db', 'ch2intro_1dc', 'ch2intro_1dd', 'ch2intro_1de', 'ch2intro_1df', 'ch2intro_1e0', 'ch2intro_1e1'], 'ch4strings_dicts': ['ch4strings_dicts_1', 'ch4strings_dicts_2', 'ch4strings_dicts_3', 'ch4strings_dicts_4', 'ch4strings_dicts_5', 'ch4strings_dicts_6', 'ch4strings_dicts_7', 'ch4strings_dicts_8', 'ch4strings_dicts_9', 'ch4strings_dicts_a', 'ch4strings_dicts_b', 'ch4strings_dicts_c', 'ch4strings_dicts_d', 'ch4strings_dicts_e', 'ch4strings_dicts_f', 'ch4strings_dicts_10', 'ch4strings_dicts_11', 'ch4strings_dicts_12', 'ch4strings_dicts_13', 'ch4strings_dicts_14', 'ch4strings_dicts_15', 'ch4strings_dicts_16', 'ch4strings_dicts_17', 'ch4strings_dicts_18', 'ch4strings_dicts_19', 'ch4strings_dicts_1a', 'ch4strings_dicts_1b', 'ch4strings_dicts_1c', 'ch4strings_dicts_1d', 'ch4strings_dicts_1e', 'ch4strings_dicts_1f', 'ch4strings_dicts_20', 'ch4strings_dicts_21', 'ch4strings_dicts_22', 'ch4strings_dicts_23', 'ch4strings_dicts_24', 'ch4strings_dicts_25', 'ch4strings_dicts_26', 'ch4strings_dicts_27', 'ch4strings_dicts_28', 'ch4strings_dicts_29', 'ch4strings_dicts_2a', 'ch4strings_dicts_2b', 'ch4strings_dicts_2c', 'ch4strings_dicts_2d', 'ch4strings_dicts_2e', 'ch4strings_dicts_2f', 'ch4strings_dicts_30', 'ch4strings_dicts_31', 'ch4strings_dicts_32', 'ch4strings_dicts_33', 'ch4strings_dicts_34', 'ch4strings_dicts_35', 'ch4strings_dicts_36', 'ch4strings_dicts_37', 'ch4strings_dicts_38', 'ch4strings_dicts_39', 'ch4strings_dicts_3a', 'ch4strings_dicts_3b', 'ch4strings_dicts_3c', 'ch4strings_dicts_3d', 'ch4strings_dicts_3e', 'ch4strings_dicts_3f', 'ch4strings_dicts_40', 'ch4strings_dicts_41', 'ch4strings_dicts_42', 'ch4strings_dicts_43', 'ch4strings_dicts_44', 'ch4strings_dicts_45', 'ch4strings_dicts_46', 'ch4strings_dicts_47', 'ch4strings_dicts_48', 'ch4strings_dicts_49', 'ch4strings_dicts_4a', 'ch4strings_dicts_4b', 'ch4strings_dicts_4c', 'ch4strings_dicts_4d', 'ch4strings_dicts_4e', 'ch4strings_dicts_4f', 'ch4strings_dicts_50', 'ch4strings_dicts_51', 'ch4strings_dicts_52', 'ch4strings_dicts_53', 'ch4strings_dicts_54', 'ch4strings_dicts_55', 'ch4strings_dicts_56', 'ch4strings_dicts_57', 'ch4strings_dicts_58', 'ch4strings_dicts_59', 'ch4strings_dicts_5a', 'ch4strings_dicts_5b', 'ch4strings_dicts_5c', 'ch4strings_dicts_5d', 'ch4strings_dicts_5e', 'ch4strings_dicts_5f', 'ch4strings_dicts_60', 'ch4strings_dicts_61', 'ch4strings_dicts_62', 'ch4strings_dicts_63', 'ch4strings_dicts_64', 'ch4strings_dicts_65', 'ch4strings_dicts_66', 'ch4strings_dicts_67', 'ch4strings_dicts_68', 'ch4strings_dicts_69', 'ch4strings_dicts_6a', 'ch4strings_dicts_6b', 'ch4strings_dicts_6c', 'ch4strings_dicts_6d', 'ch4strings_dicts_6e', 'ch4strings_dicts_6f', 'ch4strings_dicts_70', 'ch4strings_dicts_71', 'ch4strings_dicts_72', 'ch4strings_dicts_73', 'ch4strings_dicts_74', 'ch4strings_dicts_75', 'ch4strings_dicts_76', 'ch4strings_dicts_77', 'ch4strings_dicts_78', 'ch4strings_dicts_79', 'ch4strings_dicts_7a', 'ch4strings_dicts_7b', 'ch4strings_dicts_7c', 'ch4strings_dicts_7d', 'ch4strings_dicts_7e', 'ch4strings_dicts_7f', 'ch4strings_dicts_80', 'ch4strings_dicts_81', 'ch4strings_dicts_82', 'ch4strings_dicts_83', 'ch4strings_dicts_84', 'ch4strings_dicts_85', 'ch4strings_dicts_86', 'ch4strings_dicts_87', 'ch4strings_dicts_88', 'ch4strings_dicts_89', 'ch4strings_dicts_8a', 'ch4strings_dicts_8b', 'ch4strings_dicts_8c', 'ch4strings_dicts_8d', 'ch4strings_dicts_8e', 'ch4strings_dicts_8f', 'ch4strings_dicts_90', 'ch4strings_dicts_91', 'ch4strings_dicts_92', 'ch4strings_dicts_93', 'ch4strings_dicts_94', 'ch4strings_dicts_95', 'ch4strings_dicts_96', 'ch4strings_dicts_97', 'ch4strings_dicts_98', 'ch4strings_dicts_99', 'ch4strings_dicts_9a', 'ch4strings_dicts_9b', 'ch4strings_dicts_9c', 'ch4strings_dicts_9d', 'ch4strings_dicts_9e', 'ch4strings_dicts_9f', 'ch4strings_dicts_a0', 'ch4strings_dicts_a1', 'ch4strings_dicts_a2', 'ch4strings_dicts_a3', 'ch4strings_dicts_a4', 'ch4strings_dicts_a5', 'ch4strings_dicts_a6', 'ch4strings_dicts_a7', 'ch4strings_dicts_a8', 'ch4strings_dicts_a9', 'ch4strings_dicts_aa', 'ch4strings_dicts_ab', 'ch4strings_dicts_ac', 'ch4strings_dicts_ad', 'ch4strings_dicts_ae', 'ch4strings_dicts_af', 'ch4strings_dicts_b0', 'ch4strings_dicts_b1', 'ch4strings_dicts_b2', 'ch4strings_dicts_b3', 'ch4strings_dicts_b4', 'ch4strings_dicts_b5', 'ch4strings_dicts_b6', 'ch4strings_dicts_b7', 'ch4strings_dicts_b8', 'ch4strings_dicts_b9', 'ch4strings_dicts_ba', 'ch4strings_dicts_bb', 'ch4strings_dicts_bc', 'ch4strings_dicts_bd', 'ch4strings_dicts_be', 'ch4strings_dicts_bf', 'ch4strings_dicts_c0', 'ch4strings_dicts_c1', 'ch4strings_dicts_c2', 'ch4strings_dicts_c3', 'ch4strings_dicts_c4', 'ch4strings_dicts_c5', 'ch4strings_dicts_c6', 'ch4strings_dicts_c7', 'ch4strings_dicts_c8', 'ch4strings_dicts_c9', 'ch4strings_dicts_ca', 'ch4strings_dicts_cb', 'ch4strings_dicts_cc', 'ch4strings_dicts_cd', 'ch4strings_dicts_ce', 'ch4strings_dicts_cf', 'ch4strings_dicts_d0', 'ch4strings_dicts_d1', 'ch4strings_dicts_d2', 'ch4strings_dicts_d3', 'ch4strings_dicts_d4', 'ch4strings_dicts_d5', 'ch4strings_dicts_d6', 'ch4strings_dicts_d7', 'ch4strings_dicts_d8', 'ch4strings_dicts_d9', 'ch4strings_dicts_da', 'ch4strings_dicts_db', 'ch4strings_dicts_dc', 'ch4strings_dicts_dd', 'ch4strings_dicts_de', 'ch4strings_dicts_df', 'ch4strings_dicts_e0', 'ch4strings_dicts_e1', 'ch4strings_dicts_e2', 'ch4strings_dicts_e3', 'ch4strings_dicts_e4', 'ch4strings_dicts_e5', 'ch4strings_dicts_e6', 'ch4strings_dicts_e7', 'ch4strings_dicts_e8', 'ch4strings_dicts_e9', 'ch4strings_dicts_ea', 'ch4strings_dicts_eb', 'ch4strings_dicts_ec', 'ch4strings_dicts_ed', 'ch4strings_dicts_ee', 'ch4strings_dicts_ef', 'ch4strings_dicts_f0', 'ch4strings_dicts_f1', 'ch4strings_dicts_f2', 'ch4strings_dicts_f3', 'ch4strings_dicts_f4', 'ch4strings_dicts_f5', 'ch4strings_dicts_f6', 'ch4strings_dicts_f7', 'ch4strings_dicts_f8', 'ch4strings_dicts_f9', 'ch4strings_dicts_fa', 'ch4strings_dicts_fb', 'ch4strings_dicts_fc', 'ch4strings_dicts_fd', 'ch4strings_dicts_fe', 'ch4strings_dicts_ff', 'ch4strings_dicts_100', 'ch4strings_dicts_101', 'ch4strings_dicts_102', 'ch4strings_dicts_103', 'ch4strings_dicts_104', 'ch4strings_dicts_105', 'ch4strings_dicts_106', 'ch4strings_dicts_107', 'ch4strings_dicts_108', 'ch4strings_dicts_109', 'ch4strings_dicts_10a', 'ch4strings_dicts_10b', 'ch4strings_dicts_10c', 'ch4strings_dicts_10d', 'ch4strings_dicts_10e', 'ch4strings_dicts_10f', 'ch4strings_dicts_110', 'ch4strings_dicts_111', 'ch4strings_dicts_112', 'ch4strings_dicts_113', 'ch4strings_dicts_114', 'ch4strings_dicts_115', 'ch4strings_dicts_116', 'ch4strings_dicts_117', 'ch4strings_dicts_118', 'ch4strings_dicts_119', 'ch4strings_dicts_11a', 'ch4strings_dicts_11b', 'ch4strings_dicts_11c', 'ch4strings_dicts_11d', 'ch4strings_dicts_11e', 'ch4strings_dicts_11f', 'ch4strings_dicts_120', 'ch4strings_dicts_121', 'ch4strings_dicts_122', 'ch4strings_dicts_123', 'ch4strings_dicts_124', 'ch4strings_dicts_125', 'ch4strings_dicts_126', 'ch4strings_dicts_127', 'ch4strings_dicts_128', 'ch4strings_dicts_129', 'ch4strings_dicts_12a', 'ch4strings_dicts_12b', 'ch4strings_dicts_12c', 'ch4strings_dicts_12d', 'ch4strings_dicts_12e', 'ch4strings_dicts_12f', 'ch4strings_dicts_130', 'ch4strings_dicts_131', 'ch4strings_dicts_132', 'ch4strings_dicts_133', 'ch4strings_dicts_134', 'ch4strings_dicts_135', 'ch4strings_dicts_136', 'ch4strings_dicts_137', 'ch4strings_dicts_138', 'ch4strings_dicts_139', 'ch4strings_dicts_13a', 'ch4strings_dicts_13b', 'ch4strings_dicts_13c', 'ch4strings_dicts_13d', 'ch4strings_dicts_13e', 'ch4strings_dicts_13f', 'ch4strings_dicts_140', 'ch4strings_dicts_141', 'ch4strings_dicts_142', 'ch4strings_dicts_143', 'ch4strings_dicts_144', 'ch4strings_dicts_145', 'ch4strings_dicts_146', 'ch4strings_dicts_147', 'ch4strings_dicts_148', 'ch4strings_dicts_149', 'ch4strings_dicts_14a', 'ch4strings_dicts_14b', 'ch4strings_dicts_14c', 'ch4strings_dicts_14d', 'ch4strings_dicts_14e', 'ch4strings_dicts_14f', 'ch4strings_dicts_150', 'ch4strings_dicts_151', 'ch4strings_dicts_152', 'ch4strings_dicts_153', 'ch4strings_dicts_154', 'ch4strings_dicts_155', 'ch4strings_dicts_156', 'ch4strings_dicts_157', 'ch4strings_dicts_158', 'ch4strings_dicts_159', 'ch4strings_dicts_15a', 'ch4strings_dicts_15b', 'ch4strings_dicts_15c', 'ch4strings_dicts_15d', 'ch4strings_dicts_15e', 'ch4strings_dicts_15f', 'ch4strings_dicts_160', 'ch4strings_dicts_161', 'ch4strings_dicts_162', 'ch4strings_dicts_163', 'ch4strings_dicts_164', 'ch4strings_dicts_165', 'ch4strings_dicts_166', 'ch4strings_dicts_167', 'ch4strings_dicts_168', 'ch4strings_dicts_169', 'ch4strings_dicts_16a', 'ch4strings_dicts_16b', 'ch4strings_dicts_16c', 'ch4strings_dicts_16d', 'ch4strings_dicts_16e', 'ch4strings_dicts_16f', 'ch4strings_dicts_170', 'ch4strings_dicts_171', 'ch4strings_dicts_172', 'ch4strings_dicts_173', 'ch4strings_dicts_174', 'ch4strings_dicts_175', 'ch4strings_dicts_176', 'ch4strings_dicts_177', 'ch4strings_dicts_178', 'ch4strings_dicts_179', 'ch4strings_dicts_17a', 'ch4strings_dicts_17b', 'ch4strings_dicts_17c', 'ch4strings_dicts_17d', 'ch4strings_dicts_17e', 'ch4strings_dicts_17f', 'ch4strings_dicts_180', 'ch4strings_dicts_181', 'ch4strings_dicts_182', 'ch4strings_dicts_183', 'ch4strings_dicts_184', 'ch4strings_dicts_185', 'ch4strings_dicts_186', 'ch4strings_dicts_187', 'ch4strings_dicts_188', 'ch4strings_dicts_189', 'ch4strings_dicts_18a', 'ch4strings_dicts_18b', 'ch4strings_dicts_18c', 'ch4strings_dicts_18d', 'ch4strings_dicts_18e', 'ch4strings_dicts_18f', 'ch4strings_dicts_190', 'ch4strings_dicts_191', 'ch4strings_dicts_192', 'ch4strings_dicts_193', 'ch4strings_dicts_194', 'ch4strings_dicts_195', 'ch4strings_dicts_196', 'ch4strings_dicts_197', 'ch4strings_dicts_198', 'ch4strings_dicts_199', 'ch4strings_dicts_19a', 'ch4strings_dicts_19b', 'ch4strings_dicts_19c', 'ch4strings_dicts_19d', 'ch4strings_dicts_19e', 'ch4strings_dicts_19f', 'ch4strings_dicts_1a0', 'ch4strings_dicts_1a1', 'ch4strings_dicts_1a2', 'ch4strings_dicts_1a3', 'ch4strings_dicts_1a4', 'ch4strings_dicts_1a5', 'ch4strings_dicts_1a6', 'ch4strings_dicts_1a7', 'ch4strings_dicts_1a8', 'ch4strings_dicts_1a9', 'ch4strings_dicts_1aa', 'ch4strings_dicts_1ab', 'ch4strings_dicts_1ac', 'ch4strings_dicts_1ad', 'ch4strings_dicts_1ae', 'ch4strings_dicts_1af', 'ch4strings_dicts_1b0', 'ch4strings_dicts_1b1', 'ch4strings_dicts_1b2', 'ch4strings_dicts_1b3', 'ch4strings_dicts_1b4', 'ch4strings_dicts_1b5', 'ch4strings_dicts_1b6', 'ch4strings_dicts_1b7', 'ch4strings_dicts_1b8', 'ch4strings_dicts_1b9', 'ch4strings_dicts_1ba', 'ch4strings_dicts_1bb', 'ch4strings_dicts_1bc', 'ch4strings_dicts_1bd', 'ch4strings_dicts_1be', 'ch4strings_dicts_1bf', 'ch4strings_dicts_1c0', 'ch4strings_dicts_1c1', 'ch4strings_dicts_1c2', 'ch4strings_dicts_1c3', 'ch4strings_dicts_1c4', 'ch4strings_dicts_1c5', 'ch4strings_dicts_1c6', 'ch4strings_dicts_1c7', 'ch4strings_dicts_1c8', 'ch4strings_dicts_1c9', 'ch4strings_dicts_1ca', 'ch4strings_dicts_1cb', 'ch4strings_dicts_1cc', 'ch4strings_dicts_1cd', 'ch4strings_dicts_1ce', 'ch4strings_dicts_1cf', 'ch4strings_dicts_1d0', 'ch4strings_dicts_1d1', 'ch4strings_dicts_1d2', 'ch4strings_dicts_1d3', 'ch4strings_dicts_1d4', 'ch4strings_dicts_1d5', 'ch4strings_dicts_1d6', 'ch4strings_dicts_1d7', 'ch4strings_dicts_1d8', 'ch4strings_dicts_1d9', 'ch4strings_dicts_1da', 'ch4strings_dicts_1db', 'ch4strings_dicts_1dc', 'ch4strings_dicts_1dd', 'ch4strings_dicts_1de', 'ch4strings_dicts_1df', 'ch4strings_dicts_1e0', 'ch4strings_dicts_1e1'], 'ch11Section_5': ['ch11Section_5_1', 'ch11Section_5_2', 'ch11Section_5_3', 'ch11Section_5_4', 'ch11Section_5_5', 'ch11Section_5_6', 'ch11Section_5_7', 'ch11Section_5_8', 'ch11Section_5_9', 'ch11Section_5_a', 'ch11Section_5_b', 'ch11Section_5_c', 'ch11Section_5_d', 'ch11Section_5_e', 'ch11Section_5_f', 'ch11Section_5_10', 'ch11Section_5_11', 'ch11Section_5_12', 'ch11Section_5_13', 'ch11Section_5_14', 'ch11Section_5_15', 'ch11Section_5_16', 'ch11Section_5_17', 'ch11Section_5_18', 'ch11Section_5_19', 'ch11Section_5_1a', 'ch11Section_5_1b', 'ch11Section_5_1c', 'ch11Section_5_1d', 'ch11Section_5_1e', 'ch11Section_5_1f', 'ch11Section_5_20', 'ch11Section_5_21', 'ch11Section_5_22', 'ch11Section_5_23', 'ch11Section_5_24', 'ch11Section_5_25', 'ch11Section_5_26', 'ch11Section_5_27', 'ch11Section_5_28', 'ch11Section_5_29', 'ch11Section_5_2a', 'ch11Section_5_2b', 'ch11Section_5_2c', 'ch11Section_5_2d', 'ch11Section_5_2e', 'ch11Section_5_2f', 'ch11Section_5_30', 'ch11Section_5_31', 'ch11Section_5_32', 'ch11Section_5_33', 'ch11Section_5_34', 'ch11Section_5_35', 'ch11Section_5_36', 'ch11Section_5_37', 'ch11Section_5_38', 'ch11Section_5_39', 'ch11Section_5_3a', 'ch11Section_5_3b', 'ch11Section_5_3c', 'ch11Section_5_3d', 'ch11Section_5_3e', 'ch11Section_5_3f', 'ch11Section_5_40', 'ch11Section_5_41', 'ch11Section_5_42', 'ch11Section_5_43', 'ch11Section_5_44', 'ch11Section_5_45', 'ch11Section_5_46', 'ch11Section_5_47', 'ch11Section_5_48', 'ch11Section_5_49', 'ch11Section_5_4a', 'ch11Section_5_4b', 'ch11Section_5_4c', 'ch11Section_5_4d', 'ch11Section_5_4e', 'ch11Section_5_4f', 'ch11Section_5_50', 'ch11Section_5_51', 'ch11Section_5_52', 'ch11Section_5_53', 'ch11Section_5_54', 'ch11Section_5_55', 'ch11Section_5_56', 'ch11Section_5_57', 'ch11Section_5_58', 'ch11Section_5_59', 'ch11Section_5_5a', 'ch11Section_5_5b', 'ch11Section_5_5c', 'ch11Section_5_5d', 'ch11Section_5_5e', 'ch11Section_5_5f', 'ch11Section_5_60', 'ch11Section_5_61', 'ch11Section_5_62', 'ch11Section_5_63', 'ch11Section_5_64', 'ch11Section_5_65', 'ch11Section_5_66', 'ch11Section_5_67', 'ch11Section_5_68', 'ch11Section_5_69', 'ch11Section_5_6a', 'ch11Section_5_6b', 'ch11Section_5_6c', 'ch11Section_5_6d', 'ch11Section_5_6e', 'ch11Section_5_6f', 'ch11Section_5_70', 'ch11Section_5_71', 'ch11Section_5_72', 'ch11Section_5_73', 'ch11Section_5_74', 'ch11Section_5_75', 'ch11Section_5_76', 'ch11Section_5_77', 'ch11Section_5_78', 'ch11Section_5_79', 'ch11Section_5_7a', 'ch11Section_5_7b', 'ch11Section_5_7c', 'ch11Section_5_7d', 'ch11Section_5_7e', 'ch11Section_5_7f', 'ch11Section_5_80', 'ch11Section_5_81', 'ch11Section_5_82', 'ch11Section_5_83', 'ch11Section_5_84', 'ch11Section_5_85', 'ch11Section_5_86', 'ch11Section_5_87', 'ch11Section_5_88', 'ch11Section_5_89', 'ch11Section_5_8a', 'ch11Section_5_8b', 'ch11Section_5_8c', 'ch11Section_5_8d', 'ch11Section_5_8e', 'ch11Section_5_8f', 'ch11Section_5_90', 'ch11Section_5_91', 'ch11Section_5_92', 'ch11Section_5_93', 'ch11Section_5_94', 'ch11Section_5_95', 'ch11Section_5_96', 'ch11Section_5_97', 'ch11Section_5_98', 'ch11Section_5_99', 'ch11Section_5_9a', 'ch11Section_5_9b', 'ch11Section_5_9c', 'ch11Section_5_9d', 'ch11Section_5_9e', 'ch11Section_5_9f', 'ch11Section_5_a0', 'ch11Section_5_a1', 'ch11Section_5_a2', 'ch11Section_5_a3', 'ch11Section_5_a4', 'ch11Section_5_a5', 'ch11Section_5_a6', 'ch11Section_5_a7', 'ch11Section_5_a8', 'ch11Section_5_a9', 'ch11Section_5_aa', 'ch11Section_5_ab', 'ch11Section_5_ac', 'ch11Section_5_ad', 'ch11Section_5_ae', 'ch11Section_5_af', 'ch11Section_5_b0', 'ch11Section_5_b1', 'ch11Section_5_b2', 'ch11Section_5_b3', 'ch11Section_5_b4', 'ch11Section_5_b5', 'ch11Section_5_b6', 'ch11Section_5_b7', 'ch11Section_5_b8', 'ch11Section_5_b9', 'ch11Section_5_ba', 'ch11Section_5_bb', 'ch11Section_5_bc', 'ch11Section_5_bd', 'ch11Section_5_be', 'ch11Section_5_bf', 'ch11Section_5_c0', 'ch11Section_5_c1', 'ch11Section_5_c2', 'ch11Section_5_c3', 'ch11Section_5_c4', 'ch11Section_5_c5', 'ch11Section_5_c6', 'ch11Section_5_c7', 'ch11Section_5_c8', 'ch11Section_5_c9', 'ch11Section_5_ca', 'ch11Section_5_cb', 'ch11Section_5_cc', 'ch11Section_5_cd', 'ch11Section_5_ce', 'ch11Section_5_cf', 'ch11Section_5_d0', 'ch11Section_5_d1', 'ch11Section_5_d2', 'ch11Section_5_d3', 'ch11Section_5_d4', 'ch11Section_5_d5', 'ch11Section_5_d6', 'ch11Section_5_d7', 'ch11Section_5_d8', 'ch11Section_5_d9', 'ch11Section_5_da', 'ch11Section_5_db', 'ch11Section_5_dc', 'ch11Section_5_dd', 'ch11Section_5_de', 'ch11Section_5_df', 'ch11Section_5_e0', 'ch11Section_5_e1', 'ch11Section_5_e2', 'ch11Section_5_e3', 'ch11Section_5_e4', 'ch11Section_5_e5', 'ch11Section_5_e6', 'ch11Section_5_e7', 'ch11Section_5_e8', 'ch11Section_5_e9', 'ch11Section_5_ea', 'ch11Section_5_eb', 'ch11Section_5_ec', 'ch11Section_5_ed', 'ch11Section_5_ee', 'ch11Section_5_ef', 'ch11Section_5_f0', 'ch11Section_5_f1', 'ch11Section_5_f2', 'ch11Section_5_f3', 'ch11Section_5_f4', 'ch11Section_5_f5', 'ch11Section_5_f6', 'ch11Section_5_f7', 'ch11Section_5_f8', 'ch11Section_5_f9', 'ch11Section_5_fa', 'ch11Section_5_fb', 'ch11Section_5_fc', 'ch11Section_5_fd', 'ch11Section_5_fe', 'ch11Section_5_ff', 'ch11Section_5_100', 'ch11Section_5_101', 'ch11Section_5_102', 'ch11Section_5_103', 'ch11Section_5_104', 'ch11Section_5_105', 'ch11Section_5_106', 'ch11Section_5_107', 'ch11Section_5_108', 'ch11Section_5_109', 'ch11Section_5_10a', 'ch11Section_5_10b', 'ch11Section_5_10c', 'ch11Section_5_10d', 'ch11Section_5_10e', 'ch11Section_5_10f', 'ch11Section_5_110', 'ch11Section_5_111', 'ch11Section_5_112', 'ch11Section_5_113', 'ch11Section_5_114', 'ch11Section_5_115', 'ch11Section_5_116', 'ch11Section_5_117', 'ch11Section_5_118', 'ch11Section_5_119', 'ch11Section_5_11a', 'ch11Section_5_11b', 'ch11Section_5_11c', 'ch11Section_5_11d', 'ch11Section_5_11e', 'ch11Section_5_11f', 'ch11Section_5_120', 'ch11Section_5_121', 'ch11Section_5_122', 'ch11Section_5_123', 'ch11Section_5_124', 'ch11Section_5_125', 'ch11Section_5_126', 'ch11Section_5_127', 'ch11Section_5_128', 'ch11Section_5_129', 'ch11Section_5_12a', 'ch11Section_5_12b', 'ch11Section_5_12c', 'ch11Section_5_12d', 'ch11Section_5_12e', 'ch11Section_5_12f', 'ch11Section_5_130', 'ch11Section_5_131', 'ch11Section_5_132', 'ch11Section_5_133', 'ch11Section_5_134', 'ch11Section_5_135', 'ch11Section_5_136', 'ch11Section_5_137', 'ch11Section_5_138', 'ch11Section_5_139', 'ch11Section_5_13a', 'ch11Section_5_13b', 'ch11Section_5_13c', 'ch11Section_5_13d', 'ch11Section_5_13e', 'ch11Section_5_13f', 'ch11Section_5_140', 'ch11Section_5_141', 'ch11Section_5_142', 'ch11Section_5_143', 'ch11Section_5_144', 'ch11Section_5_145', 'ch11Section_5_146', 'ch11Section_5_147', 'ch11Section_5_148', 'ch11Section_5_149', 'ch11Section_5_14a', 'ch11Section_5_14b', 'ch11Section_5_14c', 'ch11Section_5_14d', 'ch11Section_5_14e', 'ch11Section_5_14f', 'ch11Section_5_150', 'ch11Section_5_151', 'ch11Section_5_152', 'ch11Section_5_153', 'ch11Section_5_154', 'ch11Section_5_155', 'ch11Section_5_156', 'ch11Section_5_157', 'ch11Section_5_158', 'ch11Section_5_159', 'ch11Section_5_15a', 'ch11Section_5_15b', 'ch11Section_5_15c', 'ch11Section_5_15d', 'ch11Section_5_15e', 'ch11Section_5_15f', 'ch11Section_5_160', 'ch11Section_5_161', 'ch11Section_5_162', 'ch11Section_5_163', 'ch11Section_5_164', 'ch11Section_5_165', 'ch11Section_5_166', 'ch11Section_5_167', 'ch11Section_5_168', 'ch11Section_5_169', 'ch11Section_5_16a', 'ch11Section_5_16b', 'ch11Section_5_16c', 'ch11Section_5_16d', 'ch11Section_5_16e', 'ch11Section_5_16f', 'ch11Section_5_170', 'ch11Section_5_171', 'ch11Section_5_172', 'ch11Section_5_173', 'ch11Section_5_174', 'ch11Section_5_175', 'ch11Section_5_176', 'ch11Section_5_177', 'ch11Section_5_178', 'ch11Section_5_179', 'ch11Section_5_17a', 'ch11Section_5_17b', 'ch11Section_5_17c', 'ch11Section_5_17d', 'ch11Section_5_17e', 'ch11Section_5_17f', 'ch11Section_5_180', 'ch11Section_5_181', 'ch11Section_5_182', 'ch11Section_5_183', 'ch11Section_5_184', 'ch11Section_5_185', 'ch11Section_5_186', 'ch11Section_5_187', 'ch11Section_5_188', 'ch11Section_5_189', 'ch11Section_5_18a', 'ch11Section_5_18b', 'ch11Section_5_18c', 'ch11Section_5_18d', 'ch11Section_5_18e', 'ch11Section_5_18f', 'ch11Section_5_190', 'ch11Section_5_191', 'ch11Section_5_192', 'ch11Section_5_193', 'ch11Section_5_194', 'ch11Section_5_195', 'ch11Section_5_196', 'ch11Section_5_197', 'ch11Section_5_198', 'ch11Section_5_199', 'ch11Section_5_19a', 'ch11Section_5_19b', 'ch11Section_5_19c', 'ch11Section_5_19d', 'ch11Section_5_19e', 'ch11Section_5_19f', 'ch11Section_5_1a0', 'ch11Section_5_1a1', 'ch11Section_5_1a2', 'ch11Section_5_1a3', 'ch11Section_5_1a4', 'ch11Section_5_1a5', 'ch11Section_5_1a6', 'ch11Section_5_1a7', 'ch11Section_5_1a8', 'ch11Section_5_1a9', 'ch11Section_5_1aa', 'ch11Section_5_1ab', 'ch11Section_5_1ac', 'ch11Section_5_1ad', 'ch11Section_5_1ae', 'ch11Section_5_1af', 'ch11Section_5_1b0', 'ch11Section_5_1b1', 'ch11Section_5_1b2', 'ch11Section_5_1b3', 'ch11Section_5_1b4', 'ch11Section_5_1b5', 'ch11Section_5_1b6', 'ch11Section_5_1b7', 'ch11Section_5_1b8', 'ch11Section_5_1b9', 'ch11Section_5_1ba', 'ch11Section_5_1bb', 'ch11Section_5_1bc', 'ch11Section_5_1bd', 'ch11Section_5_1be', 'ch11Section_5_1bf', 'ch11Section_5_1c0', 'ch11Section_5_1c1', 'ch11Section_5_1c2', 'ch11Section_5_1c3', 'ch11Section_5_1c4', 'ch11Section_5_1c5', 'ch11Section_5_1c6', 'ch11Section_5_1c7', 'ch11Section_5_1c8', 'ch11Section_5_1c9', 'ch11Section_5_1ca', 'ch11Section_5_1cb', 'ch11Section_5_1cc', 'ch11Section_5_1cd', 'ch11Section_5_1ce', 'ch11Section_5_1cf', 'ch11Section_5_1d0', 'ch11Section_5_1d1', 'ch11Section_5_1d2', 'ch11Section_5_1d3', 'ch11Section_5_1d4', 'ch11Section_5_1d5', 'ch11Section_5_1d6', 'ch11Section_5_1d7', 'ch11Section_5_1d8', 'ch11Section_5_1d9', 'ch11Section_5_1da', 'ch11Section_5_1db', 'ch11Section_5_1dc', 'ch11Section_5_1dd', 'ch11Section_5_1de', 'ch11Section_5_1df', 'ch11Section_5_1e0', 'ch11Section_5_1e1'], 'ch7interim_assessment': ['ch7interim_assessment_1', 'ch7interim_assessment_2', 'ch7interim_assessment_3', 'ch7interim_assessment_4', 'ch7interim_assessment_5', 'ch7interim_assessment_6', 'ch7interim_assessment_7', 'ch7interim_assessment_8', 'ch7interim_assessment_9', 'ch7interim_assessment_a', 'ch7interim_assessment_b', 'ch7interim_assessment_c', 'ch7interim_assessment_d', 'ch7interim_assessment_e', 'ch7interim_assessment_f', 'ch7interim_assessment_10', 'ch7interim_assessment_11', 'ch7interim_assessment_12', 'ch7interim_assessment_13', 'ch7interim_assessment_14', 'ch7interim_assessment_15', 'ch7interim_assessment_16', 'ch7interim_assessment_17', 'ch7interim_assessment_18', 'ch7interim_assessment_19', 'ch7interim_assessment_1a', 'ch7interim_assessment_1b', 'ch7interim_assessment_1c', 'ch7interim_assessment_1d', 'ch7interim_assessment_1e', 'ch7interim_assessment_1f', 'ch7interim_assessment_20', 'ch7interim_assessment_21', 'ch7interim_assessment_22', 'ch7interim_assessment_23', 'ch7interim_assessment_24', 'ch7interim_assessment_25', 'ch7interim_assessment_26', 'ch7interim_assessment_27', 'ch7interim_assessment_28', 'ch7interim_assessment_29', 'ch7interim_assessment_2a', 'ch7interim_assessment_2b', 'ch7interim_assessment_2c', 'ch7interim_assessment_2d', 'ch7interim_assessment_2e', 'ch7interim_assessment_2f', 'ch7interim_assessment_30', 'ch7interim_assessment_31', 'ch7interim_assessment_32', 'ch7interim_assessment_33', 'ch7interim_assessment_34', 'ch7interim_assessment_35', 'ch7interim_assessment_36', 'ch7interim_assessment_37', 'ch7interim_assessment_38', 'ch7interim_assessment_39', 'ch7interim_assessment_3a', 'ch7interim_assessment_3b', 'ch7interim_assessment_3c', 'ch7interim_assessment_3d', 'ch7interim_assessment_3e', 'ch7interim_assessment_3f', 'ch7interim_assessment_40', 'ch7interim_assessment_41', 'ch7interim_assessment_42', 'ch7interim_assessment_43', 'ch7interim_assessment_44', 'ch7interim_assessment_45', 'ch7interim_assessment_46', 'ch7interim_assessment_47', 'ch7interim_assessment_48', 'ch7interim_assessment_49', 'ch7interim_assessment_4a', 'ch7interim_assessment_4b', 'ch7interim_assessment_4c', 'ch7interim_assessment_4d', 'ch7interim_assessment_4e', 'ch7interim_assessment_4f', 'ch7interim_assessment_50', 'ch7interim_assessment_51', 'ch7interim_assessment_52', 'ch7interim_assessment_53', 'ch7interim_assessment_54', 'ch7interim_assessment_55', 'ch7interim_assessment_56', 'ch7interim_assessment_57', 'ch7interim_assessment_58', 'ch7interim_assessment_59', 'ch7interim_assessment_5a', 'ch7interim_assessment_5b', 'ch7interim_assessment_5c', 'ch7interim_assessment_5d', 'ch7interim_assessment_5e', 'ch7interim_assessment_5f', 'ch7interim_assessment_60', 'ch7interim_assessment_61', 'ch7interim_assessment_62', 'ch7interim_assessment_63', 'ch7interim_assessment_64', 'ch7interim_assessment_65', 'ch7interim_assessment_66', 'ch7interim_assessment_67', 'ch7interim_assessment_68', 'ch7interim_assessment_69', 'ch7interim_assessment_6a', 'ch7interim_assessment_6b', 'ch7interim_assessment_6c', 'ch7interim_assessment_6d', 'ch7interim_assessment_6e', 'ch7interim_assessment_6f', 'ch7interim_assessment_70', 'ch7interim_assessment_71', 'ch7interim_assessment_72', 'ch7interim_assessment_73', 'ch7interim_assessment_74', 'ch7interim_assessment_75', 'ch7interim_assessment_76', 'ch7interim_assessment_77', 'ch7interim_assessment_78', 'ch7interim_assessment_79', 'ch7interim_assessment_7a', 'ch7interim_assessment_7b', 'ch7interim_assessment_7c', 'ch7interim_assessment_7d', 'ch7interim_assessment_7e', 'ch7interim_assessment_7f', 'ch7interim_assessment_80', 'ch7interim_assessment_81', 'ch7interim_assessment_82', 'ch7interim_assessment_83', 'ch7interim_assessment_84', 'ch7interim_assessment_85', 'ch7interim_assessment_86', 'ch7interim_assessment_87', 'ch7interim_assessment_88', 'ch7interim_assessment_89', 'ch7interim_assessment_8a', 'ch7interim_assessment_8b', 'ch7interim_assessment_8c', 'ch7interim_assessment_8d', 'ch7interim_assessment_8e', 'ch7interim_assessment_8f', 'ch7interim_assessment_90', 'ch7interim_assessment_91', 'ch7interim_assessment_92', 'ch7interim_assessment_93', 'ch7interim_assessment_94', 'ch7interim_assessment_95', 'ch7interim_assessment_96', 'ch7interim_assessment_97', 'ch7interim_assessment_98', 'ch7interim_assessment_99', 'ch7interim_assessment_9a', 'ch7interim_assessment_9b', 'ch7interim_assessment_9c', 'ch7interim_assessment_9d', 'ch7interim_assessment_9e', 'ch7interim_assessment_9f', 'ch7interim_assessment_a0', 'ch7interim_assessment_a1', 'ch7interim_assessment_a2', 'ch7interim_assessment_a3', 'ch7interim_assessment_a4', 'ch7interim_assessment_a5', 'ch7interim_assessment_a6', 'ch7interim_assessment_a7', 'ch7interim_assessment_a8', 'ch7interim_assessment_a9', 'ch7interim_assessment_aa', 'ch7interim_assessment_ab', 'ch7interim_assessment_ac', 'ch7interim_assessment_ad', 'ch7interim_assessment_ae', 'ch7interim_assessment_af', 'ch7interim_assessment_b0', 'ch7interim_assessment_b1', 'ch7interim_assessment_b2', 'ch7interim_assessment_b3', 'ch7interim_assessment_b4', 'ch7interim_assessment_b5', 'ch7interim_assessment_b6', 'ch7interim_assessment_b7', 'ch7interim_assessment_b8', 'ch7interim_assessment_b9', 'ch7interim_assessment_ba', 'ch7interim_assessment_bb', 'ch7interim_assessment_bc', 'ch7interim_assessment_bd', 'ch7interim_assessment_be', 'ch7interim_assessment_bf', 'ch7interim_assessment_c0', 'ch7interim_assessment_c1', 'ch7interim_assessment_c2', 'ch7interim_assessment_c3', 'ch7interim_assessment_c4', 'ch7interim_assessment_c5', 'ch7interim_assessment_c6', 'ch7interim_assessment_c7', 'ch7interim_assessment_c8', 'ch7interim_assessment_c9', 'ch7interim_assessment_ca', 'ch7interim_assessment_cb', 'ch7interim_assessment_cc', 'ch7interim_assessment_cd', 'ch7interim_assessment_ce', 'ch7interim_assessment_cf', 'ch7interim_assessment_d0', 'ch7interim_assessment_d1', 'ch7interim_assessment_d2', 'ch7interim_assessment_d3', 'ch7interim_assessment_d4', 'ch7interim_assessment_d5', 'ch7interim_assessment_d6', 'ch7interim_assessment_d7', 'ch7interim_assessment_d8', 'ch7interim_assessment_d9', 'ch7interim_assessment_da', 'ch7interim_assessment_db', 'ch7interim_assessment_dc', 'ch7interim_assessment_dd', 'ch7interim_assessment_de', 'ch7interim_assessment_df', 'ch7interim_assessment_e0', 'ch7interim_assessment_e1', 'ch7interim_assessment_e2', 'ch7interim_assessment_e3', 'ch7interim_assessment_e4', 'ch7interim_assessment_e5', 'ch7interim_assessment_e6', 'ch7interim_assessment_e7', 'ch7interim_assessment_e8', 'ch7interim_assessment_e9', 'ch7interim_assessment_ea', 'ch7interim_assessment_eb', 'ch7interim_assessment_ec', 'ch7interim_assessment_ed', 'ch7interim_assessment_ee', 'ch7interim_assessment_ef', 'ch7interim_assessment_f0', 'ch7interim_assessment_f1', 'ch7interim_assessment_f2', 'ch7interim_assessment_f3', 'ch7interim_assessment_f4', 'ch7interim_assessment_f5', 'ch7interim_assessment_f6', 'ch7interim_assessment_f7', 'ch7interim_assessment_f8', 'ch7interim_assessment_f9', 'ch7interim_assessment_fa', 'ch7interim_assessment_fb', 'ch7interim_assessment_fc', 'ch7interim_assessment_fd', 'ch7interim_assessment_fe', 'ch7interim_assessment_ff', 'ch7interim_assessment_100', 'ch7interim_assessment_101', 'ch7interim_assessment_102', 'ch7interim_assessment_103', 'ch7interim_assessment_104', 'ch7interim_assessment_105', 'ch7interim_assessment_106', 'ch7interim_assessment_107', 'ch7interim_assessment_108', 'ch7interim_assessment_109', 'ch7interim_assessment_10a', 'ch7interim_assessment_10b', 'ch7interim_assessment_10c', 'ch7interim_assessment_10d', 'ch7interim_assessment_10e', 'ch7interim_assessment_10f', 'ch7interim_assessment_110', 'ch7interim_assessment_111', 'ch7interim_assessment_112', 'ch7interim_assessment_113', 'ch7interim_assessment_114', 'ch7interim_assessment_115', 'ch7interim_assessment_116', 'ch7interim_assessment_117', 'ch7interim_assessment_118', 'ch7interim_assessment_119', 'ch7interim_assessment_11a', 'ch7interim_assessment_11b', 'ch7interim_assessment_11c', 'ch7interim_assessment_11d', 'ch7interim_assessment_11e', 'ch7interim_assessment_11f', 'ch7interim_assessment_120', 'ch7interim_assessment_121', 'ch7interim_assessment_122', 'ch7interim_assessment_123', 'ch7interim_assessment_124', 'ch7interim_assessment_125', 'ch7interim_assessment_126', 'ch7interim_assessment_127', 'ch7interim_assessment_128', 'ch7interim_assessment_129', 'ch7interim_assessment_12a', 'ch7interim_assessment_12b', 'ch7interim_assessment_12c', 'ch7interim_assessment_12d', 'ch7interim_assessment_12e', 'ch7interim_assessment_12f', 'ch7interim_assessment_130', 'ch7interim_assessment_131', 'ch7interim_assessment_132', 'ch7interim_assessment_133', 'ch7interim_assessment_134', 'ch7interim_assessment_135', 'ch7interim_assessment_136', 'ch7interim_assessment_137', 'ch7interim_assessment_138', 'ch7interim_assessment_139', 'ch7interim_assessment_13a', 'ch7interim_assessment_13b', 'ch7interim_assessment_13c', 'ch7interim_assessment_13d', 'ch7interim_assessment_13e', 'ch7interim_assessment_13f', 'ch7interim_assessment_140', 'ch7interim_assessment_141', 'ch7interim_assessment_142', 'ch7interim_assessment_143', 'ch7interim_assessment_144', 'ch7interim_assessment_145', 'ch7interim_assessment_146', 'ch7interim_assessment_147', 'ch7interim_assessment_148', 'ch7interim_assessment_149', 'ch7interim_assessment_14a', 'ch7interim_assessment_14b', 'ch7interim_assessment_14c', 'ch7interim_assessment_14d', 'ch7interim_assessment_14e', 'ch7interim_assessment_14f', 'ch7interim_assessment_150', 'ch7interim_assessment_151', 'ch7interim_assessment_152', 'ch7interim_assessment_153', 'ch7interim_assessment_154', 'ch7interim_assessment_155', 'ch7interim_assessment_156', 'ch7interim_assessment_157', 'ch7interim_assessment_158', 'ch7interim_assessment_159', 'ch7interim_assessment_15a', 'ch7interim_assessment_15b', 'ch7interim_assessment_15c', 'ch7interim_assessment_15d', 'ch7interim_assessment_15e', 'ch7interim_assessment_15f', 'ch7interim_assessment_160', 'ch7interim_assessment_161', 'ch7interim_assessment_162', 'ch7interim_assessment_163', 'ch7interim_assessment_164', 'ch7interim_assessment_165', 'ch7interim_assessment_166', 'ch7interim_assessment_167', 'ch7interim_assessment_168', 'ch7interim_assessment_169', 'ch7interim_assessment_16a', 'ch7interim_assessment_16b', 'ch7interim_assessment_16c', 'ch7interim_assessment_16d', 'ch7interim_assessment_16e', 'ch7interim_assessment_16f', 'ch7interim_assessment_170', 'ch7interim_assessment_171', 'ch7interim_assessment_172', 'ch7interim_assessment_173', 'ch7interim_assessment_174', 'ch7interim_assessment_175', 'ch7interim_assessment_176', 'ch7interim_assessment_177', 'ch7interim_assessment_178', 'ch7interim_assessment_179', 'ch7interim_assessment_17a', 'ch7interim_assessment_17b', 'ch7interim_assessment_17c', 'ch7interim_assessment_17d', 'ch7interim_assessment_17e', 'ch7interim_assessment_17f', 'ch7interim_assessment_180', 'ch7interim_assessment_181', 'ch7interim_assessment_182', 'ch7interim_assessment_183', 'ch7interim_assessment_184', 'ch7interim_assessment_185', 'ch7interim_assessment_186', 'ch7interim_assessment_187', 'ch7interim_assessment_188', 'ch7interim_assessment_189', 'ch7interim_assessment_18a', 'ch7interim_assessment_18b', 'ch7interim_assessment_18c', 'ch7interim_assessment_18d', 'ch7interim_assessment_18e', 'ch7interim_assessment_18f', 'ch7interim_assessment_190', 'ch7interim_assessment_191', 'ch7interim_assessment_192', 'ch7interim_assessment_193', 'ch7interim_assessment_194', 'ch7interim_assessment_195', 'ch7interim_assessment_196', 'ch7interim_assessment_197', 'ch7interim_assessment_198', 'ch7interim_assessment_199', 'ch7interim_assessment_19a', 'ch7interim_assessment_19b', 'ch7interim_assessment_19c', 'ch7interim_assessment_19d', 'ch7interim_assessment_19e', 'ch7interim_assessment_19f', 'ch7interim_assessment_1a0', 'ch7interim_assessment_1a1', 'ch7interim_assessment_1a2', 'ch7interim_assessment_1a3', 'ch7interim_assessment_1a4', 'ch7interim_assessment_1a5', 'ch7interim_assessment_1a6', 'ch7interim_assessment_1a7', 'ch7interim_assessment_1a8', 'ch7interim_assessment_1a9', 'ch7interim_assessment_1aa', 'ch7interim_assessment_1ab', 'ch7interim_assessment_1ac', 'ch7interim_assessment_1ad', 'ch7interim_assessment_1ae', 'ch7interim_assessment_1af', 'ch7interim_assessment_1b0', 'ch7interim_assessment_1b1', 'ch7interim_assessment_1b2', 'ch7interim_assessment_1b3', 'ch7interim_assessment_1b4', 'ch7interim_assessment_1b5', 'ch7interim_assessment_1b6', 'ch7interim_assessment_1b7', 'ch7interim_assessment_1b8', 'ch7interim_assessment_1b9', 'ch7interim_assessment_1ba', 'ch7interim_assessment_1bb', 'ch7interim_assessment_1bc', 'ch7interim_assessment_1bd', 'ch7interim_assessment_1be', 'ch7interim_assessment_1bf', 'ch7interim_assessment_1c0', 'ch7interim_assessment_1c1', 'ch7interim_assessment_1c2', 'ch7interim_assessment_1c3', 'ch7interim_assessment_1c4', 'ch7interim_assessment_1c5', 'ch7interim_assessment_1c6', 'ch7interim_assessment_1c7', 'ch7interim_assessment_1c8', 'ch7interim_assessment_1c9', 'ch7interim_assessment_1ca', 'ch7interim_assessment_1cb', 'ch7interim_assessment_1cc', 'ch7interim_assessment_1cd', 'ch7interim_assessment_1ce', 'ch7interim_assessment_1cf', 'ch7interim_assessment_1d0', 'ch7interim_assessment_1d1', 'ch7interim_assessment_1d2', 'ch7interim_assessment_1d3', 'ch7interim_assessment_1d4', 'ch7interim_assessment_1d5', 'ch7interim_assessment_1d6', 'ch7interim_assessment_1d7', 'ch7interim_assessment_1d8', 'ch7interim_assessment_1d9', 'ch7interim_assessment_1da', 'ch7interim_assessment_1db', 'ch7interim_assessment_1dc', 'ch7interim_assessment_1dd', 'ch7interim_assessment_1de', 'ch7interim_assessment_1df', 'ch7interim_assessment_1e0', 'ch7interim_assessment_1e1'], 'ch8ult_module_plan': ['ch8ult_module_plan_1', 'ch8ult_module_plan_2', 'ch8ult_module_plan_3', 'ch8ult_module_plan_4', 'ch8ult_module_plan_5', 'ch8ult_module_plan_6', 'ch8ult_module_plan_7', 'ch8ult_module_plan_8', 'ch8ult_module_plan_9', 'ch8ult_module_plan_a', 'ch8ult_module_plan_b', 'ch8ult_module_plan_c', 'ch8ult_module_plan_d', 'ch8ult_module_plan_e', 'ch8ult_module_plan_f', 'ch8ult_module_plan_10', 'ch8ult_module_plan_11', 'ch8ult_module_plan_12', 'ch8ult_module_plan_13', 'ch8ult_module_plan_14', 'ch8ult_module_plan_15', 'ch8ult_module_plan_16', 'ch8ult_module_plan_17', 'ch8ult_module_plan_18', 'ch8ult_module_plan_19', 'ch8ult_module_plan_1a', 'ch8ult_module_plan_1b', 'ch8ult_module_plan_1c', 'ch8ult_module_plan_1d', 'ch8ult_module_plan_1e', 'ch8ult_module_plan_1f', 'ch8ult_module_plan_20', 'ch8ult_module_plan_21', 'ch8ult_module_plan_22', 'ch8ult_module_plan_23', 'ch8ult_module_plan_24', 'ch8ult_module_plan_25', 'ch8ult_module_plan_26', 'ch8ult_module_plan_27', 'ch8ult_module_plan_28', 'ch8ult_module_plan_29', 'ch8ult_module_plan_2a', 'ch8ult_module_plan_2b', 'ch8ult_module_plan_2c', 'ch8ult_module_plan_2d', 'ch8ult_module_plan_2e', 'ch8ult_module_plan_2f', 'ch8ult_module_plan_30', 'ch8ult_module_plan_31', 'ch8ult_module_plan_32', 'ch8ult_module_plan_33', 'ch8ult_module_plan_34', 'ch8ult_module_plan_35', 'ch8ult_module_plan_36', 'ch8ult_module_plan_37', 'ch8ult_module_plan_38', 'ch8ult_module_plan_39', 'ch8ult_module_plan_3a', 'ch8ult_module_plan_3b', 'ch8ult_module_plan_3c', 'ch8ult_module_plan_3d', 'ch8ult_module_plan_3e', 'ch8ult_module_plan_3f', 'ch8ult_module_plan_40', 'ch8ult_module_plan_41', 'ch8ult_module_plan_42', 'ch8ult_module_plan_43', 'ch8ult_module_plan_44', 'ch8ult_module_plan_45', 'ch8ult_module_plan_46', 'ch8ult_module_plan_47', 'ch8ult_module_plan_48', 'ch8ult_module_plan_49', 'ch8ult_module_plan_4a', 'ch8ult_module_plan_4b', 'ch8ult_module_plan_4c', 'ch8ult_module_plan_4d', 'ch8ult_module_plan_4e', 'ch8ult_module_plan_4f', 'ch8ult_module_plan_50', 'ch8ult_module_plan_51', 'ch8ult_module_plan_52', 'ch8ult_module_plan_53', 'ch8ult_module_plan_54', 'ch8ult_module_plan_55', 'ch8ult_module_plan_56', 'ch8ult_module_plan_57', 'ch8ult_module_plan_58', 'ch8ult_module_plan_59', 'ch8ult_module_plan_5a', 'ch8ult_module_plan_5b', 'ch8ult_module_plan_5c', 'ch8ult_module_plan_5d', 'ch8ult_module_plan_5e', 'ch8ult_module_plan_5f', 'ch8ult_module_plan_60', 'ch8ult_module_plan_61', 'ch8ult_module_plan_62', 'ch8ult_module_plan_63', 'ch8ult_module_plan_64', 'ch8ult_module_plan_65', 'ch8ult_module_plan_66', 'ch8ult_module_plan_67', 'ch8ult_module_plan_68', 'ch8ult_module_plan_69', 'ch8ult_module_plan_6a', 'ch8ult_module_plan_6b', 'ch8ult_module_plan_6c', 'ch8ult_module_plan_6d', 'ch8ult_module_plan_6e', 'ch8ult_module_plan_6f', 'ch8ult_module_plan_70', 'ch8ult_module_plan_71', 'ch8ult_module_plan_72', 'ch8ult_module_plan_73', 'ch8ult_module_plan_74', 'ch8ult_module_plan_75', 'ch8ult_module_plan_76', 'ch8ult_module_plan_77', 'ch8ult_module_plan_78', 'ch8ult_module_plan_79', 'ch8ult_module_plan_7a', 'ch8ult_module_plan_7b', 'ch8ult_module_plan_7c', 'ch8ult_module_plan_7d', 'ch8ult_module_plan_7e', 'ch8ult_module_plan_7f', 'ch8ult_module_plan_80', 'ch8ult_module_plan_81', 'ch8ult_module_plan_82', 'ch8ult_module_plan_83', 'ch8ult_module_plan_84', 'ch8ult_module_plan_85', 'ch8ult_module_plan_86', 'ch8ult_module_plan_87', 'ch8ult_module_plan_88', 'ch8ult_module_plan_89', 'ch8ult_module_plan_8a', 'ch8ult_module_plan_8b', 'ch8ult_module_plan_8c', 'ch8ult_module_plan_8d', 'ch8ult_module_plan_8e', 'ch8ult_module_plan_8f', 'ch8ult_module_plan_90', 'ch8ult_module_plan_91', 'ch8ult_module_plan_92', 'ch8ult_module_plan_93', 'ch8ult_module_plan_94', 'ch8ult_module_plan_95', 'ch8ult_module_plan_96', 'ch8ult_module_plan_97', 'ch8ult_module_plan_98', 'ch8ult_module_plan_99', 'ch8ult_module_plan_9a', 'ch8ult_module_plan_9b', 'ch8ult_module_plan_9c', 'ch8ult_module_plan_9d', 'ch8ult_module_plan_9e', 'ch8ult_module_plan_9f', 'ch8ult_module_plan_a0', 'ch8ult_module_plan_a1', 'ch8ult_module_plan_a2', 'ch8ult_module_plan_a3', 'ch8ult_module_plan_a4', 'ch8ult_module_plan_a5', 'ch8ult_module_plan_a6', 'ch8ult_module_plan_a7', 'ch8ult_module_plan_a8', 'ch8ult_module_plan_a9', 'ch8ult_module_plan_aa', 'ch8ult_module_plan_ab', 'ch8ult_module_plan_ac', 'ch8ult_module_plan_ad', 'ch8ult_module_plan_ae', 'ch8ult_module_plan_af', 'ch8ult_module_plan_b0', 'ch8ult_module_plan_b1', 'ch8ult_module_plan_b2', 'ch8ult_module_plan_b3', 'ch8ult_module_plan_b4', 'ch8ult_module_plan_b5', 'ch8ult_module_plan_b6', 'ch8ult_module_plan_b7', 'ch8ult_module_plan_b8', 'ch8ult_module_plan_b9', 'ch8ult_module_plan_ba', 'ch8ult_module_plan_bb', 'ch8ult_module_plan_bc', 'ch8ult_module_plan_bd', 'ch8ult_module_plan_be', 'ch8ult_module_plan_bf', 'ch8ult_module_plan_c0', 'ch8ult_module_plan_c1', 'ch8ult_module_plan_c2', 'ch8ult_module_plan_c3', 'ch8ult_module_plan_c4', 'ch8ult_module_plan_c5', 'ch8ult_module_plan_c6', 'ch8ult_module_plan_c7', 'ch8ult_module_plan_c8', 'ch8ult_module_plan_c9', 'ch8ult_module_plan_ca', 'ch8ult_module_plan_cb', 'ch8ult_module_plan_cc', 'ch8ult_module_plan_cd', 'ch8ult_module_plan_ce', 'ch8ult_module_plan_cf', 'ch8ult_module_plan_d0', 'ch8ult_module_plan_d1', 'ch8ult_module_plan_d2', 'ch8ult_module_plan_d3', 'ch8ult_module_plan_d4', 'ch8ult_module_plan_d5', 'ch8ult_module_plan_d6', 'ch8ult_module_plan_d7', 'ch8ult_module_plan_d8', 'ch8ult_module_plan_d9', 'ch8ult_module_plan_da', 'ch8ult_module_plan_db', 'ch8ult_module_plan_dc', 'ch8ult_module_plan_dd', 'ch8ult_module_plan_de', 'ch8ult_module_plan_df', 'ch8ult_module_plan_e0', 'ch8ult_module_plan_e1', 'ch8ult_module_plan_e2', 'ch8ult_module_plan_e3', 'ch8ult_module_plan_e4', 'ch8ult_module_plan_e5', 'ch8ult_module_plan_e6', 'ch8ult_module_plan_e7', 'ch8ult_module_plan_e8', 'ch8ult_module_plan_e9', 'ch8ult_module_plan_ea', 'ch8ult_module_plan_eb', 'ch8ult_module_plan_ec', 'ch8ult_module_plan_ed', 'ch8ult_module_plan_ee', 'ch8ult_module_plan_ef', 'ch8ult_module_plan_f0', 'ch8ult_module_plan_f1', 'ch8ult_module_plan_f2', 'ch8ult_module_plan_f3', 'ch8ult_module_plan_f4', 'ch8ult_module_plan_f5', 'ch8ult_module_plan_f6', 'ch8ult_module_plan_f7', 'ch8ult_module_plan_f8', 'ch8ult_module_plan_f9', 'ch8ult_module_plan_fa', 'ch8ult_module_plan_fb', 'ch8ult_module_plan_fc', 'ch8ult_module_plan_fd', 'ch8ult_module_plan_fe', 'ch8ult_module_plan_ff', 'ch8ult_module_plan_100', 'ch8ult_module_plan_101', 'ch8ult_module_plan_102', 'ch8ult_module_plan_103', 'ch8ult_module_plan_104', 'ch8ult_module_plan_105', 'ch8ult_module_plan_106', 'ch8ult_module_plan_107', 'ch8ult_module_plan_108', 'ch8ult_module_plan_109', 'ch8ult_module_plan_10a', 'ch8ult_module_plan_10b', 'ch8ult_module_plan_10c', 'ch8ult_module_plan_10d', 'ch8ult_module_plan_10e', 'ch8ult_module_plan_10f', 'ch8ult_module_plan_110', 'ch8ult_module_plan_111', 'ch8ult_module_plan_112', 'ch8ult_module_plan_113', 'ch8ult_module_plan_114', 'ch8ult_module_plan_115', 'ch8ult_module_plan_116', 'ch8ult_module_plan_117', 'ch8ult_module_plan_118', 'ch8ult_module_plan_119', 'ch8ult_module_plan_11a', 'ch8ult_module_plan_11b', 'ch8ult_module_plan_11c', 'ch8ult_module_plan_11d', 'ch8ult_module_plan_11e', 'ch8ult_module_plan_11f', 'ch8ult_module_plan_120', 'ch8ult_module_plan_121', 'ch8ult_module_plan_122', 'ch8ult_module_plan_123', 'ch8ult_module_plan_124', 'ch8ult_module_plan_125', 'ch8ult_module_plan_126', 'ch8ult_module_plan_127', 'ch8ult_module_plan_128', 'ch8ult_module_plan_129', 'ch8ult_module_plan_12a', 'ch8ult_module_plan_12b', 'ch8ult_module_plan_12c', 'ch8ult_module_plan_12d', 'ch8ult_module_plan_12e', 'ch8ult_module_plan_12f', 'ch8ult_module_plan_130', 'ch8ult_module_plan_131', 'ch8ult_module_plan_132', 'ch8ult_module_plan_133', 'ch8ult_module_plan_134', 'ch8ult_module_plan_135', 'ch8ult_module_plan_136', 'ch8ult_module_plan_137', 'ch8ult_module_plan_138', 'ch8ult_module_plan_139', 'ch8ult_module_plan_13a', 'ch8ult_module_plan_13b', 'ch8ult_module_plan_13c', 'ch8ult_module_plan_13d', 'ch8ult_module_plan_13e', 'ch8ult_module_plan_13f', 'ch8ult_module_plan_140', 'ch8ult_module_plan_141', 'ch8ult_module_plan_142', 'ch8ult_module_plan_143', 'ch8ult_module_plan_144', 'ch8ult_module_plan_145', 'ch8ult_module_plan_146', 'ch8ult_module_plan_147', 'ch8ult_module_plan_148', 'ch8ult_module_plan_149', 'ch8ult_module_plan_14a', 'ch8ult_module_plan_14b', 'ch8ult_module_plan_14c', 'ch8ult_module_plan_14d', 'ch8ult_module_plan_14e', 'ch8ult_module_plan_14f', 'ch8ult_module_plan_150', 'ch8ult_module_plan_151', 'ch8ult_module_plan_152', 'ch8ult_module_plan_153', 'ch8ult_module_plan_154', 'ch8ult_module_plan_155', 'ch8ult_module_plan_156', 'ch8ult_module_plan_157', 'ch8ult_module_plan_158', 'ch8ult_module_plan_159', 'ch8ult_module_plan_15a', 'ch8ult_module_plan_15b', 'ch8ult_module_plan_15c', 'ch8ult_module_plan_15d', 'ch8ult_module_plan_15e', 'ch8ult_module_plan_15f', 'ch8ult_module_plan_160', 'ch8ult_module_plan_161', 'ch8ult_module_plan_162', 'ch8ult_module_plan_163', 'ch8ult_module_plan_164', 'ch8ult_module_plan_165', 'ch8ult_module_plan_166', 'ch8ult_module_plan_167', 'ch8ult_module_plan_168', 'ch8ult_module_plan_169', 'ch8ult_module_plan_16a', 'ch8ult_module_plan_16b', 'ch8ult_module_plan_16c', 'ch8ult_module_plan_16d', 'ch8ult_module_plan_16e', 'ch8ult_module_plan_16f', 'ch8ult_module_plan_170', 'ch8ult_module_plan_171', 'ch8ult_module_plan_172', 'ch8ult_module_plan_173', 'ch8ult_module_plan_174', 'ch8ult_module_plan_175', 'ch8ult_module_plan_176', 'ch8ult_module_plan_177', 'ch8ult_module_plan_178', 'ch8ult_module_plan_179', 'ch8ult_module_plan_17a', 'ch8ult_module_plan_17b', 'ch8ult_module_plan_17c', 'ch8ult_module_plan_17d', 'ch8ult_module_plan_17e', 'ch8ult_module_plan_17f', 'ch8ult_module_plan_180', 'ch8ult_module_plan_181', 'ch8ult_module_plan_182', 'ch8ult_module_plan_183', 'ch8ult_module_plan_184', 'ch8ult_module_plan_185', 'ch8ult_module_plan_186', 'ch8ult_module_plan_187', 'ch8ult_module_plan_188', 'ch8ult_module_plan_189', 'ch8ult_module_plan_18a', 'ch8ult_module_plan_18b', 'ch8ult_module_plan_18c', 'ch8ult_module_plan_18d', 'ch8ult_module_plan_18e', 'ch8ult_module_plan_18f', 'ch8ult_module_plan_190', 'ch8ult_module_plan_191', 'ch8ult_module_plan_192', 'ch8ult_module_plan_193', 'ch8ult_module_plan_194', 'ch8ult_module_plan_195', 'ch8ult_module_plan_196', 'ch8ult_module_plan_197', 'ch8ult_module_plan_198', 'ch8ult_module_plan_199', 'ch8ult_module_plan_19a', 'ch8ult_module_plan_19b', 'ch8ult_module_plan_19c', 'ch8ult_module_plan_19d', 'ch8ult_module_plan_19e', 'ch8ult_module_plan_19f', 'ch8ult_module_plan_1a0', 'ch8ult_module_plan_1a1', 'ch8ult_module_plan_1a2', 'ch8ult_module_plan_1a3', 'ch8ult_module_plan_1a4', 'ch8ult_module_plan_1a5', 'ch8ult_module_plan_1a6', 'ch8ult_module_plan_1a7', 'ch8ult_module_plan_1a8', 'ch8ult_module_plan_1a9', 'ch8ult_module_plan_1aa', 'ch8ult_module_plan_1ab', 'ch8ult_module_plan_1ac', 'ch8ult_module_plan_1ad', 'ch8ult_module_plan_1ae', 'ch8ult_module_plan_1af', 'ch8ult_module_plan_1b0', 'ch8ult_module_plan_1b1', 'ch8ult_module_plan_1b2', 'ch8ult_module_plan_1b3', 'ch8ult_module_plan_1b4', 'ch8ult_module_plan_1b5', 'ch8ult_module_plan_1b6', 'ch8ult_module_plan_1b7', 'ch8ult_module_plan_1b8', 'ch8ult_module_plan_1b9', 'ch8ult_module_plan_1ba', 'ch8ult_module_plan_1bb', 'ch8ult_module_plan_1bc', 'ch8ult_module_plan_1bd', 'ch8ult_module_plan_1be', 'ch8ult_module_plan_1bf', 'ch8ult_module_plan_1c0', 'ch8ult_module_plan_1c1', 'ch8ult_module_plan_1c2', 'ch8ult_module_plan_1c3', 'ch8ult_module_plan_1c4', 'ch8ult_module_plan_1c5', 'ch8ult_module_plan_1c6', 'ch8ult_module_plan_1c7', 'ch8ult_module_plan_1c8', 'ch8ult_module_plan_1c9', 'ch8ult_module_plan_1ca', 'ch8ult_module_plan_1cb', 'ch8ult_module_plan_1cc', 'ch8ult_module_plan_1cd', 'ch8ult_module_plan_1ce', 'ch8ult_module_plan_1cf', 'ch8ult_module_plan_1d0', 'ch8ult_module_plan_1d1', 'ch8ult_module_plan_1d2', 'ch8ult_module_plan_1d3', 'ch8ult_module_plan_1d4', 'ch8ult_module_plan_1d5', 'ch8ult_module_plan_1d6', 'ch8ult_module_plan_1d7', 'ch8ult_module_plan_1d8', 'ch8ult_module_plan_1d9', 'ch8ult_module_plan_1da', 'ch8ult_module_plan_1db', 'ch8ult_module_plan_1dc', 'ch8ult_module_plan_1dd', 'ch8ult_module_plan_1de', 'ch8ult_module_plan_1df', 'ch8ult_module_plan_1e0', 'ch8ult_module_plan_1e1'], 'ch10session4': ['ch10session4_1', 'ch10session4_2', 'ch10session4_3', 'ch10session4_4', 'ch10session4_5', 'ch10session4_6', 'ch10session4_7', 'ch10session4_8', 'ch10session4_9', 'ch10session4_a', 'ch10session4_b', 'ch10session4_c', 'ch10session4_d', 'ch10session4_e', 'ch10session4_f', 'ch10session4_10', 'ch10session4_11', 'ch10session4_12', 'ch10session4_13', 'ch10session4_14', 'ch10session4_15', 'ch10session4_16', 'ch10session4_17', 'ch10session4_18', 'ch10session4_19', 'ch10session4_1a', 'ch10session4_1b', 'ch10session4_1c', 'ch10session4_1d', 'ch10session4_1e', 'ch10session4_1f', 'ch10session4_20', 'ch10session4_21', 'ch10session4_22', 'ch10session4_23', 'ch10session4_24', 'ch10session4_25', 'ch10session4_26', 'ch10session4_27', 'ch10session4_28', 'ch10session4_29', 'ch10session4_2a', 'ch10session4_2b', 'ch10session4_2c', 'ch10session4_2d', 'ch10session4_2e', 'ch10session4_2f', 'ch10session4_30', 'ch10session4_31', 'ch10session4_32', 'ch10session4_33', 'ch10session4_34', 'ch10session4_35', 'ch10session4_36', 'ch10session4_37', 'ch10session4_38', 'ch10session4_39', 'ch10session4_3a', 'ch10session4_3b', 'ch10session4_3c', 'ch10session4_3d', 'ch10session4_3e', 'ch10session4_3f', 'ch10session4_40', 'ch10session4_41', 'ch10session4_42', 'ch10session4_43', 'ch10session4_44', 'ch10session4_45', 'ch10session4_46', 'ch10session4_47', 'ch10session4_48', 'ch10session4_49', 'ch10session4_4a', 'ch10session4_4b', 'ch10session4_4c', 'ch10session4_4d', 'ch10session4_4e', 'ch10session4_4f', 'ch10session4_50', 'ch10session4_51', 'ch10session4_52', 'ch10session4_53', 'ch10session4_54', 'ch10session4_55', 'ch10session4_56', 'ch10session4_57', 'ch10session4_58', 'ch10session4_59', 'ch10session4_5a', 'ch10session4_5b', 'ch10session4_5c', 'ch10session4_5d', 'ch10session4_5e', 'ch10session4_5f', 'ch10session4_60', 'ch10session4_61', 'ch10session4_62', 'ch10session4_63', 'ch10session4_64', 'ch10session4_65', 'ch10session4_66', 'ch10session4_67', 'ch10session4_68', 'ch10session4_69', 'ch10session4_6a', 'ch10session4_6b', 'ch10session4_6c', 'ch10session4_6d', 'ch10session4_6e', 'ch10session4_6f', 'ch10session4_70', 'ch10session4_71', 'ch10session4_72', 'ch10session4_73', 'ch10session4_74', 'ch10session4_75', 'ch10session4_76', 'ch10session4_77', 'ch10session4_78', 'ch10session4_79', 'ch10session4_7a', 'ch10session4_7b', 'ch10session4_7c', 'ch10session4_7d', 'ch10session4_7e', 'ch10session4_7f', 'ch10session4_80', 'ch10session4_81', 'ch10session4_82', 'ch10session4_83', 'ch10session4_84', 'ch10session4_85', 'ch10session4_86', 'ch10session4_87', 'ch10session4_88', 'ch10session4_89', 'ch10session4_8a', 'ch10session4_8b', 'ch10session4_8c', 'ch10session4_8d', 'ch10session4_8e', 'ch10session4_8f', 'ch10session4_90', 'ch10session4_91', 'ch10session4_92', 'ch10session4_93', 'ch10session4_94', 'ch10session4_95', 'ch10session4_96', 'ch10session4_97', 'ch10session4_98', 'ch10session4_99', 'ch10session4_9a', 'ch10session4_9b', 'ch10session4_9c', 'ch10session4_9d', 'ch10session4_9e', 'ch10session4_9f', 'ch10session4_a0', 'ch10session4_a1', 'ch10session4_a2', 'ch10session4_a3', 'ch10session4_a4', 'ch10session4_a5', 'ch10session4_a6', 'ch10session4_a7', 'ch10session4_a8', 'ch10session4_a9', 'ch10session4_aa', 'ch10session4_ab', 'ch10session4_ac', 'ch10session4_ad', 'ch10session4_ae', 'ch10session4_af', 'ch10session4_b0', 'ch10session4_b1', 'ch10session4_b2', 'ch10session4_b3', 'ch10session4_b4', 'ch10session4_b5', 'ch10session4_b6', 'ch10session4_b7', 'ch10session4_b8', 'ch10session4_b9', 'ch10session4_ba', 'ch10session4_bb', 'ch10session4_bc', 'ch10session4_bd', 'ch10session4_be', 'ch10session4_bf', 'ch10session4_c0', 'ch10session4_c1', 'ch10session4_c2', 'ch10session4_c3', 'ch10session4_c4', 'ch10session4_c5', 'ch10session4_c6', 'ch10session4_c7', 'ch10session4_c8', 'ch10session4_c9', 'ch10session4_ca', 'ch10session4_cb', 'ch10session4_cc', 'ch10session4_cd', 'ch10session4_ce', 'ch10session4_cf', 'ch10session4_d0', 'ch10session4_d1', 'ch10session4_d2', 'ch10session4_d3', 'ch10session4_d4', 'ch10session4_d5', 'ch10session4_d6', 'ch10session4_d7', 'ch10session4_d8', 'ch10session4_d9', 'ch10session4_da', 'ch10session4_db', 'ch10session4_dc', 'ch10session4_dd', 'ch10session4_de', 'ch10session4_df', 'ch10session4_e0', 'ch10session4_e1', 'ch10session4_e2', 'ch10session4_e3', 'ch10session4_e4', 'ch10session4_e5', 'ch10session4_e6', 'ch10session4_e7', 'ch10session4_e8', 'ch10session4_e9', 'ch10session4_ea', 'ch10session4_eb', 'ch10session4_ec', 'ch10session4_ed', 'ch10session4_ee', 'ch10session4_ef', 'ch10session4_f0', 'ch10session4_f1', 'ch10session4_f2', 'ch10session4_f3', 'ch10session4_f4', 'ch10session4_f5', 'ch10session4_f6', 'ch10session4_f7', 'ch10session4_f8', 'ch10session4_f9', 'ch10session4_fa', 'ch10session4_fb', 'ch10session4_fc', 'ch10session4_fd', 'ch10session4_fe', 'ch10session4_ff', 'ch10session4_100', 'ch10session4_101', 'ch10session4_102', 'ch10session4_103', 'ch10session4_104', 'ch10session4_105', 'ch10session4_106', 'ch10session4_107', 'ch10session4_108', 'ch10session4_109', 'ch10session4_10a', 'ch10session4_10b', 'ch10session4_10c', 'ch10session4_10d', 'ch10session4_10e', 'ch10session4_10f', 'ch10session4_110', 'ch10session4_111', 'ch10session4_112', 'ch10session4_113', 'ch10session4_114', 'ch10session4_115', 'ch10session4_116', 'ch10session4_117', 'ch10session4_118', 'ch10session4_119', 'ch10session4_11a', 'ch10session4_11b', 'ch10session4_11c', 'ch10session4_11d', 'ch10session4_11e', 'ch10session4_11f', 'ch10session4_120', 'ch10session4_121', 'ch10session4_122', 'ch10session4_123', 'ch10session4_124', 'ch10session4_125', 'ch10session4_126', 'ch10session4_127', 'ch10session4_128', 'ch10session4_129', 'ch10session4_12a', 'ch10session4_12b', 'ch10session4_12c', 'ch10session4_12d', 'ch10session4_12e', 'ch10session4_12f', 'ch10session4_130', 'ch10session4_131', 'ch10session4_132', 'ch10session4_133', 'ch10session4_134', 'ch10session4_135', 'ch10session4_136', 'ch10session4_137', 'ch10session4_138', 'ch10session4_139', 'ch10session4_13a', 'ch10session4_13b', 'ch10session4_13c', 'ch10session4_13d', 'ch10session4_13e', 'ch10session4_13f', 'ch10session4_140', 'ch10session4_141', 'ch10session4_142', 'ch10session4_143', 'ch10session4_144', 'ch10session4_145', 'ch10session4_146', 'ch10session4_147', 'ch10session4_148', 'ch10session4_149', 'ch10session4_14a', 'ch10session4_14b', 'ch10session4_14c', 'ch10session4_14d', 'ch10session4_14e', 'ch10session4_14f', 'ch10session4_150', 'ch10session4_151', 'ch10session4_152', 'ch10session4_153', 'ch10session4_154', 'ch10session4_155', 'ch10session4_156', 'ch10session4_157', 'ch10session4_158', 'ch10session4_159', 'ch10session4_15a', 'ch10session4_15b', 'ch10session4_15c', 'ch10session4_15d', 'ch10session4_15e', 'ch10session4_15f', 'ch10session4_160', 'ch10session4_161', 'ch10session4_162', 'ch10session4_163', 'ch10session4_164', 'ch10session4_165', 'ch10session4_166', 'ch10session4_167', 'ch10session4_168', 'ch10session4_169', 'ch10session4_16a', 'ch10session4_16b', 'ch10session4_16c', 'ch10session4_16d', 'ch10session4_16e', 'ch10session4_16f', 'ch10session4_170', 'ch10session4_171', 'ch10session4_172', 'ch10session4_173', 'ch10session4_174', 'ch10session4_175', 'ch10session4_176', 'ch10session4_177', 'ch10session4_178', 'ch10session4_179', 'ch10session4_17a', 'ch10session4_17b', 'ch10session4_17c', 'ch10session4_17d', 'ch10session4_17e', 'ch10session4_17f', 'ch10session4_180', 'ch10session4_181', 'ch10session4_182', 'ch10session4_183', 'ch10session4_184', 'ch10session4_185', 'ch10session4_186', 'ch10session4_187', 'ch10session4_188', 'ch10session4_189', 'ch10session4_18a', 'ch10session4_18b', 'ch10session4_18c', 'ch10session4_18d', 'ch10session4_18e', 'ch10session4_18f', 'ch10session4_190', 'ch10session4_191', 'ch10session4_192', 'ch10session4_193', 'ch10session4_194', 'ch10session4_195', 'ch10session4_196', 'ch10session4_197', 'ch10session4_198', 'ch10session4_199', 'ch10session4_19a', 'ch10session4_19b', 'ch10session4_19c', 'ch10session4_19d', 'ch10session4_19e', 'ch10session4_19f', 'ch10session4_1a0', 'ch10session4_1a1', 'ch10session4_1a2', 'ch10session4_1a3', 'ch10session4_1a4', 'ch10session4_1a5', 'ch10session4_1a6', 'ch10session4_1a7', 'ch10session4_1a8', 'ch10session4_1a9', 'ch10session4_1aa', 'ch10session4_1ab', 'ch10session4_1ac', 'ch10session4_1ad', 'ch10session4_1ae', 'ch10session4_1af', 'ch10session4_1b0', 'ch10session4_1b1', 'ch10session4_1b2', 'ch10session4_1b3', 'ch10session4_1b4', 'ch10session4_1b5', 'ch10session4_1b6', 'ch10session4_1b7', 'ch10session4_1b8', 'ch10session4_1b9', 'ch10session4_1ba', 'ch10session4_1bb', 'ch10session4_1bc', 'ch10session4_1bd', 'ch10session4_1be', 'ch10session4_1bf', 'ch10session4_1c0', 'ch10session4_1c1', 'ch10session4_1c2', 'ch10session4_1c3', 'ch10session4_1c4', 'ch10session4_1c5', 'ch10session4_1c6', 'ch10session4_1c7', 'ch10session4_1c8', 'ch10session4_1c9', 'ch10session4_1ca', 'ch10session4_1cb', 'ch10session4_1cc', 'ch10session4_1cd', 'ch10session4_1ce', 'ch10session4_1cf', 'ch10session4_1d0', 'ch10session4_1d1', 'ch10session4_1d2', 'ch10session4_1d3', 'ch10session4_1d4', 'ch10session4_1d5', 'ch10session4_1d6', 'ch10session4_1d7', 'ch10session4_1d8', 'ch10session4_1d9', 'ch10session4_1da', 'ch10session4_1db', 'ch10session4_1dc', 'ch10session4_1dd', 'ch10session4_1de', 'ch10session4_1df', 'ch10session4_1e0', 'ch10session4_1e1']}
\ No newline at end of file
Binary file SEESenv/web/hgbook/comments/p_list.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/comments/p_list.py~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1 @@
+p_list={'chap_intro':['x_38', 'x_39', 'x_3d', 'x_3e', 'x_3f', 'x_40', 'x_41', 'x_42', 'x_46', 'x_4c', 'x_4d', 'x_4e', 'x_4f', 'x_50', 'x_51', 'x_52', 'x_53', 'x_54', 'x_55', 'x_56', 'x_57', 'x_58', 'x_59', 'x_5a', 'x_5b', 'x_5c', 'x_5d', 'x_5e', 'x_5f', 'x_60', 'x_61', 'x_62', 'x_63', 'x_64', 'x_65', 'x_66', 'x_67', 'x_68', 'x_69', 'x_6d', 'x_6e', 'x_6f', 'x_70', 'x_71', 'x_72', 'x_73', 'x_74', 'x_75', 'x_79', 'x_7a', 'x_7b', 'x_7c', 'x_7d', 'x_7e', 'x_7f', 'x_80', 'x_81', 'x_82', 'x_83', 'x_84', 'x_85', 'x_86', 'x_87', 'x_88', 'x_89', 'x_8a', 'x_8b', 'x_8c', 'x_8d', 'x_8e', 'x_8f', 'x_90', 'x_91', 'x_92', 'x_93', 'x_94', 'x_95', 'x_96', 'x_97', 'x_98', 'x_99', 'x_9a', 'x_9b', 'x_9c', 'x_9d'],'chap01_intro':['x_1', 'x_2'],'chap02_basic':['x_197', 'x_198', 'x_19c', 'x_19d', 'x_19e', 'x_19f', 'x_1a0', 'x_1a1', 'x_1a5', 'x_1ab', 'x_1ac', 'x_1ad', 'x_1ae', 'x_1af', 'x_1b0', 'x_1b1', 'x_1b2', 'x_1b3', 'x_1b4', 'x_1b5', 'x_1b6', 'x_1b7', 'x_1b8', 'x_1b9', 'x_1ba', 'x_1bb', 'x_1bc', 'x_1bd', 'x_1be', 'x_1bf', 'x_1c0', 'x_1c1', 'x_1c2', 'x_1c3', 'x_1c4', 'x_1c5', 'x_1c6', 'x_1c7', 'x_1c8', 'x_1cc', 'x_1cd', 'x_1ce', 'x_1cf', 'x_1d0', 'x_1d1', 'x_1d2', 'x_1d3', 'x_1d4', 'x_1d8', 'x_1d9', 'x_1da', 'x_1db', 'x_1dc', 'x_1dd', 'x_1de', 'x_1df', 'x_1e0', 'x_1e1', 'x_1e2', 'x_1e3', 'x_1e4', 'x_1e5', 'x_1e6', 'x_1e7', 'x_1e8', 'x_1e9', 'x_1ea', 'x_1eb', 'x_1ec', 'x_1ed', 'x_1ee', 'x_1ef', 'x_1f0', 'x_1f1', 'x_1f2', 'x_1f3', 'x_1f4', 'x_1f5', 'x_1f6', 'x_1f7', 'x_1f8', 'x_1f9', 'x_1fa', 'x_1fb','x_1fc'],'chap02_basicoop':['x_c2', 'x_c3', 'x_c4', 'x_c5', 'x_c6', 'x_c7'],'chap03-session4':['x_f', 'x_10', 'x_11', 'x_12', 'x_13', 'x_14', 'x_15', 'x_16', 'x_17', 'x_18', 'x_19', 'x_1a', 'x_1b', 'x_1c', 'x_1d', 'x_1e', 'x_1f', 'x_23', 'x_24', 'x_25', 'x_26', 'x_27', 'x_28', 'x_29', 'x_2a', 'x_2b', 'x_2c', 'x_2d', 'x_2e', 'x_2f', 'x_30', 'x_31', 'x_32', 'x_33', 'x_34', 'x_35', 'x_66', 'x_67', 'x_68', 'x_71', 'x_72', 'x_7c', 'x_7d', 'x_7e', 'x_9b', 'x_9c', 'x_9d', 'x_9e', 'x_9f', 'x_a0', 'x_a1', 'x_a2', 'x_a3', 'x_a4', 'x_a5', 'x_a6', 'x_b8', 'x_b9', 'x_ba', 'x_bb', 'x_bc', 'x_c0', 'x_c1','chap04_handout':['x_204']}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/comments/sql/comment.mysql.sql	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,2 @@
+alter table comments_comment convert to character set utf8 collate utf8_bin;
+alter table comments_comment default character set utf8 collate utf8_bin;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/comments/sql/element.mysql.sql	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,2 @@
+alter table comments_element convert to character set utf8 collate utf8_bin;
+alter table comments_element default character set utf8 collate utf8_bin;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/comments/test	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,5 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 9. Finding and fixing mistakes</title><link rel="stylesheet" href="/support/styles.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.3"><link rel="home" href="index.html" title="Mercurial: The Definitive Guide"><link rel="up" href="index.html" title="Mercurial: The Definitive Guide"><link rel="prev" href="managing-releases-and-branchy-development.html" title="Chapter 8. Managing releases and branchy development"><link rel="next" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks"><link rel="alternate" type="application/atom+xml" title="Comments" href="/feeds/comments/"><link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png"><script type="text/javascript" src="/support/jquery-min.js"></script><script type="text/javascript" src="/support/form.js"></script><script type="text/javascript" src="/support/hsbook.js"></script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><h2 class="booktitle"><a href="/">Mercurial: The Definitive Guide</a><span class="authors">by Bryan O'Sullivan</span></h2></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. Finding and fixing mistakes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="managing-releases-and-branchy-development.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="handling-repository-events-with-hooks.html">Next</a></td></tr></table></div><div class="chapter" lang="en" id="chap:undo"><div class="titlepage"><div><div><h2 class="title">Chapter 9. Finding and fixing mistakes</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id390081">Erasing local history</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id390087">The accidental commit</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:rollback">Rolling back a transaction</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id390858">The erroneous pull</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:rollback-after-push">Rolling back is useless once you've pushed</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id391000">You can only roll back once</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id391367">Reverting the mistaken change</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:mgmt">File management errors</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id392218">Dealing with committed changes</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392287">Backing out a changeset</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392424">Backing out the tip changeset</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392766">Backing out a non-tip change</a></span></dt><dd><dl><dt><span class="sect3"><a href="finding-and-fixing-mistakes.html#id392990">Always use the --merge option</a></span></dt></dl></dd><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id393181">Gaining more control of the backout process</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id393814">Why hg backout works as
+	it does</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#sec:undo:aaaiiieee">Changes that should never have been</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394303">Backing out a merge</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394612">Protect yourself from escaped
+	changes</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394667">What to do about sensitive changes that escape</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#sec:undo:bisect">Finding the source of a bug</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394992">Using the hg bisect
+	command</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396541">Cleaning up after your search</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id396622">Tips for finding bugs effectively</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396628">Give consistent input</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396884">Automate as much as possible</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396713">Check your results</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396770">Beware interference between bugs</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396856">Bracket your search lazily</a></span></dt></dl></dd></dl></div>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/comments/test~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,5 @@
+html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 9. Finding and fixing mistakes</title><link rel="stylesheet" href="/support/styles.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.3"><link rel="home" href="index.html" title="Mercurial: The Definitive Guide"><link rel="up" href="index.html" title="Mercurial: The Definitive Guide"><link rel="prev" href="managing-releases-and-branchy-development.html" title="Chapter 8. Managing releases and branchy development"><link rel="next" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks"><link rel="alternate" type="application/atom+xml" title="Comments" href="/feeds/comments/"><link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png"><script type="text/javascript" src="/support/jquery-min.js"></script><script type="text/javascript" src="/support/form.js"></script><script type="text/javascript" src="/support/hsbook.js"></script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><h2 class="booktitle"><a href="/">Mercurial: The Definitive Guide</a><span class="authors">by Bryan O'Sullivan</span></h2></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. Finding and fixing mistakes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="managing-releases-and-branchy-development.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="handling-repository-events-with-hooks.html">Next</a></td></tr></table></div><div class="chapter" lang="en" id="chap:undo"><div class="titlepage"><div><div><h2 class="title">Chapter 9. Finding and fixing mistakes</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id390081">Erasing local history</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id390087">The accidental commit</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:rollback">Rolling back a transaction</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id390858">The erroneous pull</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:rollback-after-push">Rolling back is useless once you've pushed</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id391000">You can only roll back once</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id391367">Reverting the mistaken change</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:mgmt">File management errors</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id392218">Dealing with committed changes</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392287">Backing out a changeset</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392424">Backing out the tip changeset</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392766">Backing out a non-tip change</a></span></dt><dd><dl><dt><span class="sect3"><a href="finding-and-fixing-mistakes.html#id392990">Always use the --merge option</a></span></dt></dl></dd><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id393181">Gaining more control of the backout process</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id393814">Why hg backout works as
+	it does</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#sec:undo:aaaiiieee">Changes that should never have been</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394303">Backing out a merge</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394612">Protect yourself from escaped
+	changes</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394667">What to do about sensitive changes that escape</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#sec:undo:bisect">Finding the source of a bug</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394992">Using the hg bisect
+	command</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396541">Cleaning up after your search</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id396622">Tips for finding bugs effectively</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396628">Give consistent input</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396884">Automate as much as possible</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396713">Check your results</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396770">Beware interference between bugs</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396856">Bracket your search lazily</a></span></dt></dl></dd></dl></div>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/comments/urls.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,8 @@
+from django.conf.urls.defaults import *
+
+urlpatterns = patterns('',
+    (r'chapter/(?P<id>[^/]+)/?$', 'hgbook.comments.views.chapter'),
+    (r'chapter/(?P<id>[^/]+)/count/?$', 'hgbook.comments.views.single_com'),
+    (r'single/(?P<id>[^/]+)/?$', 'hgbook.comments.views.single'),
+    (r'submit/(?P<id>[^/]+)/?$', 'hgbook.comments.views.submit')
+)	
Binary file SEESenv/web/hgbook/comments/urls.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/comments/urls.py~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,8 @@
+from django.conf.urls.defaults import *
+
+urlpatterns = patterns('',
+    (r'chapter/(?P<id>[^/]+)/?$', 'hgbook.comments.views.chapter'),
+    (r'chapter/(?P<id>[^/]+)/count/?$', 'hgbook.comments.views.single_com'),
+    (r'single/(?P<id>[^/]+)/?$', 'hgbook.comments.views.single'),
+    (r'submit/(?P<id>[^/]+)/?$', 'hgbook.comments.views.submit')
+)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/comments/views.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,239 @@
+import sys
+import django.forms as forms
+from django.db import connection
+from django.http import HttpResponse
+from hgbook.comments.models import Comment, Element
+from django.shortcuts import get_object_or_404, render_to_response
+from django.template import Context ,RequestContext
+from django.template.loader import get_template
+from django.utils.simplejson import dumps 
+from p_list import *
+from BeautifulSoup import BeautifulSoup
+import glob
+html_folder='/home/amit/SEES-hacks/web/html/'
+
+def sort_dict(dict):
+	new_dict = {}
+	sorted_keys = dict.keys()
+	sorted_keys.sort()
+	print >> sys.stderr , sorted_keys
+	for key in sorted_keys:
+		new_dict[key] = dict[key]
+
+	return new_dict
+
+def dump_queries():
+    # requires settings.DEBUG to be set to True in order to work
+    if len(connection.queries) == 1:
+        print connection.queries
+    else:
+        qs = {}
+        for q in connection.queries:
+            qs[q['sql']] = qs.setdefault(q['sql'], 0) + 1
+        for q in sorted(qs.items(), key=lambda x: x[1], reverse=True):
+            print q
+        print len(connection.queries)
+
+class CommentForm(forms.Form):
+    id = forms.CharField(widget=forms.HiddenInput)
+    name = forms.CharField(max_length=64)
+    url = forms.URLField(max_length=128, required=False)
+    comment = forms.CharField(widget=forms.Textarea(attrs={
+        'rows': 8, 'cols': 60
+        }))
+    remember = forms.BooleanField(initial=True, required=False)
+
+def search(request):
+	print request
+
+
+def index(request):
+	html_files = glob.glob(html_folder+'ch*.html')
+	print >> sys.stderr ,html_files	
+	print >> sys.stderr ,"just checking whether i got here"	
+	print >> sys.stderr , html_files	
+	html_files.sort()
+	link_list=['/review/html/'+a.split('/')[-1] for a in html_files]
+#	print >> sys.stderr , html_files        
+	title_list=[]
+	for html_file in html_files:
+		file_str=open(html_file,'r').read()			
+		soup_obj=BeautifulSoup(''.join(file_str))
+		title_str=soup_obj.html.head.title.string		
+		title_str=unicode(title_str)		
+		title_str.encode('ascii','ignore')              
+		title_list.append(title_str)
+	
+	resp_dict=zip(link_list,title_list)
+	print >>sys.stderr ,resp_dict
+	return render_to_response('index.html', {'resp_dict': resp_dict })
+
+
+
+
+
+
+
+def comments_by_chapter(id):
+    objs = {}
+    for c in Comment.objects.filter(element=id, hidden=False).order_by('date'):
+        objs.setdefault(c.element_id, []).append(c)
+    return objs
+
+def chapter(request, id):
+    template = get_template('comment.html')
+    resp = {}
+    for elt, comments in comments_by_chapter(id).iteritems():
+            
+        form = CommentForm(initial={
+            'id': elt,
+            'name': request.session.get('name', ''),
+            })
+            
+
+
+    resp[elt] = template.render(RequestContext({
+            'id': elt,
+            'form': form,
+            'length': len(comments),
+            'query': comments,
+            }))
+    return HttpResponse(dumps(resp), mimetype='application/json')
+
+#    queryset = Comment.objects.filter(element=id, hidden=False).order_by('date')
+#    if form is None:
+#        form = CommentForm(initial={
+#            'id': id,
+#            'name': request.session.get('name', ''),
+#            })
+#    try:
+#        error = form.errors[0]
+#    except:
+#        error = ''
+#    return render_to_response('comment.html', {
+#        'id': id,
+#        'form': form,
+#        'length': len(queryset),
+#        'query': queryset,
+#        'newid': newid or True,
+#        'error': error,
+#        })
+
+
+
+
+
+def single_com(request,id):
+     
+#    template = get_template('comment.html')
+    resp = {}
+    print >> sys.stderr ,id   
+    for i in p_list[id]:	
+#        form=None
+        queryset = Comment.objects.filter(element=i, hidden=False).order_by('date')
+                
+#        if form is None:
+#		form = CommentForm(initial={
+#		    'id': id,
+#		    'name': request.session.get('name', ''),
+#        })
+        if len(queryset)==0:
+            resp[i] = "No"
+        elif len(queryset)==1:
+            resp[i]="One"
+        else:
+            resp[i] = len(queryset)
+#            'id': i,
+#           'form': form,
+#            'length': len(queryset),
+#            'query': queryset,
+            
+    return HttpResponse(dumps(resp), mimetype='application/json')
+#    template = get_template('comment.html')    
+#    for i in p_list[id]:	
+#        form=None
+#        queryset = Comment.objects.filter(element=i, hidden=False).order_by('date')
+#        print queryset        
+#        if form is None:
+#		form = CommentForm(initial={
+#		    'id': id,
+#		    'name': request.session.get('name', ''),
+#		    })
+#       try:
+#		    error = form.errors[0]
+#        except:
+#            error = ''
+	    
+#    return HttpResponse(response_list)
+
+
+
+
+
+
+def chapter_count(request, id):
+      
+    resp = comments_by_chapter(id)
+    
+    for elt, comments in resp.iteritems():
+              
+        resp[elt] = len(comments)
+     
+    return HttpResponse(dumps(resp), mimetype='application/json')
+    
+def single(request, id, form=None, newid=None ):
+    queryset = Comment.objects.filter(element=id, hidden=False).order_by('date')
+    if form is None:
+        form = CommentForm(initial={
+            'id': id,
+            'name': request.session.get('name', ''),
+            })
+    try:
+        error = form.errors[0]
+    except:
+        error = ''
+    return render_to_response('comment.html', {
+        'id': id,
+        'form': form,
+        'length': len(queryset),
+        'query': queryset,
+        'newid': newid or True,
+        'error': error,
+        })
+
+def submit(request, id):
+#    print request
+#    print id    
+    try :    
+        element=Element.objects.get(id=id,chapter='chap_intro')
+    except Element.DoesNotExist:
+        element=Element(id=id)    
+	element.save()    
+    
+   
+    if request.method == 'POST':
+       
+	form = CommentForm(request.POST)
+	   
+	if form.is_valid():
+            data = form.cleaned_data
+            
+	    if data.get('remember'):
+		               
+		request.session['name'] = data['name']
+                request.session['url'] = data['url']
+            else:
+                request.session.pop('name', None)
+                request.session.pop('url', None)
+            c = Comment(element=element,
+                        comment=data['comment'],
+                        submitter_name=data['name'],
+                        submitter_url=data['url'],
+                        ip=request.META.get('REMOTE_ADDR'))
+          
+			
+	c.save()
+        newid=c.id        
+        form = None
+    return single(request, id, form, newid)
+
Binary file SEESenv/web/hgbook/comments/views.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/comments/views.py~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,239 @@
+import sys
+import django.forms as forms
+from django.db import connection
+from django.http import HttpResponse
+from hgbook.comments.models import Comment, Element
+from django.shortcuts import get_object_or_404, render_to_response
+from django.template import Context ,RequestContext
+from django.template.loader import get_template
+from django.utils.simplejson import dumps 
+from p_list import *
+from BeautifulSoup import BeautifulSoup
+import glob
+html_folder='/home/amit/SEES-hacks/web/html'
+
+def sort_dict(dict):
+	new_dict = {}
+	sorted_keys = dict.keys()
+	sorted_keys.sort()
+	print >> sys.stderr , sorted_keys
+	for key in sorted_keys:
+		new_dict[key] = dict[key]
+
+	return new_dict
+
+def dump_queries():
+    # requires settings.DEBUG to be set to True in order to work
+    if len(connection.queries) == 1:
+        print connection.queries
+    else:
+        qs = {}
+        for q in connection.queries:
+            qs[q['sql']] = qs.setdefault(q['sql'], 0) + 1
+        for q in sorted(qs.items(), key=lambda x: x[1], reverse=True):
+            print q
+        print len(connection.queries)
+
+class CommentForm(forms.Form):
+    id = forms.CharField(widget=forms.HiddenInput)
+    name = forms.CharField(max_length=64)
+    url = forms.URLField(max_length=128, required=False)
+    comment = forms.CharField(widget=forms.Textarea(attrs={
+        'rows': 8, 'cols': 60
+        }))
+    remember = forms.BooleanField(initial=True, required=False)
+
+def search(request):
+	print request
+
+
+def index(request):
+	html_files = glob.glob(html_folder+'ch*.html')
+	print >> sys.stderr ,html_files	
+	print >> sys.stderr ,"just checking whether i got here"	
+	print >> sys.stderr , html_files	
+	html_files.sort()
+	link_list=['/review/html/'+a.split('/')[-1] for a in html_files]
+#	print >> sys.stderr , html_files        
+	title_list=[]
+	for html_file in html_files:
+		file_str=open(html_file,'r').read()			
+		soup_obj=BeautifulSoup(''.join(file_str))
+		title_str=soup_obj.html.head.title.string		
+		title_str=unicode(title_str)		
+		title_str.encode('ascii','ignore')              
+		title_list.append(title_str)
+	
+	resp_dict=zip(link_list,title_list)
+	print >>sys.stderr ,resp_dict
+	return render_to_response('index.html', {'resp_dict': resp_dict })
+
+
+
+
+
+
+
+def comments_by_chapter(id):
+    objs = {}
+    for c in Comment.objects.filter(element=id, hidden=False).order_by('date'):
+        objs.setdefault(c.element_id, []).append(c)
+    return objs
+
+def chapter(request, id):
+    template = get_template('comment.html')
+    resp = {}
+    for elt, comments in comments_by_chapter(id).iteritems():
+            
+        form = CommentForm(initial={
+            'id': elt,
+            'name': request.session.get('name', ''),
+            })
+            
+
+
+    resp[elt] = template.render(RequestContext({
+            'id': elt,
+            'form': form,
+            'length': len(comments),
+            'query': comments,
+            }))
+    return HttpResponse(dumps(resp), mimetype='application/json')
+
+#    queryset = Comment.objects.filter(element=id, hidden=False).order_by('date')
+#    if form is None:
+#        form = CommentForm(initial={
+#            'id': id,
+#            'name': request.session.get('name', ''),
+#            })
+#    try:
+#        error = form.errors[0]
+#    except:
+#        error = ''
+#    return render_to_response('comment.html', {
+#        'id': id,
+#        'form': form,
+#        'length': len(queryset),
+#        'query': queryset,
+#        'newid': newid or True,
+#        'error': error,
+#        })
+
+
+
+
+
+def single_com(request,id):
+     
+#    template = get_template('comment.html')
+    resp = {}
+    print >> sys.stderr ,id   
+    for i in p_list[id]:	
+#        form=None
+        queryset = Comment.objects.filter(element=i, hidden=False).order_by('date')
+                
+#        if form is None:
+#		form = CommentForm(initial={
+#		    'id': id,
+#		    'name': request.session.get('name', ''),
+#        })
+        if len(queryset)==0:
+            resp[i] = "No"
+        elif len(queryset)==1:
+            resp[i]="One"
+        else:
+            resp[i] = len(queryset)
+#            'id': i,
+#           'form': form,
+#            'length': len(queryset),
+#            'query': queryset,
+            
+    return HttpResponse(dumps(resp), mimetype='application/json')
+#    template = get_template('comment.html')    
+#    for i in p_list[id]:	
+#        form=None
+#        queryset = Comment.objects.filter(element=i, hidden=False).order_by('date')
+#        print queryset        
+#        if form is None:
+#		form = CommentForm(initial={
+#		    'id': id,
+#		    'name': request.session.get('name', ''),
+#		    })
+#       try:
+#		    error = form.errors[0]
+#        except:
+#            error = ''
+	    
+#    return HttpResponse(response_list)
+
+
+
+
+
+
+def chapter_count(request, id):
+      
+    resp = comments_by_chapter(id)
+    
+    for elt, comments in resp.iteritems():
+              
+        resp[elt] = len(comments)
+     
+    return HttpResponse(dumps(resp), mimetype='application/json')
+    
+def single(request, id, form=None, newid=None ):
+    queryset = Comment.objects.filter(element=id, hidden=False).order_by('date')
+    if form is None:
+        form = CommentForm(initial={
+            'id': id,
+            'name': request.session.get('name', ''),
+            })
+    try:
+        error = form.errors[0]
+    except:
+        error = ''
+    return render_to_response('comment.html', {
+        'id': id,
+        'form': form,
+        'length': len(queryset),
+        'query': queryset,
+        'newid': newid or True,
+        'error': error,
+        })
+
+def submit(request, id):
+#    print request
+#    print id    
+    try :    
+        element=Element.objects.get(id=id,chapter='chap_intro')
+    except Element.DoesNotExist:
+        element=Element(id=id)    
+	element.save()    
+    
+   
+    if request.method == 'POST':
+       
+	form = CommentForm(request.POST)
+	   
+	if form.is_valid():
+            data = form.cleaned_data
+            
+	    if data.get('remember'):
+		               
+		request.session['name'] = data['name']
+                request.session['url'] = data['url']
+            else:
+                request.session.pop('name', None)
+                request.session.pop('url', None)
+            c = Comment(element=element,
+                        comment=data['comment'],
+                        submitter_name=data['name'],
+                        submitter_url=data['url'],
+                        ip=request.META.get('REMOTE_ADDR'))
+          
+			
+	c.save()
+        newid=c.id        
+        form = None
+    return single(request, id, form, newid)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/converter.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,52 @@
+from lxml import etree
+from lxml import html
+from lxml.cssselect import CSSSelector
+import md5
+import sys
+
+
+args = sys.argv[1:]
+
+# django stuff
+from django.core.management import setup_environ
+import settings # Assumed to be in the same directory.
+setup_environ(settings)       # ugly django collateral effects :(
+from comments.models import Element
+
+doc_id = 'MMSC'
+sel = CSSSelector('div.chapter p, pre, h1, table.equation')
+chapter_sel = CSSSelector('div.chapter')
+
+try:
+    filename = args[0]
+except IndexError:
+    raise IndexError("Usage: %s <path-to-html-file>" % __file__)
+
+tree = etree.parse(filename, html.HTMLParser(remove_blank_text=True))
+root = tree.getroot()
+
+chapter = chapter_sel(root)[0]
+chapter_title = chapter.get('id').split(':')[1]
+chapter_hash = md5.new(chapter.get('id').encode('utf8')).hexdigest()
+
+chapter.set('id', chapter_hash)
+
+for element in sel(root):
+    hsh_source = element.text or element.get('alt') or etree.tostring(element)
+
+    if hsh_source:
+        hsh_source_encoded = hsh_source.encode('utf8')
+        hsh = md5.new(hsh_source_encoded).hexdigest()
+        element.set('id', '%s-%s' % (chapter_hash, hsh))
+    
+        # create the commentable element in the DB
+        e = Element()
+        e.id = '%s-%s' % (chapter_hash, hsh)
+        e.chapter = chapter_hash
+        e.title = chapter_title
+        e.save()
+
+
+
+print etree.tostring(root)      # pipe to a file if you wish
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/dbutil.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,32 @@
+import MySQLdb as mysql
+import sys
+
+def connect():
+    try:
+        import secrets
+    except ImportError:
+        print >> sys.stderr, 'Decrypt secrets.py.gpg or create a new copy!'
+        sys.exit(1)
+
+    if secrets.DATABASE_ENGINE != 'mysql':
+        print >> sys.stderr, ('You are using a %s database' %
+                              secrets.DATABASE_ENGINE)
+        sys.exit(1)
+
+    kwargs = {
+        'charset': 'utf8',
+        'use_unicode': True,
+        }
+    if secrets.DATABASE_USER:
+        kwargs['user'] = secrets.DATABASE_USER
+    if secrets.DATABASE_NAME:
+        kwargs['db'] = secrets.DATABASE_NAME
+    if secrets.DATABASE_PASSWORD:
+        kwargs['passwd'] = secrets.DATABASE_PASSWORD
+    if secrets.DATABASE_HOST.startswith('/'):
+        kwargs['unix_socket'] = secrets.DATABASE_HOST
+    elif secrets.DATABASE_HOST:
+        kwargs['host'] = secrets.DATABASE_HOST
+    if secrets.DATABASE_PORT:
+        kwargs['port'] = int(secrets.DATABASE_PORT)
+    return mysql.connect(**kwargs)
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/iamflint has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/position.DB has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/position.baseA has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/position.baseB has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/postlist.DB has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/postlist.baseA has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/postlist.baseB has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/record.DB has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/record.baseA has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/record.baseB has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/spelling.DB has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/spelling.baseA has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/spelling.baseB has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/termlist.DB has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/termlist.baseA has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/termlist.baseB has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/value.DB has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/value.baseA has changed
Binary file SEESenv/web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/value.baseB has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/load_elements.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+#
+# This script updates the contents of the comments_element table.
+# It's fugly, but a lot less painful than trying to use Django's
+# fixtures system.
+
+import os, sys
+sys.path.append(os.path.dirname(__file__))
+import dbutil
+
+os.system('make -C ../../en all-ids.dat')
+
+conn = dbutil.connect()
+c = conn.cursor()
+c.execute('''load data local infile "../../en/all-ids.dat" replace
+             into table comments_element
+             fields terminated by "|"''')
+print 'Database updated'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/manage.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+from django.core.management import execute_manager
+try:
+    import settings # Assumed to be in the same directory.
+except ImportError:
+    import sys
+    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
+    sys.exit(1)
+
+if __name__ == "__main__":
+    execute_manager(settings)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/reviewers.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,81 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import os, sys
+sys.path.append(os.path.dirname(__file__))
+import dbutil
+
+conn = dbutil.connect()
+c = conn.cursor()
+
+c.execute('''select submitter_name from comments_comment''')
+
+reviewers = {}
+
+mappings = {
+    u'alejandro "tab-lover" dubrovsky': u'Alejandro Dubrovsky',
+    u'alex hirzel <ahirzel@mtu.edu>': u'Alex Hirzel',
+    u'anonymous coward': u'Anonymous',
+    u'arthur van leeuwen': u'Arthur van Leeuwen',
+    u'augustss': u'Lennart Augustsson',
+    u'ed t': u'Anonymous',
+    u'geogre moschovitis': u'George Moschovitis',
+    u'george m': u'George Moschovitis',
+    u'haskell newb': u'Anonymous',
+    u'j. pablo fernandez': u'J. Pablo Fernández',
+    u'kamal al-marhoobi': u'Kamal Al-Marhubi',
+    u'kevin w.': u'Kevin Watters',
+    u'max cantor (#haskell - mxc)': u'Max Cantor',
+    u'michael campbell': u'Michael Campbell',
+    u'mike btauwerman': u'Mike Brauwerman',
+    u'no credit necessary': u'Anonymous',
+    u'nykänen, matti': u'Matti Nykänen',
+    u'omar antolin camarena': u'Omar Antolín Camarena',
+    u'ryan t mulligan': u'Ryan T. Mulligan',
+    u'sengan baring-gould': u'Sengan Baring-Gould',
+    u'some guy': u'Anonymous',
+    u'tomas janousek': u'Tomáš Janoušek',
+    u'william halchin': u'William N. Halchin',
+    }
+
+def fixup(s):
+    try:
+        return s.encode('ascii')
+    except UnicodeEncodeError:
+        def f(c):
+            o = ord(c)
+            if o < 128:
+                return c
+            return '&#%d;' % o
+        return ''.join(map(f, s))
+
+total = 0
+for r in c.fetchall():
+    r = r[0].decode('utf-8')
+    if r in ("Bryan O'Sullivan",):
+        continue
+    total += 1
+    m = mappings.get(r.lower())
+    if m:
+        r = m
+    elif len(r) < 2 or ' ' not in r:
+        r = 'Anonymous'
+    reviewers.setdefault(r, 0)
+    reviewers[r] += 1
+
+reviewers = sorted(reviewers.iteritems(), key=lambda x: x[0])
+
+cohorts = [(.01,1),(.002,.01)]
+
+for (lo,hi) in cohorts:
+    lo = total * lo
+    hi = total * hi
+    for r in [n for n in reviewers if lo <= n[1] < hi]:
+        if r[1] > 3:
+            print '%s,' % fixup(r[0])
+    print
+
+lo = total * .002
+for n in reviewers:
+    if n[1] < lo:
+        print '%s,' % fixup(n[0])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/run.wsgi	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,12 @@
+import os
+import sys
+import django
+sys.path.append('/'.join(os.getcwd().split('/')[:-1])')
+sys.path.append(os.path.join(os.getcwd(),'comments'))
+os.environ['DJANGO_SETTINGS_MODULE'] = 'hgbook.settings'
+import django.core.handlers.wsgi
+application = django.core.handlers.wsgi.WSGIHandler()
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/run.wsgi~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,12 @@
+import os
+import sys
+import django
+sys.path.append('/'.join(os.getcwd().split('/')[:-1])')
+sys.path.append(os.join(os.getcwd().split('/'),comments))
+os.environ['DJANGO_SETTINGS_MODULE'] = 'hgbook.settings'
+import django.core.handlers.wsgi
+application = django.core.handlers.wsgi.WSGIHandler()
+
+
+
+
Binary file SEESenv/web/hgbook/secrets.py.gpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/settings.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,99 @@
+# Django settings for hgbook project.
+
+import os, sys
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+ADMINS = (
+    ("Bryan O'Sullivan", 'bos@serpentine.com'),
+)
+
+MANAGERS = ADMINS
+
+ROOT = os.path.dirname(sys.modules[__name__].__file__)
+
+DJAPIAN_DATABASE_PATH = '/home/amit/hgbook-alqua/web/hgbook'
+DJAPIAN_STEMMING_LANG = 'en'
+
+
+try:
+    from secrets import DATABASE_ENGINE, DATABASE_NAME, DATABASE_USER, \
+         DATABASE_PASSWORD, DATABASE_HOST, DATABASE_PORT, SECRET_KEY
+except ImportError:
+    print >> sys.stderr, 'Faking up some database configuration for you'
+    DATABASE_ENGINE = 'sqlite3'
+    DATABASE_NAME = os.path.join(ROOT, '.database.sqlite3')
+    DATABASE_USER = ''
+    DATABASE_PASSWORD = ''
+    DATABASE_HOST = ''
+    DATABASE_PORT = ''
+    SECRET_KEY = ''
+
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be avilable on all operating systems.
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
+TIME_ZONE = 'America/Los_Angeles'
+
+# Language code for this installation. All choices can be found here:
+# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
+LANGUAGE_CODE = 'en-us'
+
+SITE_ID = 1
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = True
+
+# Absolute path to the directory that holds media.
+# Example: "/home/media/media.lawrence.com/"
+MEDIA_ROOT = ''
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash if there is a path component (optional in other cases).
+# Examples: "http://media.lawrence.com", "http://example.com/media/"
+MEDIA_URL = ''
+
+# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
+# trailing slash.
+# Examples: "http://foo.com/media/", "/media/".
+ADMIN_MEDIA_PREFIX = '/media/'
+
+
+#Index Directories for searching static html files
+DD_SEARCH_INDEX_DIR = '../html/'
+
+
+
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+    'django.template.loaders.filesystem.load_template_source',
+    'django.template.loaders.app_directories.load_template_source',
+#     'django.template.loaders.eggs.load_template_source',
+)
+
+MIDDLEWARE_CLASSES = (
+    'django.middleware.common.CommonMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.middleware.doc.XViewMiddleware',
+    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware'
+)
+
+ROOT_URLCONF = 'hgbook.urls'
+
+TEMPLATE_DIRS = (
+    os.path.join(ROOT, 'templates')
+)
+
+INSTALLED_APPS = (
+    'django.contrib.admin',
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.sites',
+    'django.contrib.flatpages',
+    'hgbook.comments',
+)
Binary file SEESenv/web/hgbook/settings.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/settings.py~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,99 @@
+# Django settings for hgbook project.
+
+import os, sys
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+ADMINS = (
+    ("Bryan O'Sullivan", 'bos@serpentine.com'),
+)
+
+MANAGERS = ADMINS
+
+ROOT = os.path.dirname(sys.modules[__name__].__file__)
+
+DJAPIAN_DATABASE_PATH = '/path/to/my/project/data/djapian/'
+DJAPIAN_STEMMING_LANG = 'en'
+
+
+try:
+    from secrets import DATABASE_ENGINE, DATABASE_NAME, DATABASE_USER, \
+         DATABASE_PASSWORD, DATABASE_HOST, DATABASE_PORT, SECRET_KEY
+except ImportError:
+    print >> sys.stderr, 'Faking up some database configuration for you'
+    DATABASE_ENGINE = 'sqlite3'
+    DATABASE_NAME = os.path.join(ROOT, '.database.sqlite3')
+    DATABASE_USER = ''
+    DATABASE_PASSWORD = ''
+    DATABASE_HOST = ''
+    DATABASE_PORT = ''
+    SECRET_KEY = ''
+
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be avilable on all operating systems.
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
+TIME_ZONE = 'America/Los_Angeles'
+
+# Language code for this installation. All choices can be found here:
+# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
+LANGUAGE_CODE = 'en-us'
+
+SITE_ID = 1
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = True
+
+# Absolute path to the directory that holds media.
+# Example: "/home/media/media.lawrence.com/"
+MEDIA_ROOT = ''
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash if there is a path component (optional in other cases).
+# Examples: "http://media.lawrence.com", "http://example.com/media/"
+MEDIA_URL = ''
+
+# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
+# trailing slash.
+# Examples: "http://foo.com/media/", "/media/".
+ADMIN_MEDIA_PREFIX = '/media/'
+
+
+#Index Directories for searching static html files
+DD_SEARCH_INDEX_DIR = '../html/'
+
+
+
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+    'django.template.loaders.filesystem.load_template_source',
+    'django.template.loaders.app_directories.load_template_source',
+#     'django.template.loaders.eggs.load_template_source',
+)
+
+MIDDLEWARE_CLASSES = (
+    'django.middleware.common.CommonMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.middleware.doc.XViewMiddleware',
+    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware'
+)
+
+ROOT_URLCONF = 'hgbook.urls'
+
+TEMPLATE_DIRS = (
+    os.path.join(ROOT, 'templates')
+)
+
+INSTALLED_APPS = (
+    'django.contrib.admin',
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.sites',
+    'django.contrib.flatpages',
+    'hgbook.comments',
+)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/templates/404.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,8 @@
+{% extends "simple.html" %}
+
+{% block title %}Page Not Found{% endblock %}
+
+{% block body %}
+<p>Sorry, we hit <a href="http://www.haskell.org/haskellwiki/Bottom">&perp;</a> when trying to find the
+page you requested.</p>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/templates/500.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,11 @@
+{% extends "simple.html" %}
+
+{% block title %}Internal Server Error{% endblock %}
+
+{% block body %}
+<p>Sorry, we hit <a
+href="http://www.haskell.org/haskellwiki/Bottom">&perp;</a> when
+trying to process your request.  If possible, please let <a
+href="mailto:bos@serpentine.com">Bryan</a> know that this problem happened,
+and what you were doing when it occurred.</p>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/templates/boilerplate.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <title>{% block pagetitle %}Mercurial: The Definitive Guide{% endblock %}</title>
+    <link rel="stylesheet" href="/support/styles.css" type="text/css"/>
+    <link rel="alternate" type="application/atom+xml" title="Comments"
+      href="/feeds/comments/"/>
+    <link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png"/>
+    <script type="text/javascript" src="/support/jquery.js"></script>
+      <script type="text/javascript" src="/support/form.js"></script>
+    <script type="text/javascript" src="/support/hsbook.js"></script>
+  </head>
+
+  <body>
+    {% block bodycontent %}{% endblock %}
+
+    <div class="hgbookfooter"> <p><img src="/support/figs/rss.png"> Want to stay
+	up to date? Subscribe to comment feeds for any chapter, or
+	the <a class="feed"
+	  href="/feeds/comments/">entire book</a>.</p> <p>Copyright
+	2006, 2007, 2008, 2009 Bryan O'Sullivan.
+	  Icons by
+	  <a href="mailto:mattahan@gmail.com">Paul Davey</a> aka <a
+	  href="http://mattahan.deviantart.com/">Mattahan</a>.</p>
+    </div>
+
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    try {
+    var pageTracker = _gat._getTracker("UA-1805907-5");
+    pageTracker._trackPageview();
+    } catch(err) {}</script>
+  </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/templates/comment.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,62 @@
+{% ifequal length 1 %}
+  <a class="commenttoggle" id="toggle_{{ id }}"
+      onclick="return toggleComment('{{ id }}')"
+      href="comments: show / hide">One comment</a>
+{% else %}
+  {% if length %}
+    <a class="commenttoggle" id="toggle_{{ id }}"
+      onclick="return toggleComment('{{ id }}')"
+      href="comments: show / hide">{{ length }} comments</a>
+  {% else %}
+    <a class="commenttoggle" id="toggle_{{ id }}"
+      onclick="return toggleComment('{{ id }}')"
+      href="comments: show / hide">No comments</a>
+    <div class="comment" {% if not newid %} style="display: none;" {% endif %}>
+      <div class="comment_body">Be the first to comment on this paragraph!</div>
+    </div>
+  {% endif %}
+{% endifequal %}
+{% for c in query %}
+  <div class="{% ifequal c.id newid %}new_{% endifequal %}comment"
+      {% if not newid %} style="display: none;" {% endif %}
+    id="comment{{ c.id }}">
+    <a name="comment{{ c.id }}"/>
+    <div class="comment_header">
+	<span class="comment_id"><a href="/review/admin/comments/comment/{{ c.id }}/">{{ c.id }}</a></span>
+      {% if c.submitter_url %}
+	<span class="comment_name"><a rel="nofollow"
+	  href="{{ c.submitter_url }}">{{ c.submitter_name|escape }}</a></span>
+      {% else %}
+	<span class="comment_name">{{ c.submitter_name|escape }}</span>
+      {% endif %}
+      <span class="comment_date">{{ c.date|date:"Y-m-d" }}</span>
+      {% if c.reviewed %}
+	<span class="comment_reviewed">(reviewed)</span>
+      {% endif %}
+      {% ifequal c.id newid %}
+	<span class="comment_thanks">thank you for your comment!</span>
+      {% endifequal %}
+    </div>
+    <div class="comment_body">{{ c.comment|escape|linebreaks }}</div>
+  </div>
+{% endfor %}
+<form class="comment" id="form_{{ id }}" action="/review/comments/submit/{{ id }}/"
+    method="post" {% if not newid %} style="display: none;" {% endif %}>
+  {{ form.id }}
+  <table>
+    <tbody>
+      <tr><td align="right" valign="top">Comment<br><a class="comment_help"
+		href="web.html#web.comment">[ help ]</a></td>
+	  <td>{{ form.comment }}</td></tr>
+      <tr><td align="right">Your name</td><td>{{ form.name }}
+	    <span class="comment_help"><b>Required</b> so we can <a
+		href="web.html#web.comment.name">give you credit</a></span></td></tr>
+      <tr><td align="right">Your URL</td><td>{{ form.url }}
+	    <span class="comment_help"><b>Optional</b> link to blog, home page,
+	      <i>etc</i>.</span></td></tr>
+      <tr><td align="right">Remember you?</td><td>{{ form.remember }}</td></tr>
+      <tr><td/><td><input name="submit" type="submit"
+	      value="Submit Comment"/><span class="comment_error">{{ error }}</span></td></tr>
+    </tbody>
+  </table>
+</form>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/templates/comment.html~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,62 @@
+{% ifequal length 1 %}
+  <a class="commenttoggle" id="toggle_{{ id }}"
+      onclick="return toggleComment('{{ id }}')"
+      href="comments: show / hide">One comment</a>
+{% else %}
+  {% if length %}
+    <a class="commenttoggle" id="toggle_{{ id }}"
+      onclick="return toggleComment('{{ id }}')"
+      href="comments: show / hide">{{ length }} comments</a>
+  {% else %}
+    <a class="commenttoggle" id="toggle_{{ id }}"
+      onclick="return toggleComment('{{ id }}')"
+      href="comments: show / hide">No comments</a>
+    <div class="comment" {% if not newid %} style="display: none;" {% endif %}>
+      <div class="comment_body">Be the first to comment on this paragraph!</div>
+    </div>
+  {% endif %}
+{% endifequal %}
+{% for c in query %}
+  <div class="{% ifequal c.id newid %}new_{% endifequal %}comment"
+      {% if not newid %} style="display: none;" {% endif %}
+    id="comment{{ c.id }}">
+    <a name="comment{{ c.id }}"/>
+    <div class="comment_header">
+	<span class="comment_id"><a href="/admin/comments/comment/{{ c.id }}/">{{ c.id }}</a></span>
+      {% if c.submitter_url %}
+	<span class="comment_name"><a rel="nofollow"
+	  href="{{ c.submitter_url }}">{{ c.submitter_name|escape }}</a></span>
+      {% else %}
+	<span class="comment_name">{{ c.submitter_name|escape }}</span>
+      {% endif %}
+      <span class="comment_date">{{ c.date|date:"Y-m-d" }}</span>
+      {% if c.reviewed %}
+	<span class="comment_reviewed">(reviewed)</span>
+      {% endif %}
+      {% ifequal c.id newid %}
+	<span class="comment_thanks">thank you for your comment!</span>
+      {% endifequal %}
+    </div>
+    <div class="comment_body">{{ c.comment|escape|linebreaks }}</div>
+  </div>
+{% endfor %}
+<form class="comment" id="form_{{ id }}" action="/review/comments/submit/{{ id }}/"
+    method="post" {% if not newid %} style="display: none;" {% endif %}>
+  {{ form.id }}
+  <table>
+    <tbody>
+      <tr><td align="right" valign="top">Comment<br><a class="comment_help"
+		href="web.html#web.comment">[ help ]</a></td>
+	  <td>{{ form.comment }}</td></tr>
+      <tr><td align="right">Your name</td><td>{{ form.name }}
+	    <span class="comment_help"><b>Required</b> so we can <a
+		href="web.html#web.comment.name">give you credit</a></span></td></tr>
+      <tr><td align="right">Your URL</td><td>{{ form.url }}
+	    <span class="comment_help"><b>Optional</b> link to blog, home page,
+	      <i>etc</i>.</span></td></tr>
+      <tr><td align="right">Remember you?</td><td>{{ form.remember }}</td></tr>
+      <tr><td/><td><input name="submit" type="submit"
+	      value="Submit Comment"/><span class="comment_error">{{ error }}</span></td></tr>
+    </tbody>
+  </table>
+</form>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/templates/feeds/comments_description.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,12 @@
+<p>On {{ obj.date|date:"Y-m-d" }},
+      {% if obj.submitter_url %}
+	<a rel="nofollow" href="{{ obj.submitter_url }}">{{ obj.submitter_name|escape }}</a>
+      {% else %}
+	{{ obj.submitter_name|escape }}
+      {% endif %}
+commented on &#8220;{{ obj.element.title|escape }}&#8221;:</p>
+<blockquote>
+{{ obj.comment|escape|linebreaks }}
+</blockquote>
+<p>To see this comment in context or to respond, visit <a
+	href="http://{{ site.domain }}{{ obj.get_absolute_url }}">{{ site.domain }}</a></p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/templates/feeds/comments_title.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1 @@
+Comment on &#8220;{{ obj.element.title|escape }}&#8221;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/templates/index.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,42 @@
+<html>
+  <head>
+    <title>Software Engineering for Engineers and Scientists</title>
+    <link rel="stylesheet" href="/review/support/styles.css" type="text/css"/>
+
+    <link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png"/>
+    <script type="text/javascript" src="/review/support/jquery.js"></script>
+
+      <script type="text/javascript" src="/review/support/form.js"></script>
+    <script type="text/javascript" src="/review/support/hsbook.js"></script>
+  </head>
+
+<body>
+    
+<div class="navheader"><h1 class="booktitle">SEES Documentation<div class="authors">by The FOSSEE TEAM</div></h1></div>
+<div class="book"> 
+{% if resp_dict %}
+{% for key,value in resp_dict %}
+<li>
+<a href={{ key }}>{{ value }}</a>
+</li>
+{% endfor %}
+{% endif %}
+
+
+
+<!-- <ul> 
+{% if resp_dict %}
+{% for key, value in resp_dict.items %}
+<li>   <a href={{ key }}>{{ val }}</a></li>
+{% endfor %} {% endif %}
+
+</ul>
+-->
+</div>
+
+
+
+    
+</body>
+</html>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/templates/index.html~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,42 @@
+<html>
+  <head>
+    <title>Software Engineering for Engineers and Scientists</title>
+    <link rel="stylesheet" href="/review/support/styles.css" type="text/css"/>
+
+    <link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png"/>
+    <script type="text/javascript" src="/review/support/jquery.js"></script>
+
+      <script type="text/javascript" src="/review/support/form.js"></script>
+    <script type="text/javascript" src="/review/support/hsbook.js"></script>
+  </head>
+
+<body>
+    
+<div class="navheader"><h1 class="booktitle">SEES Documentation<div class="authors">by The FOSSEE TEAM</div></h1></div>
+<div class="book"> 
+{% if resp_dict %}
+{% for item in resp_dict %}
+<li>
+<a href={{ item(0) }}>{{ item(1) }}</a>
+</li>
+{% endfor %}
+{% endif %}
+
+
+
+<!-- <ul> 
+{% if resp_dict %}
+{% for key, value in resp_dict.items %}
+<li>   <a href={{ key }}>{{ val }}</a></li>
+{% endfor %} {% endif %}
+
+</ul>
+-->
+</div>
+
+
+
+    
+</body>
+</html>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/templates/simple.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,7 @@
+{% extends "boilerplate.html" %}
+
+{% block bodycontent %}
+<div class="navheader"><h1>{% block title %}{% endblock %}</h1></div>
+
+<div class="basetemplate">{% block body %}{% endblock %}</div>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/templates/single_com.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,19 @@
+{% ifequal length 1 %}
+  <a class="commenttoggle" id="toggle_{{ id }}"
+      onclick="return toggleComment('{{ id }}')"
+      href="comments: show / hide">One comment</a>
+{% else %}
+  {% if length %}
+    <a class="commenttoggle" id="toggle_{{ id }}"
+      onclick="return toggleComment('{{ id }}')"
+      href="comments: show / hide">{{ length }} comments</a>
+  {% else %}
+    <a class="commenttoggle" id="toggle_{{ id }}"
+      onclick="return toggleComment('{{ id }}')"
+      href="comments: show / hide">No comments</a>
+    <div class="comment" {% if not newid %} style="display: none;" {% endif %}>
+      <div class="comment_body">Be the first to comment on this paragraph!</div>
+    </div>
+  {% endif %}
+{% endifequal %}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/templates/single_com.html~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,19 @@
+{% ifequal length 1 %}
+  <a class="commenttoggle" id="toggle_{{ id }}"
+      onclick="return toggleComment('{{ id }}')"
+      href="comments: show / hide">One comment</a>
+{% else %}
+  {% if length %}
+    <a class="commenttoggle" id="toggle_{{ id }}"
+      onclick="return toggleComment('{{ id }}')"
+      href="comments: show / hide">{{ length }} comments</a>
+  {% else %}
+    <a class="commenttoggle" id="toggle_{{ id }}"
+      onclick="return toggleComment('{{ id }}')"
+      href="comments: show / hide">No comments</a>
+    <div class="comment" {% if not newid %} style="display: none;" {% endif %}>
+      <div class="comment_body">Be the first to comment on this paragraph!</div>
+    </div>
+  {% endif %}
+{% endifequal %}
+{% for c in query %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/urls.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,31 @@
+import os, sys
+from django.conf.urls.defaults import *
+import hgbook.comments.feeds as feeds
+from django.contrib import admin
+
+admin.autodiscover()
+
+feeds = {
+    'comments': feeds.Comments,
+    }
+
+urlpatterns = patterns('',
+    (r'^comments/', include('hgbook.comments.urls')),
+
+    (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed',
+     {'feed_dict': feeds}),          
+    (r'^$', 'hgbook.comments.views.index'), 
+
+    (r'^search/', 'hgbook.comments.views.search'), 
+
+    # Only uncomment this for local testing without Apache.
+     (r'^html/(?P<path>.*)$', 'django.views.static.serve',
+     {'document_root': os.path.realpath(os.path.dirname(
+        sys.modules[__name__].__file__) + '/../html/')}),
+     (r'^support/(?P<path>.*)$', 'django.views.static.serve',
+     {'document_root': os.path.realpath(os.path.dirname(
+        sys.modules[__name__].__file__) + '/../support/')}),
+
+    # Uncomment this for admin:
+    (r'^admin/(.*)', admin.site.root),
+)
Binary file SEESenv/web/hgbook/urls.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/hgbook/urls.py~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,31 @@
+import os, sys
+from django.conf.urls.defaults import *
+import hgbook.comments.feeds as feeds
+from django.contrib import admin
+
+admin.autodiscover()
+
+feeds = {
+    'comments': feeds.Comments,
+    }
+
+urlpatterns = patterns('',
+    (r'^comments/', include('hgbook.comments.urls')),
+
+    (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed',
+     {'feed_dict': feeds}),          
+    (r'^/$', 'hgbook.comments.views.index'), 
+
+    (r'^search/', 'hgbook.comments.views.search'), 
+
+    # Only uncomment this for local testing without Apache.
+     (r'^html/(?P<path>.*)$', 'django.views.static.serve',
+     {'document_root': os.path.realpath(os.path.dirname(
+        sys.modules[__name__].__file__) + '/../html/')}),
+     (r'^support/(?P<path>.*)$', 'django.views.static.serve',
+     {'document_root': os.path.realpath(os.path.dirname(
+        sys.modules[__name__].__file__) + '/../support/')}),
+
+    # Uncomment this for admin:
+    (r'^admin/(.*)', admin.site.root),
+)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/backup/abc.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,530 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Chapter 9. Finding and fixing mistakes</title>
+<link rel="stylesheet" href="/support/styles.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.3"><link rel="home" href="index.html" title="Mercurial: The Definitive Guide">
+<link rel="up" href="index.html" title="Mercurial: The Definitive Guide">
+<link rel="prev" href="managing-releases-and-branchy-development.html" title="Chapter 8. Managing releases and branchy development">
+<link rel="next" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks"><link rel="alternate" type="application/atom+xml" title="Comments" href="/feeds/comments/">
+<link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png">
+<script type="text/javascript" src="/support/jquery-min.js"></script>
+<script type="text/javascript" src="/support/form.js"></script>
+<script type="text/javascript" src="/support/hsbook.js"></script></head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<div class="navheader">
+<table width="100%" summary="Navigation header">
+<tr><th colspan="3" align="center">Chapter 14. Adding functionality with extensions</th></tr>
+<tr>
+<td width="20%" align="left">
+<a accesskey="p" href="advanced-uses-of-mercurial-queues.html">Prev</a> </td>
+<th width="60%" align="center"> </th>
+<td width="20%" align="right"> <a accesskey="n" href="migrating-to-mercurial.html">Next</a>
+</td>
+</tr>
+</table>
+<hr>
+</div>
+<div class="chapter" title="Chapter 14. Adding functionality with extensions">
+<div class="titlepage"><div><div><h2 class="title">
+<a name="chap:hgext"></a>Chapter 14. Adding functionality with extensions</h2></div></div></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:inotify">14.1. Improve performance with the <code class="literal">inotify</code> extension</a></span></dt>
+<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:extdiff">14.2. Flexible diff support with the <code class="literal">extdiff</code> extension</a></span></dt>
+<dd><dl><dt><span class="sect2"><a href="adding-functionality-with-extensions.html#id3071699">14.2.1. Defining command aliases</a></span></dt></dl></dd>
+<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:transplant">14.3. Cherrypicking changes with the <code class="literal">transplant</code> extension</a></span></dt>
+<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:patchbomb">14.4. Send changes via email with the <code class="literal">patchbomb</code> extension</a></span></dt>
+<dd><dl><dt><span class="sect2"><a href="adding-functionality-with-extensions.html#id3072184">14.4.1. Changing the behavior of patchbombs</a></span></dt></dl></dd>
+</dl>
+</div>
+<p id="x_4fe"></a>While the core of Mercurial is quite complete from a
+    functionality standpoint, it's deliberately shorn of fancy
+    features.  This approach of preserving simplicity keeps the
+    software easy to deal with for both maintainers and users.</p>
+<p id="x_4ff"></a>However, Mercurial doesn't box you in with an inflexible
+    command set: you can add features to it as
+    <span class="emphasis"><em>extensions</em></span> (sometimes known as
+    <span class="emphasis"><em>plugins</em></span>).  We've already discussed a few of
+    these extensions in earlier chapters.</p>
+<p id="x_546" id="x_546"></a>When you provide a directory name, Mercurial will interpret
+      this as “<span class="quote">operate on every file in this directory and its
+	subdirectories</span>”. Mercurial traverses the files and
+      subdirectories in a directory in alphabetical order.  When it
+      encounters a subdirectory, it will traverse that subdirectory
+      before continuing with the current directory.</p>
+
+
+
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p id="x_500"></a><a class="xref" href="a-tour-of-mercurial-merging-work.html#sec:tour-merge:fetch" title="3.3. Simplifying the pull-merge-commit sequence">Section 3.3, “Simplifying the pull-merge-commit sequence”</a>
+	covers the <code class="literal">fetch</code> extension;
+	this combines pulling new changes and merging them with local
+	changes into a single command, <span class="command"><strong>fetch</strong></span>.</p></li>
+<li class="listitem"><p id="x_501"></a>In <a class="xref" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks">Chapter 10, <i>Handling repository events with hooks</i></a>, we covered
+	several extensions that are useful for hook-related
+	functionality: <code class="literal">acl</code> adds
+	access control lists; <code class="literal">bugzilla</code> adds integration with the
+	Bugzilla bug tracking system; and <code class="literal">notify</code> sends notification emails on
+	new changes.</p></li>
+<li class="listitem"><p id="x_502"></a>The Mercurial Queues patch management extension is
+	so invaluable that it merits two chapters and an appendix all
+	to itself. <a class="xref" href="managing-change-with-mercurial-queues.html" title="Chapter 12. Managing change with Mercurial Queues">Chapter 12, <i>Managing change with Mercurial Queues</i></a> covers the
+	basics; <a class="xref" href="advanced-uses-of-mercurial-queues.html" title="Chapter 13. Advanced uses of Mercurial Queues">Chapter 13, <i>Advanced uses of Mercurial Queues</i></a> discusses advanced topics;
+	and <a class="xref" href="mercurial-queues-reference.html" title="Appendix B. Mercurial Queues reference">Appendix B, <i>Mercurial Queues reference</i></a> goes into detail on
+	each
+	command.</p></li>
+</ul></div>
+<p id="x_503"></a>In this chapter, we'll cover some of the other extensions that
+    are available for Mercurial, and briefly touch on some of the
+    machinery you'll need to know about if you want to write an
+    extension of your own.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p id="x_504"></a>In <a class="xref" href="adding-functionality-with-extensions.html#sec:hgext:inotify" title="14.1. Improve performance with the inotify extension">Section 14.1, “Improve performance with the <code class="literal">inotify</code> extension”</a>,
+	we'll discuss the possibility of <span class="emphasis"><em>huge</em></span>
+	performance improvements using the <code class="literal">inotify</code> extension.</p></li></ul></div>
+<div class="sect1" title="14.1. Improve performance with the inotify extension">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="sec:hgext:inotify"></a>14.1. Improve performance with the <code class="literal">inotify</code> extension</h2></div></div></div>
+<p id="x_505"></a>Are you interested in having some of the most common
+      Mercurial operations run as much as a hundred times faster?
+      Read on!</p>
+<p id="x_506"></a>Mercurial has great performance under normal circumstances.
+      For example, when you run the <span class="command"><strong>hg
+	status</strong></span> command, Mercurial has to scan almost every
+      directory and file in your repository so that it can display
+      file status.  Many other Mercurial commands need to do the same
+      work behind the scenes; for example, the <span class="command"><strong>hg diff</strong></span> command uses the status
+      machinery to avoid doing an expensive comparison operation on
+      files that obviously haven't changed.</p>
+<p id="x_507"></a>Because obtaining file status is crucial to good
+      performance, the authors of Mercurial have optimised this code
+      to within an inch of its life.  However, there's no avoiding the
+      fact that when you run <span class="command"><strong>hg
+	status</strong></span>, Mercurial is going to have to perform at
+      least one expensive system call for each managed file to
+      determine whether it's changed since the last time Mercurial
+      checked.  For a sufficiently large repository, this can take a
+      long time.</p>
+<p id="x_508"></a>To put a number on the magnitude of this effect, I created a
+      repository containing 150,000 managed files.  I timed <span class="command"><strong>hg status</strong></span> as taking ten seconds to
+      run, even when <span class="emphasis"><em>none</em></span> of those files had been
+      modified.</p>
+<p id="x_509"></a>Many modern operating systems contain a file notification
+      facility. If a program signs up to an appropriate service, the
+      operating system will notify it every time a file of interest is
+      created, modified, or deleted.  On Linux systems, the kernel
+      component that does this is called
+      <code class="literal">inotify</code>.</p>
+<p id="x_50a"></a>Mercurial's <code class="literal">inotify</code>
+      extension talks to the kernel's <code class="literal">inotify</code>
+      component to optimise <span class="command"><strong>hg status</strong></span>
+      commands.  The extension has two components.  A daemon sits in
+      the background and receives notifications from the
+      <code class="literal">inotify</code> subsystem.  It also listens for
+      connections from a regular Mercurial command.  The extension
+      modifies Mercurial's behavior so that instead of scanning the
+      filesystem, it queries the daemon.  Since the daemon has perfect
+      information about the state of the repository, it can respond
+      with a result instantaneously, avoiding the need to scan every
+      directory and file in the repository.</p>
+<p id="x_50b"></a>Recall the ten seconds that I measured plain Mercurial as
+      taking to run <span class="command"><strong>hg status</strong></span> on a
+      150,000 file repository.  With the <code class="literal">inotify</code> extension enabled, the time
+      dropped to 0.1 seconds, a factor of <span class="emphasis"><em>one
+	hundred</em></span> faster.</p>
+<p id="x_50c"></a>Before we continue, please pay attention to some
+      caveats.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p id="x_50d"></a>The <code class="literal">inotify</code>
+	  extension is Linux-specific.  Because it interfaces directly
+	  to the Linux kernel's <code class="literal">inotify</code> subsystem,
+	  it does not work on other operating systems.</p></li>
+<li class="listitem"><p id="x_50e"></a>It should work on any Linux distribution that
+	  was released after early 2005.  Older distributions are
+	  likely to have a kernel that lacks
+	  <code class="literal">inotify</code>, or a version of
+	  <code class="literal">glibc</code> that does not have the necessary
+	  interfacing support.</p></li>
+<li class="listitem"><p id="x_50f"></a>Not all filesystems are suitable for use with
+	  the <code class="literal">inotify</code> extension.
+	  Network filesystems such as NFS are a non-starter, for
+	  example, particularly if you're running Mercurial on several
+	  systems, all mounting the same network filesystem.  The
+	  kernel's <code class="literal">inotify</code> system has no way of
+	  knowing about changes made on another system.  Most local
+	  filesystems (e.g. ext3, XFS, ReiserFS) should work
+	  fine.</p></li>
+</ul></div>
+<p id="x_510"></a>The <code class="literal">inotify</code> extension is
+      not yet shipped with Mercurial as of May 2007, so it's a little
+      more involved to set up than other extensions.  But the
+      performance improvement is worth it!</p>
+<p id="x_511"></a>The extension currently comes in two parts: a set of patches
+      to the Mercurial source code, and a library of Python bindings
+      to the <code class="literal">inotify</code> subsystem.</p>
+<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="figs/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p id="x_512"></a>  There are <span class="emphasis"><em>two</em></span> Python
+	<code class="literal">inotify</code> binding libraries.  One of them is
+	called <code class="literal">pyinotify</code>, and is packaged by some
+	Linux distributions as <code class="literal">python-inotify</code>.
+	This is <span class="emphasis"><em>not</em></span> the one you'll need, as it is
+	too buggy and inefficient to be practical.</p></td></tr>
+</table></div>
+<p id="x_513"></a>To get going, it's best to already have a functioning copy
+      of Mercurial installed.</p>
+<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="figs/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p id="x_514"></a>  If you follow the instructions below, you'll be
+	<span class="emphasis"><em>replacing</em></span> and overwriting any existing
+	installation of Mercurial that you might already have, using
+	the latest <span class="quote">“<span class="quote">bleeding edge</span>”</span> Mercurial code. Don't
+	say you weren't warned!</p></td></tr>
+</table></div>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<p id="x_515"></a>Clone the Python <code class="literal">inotify</code>
+	  binding repository.  Build and install it.</p>
+<pre class="programlisting">hg clone http://hg.kublai.com/python/inotify
+cd inotify
+python setup.py build --force
+sudo python setup.py install --skip-build</pre>
+</li>
+<li class="listitem">
+<p id="x_516"></a>Clone the <code class="filename">crew</code> Mercurial repository.
+	  Clone the <code class="literal">inotify</code> patch
+	  repository so that Mercurial Queues will be able to apply
+	  patches to your cope of the <code class="filename">crew</code> repository.</p>
+<pre class="programlisting">hg clone http://hg.intevation.org/mercurial/crew
+hg clone crew inotify
+hg clone http://hg.kublai.com/mercurial/patches/inotify inotify/.hg/patches</pre>
+</li>
+<li class="listitem"><p id="x_517"></a>Make sure that you have the Mercurial Queues
+	  extension, <code class="literal">mq</code>, enabled.  If
+	  you've never used MQ, read <a class="xref" href="managing-change-with-mercurial-queues.html#sec:mq:start" title="12.5. Getting started with Mercurial Queues">Section 12.5, “Getting started with Mercurial Queues”</a> to get started
+	  quickly.</p></li>
+<li class="listitem">
+<p id="x_518"></a>Go into the <code class="filename">inotify</code> repo, and apply all
+	  of the <code class="literal">inotify</code> patches
+	  using the <code class="option">hg
+	    -a</code> option to the <span class="command"><strong>qpush</strong></span> command.</p>
+<pre class="programlisting">cd inotify
+hg qpush -a</pre>
+</li>
+<li class="listitem"><p id="x_519"></a>  If you get an error message from <span class="command"><strong>qpush</strong></span>, you should not continue.
+	  Instead, ask for help.</p></li>
+<li class="listitem">
+<p id="x_51a"></a>Build and install the patched version of
+	  Mercurial.</p>
+<pre class="programlisting">python setup.py build --force
+sudo python setup.py install --skip-build</pre>
+</li>
+</ol></div>
+<p id="x_51b"></a>Once you've build a suitably patched version of Mercurial,
+      all you need to do to enable the <code class="literal">inotify</code> extension is add an entry to
+      your <code class="filename">~/.hgrc</code>.</p>
+<pre class="programlisting">[extensions] inotify =</pre>
+<p id="x_51c"></a>When the <code class="literal">inotify</code> extension
+      is enabled, Mercurial will automatically and transparently start
+      the status daemon the first time you run a command that needs
+      status in a repository.  It runs one status daemon per
+      repository.</p>
+<p id="x_51d"></a>The status daemon is started silently, and runs in the
+      background.  If you look at a list of running processes after
+      you've enabled the <code class="literal">inotify</code>
+      extension and run a few commands in different repositories,
+      you'll thus see a few <code class="literal">hg</code> processes sitting
+      around, waiting for updates from the kernel and queries from
+      Mercurial.</p>
+<p id="x_51e"></a>The first time you run a Mercurial command in a repository
+      when you have the <code class="literal">inotify</code>
+      extension enabled, it will run with about the same performance
+      as a normal Mercurial command.  This is because the status
+      daemon needs to perform a normal status scan so that it has a
+      baseline against which to apply later updates from the kernel.
+      However, <span class="emphasis"><em>every</em></span> subsequent command that does
+      any kind of status check should be noticeably faster on
+      repositories of even fairly modest size.  Better yet, the bigger
+      your repository is, the greater a performance advantage you'll
+      see.  The <code class="literal">inotify</code> daemon makes
+      status operations almost instantaneous on repositories of all
+      sizes!</p>
+<p id="x_51f"></a>If you like, you can manually start a status daemon using
+      the <span class="command"><strong>inserve</strong></span> command.
+      This gives you slightly finer control over how the daemon ought
+      to run.  This command will of course only be available when the
+      <code class="literal">inotify</code> extension is
+      enabled.</p>
+<p id="x_520"></a>When you're using the <code class="literal">inotify</code> extension, you should notice
+      <span class="emphasis"><em>no difference at all</em></span> in Mercurial's
+      behavior, with the sole exception of status-related commands
+      running a whole lot faster than they used to.  You should
+      specifically expect that commands will not print different
+      output; neither should they give different results. If either of
+      these situations occurs, please report a bug.</p>
+</div>
+<div class="sect1" title="14.2. Flexible diff support with the extdiff extension">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="sec:hgext:extdiff"></a>14.2. Flexible diff support with the <code class="literal">extdiff</code> extension</h2></div></div></div>
+<p id="x_521"></a>Mercurial's built-in <span class="command"><strong>hg
+	diff</strong></span> command outputs plaintext unified diffs.</p>
+<pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg diff</code></strong>
+diff -r 80997726a0ea myfile
+--- a/myfile	Wed Jan 06 06:50:18 2010 +0000
++++ b/myfile	Wed Jan 06 06:50:18 2010 +0000
+@@ -1,1 +1,2 @@
+ The first line.
++The second line.
+</pre>
+<p id="x_522"></a>If you would like to use an external tool to display
+      modifications, you'll want to use the <code class="literal">extdiff</code> extension.  This will let you
+      use, for example, a graphical diff tool.</p>
+<p id="x_523"></a>The <code class="literal">extdiff</code> extension is
+      bundled with Mercurial, so it's easy to set up.  In the <code class="literal">extensions</code> section of your
+      <code class="filename">~/.hgrc</code>, simply add a
+      one-line entry to enable the extension.</p>
+<pre class="programlisting">[extensions]
+extdiff =</pre>
+<p id="x_524"></a>This introduces a command named <span class="command"><strong>extdiff</strong></span>, which by default uses
+      your system's <span class="command"><strong>diff</strong></span> command to generate a
+      unified diff in the same form as the built-in <span class="command"><strong>hg diff</strong></span> command.</p>
+<pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg extdiff</code></strong>
+--- a.80997726a0ea/myfile	2010-01-06 06:50:18.613674526 +0000
++++ /tmp/extdiffNErQlu/a/myfile	2010-01-06 06:50:18.437687076 +0000
+@@ -1 +1,2 @@
+ The first line.
++The second line.
+</pre>
+<p id="x_525"></a>The result won't be exactly the same as with the built-in
+      <span class="command"><strong>hg diff</strong></span> variations, because the
+      output of <span class="command"><strong>diff</strong></span> varies from one system to
+      another, even when passed the same options.</p>
+<p id="x_526"></a>As the <span class="quote">“<span class="quote"><code class="literal">making snapshot</code></span>”</span>
+      lines of output above imply, the <span class="command"><strong>extdiff</strong></span> command works by
+      creating two snapshots of your source tree.  The first snapshot
+      is of the source revision; the second, of the target revision or
+      working directory.  The <span class="command"><strong>extdiff</strong></span> command generates
+      these snapshots in a temporary directory, passes the name of
+      each directory to an external diff viewer, then deletes the
+      temporary directory.  For efficiency, it only snapshots the
+      directories and files that have changed between the two
+      revisions.</p>
+<p id="x_527"></a>Snapshot directory names have the same base name as your
+      repository. If your repository path is <code class="filename">/quux/bar/foo</code>, then <code class="filename">foo</code> will be the name of each
+      snapshot directory.  Each snapshot directory name has its
+      changeset ID appended, if appropriate.  If a snapshot is of
+      revision <code class="literal">a631aca1083f</code>, the directory will be
+      named <code class="filename">foo.a631aca1083f</code>.
+      A snapshot of the working directory won't have a changeset ID
+      appended, so it would just be <code class="filename">foo</code> in this example.  To see what
+      this looks like in practice, look again at the <span class="command"><strong>extdiff</strong></span> example above.  Notice
+      that the diff has the snapshot directory names embedded in its
+      header.</p>
+<p id="x_528"></a>The <span class="command"><strong>extdiff</strong></span> command
+      accepts two important options. The <code class="option">hg -p</code> option
+      lets you choose a program to view differences with, instead of
+      <span class="command"><strong>diff</strong></span>.  With the <code class="option">hg -o</code> option,
+      you can change the options that <span class="command"><strong>extdiff</strong></span> passes to the program
+      (by default, these options are
+      <span class="quote">“<span class="quote"><code class="literal">-Npru</code></span>”</span>, which only make sense
+      if you're running <span class="command"><strong>diff</strong></span>).  In other respects,
+      the <span class="command"><strong>extdiff</strong></span> command
+      acts similarly to the built-in <span class="command"><strong>hg
+	diff</strong></span> command: you use the same option names, syntax,
+      and arguments to specify the revisions you want, the files you
+      want, and so on.</p>
+<p id="x_529"></a>As an example, here's how to run the normal system
+      <span class="command"><strong>diff</strong></span> command, getting it to generate context
+      diffs (using the <code class="option">-c</code> option)
+      instead of unified diffs, and five lines of context instead of
+      the default three (passing <code class="literal">5</code> as the argument
+      to the <code class="option">-C</code> option).</p>
+<pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg extdiff -o -NprcC5</code></strong>
+*** a.80997726a0ea/myfile	Wed Jan  6 06:50:18 2010
+--- /tmp/extdiffNErQlu/a/myfile	Wed Jan  6 06:50:18 2010
+***************
+*** 1 ****
+--- 1,2 ----
+  The first line.
++ The second line.
+</pre>
+<p id="x_52a"></a>Launching a visual diff tool is just as easy.  Here's how to
+      launch the <span class="command"><strong>kdiff3</strong></span> viewer.</p>
+<pre class="programlisting">hg extdiff -p kdiff3 -o</pre>
+<p id="x_52b"></a>If your diff viewing command can't deal with directories,
+      you can easily work around this with a little scripting.  For an
+      example of such scripting in action with the <code class="literal">mq</code> extension and the
+      <span class="command"><strong>interdiff</strong></span> command, see <a class="xref" href="advanced-uses-of-mercurial-queues.html#mq-collab:tips:interdiff" title="13.9.2. Viewing the history of a patch">Section 13.9.2, “Viewing the history of a patch”</a>.</p>
+<div class="sect2" title="14.2.1. Defining command aliases">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id3071699"></a>14.2.1. Defining command aliases</h3></div></div></div>
+<p id="x_52c"></a>It can be cumbersome to remember the options to both the
+	<span class="command"><strong>extdiff</strong></span> command and
+	the diff viewer you want to use, so the <code class="literal">extdiff</code> extension lets you define
+	<span class="emphasis"><em>new</em></span> commands that will invoke your diff
+	viewer with exactly the right options.</p>
+<p id="x_52d"></a>All you need to do is edit your <code class="filename">~/.hgrc</code>, and add a section named
+	<code class="literal">extdiff</code>.  Inside this
+	section, you can define multiple commands.  Here's how to add
+	a <code class="literal">kdiff3</code> command.  Once you've defined
+	this, you can type <span class="quote">“<span class="quote"><code class="literal">hg kdiff3</code></span>”</span>
+	and the <code class="literal">extdiff</code> extension
+	will run <span class="command"><strong>kdiff3</strong></span> for you.</p>
+<pre class="programlisting">[extdiff]
+cmd.kdiff3 =</pre>
+<p id="x_52e"></a>If you leave the right hand side of the definition empty,
+	as above, the <code class="literal">extdiff</code>
+	extension uses the name of the command you defined as the name
+	of the external program to run.  But these names don't have to
+	be the same.  Here, we define a command named
+	<span class="quote">“<span class="quote"><code class="literal">hg wibble</code></span>”</span>, which runs
+	<span class="command"><strong>kdiff3</strong></span>.</p>
+<pre class="programlisting">[extdiff]
+ cmd.wibble = kdiff3</pre>
+<p id="x_52f"></a>You can also specify the default options that you want to
+	invoke your diff viewing program with.  The prefix to use is
+	<span class="quote">“<span class="quote"><code class="literal">opts.</code></span>”</span>, followed by the name
+	of the command to which the options apply.  This example
+	defines a <span class="quote">“<span class="quote"><code class="literal">hg vimdiff</code></span>”</span> command
+	that runs the <span class="command"><strong>vim</strong></span> editor's
+	<code class="literal">DirDiff</code> extension.</p>
+<pre class="programlisting">[extdiff]
+ cmd.vimdiff = vim
+opts.vimdiff = -f '+next' '+execute "DirDiff" argv(0) argv(1)'</pre>
+</div>
+</div>
+<div class="sect1" title="14.3. Cherrypicking changes with the transplant extension">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="sec:hgext:transplant"></a>14.3. Cherrypicking changes with the <code class="literal">transplant</code> extension</h2></div></div></div>
+<p id="x_530"></a>Need to have a long chat with Brendan about this.</p>
+</div>
+<div class="sect1" title="14.4. Send changes via email with the patchbomb extension">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="sec:hgext:patchbomb"></a>14.4. Send changes via email with the <code class="literal">patchbomb</code> extension</h2></div></div></div>
+<p id="x_531"></a>Many projects have a culture of <span class="quote">“<span class="quote">change
+	review</span>”</span>, in which people send their modifications to a
+      mailing list for others to read and comment on before they
+      commit the final version to a shared repository.  Some projects
+      have people who act as gatekeepers; they apply changes from
+      other people to a repository to which those others don't have
+      access.</p>
+<p id="x_532"></a>Mercurial makes it easy to send changes over email for
+      review or application, via its <code class="literal">patchbomb</code> extension.  The extension is
+      so named because changes are formatted as patches, and it's usual
+      to send one changeset per email message.  Sending a long series
+      of changes by email is thus much like <span class="quote">“<span class="quote">bombing</span>”</span> the
+      recipient's inbox, hence <span class="quote">“<span class="quote">patchbomb</span>”</span>.</p>
+<p id="x_533"></a>As usual, the basic configuration of the <code class="literal">patchbomb</code> extension takes just one or
+      two lines in your <code class="filename">
+	/.hgrc</code>.</p>
+<pre class="programlisting">[extensions]
+patchbomb =</pre>
+<p id="x_534"></a>Once you've enabled the extension, you will have a new
+      command available, named <span class="command"><strong>email</strong></span>.</p>
+<p id="x_535"></a>The safest and best way to invoke the <span class="command"><strong>email</strong></span> command is to
+      <span class="emphasis"><em>always</em></span> run it first with the <code class="option">hg -n</code> option.
+      This will show you what the command <span class="emphasis"><em>would</em></span>
+      send, without actually sending anything.  Once you've had a
+      quick glance over the changes and verified that you are sending
+      the right ones, you can rerun the same command, with the <code class="option">hg -n</code> option
+      removed.</p>
+<p id="x_536"></a>The <span class="command"><strong>email</strong></span> command
+      accepts the same kind of revision syntax as every other
+      Mercurial command.  For example, this command will send every
+      revision between 7 and <code class="literal">tip</code>, inclusive.</p>
+<pre class="programlisting">hg email -n 7:tip</pre>
+<p id="x_537"></a>You can also specify a <span class="emphasis"><em>repository</em></span> to
+      compare with.  If you provide a repository but no revisions, the
+      <span class="command"><strong>email</strong></span> command will
+      send all revisions in the local repository that are not present
+      in the remote repository.  If you additionally specify revisions
+      or a branch name (the latter using the <code class="option">hg -b</code> option),
+      this will constrain the revisions sent.</p>
+<p id="x_538"></a>It's perfectly safe to run the <span class="command"><strong>email</strong></span> command without the
+      names of the people you want to send to: if you do this, it will
+      just prompt you for those values interactively.  (If you're
+      using a Linux or Unix-like system, you should have enhanced
+      <code class="literal">readline</code>-style editing capabilities when
+      entering those headers, too, which is useful.)</p>
+<p id="x_539"></a>When you are sending just one revision, the <span class="command"><strong>email</strong></span> command will by
+      default use the first line of the changeset description as the
+      subject of the single email message it sends.</p>
+<p id="x_53a"></a>If you send multiple revisions, the <span class="command"><strong>email</strong></span> command will usually
+      send one message per changeset.  It will preface the series with
+      an introductory message, in which you should describe the
+      purpose of the series of changes you're sending.</p>
+<div class="sect2" title="14.4.1. Changing the behavior of patchbombs">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id3072184"></a>14.4.1. Changing the behavior of patchbombs</h3></div></div></div>
+<p id="x_53b"></a>Not every project has exactly the same conventions for
+	sending changes in email; the <code class="literal">patchbomb</code> extension tries to
+	accommodate a number of variations through command line
+	options.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p id="x_53c"></a>You can write a subject for the introductory
+	    message on the command line using the <code class="option">hg -s</code>
+	    option.  This takes one argument, the text of the subject
+	    to use.</p></li>
+<li class="listitem"><p id="x_53d"></a>To change the email address from which the
+	    messages originate, use the <code class="option">hg -f</code>
+	    option.  This takes one argument, the email address to
+	    use.</p></li>
+<li class="listitem"><p id="x_53e"></a>The default behavior is to send unified diffs
+	    (see <a class="xref" href="managing-change-with-mercurial-queues.html#sec:mq:patch" title="12.4. Understanding patches">Section 12.4, “Understanding patches”</a> for a
+	    description of the
+	    format), one per message.  You can send a binary bundle
+	    instead with the <code class="option">hg -b</code>
+	    option.</p></li>
+<li class="listitem"><p id="x_53f"></a>Unified diffs are normally prefaced with a
+	    metadata header.  You can omit this, and send unadorned
+	    diffs, with the <code class="option">hg
+	      --plain</code> option.</p></li>
+<li class="listitem"><p id="x_540"></a>Diffs are normally sent <span class="quote">“<span class="quote">inline</span>”</span>,
+	    in the same body part as the description of a patch.  This
+	    makes it easiest for the largest number of readers to
+	    quote and respond to parts of a diff, as some mail clients
+	    will only quote the first MIME body part in a message. If
+	    you'd prefer to send the description and the diff in
+	    separate body parts, use the <code class="option">hg -a</code>
+	    option.</p></li>
+<li class="listitem"><p id="x_541"></a>Instead of sending mail messages, you can
+	    write them to an <code class="literal">mbox</code>-format mail
+	    folder using the <code class="option">hg -m</code>
+	    option.  That option takes one argument, the name of the
+	    file to write to.</p></li>
+<li class="listitem"><p id="x_542"></a>If you would like to add a
+	    <span class="command"><strong>diffstat</strong></span>-format summary to each patch,
+	    and one to the introductory message, use the <code class="option">hg -d</code>
+	    option.  The <span class="command"><strong>diffstat</strong></span> command displays
+	    a table containing the name of each file patched, the
+	    number of lines affected, and a histogram showing how much
+	    each file is modified.  This gives readers a qualitative
+	    glance at how complex a patch is.</p></li>
+</ul></div>
+</div>
+</div>
+</div>
+<div class="navfooter">
+<hr>
+<table width="100%" summary="Navigation footer">
+<tr>
+<td width="40%" align="left">
+<a accesskey="p" href="advanced-uses-of-mercurial-queues.html">Prev</a> </td>
+<td width="20%" align="center"> </td>
+<td width="40%" align="right"> <a accesskey="n" href="migrating-to-mercurial.html">Next</a>
+</td>
+</tr>
+<tr>
+<td width="40%" align="left" valign="top">Chapter 13. Advanced uses of Mercurial Queues </td>
+<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
+<td width="40%" align="right" valign="top"> Appendix A. Migrating to Mercurial</td>
+</tr>
+</table>
+</div>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/backup/abc.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,2 @@
+pid_list=['x_4fe', 'x_4ff', 'x_546', 'x_503', 'x_505', 'x_506', 'x_507', 'x_508', 'x_509', 'x_50a', 'x_50b', 'x_50c', 'x_510', 'x_511', 'x_513', 'x_515', 'x_516', 'x_518', 'x_51a', 'x_51b', 'x_51c', 'x_51d', 'x_51e', 'x_51f', 'x_520', 'x_521', 'x_522', 'x_523', 'x_524', 'x_525', 'x_526', 'x_527', 'x_528', 'x_529', 'x_52a', 'x_52b', 'x_52c', 'x_52d', 'x_52e', 'x_52f', 'x_530', 'x_531', 'x_532', 'x_533', 'x_534', 'x_535', 'x_536', 'x_537', 'x_538', 'x_539', 'x_53a', 'x_53b']
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/backup/abcd.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,929 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 9. Finding and fixing mistakes</title><link rel="stylesheet" href="/support/styles.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.3"><link rel="home" href="index.html" title="Mercurial: The Definitive Guide"><link rel="up" href="index.html" title="Mercurial: The Definitive Guide"><link rel="prev" href="managing-releases-and-branchy-development.html" title="Chapter 8. Managing releases and branchy development"><link rel="next" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks"><link rel="alternate" type="application/atom+xml" title="Comments" href="/feeds/comments/"><link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png"><script type="text/javascript" src="/support/jquery-min.js"></script><script type="text/javascript" src="/support/form.js"></script><script type="text/javascript" src="/support/hsbook.js"></script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><h2 class="booktitle"><a href="/">Mercurial: The Definitive Guide</a><span class="authors">by Bryan O'Sullivan</span></h2></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. Finding and fixing mistakes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="managing-releases-and-branchy-development.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="handling-repository-events-with-hooks.html">Next</a></td></tr></table></div><div class="chapter" lang="en" id="chap:undo"><div class="titlepage"><div><div><h2 class="title">Chapter 9. Finding and fixing mistakes</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id390081">Erasing local history</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id390087">The accidental commit</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:rollback">Rolling back a transaction</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id390858">The erroneous pull</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:rollback-after-push">Rolling back is useless once you've pushed</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id391000">You can only roll back once</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id391367">Reverting the mistaken change</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:mgmt">File management errors</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id392218">Dealing with committed changes</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392287">Backing out a changeset</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392424">Backing out the tip changeset</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392766">Backing out a non-tip change</a></span></dt><dd><dl><dt><span class="sect3"><a href="finding-and-fixing-mistakes.html#id392990">Always use the --merge option</a></span></dt></dl></dd><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id393181">Gaining more control of the backout process</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id393814">Why hg backout works as
+	it does</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#sec:undo:aaaiiieee">Changes that should never have been</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394303">Backing out a merge</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394612">Protect yourself from escaped
+	changes</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394667">What to do about sensitive changes that escape</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#sec:undo:bisect">Finding the source of a bug</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394992">Using the hg bisect
+	command</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396541">Cleaning up after your search</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id396622">Tips for finding bugs effectively</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396628">Give consistent input</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396884">Automate as much as possible</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396713">Check your results</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396770">Beware interference between bugs</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396856">Bracket your search lazily</a></span></dt></dl></dd></dl></div><p id="x_d2"><a name="x_d2"></a>To err might be human, but to really handle the consequences
+    well takes a top-notch revision control system.  In this chapter,
+    we'll discuss some of the techniques you can use when you find
+    that a problem has crept into your project.  Mercurial has some
+    highly capable features that will help you to isolate the sources
+    of problems, and to handle them appropriately.</p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="id390081">Erasing local history</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id390087">The accidental commit</h3></div></div></div><p id="x_d3"><a name="x_d3"></a>I have the occasional but persistent problem of typing
+	rather more quickly than I can think, which sometimes results
+	in me committing a changeset that is either incomplete or
+	plain wrong.  In my case, the usual kind of incomplete
+	changeset is one in which I've created a new source file, but
+	forgotten to <span class="command"><strong>hg add</strong></span> it.  A
+	“<span class="quote">plain wrong</span>” changeset is not as common, but no
+	less annoying.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="sec:undo:rollback">Rolling back a transaction</h3></div></div></div><p id="x_d4"><a name="x_d4"></a>In <a class="xref" href="behind-the-scenes.html#sec:concepts:txn" title="Safe operation">the section called “Safe operation”</a>, I
+	mentioned that Mercurial treats each modification of a
+	repository as a <span class="emphasis"><em>transaction</em></span>.  Every time
+	you commit a changeset or pull changes from another
+	repository, Mercurial remembers what you did.  You can undo,
+	or <span class="emphasis"><em>roll back</em></span>, exactly one of these
+	actions using the <span class="command"><strong>hg rollback</strong></span>
+
+	command.  (See <a class="xref" href="finding-and-fixing-mistakes.html#sec:undo:rollback-after-push" title="Rolling back is useless once you've pushed">the section called “Rolling back is useless once you've pushed”</a>
+	for an important caveat about the use of this command.)</p><p id="x_d5"><a name="x_d5"></a>Here's a mistake that I often find myself making:
+	committing a change in which I've created a new file, but
+	forgotten to <span class="command"><strong>hg add</strong></span>
+	it.</p><pre id="id390839" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
+M a
+<code class="prompt">$</code> <strong class="userinput"><code>echo b &gt; b</code></strong>
+
+<code class="prompt">$</code> <strong class="userinput"><code>hg commit -m 'Add file b'</code></strong>
+</pre><p id="x_d6"><a name="x_d6"></a>Looking at the output of <span class="command"><strong>hg
+	  status</strong></span> after the commit immediately confirms the
+	error.</p><pre id="id390541" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
+? b
+<code class="prompt">$</code> <strong class="userinput"><code>hg tip</code></strong>
+
+changeset:   1:f2db1de2ba4f
+tag:         tip
+user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
+date:        Tue May 05 06:55:44 2009 +0000
+summary:     Add file b
+
+</pre><p id="x_d7"><a name="x_d7"></a>The commit captured the changes to the file
+	<code class="filename">a</code>, but not the new file
+	<code class="filename">b</code>.  If I were to push this changeset to a
+	repository that I shared with a colleague, the chances are
+	high that something in <code class="filename">a</code> would refer to
+	<code class="filename">b</code>, which would not be present in their
+	repository when they pulled my changes.  I would thus become
+	the object of some indignation.</p><p id="x_d8"><a name="x_d8"></a>However, luck is with me—I've caught my error
+	before I pushed the changeset.  I use the <span class="command"><strong>hg rollback</strong></span> command, and Mercurial
+	makes that last changeset vanish.</p><pre id="id391066" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg rollback</code></strong>
+
+rolling back last transaction
+<code class="prompt">$</code> <strong class="userinput"><code>hg tip</code></strong>
+changeset:   0:cde70bc943e1
+tag:         tip
+user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
+date:        Tue May 05 06:55:44 2009 +0000
+summary:     First commit
+
+<code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
+M a
+? b
+</pre><p id="x_d9"><a name="x_d9"></a>Notice that the changeset is no longer present in the
+	repository's history, and the working directory once again
+	thinks that the file <code class="filename">a</code> is modified.  The
+	commit and rollback have left the working directory exactly as
+	it was prior to the commit; the changeset has been completely
+	erased.  I can now safely <span class="command"><strong>hg
+	  add</strong></span> the file <code class="filename">b</code>, and rerun my
+	commit.</p><pre id="id391024" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg add b</code></strong>
+
+<code class="prompt">$</code> <strong class="userinput"><code>hg commit -m 'Add file b, this time for real'</code></strong>
+</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id390858">The erroneous pull</h3></div></div></div><p id="x_da"><a name="x_da"></a>It's common practice with Mercurial to maintain separate
+	development branches of a project in different repositories.
+	Your development team might have one shared repository for
+	your project's “<span class="quote">0.9</span>” release, and another,
+	containing different changes, for the “<span class="quote">1.0</span>”
+	release.</p><p id="x_db"><a name="x_db"></a>Given this, you can imagine that the consequences could be
+	messy if you had a local “<span class="quote">0.9</span>” repository, and
+	accidentally pulled changes from the shared “<span class="quote">1.0</span>”
+	repository into it.  At worst, you could be paying
+	insufficient attention, and push those changes into the shared
+	“<span class="quote">0.9</span>” tree, confusing your entire team (but don't
+	worry, we'll return to this horror scenario later).  However,
+	it's more likely that you'll notice immediately, because
+	Mercurial will display the URL it's pulling from, or you will
+	see it pull a suspiciously large number of changes into the
+	repository.</p><p id="x_dc"><a name="x_dc"></a>The <span class="command"><strong>hg rollback</strong></span> command
+	will work nicely to expunge all of the changesets that you
+	just pulled.  Mercurial groups all changes from one <span class="command"><strong>hg pull</strong></span> into a single transaction,
+	so one <span class="command"><strong>hg rollback</strong></span> is all you
+	need to undo this mistake.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="sec:undo:rollback-after-push">Rolling back is useless once you've pushed</h3></div></div></div><p id="x_dd"><a name="x_dd"></a>The value of the <span class="command"><strong>hg
+	  rollback</strong></span> command drops to zero once you've pushed
+	your changes to another repository.  Rolling back a change
+	makes it disappear entirely, but <span class="emphasis"><em>only</em></span> in
+	the repository in which you perform the <span class="command"><strong>hg rollback</strong></span>.  Because a rollback
+	eliminates history, there's no way for the disappearance of a
+	change to propagate between repositories.</p><p id="x_de"><a name="x_de"></a>If you've pushed a change to another
+	repository—particularly if it's a shared
+	repository—it has essentially “<span class="quote">escaped into the
+	  wild,</span>” and you'll have to recover from your mistake
+	in a different way.  If you push a changeset somewhere, then
+	roll it back, then pull from the repository you pushed to, the
+	changeset you thought you'd gotten rid of will simply reappear
+	in your repository.</p><p id="x_df"><a name="x_df"></a>(If you absolutely know for sure that the change
+	you want to roll back is the most recent change in the
+	repository that you pushed to, <span class="emphasis"><em>and</em></span> you
+	know that nobody else could have pulled it from that
+	repository, you can roll back the changeset there, too, but
+	you really should not expect this to work reliably.  Sooner or
+	later a change really will make it into a repository that you
+	don't directly control (or have forgotten about), and come
+	back to bite you.)</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id391000">You can only roll back once</h3></div></div></div><p id="x_e0"><a name="x_e0"></a>Mercurial stores exactly one transaction in its
+	transaction log; that transaction is the most recent one that
+	occurred in the repository. This means that you can only roll
+	back one transaction.  If you expect to be able to roll back
+	one transaction, then its predecessor, this is not the
+	behavior you will get.</p><pre id="id391424" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg rollback</code></strong>
+
+rolling back last transaction
+<code class="prompt">$</code> <strong class="userinput"><code>hg rollback</code></strong>
+no rollback information available
+</pre><p id="x_e1"><a name="x_e1"></a>Once you've rolled back one transaction in a repository,
+	you can't roll back again in that repository until you perform
+	another commit or pull.</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="id391367">Reverting the mistaken change</h2></div></div></div><p id="x_e2"><a name="x_e2"></a>If you make a modification to a file, and decide that you
+      really didn't want to change the file at all, and you haven't
+      yet committed your changes, the <span class="command"><strong>hg
+	revert</strong></span> command is the one you'll need.  It looks at
+      the changeset that's the parent of the working directory, and
+      restores the contents of the file to their state as of that
+      changeset. (That's a long-winded way of saying that, in the
+      normal case, it undoes your modifications.)</p><p id="x_e3"><a name="x_e3"></a>Let's illustrate how the <span class="command"><strong>hg
+	revert</strong></span> command works with yet another small example.
+      We'll begin by modifying a file that Mercurial is already
+      tracking.</p><pre id="id391316" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cat file</code></strong>
+
+original content
+<code class="prompt">$</code> <strong class="userinput"><code>echo unwanted change &gt;&gt; file</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>hg diff file</code></strong>
+diff -r b52afd4afc59 file
+--- a/file	Tue May 05 06:55:32 2009 +0000
++++ b/file	Tue May 05 06:55:32 2009 +0000
+@@ -1,1 +1,2 @@
+ original content
++unwanted change
+</pre><p id="x_e4"><a name="x_e4"></a>If we don't
+      want that change, we can simply <span class="command"><strong>hg
+	revert</strong></span> the file.</p><pre id="id391251" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
+
+M file
+<code class="prompt">$</code> <strong class="userinput"><code>hg revert file</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>cat file</code></strong>
+original content
+</pre><p id="x_e5"><a name="x_e5"></a>The <span class="command"><strong>hg revert</strong></span> command
+      provides us with an extra degree of safety by saving our
+      modified file with a <code class="filename">.orig</code>
+      extension.</p><pre id="id391767" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
+
+? file.orig
+<code class="prompt">$</code> <strong class="userinput"><code>cat file.orig</code></strong>
+original content
+unwanted change
+</pre><div class="tip"><table border="0" summary="Tip: Be careful with .orig files"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="/support/figs/tip.png"></td><th align="left">Be careful with .orig files</th></tr><tr><td align="left" valign="top"><p id="x_6b8"><a name="x_6b8"></a>It's extremely unlikely that you are either using
+	Mercurial to manage files with <code class="filename">.orig</code>
+	extensions or that you even care about the contents of such
+	files.  Just in case, though, it's useful to remember that
+	<span class="command"><strong>hg revert</strong></span> will
+	unconditionally overwrite an existing file with a
+	<code class="filename">.orig</code> extension. For instance, if you
+	already have a file named <code class="filename">foo.orig</code> when
+	you revert <code class="filename">foo</code>, the contents of
+	<code class="filename">foo.orig</code> will be clobbered.</p></td></tr></table></div><p id="x_e6"><a name="x_e6"></a>Here is a summary of the cases that the <span class="command"><strong>hg revert</strong></span> command can deal with.  We
+      will describe each of these in more detail in the section that
+      follows.</p><div class="itemizedlist"><ul type="disc"><li><p id="x_e7"><a name="x_e7"></a>If you modify a file, it will restore the file
+	  to its unmodified state.</p></li><li><p id="x_e8"><a name="x_e8"></a>If you <span class="command"><strong>hg add</strong></span> a
+	  file, it will undo the “<span class="quote">added</span>” state of the
+	  file, but leave the file itself untouched.</p></li><li><p id="x_e9"><a name="x_e9"></a>If you delete a file without telling Mercurial,
+	  it will restore the file to its unmodified contents.</p></li><li><p id="x_ea"><a name="x_ea"></a>If you use the <span class="command"><strong>hg
+	    remove</strong></span> command to remove a file, it will undo
+	  the “<span class="quote">removed</span>” state of the file, and restore
+	  the file to its unmodified contents.</p></li></ul></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="sec:undo:mgmt">File management errors</h3></div></div></div><p id="x_eb"><a name="x_eb"></a>The <span class="command"><strong>hg revert</strong></span> command is
+	useful for more than just modified files.  It lets you reverse
+	the results of all of Mercurial's file management
+	commands—<span class="command"><strong>hg add</strong></span>,
+	<span class="command"><strong>hg remove</strong></span>, and so on.</p><p id="x_ec"><a name="x_ec"></a>If you <span class="command"><strong>hg add</strong></span> a file,
+	then decide that in fact you don't want Mercurial to track it,
+	use <span class="command"><strong>hg revert</strong></span> to undo the
+	add.  Don't worry; Mercurial will not modify the file in any
+	way.  It will just “<span class="quote">unmark</span>” the file.</p><pre id="id391756" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>echo oops &gt; oops</code></strong>
+
+<code class="prompt">$</code> <strong class="userinput"><code>hg add oops</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>hg status oops</code></strong>
+A oops
+<code class="prompt">$</code> <strong class="userinput"><code>hg revert oops</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
+
+? oops
+</pre><p id="x_ed"><a name="x_ed"></a>Similarly, if you ask Mercurial to <span class="command"><strong>hg remove</strong></span> a file, you can use
+	<span class="command"><strong>hg revert</strong></span> to restore it to
+	the contents it had as of the parent of the working directory.
+	
+</p><pre id="id392036" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg remove file</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
+R file
+
+<code class="prompt">$</code> <strong class="userinput"><code>hg revert file</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>ls file</code></strong>
+file
+</pre><p>
+
+ This works just as
+	well for a file that you deleted by hand, without telling
+	Mercurial (recall that in Mercurial terminology, this kind of
+	file is called “<span class="quote">missing</span>”).</p><pre id="id391954" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>rm file</code></strong>
+
+<code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
+! file
+<code class="prompt">$</code> <strong class="userinput"><code>hg revert file</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>ls file</code></strong>
+file
+</pre><p id="x_ee"><a name="x_ee"></a>If you revert a <span class="command"><strong>hg copy</strong></span>,
+	the copied-to file remains in your working directory
+	afterwards, untracked.  Since a copy doesn't affect the
+	copied-from file in any way, Mercurial doesn't do anything
+	with the copied-from file.</p><pre id="id392181" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg copy file new-file</code></strong>
+
+<code class="prompt">$</code> <strong class="userinput"><code>hg revert new-file</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
+? new-file
+</pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="id392218">Dealing with committed changes</h2></div></div></div><p id="x_f5"><a name="x_f5"></a>Consider a case where you have committed a change
+      <span class="emphasis"><em>a</em></span>, and another change
+      <span class="emphasis"><em>b</em></span> on top of it; you then realise that
+      change <span class="emphasis"><em>a</em></span> was incorrect.  Mercurial lets you
+      “<span class="quote">back out</span>” an entire changeset automatically, and
+      building blocks that let you reverse part of a changeset by
+      hand.</p><p id="x_f6"><a name="x_f6"></a>Before you read this section, here's something to
+      keep in mind: the <span class="command"><strong>hg backout</strong></span>
+
+      command undoes the effect of a change by
+      <span class="emphasis"><em>adding</em></span> to your repository's history, not by
+      modifying or erasing it.  It's the right tool to use if you're
+      fixing bugs, but not if you're trying to undo some change that
+      has catastrophic consequences.  To deal with those, see
+      <a class="xref" href="finding-and-fixing-mistakes.html#sec:undo:aaaiiieee" title="Changes that should never have been">the section called “Changes that should never have been”</a>.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id392287">Backing out a changeset</h3></div></div></div><p id="x_f7"><a name="x_f7"></a>The <span class="command"><strong>hg backout</strong></span> command
+	lets you “<span class="quote">undo</span>” the effects of an entire
+	changeset in an automated fashion.  Because Mercurial's
+	history is immutable, this command <span class="emphasis"><em>does
+	  not</em></span> get rid of the changeset you want to undo.
+	Instead, it creates a new changeset that
+	<span class="emphasis"><em>reverses</em></span> the effect of the to-be-undone
+	changeset.</p><p id="x_f8"><a name="x_f8"></a>The operation of the <span class="command"><strong>hg
+	  backout</strong></span> command is a little intricate, so let's
+	illustrate it with some examples.  First, we'll create a
+	repository with some simple changes.</p><pre id="id392685" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg init myrepo</code></strong>
+
+<code class="prompt">$</code> <strong class="userinput"><code>cd myrepo</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>echo first change &gt;&gt; myfile</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>hg add myfile</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>hg commit -m 'first change'</code></strong>
+
+<code class="prompt">$</code> <strong class="userinput"><code>echo second change &gt;&gt; myfile</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>hg commit -m 'second change'</code></strong>
+</pre><p id="x_f9"><a name="x_f9"></a>The <span class="command"><strong>hg backout</strong></span> command
+	takes a single changeset ID as its argument; this is the
+	changeset to back out.  Normally, <span class="command"><strong>hg
+	  backout</strong></span> will drop you into a text editor to write
+	a commit message, so you can record why you're backing the
+	change out.  In this example, we provide a commit message on
+	the command line using the <code class="option">-m</code> option.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id392424">Backing out the tip changeset</h3></div></div></div><p id="x_fa"><a name="x_fa"></a>We're going to start by backing out the last changeset we
+	committed.</p><pre id="id392577" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg backout -m 'back out second change' tip</code></strong>
+
+reverting myfile
+changeset 2:01adc4672142 backs out changeset 1:7e341ee3be7a
+<code class="prompt">$</code> <strong class="userinput"><code>cat myfile</code></strong>
+first change
+</pre><p id="x_fb"><a name="x_fb"></a>You can see that the second line from
+	<code class="filename">myfile</code> is no longer present.  Taking a
+	look at the output of <span class="command"><strong>hg log</strong></span>
+	gives us an idea of what the <span class="command"><strong>hg
+	  backout</strong></span> command has done.
+	
+
+</p><pre id="id392554" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg log --style compact</code></strong>
+2[tip]   01adc4672142   2009-05-05 06:55 +0000   bos
+  back out second change
+
+1   7e341ee3be7a   2009-05-05 06:55 +0000   bos
+  second change
+
+0   56b97fc928f2   2009-05-05 06:55 +0000   bos
+  first change
+
+</pre><p>
+
+ Notice that the new changeset
+	that <span class="command"><strong>hg backout</strong></span> has created
+	is a child of the changeset we backed out.  It's easier to see
+	this in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:backout" title="Figure 9.1. Backing out a change using the hg backout command">Figure 9.1, “Backing out a change using the hg backout command”</a>, which presents a
+	graphical view of the change history.  As you can see, the
+	history is nice and linear.</p><div class="figure"><a name="fig:undo:backout"></a><p class="title"><b>Figure 9.1. Backing out a change using the <span class="command">hg backout</span> command</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/undo-simple.png" alt="XXX add text"></div></div></div><br class="figure-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id392766">Backing out a non-tip change</h3></div></div></div><p id="x_fd"><a name="x_fd"></a>If you want to back out a change other than the last one
+	you committed, pass the <code class="option">--merge</code> option to the
+	<span class="command"><strong>hg backout</strong></span> command.</p><pre id="id393141" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd ..</code></strong>
+
+<code class="prompt">$</code> <strong class="userinput"><code>hg clone -r1 myrepo non-tip-repo</code></strong>
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 2 changesets with 2 changes to 1 files
+updating working directory
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+<code class="prompt">$</code> <strong class="userinput"><code>cd non-tip-repo</code></strong>
+</pre><p id="x_fe"><a name="x_fe"></a>This makes backing out any changeset a
+	“<span class="quote">one-shot</span>” operation that's usually simple and
+	fast.</p><pre id="id392845" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>echo third change &gt;&gt; myfile</code></strong>
+
+<code class="prompt">$</code> <strong class="userinput"><code>hg commit -m 'third change'</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>hg backout --merge -m 'back out second change' 1</code></strong>
+reverting myfile
+created new head
+changeset 3:abc7fd860049 backs out changeset 1:7e341ee3be7a
+merging with changeset 3:abc7fd860049
+merging myfile
+0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+</pre><p id="x_ff"><a name="x_ff"></a>If you take a look at the contents of
+	<code class="filename">myfile</code> after the backout finishes, you'll
+	see that the first and third changes are present, but not the
+	second.</p><pre id="id392886" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cat myfile</code></strong>
+
+first change
+third change
+</pre><p id="x_100"><a name="x_100"></a>As the graphical history in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:backout-non-tip" title="Figure 9.2. Automated backout of a non-tip change using the hg backout command">Figure 9.2, “Automated backout of a non-tip change using the
+	  hg backout command”</a> illustrates, Mercurial
+	still commits one change in this kind of situation (the
+	box-shaped node is the ones that Mercurial commits
+	automatically), but the revision graph now looks different.
+	Before Mercurial begins the backout process, it first
+	remembers what the current parent of the working directory is.
+	It then backs out the target changeset, and commits that as a
+	changeset.  Finally, it merges back to the previous parent of
+	the working directory, but notice that it <span class="emphasis"><em>does not
+	  commit</em></span> the result of the merge.  The repository
+	now contains two heads, and the working directory is in a
+	merge state.</p><div class="figure"><a name="fig:undo:backout-non-tip"></a><p class="title"><b>Figure 9.2. Automated backout of a non-tip change using the
+	  <span class="command">hg backout</span> command</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/undo-non-tip.png" alt="XXX add text"></div></div></div><br class="figure-break"><p id="x_103"><a name="x_103"></a>The result is that you end up “<span class="quote">back where you
+	  were</span>”, only with some extra history that undoes the
+	effect of the changeset you wanted to back out.</p><p id="x_6b9"><a name="x_6b9"></a>You might wonder why Mercurial does not commit the result
+	of the merge that it performed.  The reason lies in Mercurial
+	behaving conservatively: a merge naturally has more scope for
+	error than simply undoing the effect of the tip changeset,
+	so your work will be safest if you first inspect (and test!)
+	the result of the merge, <span class="emphasis"><em>then</em></span> commit
+	it.</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title" id="id392990">Always use the <code class="option">--merge</code> option</h4></div></div></div><p id="x_104"><a name="x_104"></a>In fact, since the <code class="option">--merge</code> option will do the
+	  “<span class="quote">right thing</span>” whether or not the changeset
+	  you're backing out is the tip (i.e. it won't try to merge if
+	  it's backing out the tip, since there's no need), you should
+	  <span class="emphasis"><em>always</em></span> use this option when you run the
+	  <span class="command"><strong>hg backout</strong></span> command.</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id393181">Gaining more control of the backout process</h3></div></div></div><p id="x_105"><a name="x_105"></a>While I've recommended that you always use the <code class="option">--merge</code> option when backing
+	out a change, the <span class="command"><strong>hg backout</strong></span>
+
+	command lets you decide how to merge a backout changeset.
+	Taking control of the backout process by hand is something you
+	will rarely need to do, but it can be useful to understand
+	what the <span class="command"><strong>hg backout</strong></span> command
+	is doing for you automatically.  To illustrate this, let's
+	clone our first repository, but omit the backout change that
+	it contains.</p><pre id="id393568" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd ..</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>hg clone -r1 myrepo newrepo</code></strong>
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 2 changesets with 2 changes to 1 files
+updating working directory
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+<code class="prompt">$</code> <strong class="userinput"><code>cd newrepo</code></strong>
+
+</pre><p id="x_106"><a name="x_106"></a>As with our
+	earlier example, We'll commit a third changeset, then back out
+	its parent, and see what happens.</p><pre id="id393553" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>echo third change &gt;&gt; myfile</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>hg commit -m 'third change'</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>hg backout -m 'back out second change' 1</code></strong>
+reverting myfile
+created new head
+changeset 3:abc7fd860049 backs out changeset 1:7e341ee3be7a
+the backout changeset is a new head - do not forget to merge
+(use "backout --merge" if you want to auto-merge)
+</pre><p id="x_107"><a name="x_107"></a>Our new changeset is again a descendant of the changeset
+	we backout out; it's thus a new head, <span class="emphasis"><em>not</em></span>
+
+	a descendant of the changeset that was the tip.  The <span class="command"><strong>hg backout</strong></span> command was quite
+	explicit in telling us this.</p><pre id="id393314" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg log --style compact</code></strong>
+3[tip]:1   abc7fd860049   2009-05-05 06:55 +0000   bos
+  back out second change
+
+2   bae4005ddac4   2009-05-05 06:55 +0000   bos
+  third change
+
+1   7e341ee3be7a   2009-05-05 06:55 +0000   bos
+  second change
+
+0   56b97fc928f2   2009-05-05 06:55 +0000   bos
+  first change
+
+</pre><p id="x_108"><a name="x_108"></a>Again, it's easier to see what has happened by looking at
+	a graph of the revision history, in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:backout-manual" title="Figure 9.3. Backing out a change using the hg backout command">Figure 9.3, “Backing out a change using the hg backout command”</a>.  This makes it clear
+	that when we use <span class="command"><strong>hg backout</strong></span>
+	to back out a change other than the tip, Mercurial adds a new
+	head to the repository (the change it committed is
+	box-shaped).</p><div class="figure"><a name="fig:undo:backout-manual"></a><p class="title"><b>Figure 9.3. Backing out a change using the <span class="command">hg backout</span> command</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/undo-manual.png" alt="XXX add text"></div></div></div><br class="figure-break"><p id="x_10a"><a name="x_10a"></a>After the <span class="command"><strong>hg backout</strong></span>
+
+	command has completed, it leaves the new
+	“<span class="quote">backout</span>” changeset as the parent of the working
+	directory.</p><pre id="id393912" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg parents</code></strong>
+changeset:   2:bae4005ddac4
+user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
+date:        Tue May 05 06:55:12 2009 +0000
+summary:     third change
+
+</pre><p id="x_10b"><a name="x_10b"></a>Now we have two isolated sets of changes.</p><pre id="id393905" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg heads</code></strong>
+
+changeset:   3:abc7fd860049
+tag:         tip
+parent:      1:7e341ee3be7a
+user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
+date:        Tue May 05 06:55:12 2009 +0000
+summary:     back out second change
+
+changeset:   2:bae4005ddac4
+user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
+date:        Tue May 05 06:55:12 2009 +0000
+summary:     third change
+
+</pre><p id="x_10c"><a name="x_10c"></a>Let's think about what we expect to see as the contents of
+	<code class="filename">myfile</code> now.  The first change should be
+	present, because we've never backed it out.  The second change
+	should be missing, as that's the change we backed out.  Since
+	the history graph shows the third change as a separate head,
+	we <span class="emphasis"><em>don't</em></span> expect to see the third change
+	present in <code class="filename">myfile</code>.</p><pre id="id393884" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cat myfile</code></strong>
+
+first change
+</pre><p id="x_10d"><a name="x_10d"></a>To get the third change back into the file, we just do a
+	normal merge of our two heads.</p><pre id="id393845" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg merge</code></strong>
+abort: outstanding uncommitted changes
+<code class="prompt">$</code> <strong class="userinput"><code>hg commit -m 'merged backout with previous tip'</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>cat myfile</code></strong>
+first change
+</pre><p id="x_10e"><a name="x_10e"></a>Afterwards, the graphical history of our
+	repository looks like
+	<a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:backout-manual-merge" title="Figure 9.4. Manually merging a backout change">Figure 9.4, “Manually merging a backout change”</a>.</p><div class="figure"><a name="fig:undo:backout-manual-merge"></a><p class="title"><b>Figure 9.4. Manually merging a backout change</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/undo-manual-merge.png" alt="XXX add text"></div></div></div><br class="figure-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id393814">Why <span class="command"><strong>hg backout</strong></span> works as
+	it does</h3></div></div></div><p id="x_110"><a name="x_110"></a>Here's a brief description of how the <span class="command"><strong>hg backout</strong></span> command works.</p><div class="orderedlist"><ol type="1"><li><p id="x_111"><a name="x_111"></a>It ensures that the working directory is
+	    “<span class="quote">clean</span>”, i.e. that the output of <span class="command"><strong>hg status</strong></span> would be empty.</p></li><li><p id="x_112"><a name="x_112"></a>It remembers the current parent of the working
+	    directory.  Let's call this changeset
+	    <code class="literal">orig</code>.</p></li><li><p id="x_113"><a name="x_113"></a>It does the equivalent of a <span class="command"><strong>hg update</strong></span> to sync the working
+	    directory to the changeset you want to back out.  Let's
+	    call this changeset <code class="literal">backout</code>.</p></li><li><p id="x_114"><a name="x_114"></a>It finds the parent of that changeset.  Let's
+	    call that changeset <code class="literal">parent</code>.</p></li><li><p id="x_115"><a name="x_115"></a>For each file that the
+	    <code class="literal">backout</code> changeset affected, it does the
+	    equivalent of a <span class="command"><strong>hg revert -r
+	      parent</strong></span> on that file, to restore it to the
+	    contents it had before that changeset was
+	    committed.</p></li><li><p id="x_116"><a name="x_116"></a>It commits the result as a new changeset.
+	    This changeset has <code class="literal">backout</code> as its
+	    parent.</p></li><li><p id="x_117"><a name="x_117"></a>If you specify <code class="option">--merge</code> on the command
+	    line, it merges with <code class="literal">orig</code>, and commits
+	    the result of the merge.</p></li></ol></div><p id="x_118"><a name="x_118"></a>An alternative way to implement the <span class="command"><strong>hg backout</strong></span> command would be to
+	<span class="command"><strong>hg export</strong></span> the
+	to-be-backed-out changeset as a diff, then use the <code class="option">--reverse</code> option to the
+	<span class="command"><strong>patch</strong></span> command to reverse the effect of the
+	change without fiddling with the working directory.  This
+	sounds much simpler, but it would not work nearly as
+	well.</p><p id="x_119"><a name="x_119"></a>The reason that <span class="command"><strong>hg
+	  backout</strong></span> does an update, a commit, a merge, and
+	another commit is to give the merge machinery the best chance
+	to do a good job when dealing with all the changes
+	<span class="emphasis"><em>between</em></span> the change you're backing out and
+	the current tip.</p><p id="x_11a"><a name="x_11a"></a>If you're backing out a changeset that's 100 revisions
+	back in your project's history, the chances that the
+	<span class="command"><strong>patch</strong></span> command will be able to apply a
+	reverse diff cleanly are not good, because intervening changes
+	are likely to have “<span class="quote">broken the context</span>” that
+	<span class="command"><strong>patch</strong></span> uses to determine whether it can
+	apply a patch (if this sounds like gibberish, see <a class="xref" href="managing-change-with-mercurial-queues.html#sec:mq:patch" title="Understanding patches">the section called “Understanding patches”</a> for a
+	discussion of the <span class="command"><strong>patch</strong></span> command).  Also,
+	Mercurial's merge machinery will handle files and directories
+	being renamed, permission changes, and modifications to binary
+	files, none of which <span class="command"><strong>patch</strong></span> can deal
+	with.</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="sec:undo:aaaiiieee">Changes that should never have been</h2></div></div></div><p id="x_11b"><a name="x_11b"></a>Most of the time, the <span class="command"><strong>hg
+	backout</strong></span> command is exactly what you need if you want
+      to undo the effects of a change.  It leaves a permanent record
+      of exactly what you did, both when committing the original
+      changeset and when you cleaned up after it.</p><p id="x_11c"><a name="x_11c"></a>On rare occasions, though, you may find that you've
+      committed a change that really should not be present in the
+      repository at all.  For example, it would be very unusual, and
+      usually considered a mistake, to commit a software project's
+      object files as well as its source files.  Object files have
+      almost no intrinsic value, and they're <span class="emphasis"><em>big</em></span>,
+      so they increase the size of the repository and the amount of
+      time it takes to clone or pull changes.</p><p id="x_11d"><a name="x_11d"></a>Before I discuss the options that you have if you commit a
+      “<span class="quote">brown paper bag</span>” change (the kind that's so bad
+      that you want to pull a brown paper bag over your head), let me
+      first discuss some approaches that probably won't work.</p><p id="x_11e"><a name="x_11e"></a>Since Mercurial treats history as
+      accumulative—every change builds on top of all changes
+      that preceded it—you generally can't just make disastrous
+      changes disappear.  The one exception is when you've just
+      committed a change, and it hasn't been pushed or pulled into
+      another repository.  That's when you can safely use the <span class="command"><strong>hg rollback</strong></span> command, as I detailed in
+      <a class="xref" href="finding-and-fixing-mistakes.html#sec:undo:rollback" title="Rolling back a transaction">the section called “Rolling back a transaction”</a>.</p><p id="x_11f"><a name="x_11f"></a>After you've pushed a bad change to another repository, you
+      <span class="emphasis"><em>could</em></span> still use <span class="command"><strong>hg
+	rollback</strong></span> to make your local copy of the change
+      disappear, but it won't have the consequences you want.  The
+      change will still be present in the remote repository, so it
+      will reappear in your local repository the next time you
+      pull.</p><p id="x_120"><a name="x_120"></a>If a situation like this arises, and you know which
+      repositories your bad change has propagated into, you can
+      <span class="emphasis"><em>try</em></span> to get rid of the change from
+      <span class="emphasis"><em>every</em></span> one of those repositories.  This is,
+      of course, not a satisfactory solution: if you miss even a
+      single repository while you're expunging, the change is still
+      “<span class="quote">in the wild</span>”, and could propagate further.</p><p id="x_121"><a name="x_121"></a>If you've committed one or more changes
+      <span class="emphasis"><em>after</em></span> the change that you'd like to see
+      disappear, your options are further reduced. Mercurial doesn't
+      provide a way to “<span class="quote">punch a hole</span>” in history, leaving
+      changesets intact.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id394303">Backing out a merge</h3></div></div></div><p id="x_6ba"><a name="x_6ba"></a>Since merges are often complicated, it is not unheard of
+	for a merge to be mangled badly, but committed erroneously.
+	Mercurial provides an important safeguard against bad merges
+	by refusing to commit unresolved files, but human ingenuity
+	guarantees that it is still possible to mess a merge up and
+	commit it.</p><p id="x_6bb"><a name="x_6bb"></a>Given a bad merge that has been committed, usually the
+	best way to approach it is to simply try to repair the damage
+	by hand.  A complete disaster that cannot be easily fixed up
+	by hand ought to be very rare, but the <span class="command"><strong>hg backout</strong></span> command may help in
+	making the cleanup easier. It offers a <code class="option">--parent</code> option, which lets
+	you specify which parent to revert to when backing out a
+	merge.</p><div class="figure"><a name="fig:undo:bad-merge-1"></a><p class="title"><b>Figure 9.5. A bad merge</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/bad-merge-1.png" alt="XXX add text"></div></div></div><br class="figure-break"><p id="x_6bc"><a name="x_6bc"></a>Suppose we have a revision graph like that in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:bad-merge-1" title="Figure 9.5. A bad merge">Figure 9.5, “A bad merge”</a>.  What we'd like is to
+	<span class="emphasis"><em>redo</em></span> the merge of revisions 2 and
+	3.</p><p id="x_6bd"><a name="x_6bd"></a>One way to do so would be as follows.</p><div class="orderedlist"><ol type="1"><li><p id="x_6be"><a name="x_6be"></a>Call <span class="command"><strong>hg backout --rev=4
+	      --parent=2</strong></span>.  This tells <span class="command"><strong>hg backout</strong></span> to back out revision
+	    4, which is the bad merge, and to when deciding which
+	    revision to prefer, to choose parent 2, one of the parents
+	    of the merge.  The effect can be seen in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:bad-merge-2" title="Figure 9.6. Backing out the merge, favoring one parent">Figure 9.6, “Backing out the merge, favoring one parent”</a>.</p><div class="figure"><a name="fig:undo:bad-merge-2"></a><p class="title"><b>Figure 9.6. Backing out the merge, favoring one parent</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/bad-merge-2.png" alt="XXX add text"></div></div></div><br class="figure-break"></li><li><p id="x_6bf"><a name="x_6bf"></a>Call <span class="command"><strong>hg backout --rev=4
+	      --parent=3</strong></span>.  This tells <span class="command"><strong>hg backout</strong></span> to back out revision
+	    4 again, but this time to choose parent 3, the other
+	    parent of the merge.  The result is visible in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:bad-merge-3" title="Figure 9.7. Backing out the merge, favoring the other parent">Figure 9.7, “Backing out the merge, favoring the other
+	      parent”</a>, in which the repository
+	    now contains three heads.</p><div class="figure"><a name="fig:undo:bad-merge-3"></a><p class="title"><b>Figure 9.7. Backing out the merge, favoring the other
+	      parent</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/bad-merge-3.png" alt="XXX add text"></div></div></div><br class="figure-break"></li><li><p id="x_6c0"><a name="x_6c0"></a>Redo the bad merge by merging the two backout heads,
+	    which reduces the number of heads in the repository to
+	    two, as can be seen in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:bad-merge-4" title="Figure 9.8. Merging the backouts">Figure 9.8, “Merging the backouts”</a>.</p><div class="figure"><a name="fig:undo:bad-merge-4"></a><p class="title"><b>Figure 9.8. Merging the backouts</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/bad-merge-4.png" alt="XXX add text"></div></div></div><br class="figure-break"></li><li><p id="x_6c1"><a name="x_6c1"></a>Merge with the commit that was made after the bad
+	    merge, as shown in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:bad-merge-5" title="Figure 9.9. Merging the backouts">Figure 9.9, “Merging the backouts”</a>.</p><div class="figure"><a name="fig:undo:bad-merge-5"></a><p class="title"><b>Figure 9.9. Merging the backouts</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/bad-merge-5.png" alt="XXX add text"></div></div></div><br class="figure-break"></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id394612">Protect yourself from “<span class="quote">escaped</span>”
+	changes</h3></div></div></div><p id="x_123"><a name="x_123"></a>If you've committed some changes to your local repository
+	and they've been pushed or pulled somewhere else, this isn't
+	necessarily a disaster.  You can protect yourself ahead of
+	time against some classes of bad changeset.  This is
+	particularly easy if your team usually pulls changes from a
+	central repository.</p><p id="x_124"><a name="x_124"></a>By configuring some hooks on that repository to validate
+	incoming changesets (see chapter <a class="xref" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks">Chapter 10, <i>Handling repository events with hooks</i></a>),
+	you can
+	automatically prevent some kinds of bad changeset from being
+	pushed to the central repository at all.  With such a
+	configuration in place, some kinds of bad changeset will
+	naturally tend to “<span class="quote">die out</span>” because they can't
+	propagate into the central repository.  Better yet, this
+	happens without any need for explicit intervention.</p><p id="x_125"><a name="x_125"></a>For instance, an incoming change hook that
+	verifies that a changeset will actually compile can prevent
+	people from inadvertently “<span class="quote">breaking the
+	  build</span>”.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id394667">What to do about sensitive changes that escape</h3></div></div></div><p id="x_6c2"><a name="x_6c2"></a>Even a carefully run project can suffer an unfortunate
+	event such as the committing and uncontrolled propagation of a
+	file that contains important passwords.</p><p id="x_6c3"><a name="x_6c3"></a>If something like this happens to you, and the information
+	that gets accidentally propagated is truly sensitive, your
+	first step should be to mitigate the effect of the leak
+	without trying to control the leak itself. If you are not 100%
+	certain that you know exactly who could have seen the changes,
+	you should immediately change passwords, cancel credit cards,
+	or find some other way to make sure that the information that
+	has leaked is no longer useful.  In other words, assume that
+	the change has propagated far and wide, and that there's
+	nothing more you can do.</p><p id="x_6c4"><a name="x_6c4"></a>You might hope that there would be mechanisms you could
+	use to either figure out who has seen a change or to erase the
+	change permanently everywhere, but there are good reasons why
+	these are not possible.</p><p id="x_6c5"><a name="x_6c5"></a>Mercurial does not provide an audit trail of who has
+	pulled changes from a repository, because it is usually either
+	impossible to record such information or trivial to spoof it.
+	In a multi-user or networked environment, you should thus be
+	extremely skeptical of yourself if you think that you have
+	identified every place that a sensitive changeset has
+	propagated to.  Don't forget that people can and will send
+	bundles by email, have their backup software save data
+	offsite, carry repositories on USB sticks, and find other
+	completely innocent ways to confound your attempts to track
+	down every copy of a problematic change.</p><p id="x_6c6"><a name="x_6c6"></a>Mercurial also does not provide a way to make a file or
+	changeset completely disappear from history, because there is
+	no way to enforce its disappearance; someone could easily
+	modify their copy of Mercurial to ignore such directives. In
+	addition, even if Mercurial provided such a capability,
+	someone who simply hadn't pulled a “<span class="quote">make this file
+	  disappear</span>” changeset wouldn't be affected by it, nor
+	would web crawlers visiting at the wrong time, disk backups,
+	or other mechanisms.  Indeed, no distributed revision control
+	system can make data reliably vanish. Providing the illusion
+	of such control could easily give a false sense of security,
+	and be worse than not providing it at all.</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="sec:undo:bisect">Finding the source of a bug</h2></div></div></div><p id="x_126"><a name="x_126"></a>While it's all very well to be able to back out a changeset
+      that introduced a bug, this requires that you know which
+      changeset to back out.  Mercurial provides an invaluable
+      command, called <span class="command"><strong>hg bisect</strong></span>, that
+      helps you to automate this process and accomplish it very
+      efficiently.</p><p id="x_127"><a name="x_127"></a>The idea behind the <span class="command"><strong>hg
+	bisect</strong></span> command is that a changeset has introduced
+      some change of behavior that you can identify with a simple
+      pass/fail test.  You don't know which piece of code introduced the
+      change, but you know how to test for the presence of the bug.
+      The <span class="command"><strong>hg bisect</strong></span> command uses your
+      test to direct its search for the changeset that introduced the
+      code that caused the bug.</p><p id="x_128"><a name="x_128"></a>Here are a few scenarios to help you understand how you
+      might apply this command.</p><div class="itemizedlist"><ul type="disc"><li><p id="x_129"><a name="x_129"></a>The most recent version of your software has a
+	  bug that you remember wasn't present a few weeks ago, but
+	  you don't know when it was introduced.  Here, your binary
+	  test checks for the presence of that bug.</p></li><li><p id="x_12a"><a name="x_12a"></a>You fixed a bug in a rush, and now it's time to
+	  close the entry in your team's bug database.  The bug
+	  database requires a changeset ID when you close an entry,
+	  but you don't remember which changeset you fixed the bug in.
+	  Once again, your binary test checks for the presence of the
+	  bug.</p></li><li><p id="x_12b"><a name="x_12b"></a>Your software works correctly, but runs 15%
+	  slower than the last time you measured it.  You want to know
+	  which changeset introduced the performance regression.  In
+	  this case, your binary test measures the performance of your
+	  software, to see whether it's “<span class="quote">fast</span>” or
+	  “<span class="quote">slow</span>”.</p></li><li><p id="x_12c"><a name="x_12c"></a>The sizes of the components of your project that
+	  you ship exploded recently, and you suspect that something
+	  changed in the way you build your project.</p></li></ul></div><p id="x_12d"><a name="x_12d"></a>From these examples, it should be clear that the <span class="command"><strong>hg bisect</strong></span> command is not useful only
+      for finding the sources of bugs.  You can use it to find any
+      “<span class="quote">emergent property</span>” of a repository (anything that
+      you can't find from a simple text search of the files in the
+      tree) for which you can write a binary test.</p><p id="x_12e"><a name="x_12e"></a>We'll introduce a little bit of terminology here, just to
+      make it clear which parts of the search process are your
+      responsibility, and which are Mercurial's.  A
+      <span class="emphasis"><em>test</em></span> is something that
+      <span class="emphasis"><em>you</em></span> run when <span class="command"><strong>hg
+	bisect</strong></span> chooses a changeset.  A
+      <span class="emphasis"><em>probe</em></span> is what <span class="command"><strong>hg
+	bisect</strong></span> runs to tell whether a revision is good.
+      Finally, we'll use the word “<span class="quote">bisect</span>”, as both a
+      noun and a verb, to stand in for the phrase “<span class="quote">search using
+	the <span class="command"><strong>hg bisect</strong></span>
+
+	command</span>”.</p><p id="x_12f"><a name="x_12f"></a>One simple way to automate the searching process would be
+      simply to probe every changeset.  However, this scales poorly.
+      If it took ten minutes to test a single changeset, and you had
+      10,000 changesets in your repository, the exhaustive approach
+      would take on average 35 <span class="emphasis"><em>days</em></span> to find the
+      changeset that introduced a bug.  Even if you knew that the bug
+      was introduced by one of the last 500 changesets, and limited
+      your search to those, you'd still be looking at over 40 hours to
+      find the changeset that introduced your bug.</p><p id="x_130"><a name="x_130"></a>What the <span class="command"><strong>hg bisect</strong></span> command
+      does is use its knowledge of the “<span class="quote">shape</span>” of your
+      project's revision history to perform a search in time
+      proportional to the <span class="emphasis"><em>logarithm</em></span> of the number
+      of changesets to check (the kind of search it performs is called
+      a dichotomic search).  With this approach, searching through
+      10,000 changesets will take less than three hours, even at ten
+      minutes per test (the search will require about 14 tests).
+      Limit your search to the last hundred changesets, and it will
+      take only about an hour (roughly seven tests).</p><p id="x_131"><a name="x_131"></a>The <span class="command"><strong>hg bisect</strong></span> command is
+      aware of the “<span class="quote">branchy</span>” nature of a Mercurial
+      project's revision history, so it has no problems dealing with
+      branches, merges, or multiple heads in a repository.  It can
+      prune entire branches of history with a single probe, which is
+      how it operates so efficiently.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id394992">Using the <span class="command"><strong>hg bisect</strong></span>
+
+	command</h3></div></div></div><p id="x_132"><a name="x_132"></a>Here's an example of <span class="command"><strong>hg
+	  bisect</strong></span> in action.</p><div class="note"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="/support/figs/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p id="x_133"><a name="x_133"></a>  In versions 0.9.5 and earlier of Mercurial, <span class="command"><strong>hg bisect</strong></span> was not a core command:
+	  it was distributed with Mercurial as an extension. This
+	  section describes the built-in command, not the old
+	  extension.</p></td></tr></table></div><p id="x_134"><a name="x_134"></a>Now let's create a repository, so that we can try out the
+	<span class="command"><strong>hg bisect</strong></span> command in
+	isolation.</p><pre id="id395406" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg init mybug</code></strong>
+
+<code class="prompt">$</code> <strong class="userinput"><code>cd mybug</code></strong>
+</pre><p id="x_135"><a name="x_135"></a>We'll simulate a project that has a bug in it in a
+	simple-minded way: create trivial changes in a loop, and
+	nominate one specific change that will have the
+	“<span class="quote">bug</span>”.  This loop creates 35 changesets, each
+	adding a single file to the repository. We'll represent our
+	“<span class="quote">bug</span>” with a file that contains the text “<span class="quote">i
+	  have a gub</span>”.</p><pre id="id395397" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>buggy_change=22</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>for (( i = 0; i &lt; 35; i++ )); do</code></strong>
+
+<code class="prompt">&gt;</code> <strong class="userinput"><code>  if [[ $i = $buggy_change ]]; then</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>    echo 'i have a gub' &gt; myfile$i</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>    hg commit -q -A -m 'buggy changeset'</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>  else</code></strong>
+
+<code class="prompt">&gt;</code> <strong class="userinput"><code>    echo 'nothing to see here, move along' &gt; myfile$i</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>    hg commit -q -A -m 'normal changeset'</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>  fi</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>done</code></strong>
+
+</pre><p id="x_136"><a name="x_136"></a>The next thing that we'd like to do is figure out how to
+	use the <span class="command"><strong>hg bisect</strong></span> command.
+	We can use Mercurial's normal built-in help mechanism for
+	this.</p><pre id="id395535" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg help bisect</code></strong>
+hg bisect [-gbsr] [-c CMD] [REV]
+
+subdivision search of changesets
+
+    This command helps to find changesets which introduce problems.
+    To use, mark the earliest changeset you know exhibits the problem
+    as bad, then mark the latest changeset which is free from the
+    problem as good. Bisect will update your working directory to a
+    revision for testing (unless the --noupdate option is specified).
+    Once you have performed tests, mark the working directory as bad
+    or good and bisect will either update to another candidate changeset
+    or announce that it has found the bad revision.
+
+    As a shortcut, you can also use the revision argument to mark a
+    revision as good or bad without checking it out first.
+
+    If you supply a command it will be used for automatic bisection. Its exit
+    status will be used as flag to mark revision as bad or good. In case exit
+    status is 0 the revision is marked as good, 125 - skipped, 127 (command not
+    found) - bisection will be aborted; any other status bigger than 0 will
+    mark revision as bad.
+
+options:
+
+ -r --reset     reset bisect state
+ -g --good      mark changeset good
+ -b --bad       mark changeset bad
+ -s --skip      skip testing changeset
+ -c --command   use command to check changeset state
+ -U --noupdate  do not update to target
+
+use "hg -v help bisect" to show global options
+</pre><p id="x_137"><a name="x_137"></a>The <span class="command"><strong>hg bisect</strong></span> command
+	works in steps.  Each step proceeds as follows.</p><div class="orderedlist"><ol type="1"><li><p id="x_138"><a name="x_138"></a>You run your binary test.</p><div class="itemizedlist"><ul type="disc"><li><p id="x_139"><a name="x_139"></a>If the test succeeded, you tell <span class="command"><strong>hg bisect</strong></span> by running the
+		<span class="command"><strong>hg bisect --good</strong></span>
+
+		command.</p></li><li><p id="x_13a"><a name="x_13a"></a>If it failed, run the <span class="command"><strong>hg bisect --bad</strong></span>
+		command.</p></li></ul></div></li><li><p id="x_13b"><a name="x_13b"></a>The command uses your information to decide
+	    which changeset to test next.</p></li><li><p id="x_13c"><a name="x_13c"></a>It updates the working directory to that
+	    changeset, and the process begins again.</p></li></ol></div><p id="x_13d"><a name="x_13d"></a>The process ends when <span class="command"><strong>hg
+	  bisect</strong></span> identifies a unique changeset that marks
+	the point where your test transitioned from
+	“<span class="quote">succeeding</span>” to “<span class="quote">failing</span>”.</p><p id="x_13e"><a name="x_13e"></a>To start the search, we must run the <span class="command"><strong>hg bisect --reset</strong></span> command.</p><pre id="id395968" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg bisect --reset</code></strong>
+
+</pre><p id="x_13f"><a name="x_13f"></a>In our case, the binary test we use is simple: we check to
+	see if any file in the repository contains the string “<span class="quote">i
+	  have a gub</span>”.  If it does, this changeset contains the
+	change that “<span class="quote">caused the bug</span>”.  By convention, a
+	changeset that has the property we're searching for is
+	“<span class="quote">bad</span>”, while one that doesn't is
+	“<span class="quote">good</span>”.</p><p id="x_140"><a name="x_140"></a>Most of the time, the revision to which the working
+	directory is synced (usually the tip) already exhibits the
+	problem introduced by the buggy change, so we'll mark it as
+	“<span class="quote">bad</span>”.</p><pre id="id396047" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg bisect --bad</code></strong>
+</pre><p id="x_141"><a name="x_141"></a>Our next task is to nominate a changeset that we know
+	<span class="emphasis"><em>doesn't</em></span> have the bug; the <span class="command"><strong>hg bisect</strong></span> command will
+	“<span class="quote">bracket</span>” its search between the first pair of
+	good and bad changesets.  In our case, we know that revision
+	10 didn't have the bug.  (I'll have more words about choosing
+	the first “<span class="quote">good</span>” changeset later.)</p><pre id="id396032" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg bisect --good 10</code></strong>
+
+Testing changeset 22:b8789808fc48 (24 changesets remaining, ~4 tests)
+0 files updated, 0 files merged, 12 files removed, 0 files unresolved
+</pre><p id="x_142"><a name="x_142"></a>Notice that this command printed some output.</p><div class="itemizedlist"><ul type="disc"><li><p id="x_143"><a name="x_143"></a>It told us how many changesets it must
+	    consider before it can identify the one that introduced
+	    the bug, and how many tests that will require.</p></li><li><p id="x_144"><a name="x_144"></a>It updated the working directory to the next
+	    changeset to test, and told us which changeset it's
+	    testing.</p></li></ul></div><p id="x_145"><a name="x_145"></a>We now run our test in the working directory.  We use the
+	<span class="command"><strong>grep</strong></span> command to see if our
+	“<span class="quote">bad</span>” file is present in the working directory.
+	If it is, this revision is bad; if not, this revision is good.
+	
+</p><pre id="id395911" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>if grep -q 'i have a gub' *</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>then</code></strong>
+
+<code class="prompt">&gt;</code> <strong class="userinput"><code>  result=bad</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>else</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>  result=good</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>fi</code></strong>
+<code class="prompt">$</code> <strong class="userinput"><code>echo this revision is $result</code></strong>
+
+this revision is bad
+<code class="prompt">$</code> <strong class="userinput"><code>hg bisect --$result</code></strong>
+Testing changeset 16:e61fdddff53e (12 changesets remaining, ~3 tests)
+0 files updated, 0 files merged, 6 files removed, 0 files unresolved
+</pre><p>
+
+</p><p id="x_146"><a name="x_146"></a>This test looks like a perfect candidate for automation,
+	so let's turn it into a shell function.</p><pre id="id396435" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>mytest() {</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>  if grep -q 'i have a gub' *</code></strong>
+
+<code class="prompt">&gt;</code> <strong class="userinput"><code>  then</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>    result=bad</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>  else</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>    result=good</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>  fi</code></strong>
+
+<code class="prompt">&gt;</code> <strong class="userinput"><code>  echo this revision is $result</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>  hg bisect --$result</code></strong>
+<code class="prompt">&gt;</code> <strong class="userinput"><code>}</code></strong>
+</pre><p id="x_147"><a name="x_147"></a>We can now run an entire test step with a single command,
+	<code class="literal">mytest</code>.</p><pre id="id396403" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>mytest</code></strong>
+
+this revision is good
+Testing changeset 19:706df39b003b (6 changesets remaining, ~2 tests)
+3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+</pre><p id="x_148"><a name="x_148"></a>A few more invocations of our canned test step command,
+	and we're done.</p><pre id="id396344" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>mytest</code></strong>
+this revision is good
+Testing changeset 20:bf7ea9a054e6 (3 changesets remaining, ~1 tests)
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+<code class="prompt">$</code> <strong class="userinput"><code>mytest</code></strong>
+this revision is good
+Testing changeset 21:921391dd45c1 (2 changesets remaining, ~1 tests)
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+<code class="prompt">$</code> <strong class="userinput"><code>mytest</code></strong>
+this revision is good
+The first bad revision is:
+changeset:   22:b8789808fc48
+user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
+
+date:        Tue May 05 06:55:14 2009 +0000
+summary:     buggy changeset
+
+</pre><p id="x_149"><a name="x_149"></a>Even though we had 40 changesets to search through, the
+	<span class="command"><strong>hg bisect</strong></span> command let us find
+	the changeset that introduced our “<span class="quote">bug</span>” with only
+	five tests.  Because the number of tests that the <span class="command"><strong>hg bisect</strong></span> command performs grows
+	logarithmically with the number of changesets to search, the
+	advantage that it has over the “<span class="quote">brute force</span>”
+	search approach increases with every changeset you add.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id396541">Cleaning up after your search</h3></div></div></div><p id="x_14a"><a name="x_14a"></a>When you're finished using the <span class="command"><strong>hg
+	  bisect</strong></span> command in a repository, you can use the
+	<span class="command"><strong>hg bisect --reset</strong></span> command to
+	drop the information it was using to drive your search.  The
+	command doesn't use much space, so it doesn't matter if you
+	forget to run this command.  However, <span class="command"><strong>hg bisect</strong></span> won't let you start a new
+	search in that repository until you do a <span class="command"><strong>hg bisect --reset</strong></span>.</p><pre id="id396936" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg bisect --reset</code></strong>
+
+</pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="id396622">Tips for finding bugs effectively</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id396628">Give consistent input</h3></div></div></div><p id="x_14b"><a name="x_14b"></a>The <span class="command"><strong>hg bisect</strong></span> command
+	requires that you correctly report the result of every test
+	you perform.  If you tell it that a test failed when it really
+	succeeded, it <span class="emphasis"><em>might</em></span> be able to detect the
+	inconsistency.  If it can identify an inconsistency in your
+	reports, it will tell you that a particular changeset is both
+	good and bad. However, it can't do this perfectly; it's about
+	as likely to report the wrong changeset as the source of the
+	bug.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id396884">Automate as much as possible</h3></div></div></div><p id="x_14c"><a name="x_14c"></a>When I started using the <span class="command"><strong>hg
+	  bisect</strong></span> command, I tried a few times to run my
+	tests by hand, on the command line.  This is an approach that
+	I, at least, am not suited to.  After a few tries, I found
+	that I was making enough mistakes that I was having to restart
+	my searches several times before finally getting correct
+	results.</p><p id="x_14d"><a name="x_14d"></a>My initial problems with driving the <span class="command"><strong>hg bisect</strong></span> command by hand occurred
+	even with simple searches on small repositories; if the
+	problem you're looking for is more subtle, or the number of
+	tests that <span class="command"><strong>hg bisect</strong></span> must
+	perform increases, the likelihood of operator error ruining
+	the search is much higher.  Once I started automating my
+	tests, I had much better results.</p><p id="x_14e"><a name="x_14e"></a>The key to automated testing is twofold:</p><div class="itemizedlist"><ul type="disc"><li><p id="x_14f"><a name="x_14f"></a>always test for the same symptom, and</p></li><li><p id="x_150"><a name="x_150"></a>always feed consistent input to the <span class="command"><strong>hg bisect</strong></span> command.</p></li></ul></div><p id="x_151"><a name="x_151"></a>In my tutorial example above, the <span class="command"><strong>grep</strong></span>
+
+	command tests for the symptom, and the <code class="literal">if</code>
+	statement takes the result of this check and ensures that we
+	always feed the same input to the <span class="command"><strong>hg
+	  bisect</strong></span> command.  The <code class="literal">mytest</code>
+	function marries these together in a reproducible way, so that
+	every test is uniform and consistent.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id396713">Check your results</h3></div></div></div><p id="x_152"><a name="x_152"></a>Because the output of a <span class="command"><strong>hg
+	  bisect</strong></span> search is only as good as the input you
+	give it, don't take the changeset it reports as the absolute
+	truth.  A simple way to cross-check its report is to manually
+	run your test at each of the following changesets:</p><div class="itemizedlist"><ul type="disc"><li><p id="x_153"><a name="x_153"></a>The changeset that it reports as the first bad
+	    revision.  Your test should still report this as
+	    bad.</p></li><li><p id="x_154"><a name="x_154"></a>The parent of that changeset (either parent,
+	    if it's a merge). Your test should report this changeset
+	    as good.</p></li><li><p id="x_155"><a name="x_155"></a>A child of that changeset.  Your test should
+	    report this changeset as bad.</p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id396770">Beware interference between bugs</h3></div></div></div><p id="x_156"><a name="x_156"></a>It's possible that your search for one bug could be
+	disrupted by the presence of another.  For example, let's say
+	your software crashes at revision 100, and worked correctly at
+	revision 50.  Unknown to you, someone else introduced a
+	different crashing bug at revision 60, and fixed it at
+	revision 80.  This could distort your results in one of
+	several ways.</p><p id="x_157"><a name="x_157"></a>It is possible that this other bug completely
+	“<span class="quote">masks</span>” yours, which is to say that it occurs
+	before your bug has a chance to manifest itself.  If you can't
+	avoid that other bug (for example, it prevents your project
+	from building), and so can't tell whether your bug is present
+	in a particular changeset, the <span class="command"><strong>hg
+	  bisect</strong></span> command cannot help you directly.  Instead,
+	you can mark a changeset as untested by running <span class="command"><strong>hg bisect --skip</strong></span>.</p><p id="x_158"><a name="x_158"></a>A different problem could arise if your test for a bug's
+	presence is not specific enough.  If you check for “<span class="quote">my
+	  program crashes</span>”, then both your crashing bug and an
+	unrelated crashing bug that masks it will look like the same
+	thing, and mislead <span class="command"><strong>hg
+	  bisect</strong></span>.</p><p id="x_159"><a name="x_159"></a>Another useful situation in which to use <span class="command"><strong>hg bisect --skip</strong></span> is if you can't
+	test a revision because your project was in a broken and hence
+	untestable state at that revision, perhaps because someone
+	checked in a change that prevented the project from
+	building.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id396856">Bracket your search lazily</h3></div></div></div><p id="x_15a"><a name="x_15a"></a>Choosing the first “<span class="quote">good</span>” and
+	“<span class="quote">bad</span>” changesets that will mark the end points of
+	your search is often easy, but it bears a little discussion
+	nevertheless.  From the perspective of <span class="command"><strong>hg bisect</strong></span>, the “<span class="quote">newest</span>”
+	changeset is conventionally “<span class="quote">bad</span>”, and the older
+	changeset is “<span class="quote">good</span>”.</p><p id="x_15b"><a name="x_15b"></a>If you're having trouble remembering when a suitable
+	“<span class="quote">good</span>” change was, so that you can tell <span class="command"><strong>hg bisect</strong></span>, you could do worse than
+	testing changesets at random.  Just remember to eliminate
+	contenders that can't possibly exhibit the bug (perhaps
+	because the feature with the bug isn't present yet) and those
+	where another problem masks the bug (as I discussed
+	above).</p><p id="x_15c"><a name="x_15c"></a>Even if you end up “<span class="quote">early</span>” by thousands of
+	changesets or months of history, you will only add a handful
+	of tests to the total number that <span class="command"><strong>hg
+	  bisect</strong></span> must perform, thanks to its logarithmic
+	behavior.</p></div></div></div><div class="hgfooter"><p><img src="/support/figs/rss.png"> Want to stay up to date? Subscribe to the comment feed for <a id="chapterfeed" class="feed" href="/feeds/comments/">this chapter</a>, or the <a class="feed" href="/feeds/comments/">entire book</a>.</p><p>Copyright 2006, 2007, 2008, 2009 Bryan O'Sullivan.
+      Icons by <a href="mailto:mattahan@gmail.com">Paul Davey</a> aka <a href="http://mattahan.deviantart.com/">Mattahan</a>.</p></div><div class="navfooter"><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="managing-releases-and-branchy-development.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="handling-repository-events-with-hooks.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 8. Managing releases and branchy development </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 10. Handling repository events with hooks</td></tr></table></div><script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script><script type="text/javascript">
+    try {
+    var pageTracker = _gat._getTracker("UA-1805907-5");
+    pageTracker._trackPageview();
+    } catch(err) {}</script></body></html>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/backup/ar01.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,387 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Functional Approach</title>
+<link rel="stylesheet" href="/support/styles.css" type="text/css">
+<meta id="generator" content="DocBook XSL Stylesheets V1.74.3"><link rel="home" href="index.html" title="Mercurial: The Definitive Guide">
+<link rel="up" href="index.html" title="Mercurial: The Definitive Guide">
+<link rel="prev" href="managing-releases-and-branchy-development.html" title="Chapter 8. Managing releases and branchy development">
+<link rel="next" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks"><link rel="alternate" type="application/atom+xml" title="Comments" href="/feeds/comments/">
+<link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png">
+<script type="text/javascript" src="/support/jquery-min.js"></script>
+<script type="text/javascript" src="/support/form.js"></script>
+<script type="text/javascript" src="/support/hsbook.js"></script></head>
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<div class="navheader">
+<table width="100%" summary="Navigation header">
+<tr><th colspan="3" align="center">Functional Approach</th></tr>
+<tr>
+<td width="20%" align="left">
+<a accesskey="p" href="index.html">Prev</a> </td>
+<th width="60%" align="center"> </th>
+<td width="20%" align="right"> </td>
+</tr>
+</table>
+<hr>
+</div>
+<div class="article" title="Functional Approach">
+<div class="titlepage">
+<div><div><h2 class="title">
+<a name="id2496165"></a>Functional Approach</h2></div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="ar01.html#default-arguments">1. Default Arguments</a></span></dt>
+<dt><span class="section"><a href="ar01.html#keyword-arguments">2. Keyword Arguments</a></span></dt>
+<dt><span class="section"><a href="ar01.html#parameter-packing-and-unpacking">3. Parameter Packing and Unpacking</a></span></dt>
+<dt><span class="section"><a href="ar01.html#nested-functions-and-scopes">4. Nested Functions and Scopes</a></span></dt>
+<dt><span class="section"><a href="ar01.html#map-reduce-and-filter-functions">5. map, reduce and filter functions</a></span></dt>
+<dd><dl><dt><span class="section"><a href="ar01.html#list-comprehensions">5.1. List Comprehensions</a></span></dt></dl></dd>
+</dl>
+</div>
+<p id="x_74b"><a name="x_74b"></a>
+    <span class="emphasis"><em>Functions</em></span> allow us to enclose a set of statements and call the function again and again instead of repeating the group of statements everytime. Functions also allow us to isolate a piece of code from all the other code and provides the convenience of not polluting the global variables.
+  </p>
+<p id="x_74c"><a name="x_74c"></a>
+    <span class="emphasis"><em>Function</em></span> in python is defined with the keyword 
+    <span class="strong"><strong>def</strong></span> followed by the name of the function, in turn followed by a pair of parenthesis which encloses the list of parameters to the function. The definition line ends with a ':'. The definition line is followed by the body of the function intended by one block. The 
+    <span class="emphasis"><em>Function</em></span> must return a value:
+  </p>
+<pre class="programlisting">def factorial(n):
+  fact = 1
+  for i in range(2, n):
+    fact *= i
+
+  return fact
+
+</pre>
+<p id="x_74d"><a name="x_74d"></a>The code snippet above defines a function with the name factorial, takes the number for which the factorial must be computed, computes the factorial and returns the value.</p>
+<p><a name="x_74e"></a>A 
+    <span class="emphasis"><em>Function</em></span> once defined can be used or called anywhere else in the program. We call a fucntion with its name followed by a pair of parenthesis which encloses the arguments to the function.
+  </p>
+<p><a name="x_74f"></a>The value that function returns can be assigned to a variable. Let's call the above function and store the factorial in a variable:</p>
+<pre class="programlisting">fact5 = factorial(5)
+
+</pre>
+<p><a name="x_750"></a>The value of fact5 will now be 120, which is the factorial of 5. Note that we passed 5 as the argument to the function.</p>
+<p><a name="x_751"></a>It may be necessary to document what the function does, for each of the function to help the person who reads our code to understand it better. In order to do this Python allows the first line of the function body to be a string. This string is called as 
+    <span class="emphasis"><em>Documentation String</em></span> or 
+    <span class="emphasis"><em>docstring</em></span>. 
+    <span class="emphasis"><em>docstrings</em></span> prove to be very handy since there are number of tools which can pull out all the docstrings from Python functions and generate the documentation automatically from it. 
+    <span class="emphasis"><em>docstrings</em></span> for functions can be written as follows:
+  </p>
+<pre class="programlisting">def factorial(n):
+  'Returns the factorial for the number n.'
+  fact = 1
+  for i in range(2, n):
+    fact *= i
+
+  return fact
+
+</pre>
+<p><a name="x_752"></a>An important point to note at this point is that, a function can return any Python value or a Python object, which also includes a 
+    <span class="emphasis"><em>Tuple</em></span>. A 
+    <span class="emphasis"><em>Tuple</em></span> is just a collection of values and those values themselves can be of any other valid Python datatypes, including 
+    <span class="emphasis"><em>Lists</em></span>, 
+    <span class="emphasis"><em>Tuples</em></span>, 
+    <span class="emphasis"><em>Dictionaries</em></span> among other things. So effectively, if a function can return a tuple, it can return any number of values through a tuple
+  </p>
+<p><a name="x_753"></a>Let us write a small function to swap two values:</p>
+<pre class="programlisting">def swap(a, b):
+  return b, a
+
+c, d = swap(a, b)
+
+</pre>
+<p><a name="x_754"></a>Function scope --------------- The variables used inside the function are confined to the function's scope and doesn't pollute the variables of the same name outside the scope of the function. Also the arguments passed to the function are passed by-value if it is of basic Python data type:</p>
+<pre class="programlisting">def cant_change(n):
+  n = 10
+
+n = 5
+cant_change(n)
+
+</pre>
+<p><a name="x_755"></a>Upon running this code, what do you think would have happened to value of n which was assigned 5 before the function call? If you have already tried out that snippet on the interpreter you already know that the value of n is not changed. This is true of any immutable types of Python like 
+    <span class="emphasis"><em>Numbers</em></span>, 
+    <span class="emphasis"><em>Strings</em></span> and 
+    <span class="emphasis"><em>Tuples</em></span>. But when you pass mutable objects like 
+    <span class="emphasis"><em>Lists</em></span> and 
+    <span class="emphasis"><em>Dictionaries</em></span> the values are manipulated even outside the function:
+  </p>
+<pre class="programlisting">&gt;&gt;&gt; def can_change(n):
+...   n[1] = James
+...
+
+&gt;&gt;&gt; name = ['Mr.', 'Steve', 'Gosling']
+&gt;&gt;&gt; can_change(name)
+&gt;&gt;&gt; name
+['Mr.', 'James', 'Gosling']
+
+</pre>
+<p><a name="x_756"></a>If nothing is returned by the function explicitly, Python takes care to return None when the funnction is called.</p>
+<div class="section" title="1. Default Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="default-arguments"></a>1. Default Arguments</h2></div></div></div>
+<p><a name="x_757"></a>There may be situations where we need to allow the functions to take the arguments optionally. Python allows us to define function this way by providing a facility called 
+      <span class="emphasis"><em>Default Arguments</em></span>. For example, we need to write a function that returns a list of fibonacci numbers. Since our function cannot generate an infinite list of fibonacci numbers, we need to specify the number of elements that the fibonacci sequence must contain. Suppose, additionally, we want to the function to return 10 numbers in the sequence if no option is specified we can define the function as follows:
+    </p>
+<pre class="programlisting">def fib(n=10):
+  fib_list = [0, 1]
+  for i in range(n - 2):
+    next = fib_list[-2] + fib_list[-1]
+    fib_list.append(next)
+  return fib_list
+
+</pre>
+<p><a name="x_758"></a>When we call this function, we can optionally specify the value for the parameter n, during the call as an argument. Calling with no argument and argument with n=5 returns the following fibonacci sequences:</p>
+<pre class="programlisting">fib()
+[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
+fib(5)
+[0, 1, 1, 2, 3]
+
+</pre>
+</div>
+<div class="section" title="2. Keyword Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="keyword-arguments"></a>2. Keyword Arguments</h2></div></div></div>
+<p><a name="x_759"></a>When a function takes a large number of arguments, it may be difficult to remember the order of the parameters in the function definition or it may be necessary to pass values to only certain parameters since others take the default value. In either of these cases, Python provides the facility of passing arguments by specifying the name of the parameter as defined in the function definition. This is known as 
+      <span class="emphasis"><em>Keyword Arguments</em></span>.
+    </p>
+<p><a name="x_75a"></a>In a function call, 
+      <span class="emphasis"><em>Keyword arguments</em></span> can be used for each argument, in the following fashion:
+    </p>
+<pre class="programlisting">argument_name=argument_value
+Also denoted as: keyword=argument
+
+def wish(name='World', greetings='Hello'):
+  print "%s, %s!" % (greetings, name)
+
+</pre>
+<p><a name="x_75b"></a>This function can be called in one of the following ways. It is important to note that no restriction is imposed in the order in which 
+      <span class="emphasis"><em>Keyword arguments</em></span> can be specified. Also note, that we have combined 
+      <span class="emphasis"><em>Keyword arguments</em></span> with 
+      <span class="emphasis"><em>Default arguments</em></span> in this example, however it is not necessary:
+    </p>
+<pre class="programlisting">wish(name='Guido', greetings='Hey')
+wish(greetings='Hey', name='Guido')
+
+</pre>
+<p><a name="x_75c"></a>Calling functions by specifying arguments in the order of parameters specified in the function definition is called as 
+      <span class="emphasis"><em>Positional arguments</em></span>, as opposed to 
+      <span class="emphasis"><em>Keyword arguments</em></span>. It is possible to use both 
+      <span class="emphasis"><em>Positional arguments</em></span> and 
+      <span class="emphasis"><em>Keyword arguments</em></span> in a single function call. But Python doesn't allow us to bungle up both of them. The arguments to the function, in the call, must always start with 
+      <span class="emphasis"><em>Positional arguments</em></span> which is in turn followed by 
+      <span class="emphasis"><em>Keyword arguments</em></span>:
+    </p>
+<pre class="programlisting">def my_func(x, y, z, u, v, w):
+  # initialize variables.
+  ...
+  # do some stuff 
+  ...
+  # return the value
+
+</pre>
+<p><a name="x_75d"></a>It is valid to call the above functions in the following ways:</p>
+<pre class="programlisting">my_func(10, 20, 30, u=1.0, v=2.0, w=3.0)
+my_func(10, 20, 30, 1.0, 2.0, w=3.0)
+my_func(10, 20, z=30, u=1.0, v=2.0, w=3.0)
+my_func(x=10, y=20, z=30, u=1.0, v=2.0, w=3.0)
+
+</pre>
+<p><a name="x_75e"></a>Following lists some of the invalid calls:</p>
+<pre class="programlisting">my_func(10, 20, z=30, 1.0, 2.0, 3.0)
+my_func(x=10, 20, z=30, 1.0, 2.0, 3.0)
+my_func(x=10, y=20, z=30, u=1.0, v=2.0, 3.0)
+
+</pre>
+</div>
+<div class="section" title="3. Parameter Packing and Unpacking">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="parameter-packing-and-unpacking"></a>3. Parameter Packing and Unpacking</h2></div></div></div>
+<p><a name="x_75f"></a>The positional arguments passed to a function can be collected in a tuple parameter and keyword arguments can be collected in a dictionary. Since keyword arguments must always be the last set of arguments passed to a function, the keyword dictionary parameter must be the last parameter. The function definition must include a list explicit parameters, followed by tuple paramter collecting parameter, whose name is preceded by a *****, for collecting positional parameters, in turn followed by the dictionary collecting parameter, whose name is preceded by a ****** :</p>
+<pre class="programlisting">def print_report(title, *args, **name):
+  """Structure of *args*
+  (age, email-id)
+  Structure of *name*
+  {
+      'first': First Name
+      'middle': Middle Name
+      'last': Last Name
+  }
+  """
+
+  print "Title: %s" % (title)
+  print "Full name: %(first)s %(middle)s %(last)s" % name
+  print "Age: %d\nEmail-ID: %s" % args
+
+</pre>
+<p><a name="x_760"></a>The above function can be called as. Note, the order of keyword parameters can be interchanged:</p>
+<pre class="programlisting">&gt;&gt;&gt; print_report('Employee Report', 29, 'johny@example.com', first='Johny',
+                 last='Charles', middle='Douglas')
+Title: Employee Report
+Full name: Johny Douglas Charles
+Age: 29
+Email-ID: johny@example.com
+
+</pre>
+<p><a name="x_761"></a>The reverse of this can also be achieved by using a very identical syntax while calling the function. A tuple or a dictionary can be passed as arguments in place of a list of *Positional arguments* or *Keyword arguments* respectively using ***** or ****** :</p>
+<pre class="programlisting">def print_report(title, age, email, first, middle, last):
+  print "Title: %s" % (title)
+  print "Full name: %s %s %s" % (first, middle, last)
+  print "Age: %d\nEmail-ID: %s" % (age, email)
+
+&gt;&gt;&gt; args = (29, 'johny@example.com')
+&gt;&gt;&gt; name = {
+        'first': 'Johny',
+        'middle': 'Charles',
+        'last': 'Douglas'
+        }
+&gt;&gt;&gt; print_report('Employee Report', *args, **name)
+Title: Employee Report
+Full name: Johny Charles Douglas
+Age: 29
+Email-ID: johny@example.com
+
+</pre>
+</div>
+<div class="section" title="4. Nested Functions and Scopes">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="nested-functions-and-scopes"></a>4. Nested Functions and Scopes</h2></div></div></div>
+<p><a name="x_762"></a>Python allows nesting one function inside another. This style of programming turns out to be extremely flexible and powerful features when we use 
+      <span class="emphasis"><em>Python decorators</em></span>. We will not talk about decorators is beyond the scope of this course. If you are interested in knowing more about 
+      <span class="emphasis"><em>decorator programming</em></span> in Python you are suggested to read:
+    </p>
+<div class="literallayout"><p><br>
+      <a class="ulink" href="http://avinashv.net/2008/04/python-decorators-syntactic-sugar" target="_top">http://avinashv.net/2008/04/python-decorators-syntactic-sugar</a>/<br>
+      <a class="ulink" href="http://personalpages.tds.net" target="_top">http://personalpages.tds.net</a>/~kent37/kk/00001.html<br>
+    </p></div>
+<p><a name="x_763"></a>However, the following is an example for nested functions in Python:</p>
+<pre class="programlisting">def outer():
+  print "Outer..."
+  def inner():
+    print "Inner..."
+  print "Outer..."
+  inner()
+
+&gt;&gt;&gt; outer()
+
+</pre>
+</div>
+<div class="section" title="5. map, reduce and filter functions">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="map-reduce-and-filter-functions"></a>5. map, reduce and filter functions</h2></div></div></div>
+<p><a name="x_764"></a>Python provides several built-in functions for convenience. The 
+      <span class="strong"><strong>map()</strong></span>, 
+      <span class="strong"><strong>reduce()</strong></span> and 
+      <span class="strong"><strong>filter()</strong></span> functions prove to be very useful with sequences like 
+      <span class="emphasis"><em>Lists</em></span>.
+    </p>
+<p><a name="x_765"></a>The 
+      <span class="strong"><strong>map</strong></span> (
+      <span class="emphasis"><em>function</em></span>, 
+      <span class="emphasis"><em>sequence</em></span>) function takes two arguments: 
+      <span class="emphasis"><em>function</em></span> and a 
+      <span class="emphasis"><em>sequence</em></span> argument. The 
+      <span class="emphasis"><em>function</em></span> argument must be the name of the function which in turn takes a single argument, the individual element of the 
+      <span class="emphasis"><em>sequence</em></span>. The 
+      <span class="strong"><strong>map</strong></span> function calls 
+      <span class="emphasis"><em>function(item)</em></span>, for each item in the sequence and returns a list of values, where each value is the value returned by each call to 
+      <span class="emphasis"><em>function(item)</em></span>. 
+      <span class="strong"><strong>map()</strong></span> function allows to pass more than one sequence. In this case, the first argument, 
+      <span class="emphasis"><em>function</em></span> must take as many arguments as the number of sequences passed. This function is called with each corresponding element in the each of the sequences, or 
+      <span class="strong"><strong>None</strong></span> if one of the sequence is exhausted:
+    </p>
+<pre class="programlisting">def square(x):
+  return x*x
+
+&gt;&gt;&gt; map(square, [1, 2, 3, 4])
+[1, 4, 9, 16]
+
+def mul(x, y):
+  return x*y
+
+&gt;&gt;&gt; map(mul, [1, 2, 3, 4], [6, 7, 8, 9])
+
+</pre>
+<p><a name="x_766"></a>The 
+      <span class="strong"><strong>filter</strong></span> (
+      <span class="emphasis"><em>function</em></span>, 
+      <span class="emphasis"><em>sequence</em></span>) function takes two arguments, similar to the 
+      <span class="strong"><strong>map()</strong></span> function. The 
+      <span class="strong"><strong>filter</strong></span> function calls 
+      <span class="emphasis"><em>function(item)</em></span>, for each item in the sequence and returns all the elements in the sequence for which 
+      <span class="emphasis"><em>function(item)</em></span> returned True:
+    </p>
+<pre class="programlisting">def even(x):
+  if x % 2:
+    return True
+  else:
+    return False
+
+&gt;&gt;&gt; filter(even, range(1, 10))
+[1, 3, 5, 7, 9]
+
+</pre>
+<p><a name="x_767"></a>The 
+      <span class="strong"><strong>reduce</strong></span> (
+      <span class="emphasis"><em>function</em></span>, 
+      <span class="emphasis"><em>sequence</em></span>) function takes two arguments, similar to 
+      <span class="strong"><strong>map</strong></span> function, however multiple sequences are not allowed. The 
+      <span class="strong"><strong>reduce</strong></span> function calls 
+      <span class="emphasis"><em>function</em></span> with first two consecutive elements in the sequence, obtains the result, calls 
+      <span class="emphasis"><em>function</em></span> with the result and the subsequent element in the sequence and so on until the end of the list and returns the final result:
+    </p>
+<pre class="programlisting">def mul(x, y):
+  return x*y
+
+&gt;&gt;&gt; reduce(mul, [1, 2, 3, 4])
+24
+
+</pre>
+<div class="section" title="5.1. List Comprehensions">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="list-comprehensions"></a>5.1. List Comprehensions</h3></div></div></div>
+<p><a name="x_768"></a>List Comprehension is a convenvience utility provided by Python. It is a syntatic sugar to create 
+        <span class="emphasis"><em>Lists</em></span>. Using 
+        <span class="emphasis"><em>List Comprehensions</em></span> one can create 
+        <span class="emphasis"><em>Lists</em></span> from other type of sequential data structures or other 
+        <span class="emphasis"><em>Lists</em></span> itself. The syntax of 
+        <span class="emphasis"><em>List Comprehensions</em></span> consists of a square brackets to indicate the result is a 
+        <span class="emphasis"><em>List</em></span> within which we include at least one 
+        <span class="strong"><strong>for</strong></span> clause and multiple 
+        <span class="strong"><strong>if</strong></span> clauses. It will be more clear with an example:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; num = [1, 2, 3]
+&gt;&gt;&gt; sq = [x*x for x in num]
+&gt;&gt;&gt; sq
+[1, 4, 9]
+&gt;&gt;&gt; all_num = [1, 2, 3, 4, 5, 6, 7, 8, 9]
+&gt;&gt;&gt; even = [x for x in all_num if x%2 == 0]
+
+</pre>
+<p><a name="x_769"></a>The syntax used here is very clear from the way it is written. It can be translated into english as, "for each element x in the list all_num, if remainder of x divided by 2 is 0, add x to the list."</p>
+</div>
+</div>
+</div>
+<div class="navfooter">
+<hr>
+<table width="100%" summary="Navigation footer">
+<tr>
+<td width="40%" align="left">
+<a accesskey="p" href="index.html">Prev</a> </td>
+<td width="20%" align="center"> </td>
+<td width="40%" align="right"> </td>
+</tr>
+<tr>
+<td width="40%" align="left" valign="top">Chapter 1.  </td>
+<td width="20%" align="center"> </td>
+<td width="40%" align="right" valign="top"> </td>
+</tr>
+</table>
+</div>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/backup/autoid.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+#
+# Add unique ID attributes to para tags.  This script should only be
+# run by one person, since otherwise it introduces the possibility of
+# chaotic conflicts among tags.
+
+import glob, os, re, sys
+
+tagged = re.compile('<para[^>]* id="x_([0-9a-f]+)"[^>]*>', re.M)
+untagged = re.compile('<para>')
+
+names = glob.glob('ch*.xml') + glob.glob('app*.xml')
+
+# First pass: find the highest-numbered paragraph ID.
+
+biggest_id = 0
+seen = set()
+errs = 0
+
+for name in names:
+    for m in tagged.finditer(open(name).read()):
+        i = int(m.group(1),16)
+        if i in seen:
+            print >> sys.stderr, '%s: duplication of ID %s' % (name, i)
+            errs += 1
+        seen.add(i)
+        if i > biggest_id:
+            biggest_id = i
+
+def retag(s):
+    global biggest_id
+    biggest_id += 1
+    return '<para id="x_%x">' % biggest_id
+
+# Second pass: add IDs to paragraphs that currently lack them.
+
+for name in names:
+    f = open(name).read()
+    f1 = untagged.sub(retag, f)
+    if f1 != f:
+        tmpname = name + '.tmp'
+        fp = open(tmpname, 'w')
+        fp.write(f1)
+        fp.close()
+        os.rename(tmpname, name)
+
+sys.exit(errs)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/backup/ch01-intro.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,686 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Basic Python</title>
+<link rel="stylesheet" href="/review/support/styles.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.3">
+<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
+<script type="text/javascript" src="/review/support/jquery-min.js"></script>
+<script type="text/javascript" src="/review/support/form.js"></script>
+<script type="text/javascript" src="/review/support/hsbook.js"></script>
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<!--<div class="navheader">
+<table width="100%" summary="Navigation header">
+<tr><th colspan="3" align="center">Basic Python</th></tr>
+<tr>
+<td width="20%" align="left">
+
+<th width="60%" align="center"> </th>
+<td width="20%" align="right"> </td>
+</tr>
+</table>
+<hr>
+</div>  -->
+
+<div class="chapter" lang="en" id="chap_intro">
+<div class="article" title="Basic Python">
+<div class="titlepage">
+<div><div><h2 class="title">
+<a name="id2988867"></a>Basic Python</h2></div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#introduction">1. Introduction</a></span></dt>
+<dt><span class="section"><a href="#the-python-interpreter">2. The Python Interpreter</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#the-interactive-interpreter">2.1. The Interactive Interpreter</a></span></dt>
+<dt><span class="section"><a href="#ipython-an-enhanced-interactive-python-interpreter">2.2. 
+        <span class="emphasis"><em>ipython</em></span> - An enhanced interactive Python interpreter
+      </a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#editing-and-running-a-python-file">3. Editing and running a python file</a></span></dt>
+<dt><span class="section"><a href="#basic-datatypes-and-operators-in-python">4. Basic Datatypes and operators in Python</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#numbers">4.1. Numbers</a></span></dt>
+<dt><span class="section"><a href="#variables">4.2. Variables</a></span></dt>
+<dt><span class="section"><a href="#strings">4.3. Strings</a></span></dt>
+<dt><span class="section"><a href="#boolean">4.4. Boolean</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#the-while-loop">5. The 
+      <span class="strong"><strong>while</strong></span> loop
+    </a></span></dt>
+<dt><span class="section"><a href="#the-if-conditional">6. The 
+      <span class="strong"><strong>if</strong></span> conditional
+    </a></span></dt>
+<dt><span class="section"><a href="#raw_input">7.       <span class="strong"><strong>raw_input()</strong></span>
+    </a></span></dt>
+<dt><span class="section"><a href="#int-method">8. 
+      <span class="strong"><strong>int()</strong></span> method
+    </a></span></dt>
+</dl>
+</div>
+<p id="x_38"></a>This document is intended to be handed out at the end of the workshop. It has been designed for Engineering students who are Python beginners and have basic programming skills. The focus is on basic numerics and plotting using Python.</p>
+<p id="x_39"></a>The system requirements:</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="x_3a"></a>Python - version 2.5.x or newer.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="x_3b"></a>IPython</p></li>
+<li class="listitem" style="list-style-type: *"><p id="x_3c"></a>Text editor - scite, vim, emacs or whatever you are comfortable with.</p></li>
+</ul></div>
+<div class="section" title="1. Introduction">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="introduction"></a>1. Introduction</h2></div></div></div>
+<p id="x_3d"></a>The Python programming language was created by a dutch named Guido van Rossum. The idea of Python was conceived in December 1989. The name Python has nothing to do with the reptilian, but its been named after the 70s comedy series "Monty Python's Flying Circus", since it happens to be Guido's favourite TV series.</p>
+<p id="x_3e"></a>Current stable version of Python is 2.6.x, although Python 3.0 is also the stable version, it is not backwards compatible with the previous versions and is hence not entirely popular at the moment. This material will focus on the 2.6.x series.</p>
+<p id="x_3f"></a>Python is licensed under the Python Software Foundation License (PSF License) which is GPL compatible Free Software license (excepting license version 1.6 and 2.0) It is a no strings attached license, which means the source code is free to modify and redistribute.</p>
+<p id="x_40"></a>The Python docs define Python as "Python is an interpreted, object-oriented, high-level programming language with dynamic semantics." A more detailed summary can be found at 
+      <a class="ulink" href="http://www.python.org/doc/essays/blurb.html" target="_top">http://www.python.org/doc/essays/blurb.html</a>. Python is a language that has been designed to help the programmer concentrate on solving the problem at hand and not worry about the programming language idiosyncrasies.
+    </p>
+<p id="x_41"></a>Python is a highly cross platform compatible language on account of it being an interpreted language. It is highly scalable and hence has been adapted to run on the Nokia 60 series phones. Python has been designed to be readable and easy to use</p>
+<p id="x_42"></a>
+      <span class="strong"><strong>Resources available for reference</strong></span>
+    </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="x_43"></a>Web: 
+          <a class="ulink" href="http://www.python.org" target="_top">http://www.python.org</a>
+        </p></li>
+<li class="listitem" style="list-style-type: *"><p id="x_44"></a>Doc: 
+          <a class="ulink" href="http://www.python.org/doc" target="_top">http://www.python.org/doc</a>
+        </p></li>
+<li class="listitem" style="list-style-type: *"><p id="x_45"></a>Free Tutorials: 
+          <span class="emphasis"><em> Official Python Tutorial: 
+            <a class="ulink" href="http://docs.python.org/tut/tut.html" target="_top">http://docs.python.org/tut/tut.html</a> 
+          </em></span> Byte of Python: 
+          <a class="ulink" href="http://www.byteofpython.info" target="_top">http://www.byteofpython.info</a>/ * Dive into Python: 
+          <a class="ulink" href="http://diveintopython.org" target="_top">http://diveintopython.org</a>/
+        </p></li>
+</ul></div>
+<p id="x_46"></a>
+      <span class="strong"><strong>Advantages of Python - Why Python??</strong></span>
+    </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="x_47"></a>Python has been designed for readability and ease of use. Its been designed in  such a fashion that it imposes readability on the programmer. Python does away with the braces and the semicolons and instead implements code blocks based on indentation, thus enhancing readability.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="x_48"></a>Python is a high level, interpreted, modular and object oriented language. Python performs memory management on its own, thus the programmer need not bother about allocating and deallocating memory to variables. Python provides extensibility by providing modules which can be easily imported similar to headers in C and packages in Java. Python is object oriented and hence provides all the object oriented characteristics such as inheritance, encapsulation and polymorphism.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="x_49"></a>Python offers a highly powerful interactive programming interface in the form of the 'Interactive Interpreter' which will be discussed in more detail in the following sections.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="x_4a"></a>Python provides a rich standard library and an extensive set of modules. The  power of Python modules can be seen in this slightly exaggerated cartoon 
+          <a class="ulink" href="http://xkcd.com/353" target="_top">http://xkcd.com/353</a>/
+        </p></li>
+<li class="listitem" style="list-style-type: *"><p id="x_4b"></a>Python interfaces well with most other programming languages such as C, C++  and FORTRAN.</p></li>
+</ul></div>
+<p id="x_4c"></a>Although, Python has one setback. Python is not fast as some of the compiled languages like C or C++. Yet, the amount of flexibility and power more than make up for this setback.</p>
+</div>
+<div class="section" title="2. The Python Interpreter">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="the-python-interpreter"></a>2. The Python Interpreter</h2></div></div></div>
+<div class="section" title="2.1. The Interactive Interpreter">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="the-interactive-interpreter"></a>2.1. The Interactive Interpreter</h3></div></div></div>
+<p id="x_4d"></a>Typing 
+        <span class="emphasis"><em>python</em></span> at the shell prompt on any standard Unix/Gnu-Linux system and hitting the enter key fires up the Python 'Interactive Interpreter'. The Python interpreter is one of the most integral features of Python. The prompt obtained when the interactive interpreter is similar to what is shown below. The exact appearance might differ based on the version of Python being used. The 
+        <code class="literal">&gt;&gt;&gt;</code> thing shown is the python prompt. When something is typed at the prompt and the enter key is hit, the python interpreter interprets the command entered and performs the appropriate action. All the examples presented in this document are to be tried hands on, on the interactive interpreter.
+      </p>
+<pre class="programlisting">Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) 
+[GCC 4.3.2] on linux2
+Type "help", "copyright", "credits" or "license" for more information.
+&gt;&gt;&gt; 
+
+</pre>
+<p id="x_4e"></a>Lets try with an example, type 
+        <code class="literal">print 'Hello, World!'</code> at the prompt and hit the enter key.
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; print 'Hello, World!'
+Hello, World!
+
+</pre>
+<p id="x_4f"></a>This example was quite straight forward, and thus we have written our first line of Python code. Now let us try typing something arbitrary at the prompt. For example:</p>
+<pre class="programlisting">&gt;&gt;&gt; arbit word
+  File "&lt;stdin&gt;", line 1
+    arbit word
+            ^
+SyntaxError: invalid syntax
+&gt;&gt;&gt;
+
+</pre>
+<p id="x_50"></a>The interpreter gave an error message saying that 'arbit word' was invalid syntax which is valid. The interpreter is an amazing tool when learning to program in Python. The interpreter provides a help function that provides the necessary documentation regarding all Python syntax, constructs, modules and objects. Typing 
+        <span class="emphasis"><em>help()</em></span> at the prompt gives the following output:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; help()
+
+Welcome to Python 2.5!  This is the online help utility.
+
+If this is your first time using Python, you should definitely check out
+the tutorial on the Internet at http://www.python.org/doc/tut/.
+
+Enter the name of any module, keyword, or topic to get help on writing
+Python programs and using Python modules.  To quit this help utility and
+return to the interpreter, just type "quit".
+
+To get a list of available modules, keywords, or topics, type "modules",
+"keywords", or "topics".  Each module also comes with a one-line summary
+of what it does; to list the modules whose summaries contain a given word
+such as "spam", type "modules spam".
+
+help&gt; 
+
+
+</pre>
+<p id="x_51"></a>As mentioned in the output, entering the name of any module, keyword or topic will provide the documentation and help regarding the same through the online help utility. Pressing 
+        <span class="emphasis"><em>Ctrl+d</em></span> exits the help prompt and returns to the python prompt.
+      </p>
+<p id="x_52"></a>Let us now try a few examples at the python interpreter.</p>
+<p id="x_53"></a>Eg 1:</p>
+<pre class="programlisting">&gt;&gt;&gt; print 'Hello, python!'
+Hello, python!
+&gt;&gt;&gt;
+
+</pre>
+<p id="x_54"></a>Eg 2:</p>
+<pre class="programlisting">&gt;&gt;&gt; print 4321*567890
+2453852690
+&gt;&gt;&gt; 
+
+</pre>
+<p id="x_55"></a>Eg 3:</p>
+<pre class="programlisting">&gt;&gt;&gt; 4321*567890
+2453852690L
+&gt;&gt;&gt;
+
+</pre>
+<pre class="programlisting">Note: Notice the 'L' at the end of the output. The 'L' signifies that the
+output of the operation is of type *long*. It was absent in the previous
+example because we used the print statement. This is because *print* formats
+the output before displaying.
+
+</pre>
+<p id="x_56"></a>Eg 4:</p>
+<pre class="programlisting">&gt;&gt;&gt; big = 12345678901234567890 ** 3
+&gt;&gt;&gt; print big
+1881676372353657772490265749424677022198701224860897069000
+&gt;&gt;&gt; 
+
+</pre>
+<pre class="programlisting">This example is to show that unlike in C or C++ there is no limit on the
+value of an integer.
+
+</pre>
+<p id="x_57"></a>Try this on the interactive interpreter: 
+        <code class="literal">import this</code>
+      </p>
+<p id="x_58"></a>
+        <span class="emphasis"><em>Hint: The output gives an idea of Power of Python</em></span>
+      </p>
+</div>
+<div class="section" title="2.2.  ipython - An enhanced interactive Python interpreter">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="ipython-an-enhanced-interactive-python-interpreter"></a>2.2. 
+        <span class="emphasis"><em>ipython</em></span> - An enhanced interactive Python interpreter
+      </h3></div></div></div>
+<p id="x_59"></a>The power and the importance of the interactive interpreter was the highlight of the previous section. This section provides insight into the enhanced interpreter with more advanced set of features called 
+        <span class="strong"><strong>ipython</strong></span>. Entering 
+        <span class="emphasis"><em>ipython</em></span> at the shell prompt fires up the interactive interpreter.
+      </p>
+<pre class="programlisting">$ ipython
+Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) 
+Type "copyright", "credits" or "license" for more information.
+
+IPython 0.8.4 -- An enhanced Interactive Python.
+?         -&gt; Introduction and overview of IPython's features.
+%quickref -&gt; Quick reference.
+help      -&gt; Python's own help system.
+object?   -&gt; Details about 'object'. ?object also works, ?? prints more.
+
+In [1]: 
+
+</pre>
+<p id="x_5a"></a>This is the output obtained upon firing ipython. The exact appearance may change based on the Python version installed. The following are some of the various features provided by 
+        <span class="strong"><strong>ipython</strong></span>:
+      </p>
+<div class="variablelist"><dl>
+<dt><span class="term"></span></dt>
+<dd>
+<p></p>
+<p id="x_5b"></a>Suggestions - ipython provides suggestions of the possible methods and operations available for the given python object.</p>
+</dd>
+</dl></div>
+<p id="x_5c"></a>Eg 5:</p>
+<pre class="programlisting">In [4]: a = 6
+
+In [5]: a.
+a.__abs__           a.__divmod__        a.__index__         a.__neg__          a.__rand__          a.__rmod__          a.__rxor__
+a.__add__           a.__doc__           a.__init__          a.__new__          a.__rdiv__          a.__rmul__          a.__setattr__
+a.__and__           a.__float__         a.__int__           a.__nonzero__      a.__rdivmod__       a.__ror__           a.__str__
+a.__class__         a.__floordiv__      a.__invert__        a.__oct__          a.__reduce__        a.__rpow__          a.__sub__
+a.__cmp__           a.__getattribute__  a.__long__          a.__or__           a.__reduce_ex__     a.__rrshift__       a.__truediv__
+a.__coerce__        a.__getnewargs__    a.__lshift__        a.__pos__          a.__repr__          a.__rshift__        a.__xor__
+a.__delattr__       a.__hash__          a.__mod__           a.__pow__          a.__rfloordiv__     a.__rsub__          
+a.__div__           a.__hex__           a.__mul__           a.__radd__         a.__rlshift__       a.__rtruediv__      
+
+</pre>
+<p id="x_5d"></a>In this example, we initialized 'a' (a variable - a concept that will be discussed in the subsequent sections.) to 6. In the next line when the 
+        <span class="emphasis"><em>tab</em></span> key is pressed after typing '
+        <span class="emphasis"><em>a.</em></span>' ipython displays the set of all possible methods that are applicable on the object 'a' (an integer in this context). Ipython provides many such datatype specific features which will be presented in the further sections as and when the datatypes are introduced.
+      </p>
+</div>
+</div>
+<div class="section" title="3. Editing and running a python file">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="editing-and-running-a-python-file"></a>3. Editing and running a python file</h2></div></div></div>
+<p id="x_5e"></a>The previous sections focused on the use of the interpreter to run python code. While the interpeter is an excellent tool to test simple solutions and experiment with small code snippets, its main disadvantage is that everything written in the interpreter is lost once its quit. Most of the times a program is used by people other than the author. So the programs have to be available in some form suitable for distribution, and hence they are written in files. This section will focus on editing and running python files. Start by opening a text editor ( it is recommended you choose one from the list at the top of this page ). In the editor type down python code and save the file with an extension 
+      <span class="strong"><strong>.py</strong></span> (python files have an extension of .py). Once done with the editing, save the file and exit the editor.
+    </p>
+<p id="x_5f"></a>Let us look at a simple example of calculating the gcd of 2 numbers using Python:</p>
+<p id="x_60"></a>
+      <span class="strong"><strong>Creating the first python script(file)</strong></span> :
+    </p>
+<pre class="programlisting">$ emacs gcd.py
+  def gcd(x,y):
+    if x % y == 0:
+      return y
+    return gcd(y, x%y)
+
+  print gcd(72, 92)
+
+</pre>
+<p id="x_61"></a>To run the script, open the shell prompt, navigate to the directory that contains the python file and run 
+      <code class="literal">python &lt;filename.py&gt;</code> at the prompt ( in this case filename is gcd.py )
+    </p>
+<p id="x_62"></a>
+      <span class="strong"><strong>Running the python script</strong></span> :
+    </p>
+<pre class="programlisting">$ python gcd.py
+4
+$ 
+
+</pre>
+<p id="x_63"></a>Another method to run a python script would be to include the line</p>
+<p id="x_64"></a>
+      <code class="literal">#! /usr/bin/python</code>
+    </p>
+<p id="x_65"></a>at the beginning of the python file and then make the file executable by</p>
+<p id="x_66"></a>$ chmod a+x 
+      <span class="emphasis"><em>filename.py</em></span>
+    </p>
+<p id="x_67"></a>Once this is done, the script can be run as a standalone program as follows:</p>
+<p id="x_68"></a>$ ./
+      <span class="emphasis"><em>filename.py</em></span>
+    </p>
+</div>
+<div class="section" title="4. Basic Datatypes and operators in Python">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="basic-datatypes-and-operators-in-python"></a>4. Basic Datatypes and operators in Python</h2></div></div></div>
+<p id="x_69"></a>Python provides the following set of basic datatypes.</p>
+<div class="blockquote"><blockquote class="blockquote"><div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="x_6a"></a>Numbers: int, float, long, complex</p></li>
+<li class="listitem" style="list-style-type: *"><p id="x_6b"></a>Strings</p></li>
+<li class="listitem" style="list-style-type: *"><p id="x_6c"></a>Boolean</p></li>
+</ul></div></blockquote></div>
+<div class="section" title="4.1. Numbers">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="numbers"></a>4.1. Numbers</h3></div></div></div>
+<p id="x_6d"></a>Numbers were introduced in the examples presented in the interactive interpreter section. Numbers include types as mentioned earlier viz., int (integers), float (floating point numbers), long (large integers), complex (complex numbers with real and imaginary parts). Python is not a strongly typed language, which means the type of a variable need not mentioned during its initialization. Let us look at a few examples.</p>
+<p id="x_6e"></a>Eg 6:</p>
+<pre class="programlisting">&gt;&gt;&gt; a = 1 #here a is an integer variable
+
+</pre>
+<p id="x_6f"></a>Eg 7:</p>
+<pre class="programlisting">&gt;&gt;&gt; lng = 122333444455555666666777777788888888999999999 #here lng is a variable of type long
+&gt;&gt;&gt; lng
+122333444455555666666777777788888888999999999L #notice the trailing 'L'
+&gt;&gt;&gt; print lng
+122333444455555666666777777788888888999999999 #notice the absence of the trailing 'L'
+&gt;&gt;&gt; lng+1
+122333444455555666666777777788888889000000000L
+
+
+</pre>
+<p id="x_70"></a>Long numbers are the same as integers in almost all aspects. They can be used in operations just like integers and along with integers without any distinction. The only distinction comes during type checking (which is not a healthy practice). Long numbers are tucked with a trailing 'L' just to signify that they are long. Notice that in the example just lng at the prompt displays the value of the variable with the 'L' whereas 
+        <code class="literal">print lng</code> displays without the 'L'. This is because print formats the output before printing. Also in the example, notice that adding an integer to a long does not give any errors and the result is as expected. So for all practical purposes longs can be treated as ints.
+      </p>
+<p id="x_71"></a>Eg 8:</p>
+<pre class="programlisting">&gt;&gt;&gt; fl = 3.14159 #fl is a float variable
+&gt;&gt;&gt; e = 1.234e-4 #e is also a float variable, specified in the exponential form
+&gt;&gt;&gt; a = 1
+&gt;&gt;&gt; b = 2
+&gt;&gt;&gt; a/b #integer division
+0
+&gt;&gt;&gt; a/fl #floating point division
+0.31831015504887655
+&gt;&gt;&gt; e/fl
+3.9279473133031364e-05
+
+
+</pre>
+<p id="x_72"></a>Floating point numbers, simply called floats are real numbers with a decimal point. The example above shows the initialization of a float variable. Shown also in this example is the difference between integer division and floating point division. 'a' and 'b' here are integer variables and hence the division gives 0 as the quotient. When either of the operands is a float, the operation is a floating point division, and the result is also a float as illustrated.</p>
+<p id="x_73"></a>Eg 9:</p>
+<pre class="programlisting">&gt;&gt;&gt; cplx = 3 + 4j #cplx is a complex variable
+&gt;&gt;&gt; cplx
+(3+4j)
+&gt;&gt;&gt; print cplx.real #prints the real part of the complex number
+3.0
+&gt;&gt;&gt; print cplx.imag #prints the imaginary part of the complex number
+4.0
+&gt;&gt;&gt; print cplx*fl  #multiplies the real and imag parts of the complex number with the multiplier
+(9.42477+12.56636j)
+&gt;&gt;&gt; abs(cplx) #returns the absolute value of the complex number
+5.0
+
+</pre>
+<p id="x_74"></a>Python provides a datatype for complex numbers. Complex numbers are initialized as shown in the example above. The 
+        <span class="emphasis"><em>real</em></span> and 
+        <span class="emphasis"><em>imag</em></span> operators return the real and imaginary parts of the complex number as shown. The 
+        <span class="emphasis"><em>abs()</em></span> returns the absolute value of the complex number.
+      </p>
+</div>
+<div class="section" title="4.2. Variables">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="variables"></a>4.2. Variables</h3></div></div></div>
+<p id="x_75"></a>Variables are just names that represent a value. Variables have already been introduced in the various examples from the previous sections. Certain rules about using variables:</p>
+<div class="blockquote"><blockquote class="blockquote"><div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="x_76"></a>Variables have to be initialized or assigned a value before being used.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="x_77"></a>Variable names can consist of letters, digits and 
+              <a class="link" href="">underscores</a> .
+            </p></li>
+<li class="listitem" style="list-style-type: *"><p id="x_78"></a>Variable names cannot begin with digits, but can contain digits in them.</p></li>
+</ul></div></blockquote></div>
+<p id="x_79"></a>In reference to the previous section examples, 'a', 'b', 'lng', 'fl', 'e' and 'cplx' are all variables of various datatypes.</p>
+<pre class="programlisting">Note: Python is not a strongly typed language and hence an integer variable can at a
+later stage be used as a float variable as well.
+
+</pre>
+</div>
+<div class="section" title="4.3. Strings">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="strings"></a>4.3. Strings</h3></div></div></div>
+<p id="x_7a"></a>Strings are one of the essential data structures of any programming language. The 
+        <code class="literal">print "Hello, World!"</code> program was introduced in the earlier section, and the 
+        <span class="emphasis"><em>"Hello, World!"</em></span> in the print statement is a string. A string is basically a set of characters. Strings can be represented in various ways shown below:
+      </p>
+<pre class="programlisting">s = 'this is a string'              # a string variable can be represented using single quotes
+s = 'This one has "quotes" inside!' # The string can have quotes inside it as shown
+s = "I have 'single-quotes' inside!"
+l = "A string spanning many lines\
+one more line\
+yet another"                        # a string can span more than a single line.
+t = """A triple quoted string does  # another way of representing multiline strings.
+not need to be escaped at the end and
+"can have nested quotes" etc."""
+
+</pre>
+<p id="x_7b"></a>Try the following on the interpreter: 
+        <code class="literal">s = 'this is a string with 'quotes' of similar kind'</code>
+      </p>
+<p id="x_7c"></a>
+        <span class="strong"><strong>Exercise: How to use single quotes within single quotes in a string as shown in the above example without getting an error?</strong></span>
+      </p>
+<div class="section" title="4.3.1. String operations">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="string-operations"></a>4.3.1. String operations</h4></div></div></div>
+<p id="x_7d"></a>A few basic string operations are presented here.</p>
+<p id="x_7e"></a>
+          <span class="strong"><strong>String concatenation</strong></span> String concatenation is done by simple addition of two strings.
+        </p>
+<pre class="programlisting">&gt;&gt;&gt; x = 'Hello'
+&gt;&gt;&gt; y = ' Python'
+&gt;&gt;&gt; print x+y
+Hello Python
+
+</pre>
+<p id="x_7f"></a>          <span class="emphasis"><em>Try this yourself:</em></span>
+        </p>
+<pre class="programlisting">&gt;&gt;&gt; somenum = 13
+&gt;&gt;&gt; print x+somenum
+
+</pre>
+<p id="x_80"></a>The problem with the above example is that here a string variable and an integer variable are trying to be concantenated. To obtain the desired result from the above example the str(), repr() and the `` can be used.</p>
+<p id="x_81"></a>
+          <span class="strong"><strong>str()</strong></span> simply converts a value to a string in a reasonable form. 
+          <span class="strong"><strong>repr()</strong></span> creates a string that is a representation of the value.
+        </p>
+<p id="x_82"></a>The difference can be seen in the example shown below:</p>
+<pre class="programlisting">&gt;&gt;&gt; str(1000000000000000000000000000000000000000000000000L)
+'1000000000000000000000000000000000000000000000000'
+&gt;&gt;&gt; repr(1000000000000000000000000000000000000000000000000L)
+'1000000000000000000000000000000000000000000000000L'
+
+</pre>
+<p id="x_83"></a>It can be observed that the 'L' in the long value shown was omitted by str(), whereas repr() converted that into a string too. An alternative way of using repr(value) is `
+          <code class="literal">value</code>`.
+        </p>
+<p id="x_84"></a>A few more examples:</p>
+<pre class="programlisting">&gt;&gt;&gt; x = "Let's go \nto Pycon"
+&gt;&gt;&gt; print x
+Let's go 
+to Pycon
+
+</pre>
+<p id="x_85"></a>In the above example, notice that the '\n'(newline) character is formatted and the string is printed on two lines. The strings discussed until now were normal strings. Other than these there are two other types of strings namely, raw strings and unicode strings.</p>
+<p id="x_86"></a>
+          <span class="strong"><strong>Raw strings</strong></span> are strings which are unformatted, that is the backslashes(\) are not parsed and are left as it is in the string. Raw strings are represented with an 'r' at the start of a string. Let us look at an example
+        </p>
+<pre class="programlisting">&gt;&gt;&gt; x = r"Let's go \nto Pycon"
+&gt;&gt;&gt; print x
+Let's go \nto Pycon
+
+</pre>
+<p id="x_87"></a>Note: The '\n' is not being parsed into a new line and is left as it is.</p>
+<p id="x_88"></a>
+          <span class="emphasis"><em>Try this yourself:</em></span>
+        </p>
+<pre class="programlisting">&gt;&gt;&gt; x = r"Let's go to Pycon\"
+
+</pre>
+<p id="x_89"></a>          <span class="strong"><strong>Unicode strings</strong></span> are strings where the characters are Unicode characters as opposed to ASCII characters. Unicode strings are represented with a 'u' at the start of the string. Let us look at an example:
+        </p>
+<pre class="programlisting">&gt;&gt;&gt; x = u"Let's go to Pycon!"
+&gt;&gt;&gt; print x
+Let's go to Pycon!
+
+</pre>
+</div>
+</div>
+<div class="section" title="4.4. Boolean">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boolean"></a>4.4. Boolean</h3></div></div></div>
+<p id="x_8a"></a>Python also provides special Boolean datatype. A boolean variable can assume a value of either 
+        <span class="emphasis"><em>True</em></span> or 
+        <span class="emphasis"><em>False</em></span> (Note the capitalizations).
+      </p>
+<p id="x_8b"></a>Let us look at examples:</p>
+<pre class="programlisting">&gt;&gt;&gt; t = True
+&gt;&gt;&gt; f = not t
+&gt;&gt;&gt; print f
+False
+&gt;&gt;&gt; f or t
+True
+&gt;&gt;&gt; f and t
+False
+
+</pre>
+</div>
+</div>
+<div class="section" title="5. The while loop">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="the-while-loop"></a>5. The 
+      <span class="strong"><strong>while</strong></span> loop
+    </h2></div></div></div>
+<p id="x_8c"></a>The Python 
+      <span class="strong"><strong>while</strong></span> loop is similar to the C/C++ while loop. The syntax is as follows:
+    </p>
+<pre class="programlisting">statement 0
+while condition:
+  statement 1 #while block
+  statement 2 #while block
+statement 3 #outside the while block.
+
+</pre>
+<p id="x_8d"></a>Let us look at an example:</p>
+<pre class="programlisting">&gt;&gt;&gt; x = 1  
+&gt;&gt;&gt; while x &lt;= 5:
+...   print x
+...   x += 1
+... 
+1
+2
+3
+4
+5
+
+</pre>
+</div>
+<div class="section" title="6. The if conditional">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="the-if-conditional"></a>6. The 
+      <span class="strong"><strong>if</strong></span> conditional
+    </h2></div></div></div>
+<p id="x_8e"></a>The Python 
+      <span class="strong"><strong>if</strong></span> block provides the conditional execution of statements. If the condition evaluates as true the block of statements defined under the if block are executed.
+    </p>
+<p id="x_8f"></a>If the first block is not executed on account of the condition not being satisfied, the set of statements in the 
+      <span class="strong"><strong>else</strong></span> block are executed.
+    </p>
+<p id="x_90"></a>The 
+      <span class="strong"><strong>elif</strong></span> block provides the functionality of evaluation of multiple conditions as shown in the example.
+    </p>
+<p id="x_91"></a>The syntax is as follows:</p>
+<pre class="programlisting">if condition :
+    statement_1
+    statement_2
+
+elif condition:
+    statement_3
+    statement_4
+else:
+    statement_5
+    statement_6
+
+</pre>
+<p id="x_92"></a>Let us look at an example:</p>
+<pre class="programlisting">&gt;&gt;&gt; n = raw_input("Input a number:")
+&gt;&gt;&gt; if n &lt; 0:
+      print n," is negative"
+      elif n &gt; 0:
+      print n," is positive"
+      else:
+      print n, " is 0"
+
+</pre>
+</div>
+<div class="section" title="7.  raw_input()">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="raw_input"></a>7.       <span class="strong"><strong>raw_input()</strong></span>
+    </h2></div></div></div>
+<p id="x_93"></a>In the previous example we saw the call to the raw_input() subroutine. The 
+      <span class="strong"><strong>raw_input()</strong></span> method is used to take user inputs through the console. Unlike 
+      <span class="strong"><strong>input()</strong></span> which assumes the data entered by the user as a standard python expression, 
+      <span class="strong"><strong>raw_input()</strong></span> treats all the input data as raw data and converts everything into a string. To illustrate this let us look at an example.
+    </p>
+<pre class="programlisting">&gt;&gt;&gt; input("Enter a number thats a palindrome:")
+Enter a number thats a palindrome:121
+121
+
+&gt;&gt;&gt; input("Enter your name:")
+Enter your name:PythonFreak
+Traceback (most recent call last):
+  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
+  File "&lt;string&gt;", line 1, in &lt;module&gt;
+NameError: name 'PythonFreak' is not defined
+
+</pre>
+<p id="x_94"></a>As shown above the 
+      <span class="strong"><strong>input()</strong></span> assumes that the data entered is a valid Python expression. In the first call it prompts for an integer input and when entered it accepts the integer as an integer, whereas in the second call, when the string is entered without the quotes, 
+      <span class="strong"><strong>input()</strong></span> assumes that the entered data is a valid Python expression and hence it raises and exception saying PythonFreak is not defined.
+    </p>
+<pre class="programlisting">&gt;&gt;&gt; input("Enter your name:")
+Enter your name:'PythonFreak'
+'PythonFreak'
+&gt;&gt;&gt; 
+
+</pre>
+<p id="x_95"></a>Here the name is accepted because its entered as a string (within quotes). But its unreasonable to go on using quotes each time a string is entered. Hence the alternative is to use 
+      <span class="strong"><strong>raw_input()</strong></span>.
+    </p>
+<p id="x_96"></a>Let us now look at how 
+      <span class="strong"><strong>raw_input()</strong></span> operates with an example.
+    </p>
+<pre class="programlisting">&gt;&gt;&gt; raw_input("Enter your name:")
+Enter your name:PythonFreak
+'PythonFreak'
+
+</pre>
+<p id="x_97"></a>Observe that the 
+      <span class="strong"><strong>raw_input()</strong></span> is converting it into a string all by itself.
+    </p>
+<pre class="programlisting">&gt;&gt;&gt; pal = raw_input("Enter a number thats a palindrome:")
+Enter a number thats a palindrome:121
+'121'
+
+</pre>
+<p id="x_98"></a>Observe that 
+      <span class="strong"><strong>raw_input()</strong></span> is converting the integer 121 also to a string as '121'. Let us look at another example:
+    </p>
+<pre class="programlisting">&gt;&gt;&gt; pal = raw_input("Enter a number thats a palindrome:")
+Enter a number thats a palindrome:121
+&gt;&gt;&gt; pal + 2
+Traceback (most recent call last):
+  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
+TypeError: cannot concatenate 'str' and 'int' objects
+&gt;&gt;&gt; pal
+'121'
+
+</pre>
+<p id="x_99"></a>Observe here that the variable 
+      <span class="emphasis"><em>pal</em></span> is a string and hence integer operations cannot be performed on it. Hence the exception is raised.
+    </p>
+</div>
+<div class="section" title="8.  int() method">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="int-method"></a>8. 
+      <span class="strong"><strong>int()</strong></span> method
+    </h2></div></div></div>
+<p id="x_9a"></a>Generally for computing purposes, the data used is not strings or raw data but on integers, floats and similar mathematical data structures. The data obtained from 
+      <span class="strong"><strong>raw_input()</strong></span> is raw data in the form of strings. In order to obtain integers from strings we use the method 
+      <span class="strong"><strong>int()</strong></span>.
+    </p>
+<p id="x_9b"></a>Let us look at an example.</p>
+<pre class="programlisting">&gt;&gt;&gt; intpal = int(pal)
+&gt;&gt;&gt; intpal
+121
+
+</pre>
+<p id="x_9c"></a>In the previous example it was observed that 
+      <span class="emphasis"><em>pal</em></span> was a string variable. Here using the 
+      <span class="strong"><strong>int()</strong></span> method the string 
+      <span class="emphasis"><em>pal</em></span> was converted to an integer variable.
+    </p>
+<p id="x_9d"></a>
+      <span class="emphasis"><em>Try This Yourself:</em></span>
+    </p>
+<pre class="programlisting">&gt;&gt;&gt; stringvar = raw_input("Enter a name:")
+Enter a name:Guido Van Rossum
+&gt;&gt;&gt; stringvar
+'Guido Van Rossum'
+&gt;&gt;&gt; numvar = int(stringvar)
+
+</pre>
+</div>
+</div>
+<div class="navfooter">
+<hr>
+<table width="100%" summary="Navigation footer">
+<tr>
+<td width="40%" align="left">
+<a accesskey="p" href="index.html">Prev</a> </td>
+<td width="20%" align="center"> </td>
+<td width="40%" align="right"> </td>
+</tr>
+<tr>
+<td width="40%" align="left" valign="top">Chapter 1. Introduction </td>
+<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
+<td width="40%" align="right" valign="top"> </td>
+</tr>
+</table>
+</div>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/backup/ch02-list_tuples.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,652 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Lists and Tuples</title>
+<link rel="stylesheet" href="hgbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="index.html" title="Chapter 1. List and Tuples">
+<link rel="up" href="index.html" title="Chapter 1. List and Tuples">
+<link rel="prev" href="index.html" title="Chapter 1. List and Tuples">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<div class="navheader">
+<table width="100%" summary="Navigation header">
+<tr><th colspan="3" align="center">Lists and Tuples</th></tr>
+<tr>
+<td width="20%" align="left">
+<a accesskey="p" href="index.html">Prev</a> </td>
+<th width="60%" align="center"> </th>
+<td width="20%" align="right"> </td>
+</tr>
+</table>
+<hr>
+</div>
+<div class="article" title="Lists and Tuples">
+<div class="titlepage">
+<div><div><h2 class="title">
+<a name="id2609714"></a>Lists and Tuples</h2></div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="ar01.html#common-list-operations">1. Common List Operations</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="ar01.html#indexing">1.1. Indexing</a></span></dt>
+<dt><span class="section"><a href="ar01.html#concatenating">1.2. Concatenating</a></span></dt>
+<dt><span class="section"><a href="ar01.html#slicing">1.3. Slicing</a></span></dt>
+<dt><span class="section"><a href="ar01.html#multiplication">1.4. Multiplication</a></span></dt>
+<dt><span class="section"><a href="ar01.html#membership">1.5. Membership</a></span></dt>
+<dt><span class="section"><a href="ar01.html#length-maximum-and-minimum">1.6. Length, Maximum and Minimum</a></span></dt>
+<dt><span class="section"><a href="ar01.html#changing-elements">1.7. Changing Elements</a></span></dt>
+<dt><span class="section"><a href="ar01.html#deleting-elements">1.8. Deleting Elements</a></span></dt>
+<dt><span class="section"><a href="ar01.html#assign-to-slices">1.9. Assign to Slices</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="ar01.html#none-empty-lists-and-initialization">2. None, Empty Lists, and Initialization</a></span></dt>
+<dt><span class="section"><a href="ar01.html#nested-lists">3. Nested Lists</a></span></dt>
+<dt><span class="section"><a href="ar01.html#list-methods">4. List Methods</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="ar01.html#append">4.1. append</a></span></dt>
+<dt><span class="section"><a href="ar01.html#count">4.2. count</a></span></dt>
+<dt><span class="section"><a href="ar01.html#extend">4.3. extend</a></span></dt>
+<dt><span class="section"><a href="ar01.html#index">4.4. index</a></span></dt>
+<dt><span class="section"><a href="ar01.html#insert">4.5. insert</a></span></dt>
+<dt><span class="section"><a href="ar01.html#pop">4.6. pop</a></span></dt>
+<dt><span class="section"><a href="ar01.html#remove">4.7. remove</a></span></dt>
+<dt><span class="section"><a href="ar01.html#reverse">4.8. reverse</a></span></dt>
+<dt><span class="section"><a href="ar01.html#sort">4.9. sort</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="ar01.html#tuples">5. Tuples</a></span></dt>
+<dd><dl><dt><span class="section"><a href="ar01.html#common-tuple-operations">5.1. Common Tuple Operations</a></span></dt></dl></dd>
+<dt><span class="section"><a href="ar01.html#additional-syntax">6. Additional Syntax</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="ar01.html#range">6.1. range()</a></span></dt>
+<dt><span class="section"><a href="ar01.html#for">6.2. for</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="ar01.html#conclusion">7. Conclusion</a></span></dt>
+</dl>
+</div>Lists
+  <p><a name="x_1"></a>Python provides an intuitive way to represent a group items, called 
+    <span class="emphasis"><em>Lists</em></span>. The items of a 
+    <span class="emphasis"><em>List</em></span> are called its elements. Unlike C/C++, elements can be of any type. A 
+    <span class="emphasis"><em>List</em></span> is represented as a list of comma-sepated elements with square brackets around them:
+  </p>
+<pre class="programlisting">&gt;&gt;&gt; a = [10, 'Python programming', 20.3523, 23, 3534534L]
+&gt;&gt;&gt; a
+[10, 'Python programming', 20.3523, 23, 3534534L]
+
+
+</pre>
+<div class="section" title="1. Common List Operations">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="common-list-operations"></a>1. Common List Operations</h2></div></div></div>
+<p><a name="x_2"></a>The following are some of the most commonly used operations on 
+      <span class="emphasis"><em>Lists</em></span>.
+    </p>
+<div class="section" title="1.1. Indexing">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="indexing"></a>1.1. Indexing</h3></div></div></div>
+<p><a name="x_3"></a>Individual elements of a 
+        <span class="emphasis"><em>List</em></span> can be accessed using an index to the element. The indices start at 0. One can also access the elements of the 
+        <span class="emphasis"><em>List</em></span> in reverse using negative indices.:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; a[1]
+'Python programming'
+&gt;&gt;&gt; a[-1]
+3534534L
+
+</pre>
+<p><a name="x_4"></a>It is important to note here that the last element of the 
+        <span class="emphasis"><em>List</em></span> has an index of -1.
+      </p>
+</div>
+<div class="section" title="1.2. Concatenating">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="concatenating"></a>1.2. Concatenating</h3></div></div></div>
+<p><a name="x_5"></a>Two or more 
+        <span class="emphasis"><em>Lists</em></span> can be concatenated using the + operator:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; a + ['foo', 12, 23.3432, 54]
+[10, 'Python programming', 20.3523, 'foo', 12, 23.3432, 54]
+&gt;&gt;&gt; [54, 75, 23] + ['write', 67, 'read']
+[54, 75, 23, 'write', 67, 'read']
+
+
+</pre>
+</div>
+<div class="section" title="1.3. Slicing">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="slicing"></a>1.3. Slicing</h3></div></div></div>
+<p><a name="x_6"></a>A 
+        <span class="emphasis"><em>List</em></span> can be sliced off to contain a subset of elements of the 
+        <span class="emphasis"><em>List</em></span>. Slicing can be done by using two indices separated by a colon, where the first index is inclusive and the second index is exclusive. The resulting slice is also a 
+        <span class="emphasis"><em>List</em></span>.:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; num = [1, 2, 3, 4, 5, 6, 7, 8, 9]
+&gt;&gt;&gt; num[3:6]
+[4, 5, 6]
+&gt;&gt;&gt; num[0:1]
+[1]
+&gt;&gt;&gt; num[7:10]
+[7, 8, 9]
+
+</pre>
+<p><a name="x_7"></a>The last example showed how to access last 3 elements of the 
+        <span class="emphasis"><em>List</em></span>. There is a small catch here. The second index 10 actually refers to the 11th element of the 
+        <span class="emphasis"><em>List</em></span> which is still valid, even though it doesn't exist because the second index is exclusive and tells the Python interpreter to get the last element of the 
+        <span class="emphasis"><em>List</em></span>. But this can also be done in a much easier way using negative indices:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; num[-3:-1]
+[7, 8, 9]
+
+</pre>
+<p><a name="x_8"></a>Excluding the first index implies that the slice must start at the beginning of the 
+        <span class="emphasis"><em>List</em></span>, while excluding the second index includes all the elements till the end of the 
+        <span class="emphasis"><em>List</em></span>. A third parameter to a slice, which is implicitly taken as 1 is the step of the slice. It is specified as a value which follows a colon after the second index:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; num[:4]
+[1, 2, 3, 4]
+&gt;&gt;&gt; num[7:]
+[8, 9]
+&gt;&gt;&gt; num[-3:]
+[7, 8, 9]
+&gt;&gt;&gt; num[:]
+[1, 2, 3, 4, 5, 6, 7, 8, 9]
+&gt;&gt;&gt; num[4:9:3]
+[5, 8]
+&gt;&gt;&gt; num[3::2]
+[4, 6, 8]
+&gt;&gt;&gt; num[::4]
+[1, 5, 9]
+
+
+</pre>
+</div>
+<div class="section" title="1.4. Multiplication">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="multiplication"></a>1.4. Multiplication</h3></div></div></div>
+<p><a name="x_9"></a>A 
+        <span class="emphasis"><em>List</em></span> can be multiplied with an integer to repeat itself:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; [20] * 5
+[20, 20, 20, 20, 20]
+&gt;&gt;&gt; [42, 'Python', 54] * 3
+[42, 'Python', 54, 42, 'Python', 54, 42, 'Python', 54]
+
+
+</pre>
+</div>
+<div class="section" title="1.5. Membership">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="membership"></a>1.5. Membership</h3></div></div></div>
+<p><a name="x_a"></a>
+        <span class="strong"><strong>in</strong></span> operator is used to find whether an element is part of the 
+        <span class="emphasis"><em>List</em></span>. It returns 
+        <span class="strong"><strong>True</strong></span> if the element is present in the 
+        <span class="emphasis"><em>List</em></span> or 
+        <span class="strong"><strong>False</strong></span> if it is not present. Since this operator returns a Boolean value it is called a Boolean operator:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; names = ['Guido', 'Alex', 'Tim']
+&gt;&gt;&gt; 'Tim' in names
+True
+&gt;&gt;&gt; 'Adam' in names
+False
+
+
+</pre>
+</div>
+<div class="section" title="1.6. Length, Maximum and Minimum">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="length-maximum-and-minimum"></a>1.6. Length, Maximum and Minimum</h3></div></div></div>
+<p><a name="x_b"></a>Length of a 
+        <span class="emphasis"><em>List</em></span> can be found out using the len function. The max function returns the element with the largest value and the min function returns the element with the smallest value:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; num = [4, 1, 32, 12, 67, 34, 65]
+&gt;&gt;&gt; len(num)
+7
+&gt;&gt;&gt; max(num)
+67
+&gt;&gt;&gt; min(num)
+1
+
+
+</pre>
+</div>
+<div class="section" title="1.7. Changing Elements">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="changing-elements"></a>1.7. Changing Elements</h3></div></div></div>
+<p><a name="x_c"></a>Unlike Strings 
+        <span class="emphasis"><em>Lists</em></span> are mutable, i.e. elements of a 
+        <span class="emphasis"><em>List</em></span> can be manipulated:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; a = [1, 3, 5, 7]
+&gt;&gt;&gt; a[2] = 9
+&gt;&gt;&gt; a
+[1, 3, 9, 7]
+
+
+</pre>
+</div>
+<div class="section" title="1.8. Deleting Elements">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="deleting-elements"></a>1.8. Deleting Elements</h3></div></div></div>
+<p><a name="x_d"></a>An element or a slice of a 
+        <span class="emphasis"><em>List</em></span> can be deleted by using the 
+        <span class="strong"><strong>del</strong></span> statement:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; a = [1, 3, 5, 7, 9, 11]
+&gt;&gt;&gt; del a[-2:]
+&gt;&gt;&gt; a
+[1, 3, 5, 7]
+&gt;&gt;&gt; del a[1]
+&gt;&gt;&gt; a
+[1, 5, 7]
+
+
+</pre>
+</div>
+<div class="section" title="1.9. Assign to Slices">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="assign-to-slices"></a>1.9. Assign to Slices</h3></div></div></div>
+<p><a name="x_e"></a>In the same way, values can be assigned to individual elements of the 
+        <span class="emphasis"><em>List</em></span>, a 
+        <span class="emphasis"><em>List</em></span> of elements can be assigned to a slice:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; a = [2, 3, 4, 5]
+&gt;&gt;&gt; a[:2] = [0, 1]
+[0, 1, 4, 5]
+&gt;&gt;&gt; a[2:2] = [2, 3]
+&gt;&gt;&gt; a
+[0, 1, 2, 3, 4, 5]
+&gt;&gt;&gt; a[2:4] = []
+&gt;&gt;&gt; a
+[0, 1, 4, 5]
+
+</pre>
+<p><a name="x_f"></a>The last two examples should be particularly noted carefully. The last but one example insert elements or a list of elements into a 
+        <span class="emphasis"><em>List</em></span> and the last example deletes a list of elements from the 
+        <span class="emphasis"><em>List</em></span>.
+      </p>
+</div>
+</div>
+<div class="section" title="2. None, Empty Lists, and Initialization">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="none-empty-lists-and-initialization"></a>2. None, Empty Lists, and Initialization</h2></div></div></div>
+<p><a name="x_10"></a>An 
+      <span class="emphasis"><em>Empty List</em></span> is a 
+      <span class="emphasis"><em>List</em></span> with no elements and is simply represented as []. A 
+      <span class="emphasis"><em>None List</em></span> is one with all elements in it being 
+      <span class="strong"><strong>None</strong></span>. It serves the purpose having a container list of some fixed number of elements with no value:
+    </p>
+<pre class="programlisting">&gt;&gt;&gt; a = []
+&gt;&gt;&gt; a
+[]
+&gt;&gt;&gt; n = [None] * 10
+&gt;&gt;&gt; n
+[None, None, None, None, None, None, None, None, None, None]
+
+
+</pre>
+</div>
+<div class="section" title="3. Nested Lists">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="nested-lists"></a>3. Nested Lists</h2></div></div></div>
+<p><a name="x_11"></a>As mentioned earlier, a List can contain elements of any data type. This also implies a 
+      <span class="emphasis"><em>List</em></span> can have a 
+      <span class="emphasis"><em>Lists</em></span> themselves as its elements. These are called as 
+      <span class="emphasis"><em>Nested Lists</em></span>. There is no limit on the depth of the 
+      <span class="emphasis"><em>Nested Lists</em></span>:
+    </p>
+<pre class="programlisting">&gt;&gt;&gt; a = [1, [1, 2, 3], 3, [1, [1, 2, 3]], 7]
+
+
+</pre>
+</div>
+<div class="section" title="4. List Methods">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="list-methods"></a>4. List Methods</h2></div></div></div>
+<p><a name="x_12"></a>A method is a function that is coupled to an object. More about objects and its methods are discussed in Advanced Python module. In general, a method is called like:</p>
+<pre class="programlisting">object.method(arguments)
+
+</pre>
+<p><a name="x_13"></a>For now, it is enough to know that a list of elements is an object and so 
+      <span class="emphasis"><em>List</em></span> methods can be called upon them. Also some of the methods change the 
+      <span class="emphasis"><em>List</em></span> in-place, meaning it modifies the existing list instead of creating a new one, while other methods don't. It must be noted as we run through the 
+      <span class="emphasis"><em>List</em></span> methods.
+    </p>
+<p><a name="x_14"></a>Some of the most commonly used 
+      <span class="emphasis"><em>List</em></span> methods are as follows:
+    </p>
+<div class="section" title="4.1. append">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="append"></a>4.1. append</h3></div></div></div>
+<p><a name="x_15"></a>The 
+        <span class="emphasis"><em>append</em></span> method is used to append an object at the end of the list:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; prime = [2, 3, 5]
+&gt;&gt;&gt; prime.append(7)
+&gt;&gt;&gt; prime
+[2, 3, 5, 7]
+
+</pre>
+<p><a name="x_16"></a>It is important to note that append changes the 
+        <span class="emphasis"><em>List</em></span> in-place.
+      </p>
+</div>
+<div class="section" title="4.2. count">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="count"></a>4.2. count</h3></div></div></div>
+<p><a name="x_17"></a>The 
+        <span class="emphasis"><em>count</em></span> method returns the number of occurences of a particular element in a list:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; [1, 4, 4, 9, 9, 9].count(9)
+3
+&gt;&gt;&gt; tlst = ['Python', 'is', 'a', 'beautiful', 'language']
+&gt;&gt;&gt; tlst.count('Python')
+1
+
+
+</pre>
+</div>
+<div class="section" title="4.3. extend">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="extend"></a>4.3. extend</h3></div></div></div>
+<p><a name="x_18"></a>The 
+        <span class="emphasis"><em>extend</em></span> method extends the list on which it is called by the list supplied as argument to it:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; a = [1, 2, 3]
+&gt;&gt;&gt; b = [4, 5, 6]
+&gt;&gt;&gt; a.extend(b)
+[1, 2, 3, 4, 5, 6]
+
+</pre>
+<p><a name="x_19"></a>This is an in-place method. This method is equivalent to using the + operator, but using the + operator returns a new list.</p>
+</div>
+<div class="section" title="4.4. index">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="index"></a>4.4. index</h3></div></div></div>
+<p><a name="x_1a"></a>The 
+        <span class="emphasis"><em>index</em></span> method returns the index position of the element in the list specified as argument:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; a = [1, 2, 3, ,4, 5]
+&gt;&gt;&gt; a.index(4)
+3
+
+
+</pre>
+</div>
+<div class="section" title="4.5. insert">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="insert"></a>4.5. insert</h3></div></div></div>
+<p><a name="x_1b"></a>The 
+        <span class="emphasis"><em>insert</em></span> method is used to insert an element specified as the second argument to the list at the position specified by the first argument:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; a = ['Python', 'is', 'cool']
+&gt;&gt;&gt; a.insert(2, 'so')
+&gt;&gt;&gt; a
+['Python', 'is', 'so', 'cool']
+
+</pre>
+<p><a name="x_1c"></a>The 
+        <span class="emphasis"><em>insert</em></span> method changes the 
+        <span class="emphasis"><em>List</em></span> in-place.
+      </p>
+</div>
+<div class="section" title="4.6. pop">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="pop"></a>4.6. pop</h3></div></div></div>
+<p><a name="x_1d"></a>The 
+        <span class="emphasis"><em>pop</em></span> method removes an element from the list. The index position of the element to be removed can be specified as an argument to the 
+        <span class="emphasis"><em>pop</em></span> method, if not it removes the last element by default:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; a = [1, 2, 3, 4, 5]
+&gt;&gt;&gt; a.pop()
+&gt;&gt;&gt; a
+5
+&gt;&gt;&gt; a.pop(2)
+&gt;&gt;&gt; a
+3
+
+</pre>
+<p><a name="x_1e"></a>The 
+        <span class="emphasis"><em>pop</em></span> method changes the 
+        <span class="emphasis"><em>List</em></span> in-place.
+      </p>
+</div>
+<div class="section" title="4.7. remove">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="remove"></a>4.7. remove</h3></div></div></div>
+<p><a name="x_1f"></a>The 
+        <span class="emphasis"><em>remove</em></span> method removes the first occurence of an element supplied as a parameter:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; a = [1, 2, 3, 4, 2, 5, 2]
+&gt;&gt;&gt; a.remove(2)
+&gt;&gt;&gt; a
+[1, 3, 4, 2, 5, 2]
+
+
+</pre>
+</div>
+<div class="section" title="4.8. reverse">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="reverse"></a>4.8. reverse</h3></div></div></div>
+<p><a name="x_20"></a>The 
+        <span class="emphasis"><em>reverse</em></span> method reverses elements in the list. It is important to note here that 
+        <span class="emphasis"><em>reverse</em></span> method changes the list in-place and doesn't return any thing:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; a = ['guido', 'alex', 'tim']
+&gt;&gt;&gt; a.reverse()
+&gt;&gt;&gt; a
+['tim', 'alex', 'guido']
+
+
+</pre>
+</div>
+<div class="section" title="4.9. sort">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="sort"></a>4.9. sort</h3></div></div></div>
+<p><a name="x_21"></a>The 
+        <span class="emphasis"><em>sort</em></span> method is used to sort the elements of the list. The 
+        <span class="emphasis"><em>sort</em></span> method also sorts in-place and does not return anything:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; a = [5, 1, 3, 7, 4]
+&gt;&gt;&gt; a.sort()
+&gt;&gt;&gt; a
+[1, 3, 4, 5, 7]
+
+</pre>
+<p><a name="x_22"></a>In addition to the sort method on a 
+        <span class="emphasis"><em>List</em></span> object we can also use the built-in 
+        <span class="strong"><strong>sorted</strong></span> function. This function takes the 
+        <span class="emphasis"><em>List</em></span> as a parameter and returns a sorted copy of the list. However the original list is left intact:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; a = [5, 1, 3, 7, 4]
+&gt;&gt;&gt; b = sorted(a)
+&gt;&gt;&gt; b
+[1, 3, 4, 5, 7]
+&gt;&gt;&gt; a
+[5, 1, 3, 7, 4]
+
+
+</pre>
+</div>
+</div>
+<div class="section" title="5. Tuples">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="tuples"></a>5. Tuples</h2></div></div></div>
+<p><a name="x_23"></a>
+      <span class="emphasis"><em>Tuples</em></span> are sequences just like 
+      <span class="emphasis"><em>Lists</em></span>, but they are immutable. In other words 
+      <span class="emphasis"><em>Tuples</em></span> provides a way to represent a group of items, where the group of items cannot be changed in any way. The syntax of a 
+      <span class="emphasis"><em>Tuple</em></span> is also very similar to 
+      <span class="emphasis"><em>List</em></span>. A 
+      <span class="emphasis"><em>Tuple</em></span> is represented with the list of items, called elements of the 
+      <span class="emphasis"><em>Tuple</em></span> separated by comma, with the entire list being enclosed in parenthesis. It is not compulsory to use parenthesis around a 
+      <span class="emphasis"><em>Tuple</em></span> but it may be necessary in some of the cases:
+    </p>
+<pre class="programlisting">&gt;&gt;&gt; a = 1, 2, 3
+&gt;&gt;&gt; a
+(1, 2, 3)
+&gt;&gt;&gt; b = 1,
+&gt;&gt;&gt; b
+(1,)
+
+</pre>
+<p><a name="x_24"></a>It is interesting to note the second example. Just a value followed by a comma automatically makes that an element of a 
+      <span class="emphasis"><em>Tuple</em></span> with only one element. It is also important to note that, irrespective of input having a parenthesis, the output always has a parenthesis.
+    </p>
+<p><a name="x_25"></a>The first example is also known as 
+      <span class="emphasis"><em>Tuple packing</em></span>, because values are being packed into a tuple. It is also possible to do 
+      <span class="emphasis"><em>Tuple unpacking</em></span> which is more interesting. It is better to understand that by example. Say we have a co-ordinate pair from which we need to separate x and y co-ordinates:
+    </p>
+<pre class="programlisting">&gt;&gt;&gt; a = (1, 2)
+&gt;&gt;&gt; x, y = a
+&gt;&gt;&gt; x
+1
+&gt;&gt;&gt; y
+2
+
+</pre>
+<p><a name="x_26"></a>      <span class="emphasis"><em>Tuple unpacking</em></span> also has several other use-cases of which the most interesting one is to swap the values of two variables. Using programming languages like C would require anywhere around 10 lines of code and an extra temporary variable to do this (including all the #include stuff). Python does it in the most intuitive way in just one line. Say we want to swap the co-ordinates in the above example:
+    </p>
+<pre class="programlisting">&gt;&gt;&gt; x, y = y, x
+&gt;&gt;&gt; x
+2
+&gt;&gt;&gt; y
+1
+
+</pre>
+<div class="section" title="5.1. Common Tuple Operations">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="common-tuple-operations"></a>5.1. Common Tuple Operations</h3></div></div></div>
+<p><a name="x_27"></a>There is no need to introduce all the 
+        <span class="emphasis"><em>Tuple</em></span> operations again, since 
+        <span class="emphasis"><em>Tuples</em></span> support the following operations that 
+        <span class="emphasis"><em>List</em></span> supports in exactly the same way:
+      </p>
+<div class="blockquote"><blockquote class="blockquote"><div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p><a name="x_28"></a>Indexing</p></li>
+<li class="listitem" style="list-style-type: *"><p><a name="x_29"></a>Concatenating</p></li>
+<li class="listitem" style="list-style-type: *"><p><a name="x_2a"></a>Slicing</p></li>
+<li class="listitem" style="list-style-type: *"><p><a name="x_2b"></a>Membership</p></li>
+<li class="listitem" style="list-style-type: *"><p><a name="x_2c"></a>Multiplication</p></li>
+<li class="listitem" style="list-style-type: *"><p><a name="x_2d"></a>Length, Maximum, Minimum</p></li>
+</ul></div></blockquote></div>
+<p><a name="x_2e"></a>The following examples illustrate the above operations:</p>
+<pre class="programlisting">&gt;&gt;&gt; a = (1, 2, 3, 4, 5, 6)
+&gt;&gt;&gt; a[5]
+6
+&gt;&gt;&gt; b = (7, 8, 9)
+&gt;&gt;&gt; a + b
+(1, 2, 3, 4, 5, 6, 7, 8, 9)
+&gt;&gt;&gt; a[3:5]
+(4, 5)
+&gt;&gt;&gt; 5 in a
+True
+&gt;&gt;&gt; c = (1,)
+&gt;&gt;&gt; c * 5
+(1, 1, 1, 1, 1)
+&gt;&gt;&gt; len(a)
+6
+&gt;&gt;&gt; max(a)
+6
+&gt;&gt;&gt; min(a)
+1
+
+</pre>
+<p><a name="x_2f"></a>However the following 
+        <span class="emphasis"><em>List</em></span> operations are not supported by 
+        <span class="emphasis"><em>Tuples</em></span> because 
+        <span class="emphasis"><em>Tuples</em></span> cannot be changed once they are created:
+      </p>
+<div class="blockquote"><blockquote class="blockquote"><div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p><a name="x_30"></a>Changing elements</p></li>
+<li class="listitem" style="list-style-type: *"><p><a name="x_31"></a>Deleting elements</p></li>
+<li class="listitem" style="list-style-type: *"><p><a name="x_32"></a>Assigning to slices</p></li>
+</ul></div></blockquote></div>
+<p><a name="x_33"></a>Similarity to 
+        <span class="emphasis"><em>Lists</em></span> leads to the questions like, why not 
+        <span class="emphasis"><em>Lists</em></span> only? Why do we even want 
+        <span class="emphasis"><em>Tuples</em></span>? Can we do the same with 
+        <span class="emphasis"><em>Lists</em></span>? And the answer is 
+        <span class="strong"><strong>Yes</strong></span> we can do it, but 
+        <span class="emphasis"><em>Tuples</em></span> are helpful at times, like we can return Tuples from functions. They are also returned by some built-in functions and methods. And also there are some use cases like co-ordinate among other things. So 
+        <span class="emphasis"><em>Tuples</em></span> are helpful.
+      </p>
+</div>
+</div>
+<div class="section" title="6. Additional Syntax">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="additional-syntax"></a>6. Additional Syntax</h2></div></div></div>
+<p><a name="x_34"></a>The following additional syntax are introduced to make it easier to operate on 
+      <span class="emphasis"><em>Lists</em></span>.
+    </p>
+<div class="section" title="6.1. range()">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="range"></a>6.1. range()</h3></div></div></div>
+<p><a name="x_35"></a>The 
+        <span class="emphasis"><em>range</em></span> function takes at least one argument and 2 additional optional arguments. If two or more arguments are specified, the range function returns a list of natural numbers starting from the first argument passed to it to the second argument. The third argument, if specified is used as a step. Suppose only one argument is specified, then 
+        <span class="emphasis"><em>range</em></span> function returns a list of natural numbers starting from 0 upto the argument specified:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; range(5, 10, 2)
+[5, 7, 9]
+&gt;&gt;&gt; range(2, 15)
+[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
+&gt;&gt;&gt; range(12)
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
+
+</pre>
+</div>
+<div class="section" title="6.2. for">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="for"></a>6.2. for</h3></div></div></div>
+<p><a name="x_36"></a>The 
+        <span class="strong"><strong>for</strong></span> keyword is used as a part of the looping construct. Unlike for loops in other languages, Python's for is used to iterate through the elements of sequences like 
+        <span class="emphasis"><em>Lists</em></span>, 
+        <span class="emphasis"><em>Tuples</em></span>, 
+        <span class="emphasis"><em>Dictionaries</em></span>, etc. The syntax of the for loop consists of 
+        <span class="strong"><strong>for</strong></span>, followed by a variable to hold the individual or the current element of the list during iteration and 
+        <span class="strong"><strong>in</strong></span>, followed by the sequence and a semicolon(':') The next line which is part of the 
+        <span class="strong"><strong>for</strong></span> loop, i.e the statements that are part of the loop should start with a new intend:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; names = ['Guido', 'Alex', 'Tim']
+&gt;&gt;&gt; for name in names:
+...   print "Name =", name
+... 
+Name = Guido
+Name = Alex
+Name = Tim
+
+
+</pre>
+</div>
+</div>
+<div class="section" title="7. Conclusion">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="conclusion"></a>7. Conclusion</h2></div></div></div>
+<p><a name="x_37"></a>This section on 
+      <span class="emphasis"><em>Lists</em></span> and 
+      <span class="emphasis"><em>Tuples</em></span> introduces almost all the necessary machinary required to work on 
+      <span class="emphasis"><em>Lists</em></span> and 
+      <span class="emphasis"><em>Tuples</em></span>. Topics like how to use these data structures in bigger more useful programs will be introduced in the subsequent chapters.
+    </p>
+</div>
+</div>
+<div class="navfooter">
+<hr>
+<table width="100%" summary="Navigation footer">
+<tr>
+<td width="40%" align="left">
+<a accesskey="p" href="index.html">Prev</a> </td>
+<td width="20%" align="center"> </td>
+<td width="40%" align="right"> </td>
+</tr>
+<tr>
+<td width="40%" align="left" valign="top">Chapter 1. List and Tuples </td>
+<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
+<td width="40%" align="right" valign="top"> </td>
+</tr>
+</table>
+</div>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/backup/ch03-oop.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,109 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Classes and Objects</title>
+<link rel="stylesheet" href="hgbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="index.html" title="Chapter 1. Classes and Object">
+<link rel="up" href="index.html" title="Chapter 1. Classes and Object">
+<link rel="prev" href="index.html" title="Chapter 1. Classes and Object">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<div class="navheader">
+<table width="100%" summary="Navigation header">
+<tr><th colspan="3" align="center">Classes and Objects</th></tr>
+<tr>
+<td width="20%" align="left">
+<a accesskey="p" href="index.html">Prev</a> </td>
+<th width="60%" align="center"> </th>
+<td width="20%" align="right"> </td>
+</tr>
+</table>
+<hr>
+</div>
+<div class="article" title="Classes and Objects">
+<div class="titlepage">
+<div><div><h2 class="title">
+<a name="id2898687"></a>Classes and Objects</h2></div></div>
+<hr>
+</div>
+<p><a name="x_9e"></a>In the previous sections we learnt about functions which provide certain level of abstraction to our code by holding the code which performs one or more specific functionalities. We were able to use this function as many times as we wanted. In addition to functions, Python also higher level of abstractions through 
+    <span class="emphasis"><em>Classes</em></span> and 
+    <span class="emphasis"><em>Objects</em></span>. 
+    <span class="emphasis"><em>Objects</em></span> can be loosely defined as a collection of a set of data items and a set of methods. The data items can be any valid Python variable or any Python object. Functions enclosed within a class are called as 
+    <span class="emphasis"><em>methods</em></span>. If you are thinking if methods are functions why is there a distinction between the two? The answer to this will be given as we walk through the concepts of 
+    <span class="emphasis"><em>Classes</em></span> and 
+    <span class="emphasis"><em>Objects</em></span>. 
+    <span class="emphasis"><em>Classes</em></span> contain the definition for the 
+    <span class="emphasis"><em>Objects</em></span>. 
+    <span class="emphasis"><em>Objects</em></span> are instances of 
+    <span class="emphasis"><em>Classes</em></span>.
+  </p>
+<p><a name="x_9f"></a>A class is defined using the keyword 
+    <span class="strong"><strong>class</strong></span> followed by the class name, in turn followed by a semicolon. The statements that a 
+    <span class="emphasis"><em>Class</em></span> encloses are written in a new block, i.e on the next indentation level:
+  </p>
+<pre class="programlisting">class Employee:
+  def setName(self, name):
+    self.name = name
+
+  def getName(self):
+    return self.name
+
+</pre>
+<p><a name="x_a0"></a>In the above example, we defined a class with the name Employee. We also defined two methods, setName and getName for this class. It is important to note the differences between the normal Python functions and class methods defined above. Each method of the class must take the same instance of the class(object) from which it was called as the first argument. It is conventionally given the name, 
+    <span class="emphasis"><em>self</em></span>. Note that 
+    <span class="emphasis"><em>self</em></span> is only a convention. You can use any other name, but the first argument to the method will always be the same object of the class from which the method was called. The data memebers that belong to the class are called as 
+    <span class="emphasis"><em>class attributes</em></span>. 
+    <span class="emphasis"><em>Class attributes</em></span> are preceded by the object of the class and a dot. In the above example, 
+    <span class="emphasis"><em>name</em></span> is a class attribute since it is preceded by the 
+    <span class="emphasis"><em>self</em></span> object. 
+    <span class="emphasis"><em>Class attributes</em></span> can be accessed from anywhere within the class.
+  </p>
+<p><a name="x_a1"></a>We can create objects of a class outside the class definition by using the same syntax we use to call a function with no parameters. We can assign this object to a variable:</p>
+<pre class="programlisting">emp = Employee()
+
+</pre>
+<p><a name="x_a2"></a>In the above example, we create an object named 
+    <span class="emphasis"><em>emp</em></span> of the class 
+    <span class="emphasis"><em>Employee</em></span>. All the attributes and methods of the class can be accessed by the object of the class using the standard notation 
+    <span class="emphasis"><em>object.attribute</em></span> or 
+    <span class="emphasis"><em>object.method()</em></span>. Although the first parameter of a class method is the self object, it must not be passed as an argument when calling the method. The 
+    <span class="emphasis"><em>self</em></span> object is implicitly passed to the method by the Python interpreter. All other arguments passing rules like default arguments, keyword arguments, argument packing and unpacking follow the same rules as those for ordinary Python functions:
+  </p>
+<pre class="programlisting">&gt;&gt;&gt; emp.setName('John')
+&gt;&gt;&gt; name = emp.getName()
+&gt;&gt;&gt; print name
+John
+&gt;&gt;&gt; print emp.name
+John
+
+</pre>
+<p><a name="x_a3"></a>If we at all try to access a class attribute before assigning a value to it, i.e before creating it, Python raises the same error as it would raise for the accessing undefined variable:</p>
+<pre class="programlisting">&gt;&gt;&gt; emp = Employee()
+&gt;&gt;&gt; emp.name
+Traceback (most recent call last):
+  File "class.py", line 10, in &lt;module&gt;
+    print e.name
+AttributeError: Employee instance has no attribute 'name'
+
+</pre>
+</div>
+<div class="navfooter">
+<hr>
+<table width="100%" summary="Navigation footer">
+<tr>
+<td width="40%" align="left">
+<a accesskey="p" href="index.html">Prev</a> </td>
+<td width="20%" align="center"> </td>
+<td width="40%" align="right"> </td>
+</tr>
+<tr>
+<td width="40%" align="left" valign="top">Chapter 1. Classes and Object </td>
+<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
+<td width="40%" align="right" valign="top"> </td>
+</tr>
+</table>
+</div>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/backup/chap_intro.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,2 @@
+p_list={'chap_intro':['x_38', 'x_39', 'x_3d', 'x_3e', 'x_3f', 'x_40', 'x_41', 'x_42', 'x_46', 'x_4c', 'x_4d', 'x_4e', 'x_4f', 'x_50', 'x_51', 'x_52', 'x_53', 'x_54', 'x_55', 'x_56', 'x_57', 'x_58', 'x_59', 'x_5a', 'x_5b', 'x_5c', 'x_5d', 'x_5e', 'x_5f', 'x_60', 'x_61', 'x_62', 'x_63', 'x_64', 'x_65', 'x_66', 'x_67', 'x_68', 'x_69', 'x_6d', 'x_6e', 'x_6f', 'x_70', 'x_71', 'x_72', 'x_73', 'x_74', 'x_75', 'x_79', 'x_7a', 'x_7b', 'x_7c', 'x_7d', 'x_7e', 'x_7f', 'x_80', 'x_81', 'x_82', 'x_83', 'x_84', 'x_85', 'x_86', 'x_87', 'x_88', 'x_89', 'x_8a', 'x_8b', 'x_8c', 'x_8d', 'x_8e', 'x_8f', 'x_90', 'x_91', 'x_92', 'x_93', 'x_94', 'x_95', 'x_96', 'x_97', 'x_98', 'x_99', 'x_9a', 'x_9b', 'x_9c', 'x_9d']}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/backup/func.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,726 @@
+<html>
+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Chapter 9. Finding and fixing mistakes</title>
+<link rel="stylesheet" href="/support/styles.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.3"><link rel="home" href="index.html" title="Mercurial: The Definitive Guide">
+<link rel="up" href="index.html" title="Mercurial: The Definitive Guide">
+<link rel="prev" href="managing-releases-and-branchy-development.html" title="Chapter 8. Managing releases and branchy development">
+<link rel="next" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks"><link rel="alternate" type="application/atom+xml" title="Comments" href="/feeds/comments/">
+<link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png">
+<script type="text/javascript" src="/support/jquery-min.js"></script>
+<script type="text/javascript" src="/support/form.js"></script>
+<script type="text/javascript" src="/support/hsbook.js"></script></head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<!--<div class="navheader">
+<table width="100%" summary="Navigation header">
+<tr><th colspan="3" align="center">Chapter 14. Adding functionality with extensions</th></tr>
+<tr>
+<td width="20%" align="left">
+<a accesskey="p" href="advanced-uses-of-mercurial-queues.html">Prev</a> </td>
+<th width="60%" align="center"> </th>
+<td width="20%" align="right"> <a accesskey="n" href="migrating-to-mercurial.html">Next</a>
+</td>
+</tr>
+</table>
+<hr>
+</div> -->
+<div class="chapter" title="Chapter 14. Adding functionality with extensions">
+<div class="titlepage"><div><div><h2 class="title">
+<a name="chap:hgext"></a>Chapter 14. Adding functionality with extensions</h2></div></div></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:inotify">14.1. Improve performance with the <code class="literal">inotify</code> extension</a></span></dt>
+<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:extdiff">14.2. Flexible diff support with the <code class="literal">extdiff</code> extension</a></span></dt>
+<dd><dl><dt><span class="sect2"><a href="adding-functionality-with-extensions.html#id3071699">14.2.1. Defining command aliases</a></span></dt></dl></dd>
+<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:transplant">14.3. Cherrypicking changes with the <code class="literal">transplant</code> extension</a></span></dt>
+<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:patchbomb">14.4. Send changes via email with the <code class="literal">patchbomb</code> extension</a></span></dt>
+<dd><dl><dt><span class="sect2"><a href="adding-functionality-with-extensions.html#id3072184">14.4.1. Changing the behavior of patchbombs</a></span></dt></dl></dd>
+</dl>
+</div>
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#default-arguments">1. Default Arguments</a></span></dt>
+<dt><span class="section"><a href="#keyword-arguments">2. Keyword Arguments</a></span></dt>
+<dt><span class="section"><a href="#parameter-packing-and-unpacking">3. Parameter Packing and Unpacking</a></span></dt>
+<dt><span class="section"><a href="#nested-functions-and-scopes">4. Nested Functions and Scopes</a></span></dt>
+<dt><span class="section"><a href="#map-reduce-and-filter-functions">5. map, reduce and filter functions</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#list-comprehensions">5.1. List Comprehensions</a></span></dt></dl></dd>
+</dl>
+
+<p id="x_74b">
+    <span class="emphasis"><em>Functions</em></span> allow us to enclose a set of statements and call the function again and again instead of repeating the group of statements everytime. Functions also allow us to isolate a piece of code from all the other code and provides the convenience of not polluting the global variables.
+  </p>
+<p id="x_74c"<a name="x_74c"></a>
+    <span class="emphasis"><em>Function</em></span> in python is defined with the keyword 
+    <span class="strong"><strong>def</strong></span> followed by the name of the function, in turn followed by a pair of parenthesis which encloses the list of parameters to the function. The definition line ends with a ':'. The definition line is followed by the body of the function intended by one block. The 
+    <span class="emphasis"><em>Function</em></span> must return a value:
+  </p>
+<pre class="programlisting">def factorial(n):
+  fact = 1
+  for i in range(2, n):
+    fact *= i
+
+  return fact
+
+</pre>
+<p><a name="x_74d"></a>The code snippet above defines a function with the name factorial, takes the number for which the factorial must be computed, computes the factorial and returns the value.</p>
+<p><a name="x_74e"></a>A 
+    <span class="emphasis"><em>Function</em></span> once defined can be used or called anywhere else in the program. We call a fucntion with its name followed by a pair of parenthesis which encloses the arguments to the function.
+  </p>
+<p><a name="x_74f"></a>The value that function returns can be assigned to a variable. Let's call the above function and store the factorial in a variable:</p>
+<pre class="programlisting">fact5 = factorial(5)
+
+</pre>
+<p><a name="x_750"></a>The value of fact5 will now be 120, which is the factorial of 5. Note that we passed 5 as the argument to the function.</p>
+<p><a name="x_751"></a>It may be necessary to document what the function does, for each of the function to help the person who reads our code to understand it better. In order to do this Python allows the first line of the function body to be a string. This string is called as 
+    <span class="emphasis"><em>Documentation String</em></span> or 
+    <span class="emphasis"><em>docstring</em></span>. 
+    <span class="emphasis"><em>docstrings</em></span> prove to be very handy since there are number of tools which can pull out all the docstrings from Python functions and generate the documentation automatically from it. 
+    <span class="emphasis"><em>docstrings</em></span> for functions can be written as follows:
+  </p>
+<pre class="programlisting">def factorial(n):
+  'Returns the factorial for the number n.'
+  fact = 1
+  for i in range(2, n):
+    fact *= i
+
+  return fact
+
+</pre>
+<p><a name="x_752"></a>An important point to note at this point is that, a function can return any Python value or a Python object, which also includes a 
+    <span class="emphasis"><em>Tuple</em></span>. A 
+    <span class="emphasis"><em>Tuple</em></span> is just a collection of values and those values themselves can be of any other valid Python datatypes, including 
+    <span class="emphasis"><em>Lists</em></span>, 
+    <span class="emphasis"><em>Tuples</em></span>, 
+    <span class="emphasis"><em>Dictionaries</em></span> among other things. So effectively, if a function can return a tuple, it can return any number of values through a tuple
+  </p>
+<p><a name="x_753"></a>Let us write a small function to swap two values:</p>
+<pre class="programlisting">def swap(a, b):
+  return b, a
+
+c, d = swap(a, b)
+
+</pre>
+<p><a name="x_754"></a>Function scope --------------- The variables used inside the function are confined to the function's scope and doesn't pollute the variables of the same name outside the scope of the function. Also the arguments passed to the function are passed by-value if it is of basic Python data type:</p>
+<pre class="programlisting">def cant_change(n):
+  n = 10
+
+n = 5
+cant_change(n)
+
+</pre>
+<p><a name="x_755"></a>Upon running this code, what do you think would have happened to value of n which was assigned 5 before the function call? If you have already tried out that snippet on the interpreter you already know that the value of n is not changed. This is true of any immutable types of Python like 
+    <span class="emphasis"><em>Numbers</em></span>, 
+    <span class="emphasis"><em>Strings</em></span> and 
+    <span class="emphasis"><em>Tuples</em></span>. But when you pass mutable objects like 
+    <span class="emphasis"><em>Lists</em></span> and 
+    <span class="emphasis"><em>Dictionaries</em></span> the values are manipulated even outside the function:
+  </p>
+<pre class="programlisting">&gt;&gt;&gt; def can_change(n):
+...   n[1] = James
+...
+
+&gt;&gt;&gt; name = ['Mr.', 'Steve', 'Gosling']
+&gt;&gt;&gt; can_change(name)
+&gt;&gt;&gt; name
+['Mr.', 'James', 'Gosling']
+
+</pre>
+<p><a name="x_756"></a>If nothing is returned by the function explicitly, Python takes care to return None when the funnction is called.</p>
+<div class="section" title="1. Default Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="default-arguments"></a>1. Default Arguments</h2></div></div></div>
+<p><a name="x_757"></a>There may be situations where we need to allow the functions to take the arguments optionally. Python allows us to define function this way by providing a facility called 
+      <span class="emphasis"><em>Default Arguments</em></span>. For example, we need to write a function that returns a list of fibonacci numbers. Since our function cannot generate an infinite list of fibonacci numbers, we need to specify the number of elements that the fibonacci sequence must contain. Suppose, additionally, we want to the function to return 10 numbers in the sequence if no option is specified we can define the function as follows:
+    </p>
+<pre class="programlisting">def fib(n=10):
+  fib_list = [0, 1]
+  for i in range(n - 2):
+    next = fib_list[-2] + fib_list[-1]
+    fib_list.append(next)
+  return fib_list
+
+</pre>
+<p><a name="x_758"></a>When we call this function, we can optionally specify the value for the parameter n, during the call as an argument. Calling with no argument and argument with n=5 returns the following fibonacci sequences:</p>
+<pre class="programlisting">fib()
+[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
+fib(5)
+[0, 1, 1, 2, 3]
+
+</pre>
+</div>
+<div class="section" title="2. Keyword Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="keyword-arguments"></a>2. Keyword Arguments</h2></div></div></div>
+<p><a name="x_759"></a>When a function takes a large number of arguments, it may be difficult to remember the order of the parameters in the function definition or it may be necessary to pass values to only certain parameters since others take the default value. In either of these cases, Python provides the facility of passing arguments by specifying the name of the parameter as defined in the function definition. This is known as 
+      <span class="emphasis"><em>Keyword Arguments</em></span>.
+    </p>
+<p><a name="x_75a"></a>In a function call, 
+      <span class="emphasis"><em>Keyword arguments</em></span> can be used for each argument, in the following fashion:
+    </p>
+<pre class="programlisting">argument_name=argument_value
+Also denoted as: keyword=argument
+
+def wish(name='World', greetings='Hello'):
+  print "%s, %s!" % (greetings, name)
+
+</pre>
+<p><a name="x_75b"></a>This function can be called in one of the following ways. It is important to note that no restriction is imposed in the order in which 
+      <span class="emphasis"><em>Keyword arguments</em></span> can be specified. Also note, that we have combined 
+      <span class="emphasis"><em>Keyword arguments</em></span> with 
+      <span class="emphasis"><em>Default arguments</em></span> in this example, however it is not necessary:
+    </p>
+<pre class="programlisting">wish(name='Guido', greetings='Hey')
+wish(greetings='Hey', name='Guido')
+
+</pre>
+<p><a name="x_75c"></a>Calling functions by specifying arguments in the order of parameters specified in the function definition is called as 
+      <span class="emphasis"><em>Positional arguments</em></span>, as opposed to 
+      <span class="emphasis"><em>Keyword arguments</em></span>. It is possible to use both 
+      <span class="emphasis"><em>Positional arguments</em></span> and 
+      <span class="emphasis"><em>Keyword arguments</em></span> in a single function call. But Python doesn't allow us to bungle up both of them. The arguments to the function, in the call, must always start with 
+      <span class="emphasis"><em>Positional arguments</em></span> which is in turn followed by 
+      <span class="emphasis"><em>Keyword arguments</em></span>:
+    </p>
+<pre class="programlisting">def my_func(x, y, z, u, v, w):
+  # initialize variables.
+  ...
+  # do some stuff 
+  ...
+  # return the value
+
+</pre>
+<p><a name="x_75d"></a>It is valid to call the above functions in the following ways:</p>
+<pre class="programlisting">my_func(10, 20, 30, u=1.0, v=2.0, w=3.0)
+my_func(10, 20, 30, 1.0, 2.0, w=3.0)
+my_func(10, 20, z=30, u=1.0, v=2.0, w=3.0)
+my_func(x=10, y=20, z=30, u=1.0, v=2.0, w=3.0)
+
+</pre>
+<p><a name="x_75e"></a>Following lists some of the invalid calls:</p>
+<pre class="programlisting">my_func(10, 20, z=30, 1.0, 2.0, 3.0)
+my_func(x=10, 20, z=30, 1.0, 2.0, 3.0)
+my_func(x=10, y=20, z=30, u=1.0, v=2.0, 3.0)
+
+</pre>
+</div>
+<div class="section" title="3. Parameter Packing and Unpacking">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="parameter-packing-and-unpacking"></a>3. Parameter Packing and Unpacking</h2></div></div></div>
+<p><a name="x_75f"></a>The positional arguments passed to a function can be collected in a tuple parameter and keyword arguments can be collected in a dictionary. Since keyword arguments must always be the last set of arguments passed to a function, the keyword dictionary parameter must be the last parameter. The function definition must include a list explicit parameters, followed by tuple paramter collecting parameter, whose name is preceded by a *****, for collecting positional parameters, in turn followed by the dictionary collecting parameter, whose name is preceded by a ****** :</p>
+<pre class="programlisting">def print_report(title, *args, **name):
+  """Structure of *args*
+  (age, email-id)
+  Structure of *name*
+  {
+      'first': First Name
+      'middle': Middle Name
+      'last': Last Name
+  }
+  """
+
+  print "Title: %s" % (title)
+  print "Full name: %(first)s %(middle)s %(last)s" % name
+  print "Age: %d\nEmail-ID: %s" % args
+
+</pre>
+<p><a name="x_760"></a>The above function can be called as. Note, the order of keyword parameters can be interchanged:</p>
+<pre class="programlisting">&gt;&gt;&gt; print_report('Employee Report', 29, 'johny@example.com', first='Johny',
+                 last='Charles', middle='Douglas')
+Title: Employee Report
+Full name: Johny Douglas Charles
+Age: 29
+Email-ID: johny@example.com
+
+</pre>
+<p><a name="x_761"></a>The reverse of this can also be achieved by using a very identical syntax while calling the function. A tuple or a dictionary can be passed as arguments in place of a list of *Positional arguments* or *Keyword arguments* respectively using ***** or ****** :</p>
+<pre class="programlisting">def print_report(title, age, email, first, middle, last):
+  print "Title: %s" % (title)
+  print "Full name: %s %s %s" % (first, middle, last)
+  print "Age: %d\nEmail-ID: %s" % (age, email)
+
+&gt;&gt;&gt; args = (29, 'johny@example.com')
+&gt;&gt;&gt; name = {
+        'first': 'Johny',
+        'middle': 'Charles',
+        'last': 'Douglas'
+        }
+&gt;&gt;&gt; print_report('Employee Report', *args, **name)
+Title: Employee Report
+Full name: Johny Charles Douglas
+Age: 29
+Email-ID: johny@example.com
+
+</pre>
+</div>
+<div class="section" title="4. Nested Functions and Scopes">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="nested-functions-and-scopes"></a>4. Nested Functions and Scopes</h2></div></div></div>
+<p><a name="x_762"></a>Python allows nesting one function inside another. This style of programming turns out to be extremely flexible and powerful features when we use 
+      <span class="emphasis"><em>Python decorators</em></span>. We will not talk about decorators is beyond the scope of this course. If you are interested in knowing more about 
+      <span class="emphasis"><em>decorator programming</em></span> in Python you are suggested to read:
+    </p>
+<div class="literallayout"><p><br>
+      <a class="ulink" href="http://avinashv.net/2008/04/python-decorators-syntactic-sugar" target="_top">http://avinashv.net/2008/04/python-decorators-syntactic-sugar</a>/<br>
+      <a class="ulink" href="http://personalpages.tds.net" target="_top">http://personalpages.tds.net</a>/~kent37/kk/00001.html<br>
+    </p></div>
+<p><a name="x_763"></a>However, the following is an example for nested functions in Python:</p>
+<pre class="programlisting">def outer():
+  print "Outer..."
+  def inner():
+    print "Inner..."
+  print "Outer..."
+  inner()
+
+&gt;&gt;&gt; outer()
+
+</pre>
+</div>
+<div class="section" title="5. map, reduce and filter functions">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="map-reduce-and-filter-functions"></a>5. map, reduce and filter functions</h2></div></div></div>
+<p><a name="x_764"></a>Python provides several built-in functions for convenience. The 
+      <span class="strong"><strong>map()</strong></span>, 
+      <span class="strong"><strong>reduce()</strong></span> and 
+      <span class="strong"><strong>filter()</strong></span> functions prove to be very useful with sequences like 
+      <span class="emphasis"><em>Lists</em></span>.
+    </p>
+<p><a name="x_765"></a>The 
+      <span class="strong"><strong>map</strong></span> (
+      <span class="emphasis"><em>function</em></span>, 
+      <span class="emphasis"><em>sequence</em></span>) function takes two arguments: 
+      <span class="emphasis"><em>function</em></span> and a 
+      <span class="emphasis"><em>sequence</em></span> argument. The 
+      <span class="emphasis"><em>function</em></span> argument must be the name of the function which in turn takes a single argument, the individual element of the 
+      <span class="emphasis"><em>sequence</em></span>. The 
+      <span class="strong"><strong>map</strong></span> function calls 
+      <span class="emphasis"><em>function(item)</em></span>, for each item in the sequence and returns a list of values, where each value is the value returned by each call to 
+      <span class="emphasis"><em>function(item)</em></span>. 
+      <span class="strong"><strong>map()</strong></span> function allows to pass more than one sequence. In this case, the first argument, 
+      <span class="emphasis"><em>function</em></span> must take as many arguments as the number of sequences passed. This function is called with each corresponding element in the each of the sequences, or 
+      <span class="strong"><strong>None</strong></span> if one of the sequence is exhausted:
+    </p>
+<pre class="programlisting">def square(x):
+  return x*x
+
+&gt;&gt;&gt; map(square, [1, 2, 3, 4])
+[1, 4, 9, 16]
+
+def mul(x, y):
+  return x*y
+
+&gt;&gt;&gt; map(mul, [1, 2, 3, 4], [6, 7, 8, 9])
+
+</pre>
+<p><a name="x_766"></a>The 
+      <span class="strong"><strong>filter</strong></span> (
+      <span class="emphasis"><em>function</em></span>, 
+      <span class="emphasis"><em>sequence</em></span>) function takes two arguments, similar to the 
+      <span class="strong"><strong>map()</strong></span> function. The 
+      <span class="strong"><strong>filter</strong></span> function calls 
+      <span class="emphasis"><em>function(item)</em></span>, for each item in the sequence and returns all the elements in the sequence for which 
+      <span class="emphasis"><em>function(item)</em></span> returned True:
+    </p>
+<pre class="programlisting">def even(x):
+  if x % 2:
+    return True
+  else:
+    return False
+
+&gt;&gt;&gt; filter(even, range(1, 10))
+[1, 3, 5, 7, 9]
+
+</pre>
+<p><a name="x_767"></a>The 
+      <span class="strong"><strong>reduce</strong></span> (
+      <span class="emphasis"><em>function</em></span>, 
+      <span class="emphasis"><em>sequence</em></span>) function takes two arguments, similar to 
+      <span class="strong"><strong>map</strong></span> function, however multiple sequences are not allowed. The 
+      <span class="strong"><strong>reduce</strong></span> function calls 
+      <span class="emphasis"><em>function</em></span> with first two consecutive elements in the sequence, obtains the result, calls 
+      <span class="emphasis"><em>function</em></span> with the result and the subsequent element in the sequence and so on until the end of the list and returns the final result:
+    </p>
+<pre class="programlisting">def mul(x, y):
+  return x*y
+
+&gt;&gt;&gt; reduce(mul, [1, 2, 3, 4])
+24
+
+</pre>
+<div class="section" title="5.1. List Comprehensions">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="list-comprehensions"></a>5.1. List Comprehensions</h3></div></div></div>
+<p><a name="x_768"></a>List Comprehension is a convenvience utility provided by Python. It is a syntatic sugar to create 
+        <span class="emphasis"><em>Lists</em></span>. Using 
+        <span class="emphasis"><em>List Comprehensions</em></span> one can create 
+        <span class="emphasis"><em>Lists</em></span> from other type of sequential data structures or other 
+        <span class="emphasis"><em>Lists</em></span> itself. The syntax of 
+        <span class="emphasis"><em>List Comprehensions</em></span> consists of a square brackets to indicate the result is a 
+        <span class="emphasis"><em>List</em></span> within which we include at least one 
+        <span class="strong"><strong>for</strong></span> clause and multiple 
+        <span class="strong"><strong>if</strong></span> clauses. It will be more clear with an example:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; num = [1, 2, 3]
+&gt;&gt;&gt; sq = [x*x for x in num]
+&gt;&gt;&gt; sq
+[1, 4, 9]
+&gt;&gt;&gt; all_num = [1, 2, 3, 4, 5, 6, 7, 8, 9]
+&gt;&gt;&gt; even = [x for x in all_num if x%2 == 0]
+
+</pre>
+<p><a name="x_769"></a>The syntax used here is very clear from the way it is written. It can be translated into english as, "for each element x in the list all_num, if remainder of x divided by 2 is 0, add x to the list."</p>
+</div>
+</div>
+</div></body>
+</html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Functional Approach</title>
+<link rel="stylesheet" href="hgbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" title="Functional Approach">
+<div class="titlepage">
+<div><div><h2 class="title">
+<a name="id2760558"></a>Functional Approach</h2></div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#default-arguments">1. Default Arguments</a></span></dt>
+<dt><span class="section"><a href="#keyword-arguments">2. Keyword Arguments</a></span></dt>
+<dt><span class="section"><a href="#parameter-packing-and-unpacking">3. Parameter Packing and Unpacking</a></span></dt>
+<dt><span class="section"><a href="#nested-functions-and-scopes">4. Nested Functions and Scopes</a></span></dt>
+<dt><span class="section"><a href="#map-reduce-and-filter-functions">5. map, reduce and filter functions</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#list-comprehensions">5.1. List Comprehensions</a></span></dt></dl></dd>
+</dl>
+</div>
+<p><a name="x_74b"></a>
+    <span class="emphasis"><em>Functions</em></span> allow us to enclose a set of statements and call the function again and again instead of repeating the group of statements everytime. Functions also allow us to isolate a piece of code from all the other code and provides the convenience of not polluting the global variables.
+  </p>
+<p><a name="x_74c"></a>
+    <span class="emphasis"><em>Function</em></span> in python is defined with the keyword 
+    <span class="strong"><strong>def</strong></span> followed by the name of the function, in turn followed by a pair of parenthesis which encloses the list of parameters to the function. The definition line ends with a ':'. The definition line is followed by the body of the function intended by one block. The 
+    <span class="emphasis"><em>Function</em></span> must return a value:
+  </p>
+<pre class="programlisting">def factorial(n):
+  fact = 1
+  for i in range(2, n):
+    fact *= i
+
+  return fact
+
+</pre>
+<p><a name="x_74d"></a>The code snippet above defines a function with the name factorial, takes the number for which the factorial must be computed, computes the factorial and returns the value.</p>
+<p><a name="x_74e"></a>A 
+    <span class="emphasis"><em>Function</em></span> once defined can be used or called anywhere else in the program. We call a fucntion with its name followed by a pair of parenthesis which encloses the arguments to the function.
+  </p>
+<p><a name="x_74f"></a>The value that function returns can be assigned to a variable. Let's call the above function and store the factorial in a variable:</p>
+<pre class="programlisting">fact5 = factorial(5)
+
+</pre>
+<p><a name="x_750"></a>The value of fact5 will now be 120, which is the factorial of 5. Note that we passed 5 as the argument to the function.</p>
+<p><a name="x_751"></a>It may be necessary to document what the function does, for each of the function to help the person who reads our code to understand it better. In order to do this Python allows the first line of the function body to be a string. This string is called as 
+    <span class="emphasis"><em>Documentation String</em></span> or 
+    <span class="emphasis"><em>docstring</em></span>. 
+    <span class="emphasis"><em>docstrings</em></span> prove to be very handy since there are number of tools which can pull out all the docstrings from Python functions and generate the documentation automatically from it. 
+    <span class="emphasis"><em>docstrings</em></span> for functions can be written as follows:
+  </p>
+<pre class="programlisting">def factorial(n):
+  'Returns the factorial for the number n.'
+  fact = 1
+  for i in range(2, n):
+    fact *= i
+
+  return fact
+
+</pre>
+<p><a name="x_752"></a>An important point to note at this point is that, a function can return any Python value or a Python object, which also includes a 
+    <span class="emphasis"><em>Tuple</em></span>. A 
+    <span class="emphasis"><em>Tuple</em></span> is just a collection of values and those values themselves can be of any other valid Python datatypes, including 
+    <span class="emphasis"><em>Lists</em></span>, 
+    <span class="emphasis"><em>Tuples</em></span>, 
+    <span class="emphasis"><em>Dictionaries</em></span> among other things. So effectively, if a function can return a tuple, it can return any number of values through a tuple
+  </p>
+<p><a name="x_753"></a>Let us write a small function to swap two values:</p>
+<pre class="programlisting">def swap(a, b):
+  return b, a
+
+c, d = swap(a, b)
+
+</pre>
+<p><a name="x_754"></a>Function scope --------------- The variables used inside the function are confined to the function's scope and doesn't pollute the variables of the same name outside the scope of the function. Also the arguments passed to the function are passed by-value if it is of basic Python data type:</p>
+<pre class="programlisting">def cant_change(n):
+  n = 10
+
+n = 5
+cant_change(n)
+
+</pre>
+<p><a name="x_755"></a>Upon running this code, what do you think would have happened to value of n which was assigned 5 before the function call? If you have already tried out that snippet on the interpreter you already know that the value of n is not changed. This is true of any immutable types of Python like 
+    <span class="emphasis"><em>Numbers</em></span>, 
+    <span class="emphasis"><em>Strings</em></span> and 
+    <span class="emphasis"><em>Tuples</em></span>. But when you pass mutable objects like 
+    <span class="emphasis"><em>Lists</em></span> and 
+    <span class="emphasis"><em>Dictionaries</em></span> the values are manipulated even outside the function:
+  </p>
+<pre class="programlisting">&gt;&gt;&gt; def can_change(n):
+...   n[1] = James
+...
+
+&gt;&gt;&gt; name = ['Mr.', 'Steve', 'Gosling']
+&gt;&gt;&gt; can_change(name)
+&gt;&gt;&gt; name
+['Mr.', 'James', 'Gosling']
+
+</pre>
+<p><a name="x_756"></a>If nothing is returned by the function explicitly, Python takes care to return None when the funnction is called.</p>
+<div class="section" title="1. Default Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="default-arguments"></a>1. Default Arguments</h2></div></div></div>
+<p><a name="x_757"></a>There may be situations where we need to allow the functions to take the arguments optionally. Python allows us to define function this way by providing a facility called 
+      <span class="emphasis"><em>Default Arguments</em></span>. For example, we need to write a function that returns a list of fibonacci numbers. Since our function cannot generate an infinite list of fibonacci numbers, we need to specify the number of elements that the fibonacci sequence must contain. Suppose, additionally, we want to the function to return 10 numbers in the sequence if no option is specified we can define the function as follows:
+    </p>
+<pre class="programlisting">def fib(n=10):
+  fib_list = [0, 1]
+  for i in range(n - 2):
+    next = fib_list[-2] + fib_list[-1]
+    fib_list.append(next)
+  return fib_list
+
+</pre>
+<p><a name="x_758"></a>When we call this function, we can optionally specify the value for the parameter n, during the call as an argument. Calling with no argument and argument with n=5 returns the following fibonacci sequences:</p>
+<pre class="programlisting">fib()
+[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
+fib(5)
+[0, 1, 1, 2, 3]
+
+</pre>
+</div>
+<div class="section" title="2. Keyword Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="keyword-arguments"></a>2. Keyword Arguments</h2></div></div></div>
+<p><a name="x_759"></a>When a function takes a large number of arguments, it may be difficult to remember the order of the parameters in the function definition or it may be necessary to pass values to only certain parameters since others take the default value. In either of these cases, Python provides the facility of passing arguments by specifying the name of the parameter as defined in the function definition. This is known as 
+      <span class="emphasis"><em>Keyword Arguments</em></span>.
+    </p>
+<p><a name="x_75a"></a>In a function call, 
+      <span class="emphasis"><em>Keyword arguments</em></span> can be used for each argument, in the following fashion:
+    </p>
+<pre class="programlisting">argument_name=argument_value
+Also denoted as: keyword=argument
+
+def wish(name='World', greetings='Hello'):
+  print "%s, %s!" % (greetings, name)
+
+</pre>
+<p><a name="x_75b"></a>This function can be called in one of the following ways. It is important to note that no restriction is imposed in the order in which 
+      <span class="emphasis"><em>Keyword arguments</em></span> can be specified. Also note, that we have combined 
+      <span class="emphasis"><em>Keyword arguments</em></span> with 
+      <span class="emphasis"><em>Default arguments</em></span> in this example, however it is not necessary:
+    </p>
+<pre class="programlisting">wish(name='Guido', greetings='Hey')
+wish(greetings='Hey', name='Guido')
+
+</pre>
+<p><a name="x_75c"></a>Calling functions by specifying arguments in the order of parameters specified in the function definition is called as 
+      <span class="emphasis"><em>Positional arguments</em></span>, as opposed to 
+      <span class="emphasis"><em>Keyword arguments</em></span>. It is possible to use both 
+      <span class="emphasis"><em>Positional arguments</em></span> and 
+      <span class="emphasis"><em>Keyword arguments</em></span> in a single function call. But Python doesn't allow us to bungle up both of them. The arguments to the function, in the call, must always start with 
+      <span class="emphasis"><em>Positional arguments</em></span> which is in turn followed by 
+      <span class="emphasis"><em>Keyword arguments</em></span>:
+    </p>
+<pre class="programlisting">def my_func(x, y, z, u, v, w):
+  # initialize variables.
+  ...
+  # do some stuff 
+  ...
+  # return the value
+
+</pre>
+<p><a name="x_75d"></a>It is valid to call the above functions in the following ways:</p>
+<pre class="programlisting">my_func(10, 20, 30, u=1.0, v=2.0, w=3.0)
+my_func(10, 20, 30, 1.0, 2.0, w=3.0)
+my_func(10, 20, z=30, u=1.0, v=2.0, w=3.0)
+my_func(x=10, y=20, z=30, u=1.0, v=2.0, w=3.0)
+
+</pre>
+<p><a name="x_75e"></a>Following lists some of the invalid calls:</p>
+<pre class="programlisting">my_func(10, 20, z=30, 1.0, 2.0, 3.0)
+my_func(x=10, 20, z=30, 1.0, 2.0, 3.0)
+my_func(x=10, y=20, z=30, u=1.0, v=2.0, 3.0)
+
+</pre>
+</div>
+<div class="section" title="3. Parameter Packing and Unpacking">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="parameter-packing-and-unpacking"></a>3. Parameter Packing and Unpacking</h2></div></div></div>
+<p><a name="x_75f"></a>The positional arguments passed to a function can be collected in a tuple parameter and keyword arguments can be collected in a dictionary. Since keyword arguments must always be the last set of arguments passed to a function, the keyword dictionary parameter must be the last parameter. The function definition must include a list explicit parameters, followed by tuple paramter collecting parameter, whose name is preceded by a *****, for collecting positional parameters, in turn followed by the dictionary collecting parameter, whose name is preceded by a ****** :</p>
+<pre class="programlisting">def print_report(title, *args, **name):
+  """Structure of *args*
+  (age, email-id)
+  Structure of *name*
+  {
+      'first': First Name
+      'middle': Middle Name
+      'last': Last Name
+  }
+  """
+
+  print "Title: %s" % (title)
+  print "Full name: %(first)s %(middle)s %(last)s" % name
+  print "Age: %d\nEmail-ID: %s" % args
+
+</pre>
+<p><a name="x_760"></a>The above function can be called as. Note, the order of keyword parameters can be interchanged:</p>
+<pre class="programlisting">&gt;&gt;&gt; print_report('Employee Report', 29, 'johny@example.com', first='Johny',
+                 last='Charles', middle='Douglas')
+Title: Employee Report
+Full name: Johny Douglas Charles
+Age: 29
+Email-ID: johny@example.com
+
+</pre>
+<p><a name="x_761"></a>The reverse of this can also be achieved by using a very identical syntax while calling the function. A tuple or a dictionary can be passed as arguments in place of a list of *Positional arguments* or *Keyword arguments* respectively using ***** or ****** :</p>
+<pre class="programlisting">def print_report(title, age, email, first, middle, last):
+  print "Title: %s" % (title)
+  print "Full name: %s %s %s" % (first, middle, last)
+  print "Age: %d\nEmail-ID: %s" % (age, email)
+
+&gt;&gt;&gt; args = (29, 'johny@example.com')
+&gt;&gt;&gt; name = {
+        'first': 'Johny',
+        'middle': 'Charles',
+        'last': 'Douglas'
+        }
+&gt;&gt;&gt; print_report('Employee Report', *args, **name)
+Title: Employee Report
+Full name: Johny Charles Douglas
+Age: 29
+Email-ID: johny@example.com
+
+</pre>
+</div>
+<div class="section" title="4. Nested Functions and Scopes">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="nested-functions-and-scopes"></a>4. Nested Functions and Scopes</h2></div></div></div>
+<p><a name="x_762"></a>Python allows nesting one function inside another. This style of programming turns out to be extremely flexible and powerful features when we use 
+      <span class="emphasis"><em>Python decorators</em></span>. We will not talk about decorators is beyond the scope of this course. If you are interested in knowing more about 
+      <span class="emphasis"><em>decorator programming</em></span> in Python you are suggested to read:
+    </p>
+<div class="literallayout"><p><br>
+      <a class="ulink" href="http://avinashv.net/2008/04/python-decorators-syntactic-sugar" target="_top">http://avinashv.net/2008/04/python-decorators-syntactic-sugar</a>/<br>
+      <a class="ulink" href="http://personalpages.tds.net" target="_top">http://personalpages.tds.net</a>/~kent37/kk/00001.html<br>
+    </p></div>
+<p><a name="x_763"></a>However, the following is an example for nested functions in Python:</p>
+<pre class="programlisting">def outer():
+  print "Outer..."
+  def inner():
+    print "Inner..."
+  print "Outer..."
+  inner()
+
+&gt;&gt;&gt; outer()
+
+</pre>
+</div>
+<div class="section" title="5. map, reduce and filter functions">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="map-reduce-and-filter-functions"></a>5. map, reduce and filter functions</h2></div></div></div>
+<p><a name="x_764"></a>Python provides several built-in functions for convenience. The 
+      <span class="strong"><strong>map()</strong></span>, 
+      <span class="strong"><strong>reduce()</strong></span> and 
+      <span class="strong"><strong>filter()</strong></span> functions prove to be very useful with sequences like 
+      <span class="emphasis"><em>Lists</em></span>.
+    </p>
+<p><a name="x_765"></a>The 
+      <span class="strong"><strong>map</strong></span> (
+      <span class="emphasis"><em>function</em></span>, 
+      <span class="emphasis"><em>sequence</em></span>) function takes two arguments: 
+      <span class="emphasis"><em>function</em></span> and a 
+      <span class="emphasis"><em>sequence</em></span> argument. The 
+      <span class="emphasis"><em>function</em></span> argument must be the name of the function which in turn takes a single argument, the individual element of the 
+      <span class="emphasis"><em>sequence</em></span>. The 
+      <span class="strong"><strong>map</strong></span> function calls 
+      <span class="emphasis"><em>function(item)</em></span>, for each item in the sequence and returns a list of values, where each value is the value returned by each call to 
+      <span class="emphasis"><em>function(item)</em></span>. 
+      <span class="strong"><strong>map()</strong></span> function allows to pass more than one sequence. In this case, the first argument, 
+      <span class="emphasis"><em>function</em></span> must take as many arguments as the number of sequences passed. This function is called with each corresponding element in the each of the sequences, or 
+      <span class="strong"><strong>None</strong></span> if one of the sequence is exhausted:
+    </p>
+<pre class="programlisting">def square(x):
+  return x*x
+
+&gt;&gt;&gt; map(square, [1, 2, 3, 4])
+[1, 4, 9, 16]
+
+def mul(x, y):
+  return x*y
+
+&gt;&gt;&gt; map(mul, [1, 2, 3, 4], [6, 7, 8, 9])
+
+</pre>
+<p><a name="x_766"></a>The 
+      <span class="strong"><strong>filter</strong></span> (
+      <span class="emphasis"><em>function</em></span>, 
+      <span class="emphasis"><em>sequence</em></span>) function takes two arguments, similar to the 
+      <span class="strong"><strong>map()</strong></span> function. The 
+      <span class="strong"><strong>filter</strong></span> function calls 
+      <span class="emphasis"><em>function(item)</em></span>, for each item in the sequence and returns all the elements in the sequence for which 
+      <span class="emphasis"><em>function(item)</em></span> returned True:
+    </p>
+<pre class="programlisting">def even(x):
+  if x % 2:
+    return True
+  else:
+    return False
+
+&gt;&gt;&gt; filter(even, range(1, 10))
+[1, 3, 5, 7, 9]
+
+</pre>
+<p><a name="x_767"></a>The 
+      <span class="strong"><strong>reduce</strong></span> (
+      <span class="emphasis"><em>function</em></span>, 
+      <span class="emphasis"><em>sequence</em></span>) function takes two arguments, similar to 
+      <span class="strong"><strong>map</strong></span> function, however multiple sequences are not allowed. The 
+      <span class="strong"><strong>reduce</strong></span> function calls 
+      <span class="emphasis"><em>function</em></span> with first two consecutive elements in the sequence, obtains the result, calls 
+      <span class="emphasis"><em>function</em></span> with the result and the subsequent element in the sequence and so on until the end of the list and returns the final result:
+    </p>
+<pre class="programlisting">def mul(x, y):
+  return x*y
+
+&gt;&gt;&gt; reduce(mul, [1, 2, 3, 4])
+24
+
+</pre>
+<div class="section" title="5.1. List Comprehensions">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="list-comprehensions"></a>5.1. List Comprehensions</h3></div></div></div>
+<p><a name="x_768"></a>List Comprehension is a convenvience utility provided by Python. It is a syntatic sugar to create 
+        <span class="emphasis"><em>Lists</em></span>. Using 
+        <span class="emphasis"><em>List Comprehensions</em></span> one can create 
+        <span class="emphasis"><em>Lists</em></span> from other type of sequential data structures or other 
+        <span class="emphasis"><em>Lists</em></span> itself. The syntax of 
+        <span class="emphasis"><em>List Comprehensions</em></span> consists of a square brackets to indicate the result is a 
+        <span class="emphasis"><em>List</em></span> within which we include at least one 
+        <span class="strong"><strong>for</strong></span> clause and multiple 
+        <span class="strong"><strong>if</strong></span> clauses. It will be more clear with an example:
+      </p>
+<pre class="programlisting">&gt;&gt;&gt; num = [1, 2, 3]
+&gt;&gt;&gt; sq = [x*x for x in num]
+&gt;&gt;&gt; sq
+[1, 4, 9]
+&gt;&gt;&gt; all_num = [1, 2, 3, 4, 5, 6, 7, 8, 9]
+&gt;&gt;&gt; even = [x for x in all_num if x%2 == 0]
+
+</pre>
+<p><a name="x_769"></a>The syntax used here is very clear from the way it is written. It can be translated into english as, "for each element x in the list all_num, if remainder of x divided by 2 is 0, add x to the list."</p>
+</div>
+</div>
+</div></body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/backup/paragraphlist.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,8 @@
+import sys
+f=open(sys.argv[1],'r')
+pid_list=[]
+for i in f.readlines():
+    if i.startswith('<p id=') : 
+        list_tmp=i.split('"')[1]
+        pid_list.append(list_tmp)
+print pid_list
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/ch1Introduction.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1141 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Introduction</title>
+<link rel="stylesheet" href="/review/support/styles.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.3">
+
+<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
+<script type="text/javascript" src="/review/support/jquery-min.js"></script>
+<script type="text/javascript" src="/review/support/form.js"></script>
+<script type="text/javascript" src="/review/support/hsbook.js"></script>
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch1Introduction">
+<div class="titlepage"></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="article"><a href="#id2906013"></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2716138">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2903833">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2957074">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2957346">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2957478">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2957486">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2957764">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2957772">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2957935">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2957995">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2958097">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2958179">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2958358">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2958366">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2958459">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2958668">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2958758">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2958811">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2958820">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2959131">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2959268">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2959439">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2959531">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2959540">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2959626">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2959752">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2959838">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2959970">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2960077">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2960086">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2960272">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2960383">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2960623">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2960892">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2960909">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2960932">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2960940">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2961705">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2961742">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2961811">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2961872">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2962076">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2962110">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2962141">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2962150">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2962338">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2962488">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2962701">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2956810">15. One Liners</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="article">
+<div class="titlepage">
+<div><div><h2 class="title" id="id2906013"></a></h2></div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#id2716138">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2903833">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2957074">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2957346">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2957478">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2957486">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2957764">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2957772">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2957935">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2957995">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2958097">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2958179">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2958358">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2958366">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2958459">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2958668">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2958758">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2958811">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2958820">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2959131">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2959268">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2959439">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2959531">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2959540">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2959626">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2959752">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2959838">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2959970">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2960077">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2960086">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2960272">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2960383">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2960623">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2960892">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2960909">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2960932">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2960940">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2961705">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2961742">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2961811">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2961872">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2962076">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2962110">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2962141">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2962150">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2962338">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2962488">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2962701">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2956810">15. One Liners</a></span></dt>
+</dl>
+</div>
+<div class="section" title="1. Introducing Linux">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2716138"></a>1. Introducing Linux</h2></div></div></div>
+<p id="ch1Introduction_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
+<p id="ch1Introduction_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
+<p id="ch1Introduction_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
+<p id="ch1Introduction_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
+<div class="section" title="1.1. Historical Background">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2903833"></a>1.1. Historical Background</h3></div></div></div>
+<div class="section" title="1.1.1. Events leading to the creation">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2903799"></a>1.1.1. Events leading to the creation</h4></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
+</ul></div>
+</div>
+<div class="section" title="1.1.2. The Creation of Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2957029"></a>1.1.2. The Creation of Linux</h4></div></div></div>
+<p id="ch1Introduction_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
+<p id="ch1Introduction_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
+</div>
+</div>
+<div class="section" title="1.2. Design and Implications">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2957074"></a>1.2. Design and Implications</h3></div></div></div>
+<p id="ch1Introduction_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
+<div class="section" title="1.2.1. User Interface">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2957098"></a>1.2.1. User Interface</h4></div></div></div>
+<p id="ch1Introduction_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
+<p id="ch1Introduction_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
+</div>
+<div class="section" title="1.2.2. Development">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2957152"></a>1.2.2. Development</h4></div></div></div>
+<p id="ch1Introduction_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
+<p id="ch1Introduction_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
+<p id="ch1Introduction_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
+</div>
+<div class="section" title="1.2.3. Community">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2957208"></a>1.2.3. Community</h4></div></div></div>
+<p id="ch1Introduction_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
+<p id="ch1Introduction_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
+<p id="ch1Introduction_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
+</div>
+<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2957253"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
+<p id="ch1Introduction_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
+</div>
+<div class="section" title="1.2.5. Programming on Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2957299"></a>1.2.5. Programming on Linux</h4></div></div></div>
+<p id="ch1Introduction_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
+<p id="ch1Introduction_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
+<p id="ch1Introduction_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
+</div>
+</div>
+<div class="section" title="1.3. Reasons for Using Linux">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2957346"></a>1.3. Reasons for Using Linux</h3></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch1Introduction_16"></a>Linux is free:</p></li></ul></div>
+<p id="ch1Introduction_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
+Most of all, Linux is free as in "free speech":
+The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch1Introduction_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
+<p id="ch1Introduction_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch1Introduction_1a"></a>Linux was made to keep on running:</p></li></ul></div>
+<p id="ch1Introduction_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch1Introduction_1c"></a>Linux is secure and versatile:</p></li></ul></div>
+<p id="ch1Introduction_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch1Introduction_1e"></a>Linux is scalable:</p></li></ul></div>
+<p id="ch1Introduction_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch1Introduction_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
+<p id="ch1Introduction_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
+</div>
+</div>
+<div class="section" title="2. Getting Started">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2957478"></a>2. Getting Started</h2></div></div></div>
+<div class="section" title="2.1. Logging in, activating the user interface and logging out">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2957486"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
+<p id="ch1Introduction_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
+<div class="section" title="2.1.1. Graphical Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2957517"></a>2.1.1. Graphical Mode</h4></div></div></div>
+<p id="ch1Introduction_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
+<p id="ch1Introduction_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
+It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
+<p id="ch1Introduction_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
+<p id="ch1Introduction_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
+<p id="ch1Introduction_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
+<p id="ch1Introduction_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
+<p id="ch1Introduction_29"></a>Another common form for a prompt is this one:
+[</p>
+<div class="reference">
+<div class="titlepage"><hr></div>user@host</div>
+<p> dir]</p>
+<p id="ch1Introduction_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
+<p id="ch1Introduction_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
+</div>
+<div class="section" title="2.1.2. Text Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2957675"></a>2.1.2. Text Mode</h4></div></div></div>
+<p id="ch1Introduction_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
+<p id="ch1Introduction_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
+reasons.</p>
+<p id="ch1Introduction_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
+<p id="ch1Introduction_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
+<p id="ch1Introduction_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
+</div>
+</div>
+</div>
+<div class="section" title="3. Basic Commands">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2957764"></a>3. Basic Commands</h2></div></div></div>
+<div class="section" title="3.1. ls">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2957772"></a>3.1. ls</h3></div></div></div>
+<p id="ch1Introduction_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
+<p id="ch1Introduction_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
+<p id="ch1Introduction_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch1Introduction_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
+<pre class="programlisting">$ ls
+jeeves.rst psmith.html blandings.html
+$ ls -l
+drwxr--r--   1 plum  editors   4096  jeeves
+-rw-r--r--   1 plum  editors  30405  psmith
+-r-xr-xr-x   1 plum  plum      8460  blandings</pre>
+<p id="ch1Introduction_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
+</div>
+<div class="section" title="3.2. date">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2957935"></a>3.2. date</h3></div></div></div>
+<p id="ch1Introduction_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
+<p id="ch1Introduction_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
+<pre class="programlisting">$date
+Tue Sep  8 12:01:45 IST 2009</pre>
+<p id="ch1Introduction_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
+<pre class="programlisting">$date --set="20040908 01:22"</pre>
+<p id="ch1Introduction_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
+<pre class="programlisting">$man date</pre>
+<p id="ch1Introduction_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
+</div>
+<div class="section" title="3.3. cd">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2957995"></a>3.3. cd</h3></div></div></div>
+<p id="ch1Introduction_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
+<p id="ch1Introduction_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
+<p id="ch1Introduction_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
+<p id="ch1Introduction_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
+<p id="ch1Introduction_46"></a>Absolute paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch1Introduction_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch1Introduction_48"></a>For example to get to /boot/grub you would type:</p>
+<pre class="programlisting">$cd /boot/grub</pre>
+<p id="ch1Introduction_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
+<p id="ch1Introduction_4a"></a>Relative paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch1Introduction_4b"></a>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.</p>
+<p id="ch1Introduction_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
+<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch1Introduction_4d"></a>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.</p>
+</div>
+<div class="section" title="3.4. who">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2958097"></a>3.4. who</h3></div></div></div>
+<p id="ch1Introduction_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
+<p id="ch1Introduction_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
+<pre class="programlisting">$who
+beeblebrox tty7         2009-09-08 10:50 (:0)
+beeblebrox pts/0        2009-09-08 11:25 (:0.0)
+dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
+beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
+<p id="ch1Introduction_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
+<p id="ch1Introduction_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
+<pre class="programlisting">$man who</pre>
+<p id="ch1Introduction_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
+</div>
+<div class="section" title="3.5. mkdir">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2958179"></a>3.5. mkdir</h3></div></div></div>
+<p id="ch1Introduction_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
+<pre class="programlisting">$mkdir name_of_directory</pre>
+<p id="ch1Introduction_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
+<div class="section" title="3.5.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2958211"></a>3.5.1. Options</h4></div></div></div>
+<p id="ch1Introduction_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch1Introduction_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
+</div>
+<div class="section" title="3.5.2. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2958272"></a>3.5.2. Examples</h4></div></div></div>
+<p id="ch1Introduction_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
+<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
+<p id="ch1Introduction_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
+<p id="ch1Introduction_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
+<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
+<p id="ch1Introduction_5d"></a>This will create:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_5e"></a>tag</p></li>
+<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch1Introduction_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
+</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
+</div>
+</div>
+</div>
+<div class="section" title="4. Getting Help">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2958358"></a>4. Getting Help</h2></div></div></div>
+<div class="section" title="4.1. apropos and whatis">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2958366"></a>4.1. apropos and whatis</h3></div></div></div>
+<p id="ch1Introduction_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
+<pre class="programlisting">$ apropos grep
+egrep       egrep (1)       Search a file for a pattern using full regular expressions
+fgrep       fgrep (1)       Search a file for a fixed-character string
+fmlgrep     fmlgrep (1)     Search a file for a pattern
+grep        grep (1)        Search a file for a pattern
+gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
+nisgrep     nismatch (1)    Utilities for searching NIS+ tables
+pgrep       pgrep (1)       Find or signal a process by name or other attribute
+zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
+...</pre>
+<p id="ch1Introduction_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
+<p id="ch1Introduction_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
+<pre class="programlisting">$whatis ls
+ls (1)           - list directory contents</pre>
+<p id="ch1Introduction_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
+<p id="ch1Introduction_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
+<pre class="programlisting">$apropos browser
+gmusicbrowser (1)    - Jukebox for large collections of audio files
+infobrowser (1)      - read Info documents
+libsmbclient (7)     - An extension library for browsers and that               can be used...
+opera (1)            - a standards-compliant graphical Web browser
+sensible-browser (1) - sensible editing, paging, and web browsing
+smbtree (1)          - A text based smb network browser
+tvtk_doc (1)         - A GUI based TVTK documentation search browser.
+viewres (1)          - graphical class browser for Xt
+w3m (1)              - a text based Web browser and pager
+www-browser (1)      - a text based Web browser and pager
+...</pre>
+</div>
+<div class="section" title="4.2. man">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2958459"></a>4.2. man</h3></div></div></div>
+<p id="ch1Introduction_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
+<p id="ch1Introduction_66"></a>To read a manual page for a Unix command, one can use:</p>
+<pre class="programlisting">$ man &lt;command_name&gt;</pre>
+<p id="ch1Introduction_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
+<p id="ch1Introduction_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
+<pre class="programlisting">$man 3 printf</pre>
+<p id="ch1Introduction_69"></a>Another example:</p>
+<pre class="programlisting">$man man</pre>
+<p id="ch1Introduction_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
+<div class="section" title="4.2.1. Layout">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2958541"></a>4.2.1. Layout</h4></div></div></div>
+<p id="ch1Introduction_6b"></a>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:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch1Introduction_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch1Introduction_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch1Introduction_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch1Introduction_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch1Introduction_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch1Introduction_71"></a>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.</p>
+<p id="ch1Introduction_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
+<p id="ch1Introduction_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
+<p id="ch1Introduction_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
+<p id="ch1Introduction_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
+<p id="ch1Introduction_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
+</div>
+</div>
+<div class="section" title="4.3. info">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2958668"></a>4.3. info</h3></div></div></div>
+<p id="ch1Introduction_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
+<p id="ch1Introduction_78"></a>The syntax is</p>
+<pre class="programlisting">$ info &lt;command_name&gt;</pre>
+<p id="ch1Introduction_79"></a><span class="emphasis"><em>info</em></span> 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</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch1Introduction_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
+</div>
+<div class="section" title="4.4. --help">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2958758"></a>4.4. --help</h3></div></div></div>
+<p id="ch1Introduction_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
+<pre class="programlisting">$ userprompt@host: cat --help
+Usage: cat [OPTION] [FILE]...
+Concatenate FILE(s), or standard input, to standard output.
+
+  -A, --show-all           equivalent to -vET
+  -b, --number-nonblank    number nonempty output lines
+  -e                       equivalent to -vE
+  -E, --show-ends          display $ at end of each line
+  -n, --number             number all output lines
+  -s, --squeeze-blank      suppress repeated empty output lines
+  -t                       equivalent to -vT
+  -T, --show-tabs          display TAB characters as ^I
+  -u                       (ignored)
+  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
+  --help     display this help and exit
+  --version  output version information and exit
+
+With no FILE, or when FILE is -, read standard input.
+
+Examples:
+  cat f - g  Output f's contents, then standard input, then g's           contents.
+  cat        Copy standard input to standard output.
+
+Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
+</div>
+</div>
+<div class="section" title="5. Basic file handling">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2958811"></a>5. Basic file handling</h2></div></div></div>
+<div class="section" title="5.1. cp">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2958820"></a>5.1. cp</h3></div></div></div>
+<p id="ch1Introduction_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
+<div class="section" title="5.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2958837"></a>5.1.1. Usage</h4></div></div></div>
+<p id="ch1Introduction_82"></a>To copy a file to another file:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
+<p id="ch1Introduction_83"></a>To copy a file to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
+<p id="ch1Introduction_84"></a>To copy a directory to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
+SourceDirectory ... TargetDirectory</pre>
+</div>
+<div class="section" title="5.1.2. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2958871"></a>5.1.2. Flags</h4></div></div></div>
+<p id="ch1Introduction_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
+<p id="ch1Introduction_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
+<p id="ch1Introduction_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
+<p id="ch1Introduction_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_89"></a>The time of the last data modification and the time of the last access.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch1Introduction_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
+</div>
+<div class="section" title="5.1.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2958969"></a>5.1.3. Examples</h4></div></div></div>
+<p id="ch1Introduction_8d"></a>To make a copy of a file in the current directory, enter:</p>
+<pre class="programlisting">$ cp prog.c prog.bak</pre>
+<p id="ch1Introduction_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
+<p id="ch1Introduction_8f"></a>To copy a file in your current directory into another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
+<p id="ch1Introduction_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
+<p id="ch1Introduction_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
+<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
+<p id="ch1Introduction_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
+<p id="ch1Introduction_93"></a>To copy all the files in a directory to a new directory, enter:</p>
+<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
+<p id="ch1Introduction_94"></a>This copies only the files in the clients directory to the customers directory.</p>
+<p id="ch1Introduction_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch1Introduction_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch1Introduction_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
+<p id="ch1Introduction_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
+<p id="ch1Introduction_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
+<p id="ch1Introduction_9a"></a>To use pattern-matching characters to copy files, enter:</p>
+<pre class="programlisting">$ cp programs/*.py .</pre>
+<p id="ch1Introduction_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
+</div>
+</div>
+<div class="section" title="5.2. mv">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2959131"></a>5.2. mv</h3></div></div></div>
+<p id="ch1Introduction_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
+<div class="section" title="5.2.1. Conflicting existing file">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2959154"></a>5.2.1. Conflicting existing file</h4></div></div></div>
+<p id="ch1Introduction_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
+</div>
+<div class="section" title="5.2.2. Differences with copy and delete">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2959179"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
+<p id="ch1Introduction_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
+</div>
+<div class="section" title="5.2.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2959210"></a>5.2.3. Examples</h4></div></div></div>
+<pre class="programlisting">$ mv myfile mynewfilename    renames a file
+$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
+$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
+$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
+$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
+$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
+$ mv foo bar baz dir         moves multiple files to directory dir
+$ mv --help                  shows a very concise help about the                syntax of the command
+$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
+<p id="ch1Introduction_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
+<p id="ch1Introduction_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
+</div>
+</div>
+<div class="section" title="5.3. rm">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2959268"></a>5.3. rm</h3></div></div></div>
+<p id="ch1Introduction_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
+<p id="ch1Introduction_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
+<pre class="programlisting">$ rm -i foo
+remove foo? y</pre>
+<div class="section" title="5.3.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2959298"></a>5.3.1. Options</h4></div></div></div>
+<p id="ch1Introduction_a3"></a>Common options that rm accepts include:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch1Introduction_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
+<p id="ch1Introduction_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
+<p id="ch1Introduction_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
+<pre class="programlisting">xargs rm &lt; filelist</pre>
+<p id="ch1Introduction_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
+</div>
+<div class="section" title="5.3.2. Permissions">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2959399"></a>5.3.2. Permissions</h4></div></div></div>
+<p id="ch1Introduction_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
+<p id="ch1Introduction_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
+<p id="ch1Introduction_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
+</div>
+</div>
+</div>
+<div class="section" title="6. Command Line Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2959439"></a>6. Command Line Arguments</h2></div></div></div>
+<p id="ch1Introduction_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
+<p id="ch1Introduction_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
+<pre class="programlisting">rm file.s</pre>
+<p id="ch1Introduction_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
+<p id="ch1Introduction_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
+<p id="ch1Introduction_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
+<p id="ch1Introduction_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
+<p id="ch1Introduction_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
+</div>
+<div class="section" title="7. Basic Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2959531"></a>7. Basic Text Processing</h2></div></div></div>
+<div class="section" title="7.1. head">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2959540"></a>7.1. head</h3></div></div></div>
+<p id="ch1Introduction_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
+<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
+<p id="ch1Introduction_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
+<pre class="programlisting">$ head -n 20 filename</pre>
+<p id="ch1Introduction_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ head -n 5 foo*</pre>
+<p id="ch1Introduction_b9"></a>Some versions omit the n and just let you say -5.</p>
+<div class="section" title="7.1.1. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2959590"></a>7.1.1. Flags</h4></div></div></div>
+<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
+<p id="ch1Introduction_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
+<p id="ch1Introduction_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
+<pre class="programlisting">sed 5q foo</pre>
+<p id="ch1Introduction_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
+</div>
+</div>
+<div class="section" title="7.2. tail">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2959626"></a>7.2. tail</h3></div></div></div>
+<p id="ch1Introduction_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
+<p id="ch1Introduction_be"></a>The command-syntax is:</p>
+<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
+<p id="ch1Introduction_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
+<pre class="programlisting">$ tail -n 20 filename</pre>
+<p id="ch1Introduction_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ tail -c 15 foo*</pre>
+<p id="ch1Introduction_c1"></a>This example shows all lines of filename from the second line onwards:</p>
+<pre class="programlisting">$ tail -n +2 filename</pre>
+<p id="ch1Introduction_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
+<pre class="programlisting">$ tail -20 filename
+$ tail -50c filename</pre>
+<p id="ch1Introduction_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
+<div class="section" title="7.2.1. File monitoring">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2959704"></a>7.2.1. File monitoring</h4></div></div></div>
+<p id="ch1Introduction_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
+<pre class="programlisting">$ tail -f /var/adm/messages</pre>
+<p id="ch1Introduction_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
+<p id="ch1Introduction_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
+</div>
+</div>
+<div class="section" title="7.3. cut">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2959752"></a>7.3. cut</h3></div></div></div>
+<p id="ch1Introduction_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
+<p id="ch1Introduction_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
+<p id="ch1Introduction_c9"></a>Assuming a file named file containing the lines:</p>
+<pre class="programlisting">foo:bar:baz:qux:quux
+one:two:three:four:five:six:seven
+alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+<p id="ch1Introduction_ca"></a>To output the fourth through tenth characters of each line:</p>
+<pre class="programlisting">$ cut -c 4-10 file</pre>
+<p id="ch1Introduction_cb"></a>This gives the output:</p>
+<pre class="programlisting">:bar:ba
+:two:th
+ha:beta</pre>
+<p id="ch1Introduction_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
+<pre class="programlisting">$ cut -d : -f 5- file</pre>
+<p id="ch1Introduction_cd"></a>This gives the output:</p>
+<pre class="programlisting">quux
+five:six:seven
+epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+</div>
+<div class="section" title="7.4. paste">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2959838"></a>7.4. paste</h3></div></div></div>
+<p id="ch1Introduction_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
+<p id="ch1Introduction_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
+<pre class="programlisting">$ paste who where when &gt; www</pre>
+<p id="ch1Introduction_d0"></a>If the files contain:</p>
+<table summary="paste" border="1"><colgroup>
+<col width="11">
+<col width="12">
+<col width="12">
+</colgroup></table>
+<p id="ch1Introduction_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
+<pre class="programlisting">Batman            GothamCity       January 3
+Trillian          Andromeda        February 4
+Jeeves            London           March 19</pre>
+</div>
+</div>
+<div class="section" title="8. Shell Meta Characters">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2959970"></a>8. Shell Meta Characters</h2></div></div></div>
+<p id="ch1Introduction_de"></a>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.</p>
+<p id="ch1Introduction_df"></a>The shell meta characters include:</p>
+<p id="ch1Introduction_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
+<p id="ch1Introduction_e1"></a>Different shells may differ in the meta characters recognized.</p>
+<p id="ch1Introduction_e2"></a>As an example,</p>
+<pre class="programlisting">$ ls file.*</pre>
+<p id="ch1Introduction_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
+<pre class="programlisting">$ ls file.?</pre>
+<p id="ch1Introduction_e4"></a>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:</p>
+<pre class="programlisting">$ more c*</pre>
+<p id="ch1Introduction_e5"></a>because the c* matches that long file name.</p>
+<p id="ch1Introduction_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
+<pre class="programlisting">$ rm ??more</pre>
+<p id="ch1Introduction_e7"></a>or:</p>
+<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
+<p id="ch1Introduction_e8"></a>or:</p>
+<pre class="programlisting">$ rm ''*|more''</pre>
+</div>
+<div class="section" title="9. Looking At Files">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2960077"></a>9. Looking At Files</h2></div></div></div>
+<div class="section" title="9.1. cat">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2960086"></a>9.1. cat</h3></div></div></div>
+<p id="ch1Introduction_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
+<p id="ch1Introduction_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
+<p id="ch1Introduction_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
+<div class="section" title="9.1.1. Jargon File Definition">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2960129"></a>9.1.1. Jargon File Definition</h4></div></div></div>
+<p id="ch1Introduction_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
+<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
+     pause (syn. blast).
+
+2. By extension, to dump large amounts of data at an unprepared target or
+     with no intention of browsing it carefully. Usage: considered silly.
+     Rare outside Unix sites. See also dd, BLT.
+
+     Among Unix fans, *cat(1)* is considered an excellent example of
+     user-interface design, because it delivers the file contents without
+     such verbosity as spacing or headers between the files, and because
+     it does not require the files to consist of lines of text, but works
+     with any sort of data.
+
+     Among Unix critics, *cat(1)* is considered the canonical example of
+     bad user-interface design, because of its woefully unobvious name.
+     It is far more often used to blast a single file to standard output
+     than to concatenate two or more files. The name cat for the former
+     operation is just as unintuitive as, say, LISP's cdr.
+
+     Of such oppositions are holy wars made...</pre>
+</div>
+<div class="section" title="9.1.2. Useless Use of 'cat'">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2960168"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
+<p id="ch1Introduction_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
+<p id="ch1Introduction_ee"></a>Nevertheless one sees people doing:</p>
+<pre class="programlisting">$ cat file | some_command and its args ...</pre>
+<p id="ch1Introduction_ef"></a>instead of the equivalent and cheaper:</p>
+<pre class="programlisting">&lt;file some_command and its args ...</pre>
+<p id="ch1Introduction_f0"></a>or (equivalently and more classically):</p>
+<pre class="programlisting">some_command and its args ... &lt;file</pre>
+<p id="ch1Introduction_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
+<p id="ch1Introduction_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
+</div>
+<div class="section" title="9.1.3. zcat">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2960239"></a>9.1.3. zcat</h4></div></div></div>
+<p id="ch1Introduction_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
+</div>
+</div>
+<div class="section" title="9.2. more">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2960272"></a>9.2. more</h3></div></div></div>
+<p id="ch1Introduction_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
+<div class="section" title="9.2.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2960292"></a>9.2.1. Usage</h4></div></div></div>
+<p id="ch1Introduction_f5"></a>The command-syntax is:</p>
+<pre class="programlisting">$ more [options] [file_name]</pre>
+<p id="ch1Introduction_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
+<p id="ch1Introduction_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
+<p id="ch1Introduction_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
+<p id="ch1Introduction_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
+</div>
+</div>
+<div class="section" title="9.3. less">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2960383"></a>9.3. less</h3></div></div></div>
+<p id="ch1Introduction_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
+<div class="section" title="9.3.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2960411"></a>9.3.1. Usage</h4></div></div></div>
+<p id="ch1Introduction_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
+<p id="ch1Introduction_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
+<p id="ch1Introduction_fd"></a>The command-syntax is:</p>
+<pre class="programlisting">$ less [options] file_name</pre>
+</div>
+<div class="section" title="9.3.2. Frequently Used Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2960466"></a>9.3.2. Frequently Used Options</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_ff"></a>-I: Case-insensitive searches.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_103"></a>-?: Shows help.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.3. Frequently Used Commands">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2960518"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_105"></a>[Space bar]: Next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_106"></a>b: Previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_10a"></a>'^ or g: Go to start of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_10b"></a>'$ or G: Go to end of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_10d"></a>=: File information.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_10e"></a>h: Help.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_10f"></a>q: Quit.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.4. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2960608"></a>9.3.4. Examples</h4></div></div></div>
+<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
+$ less +F /var/log/mail.log              #Follow mode for log
+$ file * | less                          #Easier file analysis.
+$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
+</div>
+</div>
+</div>
+<div class="section" title="10. Directory Structure">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2960623"></a>10. Directory Structure</h2></div></div></div>
+<p id="ch1Introduction_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
+<p id="ch1Introduction_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
+<table summary="Directory Structure" border="1"><colgroup>
+<col width="15">
+<col width="48">
+</colgroup></table>
+<div class="section" title="10.1. man hier">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2960892"></a>10.1. man hier</h3></div></div></div>
+<p id="ch1Introduction_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
+<pre class="programlisting">$ man hier</pre>
+</div>
+<div class="section" title="10.2. ls -l">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2960909"></a>10.2. ls -l</h3></div></div></div>
+<p id="ch1Introduction_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
+<pre class="programlisting">$ ls -l</pre>
+<p id="ch1Introduction_138"></a>This can be done after entering the required directory.</p>
+</div>
+</div>
+<div class="section" title="11. Permissions and Ownership">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2960932"></a>11. Permissions and Ownership</h2></div></div></div>
+<div class="section" title="11.1. chmod">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2960940"></a>11.1. chmod</h3></div></div></div>
+<p id="ch1Introduction_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
+<div class="section" title="11.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2960966"></a>11.1.1. Usage</h4></div></div></div>
+<p id="ch1Introduction_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
+<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
+<p id="ch1Introduction_13b"></a>To view what the permissions currently are, type:</p>
+<pre class="programlisting">$ ls -l file</pre>
+</div>
+<div class="section" title="11.1.2. Command line options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2960994"></a>11.1.2. Command line options</h4></div></div></div>
+<p id="ch1Introduction_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
+</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2961030"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
+<p id="ch1Introduction_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
+<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
+<p id="ch1Introduction_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="8">
+<col width="45">
+</colgroup></table>
+<p id="ch1Introduction_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="54">
+</colgroup></table>
+<p id="ch1Introduction_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="5">
+<col width="14">
+<col width="48">
+</colgroup></table>
+<p id="ch1Introduction_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
+</div>
+<div class="section" title="11.1.2.2. Symbolic examples">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2961577"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
+<p id="ch1Introduction_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
+<pre class="programlisting">$ chmod ug+rw mydir
+$ ls -ld mydir
+drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
+<p id="ch1Introduction_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
+<pre class="programlisting">$ chmod a-w myfile
+$ ls -l myfile
+-r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
+<p id="ch1Introduction_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
+<pre class="programlisting">$ chmod ug=rx mydir
+$ ls -ld mydir
+dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
+</div>
+<div class="section" title="11.1.2.3. Octal numbers">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2961618"></a>11.1.2.3. Octal numbers</h5></div></div></div>
+<p id="ch1Introduction_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
+<pre class="programlisting">$ chmod 664 myfile
+$ ls -l myfile
+-rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
+<p id="ch1Introduction_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
+<pre class="programlisting">$ chmod 0664 myfile</pre>
+</div>
+<div class="section" title="11.1.2.4. Special modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2961657"></a>11.1.2.4. Special modes</h5></div></div></div>
+<p id="ch1Introduction_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
+<p id="ch1Introduction_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="12. Redirection and Piping">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2961705"></a>12. Redirection and Piping</h2></div></div></div>
+<p id="ch1Introduction_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
+<p id="ch1Introduction_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
+<div class="section" title="12.1. Redirecting standard input and standard output">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2961742"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
+<p id="ch1Introduction_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
+<pre class="programlisting">$ command1 &gt; file1</pre>
+<p id="ch1Introduction_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
+<pre class="programlisting">$ command1 &lt; file1</pre>
+<p id="ch1Introduction_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
+<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
+<p id="ch1Introduction_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
+</div>
+<div class="section" title="12.2. Piping">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2961811"></a>12.2. Piping</h3></div></div></div>
+<p id="ch1Introduction_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
+A pipeline of three programs run on a text terminal:</p>
+<pre class="programlisting">$ command1 | command2</pre>
+<p id="ch1Introduction_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
+<p id="ch1Introduction_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
+<pre class="programlisting">$ command1 &gt; tempfile
+$ command2 &lt; tempfile
+$ rm tempfile</pre>
+<p id="ch1Introduction_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
+<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
+<p id="ch1Introduction_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
+</div>
+<div class="section" title="12.3. Redirecting to and from the standard file handles">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2961872"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
+<p id="ch1Introduction_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
+<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
+<col width="12">
+<col width="13">
+<col width="24">
+</colgroup></table>
+<p id="ch1Introduction_18d"></a>For example:</p>
+<pre class="programlisting">$ command1 2&gt; file1</pre>
+<p id="ch1Introduction_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
+<p id="ch1Introduction_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
+<p id="ch1Introduction_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
+<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
+<p id="ch1Introduction_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
+<p id="ch1Introduction_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
+<p id="ch1Introduction_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
+<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
+<p id="ch1Introduction_194"></a>A simplified form of the command:</p>
+<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
+<p id="ch1Introduction_195"></a>is:</p>
+<pre class="programlisting">$ command &amp;&gt;file</pre>
+<p id="ch1Introduction_196"></a>or:</p>
+<pre class="programlisting">$command &gt;&amp;file</pre>
+</div>
+<div class="section" title="12.4. Chained pipelines">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2962076"></a>12.4. Chained pipelines</h3></div></div></div>
+<p id="ch1Introduction_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
+<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
+<p id="ch1Introduction_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
+</div>
+<div class="section" title="12.5. Redirect to multiple outputs">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2962110"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
+<p id="ch1Introduction_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
+<pre class="programlisting">$ ls -lrt | tee xyz</pre>
+<p id="ch1Introduction_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
+</div>
+</div>
+<div class="section" title="13. More Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2962141"></a>13. More Text Processing</h2></div></div></div>
+<div class="section" title="13.1. grep">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2962150"></a>13.1. grep</h3></div></div></div>
+<p id="ch1Introduction_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
+<div class="section" title="13.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2962181"></a>13.1.1. Usage</h4></div></div></div>
+<p id="ch1Introduction_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
+<pre class="programlisting">$ grep apple fruitlist.txt</pre>
+<p id="ch1Introduction_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
+<p id="ch1Introduction_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
+<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
+<p id="ch1Introduction_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
+<p id="ch1Introduction_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
+<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
+<p id="ch1Introduction_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
+<div class="section" title="13.1.1.1. Variations">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2962259"></a>13.1.1.1. Variations</h5></div></div></div>
+<p id="ch1Introduction_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
+<p id="ch1Introduction_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
+<p id="ch1Introduction_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
+</div>
+</div>
+</div>
+<div class="section" title="13.2. tr">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2962338"></a>13.2. tr</h3></div></div></div>
+<p id="ch1Introduction_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
+<p id="ch1Introduction_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
+<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
+<p id="ch1Introduction_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
+<p id="ch1Introduction_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
+<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
+<p id="ch1Introduction_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
+<p id="ch1Introduction_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
+<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
+<p id="ch1Introduction_1ab"></a>therefore removes all non-alphanumeric characters.</p>
+<p id="ch1Introduction_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
+<pre class="programlisting">$ tr -s '\n' '\n'</pre>
+<p id="ch1Introduction_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
+<p id="ch1Introduction_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
+<pre class="programlisting">$ tr -d '\r'</pre>
+<p id="ch1Introduction_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
+<p id="ch1Introduction_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
+</div>
+</div>
+<div class="section" title="14. Elementary Regex">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2962488"></a>14. Elementary Regex</h2></div></div></div>
+<p id="ch1Introduction_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
+<p id="ch1Introduction_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
+<p id="ch1Introduction_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
+<p id="ch1Introduction_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
+<table summary="Elementary Regex" border="1"><colgroup>
+<col width="13">
+<col width="60">
+</colgroup></table>
+<div class="section" title="14.1. Lazy quantification">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2962701"></a>14.1. Lazy quantification</h3></div></div></div>
+<p id="ch1Introduction_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
+<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
+<p id="ch1Introduction_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
+<p id="ch1Introduction_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
+</div>
+</div>
+<div class="section" title="15. One Liners">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2956810"></a>15. One Liners</h2></div></div></div>
+<p id="ch1Introduction_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
+<p id="ch1Introduction_1cd"></a>The one liner can be</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem"><p id="ch1Introduction_1ce"></a>An expression written in the language of the shell.</p></li>
+<li class="listitem"><p id="ch1Introduction_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
+<li class="listitem"><p id="ch1Introduction_1d0"></a>The invocation of a compiler together with source to compile and
+instructions for executing the compiled program.</p></li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch1Introduction_1d1"></a>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.</p>
+<p id="ch1Introduction_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
+<p id="ch1Introduction_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
+<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
+<p id="ch1Introduction_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
+<p id="ch1Introduction_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
+<p id="ch1Introduction_1d6"></a>Here are the first few of them:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<p id="ch1Introduction_1d7"></a>Print the total number of input lines:</p>
+<p id="ch1Introduction_1d8"></a>END { print NR }</p>
+</li>
+<li class="listitem">
+<p id="ch1Introduction_1d9"></a>Print the tenth input line:</p>
+<p id="ch1Introduction_1da"></a>NR == 10</p>
+</li>
+<li class="listitem">
+<p id="ch1Introduction_1db"></a>Print the last field of every input line:</p>
+<p id="ch1Introduction_1dc"></a>{ print $NF }</p>
+</li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch1Introduction_1dd"></a>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.</p>
+<p id="ch1Introduction_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
+<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
+*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
+<p id="ch1Introduction_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
+<p id="ch1Introduction_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
+<pre class="programlisting">$ prog foo 'f??'; echo $?
+
+$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
+<p id="ch1Introduction_1e1"></a>Here is a one line shell script to show directories:</p>
+<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
+</div>
+</div>
+</div></body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/ch2intro.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1138 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Intro</title>
+<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
+<script type="text/javascript" src="/review/support/jquery-min.js"></script>
+<script type="text/javascript" src="/review/support/form.js"></script>
+<script type="text/javascript" src="/review/support/hsbook.js"></script>
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch2intro">
+<div class="titlepage"></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="article"><a href="#id2931272"></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2741397">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2929092">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2982331">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2982596">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2982723">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2982731">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2983003">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2983011">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2983169">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2983227">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2983324">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2983404">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2983578">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2983586">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2983667">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2983870">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2983961">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2984014">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2984023">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2984334">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2984483">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2984653">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2984746">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2984755">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2984842">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2984970">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2985055">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2985190">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2985297">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2985305">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2985493">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2985608">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2985848">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2986117">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2986133">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2986156">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2986165">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2986929">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2986966">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2987035">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2987096">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2987301">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2987335">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2987365">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2987374">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2987563">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2987713">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2988062">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2988138">15. One Liners</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="article">
+<div class="titlepage">
+<div><div><h2 class="title" id="id2931272"></a></h2></div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#id2741397">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2929092">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2982331">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2982596">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2982723">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2982731">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2983003">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2983011">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2983169">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2983227">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2983324">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2983404">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2983578">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2983586">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2983667">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2983870">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2983961">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2984014">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2984023">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2984334">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2984483">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2984653">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2984746">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2984755">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2984842">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2984970">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2985055">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2985190">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2985297">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2985305">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2985493">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2985608">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2985848">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2986117">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2986133">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2986156">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2986165">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2986929">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2986966">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2987035">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2987096">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2987301">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2987335">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2987365">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2987374">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2987563">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2987713">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2988062">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2988138">15. One Liners</a></span></dt>
+</dl>
+</div>
+<div class="section" title="1. Introducing Linux">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2741397"></a>1. Introducing Linux</h2></div></div></div>
+<p id="ch2intro_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
+<p id="ch2intro_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
+<p id="ch2intro_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
+<p id="ch2intro_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
+<div class="section" title="1.1. Historical Background">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2929092"></a>1.1. Historical Background</h3></div></div></div>
+<div class="section" title="1.1.1. Events leading to the creation">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2928965"></a>1.1.1. Events leading to the creation</h4></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
+</ul></div>
+</div>
+<div class="section" title="1.1.2. The Creation of Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2982286"></a>1.1.2. The Creation of Linux</h4></div></div></div>
+<p id="ch2intro_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
+<p id="ch2intro_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
+</div>
+</div>
+<div class="section" title="1.2. Design and Implications">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2982331"></a>1.2. Design and Implications</h3></div></div></div>
+<p id="ch2intro_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
+<div class="section" title="1.2.1. User Interface">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2982356"></a>1.2.1. User Interface</h4></div></div></div>
+<p id="ch2intro_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
+<p id="ch2intro_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
+</div>
+<div class="section" title="1.2.2. Development">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2982408"></a>1.2.2. Development</h4></div></div></div>
+<p id="ch2intro_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
+<p id="ch2intro_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
+<p id="ch2intro_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
+</div>
+<div class="section" title="1.2.3. Community">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2982463"></a>1.2.3. Community</h4></div></div></div>
+<p id="ch2intro_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
+<p id="ch2intro_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
+<p id="ch2intro_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
+</div>
+<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2982506"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
+<p id="ch2intro_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
+</div>
+<div class="section" title="1.2.5. Programming on Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2982552"></a>1.2.5. Programming on Linux</h4></div></div></div>
+<p id="ch2intro_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
+<p id="ch2intro_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
+<p id="ch2intro_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
+</div>
+</div>
+<div class="section" title="1.3. Reasons for Using Linux">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2982596"></a>1.3. Reasons for Using Linux</h3></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch2intro_16"></a>Linux is free:</p></li></ul></div>
+<p id="ch2intro_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
+Most of all, Linux is free as in "free speech":
+The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch2intro_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
+<p id="ch2intro_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch2intro_1a"></a>Linux was made to keep on running:</p></li></ul></div>
+<p id="ch2intro_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch2intro_1c"></a>Linux is secure and versatile:</p></li></ul></div>
+<p id="ch2intro_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch2intro_1e"></a>Linux is scalable:</p></li></ul></div>
+<p id="ch2intro_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch2intro_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
+<p id="ch2intro_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
+</div>
+</div>
+<div class="section" title="2. Getting Started">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2982723"></a>2. Getting Started</h2></div></div></div>
+<div class="section" title="2.1. Logging in, activating the user interface and logging out">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2982731"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
+<p id="ch2intro_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
+<div class="section" title="2.1.1. Graphical Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2982761"></a>2.1.1. Graphical Mode</h4></div></div></div>
+<p id="ch2intro_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
+<p id="ch2intro_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
+It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
+<p id="ch2intro_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
+<p id="ch2intro_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
+<p id="ch2intro_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
+<p id="ch2intro_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
+<p id="ch2intro_29"></a>Another common form for a prompt is this one:
+[</p>
+<div class="reference">
+<div class="titlepage"><hr></div>user@host</div>
+<p> dir]</p>
+<p id="ch2intro_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
+<p id="ch2intro_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
+</div>
+<div class="section" title="2.1.2. Text Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2982916"></a>2.1.2. Text Mode</h4></div></div></div>
+<p id="ch2intro_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
+<p id="ch2intro_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
+reasons.</p>
+<p id="ch2intro_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
+<p id="ch2intro_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
+<p id="ch2intro_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
+</div>
+</div>
+</div>
+<div class="section" title="3. Basic Commands">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2983003"></a>3. Basic Commands</h2></div></div></div>
+<div class="section" title="3.1. ls">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2983011"></a>3.1. ls</h3></div></div></div>
+<p id="ch2intro_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
+<p id="ch2intro_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
+<p id="ch2intro_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch2intro_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
+<pre class="programlisting">$ ls
+jeeves.rst psmith.html blandings.html
+$ ls -l
+drwxr--r--   1 plum  editors   4096  jeeves
+-rw-r--r--   1 plum  editors  30405  psmith
+-r-xr-xr-x   1 plum  plum      8460  blandings</pre>
+<p id="ch2intro_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
+</div>
+<div class="section" title="3.2. date">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2983169"></a>3.2. date</h3></div></div></div>
+<p id="ch2intro_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
+<p id="ch2intro_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
+<pre class="programlisting">$date
+Tue Sep  8 12:01:45 IST 2009</pre>
+<p id="ch2intro_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
+<pre class="programlisting">$date --set="20040908 01:22"</pre>
+<p id="ch2intro_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
+<pre class="programlisting">$man date</pre>
+<p id="ch2intro_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
+</div>
+<div class="section" title="3.3. cd">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2983227"></a>3.3. cd</h3></div></div></div>
+<p id="ch2intro_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
+<p id="ch2intro_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
+<p id="ch2intro_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
+<p id="ch2intro_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
+<p id="ch2intro_46"></a>Absolute paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch2intro_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch2intro_48"></a>For example to get to /boot/grub you would type:</p>
+<pre class="programlisting">$cd /boot/grub</pre>
+<p id="ch2intro_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
+<p id="ch2intro_4a"></a>Relative paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch2intro_4b"></a>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.</p>
+<p id="ch2intro_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
+<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch2intro_4d"></a>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.</p>
+</div>
+<div class="section" title="3.4. who">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2983324"></a>3.4. who</h3></div></div></div>
+<p id="ch2intro_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
+<p id="ch2intro_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
+<pre class="programlisting">$who
+beeblebrox tty7         2009-09-08 10:50 (:0)
+beeblebrox pts/0        2009-09-08 11:25 (:0.0)
+dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
+beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
+<p id="ch2intro_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
+<p id="ch2intro_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
+<pre class="programlisting">$man who</pre>
+<p id="ch2intro_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
+</div>
+<div class="section" title="3.5. mkdir">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2983404"></a>3.5. mkdir</h3></div></div></div>
+<p id="ch2intro_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
+<pre class="programlisting">$mkdir name_of_directory</pre>
+<p id="ch2intro_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
+<div class="section" title="3.5.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2983435"></a>3.5.1. Options</h4></div></div></div>
+<p id="ch2intro_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch2intro_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
+</div>
+<div class="section" title="3.5.2. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2983494"></a>3.5.2. Examples</h4></div></div></div>
+<p id="ch2intro_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
+<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
+<p id="ch2intro_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
+<p id="ch2intro_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
+<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
+<p id="ch2intro_5d"></a>This will create:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_5e"></a>tag</p></li>
+<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch2intro_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
+</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
+</div>
+</div>
+</div>
+<div class="section" title="4. Getting Help">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2983578"></a>4. Getting Help</h2></div></div></div>
+<div class="section" title="4.1. apropos and whatis">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2983586"></a>4.1. apropos and whatis</h3></div></div></div>
+<p id="ch2intro_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
+<pre class="programlisting">$ apropos grep
+egrep       egrep (1)       Search a file for a pattern using full regular expressions
+fgrep       fgrep (1)       Search a file for a fixed-character string
+fmlgrep     fmlgrep (1)     Search a file for a pattern
+grep        grep (1)        Search a file for a pattern
+gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
+nisgrep     nismatch (1)    Utilities for searching NIS+ tables
+pgrep       pgrep (1)       Find or signal a process by name or other attribute
+zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
+...</pre>
+<p id="ch2intro_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
+<p id="ch2intro_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
+<pre class="programlisting">$whatis ls
+ls (1)           - list directory contents</pre>
+<p id="ch2intro_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
+<p id="ch2intro_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
+<pre class="programlisting">$apropos browser
+gmusicbrowser (1)    - Jukebox for large collections of audio files
+infobrowser (1)      - read Info documents
+libsmbclient (7)     - An extension library for browsers and that               can be used...
+opera (1)            - a standards-compliant graphical Web browser
+sensible-browser (1) - sensible editing, paging, and web browsing
+smbtree (1)          - A text based smb network browser
+tvtk_doc (1)         - A GUI based TVTK documentation search browser.
+viewres (1)          - graphical class browser for Xt
+w3m (1)              - a text based Web browser and pager
+www-browser (1)      - a text based Web browser and pager
+...</pre>
+</div>
+<div class="section" title="4.2. man">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2983667"></a>4.2. man</h3></div></div></div>
+<p id="ch2intro_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
+<p id="ch2intro_66"></a>To read a manual page for a Unix command, one can use:</p>
+<pre class="programlisting">$ man &lt;command_name&gt;</pre>
+<p id="ch2intro_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
+<p id="ch2intro_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
+<pre class="programlisting">$man 3 printf</pre>
+<p id="ch2intro_69"></a>Another example:</p>
+<pre class="programlisting">$man man</pre>
+<p id="ch2intro_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
+<div class="section" title="4.2.1. Layout">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2983747"></a>4.2.1. Layout</h4></div></div></div>
+<p id="ch2intro_6b"></a>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:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch2intro_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch2intro_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch2intro_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch2intro_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch2intro_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch2intro_71"></a>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.</p>
+<p id="ch2intro_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
+<p id="ch2intro_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
+<p id="ch2intro_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
+<p id="ch2intro_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
+<p id="ch2intro_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
+</div>
+</div>
+<div class="section" title="4.3. info">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2983870"></a>4.3. info</h3></div></div></div>
+<p id="ch2intro_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
+<p id="ch2intro_78"></a>The syntax is</p>
+<pre class="programlisting">$ info &lt;command_name&gt;</pre>
+<p id="ch2intro_79"></a><span class="emphasis"><em>info</em></span> 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</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch2intro_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
+</div>
+<div class="section" title="4.4. --help">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2983961"></a>4.4. --help</h3></div></div></div>
+<p id="ch2intro_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
+<pre class="programlisting">$ userprompt@host: cat --help
+Usage: cat [OPTION] [FILE]...
+Concatenate FILE(s), or standard input, to standard output.
+
+  -A, --show-all           equivalent to -vET
+  -b, --number-nonblank    number nonempty output lines
+  -e                       equivalent to -vE
+  -E, --show-ends          display $ at end of each line
+  -n, --number             number all output lines
+  -s, --squeeze-blank      suppress repeated empty output lines
+  -t                       equivalent to -vT
+  -T, --show-tabs          display TAB characters as ^I
+  -u                       (ignored)
+  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
+  --help     display this help and exit
+  --version  output version information and exit
+
+With no FILE, or when FILE is -, read standard input.
+
+Examples:
+  cat f - g  Output f's contents, then standard input, then g's           contents.
+  cat        Copy standard input to standard output.
+
+Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
+</div>
+</div>
+<div class="section" title="5. Basic file handling">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2984014"></a>5. Basic file handling</h2></div></div></div>
+<div class="section" title="5.1. cp">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2984023"></a>5.1. cp</h3></div></div></div>
+<p id="ch2intro_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
+<div class="section" title="5.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2984040"></a>5.1.1. Usage</h4></div></div></div>
+<p id="ch2intro_82"></a>To copy a file to another file:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
+<p id="ch2intro_83"></a>To copy a file to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
+<p id="ch2intro_84"></a>To copy a directory to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
+SourceDirectory ... TargetDirectory</pre>
+</div>
+<div class="section" title="5.1.2. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2984074"></a>5.1.2. Flags</h4></div></div></div>
+<p id="ch2intro_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
+<p id="ch2intro_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
+<p id="ch2intro_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
+<p id="ch2intro_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_89"></a>The time of the last data modification and the time of the last access.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch2intro_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
+</div>
+<div class="section" title="5.1.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2984172"></a>5.1.3. Examples</h4></div></div></div>
+<p id="ch2intro_8d"></a>To make a copy of a file in the current directory, enter:</p>
+<pre class="programlisting">$ cp prog.c prog.bak</pre>
+<p id="ch2intro_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
+<p id="ch2intro_8f"></a>To copy a file in your current directory into another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
+<p id="ch2intro_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
+<p id="ch2intro_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
+<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
+<p id="ch2intro_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
+<p id="ch2intro_93"></a>To copy all the files in a directory to a new directory, enter:</p>
+<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
+<p id="ch2intro_94"></a>This copies only the files in the clients directory to the customers directory.</p>
+<p id="ch2intro_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch2intro_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch2intro_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
+<p id="ch2intro_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
+<p id="ch2intro_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
+<p id="ch2intro_9a"></a>To use pattern-matching characters to copy files, enter:</p>
+<pre class="programlisting">$ cp programs/*.py .</pre>
+<p id="ch2intro_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
+</div>
+</div>
+<div class="section" title="5.2. mv">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2984334"></a>5.2. mv</h3></div></div></div>
+<p id="ch2intro_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
+<div class="section" title="5.2.1. Conflicting existing file">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2984358"></a>5.2.1. Conflicting existing file</h4></div></div></div>
+<p id="ch2intro_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
+</div>
+<div class="section" title="5.2.2. Differences with copy and delete">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2984377"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
+<p id="ch2intro_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
+</div>
+<div class="section" title="5.2.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2984423"></a>5.2.3. Examples</h4></div></div></div>
+<pre class="programlisting">$ mv myfile mynewfilename    renames a file
+$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
+$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
+$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
+$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
+$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
+$ mv foo bar baz dir         moves multiple files to directory dir
+$ mv --help                  shows a very concise help about the                syntax of the command
+$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
+<p id="ch2intro_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
+<p id="ch2intro_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
+</div>
+</div>
+<div class="section" title="5.3. rm">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2984483"></a>5.3. rm</h3></div></div></div>
+<p id="ch2intro_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
+<p id="ch2intro_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
+<pre class="programlisting">$ rm -i foo
+remove foo? y</pre>
+<div class="section" title="5.3.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2984512"></a>5.3.1. Options</h4></div></div></div>
+<p id="ch2intro_a3"></a>Common options that rm accepts include:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch2intro_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
+<p id="ch2intro_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
+<p id="ch2intro_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
+<pre class="programlisting">xargs rm &lt; filelist</pre>
+<p id="ch2intro_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
+</div>
+<div class="section" title="5.3.2. Permissions">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2984613"></a>5.3.2. Permissions</h4></div></div></div>
+<p id="ch2intro_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
+<p id="ch2intro_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
+<p id="ch2intro_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
+</div>
+</div>
+</div>
+<div class="section" title="6. Command Line Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2984653"></a>6. Command Line Arguments</h2></div></div></div>
+<p id="ch2intro_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
+<p id="ch2intro_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
+<pre class="programlisting">rm file.s</pre>
+<p id="ch2intro_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
+<p id="ch2intro_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
+<p id="ch2intro_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
+<p id="ch2intro_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
+<p id="ch2intro_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
+</div>
+<div class="section" title="7. Basic Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2984746"></a>7. Basic Text Processing</h2></div></div></div>
+<div class="section" title="7.1. head">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2984755"></a>7.1. head</h3></div></div></div>
+<p id="ch2intro_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
+<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
+<p id="ch2intro_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
+<pre class="programlisting">$ head -n 20 filename</pre>
+<p id="ch2intro_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ head -n 5 foo*</pre>
+<p id="ch2intro_b9"></a>Some versions omit the n and just let you say -5.</p>
+<div class="section" title="7.1.1. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2984806"></a>7.1.1. Flags</h4></div></div></div>
+<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
+<p id="ch2intro_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
+<p id="ch2intro_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
+<pre class="programlisting">sed 5q foo</pre>
+<p id="ch2intro_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
+</div>
+</div>
+<div class="section" title="7.2. tail">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2984842"></a>7.2. tail</h3></div></div></div>
+<p id="ch2intro_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
+<p id="ch2intro_be"></a>The command-syntax is:</p>
+<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
+<p id="ch2intro_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
+<pre class="programlisting">$ tail -n 20 filename</pre>
+<p id="ch2intro_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ tail -c 15 foo*</pre>
+<p id="ch2intro_c1"></a>This example shows all lines of filename from the second line onwards:</p>
+<pre class="programlisting">$ tail -n +2 filename</pre>
+<p id="ch2intro_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
+<pre class="programlisting">$ tail -20 filename
+$ tail -50c filename</pre>
+<p id="ch2intro_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
+<div class="section" title="7.2.1. File monitoring">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2984920"></a>7.2.1. File monitoring</h4></div></div></div>
+<p id="ch2intro_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
+<pre class="programlisting">$ tail -f /var/adm/messages</pre>
+<p id="ch2intro_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
+<p id="ch2intro_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
+</div>
+</div>
+<div class="section" title="7.3. cut">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2984970"></a>7.3. cut</h3></div></div></div>
+<p id="ch2intro_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
+<p id="ch2intro_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
+<p id="ch2intro_c9"></a>Assuming a file named file containing the lines:</p>
+<pre class="programlisting">foo:bar:baz:qux:quux
+one:two:three:four:five:six:seven
+alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+<p id="ch2intro_ca"></a>To output the fourth through tenth characters of each line:</p>
+<pre class="programlisting">$ cut -c 4-10 file</pre>
+<p id="ch2intro_cb"></a>This gives the output:</p>
+<pre class="programlisting">:bar:ba
+:two:th
+ha:beta</pre>
+<p id="ch2intro_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
+<pre class="programlisting">$ cut -d : -f 5- file</pre>
+<p id="ch2intro_cd"></a>This gives the output:</p>
+<pre class="programlisting">quux
+five:six:seven
+epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+</div>
+<div class="section" title="7.4. paste">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2985055"></a>7.4. paste</h3></div></div></div>
+<p id="ch2intro_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
+<p id="ch2intro_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
+<pre class="programlisting">$ paste who where when &gt; www</pre>
+<p id="ch2intro_d0"></a>If the files contain:</p>
+<table summary="paste" border="1"><colgroup>
+<col width="11">
+<col width="12">
+<col width="12">
+</colgroup></table>
+<p id="ch2intro_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
+<pre class="programlisting">Batman            GothamCity       January 3
+Trillian          Andromeda        February 4
+Jeeves            London           March 19</pre>
+</div>
+</div>
+<div class="section" title="8. Shell Meta Characters">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2985190"></a>8. Shell Meta Characters</h2></div></div></div>
+<p id="ch2intro_de"></a>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.</p>
+<p id="ch2intro_df"></a>The shell meta characters include:</p>
+<p id="ch2intro_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
+<p id="ch2intro_e1"></a>Different shells may differ in the meta characters recognized.</p>
+<p id="ch2intro_e2"></a>As an example,</p>
+<pre class="programlisting">$ ls file.*</pre>
+<p id="ch2intro_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
+<pre class="programlisting">$ ls file.?</pre>
+<p id="ch2intro_e4"></a>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:</p>
+<pre class="programlisting">$ more c*</pre>
+<p id="ch2intro_e5"></a>because the c* matches that long file name.</p>
+<p id="ch2intro_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
+<pre class="programlisting">$ rm ??more</pre>
+<p id="ch2intro_e7"></a>or:</p>
+<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
+<p id="ch2intro_e8"></a>or:</p>
+<pre class="programlisting">$ rm ''*|more''</pre>
+</div>
+<div class="section" title="9. Looking At Files">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2985297"></a>9. Looking At Files</h2></div></div></div>
+<div class="section" title="9.1. cat">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2985305"></a>9.1. cat</h3></div></div></div>
+<p id="ch2intro_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
+<p id="ch2intro_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
+<p id="ch2intro_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
+<div class="section" title="9.1.1. Jargon File Definition">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2985349"></a>9.1.1. Jargon File Definition</h4></div></div></div>
+<p id="ch2intro_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
+<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
+     pause (syn. blast).
+
+2. By extension, to dump large amounts of data at an unprepared target or
+     with no intention of browsing it carefully. Usage: considered silly.
+     Rare outside Unix sites. See also dd, BLT.
+
+     Among Unix fans, *cat(1)* is considered an excellent example of
+     user-interface design, because it delivers the file contents without
+     such verbosity as spacing or headers between the files, and because
+     it does not require the files to consist of lines of text, but works
+     with any sort of data.
+
+     Among Unix critics, *cat(1)* is considered the canonical example of
+     bad user-interface design, because of its woefully unobvious name.
+     It is far more often used to blast a single file to standard output
+     than to concatenate two or more files. The name cat for the former
+     operation is just as unintuitive as, say, LISP's cdr.
+
+     Of such oppositions are holy wars made...</pre>
+</div>
+<div class="section" title="9.1.2. Useless Use of 'cat'">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2985388"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
+<p id="ch2intro_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
+<p id="ch2intro_ee"></a>Nevertheless one sees people doing:</p>
+<pre class="programlisting">$ cat file | some_command and its args ...</pre>
+<p id="ch2intro_ef"></a>instead of the equivalent and cheaper:</p>
+<pre class="programlisting">&lt;file some_command and its args ...</pre>
+<p id="ch2intro_f0"></a>or (equivalently and more classically):</p>
+<pre class="programlisting">some_command and its args ... &lt;file</pre>
+<p id="ch2intro_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
+<p id="ch2intro_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
+</div>
+<div class="section" title="9.1.3. zcat">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2985457"></a>9.1.3. zcat</h4></div></div></div>
+<p id="ch2intro_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
+</div>
+</div>
+<div class="section" title="9.2. more">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2985493"></a>9.2. more</h3></div></div></div>
+<p id="ch2intro_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
+<div class="section" title="9.2.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2985513"></a>9.2.1. Usage</h4></div></div></div>
+<p id="ch2intro_f5"></a>The command-syntax is:</p>
+<pre class="programlisting">$ more [options] [file_name]</pre>
+<p id="ch2intro_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
+<p id="ch2intro_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
+<p id="ch2intro_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
+<p id="ch2intro_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
+</div>
+</div>
+<div class="section" title="9.3. less">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2985608"></a>9.3. less</h3></div></div></div>
+<p id="ch2intro_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
+<div class="section" title="9.3.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2985637"></a>9.3.1. Usage</h4></div></div></div>
+<p id="ch2intro_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
+<p id="ch2intro_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
+<p id="ch2intro_fd"></a>The command-syntax is:</p>
+<pre class="programlisting">$ less [options] file_name</pre>
+</div>
+<div class="section" title="9.3.2. Frequently Used Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2985691"></a>9.3.2. Frequently Used Options</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_ff"></a>-I: Case-insensitive searches.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_103"></a>-?: Shows help.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.3. Frequently Used Commands">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2985743"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_105"></a>[Space bar]: Next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_106"></a>b: Previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_10a"></a>'^ or g: Go to start of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_10b"></a>'$ or G: Go to end of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_10d"></a>=: File information.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_10e"></a>h: Help.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_10f"></a>q: Quit.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.4. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2985832"></a>9.3.4. Examples</h4></div></div></div>
+<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
+$ less +F /var/log/mail.log              #Follow mode for log
+$ file * | less                          #Easier file analysis.
+$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
+</div>
+</div>
+</div>
+<div class="section" title="10. Directory Structure">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2985848"></a>10. Directory Structure</h2></div></div></div>
+<p id="ch2intro_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
+<p id="ch2intro_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
+<table summary="Directory Structure" border="1"><colgroup>
+<col width="15">
+<col width="48">
+</colgroup></table>
+<div class="section" title="10.1. man hier">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2986117"></a>10.1. man hier</h3></div></div></div>
+<p id="ch2intro_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
+<pre class="programlisting">$ man hier</pre>
+</div>
+<div class="section" title="10.2. ls -l">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2986133"></a>10.2. ls -l</h3></div></div></div>
+<p id="ch2intro_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
+<pre class="programlisting">$ ls -l</pre>
+<p id="ch2intro_138"></a>This can be done after entering the required directory.</p>
+</div>
+</div>
+<div class="section" title="11. Permissions and Ownership">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2986156"></a>11. Permissions and Ownership</h2></div></div></div>
+<div class="section" title="11.1. chmod">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2986165"></a>11.1. chmod</h3></div></div></div>
+<p id="ch2intro_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
+<div class="section" title="11.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2986191"></a>11.1.1. Usage</h4></div></div></div>
+<p id="ch2intro_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
+<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
+<p id="ch2intro_13b"></a>To view what the permissions currently are, type:</p>
+<pre class="programlisting">$ ls -l file</pre>
+</div>
+<div class="section" title="11.1.2. Command line options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2986219"></a>11.1.2. Command line options</h4></div></div></div>
+<p id="ch2intro_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch2intro_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
+</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2986255"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
+<p id="ch2intro_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
+<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
+<p id="ch2intro_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="8">
+<col width="45">
+</colgroup></table>
+<p id="ch2intro_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="54">
+</colgroup></table>
+<p id="ch2intro_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="5">
+<col width="14">
+<col width="48">
+</colgroup></table>
+<p id="ch2intro_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
+</div>
+<div class="section" title="11.1.2.2. Symbolic examples">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2986802"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
+<p id="ch2intro_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
+<pre class="programlisting">$ chmod ug+rw mydir
+$ ls -ld mydir
+drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
+<p id="ch2intro_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
+<pre class="programlisting">$ chmod a-w myfile
+$ ls -l myfile
+-r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
+<p id="ch2intro_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
+<pre class="programlisting">$ chmod ug=rx mydir
+$ ls -ld mydir
+dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
+</div>
+<div class="section" title="11.1.2.3. Octal numbers">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2986842"></a>11.1.2.3. Octal numbers</h5></div></div></div>
+<p id="ch2intro_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
+<pre class="programlisting">$ chmod 664 myfile
+$ ls -l myfile
+-rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
+<p id="ch2intro_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
+<pre class="programlisting">$ chmod 0664 myfile</pre>
+</div>
+<div class="section" title="11.1.2.4. Special modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2986882"></a>11.1.2.4. Special modes</h5></div></div></div>
+<p id="ch2intro_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
+<p id="ch2intro_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="12. Redirection and Piping">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2986929"></a>12. Redirection and Piping</h2></div></div></div>
+<p id="ch2intro_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
+<p id="ch2intro_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
+<div class="section" title="12.1. Redirecting standard input and standard output">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2986966"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
+<p id="ch2intro_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
+<pre class="programlisting">$ command1 &gt; file1</pre>
+<p id="ch2intro_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
+<pre class="programlisting">$ command1 &lt; file1</pre>
+<p id="ch2intro_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
+<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
+<p id="ch2intro_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
+</div>
+<div class="section" title="12.2. Piping">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2987035"></a>12.2. Piping</h3></div></div></div>
+<p id="ch2intro_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
+A pipeline of three programs run on a text terminal:</p>
+<pre class="programlisting">$ command1 | command2</pre>
+<p id="ch2intro_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
+<p id="ch2intro_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
+<pre class="programlisting">$ command1 &gt; tempfile
+$ command2 &lt; tempfile
+$ rm tempfile</pre>
+<p id="ch2intro_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
+<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
+<p id="ch2intro_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
+</div>
+<div class="section" title="12.3. Redirecting to and from the standard file handles">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2987096"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
+<p id="ch2intro_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
+<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
+<col width="12">
+<col width="13">
+<col width="24">
+</colgroup></table>
+<p id="ch2intro_18d"></a>For example:</p>
+<pre class="programlisting">$ command1 2&gt; file1</pre>
+<p id="ch2intro_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
+<p id="ch2intro_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
+<p id="ch2intro_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
+<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
+<p id="ch2intro_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
+<p id="ch2intro_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
+<p id="ch2intro_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
+<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
+<p id="ch2intro_194"></a>A simplified form of the command:</p>
+<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
+<p id="ch2intro_195"></a>is:</p>
+<pre class="programlisting">$ command &amp;&gt;file</pre>
+<p id="ch2intro_196"></a>or:</p>
+<pre class="programlisting">$command &gt;&amp;file</pre>
+</div>
+<div class="section" title="12.4. Chained pipelines">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2987301"></a>12.4. Chained pipelines</h3></div></div></div>
+<p id="ch2intro_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
+<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
+<p id="ch2intro_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
+</div>
+<div class="section" title="12.5. Redirect to multiple outputs">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2987335"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
+<p id="ch2intro_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
+<pre class="programlisting">$ ls -lrt | tee xyz</pre>
+<p id="ch2intro_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
+</div>
+</div>
+<div class="section" title="13. More Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2987365"></a>13. More Text Processing</h2></div></div></div>
+<div class="section" title="13.1. grep">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2987374"></a>13.1. grep</h3></div></div></div>
+<p id="ch2intro_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
+<div class="section" title="13.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2987405"></a>13.1.1. Usage</h4></div></div></div>
+<p id="ch2intro_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
+<pre class="programlisting">$ grep apple fruitlist.txt</pre>
+<p id="ch2intro_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
+<p id="ch2intro_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
+<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
+<p id="ch2intro_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
+<p id="ch2intro_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
+<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
+<p id="ch2intro_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
+<div class="section" title="13.1.1.1. Variations">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2987484"></a>13.1.1.1. Variations</h5></div></div></div>
+<p id="ch2intro_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
+<p id="ch2intro_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
+<p id="ch2intro_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
+</div>
+</div>
+</div>
+<div class="section" title="13.2. tr">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2987563"></a>13.2. tr</h3></div></div></div>
+<p id="ch2intro_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
+<p id="ch2intro_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
+<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
+<p id="ch2intro_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
+<p id="ch2intro_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
+<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
+<p id="ch2intro_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
+<p id="ch2intro_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
+<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
+<p id="ch2intro_1ab"></a>therefore removes all non-alphanumeric characters.</p>
+<p id="ch2intro_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
+<pre class="programlisting">$ tr -s '\n' '\n'</pre>
+<p id="ch2intro_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
+<p id="ch2intro_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
+<pre class="programlisting">$ tr -d '\r'</pre>
+<p id="ch2intro_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
+<p id="ch2intro_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
+</div>
+</div>
+<div class="section" title="14. Elementary Regex">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2987713"></a>14. Elementary Regex</h2></div></div></div>
+<p id="ch2intro_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
+<p id="ch2intro_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
+<p id="ch2intro_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
+<p id="ch2intro_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
+<table summary="Elementary Regex" border="1"><colgroup>
+<col width="13">
+<col width="60">
+</colgroup></table>
+<div class="section" title="14.1. Lazy quantification">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2988062"></a>14.1. Lazy quantification</h3></div></div></div>
+<p id="ch2intro_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
+<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
+<p id="ch2intro_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
+<p id="ch2intro_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
+</div>
+</div>
+<div class="section" title="15. One Liners">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2988138"></a>15. One Liners</h2></div></div></div>
+<p id="ch2intro_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
+<p id="ch2intro_1cd"></a>The one liner can be</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem"><p id="ch2intro_1ce"></a>An expression written in the language of the shell.</p></li>
+<li class="listitem"><p id="ch2intro_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
+<li class="listitem"><p id="ch2intro_1d0"></a>The invocation of a compiler together with source to compile and
+instructions for executing the compiled program.</p></li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch2intro_1d1"></a>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.</p>
+<p id="ch2intro_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
+<p id="ch2intro_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
+<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
+<p id="ch2intro_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
+<p id="ch2intro_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
+<p id="ch2intro_1d6"></a>Here are the first few of them:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<p id="ch2intro_1d7"></a>Print the total number of input lines:</p>
+<p id="ch2intro_1d8"></a>END { print NR }</p>
+</li>
+<li class="listitem">
+<p id="ch2intro_1d9"></a>Print the tenth input line:</p>
+<p id="ch2intro_1da"></a>NR == 10</p>
+</li>
+<li class="listitem">
+<p id="ch2intro_1db"></a>Print the last field of every input line:</p>
+<p id="ch2intro_1dc"></a>{ print $NF }</p>
+</li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch2intro_1dd"></a>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.</p>
+<p id="ch2intro_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
+<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
+*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
+<p id="ch2intro_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
+<p id="ch2intro_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
+<pre class="programlisting">$ prog foo 'f??'; echo $?
+
+$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
+<p id="ch2intro_1e1"></a>Here is a one line shell script to show directories:</p>
+<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
+</div>
+</div>
+</div></body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/ch3list_tuples.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1138 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>List and Tuples </title>
+<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
+<script type="text/javascript" src="/review/support/jquery-min.js"></script>
+<script type="text/javascript" src="/review/support/form.js"></script>
+<script type="text/javascript" src="/review/support/hsbook.js"></script>
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch3list_tuples">
+<div class="titlepage"></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="article"><a href="#id2689198"></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2499323">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2687018">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2740259">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2740531">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2740663">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2740671">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2740949">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2740958">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2741120">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2741180">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2741282">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2741364">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2741543">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2741551">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2740051">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2741979">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2742070">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2742122">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2742131">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2742442">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2742574">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2742744">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2742837">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2742845">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2742932">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2743058">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2743144">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2743276">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2743383">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2743392">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2743578">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2743688">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2743929">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2744198">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2744214">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2744237">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2744246">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2745018">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2745055">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2745124">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2745186">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2745390">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2745424">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2745454">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2745463">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2745652">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2745806">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2746019">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2746095">15. One Liners</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="article">
+<div class="titlepage">
+<div><div><h2 class="title" id="id2689198"></a></h2></div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#id2499323">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2687018">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2740259">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2740531">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2740663">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2740671">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2740949">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2740958">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2741120">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2741180">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2741282">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2741364">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2741543">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2741551">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2740051">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2741979">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2742070">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2742122">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2742131">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2742442">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2742574">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2742744">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2742837">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2742845">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2742932">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2743058">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2743144">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2743276">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2743383">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2743392">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2743578">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2743688">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2743929">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2744198">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2744214">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2744237">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2744246">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2745018">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2745055">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2745124">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2745186">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2745390">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2745424">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2745454">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2745463">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2745652">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2745806">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2746019">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2746095">15. One Liners</a></span></dt>
+</dl>
+</div>
+<div class="section" title="1. Introducing Linux">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2499323"></a>1. Introducing Linux</h2></div></div></div>
+<p id="ch3list_tuples_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
+<p id="ch3list_tuples_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
+<p id="ch3list_tuples_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
+<p id="ch3list_tuples_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
+<div class="section" title="1.1. Historical Background">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2687018"></a>1.1. Historical Background</h3></div></div></div>
+<div class="section" title="1.1.1. Events leading to the creation">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2686984"></a>1.1.1. Events leading to the creation</h4></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
+</ul></div>
+</div>
+<div class="section" title="1.1.2. The Creation of Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2740214"></a>1.1.2. The Creation of Linux</h4></div></div></div>
+<p id="ch3list_tuples_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
+<p id="ch3list_tuples_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
+</div>
+</div>
+<div class="section" title="1.2. Design and Implications">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2740259"></a>1.2. Design and Implications</h3></div></div></div>
+<p id="ch3list_tuples_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
+<div class="section" title="1.2.1. User Interface">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2740283"></a>1.2.1. User Interface</h4></div></div></div>
+<p id="ch3list_tuples_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
+<p id="ch3list_tuples_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
+</div>
+<div class="section" title="1.2.2. Development">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2740337"></a>1.2.2. Development</h4></div></div></div>
+<p id="ch3list_tuples_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
+<p id="ch3list_tuples_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
+<p id="ch3list_tuples_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
+</div>
+<div class="section" title="1.2.3. Community">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2740394"></a>1.2.3. Community</h4></div></div></div>
+<p id="ch3list_tuples_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
+<p id="ch3list_tuples_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
+<p id="ch3list_tuples_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
+</div>
+<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2740438"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
+<p id="ch3list_tuples_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
+</div>
+<div class="section" title="1.2.5. Programming on Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2740484"></a>1.2.5. Programming on Linux</h4></div></div></div>
+<p id="ch3list_tuples_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
+<p id="ch3list_tuples_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
+<p id="ch3list_tuples_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
+</div>
+</div>
+<div class="section" title="1.3. Reasons for Using Linux">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2740531"></a>1.3. Reasons for Using Linux</h3></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_16"></a>Linux is free:</p></li></ul></div>
+<p id="ch3list_tuples_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
+Most of all, Linux is free as in "free speech":
+The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
+<p id="ch3list_tuples_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_1a"></a>Linux was made to keep on running:</p></li></ul></div>
+<p id="ch3list_tuples_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_1c"></a>Linux is secure and versatile:</p></li></ul></div>
+<p id="ch3list_tuples_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_1e"></a>Linux is scalable:</p></li></ul></div>
+<p id="ch3list_tuples_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
+<p id="ch3list_tuples_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
+</div>
+</div>
+<div class="section" title="2. Getting Started">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2740663"></a>2. Getting Started</h2></div></div></div>
+<div class="section" title="2.1. Logging in, activating the user interface and logging out">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2740671"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
+<p id="ch3list_tuples_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
+<div class="section" title="2.1.1. Graphical Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2740702"></a>2.1.1. Graphical Mode</h4></div></div></div>
+<p id="ch3list_tuples_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
+<p id="ch3list_tuples_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
+It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
+<p id="ch3list_tuples_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
+<p id="ch3list_tuples_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
+<p id="ch3list_tuples_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
+<p id="ch3list_tuples_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
+<p id="ch3list_tuples_29"></a>Another common form for a prompt is this one:
+[</p>
+<div class="reference">
+<div class="titlepage"><hr></div>user@host</div>
+<p> dir]</p>
+<p id="ch3list_tuples_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
+<p id="ch3list_tuples_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
+</div>
+<div class="section" title="2.1.2. Text Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2740860"></a>2.1.2. Text Mode</h4></div></div></div>
+<p id="ch3list_tuples_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
+<p id="ch3list_tuples_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
+reasons.</p>
+<p id="ch3list_tuples_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
+<p id="ch3list_tuples_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
+<p id="ch3list_tuples_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
+</div>
+</div>
+</div>
+<div class="section" title="3. Basic Commands">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2740949"></a>3. Basic Commands</h2></div></div></div>
+<div class="section" title="3.1. ls">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2740958"></a>3.1. ls</h3></div></div></div>
+<p id="ch3list_tuples_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
+<p id="ch3list_tuples_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
+<p id="ch3list_tuples_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch3list_tuples_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
+<pre class="programlisting">$ ls
+jeeves.rst psmith.html blandings.html
+$ ls -l
+drwxr--r--   1 plum  editors   4096  jeeves
+-rw-r--r--   1 plum  editors  30405  psmith
+-r-xr-xr-x   1 plum  plum      8460  blandings</pre>
+<p id="ch3list_tuples_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
+</div>
+<div class="section" title="3.2. date">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2741120"></a>3.2. date</h3></div></div></div>
+<p id="ch3list_tuples_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
+<p id="ch3list_tuples_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
+<pre class="programlisting">$date
+Tue Sep  8 12:01:45 IST 2009</pre>
+<p id="ch3list_tuples_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
+<pre class="programlisting">$date --set="20040908 01:22"</pre>
+<p id="ch3list_tuples_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
+<pre class="programlisting">$man date</pre>
+<p id="ch3list_tuples_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
+</div>
+<div class="section" title="3.3. cd">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2741180"></a>3.3. cd</h3></div></div></div>
+<p id="ch3list_tuples_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
+<p id="ch3list_tuples_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
+<p id="ch3list_tuples_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
+<p id="ch3list_tuples_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
+<p id="ch3list_tuples_46"></a>Absolute paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch3list_tuples_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch3list_tuples_48"></a>For example to get to /boot/grub you would type:</p>
+<pre class="programlisting">$cd /boot/grub</pre>
+<p id="ch3list_tuples_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
+<p id="ch3list_tuples_4a"></a>Relative paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch3list_tuples_4b"></a>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.</p>
+<p id="ch3list_tuples_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
+<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch3list_tuples_4d"></a>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.</p>
+</div>
+<div class="section" title="3.4. who">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2741282"></a>3.4. who</h3></div></div></div>
+<p id="ch3list_tuples_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
+<p id="ch3list_tuples_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
+<pre class="programlisting">$who
+beeblebrox tty7         2009-09-08 10:50 (:0)
+beeblebrox pts/0        2009-09-08 11:25 (:0.0)
+dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
+beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
+<p id="ch3list_tuples_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
+<p id="ch3list_tuples_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
+<pre class="programlisting">$man who</pre>
+<p id="ch3list_tuples_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
+</div>
+<div class="section" title="3.5. mkdir">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2741364"></a>3.5. mkdir</h3></div></div></div>
+<p id="ch3list_tuples_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
+<pre class="programlisting">$mkdir name_of_directory</pre>
+<p id="ch3list_tuples_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
+<div class="section" title="3.5.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2741396"></a>3.5.1. Options</h4></div></div></div>
+<p id="ch3list_tuples_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch3list_tuples_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
+</div>
+<div class="section" title="3.5.2. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2741457"></a>3.5.2. Examples</h4></div></div></div>
+<p id="ch3list_tuples_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
+<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
+<p id="ch3list_tuples_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
+<p id="ch3list_tuples_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
+<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
+<p id="ch3list_tuples_5d"></a>This will create:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_5e"></a>tag</p></li>
+<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
+</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
+</div>
+</div>
+</div>
+<div class="section" title="4. Getting Help">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2741543"></a>4. Getting Help</h2></div></div></div>
+<div class="section" title="4.1. apropos and whatis">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2741551"></a>4.1. apropos and whatis</h3></div></div></div>
+<p id="ch3list_tuples_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
+<pre class="programlisting">$ apropos grep
+egrep       egrep (1)       Search a file for a pattern using full regular expressions
+fgrep       fgrep (1)       Search a file for a fixed-character string
+fmlgrep     fmlgrep (1)     Search a file for a pattern
+grep        grep (1)        Search a file for a pattern
+gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
+nisgrep     nismatch (1)    Utilities for searching NIS+ tables
+pgrep       pgrep (1)       Find or signal a process by name or other attribute
+zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
+...</pre>
+<p id="ch3list_tuples_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
+<p id="ch3list_tuples_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
+<pre class="programlisting">$whatis ls
+ls (1)           - list directory contents</pre>
+<p id="ch3list_tuples_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
+<p id="ch3list_tuples_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
+<pre class="programlisting">$apropos browser
+gmusicbrowser (1)    - Jukebox for large collections of audio files
+infobrowser (1)      - read Info documents
+libsmbclient (7)     - An extension library for browsers and that               can be used...
+opera (1)            - a standards-compliant graphical Web browser
+sensible-browser (1) - sensible editing, paging, and web browsing
+smbtree (1)          - A text based smb network browser
+tvtk_doc (1)         - A GUI based TVTK documentation search browser.
+viewres (1)          - graphical class browser for Xt
+w3m (1)              - a text based Web browser and pager
+www-browser (1)      - a text based Web browser and pager
+...</pre>
+</div>
+<div class="section" title="4.2. man">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2740051"></a>4.2. man</h3></div></div></div>
+<p id="ch3list_tuples_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
+<p id="ch3list_tuples_66"></a>To read a manual page for a Unix command, one can use:</p>
+<pre class="programlisting">$ man &lt;command_name&gt;</pre>
+<p id="ch3list_tuples_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
+<p id="ch3list_tuples_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
+<pre class="programlisting">$man 3 printf</pre>
+<p id="ch3list_tuples_69"></a>Another example:</p>
+<pre class="programlisting">$man man</pre>
+<p id="ch3list_tuples_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
+<div class="section" title="4.2.1. Layout">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2741853"></a>4.2.1. Layout</h4></div></div></div>
+<p id="ch3list_tuples_6b"></a>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:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch3list_tuples_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch3list_tuples_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch3list_tuples_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch3list_tuples_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch3list_tuples_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch3list_tuples_71"></a>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.</p>
+<p id="ch3list_tuples_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
+<p id="ch3list_tuples_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
+<p id="ch3list_tuples_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
+<p id="ch3list_tuples_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
+<p id="ch3list_tuples_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
+</div>
+</div>
+<div class="section" title="4.3. info">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2741979"></a>4.3. info</h3></div></div></div>
+<p id="ch3list_tuples_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
+<p id="ch3list_tuples_78"></a>The syntax is</p>
+<pre class="programlisting">$ info &lt;command_name&gt;</pre>
+<p id="ch3list_tuples_79"></a><span class="emphasis"><em>info</em></span> 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</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch3list_tuples_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
+</div>
+<div class="section" title="4.4. --help">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2742070"></a>4.4. --help</h3></div></div></div>
+<p id="ch3list_tuples_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
+<pre class="programlisting">$ userprompt@host: cat --help
+Usage: cat [OPTION] [FILE]...
+Concatenate FILE(s), or standard input, to standard output.
+
+  -A, --show-all           equivalent to -vET
+  -b, --number-nonblank    number nonempty output lines
+  -e                       equivalent to -vE
+  -E, --show-ends          display $ at end of each line
+  -n, --number             number all output lines
+  -s, --squeeze-blank      suppress repeated empty output lines
+  -t                       equivalent to -vT
+  -T, --show-tabs          display TAB characters as ^I
+  -u                       (ignored)
+  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
+  --help     display this help and exit
+  --version  output version information and exit
+
+With no FILE, or when FILE is -, read standard input.
+
+Examples:
+  cat f - g  Output f's contents, then standard input, then g's           contents.
+  cat        Copy standard input to standard output.
+
+Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
+</div>
+</div>
+<div class="section" title="5. Basic file handling">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2742122"></a>5. Basic file handling</h2></div></div></div>
+<div class="section" title="5.1. cp">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2742131"></a>5.1. cp</h3></div></div></div>
+<p id="ch3list_tuples_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
+<div class="section" title="5.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2742148"></a>5.1.1. Usage</h4></div></div></div>
+<p id="ch3list_tuples_82"></a>To copy a file to another file:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
+<p id="ch3list_tuples_83"></a>To copy a file to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
+<p id="ch3list_tuples_84"></a>To copy a directory to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
+SourceDirectory ... TargetDirectory</pre>
+</div>
+<div class="section" title="5.1.2. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2742182"></a>5.1.2. Flags</h4></div></div></div>
+<p id="ch3list_tuples_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
+<p id="ch3list_tuples_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
+<p id="ch3list_tuples_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
+<p id="ch3list_tuples_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_89"></a>The time of the last data modification and the time of the last access.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch3list_tuples_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
+</div>
+<div class="section" title="5.1.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2742280"></a>5.1.3. Examples</h4></div></div></div>
+<p id="ch3list_tuples_8d"></a>To make a copy of a file in the current directory, enter:</p>
+<pre class="programlisting">$ cp prog.c prog.bak</pre>
+<p id="ch3list_tuples_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
+<p id="ch3list_tuples_8f"></a>To copy a file in your current directory into another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
+<p id="ch3list_tuples_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
+<p id="ch3list_tuples_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
+<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
+<p id="ch3list_tuples_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
+<p id="ch3list_tuples_93"></a>To copy all the files in a directory to a new directory, enter:</p>
+<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
+<p id="ch3list_tuples_94"></a>This copies only the files in the clients directory to the customers directory.</p>
+<p id="ch3list_tuples_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch3list_tuples_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch3list_tuples_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
+<p id="ch3list_tuples_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
+<p id="ch3list_tuples_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
+<p id="ch3list_tuples_9a"></a>To use pattern-matching characters to copy files, enter:</p>
+<pre class="programlisting">$ cp programs/*.py .</pre>
+<p id="ch3list_tuples_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
+</div>
+</div>
+<div class="section" title="5.2. mv">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2742442"></a>5.2. mv</h3></div></div></div>
+<p id="ch3list_tuples_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
+<div class="section" title="5.2.1. Conflicting existing file">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2742466"></a>5.2.1. Conflicting existing file</h4></div></div></div>
+<p id="ch3list_tuples_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
+</div>
+<div class="section" title="5.2.2. Differences with copy and delete">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2742485"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
+<p id="ch3list_tuples_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
+</div>
+<div class="section" title="5.2.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2742516"></a>5.2.3. Examples</h4></div></div></div>
+<pre class="programlisting">$ mv myfile mynewfilename    renames a file
+$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
+$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
+$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
+$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
+$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
+$ mv foo bar baz dir         moves multiple files to directory dir
+$ mv --help                  shows a very concise help about the                syntax of the command
+$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
+<p id="ch3list_tuples_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
+<p id="ch3list_tuples_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
+</div>
+</div>
+<div class="section" title="5.3. rm">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2742574"></a>5.3. rm</h3></div></div></div>
+<p id="ch3list_tuples_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
+<p id="ch3list_tuples_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
+<pre class="programlisting">$ rm -i foo
+remove foo? y</pre>
+<div class="section" title="5.3.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2742604"></a>5.3.1. Options</h4></div></div></div>
+<p id="ch3list_tuples_a3"></a>Common options that rm accepts include:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch3list_tuples_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
+<p id="ch3list_tuples_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
+<p id="ch3list_tuples_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
+<pre class="programlisting">xargs rm &lt; filelist</pre>
+<p id="ch3list_tuples_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
+</div>
+<div class="section" title="5.3.2. Permissions">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2742705"></a>5.3.2. Permissions</h4></div></div></div>
+<p id="ch3list_tuples_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
+<p id="ch3list_tuples_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
+<p id="ch3list_tuples_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
+</div>
+</div>
+</div>
+<div class="section" title="6. Command Line Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2742744"></a>6. Command Line Arguments</h2></div></div></div>
+<p id="ch3list_tuples_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
+<p id="ch3list_tuples_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
+<pre class="programlisting">rm file.s</pre>
+<p id="ch3list_tuples_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
+<p id="ch3list_tuples_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
+<p id="ch3list_tuples_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
+<p id="ch3list_tuples_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
+<p id="ch3list_tuples_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
+</div>
+<div class="section" title="7. Basic Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2742837"></a>7. Basic Text Processing</h2></div></div></div>
+<div class="section" title="7.1. head">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2742845"></a>7.1. head</h3></div></div></div>
+<p id="ch3list_tuples_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
+<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
+<p id="ch3list_tuples_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
+<pre class="programlisting">$ head -n 20 filename</pre>
+<p id="ch3list_tuples_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ head -n 5 foo*</pre>
+<p id="ch3list_tuples_b9"></a>Some versions omit the n and just let you say -5.</p>
+<div class="section" title="7.1.1. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2742896"></a>7.1.1. Flags</h4></div></div></div>
+<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
+<p id="ch3list_tuples_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
+<p id="ch3list_tuples_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
+<pre class="programlisting">sed 5q foo</pre>
+<p id="ch3list_tuples_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
+</div>
+</div>
+<div class="section" title="7.2. tail">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2742932"></a>7.2. tail</h3></div></div></div>
+<p id="ch3list_tuples_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
+<p id="ch3list_tuples_be"></a>The command-syntax is:</p>
+<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
+<p id="ch3list_tuples_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
+<pre class="programlisting">$ tail -n 20 filename</pre>
+<p id="ch3list_tuples_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ tail -c 15 foo*</pre>
+<p id="ch3list_tuples_c1"></a>This example shows all lines of filename from the second line onwards:</p>
+<pre class="programlisting">$ tail -n +2 filename</pre>
+<p id="ch3list_tuples_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
+<pre class="programlisting">$ tail -20 filename
+$ tail -50c filename</pre>
+<p id="ch3list_tuples_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
+<div class="section" title="7.2.1. File monitoring">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2743009"></a>7.2.1. File monitoring</h4></div></div></div>
+<p id="ch3list_tuples_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
+<pre class="programlisting">$ tail -f /var/adm/messages</pre>
+<p id="ch3list_tuples_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
+<p id="ch3list_tuples_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
+</div>
+</div>
+<div class="section" title="7.3. cut">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2743058"></a>7.3. cut</h3></div></div></div>
+<p id="ch3list_tuples_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
+<p id="ch3list_tuples_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
+<p id="ch3list_tuples_c9"></a>Assuming a file named file containing the lines:</p>
+<pre class="programlisting">foo:bar:baz:qux:quux
+one:two:three:four:five:six:seven
+alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+<p id="ch3list_tuples_ca"></a>To output the fourth through tenth characters of each line:</p>
+<pre class="programlisting">$ cut -c 4-10 file</pre>
+<p id="ch3list_tuples_cb"></a>This gives the output:</p>
+<pre class="programlisting">:bar:ba
+:two:th
+ha:beta</pre>
+<p id="ch3list_tuples_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
+<pre class="programlisting">$ cut -d : -f 5- file</pre>
+<p id="ch3list_tuples_cd"></a>This gives the output:</p>
+<pre class="programlisting">quux
+five:six:seven
+epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+</div>
+<div class="section" title="7.4. paste">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2743144"></a>7.4. paste</h3></div></div></div>
+<p id="ch3list_tuples_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
+<p id="ch3list_tuples_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
+<pre class="programlisting">$ paste who where when &gt; www</pre>
+<p id="ch3list_tuples_d0"></a>If the files contain:</p>
+<table summary="paste" border="1"><colgroup>
+<col width="11">
+<col width="12">
+<col width="12">
+</colgroup></table>
+<p id="ch3list_tuples_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
+<pre class="programlisting">Batman            GothamCity       January 3
+Trillian          Andromeda        February 4
+Jeeves            London           March 19</pre>
+</div>
+</div>
+<div class="section" title="8. Shell Meta Characters">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2743276"></a>8. Shell Meta Characters</h2></div></div></div>
+<p id="ch3list_tuples_de"></a>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.</p>
+<p id="ch3list_tuples_df"></a>The shell meta characters include:</p>
+<p id="ch3list_tuples_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
+<p id="ch3list_tuples_e1"></a>Different shells may differ in the meta characters recognized.</p>
+<p id="ch3list_tuples_e2"></a>As an example,</p>
+<pre class="programlisting">$ ls file.*</pre>
+<p id="ch3list_tuples_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
+<pre class="programlisting">$ ls file.?</pre>
+<p id="ch3list_tuples_e4"></a>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:</p>
+<pre class="programlisting">$ more c*</pre>
+<p id="ch3list_tuples_e5"></a>because the c* matches that long file name.</p>
+<p id="ch3list_tuples_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
+<pre class="programlisting">$ rm ??more</pre>
+<p id="ch3list_tuples_e7"></a>or:</p>
+<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
+<p id="ch3list_tuples_e8"></a>or:</p>
+<pre class="programlisting">$ rm ''*|more''</pre>
+</div>
+<div class="section" title="9. Looking At Files">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2743383"></a>9. Looking At Files</h2></div></div></div>
+<div class="section" title="9.1. cat">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2743392"></a>9.1. cat</h3></div></div></div>
+<p id="ch3list_tuples_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
+<p id="ch3list_tuples_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
+<p id="ch3list_tuples_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
+<div class="section" title="9.1.1. Jargon File Definition">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2743435"></a>9.1.1. Jargon File Definition</h4></div></div></div>
+<p id="ch3list_tuples_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
+<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
+     pause (syn. blast).
+
+2. By extension, to dump large amounts of data at an unprepared target or
+     with no intention of browsing it carefully. Usage: considered silly.
+     Rare outside Unix sites. See also dd, BLT.
+
+     Among Unix fans, *cat(1)* is considered an excellent example of
+     user-interface design, because it delivers the file contents without
+     such verbosity as spacing or headers between the files, and because
+     it does not require the files to consist of lines of text, but works
+     with any sort of data.
+
+     Among Unix critics, *cat(1)* is considered the canonical example of
+     bad user-interface design, because of its woefully unobvious name.
+     It is far more often used to blast a single file to standard output
+     than to concatenate two or more files. The name cat for the former
+     operation is just as unintuitive as, say, LISP's cdr.
+
+     Of such oppositions are holy wars made...</pre>
+</div>
+<div class="section" title="9.1.2. Useless Use of 'cat'">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2743474"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
+<p id="ch3list_tuples_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
+<p id="ch3list_tuples_ee"></a>Nevertheless one sees people doing:</p>
+<pre class="programlisting">$ cat file | some_command and its args ...</pre>
+<p id="ch3list_tuples_ef"></a>instead of the equivalent and cheaper:</p>
+<pre class="programlisting">&lt;file some_command and its args ...</pre>
+<p id="ch3list_tuples_f0"></a>or (equivalently and more classically):</p>
+<pre class="programlisting">some_command and its args ... &lt;file</pre>
+<p id="ch3list_tuples_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
+<p id="ch3list_tuples_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
+</div>
+<div class="section" title="9.1.3. zcat">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2743544"></a>9.1.3. zcat</h4></div></div></div>
+<p id="ch3list_tuples_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
+</div>
+</div>
+<div class="section" title="9.2. more">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2743578"></a>9.2. more</h3></div></div></div>
+<p id="ch3list_tuples_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
+<div class="section" title="9.2.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2743597"></a>9.2.1. Usage</h4></div></div></div>
+<p id="ch3list_tuples_f5"></a>The command-syntax is:</p>
+<pre class="programlisting">$ more [options] [file_name]</pre>
+<p id="ch3list_tuples_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
+<p id="ch3list_tuples_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
+<p id="ch3list_tuples_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
+<p id="ch3list_tuples_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
+</div>
+</div>
+<div class="section" title="9.3. less">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2743688"></a>9.3. less</h3></div></div></div>
+<p id="ch3list_tuples_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
+<div class="section" title="9.3.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2743717"></a>9.3.1. Usage</h4></div></div></div>
+<p id="ch3list_tuples_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
+<p id="ch3list_tuples_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
+<p id="ch3list_tuples_fd"></a>The command-syntax is:</p>
+<pre class="programlisting">$ less [options] file_name</pre>
+</div>
+<div class="section" title="9.3.2. Frequently Used Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2743772"></a>9.3.2. Frequently Used Options</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_ff"></a>-I: Case-insensitive searches.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_103"></a>-?: Shows help.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.3. Frequently Used Commands">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2743824"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_105"></a>[Space bar]: Next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_106"></a>b: Previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_10a"></a>'^ or g: Go to start of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_10b"></a>'$ or G: Go to end of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_10d"></a>=: File information.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_10e"></a>h: Help.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_10f"></a>q: Quit.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.4. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2743913"></a>9.3.4. Examples</h4></div></div></div>
+<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
+$ less +F /var/log/mail.log              #Follow mode for log
+$ file * | less                          #Easier file analysis.
+$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
+</div>
+</div>
+</div>
+<div class="section" title="10. Directory Structure">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2743929"></a>10. Directory Structure</h2></div></div></div>
+<p id="ch3list_tuples_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
+<p id="ch3list_tuples_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
+<table summary="Directory Structure" border="1"><colgroup>
+<col width="15">
+<col width="48">
+</colgroup></table>
+<div class="section" title="10.1. man hier">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2744198"></a>10.1. man hier</h3></div></div></div>
+<p id="ch3list_tuples_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
+<pre class="programlisting">$ man hier</pre>
+</div>
+<div class="section" title="10.2. ls -l">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2744214"></a>10.2. ls -l</h3></div></div></div>
+<p id="ch3list_tuples_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
+<pre class="programlisting">$ ls -l</pre>
+<p id="ch3list_tuples_138"></a>This can be done after entering the required directory.</p>
+</div>
+</div>
+<div class="section" title="11. Permissions and Ownership">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2744237"></a>11. Permissions and Ownership</h2></div></div></div>
+<div class="section" title="11.1. chmod">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2744246"></a>11.1. chmod</h3></div></div></div>
+<p id="ch3list_tuples_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
+<div class="section" title="11.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2744272"></a>11.1.1. Usage</h4></div></div></div>
+<p id="ch3list_tuples_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
+<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
+<p id="ch3list_tuples_13b"></a>To view what the permissions currently are, type:</p>
+<pre class="programlisting">$ ls -l file</pre>
+</div>
+<div class="section" title="11.1.2. Command line options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2744300"></a>11.1.2. Command line options</h4></div></div></div>
+<p id="ch3list_tuples_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch3list_tuples_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
+</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2744336"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
+<p id="ch3list_tuples_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
+<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
+<p id="ch3list_tuples_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="8">
+<col width="45">
+</colgroup></table>
+<p id="ch3list_tuples_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="54">
+</colgroup></table>
+<p id="ch3list_tuples_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="5">
+<col width="14">
+<col width="48">
+</colgroup></table>
+<p id="ch3list_tuples_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
+</div>
+<div class="section" title="11.1.2.2. Symbolic examples">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2744892"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
+<p id="ch3list_tuples_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
+<pre class="programlisting">$ chmod ug+rw mydir
+$ ls -ld mydir
+drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
+<p id="ch3list_tuples_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
+<pre class="programlisting">$ chmod a-w myfile
+$ ls -l myfile
+-r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
+<p id="ch3list_tuples_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
+<pre class="programlisting">$ chmod ug=rx mydir
+$ ls -ld mydir
+dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
+</div>
+<div class="section" title="11.1.2.3. Octal numbers">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2744933"></a>11.1.2.3. Octal numbers</h5></div></div></div>
+<p id="ch3list_tuples_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
+<pre class="programlisting">$ chmod 664 myfile
+$ ls -l myfile
+-rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
+<p id="ch3list_tuples_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
+<pre class="programlisting">$ chmod 0664 myfile</pre>
+</div>
+<div class="section" title="11.1.2.4. Special modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2744973"></a>11.1.2.4. Special modes</h5></div></div></div>
+<p id="ch3list_tuples_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
+<p id="ch3list_tuples_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="12. Redirection and Piping">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2745018"></a>12. Redirection and Piping</h2></div></div></div>
+<p id="ch3list_tuples_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
+<p id="ch3list_tuples_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
+<div class="section" title="12.1. Redirecting standard input and standard output">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2745055"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
+<p id="ch3list_tuples_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
+<pre class="programlisting">$ command1 &gt; file1</pre>
+<p id="ch3list_tuples_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
+<pre class="programlisting">$ command1 &lt; file1</pre>
+<p id="ch3list_tuples_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
+<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
+<p id="ch3list_tuples_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
+</div>
+<div class="section" title="12.2. Piping">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2745124"></a>12.2. Piping</h3></div></div></div>
+<p id="ch3list_tuples_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
+A pipeline of three programs run on a text terminal:</p>
+<pre class="programlisting">$ command1 | command2</pre>
+<p id="ch3list_tuples_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
+<p id="ch3list_tuples_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
+<pre class="programlisting">$ command1 &gt; tempfile
+$ command2 &lt; tempfile
+$ rm tempfile</pre>
+<p id="ch3list_tuples_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
+<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
+<p id="ch3list_tuples_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
+</div>
+<div class="section" title="12.3. Redirecting to and from the standard file handles">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2745186"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
+<p id="ch3list_tuples_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
+<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
+<col width="12">
+<col width="13">
+<col width="24">
+</colgroup></table>
+<p id="ch3list_tuples_18d"></a>For example:</p>
+<pre class="programlisting">$ command1 2&gt; file1</pre>
+<p id="ch3list_tuples_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
+<p id="ch3list_tuples_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
+<p id="ch3list_tuples_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
+<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
+<p id="ch3list_tuples_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
+<p id="ch3list_tuples_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
+<p id="ch3list_tuples_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
+<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
+<p id="ch3list_tuples_194"></a>A simplified form of the command:</p>
+<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
+<p id="ch3list_tuples_195"></a>is:</p>
+<pre class="programlisting">$ command &amp;&gt;file</pre>
+<p id="ch3list_tuples_196"></a>or:</p>
+<pre class="programlisting">$command &gt;&amp;file</pre>
+</div>
+<div class="section" title="12.4. Chained pipelines">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2745390"></a>12.4. Chained pipelines</h3></div></div></div>
+<p id="ch3list_tuples_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
+<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
+<p id="ch3list_tuples_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
+</div>
+<div class="section" title="12.5. Redirect to multiple outputs">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2745424"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
+<p id="ch3list_tuples_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
+<pre class="programlisting">$ ls -lrt | tee xyz</pre>
+<p id="ch3list_tuples_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
+</div>
+</div>
+<div class="section" title="13. More Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2745454"></a>13. More Text Processing</h2></div></div></div>
+<div class="section" title="13.1. grep">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2745463"></a>13.1. grep</h3></div></div></div>
+<p id="ch3list_tuples_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
+<div class="section" title="13.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2745494"></a>13.1.1. Usage</h4></div></div></div>
+<p id="ch3list_tuples_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
+<pre class="programlisting">$ grep apple fruitlist.txt</pre>
+<p id="ch3list_tuples_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
+<p id="ch3list_tuples_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
+<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
+<p id="ch3list_tuples_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
+<p id="ch3list_tuples_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
+<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
+<p id="ch3list_tuples_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
+<div class="section" title="13.1.1.1. Variations">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2745573"></a>13.1.1.1. Variations</h5></div></div></div>
+<p id="ch3list_tuples_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
+<p id="ch3list_tuples_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
+<p id="ch3list_tuples_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
+</div>
+</div>
+</div>
+<div class="section" title="13.2. tr">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2745652"></a>13.2. tr</h3></div></div></div>
+<p id="ch3list_tuples_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
+<p id="ch3list_tuples_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
+<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
+<p id="ch3list_tuples_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
+<p id="ch3list_tuples_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
+<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
+<p id="ch3list_tuples_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
+<p id="ch3list_tuples_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
+<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
+<p id="ch3list_tuples_1ab"></a>therefore removes all non-alphanumeric characters.</p>
+<p id="ch3list_tuples_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
+<pre class="programlisting">$ tr -s '\n' '\n'</pre>
+<p id="ch3list_tuples_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
+<p id="ch3list_tuples_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
+<pre class="programlisting">$ tr -d '\r'</pre>
+<p id="ch3list_tuples_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
+<p id="ch3list_tuples_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
+</div>
+</div>
+<div class="section" title="14. Elementary Regex">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2745806"></a>14. Elementary Regex</h2></div></div></div>
+<p id="ch3list_tuples_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
+<p id="ch3list_tuples_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
+<p id="ch3list_tuples_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
+<p id="ch3list_tuples_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
+<table summary="Elementary Regex" border="1"><colgroup>
+<col width="13">
+<col width="60">
+</colgroup></table>
+<div class="section" title="14.1. Lazy quantification">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2746019"></a>14.1. Lazy quantification</h3></div></div></div>
+<p id="ch3list_tuples_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
+<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
+<p id="ch3list_tuples_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
+<p id="ch3list_tuples_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
+</div>
+</div>
+<div class="section" title="15. One Liners">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2746095"></a>15. One Liners</h2></div></div></div>
+<p id="ch3list_tuples_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
+<p id="ch3list_tuples_1cd"></a>The one liner can be</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem"><p id="ch3list_tuples_1ce"></a>An expression written in the language of the shell.</p></li>
+<li class="listitem"><p id="ch3list_tuples_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
+<li class="listitem"><p id="ch3list_tuples_1d0"></a>The invocation of a compiler together with source to compile and
+instructions for executing the compiled program.</p></li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch3list_tuples_1d1"></a>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.</p>
+<p id="ch3list_tuples_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
+<p id="ch3list_tuples_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
+<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
+<p id="ch3list_tuples_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
+<p id="ch3list_tuples_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
+<p id="ch3list_tuples_1d6"></a>Here are the first few of them:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<p id="ch3list_tuples_1d7"></a>Print the total number of input lines:</p>
+<p id="ch3list_tuples_1d8"></a>END { print NR }</p>
+</li>
+<li class="listitem">
+<p id="ch3list_tuples_1d9"></a>Print the tenth input line:</p>
+<p id="ch3list_tuples_1da"></a>NR == 10</p>
+</li>
+<li class="listitem">
+<p id="ch3list_tuples_1db"></a>Print the last field of every input line:</p>
+<p id="ch3list_tuples_1dc"></a>{ print $NF }</p>
+</li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch3list_tuples_1dd"></a>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.</p>
+<p id="ch3list_tuples_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
+<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
+*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
+<p id="ch3list_tuples_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
+<p id="ch3list_tuples_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
+<pre class="programlisting">$ prog foo 'f??'; echo $?
+
+$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
+<p id="ch3list_tuples_1e1"></a>Here is a one line shell script to show directories:</p>
+<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
+</div>
+</div>
+</div></body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/ch4strings_dicts.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1139 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Strings and Dicts </title>
+<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
+<script type="text/javascript" src="/review/support/jquery-min.js"></script>
+<script type="text/javascript" src="/review/support/form.js"></script>
+<script type="text/javascript" src="/review/support/hsbook.js"></script>
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch4strings_dicts ">
+<div class="titlepage"></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="article"><a href="#id2633629"></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2443754">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2631449">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2684690">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2684962">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2685094">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2685102">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2684456">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2684464">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2685688">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2685748">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2685850">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2685932">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2686111">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2686119">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2686212">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2686421">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2686511">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2686564">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2686572">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2686884">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2687015">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2687186">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2687278">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2687287">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2687373">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2687499">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2687585">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2687717">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2687825">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2687833">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2688020">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2688130">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2688372">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2688647">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2688663">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2688686">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2688695">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2689472">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2689508">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2689576">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2689638">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2689846">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2689880">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2689911">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2689920">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2690110">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2690261">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2690477">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2690554">15. One Liners</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="article">
+<div class="titlepage">
+<div><div><h2 class="title" id="id2633629"></a></h2></div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#id2443754">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2631449">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2684690">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2684962">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2685094">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2685102">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2684456">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2684464">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2685688">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2685748">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2685850">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2685932">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2686111">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2686119">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2686212">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2686421">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2686511">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2686564">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2686572">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2686884">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2687015">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2687186">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2687278">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2687287">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2687373">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2687499">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2687585">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2687717">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2687825">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2687833">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2688020">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2688130">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2688372">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2688647">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2688663">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2688686">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2688695">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2689472">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2689508">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2689576">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2689638">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2689846">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2689880">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2689911">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2689920">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2690110">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2690261">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2690477">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2690554">15. One Liners</a></span></dt>
+</dl>
+</div>
+<div class="section" title="1. Introducing Linux">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2443754"></a>1. Introducing Linux</h2></div></div></div>
+<p id="ch4strings_dicts_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
+<p id="ch4strings_dicts_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
+<p id="ch4strings_dicts_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
+<p id="ch4strings_dicts_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
+<div class="section" title="1.1. Historical Background">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2631449"></a>1.1. Historical Background</h3></div></div></div>
+<div class="section" title="1.1.1. Events leading to the creation">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2631415"></a>1.1.1. Events leading to the creation</h4></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
+</ul></div>
+</div>
+<div class="section" title="1.1.2. The Creation of Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2684645"></a>1.1.2. The Creation of Linux</h4></div></div></div>
+<p id="ch4strings_dicts_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
+<p id="ch4strings_dicts_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
+</div>
+</div>
+<div class="section" title="1.2. Design and Implications">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2684690"></a>1.2. Design and Implications</h3></div></div></div>
+<p id="ch4strings_dicts_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
+<div class="section" title="1.2.1. User Interface">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2684714"></a>1.2.1. User Interface</h4></div></div></div>
+<p id="ch4strings_dicts_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
+<p id="ch4strings_dicts_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
+</div>
+<div class="section" title="1.2.2. Development">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2684768"></a>1.2.2. Development</h4></div></div></div>
+<p id="ch4strings_dicts_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
+<p id="ch4strings_dicts_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
+<p id="ch4strings_dicts_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
+</div>
+<div class="section" title="1.2.3. Community">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2684824"></a>1.2.3. Community</h4></div></div></div>
+<p id="ch4strings_dicts_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
+<p id="ch4strings_dicts_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
+<p id="ch4strings_dicts_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
+</div>
+<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2684869"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
+<p id="ch4strings_dicts_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
+</div>
+<div class="section" title="1.2.5. Programming on Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2684915"></a>1.2.5. Programming on Linux</h4></div></div></div>
+<p id="ch4strings_dicts_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
+<p id="ch4strings_dicts_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
+<p id="ch4strings_dicts_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
+</div>
+</div>
+<div class="section" title="1.3. Reasons for Using Linux">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2684962"></a>1.3. Reasons for Using Linux</h3></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_16"></a>Linux is free:</p></li></ul></div>
+<p id="ch4strings_dicts_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
+Most of all, Linux is free as in "free speech":
+The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
+<p id="ch4strings_dicts_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_1a"></a>Linux was made to keep on running:</p></li></ul></div>
+<p id="ch4strings_dicts_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_1c"></a>Linux is secure and versatile:</p></li></ul></div>
+<p id="ch4strings_dicts_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_1e"></a>Linux is scalable:</p></li></ul></div>
+<p id="ch4strings_dicts_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
+<p id="ch4strings_dicts_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
+</div>
+</div>
+<div class="section" title="2. Getting Started">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2685094"></a>2. Getting Started</h2></div></div></div>
+<div class="section" title="2.1. Logging in, activating the user interface and logging out">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2685102"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
+<p id="ch4strings_dicts_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
+<div class="section" title="2.1.1. Graphical Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2685133"></a>2.1.1. Graphical Mode</h4></div></div></div>
+<p id="ch4strings_dicts_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
+<p id="ch4strings_dicts_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
+It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
+<p id="ch4strings_dicts_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
+<p id="ch4strings_dicts_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
+<p id="ch4strings_dicts_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
+<p id="ch4strings_dicts_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
+<p id="ch4strings_dicts_29"></a>Another common form for a prompt is this one:
+[</p>
+<div class="reference">
+<div class="titlepage"><hr></div>user@host</div>
+<p> dir]</p>
+<p id="ch4strings_dicts_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
+<p id="ch4strings_dicts_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
+</div>
+<div class="section" title="2.1.2. Text Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2685291"></a>2.1.2. Text Mode</h4></div></div></div>
+<p id="ch4strings_dicts_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
+<p id="ch4strings_dicts_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
+reasons.</p>
+<p id="ch4strings_dicts_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
+<p id="ch4strings_dicts_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
+<p id="ch4strings_dicts_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
+</div>
+</div>
+</div>
+<div class="section" title="3. Basic Commands">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2684456"></a>3. Basic Commands</h2></div></div></div>
+<div class="section" title="3.1. ls">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2684464"></a>3.1. ls</h3></div></div></div>
+<p id="ch4strings_dicts_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
+<p id="ch4strings_dicts_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
+<p id="ch4strings_dicts_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
+<pre class="programlisting">$ ls
+jeeves.rst psmith.html blandings.html
+$ ls -l
+drwxr--r--   1 plum  editors   4096  jeeves
+-rw-r--r--   1 plum  editors  30405  psmith
+-r-xr-xr-x   1 plum  plum      8460  blandings</pre>
+<p id="ch4strings_dicts_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
+</div>
+<div class="section" title="3.2. date">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2685688"></a>3.2. date</h3></div></div></div>
+<p id="ch4strings_dicts_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
+<p id="ch4strings_dicts_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
+<pre class="programlisting">$date
+Tue Sep  8 12:01:45 IST 2009</pre>
+<p id="ch4strings_dicts_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
+<pre class="programlisting">$date --set="20040908 01:22"</pre>
+<p id="ch4strings_dicts_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
+<pre class="programlisting">$man date</pre>
+<p id="ch4strings_dicts_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
+</div>
+<div class="section" title="3.3. cd">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2685748"></a>3.3. cd</h3></div></div></div>
+<p id="ch4strings_dicts_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
+<p id="ch4strings_dicts_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
+<p id="ch4strings_dicts_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
+<p id="ch4strings_dicts_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
+<p id="ch4strings_dicts_46"></a>Absolute paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch4strings_dicts_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_48"></a>For example to get to /boot/grub you would type:</p>
+<pre class="programlisting">$cd /boot/grub</pre>
+<p id="ch4strings_dicts_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
+<p id="ch4strings_dicts_4a"></a>Relative paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch4strings_dicts_4b"></a>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.</p>
+<p id="ch4strings_dicts_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
+<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_4d"></a>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.</p>
+</div>
+<div class="section" title="3.4. who">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2685850"></a>3.4. who</h3></div></div></div>
+<p id="ch4strings_dicts_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
+<p id="ch4strings_dicts_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
+<pre class="programlisting">$who
+beeblebrox tty7         2009-09-08 10:50 (:0)
+beeblebrox pts/0        2009-09-08 11:25 (:0.0)
+dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
+beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
+<p id="ch4strings_dicts_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
+<p id="ch4strings_dicts_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
+<pre class="programlisting">$man who</pre>
+<p id="ch4strings_dicts_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
+</div>
+<div class="section" title="3.5. mkdir">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2685932"></a>3.5. mkdir</h3></div></div></div>
+<p id="ch4strings_dicts_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
+<pre class="programlisting">$mkdir name_of_directory</pre>
+<p id="ch4strings_dicts_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
+<div class="section" title="3.5.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2685964"></a>3.5.1. Options</h4></div></div></div>
+<p id="ch4strings_dicts_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
+</div>
+<div class="section" title="3.5.2. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2686025"></a>3.5.2. Examples</h4></div></div></div>
+<p id="ch4strings_dicts_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
+<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
+<p id="ch4strings_dicts_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
+<p id="ch4strings_dicts_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
+<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
+<p id="ch4strings_dicts_5d"></a>This will create:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_5e"></a>tag</p></li>
+<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
+</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
+</div>
+</div>
+</div>
+<div class="section" title="4. Getting Help">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2686111"></a>4. Getting Help</h2></div></div></div>
+<div class="section" title="4.1. apropos and whatis">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2686119"></a>4.1. apropos and whatis</h3></div></div></div>
+<p id="ch4strings_dicts_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
+<pre class="programlisting">$ apropos grep
+egrep       egrep (1)       Search a file for a pattern using full regular expressions
+fgrep       fgrep (1)       Search a file for a fixed-character string
+fmlgrep     fmlgrep (1)     Search a file for a pattern
+grep        grep (1)        Search a file for a pattern
+gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
+nisgrep     nismatch (1)    Utilities for searching NIS+ tables
+pgrep       pgrep (1)       Find or signal a process by name or other attribute
+zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
+...</pre>
+<p id="ch4strings_dicts_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
+<p id="ch4strings_dicts_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
+<pre class="programlisting">$whatis ls
+ls (1)           - list directory contents</pre>
+<p id="ch4strings_dicts_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
+<p id="ch4strings_dicts_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
+<pre class="programlisting">$apropos browser
+gmusicbrowser (1)    - Jukebox for large collections of audio files
+infobrowser (1)      - read Info documents
+libsmbclient (7)     - An extension library for browsers and that               can be used...
+opera (1)            - a standards-compliant graphical Web browser
+sensible-browser (1) - sensible editing, paging, and web browsing
+smbtree (1)          - A text based smb network browser
+tvtk_doc (1)         - A GUI based TVTK documentation search browser.
+viewres (1)          - graphical class browser for Xt
+w3m (1)              - a text based Web browser and pager
+www-browser (1)      - a text based Web browser and pager
+...</pre>
+</div>
+<div class="section" title="4.2. man">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2686212"></a>4.2. man</h3></div></div></div>
+<p id="ch4strings_dicts_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
+<p id="ch4strings_dicts_66"></a>To read a manual page for a Unix command, one can use:</p>
+<pre class="programlisting">$ man &lt;command_name&gt;</pre>
+<p id="ch4strings_dicts_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
+<p id="ch4strings_dicts_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
+<pre class="programlisting">$man 3 printf</pre>
+<p id="ch4strings_dicts_69"></a>Another example:</p>
+<pre class="programlisting">$man man</pre>
+<p id="ch4strings_dicts_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
+<div class="section" title="4.2.1. Layout">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2686294"></a>4.2.1. Layout</h4></div></div></div>
+<p id="ch4strings_dicts_6b"></a>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:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch4strings_dicts_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch4strings_dicts_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch4strings_dicts_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch4strings_dicts_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch4strings_dicts_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch4strings_dicts_71"></a>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.</p>
+<p id="ch4strings_dicts_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
+<p id="ch4strings_dicts_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
+<p id="ch4strings_dicts_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
+<p id="ch4strings_dicts_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
+<p id="ch4strings_dicts_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
+</div>
+</div>
+<div class="section" title="4.3. info">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2686421"></a>4.3. info</h3></div></div></div>
+<p id="ch4strings_dicts_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
+<p id="ch4strings_dicts_78"></a>The syntax is</p>
+<pre class="programlisting">$ info &lt;command_name&gt;</pre>
+<p id="ch4strings_dicts_79"></a><span class="emphasis"><em>info</em></span> 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</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
+</div>
+<div class="section" title="4.4. --help">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2686511"></a>4.4. --help</h3></div></div></div>
+<p id="ch4strings_dicts_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
+<pre class="programlisting">$ userprompt@host: cat --help
+Usage: cat [OPTION] [FILE]...
+Concatenate FILE(s), or standard input, to standard output.
+
+  -A, --show-all           equivalent to -vET
+  -b, --number-nonblank    number nonempty output lines
+  -e                       equivalent to -vE
+  -E, --show-ends          display $ at end of each line
+  -n, --number             number all output lines
+  -s, --squeeze-blank      suppress repeated empty output lines
+  -t                       equivalent to -vT
+  -T, --show-tabs          display TAB characters as ^I
+  -u                       (ignored)
+  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
+  --help     display this help and exit
+  --version  output version information and exit
+
+With no FILE, or when FILE is -, read standard input.
+
+Examples:
+  cat f - g  Output f's contents, then standard input, then g's           contents.
+  cat        Copy standard input to standard output.
+
+Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
+</div>
+</div>
+<div class="section" title="5. Basic file handling">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2686564"></a>5. Basic file handling</h2></div></div></div>
+<div class="section" title="5.1. cp">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2686572"></a>5.1. cp</h3></div></div></div>
+<p id="ch4strings_dicts_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
+<div class="section" title="5.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2686590"></a>5.1.1. Usage</h4></div></div></div>
+<p id="ch4strings_dicts_82"></a>To copy a file to another file:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
+<p id="ch4strings_dicts_83"></a>To copy a file to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
+<p id="ch4strings_dicts_84"></a>To copy a directory to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
+SourceDirectory ... TargetDirectory</pre>
+</div>
+<div class="section" title="5.1.2. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2686624"></a>5.1.2. Flags</h4></div></div></div>
+<p id="ch4strings_dicts_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
+<p id="ch4strings_dicts_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
+<p id="ch4strings_dicts_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
+<p id="ch4strings_dicts_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_89"></a>The time of the last data modification and the time of the last access.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
+</div>
+<div class="section" title="5.1.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2686722"></a>5.1.3. Examples</h4></div></div></div>
+<p id="ch4strings_dicts_8d"></a>To make a copy of a file in the current directory, enter:</p>
+<pre class="programlisting">$ cp prog.c prog.bak</pre>
+<p id="ch4strings_dicts_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
+<p id="ch4strings_dicts_8f"></a>To copy a file in your current directory into another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
+<p id="ch4strings_dicts_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
+<p id="ch4strings_dicts_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
+<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
+<p id="ch4strings_dicts_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
+<p id="ch4strings_dicts_93"></a>To copy all the files in a directory to a new directory, enter:</p>
+<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
+<p id="ch4strings_dicts_94"></a>This copies only the files in the clients directory to the customers directory.</p>
+<p id="ch4strings_dicts_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch4strings_dicts_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
+<p id="ch4strings_dicts_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
+<p id="ch4strings_dicts_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
+<p id="ch4strings_dicts_9a"></a>To use pattern-matching characters to copy files, enter:</p>
+<pre class="programlisting">$ cp programs/*.py .</pre>
+<p id="ch4strings_dicts_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
+</div>
+</div>
+<div class="section" title="5.2. mv">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2686884"></a>5.2. mv</h3></div></div></div>
+<p id="ch4strings_dicts_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
+<div class="section" title="5.2.1. Conflicting existing file">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2686907"></a>5.2.1. Conflicting existing file</h4></div></div></div>
+<p id="ch4strings_dicts_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
+</div>
+<div class="section" title="5.2.2. Differences with copy and delete">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2686927"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
+<p id="ch4strings_dicts_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
+</div>
+<div class="section" title="5.2.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2686957"></a>5.2.3. Examples</h4></div></div></div>
+<pre class="programlisting">$ mv myfile mynewfilename    renames a file
+$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
+$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
+$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
+$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
+$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
+$ mv foo bar baz dir         moves multiple files to directory dir
+$ mv --help                  shows a very concise help about the                syntax of the command
+$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
+<p id="ch4strings_dicts_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
+<p id="ch4strings_dicts_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
+</div>
+</div>
+<div class="section" title="5.3. rm">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2687015"></a>5.3. rm</h3></div></div></div>
+<p id="ch4strings_dicts_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
+<p id="ch4strings_dicts_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
+<pre class="programlisting">$ rm -i foo
+remove foo? y</pre>
+<div class="section" title="5.3.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2687045"></a>5.3.1. Options</h4></div></div></div>
+<p id="ch4strings_dicts_a3"></a>Common options that rm accepts include:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
+<p id="ch4strings_dicts_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
+<p id="ch4strings_dicts_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
+<pre class="programlisting">xargs rm &lt; filelist</pre>
+<p id="ch4strings_dicts_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
+</div>
+<div class="section" title="5.3.2. Permissions">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2687147"></a>5.3.2. Permissions</h4></div></div></div>
+<p id="ch4strings_dicts_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
+<p id="ch4strings_dicts_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
+<p id="ch4strings_dicts_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
+</div>
+</div>
+</div>
+<div class="section" title="6. Command Line Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2687186"></a>6. Command Line Arguments</h2></div></div></div>
+<p id="ch4strings_dicts_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
+<p id="ch4strings_dicts_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
+<pre class="programlisting">rm file.s</pre>
+<p id="ch4strings_dicts_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
+<p id="ch4strings_dicts_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
+<p id="ch4strings_dicts_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
+<p id="ch4strings_dicts_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
+<p id="ch4strings_dicts_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
+</div>
+<div class="section" title="7. Basic Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2687278"></a>7. Basic Text Processing</h2></div></div></div>
+<div class="section" title="7.1. head">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2687287"></a>7.1. head</h3></div></div></div>
+<p id="ch4strings_dicts_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
+<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
+<p id="ch4strings_dicts_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
+<pre class="programlisting">$ head -n 20 filename</pre>
+<p id="ch4strings_dicts_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ head -n 5 foo*</pre>
+<p id="ch4strings_dicts_b9"></a>Some versions omit the n and just let you say -5.</p>
+<div class="section" title="7.1.1. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2687338"></a>7.1.1. Flags</h4></div></div></div>
+<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
+<p id="ch4strings_dicts_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
+<p id="ch4strings_dicts_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
+<pre class="programlisting">sed 5q foo</pre>
+<p id="ch4strings_dicts_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
+</div>
+</div>
+<div class="section" title="7.2. tail">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2687373"></a>7.2. tail</h3></div></div></div>
+<p id="ch4strings_dicts_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
+<p id="ch4strings_dicts_be"></a>The command-syntax is:</p>
+<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
+<p id="ch4strings_dicts_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
+<pre class="programlisting">$ tail -n 20 filename</pre>
+<p id="ch4strings_dicts_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ tail -c 15 foo*</pre>
+<p id="ch4strings_dicts_c1"></a>This example shows all lines of filename from the second line onwards:</p>
+<pre class="programlisting">$ tail -n +2 filename</pre>
+<p id="ch4strings_dicts_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
+<pre class="programlisting">$ tail -20 filename
+$ tail -50c filename</pre>
+<p id="ch4strings_dicts_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
+<div class="section" title="7.2.1. File monitoring">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2687451"></a>7.2.1. File monitoring</h4></div></div></div>
+<p id="ch4strings_dicts_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
+<pre class="programlisting">$ tail -f /var/adm/messages</pre>
+<p id="ch4strings_dicts_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
+<p id="ch4strings_dicts_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
+</div>
+</div>
+<div class="section" title="7.3. cut">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2687499"></a>7.3. cut</h3></div></div></div>
+<p id="ch4strings_dicts_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
+<p id="ch4strings_dicts_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
+<p id="ch4strings_dicts_c9"></a>Assuming a file named file containing the lines:</p>
+<pre class="programlisting">foo:bar:baz:qux:quux
+one:two:three:four:five:six:seven
+alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+<p id="ch4strings_dicts_ca"></a>To output the fourth through tenth characters of each line:</p>
+<pre class="programlisting">$ cut -c 4-10 file</pre>
+<p id="ch4strings_dicts_cb"></a>This gives the output:</p>
+<pre class="programlisting">:bar:ba
+:two:th
+ha:beta</pre>
+<p id="ch4strings_dicts_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
+<pre class="programlisting">$ cut -d : -f 5- file</pre>
+<p id="ch4strings_dicts_cd"></a>This gives the output:</p>
+<pre class="programlisting">quux
+five:six:seven
+epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+</div>
+<div class="section" title="7.4. paste">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2687585"></a>7.4. paste</h3></div></div></div>
+<p id="ch4strings_dicts_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
+<p id="ch4strings_dicts_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
+<pre class="programlisting">$ paste who where when &gt; www</pre>
+<p id="ch4strings_dicts_d0"></a>If the files contain:</p>
+<table summary="paste" border="1"><colgroup>
+<col width="11">
+<col width="12">
+<col width="12">
+</colgroup></table>
+<p id="ch4strings_dicts_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
+<pre class="programlisting">Batman            GothamCity       January 3
+Trillian          Andromeda        February 4
+Jeeves            London           March 19</pre>
+</div>
+</div>
+<div class="section" title="8. Shell Meta Characters">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2687717"></a>8. Shell Meta Characters</h2></div></div></div>
+<p id="ch4strings_dicts_de"></a>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.</p>
+<p id="ch4strings_dicts_df"></a>The shell meta characters include:</p>
+<p id="ch4strings_dicts_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
+<p id="ch4strings_dicts_e1"></a>Different shells may differ in the meta characters recognized.</p>
+<p id="ch4strings_dicts_e2"></a>As an example,</p>
+<pre class="programlisting">$ ls file.*</pre>
+<p id="ch4strings_dicts_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
+<pre class="programlisting">$ ls file.?</pre>
+<p id="ch4strings_dicts_e4"></a>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:</p>
+<pre class="programlisting">$ more c*</pre>
+<p id="ch4strings_dicts_e5"></a>because the c* matches that long file name.</p>
+<p id="ch4strings_dicts_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
+<pre class="programlisting">$ rm ??more</pre>
+<p id="ch4strings_dicts_e7"></a>or:</p>
+<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
+<p id="ch4strings_dicts_e8"></a>or:</p>
+<pre class="programlisting">$ rm ''*|more''</pre>
+</div>
+<div class="section" title="9. Looking At Files">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2687825"></a>9. Looking At Files</h2></div></div></div>
+<div class="section" title="9.1. cat">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2687833"></a>9.1. cat</h3></div></div></div>
+<p id="ch4strings_dicts_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
+<p id="ch4strings_dicts_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
+<p id="ch4strings_dicts_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
+<div class="section" title="9.1.1. Jargon File Definition">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2687876"></a>9.1.1. Jargon File Definition</h4></div></div></div>
+<p id="ch4strings_dicts_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
+<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
+     pause (syn. blast).
+
+2. By extension, to dump large amounts of data at an unprepared target or
+     with no intention of browsing it carefully. Usage: considered silly.
+     Rare outside Unix sites. See also dd, BLT.
+
+     Among Unix fans, *cat(1)* is considered an excellent example of
+     user-interface design, because it delivers the file contents without
+     such verbosity as spacing or headers between the files, and because
+     it does not require the files to consist of lines of text, but works
+     with any sort of data.
+
+     Among Unix critics, *cat(1)* is considered the canonical example of
+     bad user-interface design, because of its woefully unobvious name.
+     It is far more often used to blast a single file to standard output
+     than to concatenate two or more files. The name cat for the former
+     operation is just as unintuitive as, say, LISP's cdr.
+
+     Of such oppositions are holy wars made...</pre>
+</div>
+<div class="section" title="9.1.2. Useless Use of 'cat'">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2687915"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
+<p id="ch4strings_dicts_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
+<p id="ch4strings_dicts_ee"></a>Nevertheless one sees people doing:</p>
+<pre class="programlisting">$ cat file | some_command and its args ...</pre>
+<p id="ch4strings_dicts_ef"></a>instead of the equivalent and cheaper:</p>
+<pre class="programlisting">&lt;file some_command and its args ...</pre>
+<p id="ch4strings_dicts_f0"></a>or (equivalently and more classically):</p>
+<pre class="programlisting">some_command and its args ... &lt;file</pre>
+<p id="ch4strings_dicts_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
+<p id="ch4strings_dicts_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
+</div>
+<div class="section" title="9.1.3. zcat">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2687986"></a>9.1.3. zcat</h4></div></div></div>
+<p id="ch4strings_dicts_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
+</div>
+</div>
+<div class="section" title="9.2. more">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2688020"></a>9.2. more</h3></div></div></div>
+<p id="ch4strings_dicts_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
+<div class="section" title="9.2.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2688039"></a>9.2.1. Usage</h4></div></div></div>
+<p id="ch4strings_dicts_f5"></a>The command-syntax is:</p>
+<pre class="programlisting">$ more [options] [file_name]</pre>
+<p id="ch4strings_dicts_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
+<p id="ch4strings_dicts_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
+<p id="ch4strings_dicts_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
+<p id="ch4strings_dicts_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
+</div>
+</div>
+<div class="section" title="9.3. less">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2688130"></a>9.3. less</h3></div></div></div>
+<p id="ch4strings_dicts_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
+<div class="section" title="9.3.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2688158"></a>9.3.1. Usage</h4></div></div></div>
+<p id="ch4strings_dicts_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
+<p id="ch4strings_dicts_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
+<p id="ch4strings_dicts_fd"></a>The command-syntax is:</p>
+<pre class="programlisting">$ less [options] file_name</pre>
+</div>
+<div class="section" title="9.3.2. Frequently Used Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2688213"></a>9.3.2. Frequently Used Options</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_ff"></a>-I: Case-insensitive searches.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_103"></a>-?: Shows help.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.3. Frequently Used Commands">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2688266"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_105"></a>[Space bar]: Next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_106"></a>b: Previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_10a"></a>'^ or g: Go to start of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_10b"></a>'$ or G: Go to end of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_10d"></a>=: File information.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_10e"></a>h: Help.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_10f"></a>q: Quit.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.4. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2688357"></a>9.3.4. Examples</h4></div></div></div>
+<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
+$ less +F /var/log/mail.log              #Follow mode for log
+$ file * | less                          #Easier file analysis.
+$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
+</div>
+</div>
+</div>
+<div class="section" title="10. Directory Structure">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2688372"></a>10. Directory Structure</h2></div></div></div>
+<p id="ch4strings_dicts_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
+<p id="ch4strings_dicts_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
+<table summary="Directory Structure" border="1"><colgroup>
+<col width="15">
+<col width="48">
+</colgroup></table>
+<div class="section" title="10.1. man hier">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2688647"></a>10.1. man hier</h3></div></div></div>
+<p id="ch4strings_dicts_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
+<pre class="programlisting">$ man hier</pre>
+</div>
+<div class="section" title="10.2. ls -l">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2688663"></a>10.2. ls -l</h3></div></div></div>
+<p id="ch4strings_dicts_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
+<pre class="programlisting">$ ls -l</pre>
+<p id="ch4strings_dicts_138"></a>This can be done after entering the required directory.</p>
+</div>
+</div>
+<div class="section" title="11. Permissions and Ownership">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2688686"></a>11. Permissions and Ownership</h2></div></div></div>
+<div class="section" title="11.1. chmod">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2688695"></a>11.1. chmod</h3></div></div></div>
+<p id="ch4strings_dicts_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
+<div class="section" title="11.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2688721"></a>11.1.1. Usage</h4></div></div></div>
+<p id="ch4strings_dicts_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
+<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
+<p id="ch4strings_dicts_13b"></a>To view what the permissions currently are, type:</p>
+<pre class="programlisting">$ ls -l file</pre>
+</div>
+<div class="section" title="11.1.2. Command line options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2688749"></a>11.1.2. Command line options</h4></div></div></div>
+<p id="ch4strings_dicts_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
+</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2688786"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
+<p id="ch4strings_dicts_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
+<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
+<p id="ch4strings_dicts_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="8">
+<col width="45">
+</colgroup></table>
+<p id="ch4strings_dicts_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="54">
+</colgroup></table>
+<p id="ch4strings_dicts_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="5">
+<col width="14">
+<col width="48">
+</colgroup></table>
+<p id="ch4strings_dicts_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
+</div>
+<div class="section" title="11.1.2.2. Symbolic examples">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2689347"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
+<p id="ch4strings_dicts_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
+<pre class="programlisting">$ chmod ug+rw mydir
+$ ls -ld mydir
+drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
+<p id="ch4strings_dicts_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
+<pre class="programlisting">$ chmod a-w myfile
+$ ls -l myfile
+-r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
+<p id="ch4strings_dicts_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
+<pre class="programlisting">$ chmod ug=rx mydir
+$ ls -ld mydir
+dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
+</div>
+<div class="section" title="11.1.2.3. Octal numbers">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2689390"></a>11.1.2.3. Octal numbers</h5></div></div></div>
+<p id="ch4strings_dicts_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
+<pre class="programlisting">$ chmod 664 myfile
+$ ls -l myfile
+-rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
+<p id="ch4strings_dicts_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
+<pre class="programlisting">$ chmod 0664 myfile</pre>
+</div>
+<div class="section" title="11.1.2.4. Special modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2689428"></a>11.1.2.4. Special modes</h5></div></div></div>
+<p id="ch4strings_dicts_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
+<p id="ch4strings_dicts_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="12. Redirection and Piping">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2689472"></a>12. Redirection and Piping</h2></div></div></div>
+<p id="ch4strings_dicts_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
+<p id="ch4strings_dicts_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
+<div class="section" title="12.1. Redirecting standard input and standard output">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2689508"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
+<p id="ch4strings_dicts_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
+<pre class="programlisting">$ command1 &gt; file1</pre>
+<p id="ch4strings_dicts_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
+<pre class="programlisting">$ command1 &lt; file1</pre>
+<p id="ch4strings_dicts_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
+<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
+<p id="ch4strings_dicts_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
+</div>
+<div class="section" title="12.2. Piping">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2689576"></a>12.2. Piping</h3></div></div></div>
+<p id="ch4strings_dicts_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
+A pipeline of three programs run on a text terminal:</p>
+<pre class="programlisting">$ command1 | command2</pre>
+<p id="ch4strings_dicts_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
+<p id="ch4strings_dicts_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
+<pre class="programlisting">$ command1 &gt; tempfile
+$ command2 &lt; tempfile
+$ rm tempfile</pre>
+<p id="ch4strings_dicts_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
+<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
+<p id="ch4strings_dicts_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
+</div>
+<div class="section" title="12.3. Redirecting to and from the standard file handles">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2689638"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
+<p id="ch4strings_dicts_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
+<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
+<col width="12">
+<col width="13">
+<col width="24">
+</colgroup></table>
+<p id="ch4strings_dicts_18d"></a>For example:</p>
+<pre class="programlisting">$ command1 2&gt; file1</pre>
+<p id="ch4strings_dicts_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
+<p id="ch4strings_dicts_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
+<p id="ch4strings_dicts_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
+<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
+<p id="ch4strings_dicts_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
+<p id="ch4strings_dicts_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
+<p id="ch4strings_dicts_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
+<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
+<p id="ch4strings_dicts_194"></a>A simplified form of the command:</p>
+<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
+<p id="ch4strings_dicts_195"></a>is:</p>
+<pre class="programlisting">$ command &amp;&gt;file</pre>
+<p id="ch4strings_dicts_196"></a>or:</p>
+<pre class="programlisting">$command &gt;&amp;file</pre>
+</div>
+<div class="section" title="12.4. Chained pipelines">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2689846"></a>12.4. Chained pipelines</h3></div></div></div>
+<p id="ch4strings_dicts_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
+<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
+<p id="ch4strings_dicts_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
+</div>
+<div class="section" title="12.5. Redirect to multiple outputs">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2689880"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
+<p id="ch4strings_dicts_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
+<pre class="programlisting">$ ls -lrt | tee xyz</pre>
+<p id="ch4strings_dicts_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
+</div>
+</div>
+<div class="section" title="13. More Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2689911"></a>13. More Text Processing</h2></div></div></div>
+<div class="section" title="13.1. grep">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2689920"></a>13.1. grep</h3></div></div></div>
+<p id="ch4strings_dicts_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
+<div class="section" title="13.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2689951"></a>13.1.1. Usage</h4></div></div></div>
+<p id="ch4strings_dicts_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
+<pre class="programlisting">$ grep apple fruitlist.txt</pre>
+<p id="ch4strings_dicts_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
+<p id="ch4strings_dicts_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
+<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
+<p id="ch4strings_dicts_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
+<p id="ch4strings_dicts_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
+<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
+<p id="ch4strings_dicts_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
+<div class="section" title="13.1.1.1. Variations">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2690030"></a>13.1.1.1. Variations</h5></div></div></div>
+<p id="ch4strings_dicts_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
+<p id="ch4strings_dicts_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
+<p id="ch4strings_dicts_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
+</div>
+</div>
+</div>
+<div class="section" title="13.2. tr">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2690110"></a>13.2. tr</h3></div></div></div>
+<p id="ch4strings_dicts_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
+<p id="ch4strings_dicts_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
+<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
+<p id="ch4strings_dicts_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
+<p id="ch4strings_dicts_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
+<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
+<p id="ch4strings_dicts_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
+<p id="ch4strings_dicts_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
+<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
+<p id="ch4strings_dicts_1ab"></a>therefore removes all non-alphanumeric characters.</p>
+<p id="ch4strings_dicts_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
+<pre class="programlisting">$ tr -s '\n' '\n'</pre>
+<p id="ch4strings_dicts_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
+<p id="ch4strings_dicts_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
+<pre class="programlisting">$ tr -d '\r'</pre>
+<p id="ch4strings_dicts_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
+<p id="ch4strings_dicts_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
+</div>
+</div>
+<div class="section" title="14. Elementary Regex">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2690261"></a>14. Elementary Regex</h2></div></div></div>
+<p id="ch4strings_dicts_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
+<p id="ch4strings_dicts_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
+<p id="ch4strings_dicts_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
+<p id="ch4strings_dicts_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
+<table summary="Elementary Regex" border="1"><colgroup>
+<col width="13">
+<col width="60">
+</colgroup></table>
+<div class="section" title="14.1. Lazy quantification">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2690477"></a>14.1. Lazy quantification</h3></div></div></div>
+<p id="ch4strings_dicts_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
+<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
+<p id="ch4strings_dicts_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
+<p id="ch4strings_dicts_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
+</div>
+</div>
+<div class="section" title="15. One Liners">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2690554"></a>15. One Liners</h2></div></div></div>
+<p id="ch4strings_dicts_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
+<p id="ch4strings_dicts_1cd"></a>The one liner can be</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem"><p id="ch4strings_dicts_1ce"></a>An expression written in the language of the shell.</p></li>
+<li class="listitem"><p id="ch4strings_dicts_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
+<li class="listitem"><p id="ch4strings_dicts_1d0"></a>The invocation of a compiler together with source to compile and
+instructions for executing the compiled program.</p></li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_1d1"></a>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.</p>
+<p id="ch4strings_dicts_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
+<p id="ch4strings_dicts_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
+<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
+<p id="ch4strings_dicts_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
+<p id="ch4strings_dicts_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
+<p id="ch4strings_dicts_1d6"></a>Here are the first few of them:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<p id="ch4strings_dicts_1d7"></a>Print the total number of input lines:</p>
+<p id="ch4strings_dicts_1d8"></a>END { print NR }</p>
+</li>
+<li class="listitem">
+<p id="ch4strings_dicts_1d9"></a>Print the tenth input line:</p>
+<p id="ch4strings_dicts_1da"></a>NR == 10</p>
+</li>
+<li class="listitem">
+<p id="ch4strings_dicts_1db"></a>Print the last field of every input line:</p>
+<p id="ch4strings_dicts_1dc"></a>{ print $NF }</p>
+</li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_1dd"></a>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.</p>
+<p id="ch4strings_dicts_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
+<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
+*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
+<p id="ch4strings_dicts_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
+<p id="ch4strings_dicts_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
+<pre class="programlisting">$ prog foo 'f??'; echo $?
+
+$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
+<p id="ch4strings_dicts_1e1"></a>Here is a one line shell script to show directories:</p>
+<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
+</div>
+</div>
+</div></body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/ch5func.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1138 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Functions</title>
+<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
+<script type="text/javascript" src="/review/support/jquery-min.js"></script>
+<script type="text/javascript" src="/review/support/form.js"></script>
+<script type="text/javascript" src="/review/support/hsbook.js"></script>
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch5func ">
+<div class="titlepage"></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="article"><a href="#id2679232"></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2489356">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2677051">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2730291">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2730555">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2730682">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2730690">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2730962">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2730971">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2731128">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2731186">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2731284">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2731364">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2731537">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2731546">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2731626">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2731830">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2731920">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2731974">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2731982">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2732293">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2730087">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2732733">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2732826">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2732834">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2732922">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2733049">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2733135">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2733270">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2733377">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2733385">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2733573">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2733687">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2733925">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2734190">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2734206">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2734228">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2734237">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2734996">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2735033">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2735102">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2735162">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2735363">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2735397">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2735427">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2735436">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2735624">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2735772">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2735981">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2736057">15. One Liners</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="article">
+<div class="titlepage">
+<div><div><h2 class="title" id="id2679232"></a></h2></div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#id2489356">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2677051">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2730291">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2730555">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2730682">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2730690">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2730962">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2730971">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2731128">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2731186">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2731284">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2731364">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2731537">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2731546">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2731626">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2731830">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2731920">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2731974">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2731982">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2732293">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2730087">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2732733">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2732826">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2732834">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2732922">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2733049">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2733135">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2733270">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2733377">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2733385">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2733573">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2733687">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2733925">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2734190">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2734206">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2734228">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2734237">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2734996">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2735033">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2735102">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2735162">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2735363">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2735397">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2735427">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2735436">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2735624">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2735772">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2735981">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2736057">15. One Liners</a></span></dt>
+</dl>
+</div>
+<div class="section" title="1. Introducing Linux">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2489356"></a>1. Introducing Linux</h2></div></div></div>
+<p id="ch5func_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
+<p id="ch5func_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
+<p id="ch5func_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
+<p id="ch5func_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
+<div class="section" title="1.1. Historical Background">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2677051"></a>1.1. Historical Background</h3></div></div></div>
+<div class="section" title="1.1.1. Events leading to the creation">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2676925"></a>1.1.1. Events leading to the creation</h4></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch5func_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
+</ul></div>
+</div>
+<div class="section" title="1.1.2. The Creation of Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2730246"></a>1.1.2. The Creation of Linux</h4></div></div></div>
+<p id="ch5func_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
+<p id="ch5func_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
+</div>
+</div>
+<div class="section" title="1.2. Design and Implications">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2730291"></a>1.2. Design and Implications</h3></div></div></div>
+<p id="ch5func_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
+<div class="section" title="1.2.1. User Interface">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2730315"></a>1.2.1. User Interface</h4></div></div></div>
+<p id="ch5func_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
+<p id="ch5func_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
+</div>
+<div class="section" title="1.2.2. Development">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2730367"></a>1.2.2. Development</h4></div></div></div>
+<p id="ch5func_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
+<p id="ch5func_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
+<p id="ch5func_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
+</div>
+<div class="section" title="1.2.3. Community">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2730422"></a>1.2.3. Community</h4></div></div></div>
+<p id="ch5func_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
+<p id="ch5func_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
+<p id="ch5func_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
+</div>
+<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2730466"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
+<p id="ch5func_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
+</div>
+<div class="section" title="1.2.5. Programming on Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2730511"></a>1.2.5. Programming on Linux</h4></div></div></div>
+<p id="ch5func_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
+<p id="ch5func_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
+<p id="ch5func_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
+</div>
+</div>
+<div class="section" title="1.3. Reasons for Using Linux">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2730555"></a>1.3. Reasons for Using Linux</h3></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch5func_16"></a>Linux is free:</p></li></ul></div>
+<p id="ch5func_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
+Most of all, Linux is free as in "free speech":
+The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch5func_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
+<p id="ch5func_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch5func_1a"></a>Linux was made to keep on running:</p></li></ul></div>
+<p id="ch5func_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch5func_1c"></a>Linux is secure and versatile:</p></li></ul></div>
+<p id="ch5func_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch5func_1e"></a>Linux is scalable:</p></li></ul></div>
+<p id="ch5func_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch5func_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
+<p id="ch5func_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
+</div>
+</div>
+<div class="section" title="2. Getting Started">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2730682"></a>2. Getting Started</h2></div></div></div>
+<div class="section" title="2.1. Logging in, activating the user interface and logging out">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2730690"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
+<p id="ch5func_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
+<div class="section" title="2.1.1. Graphical Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2730720"></a>2.1.1. Graphical Mode</h4></div></div></div>
+<p id="ch5func_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
+<p id="ch5func_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
+It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
+<p id="ch5func_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
+<p id="ch5func_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
+<p id="ch5func_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
+<p id="ch5func_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
+<p id="ch5func_29"></a>Another common form for a prompt is this one:
+[</p>
+<div class="reference">
+<div class="titlepage"><hr></div>user@host</div>
+<p> dir]</p>
+<p id="ch5func_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
+<p id="ch5func_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
+</div>
+<div class="section" title="2.1.2. Text Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2730875"></a>2.1.2. Text Mode</h4></div></div></div>
+<p id="ch5func_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
+<p id="ch5func_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
+reasons.</p>
+<p id="ch5func_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
+<p id="ch5func_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
+<p id="ch5func_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
+</div>
+</div>
+</div>
+<div class="section" title="3. Basic Commands">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2730962"></a>3. Basic Commands</h2></div></div></div>
+<div class="section" title="3.1. ls">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2730971"></a>3.1. ls</h3></div></div></div>
+<p id="ch5func_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
+<p id="ch5func_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
+<p id="ch5func_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch5func_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch5func_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
+<pre class="programlisting">$ ls
+jeeves.rst psmith.html blandings.html
+$ ls -l
+drwxr--r--   1 plum  editors   4096  jeeves
+-rw-r--r--   1 plum  editors  30405  psmith
+-r-xr-xr-x   1 plum  plum      8460  blandings</pre>
+<p id="ch5func_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
+</div>
+<div class="section" title="3.2. date">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2731128"></a>3.2. date</h3></div></div></div>
+<p id="ch5func_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
+<p id="ch5func_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
+<pre class="programlisting">$date
+Tue Sep  8 12:01:45 IST 2009</pre>
+<p id="ch5func_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
+<pre class="programlisting">$date --set="20040908 01:22"</pre>
+<p id="ch5func_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
+<pre class="programlisting">$man date</pre>
+<p id="ch5func_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
+</div>
+<div class="section" title="3.3. cd">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2731186"></a>3.3. cd</h3></div></div></div>
+<p id="ch5func_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
+<p id="ch5func_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
+<p id="ch5func_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
+<p id="ch5func_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
+<p id="ch5func_46"></a>Absolute paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch5func_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch5func_48"></a>For example to get to /boot/grub you would type:</p>
+<pre class="programlisting">$cd /boot/grub</pre>
+<p id="ch5func_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
+<p id="ch5func_4a"></a>Relative paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch5func_4b"></a>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.</p>
+<p id="ch5func_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
+<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch5func_4d"></a>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.</p>
+</div>
+<div class="section" title="3.4. who">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2731284"></a>3.4. who</h3></div></div></div>
+<p id="ch5func_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
+<p id="ch5func_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
+<pre class="programlisting">$who
+beeblebrox tty7         2009-09-08 10:50 (:0)
+beeblebrox pts/0        2009-09-08 11:25 (:0.0)
+dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
+beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
+<p id="ch5func_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
+<p id="ch5func_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
+<pre class="programlisting">$man who</pre>
+<p id="ch5func_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
+</div>
+<div class="section" title="3.5. mkdir">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2731364"></a>3.5. mkdir</h3></div></div></div>
+<p id="ch5func_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
+<pre class="programlisting">$mkdir name_of_directory</pre>
+<p id="ch5func_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
+<div class="section" title="3.5.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2731395"></a>3.5.1. Options</h4></div></div></div>
+<p id="ch5func_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch5func_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch5func_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
+</div>
+<div class="section" title="3.5.2. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2731454"></a>3.5.2. Examples</h4></div></div></div>
+<p id="ch5func_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
+<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
+<p id="ch5func_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
+<p id="ch5func_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
+<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
+<p id="ch5func_5d"></a>This will create:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch5func_5e"></a>tag</p></li>
+<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch5func_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
+</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
+</div>
+</div>
+</div>
+<div class="section" title="4. Getting Help">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2731537"></a>4. Getting Help</h2></div></div></div>
+<div class="section" title="4.1. apropos and whatis">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2731546"></a>4.1. apropos and whatis</h3></div></div></div>
+<p id="ch5func_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
+<pre class="programlisting">$ apropos grep
+egrep       egrep (1)       Search a file for a pattern using full regular expressions
+fgrep       fgrep (1)       Search a file for a fixed-character string
+fmlgrep     fmlgrep (1)     Search a file for a pattern
+grep        grep (1)        Search a file for a pattern
+gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
+nisgrep     nismatch (1)    Utilities for searching NIS+ tables
+pgrep       pgrep (1)       Find or signal a process by name or other attribute
+zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
+...</pre>
+<p id="ch5func_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
+<p id="ch5func_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
+<pre class="programlisting">$whatis ls
+ls (1)           - list directory contents</pre>
+<p id="ch5func_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
+<p id="ch5func_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
+<pre class="programlisting">$apropos browser
+gmusicbrowser (1)    - Jukebox for large collections of audio files
+infobrowser (1)      - read Info documents
+libsmbclient (7)     - An extension library for browsers and that               can be used...
+opera (1)            - a standards-compliant graphical Web browser
+sensible-browser (1) - sensible editing, paging, and web browsing
+smbtree (1)          - A text based smb network browser
+tvtk_doc (1)         - A GUI based TVTK documentation search browser.
+viewres (1)          - graphical class browser for Xt
+w3m (1)              - a text based Web browser and pager
+www-browser (1)      - a text based Web browser and pager
+...</pre>
+</div>
+<div class="section" title="4.2. man">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2731626"></a>4.2. man</h3></div></div></div>
+<p id="ch5func_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
+<p id="ch5func_66"></a>To read a manual page for a Unix command, one can use:</p>
+<pre class="programlisting">$ man &lt;command_name&gt;</pre>
+<p id="ch5func_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
+<p id="ch5func_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
+<pre class="programlisting">$man 3 printf</pre>
+<p id="ch5func_69"></a>Another example:</p>
+<pre class="programlisting">$man man</pre>
+<p id="ch5func_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
+<div class="section" title="4.2.1. Layout">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2731706"></a>4.2.1. Layout</h4></div></div></div>
+<p id="ch5func_6b"></a>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:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch5func_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch5func_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch5func_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch5func_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch5func_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch5func_71"></a>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.</p>
+<p id="ch5func_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
+<p id="ch5func_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
+<p id="ch5func_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
+<p id="ch5func_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
+<p id="ch5func_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
+</div>
+</div>
+<div class="section" title="4.3. info">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2731830"></a>4.3. info</h3></div></div></div>
+<p id="ch5func_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
+<p id="ch5func_78"></a>The syntax is</p>
+<pre class="programlisting">$ info &lt;command_name&gt;</pre>
+<p id="ch5func_79"></a><span class="emphasis"><em>info</em></span> 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</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch5func_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch5func_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
+</div>
+<div class="section" title="4.4. --help">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2731920"></a>4.4. --help</h3></div></div></div>
+<p id="ch5func_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
+<pre class="programlisting">$ userprompt@host: cat --help
+Usage: cat [OPTION] [FILE]...
+Concatenate FILE(s), or standard input, to standard output.
+
+  -A, --show-all           equivalent to -vET
+  -b, --number-nonblank    number nonempty output lines
+  -e                       equivalent to -vE
+  -E, --show-ends          display $ at end of each line
+  -n, --number             number all output lines
+  -s, --squeeze-blank      suppress repeated empty output lines
+  -t                       equivalent to -vT
+  -T, --show-tabs          display TAB characters as ^I
+  -u                       (ignored)
+  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
+  --help     display this help and exit
+  --version  output version information and exit
+
+With no FILE, or when FILE is -, read standard input.
+
+Examples:
+  cat f - g  Output f's contents, then standard input, then g's           contents.
+  cat        Copy standard input to standard output.
+
+Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
+</div>
+</div>
+<div class="section" title="5. Basic file handling">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2731974"></a>5. Basic file handling</h2></div></div></div>
+<div class="section" title="5.1. cp">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2731982"></a>5.1. cp</h3></div></div></div>
+<p id="ch5func_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
+<div class="section" title="5.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2732000"></a>5.1.1. Usage</h4></div></div></div>
+<p id="ch5func_82"></a>To copy a file to another file:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
+<p id="ch5func_83"></a>To copy a file to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
+<p id="ch5func_84"></a>To copy a directory to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
+SourceDirectory ... TargetDirectory</pre>
+</div>
+<div class="section" title="5.1.2. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2732034"></a>5.1.2. Flags</h4></div></div></div>
+<p id="ch5func_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
+<p id="ch5func_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
+<p id="ch5func_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
+<p id="ch5func_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch5func_89"></a>The time of the last data modification and the time of the last access.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch5func_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
+</div>
+<div class="section" title="5.1.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2732132"></a>5.1.3. Examples</h4></div></div></div>
+<p id="ch5func_8d"></a>To make a copy of a file in the current directory, enter:</p>
+<pre class="programlisting">$ cp prog.c prog.bak</pre>
+<p id="ch5func_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
+<p id="ch5func_8f"></a>To copy a file in your current directory into another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
+<p id="ch5func_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
+<p id="ch5func_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
+<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
+<p id="ch5func_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
+<p id="ch5func_93"></a>To copy all the files in a directory to a new directory, enter:</p>
+<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
+<p id="ch5func_94"></a>This copies only the files in the clients directory to the customers directory.</p>
+<p id="ch5func_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch5func_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch5func_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
+<p id="ch5func_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
+<p id="ch5func_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
+<p id="ch5func_9a"></a>To use pattern-matching characters to copy files, enter:</p>
+<pre class="programlisting">$ cp programs/*.py .</pre>
+<p id="ch5func_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
+</div>
+</div>
+<div class="section" title="5.2. mv">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2732293"></a>5.2. mv</h3></div></div></div>
+<p id="ch5func_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
+<div class="section" title="5.2.1. Conflicting existing file">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2732317"></a>5.2.1. Conflicting existing file</h4></div></div></div>
+<p id="ch5func_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
+</div>
+<div class="section" title="5.2.2. Differences with copy and delete">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2732336"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
+<p id="ch5func_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
+</div>
+<div class="section" title="5.2.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2730028"></a>5.2.3. Examples</h4></div></div></div>
+<pre class="programlisting">$ mv myfile mynewfilename    renames a file
+$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
+$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
+$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
+$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
+$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
+$ mv foo bar baz dir         moves multiple files to directory dir
+$ mv --help                  shows a very concise help about the                syntax of the command
+$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
+<p id="ch5func_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
+<p id="ch5func_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
+</div>
+</div>
+<div class="section" title="5.3. rm">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2730087"></a>5.3. rm</h3></div></div></div>
+<p id="ch5func_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
+<p id="ch5func_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
+<pre class="programlisting">$ rm -i foo
+remove foo? y</pre>
+<div class="section" title="5.3.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2730116"></a>5.3.1. Options</h4></div></div></div>
+<p id="ch5func_a3"></a>Common options that rm accepts include:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch5func_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch5func_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
+<p id="ch5func_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
+<p id="ch5func_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
+<pre class="programlisting">xargs rm &lt; filelist</pre>
+<p id="ch5func_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
+</div>
+<div class="section" title="5.3.2. Permissions">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2732693"></a>5.3.2. Permissions</h4></div></div></div>
+<p id="ch5func_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
+<p id="ch5func_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
+<p id="ch5func_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
+</div>
+</div>
+</div>
+<div class="section" title="6. Command Line Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2732733"></a>6. Command Line Arguments</h2></div></div></div>
+<p id="ch5func_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
+<p id="ch5func_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
+<pre class="programlisting">rm file.s</pre>
+<p id="ch5func_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
+<p id="ch5func_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
+<p id="ch5func_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
+<p id="ch5func_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
+<p id="ch5func_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
+</div>
+<div class="section" title="7. Basic Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2732826"></a>7. Basic Text Processing</h2></div></div></div>
+<div class="section" title="7.1. head">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2732834"></a>7.1. head</h3></div></div></div>
+<p id="ch5func_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
+<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
+<p id="ch5func_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
+<pre class="programlisting">$ head -n 20 filename</pre>
+<p id="ch5func_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ head -n 5 foo*</pre>
+<p id="ch5func_b9"></a>Some versions omit the n and just let you say -5.</p>
+<div class="section" title="7.1.1. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2732886"></a>7.1.1. Flags</h4></div></div></div>
+<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
+<p id="ch5func_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
+<p id="ch5func_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
+<pre class="programlisting">sed 5q foo</pre>
+<p id="ch5func_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
+</div>
+</div>
+<div class="section" title="7.2. tail">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2732922"></a>7.2. tail</h3></div></div></div>
+<p id="ch5func_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
+<p id="ch5func_be"></a>The command-syntax is:</p>
+<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
+<p id="ch5func_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
+<pre class="programlisting">$ tail -n 20 filename</pre>
+<p id="ch5func_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ tail -c 15 foo*</pre>
+<p id="ch5func_c1"></a>This example shows all lines of filename from the second line onwards:</p>
+<pre class="programlisting">$ tail -n +2 filename</pre>
+<p id="ch5func_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
+<pre class="programlisting">$ tail -20 filename
+$ tail -50c filename</pre>
+<p id="ch5func_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
+<div class="section" title="7.2.1. File monitoring">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2733000"></a>7.2.1. File monitoring</h4></div></div></div>
+<p id="ch5func_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
+<pre class="programlisting">$ tail -f /var/adm/messages</pre>
+<p id="ch5func_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
+<p id="ch5func_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
+</div>
+</div>
+<div class="section" title="7.3. cut">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2733049"></a>7.3. cut</h3></div></div></div>
+<p id="ch5func_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
+<p id="ch5func_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
+<p id="ch5func_c9"></a>Assuming a file named file containing the lines:</p>
+<pre class="programlisting">foo:bar:baz:qux:quux
+one:two:three:four:five:six:seven
+alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+<p id="ch5func_ca"></a>To output the fourth through tenth characters of each line:</p>
+<pre class="programlisting">$ cut -c 4-10 file</pre>
+<p id="ch5func_cb"></a>This gives the output:</p>
+<pre class="programlisting">:bar:ba
+:two:th
+ha:beta</pre>
+<p id="ch5func_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
+<pre class="programlisting">$ cut -d : -f 5- file</pre>
+<p id="ch5func_cd"></a>This gives the output:</p>
+<pre class="programlisting">quux
+five:six:seven
+epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+</div>
+<div class="section" title="7.4. paste">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2733135"></a>7.4. paste</h3></div></div></div>
+<p id="ch5func_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
+<p id="ch5func_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
+<pre class="programlisting">$ paste who where when &gt; www</pre>
+<p id="ch5func_d0"></a>If the files contain:</p>
+<table summary="paste" border="1"><colgroup>
+<col width="11">
+<col width="12">
+<col width="12">
+</colgroup></table>
+<p id="ch5func_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
+<pre class="programlisting">Batman            GothamCity       January 3
+Trillian          Andromeda        February 4
+Jeeves            London           March 19</pre>
+</div>
+</div>
+<div class="section" title="8. Shell Meta Characters">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2733270"></a>8. Shell Meta Characters</h2></div></div></div>
+<p id="ch5func_de"></a>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.</p>
+<p id="ch5func_df"></a>The shell meta characters include:</p>
+<p id="ch5func_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
+<p id="ch5func_e1"></a>Different shells may differ in the meta characters recognized.</p>
+<p id="ch5func_e2"></a>As an example,</p>
+<pre class="programlisting">$ ls file.*</pre>
+<p id="ch5func_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
+<pre class="programlisting">$ ls file.?</pre>
+<p id="ch5func_e4"></a>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:</p>
+<pre class="programlisting">$ more c*</pre>
+<p id="ch5func_e5"></a>because the c* matches that long file name.</p>
+<p id="ch5func_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
+<pre class="programlisting">$ rm ??more</pre>
+<p id="ch5func_e7"></a>or:</p>
+<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
+<p id="ch5func_e8"></a>or:</p>
+<pre class="programlisting">$ rm ''*|more''</pre>
+</div>
+<div class="section" title="9. Looking At Files">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2733377"></a>9. Looking At Files</h2></div></div></div>
+<div class="section" title="9.1. cat">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2733385"></a>9.1. cat</h3></div></div></div>
+<p id="ch5func_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
+<p id="ch5func_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
+<p id="ch5func_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
+<div class="section" title="9.1.1. Jargon File Definition">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2733428"></a>9.1.1. Jargon File Definition</h4></div></div></div>
+<p id="ch5func_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
+<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
+     pause (syn. blast).
+
+2. By extension, to dump large amounts of data at an unprepared target or
+     with no intention of browsing it carefully. Usage: considered silly.
+     Rare outside Unix sites. See also dd, BLT.
+
+     Among Unix fans, *cat(1)* is considered an excellent example of
+     user-interface design, because it delivers the file contents without
+     such verbosity as spacing or headers between the files, and because
+     it does not require the files to consist of lines of text, but works
+     with any sort of data.
+
+     Among Unix critics, *cat(1)* is considered the canonical example of
+     bad user-interface design, because of its woefully unobvious name.
+     It is far more often used to blast a single file to standard output
+     than to concatenate two or more files. The name cat for the former
+     operation is just as unintuitive as, say, LISP's cdr.
+
+     Of such oppositions are holy wars made...</pre>
+</div>
+<div class="section" title="9.1.2. Useless Use of 'cat'">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2733467"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
+<p id="ch5func_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
+<p id="ch5func_ee"></a>Nevertheless one sees people doing:</p>
+<pre class="programlisting">$ cat file | some_command and its args ...</pre>
+<p id="ch5func_ef"></a>instead of the equivalent and cheaper:</p>
+<pre class="programlisting">&lt;file some_command and its args ...</pre>
+<p id="ch5func_f0"></a>or (equivalently and more classically):</p>
+<pre class="programlisting">some_command and its args ... &lt;file</pre>
+<p id="ch5func_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
+<p id="ch5func_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
+</div>
+<div class="section" title="9.1.3. zcat">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2733537"></a>9.1.3. zcat</h4></div></div></div>
+<p id="ch5func_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
+</div>
+</div>
+<div class="section" title="9.2. more">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2733573"></a>9.2. more</h3></div></div></div>
+<p id="ch5func_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
+<div class="section" title="9.2.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2733593"></a>9.2.1. Usage</h4></div></div></div>
+<p id="ch5func_f5"></a>The command-syntax is:</p>
+<pre class="programlisting">$ more [options] [file_name]</pre>
+<p id="ch5func_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
+<p id="ch5func_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
+<p id="ch5func_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
+<p id="ch5func_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
+</div>
+</div>
+<div class="section" title="9.3. less">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2733687"></a>9.3. less</h3></div></div></div>
+<p id="ch5func_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
+<div class="section" title="9.3.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2733716"></a>9.3.1. Usage</h4></div></div></div>
+<p id="ch5func_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
+<p id="ch5func_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
+<p id="ch5func_fd"></a>The command-syntax is:</p>
+<pre class="programlisting">$ less [options] file_name</pre>
+</div>
+<div class="section" title="9.3.2. Frequently Used Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2733770"></a>9.3.2. Frequently Used Options</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch5func_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_ff"></a>-I: Case-insensitive searches.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_103"></a>-?: Shows help.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.3. Frequently Used Commands">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2733822"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch5func_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_105"></a>[Space bar]: Next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_106"></a>b: Previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_10a"></a>'^ or g: Go to start of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_10b"></a>'$ or G: Go to end of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_10d"></a>=: File information.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_10e"></a>h: Help.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_10f"></a>q: Quit.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.4. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2733910"></a>9.3.4. Examples</h4></div></div></div>
+<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
+$ less +F /var/log/mail.log              #Follow mode for log
+$ file * | less                          #Easier file analysis.
+$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
+</div>
+</div>
+</div>
+<div class="section" title="10. Directory Structure">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2733925"></a>10. Directory Structure</h2></div></div></div>
+<p id="ch5func_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
+<p id="ch5func_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
+<table summary="Directory Structure" border="1"><colgroup>
+<col width="15">
+<col width="48">
+</colgroup></table>
+<div class="section" title="10.1. man hier">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2734190"></a>10.1. man hier</h3></div></div></div>
+<p id="ch5func_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
+<pre class="programlisting">$ man hier</pre>
+</div>
+<div class="section" title="10.2. ls -l">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2734206"></a>10.2. ls -l</h3></div></div></div>
+<p id="ch5func_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
+<pre class="programlisting">$ ls -l</pre>
+<p id="ch5func_138"></a>This can be done after entering the required directory.</p>
+</div>
+</div>
+<div class="section" title="11. Permissions and Ownership">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2734228"></a>11. Permissions and Ownership</h2></div></div></div>
+<div class="section" title="11.1. chmod">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2734237"></a>11.1. chmod</h3></div></div></div>
+<p id="ch5func_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
+<div class="section" title="11.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2734263"></a>11.1.1. Usage</h4></div></div></div>
+<p id="ch5func_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
+<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
+<p id="ch5func_13b"></a>To view what the permissions currently are, type:</p>
+<pre class="programlisting">$ ls -l file</pre>
+</div>
+<div class="section" title="11.1.2. Command line options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2734290"></a>11.1.2. Command line options</h4></div></div></div>
+<p id="ch5func_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch5func_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch5func_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
+</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2734326"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
+<p id="ch5func_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
+<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
+<p id="ch5func_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="8">
+<col width="45">
+</colgroup></table>
+<p id="ch5func_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="54">
+</colgroup></table>
+<p id="ch5func_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="5">
+<col width="14">
+<col width="48">
+</colgroup></table>
+<p id="ch5func_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
+</div>
+<div class="section" title="11.1.2.2. Symbolic examples">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2734874"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
+<p id="ch5func_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
+<pre class="programlisting">$ chmod ug+rw mydir
+$ ls -ld mydir
+drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
+<p id="ch5func_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
+<pre class="programlisting">$ chmod a-w myfile
+$ ls -l myfile
+-r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
+<p id="ch5func_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
+<pre class="programlisting">$ chmod ug=rx mydir
+$ ls -ld mydir
+dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
+</div>
+<div class="section" title="11.1.2.3. Octal numbers">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2734915"></a>11.1.2.3. Octal numbers</h5></div></div></div>
+<p id="ch5func_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
+<pre class="programlisting">$ chmod 664 myfile
+$ ls -l myfile
+-rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
+<p id="ch5func_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
+<pre class="programlisting">$ chmod 0664 myfile</pre>
+</div>
+<div class="section" title="11.1.2.4. Special modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2734953"></a>11.1.2.4. Special modes</h5></div></div></div>
+<p id="ch5func_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
+<p id="ch5func_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="12. Redirection and Piping">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2734996"></a>12. Redirection and Piping</h2></div></div></div>
+<p id="ch5func_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
+<p id="ch5func_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
+<div class="section" title="12.1. Redirecting standard input and standard output">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2735033"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
+<p id="ch5func_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
+<pre class="programlisting">$ command1 &gt; file1</pre>
+<p id="ch5func_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
+<pre class="programlisting">$ command1 &lt; file1</pre>
+<p id="ch5func_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
+<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
+<p id="ch5func_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
+</div>
+<div class="section" title="12.2. Piping">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2735102"></a>12.2. Piping</h3></div></div></div>
+<p id="ch5func_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
+A pipeline of three programs run on a text terminal:</p>
+<pre class="programlisting">$ command1 | command2</pre>
+<p id="ch5func_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
+<p id="ch5func_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
+<pre class="programlisting">$ command1 &gt; tempfile
+$ command2 &lt; tempfile
+$ rm tempfile</pre>
+<p id="ch5func_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
+<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
+<p id="ch5func_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
+</div>
+<div class="section" title="12.3. Redirecting to and from the standard file handles">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2735162"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
+<p id="ch5func_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
+<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
+<col width="12">
+<col width="13">
+<col width="24">
+</colgroup></table>
+<p id="ch5func_18d"></a>For example:</p>
+<pre class="programlisting">$ command1 2&gt; file1</pre>
+<p id="ch5func_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
+<p id="ch5func_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
+<p id="ch5func_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
+<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
+<p id="ch5func_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
+<p id="ch5func_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
+<p id="ch5func_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
+<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
+<p id="ch5func_194"></a>A simplified form of the command:</p>
+<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
+<p id="ch5func_195"></a>is:</p>
+<pre class="programlisting">$ command &amp;&gt;file</pre>
+<p id="ch5func_196"></a>or:</p>
+<pre class="programlisting">$command &gt;&amp;file</pre>
+</div>
+<div class="section" title="12.4. Chained pipelines">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2735363"></a>12.4. Chained pipelines</h3></div></div></div>
+<p id="ch5func_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
+<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
+<p id="ch5func_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
+</div>
+<div class="section" title="12.5. Redirect to multiple outputs">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2735397"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
+<p id="ch5func_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
+<pre class="programlisting">$ ls -lrt | tee xyz</pre>
+<p id="ch5func_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
+</div>
+</div>
+<div class="section" title="13. More Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2735427"></a>13. More Text Processing</h2></div></div></div>
+<div class="section" title="13.1. grep">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2735436"></a>13.1. grep</h3></div></div></div>
+<p id="ch5func_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
+<div class="section" title="13.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2735467"></a>13.1.1. Usage</h4></div></div></div>
+<p id="ch5func_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
+<pre class="programlisting">$ grep apple fruitlist.txt</pre>
+<p id="ch5func_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
+<p id="ch5func_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
+<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
+<p id="ch5func_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
+<p id="ch5func_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
+<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
+<p id="ch5func_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
+<div class="section" title="13.1.1.1. Variations">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2735545"></a>13.1.1.1. Variations</h5></div></div></div>
+<p id="ch5func_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
+<p id="ch5func_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
+<p id="ch5func_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
+</div>
+</div>
+</div>
+<div class="section" title="13.2. tr">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2735624"></a>13.2. tr</h3></div></div></div>
+<p id="ch5func_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
+<p id="ch5func_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
+<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
+<p id="ch5func_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
+<p id="ch5func_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
+<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
+<p id="ch5func_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
+<p id="ch5func_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
+<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
+<p id="ch5func_1ab"></a>therefore removes all non-alphanumeric characters.</p>
+<p id="ch5func_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
+<pre class="programlisting">$ tr -s '\n' '\n'</pre>
+<p id="ch5func_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
+<p id="ch5func_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
+<pre class="programlisting">$ tr -d '\r'</pre>
+<p id="ch5func_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
+<p id="ch5func_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
+</div>
+</div>
+<div class="section" title="14. Elementary Regex">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2735772"></a>14. Elementary Regex</h2></div></div></div>
+<p id="ch5func_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
+<p id="ch5func_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
+<p id="ch5func_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
+<p id="ch5func_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
+<table summary="Elementary Regex" border="1"><colgroup>
+<col width="13">
+<col width="60">
+</colgroup></table>
+<div class="section" title="14.1. Lazy quantification">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2735981"></a>14.1. Lazy quantification</h3></div></div></div>
+<p id="ch5func_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
+<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
+<p id="ch5func_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
+<p id="ch5func_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
+</div>
+</div>
+<div class="section" title="15. One Liners">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2736057"></a>15. One Liners</h2></div></div></div>
+<p id="ch5func_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
+<p id="ch5func_1cd"></a>The one liner can be</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem"><p id="ch5func_1ce"></a>An expression written in the language of the shell.</p></li>
+<li class="listitem"><p id="ch5func_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
+<li class="listitem"><p id="ch5func_1d0"></a>The invocation of a compiler together with source to compile and
+instructions for executing the compiled program.</p></li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch5func_1d1"></a>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.</p>
+<p id="ch5func_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
+<p id="ch5func_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
+<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
+<p id="ch5func_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
+<p id="ch5func_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
+<p id="ch5func_1d6"></a>Here are the first few of them:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<p id="ch5func_1d7"></a>Print the total number of input lines:</p>
+<p id="ch5func_1d8"></a>END { print NR }</p>
+</li>
+<li class="listitem">
+<p id="ch5func_1d9"></a>Print the tenth input line:</p>
+<p id="ch5func_1da"></a>NR == 10</p>
+</li>
+<li class="listitem">
+<p id="ch5func_1db"></a>Print the last field of every input line:</p>
+<p id="ch5func_1dc"></a>{ print $NF }</p>
+</li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch5func_1dd"></a>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.</p>
+<p id="ch5func_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
+<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
+*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
+<p id="ch5func_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
+<p id="ch5func_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
+<pre class="programlisting">$ prog foo 'f??'; echo $?
+
+$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
+<p id="ch5func_1e1"></a>Here is a one line shell script to show directories:</p>
+<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
+</div>
+</div>
+</div></body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/ch6oop.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1138 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Strings and Dicts </title>
+<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
+<script type="text/javascript" src="/review/support/jquery-min.js"></script>
+<script type="text/javascript" src="/review/support/form.js"></script>
+<script type="text/javascript" src="/review/support/hsbook.js"></script>
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch6op">
+<div class="titlepage"></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="article"><a href="#id2674385"></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2484509">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2672204">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2725444">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2725708">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2725835">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2725844">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2726115">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2726124">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2726281">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2726339">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2726437">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2726517">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2726690">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2726699">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2726779">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2726983">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2727073">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2727127">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2727136">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2727446">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2725240">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2727886">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2727979">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2727988">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2728075">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2728202">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2728288">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2728423">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2728530">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2728538">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2728726">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2728840">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2729078">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2729343">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2729359">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2729381">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2729390">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2730149">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2730186">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2730255">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2730315">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2730516">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2730550">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2730580">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2730589">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2730777">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2730925">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2731134">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2731210">15. One Liners</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="article">
+<div class="titlepage">
+<div><div><h2 class="title" id="id2674385"></a></h2></div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#id2484509">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2672204">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2725444">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2725708">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2725835">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2725844">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2726115">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2726124">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2726281">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2726339">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2726437">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2726517">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2726690">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2726699">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2726779">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2726983">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2727073">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2727127">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2727136">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2727446">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2725240">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2727886">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2727979">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2727988">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2728075">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2728202">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2728288">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2728423">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2728530">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2728538">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2728726">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2728840">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2729078">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2729343">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2729359">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2729381">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2729390">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2730149">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2730186">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2730255">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2730315">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2730516">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2730550">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2730580">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2730589">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2730777">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2730925">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2731134">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2731210">15. One Liners</a></span></dt>
+</dl>
+</div>
+<div class="section" title="1. Introducing Linux">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2484509"></a>1. Introducing Linux</h2></div></div></div>
+<p id="ch6oop_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
+<p id="ch6oop_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
+<p id="ch6oop_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
+<p id="ch6oop_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
+<div class="section" title="1.1. Historical Background">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2672204"></a>1.1. Historical Background</h3></div></div></div>
+<div class="section" title="1.1.1. Events leading to the creation">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2672078"></a>1.1.1. Events leading to the creation</h4></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
+</ul></div>
+</div>
+<div class="section" title="1.1.2. The Creation of Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2725399"></a>1.1.2. The Creation of Linux</h4></div></div></div>
+<p id="ch6oop_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
+<p id="ch6oop_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
+</div>
+</div>
+<div class="section" title="1.2. Design and Implications">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2725444"></a>1.2. Design and Implications</h3></div></div></div>
+<p id="ch6oop_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
+<div class="section" title="1.2.1. User Interface">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2725468"></a>1.2.1. User Interface</h4></div></div></div>
+<p id="ch6oop_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
+<p id="ch6oop_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
+</div>
+<div class="section" title="1.2.2. Development">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2725520"></a>1.2.2. Development</h4></div></div></div>
+<p id="ch6oop_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
+<p id="ch6oop_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
+<p id="ch6oop_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
+</div>
+<div class="section" title="1.2.3. Community">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2725575"></a>1.2.3. Community</h4></div></div></div>
+<p id="ch6oop_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
+<p id="ch6oop_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
+<p id="ch6oop_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
+</div>
+<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2725619"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
+<p id="ch6oop_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
+</div>
+<div class="section" title="1.2.5. Programming on Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2725664"></a>1.2.5. Programming on Linux</h4></div></div></div>
+<p id="ch6oop_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
+<p id="ch6oop_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
+<p id="ch6oop_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
+</div>
+</div>
+<div class="section" title="1.3. Reasons for Using Linux">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2725708"></a>1.3. Reasons for Using Linux</h3></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch6oop_16"></a>Linux is free:</p></li></ul></div>
+<p id="ch6oop_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
+Most of all, Linux is free as in "free speech":
+The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch6oop_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
+<p id="ch6oop_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch6oop_1a"></a>Linux was made to keep on running:</p></li></ul></div>
+<p id="ch6oop_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch6oop_1c"></a>Linux is secure and versatile:</p></li></ul></div>
+<p id="ch6oop_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch6oop_1e"></a>Linux is scalable:</p></li></ul></div>
+<p id="ch6oop_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch6oop_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
+<p id="ch6oop_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
+</div>
+</div>
+<div class="section" title="2. Getting Started">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2725835"></a>2. Getting Started</h2></div></div></div>
+<div class="section" title="2.1. Logging in, activating the user interface and logging out">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2725844"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
+<p id="ch6oop_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
+<div class="section" title="2.1.1. Graphical Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2725874"></a>2.1.1. Graphical Mode</h4></div></div></div>
+<p id="ch6oop_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
+<p id="ch6oop_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
+It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
+<p id="ch6oop_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
+<p id="ch6oop_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
+<p id="ch6oop_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
+<p id="ch6oop_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
+<p id="ch6oop_29"></a>Another common form for a prompt is this one:
+[</p>
+<div class="reference">
+<div class="titlepage"><hr></div>user@host</div>
+<p> dir]</p>
+<p id="ch6oop_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
+<p id="ch6oop_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
+</div>
+<div class="section" title="2.1.2. Text Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2726028"></a>2.1.2. Text Mode</h4></div></div></div>
+<p id="ch6oop_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
+<p id="ch6oop_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
+reasons.</p>
+<p id="ch6oop_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
+<p id="ch6oop_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
+<p id="ch6oop_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
+</div>
+</div>
+</div>
+<div class="section" title="3. Basic Commands">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2726115"></a>3. Basic Commands</h2></div></div></div>
+<div class="section" title="3.1. ls">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2726124"></a>3.1. ls</h3></div></div></div>
+<p id="ch6oop_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
+<p id="ch6oop_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
+<p id="ch6oop_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch6oop_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
+<pre class="programlisting">$ ls
+jeeves.rst psmith.html blandings.html
+$ ls -l
+drwxr--r--   1 plum  editors   4096  jeeves
+-rw-r--r--   1 plum  editors  30405  psmith
+-r-xr-xr-x   1 plum  plum      8460  blandings</pre>
+<p id="ch6oop_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
+</div>
+<div class="section" title="3.2. date">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2726281"></a>3.2. date</h3></div></div></div>
+<p id="ch6oop_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
+<p id="ch6oop_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
+<pre class="programlisting">$date
+Tue Sep  8 12:01:45 IST 2009</pre>
+<p id="ch6oop_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
+<pre class="programlisting">$date --set="20040908 01:22"</pre>
+<p id="ch6oop_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
+<pre class="programlisting">$man date</pre>
+<p id="ch6oop_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
+</div>
+<div class="section" title="3.3. cd">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2726339"></a>3.3. cd</h3></div></div></div>
+<p id="ch6oop_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
+<p id="ch6oop_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
+<p id="ch6oop_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
+<p id="ch6oop_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
+<p id="ch6oop_46"></a>Absolute paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch6oop_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch6oop_48"></a>For example to get to /boot/grub you would type:</p>
+<pre class="programlisting">$cd /boot/grub</pre>
+<p id="ch6oop_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
+<p id="ch6oop_4a"></a>Relative paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch6oop_4b"></a>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.</p>
+<p id="ch6oop_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
+<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch6oop_4d"></a>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.</p>
+</div>
+<div class="section" title="3.4. who">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2726437"></a>3.4. who</h3></div></div></div>
+<p id="ch6oop_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
+<p id="ch6oop_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
+<pre class="programlisting">$who
+beeblebrox tty7         2009-09-08 10:50 (:0)
+beeblebrox pts/0        2009-09-08 11:25 (:0.0)
+dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
+beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
+<p id="ch6oop_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
+<p id="ch6oop_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
+<pre class="programlisting">$man who</pre>
+<p id="ch6oop_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
+</div>
+<div class="section" title="3.5. mkdir">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2726517"></a>3.5. mkdir</h3></div></div></div>
+<p id="ch6oop_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
+<pre class="programlisting">$mkdir name_of_directory</pre>
+<p id="ch6oop_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
+<div class="section" title="3.5.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2726548"></a>3.5.1. Options</h4></div></div></div>
+<p id="ch6oop_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch6oop_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
+</div>
+<div class="section" title="3.5.2. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2726607"></a>3.5.2. Examples</h4></div></div></div>
+<p id="ch6oop_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
+<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
+<p id="ch6oop_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
+<p id="ch6oop_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
+<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
+<p id="ch6oop_5d"></a>This will create:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_5e"></a>tag</p></li>
+<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch6oop_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
+</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
+</div>
+</div>
+</div>
+<div class="section" title="4. Getting Help">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2726690"></a>4. Getting Help</h2></div></div></div>
+<div class="section" title="4.1. apropos and whatis">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2726699"></a>4.1. apropos and whatis</h3></div></div></div>
+<p id="ch6oop_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
+<pre class="programlisting">$ apropos grep
+egrep       egrep (1)       Search a file for a pattern using full regular expressions
+fgrep       fgrep (1)       Search a file for a fixed-character string
+fmlgrep     fmlgrep (1)     Search a file for a pattern
+grep        grep (1)        Search a file for a pattern
+gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
+nisgrep     nismatch (1)    Utilities for searching NIS+ tables
+pgrep       pgrep (1)       Find or signal a process by name or other attribute
+zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
+...</pre>
+<p id="ch6oop_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
+<p id="ch6oop_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
+<pre class="programlisting">$whatis ls
+ls (1)           - list directory contents</pre>
+<p id="ch6oop_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
+<p id="ch6oop_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
+<pre class="programlisting">$apropos browser
+gmusicbrowser (1)    - Jukebox for large collections of audio files
+infobrowser (1)      - read Info documents
+libsmbclient (7)     - An extension library for browsers and that               can be used...
+opera (1)            - a standards-compliant graphical Web browser
+sensible-browser (1) - sensible editing, paging, and web browsing
+smbtree (1)          - A text based smb network browser
+tvtk_doc (1)         - A GUI based TVTK documentation search browser.
+viewres (1)          - graphical class browser for Xt
+w3m (1)              - a text based Web browser and pager
+www-browser (1)      - a text based Web browser and pager
+...</pre>
+</div>
+<div class="section" title="4.2. man">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2726779"></a>4.2. man</h3></div></div></div>
+<p id="ch6oop_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
+<p id="ch6oop_66"></a>To read a manual page for a Unix command, one can use:</p>
+<pre class="programlisting">$ man &lt;command_name&gt;</pre>
+<p id="ch6oop_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
+<p id="ch6oop_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
+<pre class="programlisting">$man 3 printf</pre>
+<p id="ch6oop_69"></a>Another example:</p>
+<pre class="programlisting">$man man</pre>
+<p id="ch6oop_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
+<div class="section" title="4.2.1. Layout">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2726859"></a>4.2.1. Layout</h4></div></div></div>
+<p id="ch6oop_6b"></a>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:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch6oop_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch6oop_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch6oop_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch6oop_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch6oop_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch6oop_71"></a>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.</p>
+<p id="ch6oop_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
+<p id="ch6oop_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
+<p id="ch6oop_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
+<p id="ch6oop_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
+<p id="ch6oop_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
+</div>
+</div>
+<div class="section" title="4.3. info">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2726983"></a>4.3. info</h3></div></div></div>
+<p id="ch6oop_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
+<p id="ch6oop_78"></a>The syntax is</p>
+<pre class="programlisting">$ info &lt;command_name&gt;</pre>
+<p id="ch6oop_79"></a><span class="emphasis"><em>info</em></span> 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</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch6oop_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
+</div>
+<div class="section" title="4.4. --help">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2727073"></a>4.4. --help</h3></div></div></div>
+<p id="ch6oop_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
+<pre class="programlisting">$ userprompt@host: cat --help
+Usage: cat [OPTION] [FILE]...
+Concatenate FILE(s), or standard input, to standard output.
+
+  -A, --show-all           equivalent to -vET
+  -b, --number-nonblank    number nonempty output lines
+  -e                       equivalent to -vE
+  -E, --show-ends          display $ at end of each line
+  -n, --number             number all output lines
+  -s, --squeeze-blank      suppress repeated empty output lines
+  -t                       equivalent to -vT
+  -T, --show-tabs          display TAB characters as ^I
+  -u                       (ignored)
+  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
+  --help     display this help and exit
+  --version  output version information and exit
+
+With no FILE, or when FILE is -, read standard input.
+
+Examples:
+  cat f - g  Output f's contents, then standard input, then g's           contents.
+  cat        Copy standard input to standard output.
+
+Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
+</div>
+</div>
+<div class="section" title="5. Basic file handling">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2727127"></a>5. Basic file handling</h2></div></div></div>
+<div class="section" title="5.1. cp">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2727136"></a>5.1. cp</h3></div></div></div>
+<p id="ch6oop_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
+<div class="section" title="5.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2727153"></a>5.1.1. Usage</h4></div></div></div>
+<p id="ch6oop_82"></a>To copy a file to another file:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
+<p id="ch6oop_83"></a>To copy a file to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
+<p id="ch6oop_84"></a>To copy a directory to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
+SourceDirectory ... TargetDirectory</pre>
+</div>
+<div class="section" title="5.1.2. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2727187"></a>5.1.2. Flags</h4></div></div></div>
+<p id="ch6oop_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
+<p id="ch6oop_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
+<p id="ch6oop_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
+<p id="ch6oop_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_89"></a>The time of the last data modification and the time of the last access.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch6oop_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
+</div>
+<div class="section" title="5.1.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2727285"></a>5.1.3. Examples</h4></div></div></div>
+<p id="ch6oop_8d"></a>To make a copy of a file in the current directory, enter:</p>
+<pre class="programlisting">$ cp prog.c prog.bak</pre>
+<p id="ch6oop_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
+<p id="ch6oop_8f"></a>To copy a file in your current directory into another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
+<p id="ch6oop_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
+<p id="ch6oop_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
+<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
+<p id="ch6oop_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
+<p id="ch6oop_93"></a>To copy all the files in a directory to a new directory, enter:</p>
+<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
+<p id="ch6oop_94"></a>This copies only the files in the clients directory to the customers directory.</p>
+<p id="ch6oop_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch6oop_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch6oop_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
+<p id="ch6oop_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
+<p id="ch6oop_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
+<p id="ch6oop_9a"></a>To use pattern-matching characters to copy files, enter:</p>
+<pre class="programlisting">$ cp programs/*.py .</pre>
+<p id="ch6oop_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
+</div>
+</div>
+<div class="section" title="5.2. mv">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2727446"></a>5.2. mv</h3></div></div></div>
+<p id="ch6oop_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
+<div class="section" title="5.2.1. Conflicting existing file">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2727470"></a>5.2.1. Conflicting existing file</h4></div></div></div>
+<p id="ch6oop_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
+</div>
+<div class="section" title="5.2.2. Differences with copy and delete">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2727489"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
+<p id="ch6oop_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
+</div>
+<div class="section" title="5.2.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2725181"></a>5.2.3. Examples</h4></div></div></div>
+<pre class="programlisting">$ mv myfile mynewfilename    renames a file
+$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
+$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
+$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
+$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
+$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
+$ mv foo bar baz dir         moves multiple files to directory dir
+$ mv --help                  shows a very concise help about the                syntax of the command
+$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
+<p id="ch6oop_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
+<p id="ch6oop_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
+</div>
+</div>
+<div class="section" title="5.3. rm">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2725240"></a>5.3. rm</h3></div></div></div>
+<p id="ch6oop_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
+<p id="ch6oop_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
+<pre class="programlisting">$ rm -i foo
+remove foo? y</pre>
+<div class="section" title="5.3.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2725269"></a>5.3.1. Options</h4></div></div></div>
+<p id="ch6oop_a3"></a>Common options that rm accepts include:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch6oop_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
+<p id="ch6oop_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
+<p id="ch6oop_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
+<pre class="programlisting">xargs rm &lt; filelist</pre>
+<p id="ch6oop_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
+</div>
+<div class="section" title="5.3.2. Permissions">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2727846"></a>5.3.2. Permissions</h4></div></div></div>
+<p id="ch6oop_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
+<p id="ch6oop_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
+<p id="ch6oop_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
+</div>
+</div>
+</div>
+<div class="section" title="6. Command Line Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2727886"></a>6. Command Line Arguments</h2></div></div></div>
+<p id="ch6oop_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
+<p id="ch6oop_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
+<pre class="programlisting">rm file.s</pre>
+<p id="ch6oop_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
+<p id="ch6oop_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
+<p id="ch6oop_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
+<p id="ch6oop_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
+<p id="ch6oop_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
+</div>
+<div class="section" title="7. Basic Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2727979"></a>7. Basic Text Processing</h2></div></div></div>
+<div class="section" title="7.1. head">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2727988"></a>7.1. head</h3></div></div></div>
+<p id="ch6oop_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
+<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
+<p id="ch6oop_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
+<pre class="programlisting">$ head -n 20 filename</pre>
+<p id="ch6oop_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ head -n 5 foo*</pre>
+<p id="ch6oop_b9"></a>Some versions omit the n and just let you say -5.</p>
+<div class="section" title="7.1.1. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2728039"></a>7.1.1. Flags</h4></div></div></div>
+<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
+<p id="ch6oop_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
+<p id="ch6oop_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
+<pre class="programlisting">sed 5q foo</pre>
+<p id="ch6oop_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
+</div>
+</div>
+<div class="section" title="7.2. tail">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2728075"></a>7.2. tail</h3></div></div></div>
+<p id="ch6oop_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
+<p id="ch6oop_be"></a>The command-syntax is:</p>
+<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
+<p id="ch6oop_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
+<pre class="programlisting">$ tail -n 20 filename</pre>
+<p id="ch6oop_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ tail -c 15 foo*</pre>
+<p id="ch6oop_c1"></a>This example shows all lines of filename from the second line onwards:</p>
+<pre class="programlisting">$ tail -n +2 filename</pre>
+<p id="ch6oop_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
+<pre class="programlisting">$ tail -20 filename
+$ tail -50c filename</pre>
+<p id="ch6oop_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
+<div class="section" title="7.2.1. File monitoring">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2728153"></a>7.2.1. File monitoring</h4></div></div></div>
+<p id="ch6oop_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
+<pre class="programlisting">$ tail -f /var/adm/messages</pre>
+<p id="ch6oop_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
+<p id="ch6oop_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
+</div>
+</div>
+<div class="section" title="7.3. cut">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2728202"></a>7.3. cut</h3></div></div></div>
+<p id="ch6oop_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
+<p id="ch6oop_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
+<p id="ch6oop_c9"></a>Assuming a file named file containing the lines:</p>
+<pre class="programlisting">foo:bar:baz:qux:quux
+one:two:three:four:five:six:seven
+alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+<p id="ch6oop_ca"></a>To output the fourth through tenth characters of each line:</p>
+<pre class="programlisting">$ cut -c 4-10 file</pre>
+<p id="ch6oop_cb"></a>This gives the output:</p>
+<pre class="programlisting">:bar:ba
+:two:th
+ha:beta</pre>
+<p id="ch6oop_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
+<pre class="programlisting">$ cut -d : -f 5- file</pre>
+<p id="ch6oop_cd"></a>This gives the output:</p>
+<pre class="programlisting">quux
+five:six:seven
+epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+</div>
+<div class="section" title="7.4. paste">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2728288"></a>7.4. paste</h3></div></div></div>
+<p id="ch6oop_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
+<p id="ch6oop_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
+<pre class="programlisting">$ paste who where when &gt; www</pre>
+<p id="ch6oop_d0"></a>If the files contain:</p>
+<table summary="paste" border="1"><colgroup>
+<col width="11">
+<col width="12">
+<col width="12">
+</colgroup></table>
+<p id="ch6oop_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
+<pre class="programlisting">Batman            GothamCity       January 3
+Trillian          Andromeda        February 4
+Jeeves            London           March 19</pre>
+</div>
+</div>
+<div class="section" title="8. Shell Meta Characters">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2728423"></a>8. Shell Meta Characters</h2></div></div></div>
+<p id="ch6oop_de"></a>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.</p>
+<p id="ch6oop_df"></a>The shell meta characters include:</p>
+<p id="ch6oop_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
+<p id="ch6oop_e1"></a>Different shells may differ in the meta characters recognized.</p>
+<p id="ch6oop_e2"></a>As an example,</p>
+<pre class="programlisting">$ ls file.*</pre>
+<p id="ch6oop_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
+<pre class="programlisting">$ ls file.?</pre>
+<p id="ch6oop_e4"></a>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:</p>
+<pre class="programlisting">$ more c*</pre>
+<p id="ch6oop_e5"></a>because the c* matches that long file name.</p>
+<p id="ch6oop_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
+<pre class="programlisting">$ rm ??more</pre>
+<p id="ch6oop_e7"></a>or:</p>
+<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
+<p id="ch6oop_e8"></a>or:</p>
+<pre class="programlisting">$ rm ''*|more''</pre>
+</div>
+<div class="section" title="9. Looking At Files">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2728530"></a>9. Looking At Files</h2></div></div></div>
+<div class="section" title="9.1. cat">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2728538"></a>9.1. cat</h3></div></div></div>
+<p id="ch6oop_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
+<p id="ch6oop_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
+<p id="ch6oop_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
+<div class="section" title="9.1.1. Jargon File Definition">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2728582"></a>9.1.1. Jargon File Definition</h4></div></div></div>
+<p id="ch6oop_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
+<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
+     pause (syn. blast).
+
+2. By extension, to dump large amounts of data at an unprepared target or
+     with no intention of browsing it carefully. Usage: considered silly.
+     Rare outside Unix sites. See also dd, BLT.
+
+     Among Unix fans, *cat(1)* is considered an excellent example of
+     user-interface design, because it delivers the file contents without
+     such verbosity as spacing or headers between the files, and because
+     it does not require the files to consist of lines of text, but works
+     with any sort of data.
+
+     Among Unix critics, *cat(1)* is considered the canonical example of
+     bad user-interface design, because of its woefully unobvious name.
+     It is far more often used to blast a single file to standard output
+     than to concatenate two or more files. The name cat for the former
+     operation is just as unintuitive as, say, LISP's cdr.
+
+     Of such oppositions are holy wars made...</pre>
+</div>
+<div class="section" title="9.1.2. Useless Use of 'cat'">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2728620"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
+<p id="ch6oop_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
+<p id="ch6oop_ee"></a>Nevertheless one sees people doing:</p>
+<pre class="programlisting">$ cat file | some_command and its args ...</pre>
+<p id="ch6oop_ef"></a>instead of the equivalent and cheaper:</p>
+<pre class="programlisting">&lt;file some_command and its args ...</pre>
+<p id="ch6oop_f0"></a>or (equivalently and more classically):</p>
+<pre class="programlisting">some_command and its args ... &lt;file</pre>
+<p id="ch6oop_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
+<p id="ch6oop_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
+</div>
+<div class="section" title="9.1.3. zcat">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2728690"></a>9.1.3. zcat</h4></div></div></div>
+<p id="ch6oop_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
+</div>
+</div>
+<div class="section" title="9.2. more">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2728726"></a>9.2. more</h3></div></div></div>
+<p id="ch6oop_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
+<div class="section" title="9.2.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2728746"></a>9.2.1. Usage</h4></div></div></div>
+<p id="ch6oop_f5"></a>The command-syntax is:</p>
+<pre class="programlisting">$ more [options] [file_name]</pre>
+<p id="ch6oop_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
+<p id="ch6oop_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
+<p id="ch6oop_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
+<p id="ch6oop_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
+</div>
+</div>
+<div class="section" title="9.3. less">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2728840"></a>9.3. less</h3></div></div></div>
+<p id="ch6oop_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
+<div class="section" title="9.3.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2728870"></a>9.3.1. Usage</h4></div></div></div>
+<p id="ch6oop_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
+<p id="ch6oop_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
+<p id="ch6oop_fd"></a>The command-syntax is:</p>
+<pre class="programlisting">$ less [options] file_name</pre>
+</div>
+<div class="section" title="9.3.2. Frequently Used Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2728924"></a>9.3.2. Frequently Used Options</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_ff"></a>-I: Case-insensitive searches.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_103"></a>-?: Shows help.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.3. Frequently Used Commands">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2728975"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_105"></a>[Space bar]: Next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_106"></a>b: Previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_10a"></a>'^ or g: Go to start of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_10b"></a>'$ or G: Go to end of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_10d"></a>=: File information.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_10e"></a>h: Help.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_10f"></a>q: Quit.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.4. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2729063"></a>9.3.4. Examples</h4></div></div></div>
+<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
+$ less +F /var/log/mail.log              #Follow mode for log
+$ file * | less                          #Easier file analysis.
+$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
+</div>
+</div>
+</div>
+<div class="section" title="10. Directory Structure">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2729078"></a>10. Directory Structure</h2></div></div></div>
+<p id="ch6oop_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
+<p id="ch6oop_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
+<table summary="Directory Structure" border="1"><colgroup>
+<col width="15">
+<col width="48">
+</colgroup></table>
+<div class="section" title="10.1. man hier">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2729343"></a>10.1. man hier</h3></div></div></div>
+<p id="ch6oop_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
+<pre class="programlisting">$ man hier</pre>
+</div>
+<div class="section" title="10.2. ls -l">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2729359"></a>10.2. ls -l</h3></div></div></div>
+<p id="ch6oop_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
+<pre class="programlisting">$ ls -l</pre>
+<p id="ch6oop_138"></a>This can be done after entering the required directory.</p>
+</div>
+</div>
+<div class="section" title="11. Permissions and Ownership">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2729381"></a>11. Permissions and Ownership</h2></div></div></div>
+<div class="section" title="11.1. chmod">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2729390"></a>11.1. chmod</h3></div></div></div>
+<p id="ch6oop_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
+<div class="section" title="11.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2729416"></a>11.1.1. Usage</h4></div></div></div>
+<p id="ch6oop_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
+<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
+<p id="ch6oop_13b"></a>To view what the permissions currently are, type:</p>
+<pre class="programlisting">$ ls -l file</pre>
+</div>
+<div class="section" title="11.1.2. Command line options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2729443"></a>11.1.2. Command line options</h4></div></div></div>
+<p id="ch6oop_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch6oop_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
+</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2729480"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
+<p id="ch6oop_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
+<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
+<p id="ch6oop_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="8">
+<col width="45">
+</colgroup></table>
+<p id="ch6oop_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="54">
+</colgroup></table>
+<p id="ch6oop_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="5">
+<col width="14">
+<col width="48">
+</colgroup></table>
+<p id="ch6oop_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
+</div>
+<div class="section" title="11.1.2.2. Symbolic examples">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2730027"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
+<p id="ch6oop_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
+<pre class="programlisting">$ chmod ug+rw mydir
+$ ls -ld mydir
+drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
+<p id="ch6oop_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
+<pre class="programlisting">$ chmod a-w myfile
+$ ls -l myfile
+-r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
+<p id="ch6oop_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
+<pre class="programlisting">$ chmod ug=rx mydir
+$ ls -ld mydir
+dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
+</div>
+<div class="section" title="11.1.2.3. Octal numbers">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2730068"></a>11.1.2.3. Octal numbers</h5></div></div></div>
+<p id="ch6oop_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
+<pre class="programlisting">$ chmod 664 myfile
+$ ls -l myfile
+-rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
+<p id="ch6oop_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
+<pre class="programlisting">$ chmod 0664 myfile</pre>
+</div>
+<div class="section" title="11.1.2.4. Special modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2730106"></a>11.1.2.4. Special modes</h5></div></div></div>
+<p id="ch6oop_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
+<p id="ch6oop_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="12. Redirection and Piping">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2730149"></a>12. Redirection and Piping</h2></div></div></div>
+<p id="ch6oop_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
+<p id="ch6oop_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
+<div class="section" title="12.1. Redirecting standard input and standard output">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2730186"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
+<p id="ch6oop_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
+<pre class="programlisting">$ command1 &gt; file1</pre>
+<p id="ch6oop_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
+<pre class="programlisting">$ command1 &lt; file1</pre>
+<p id="ch6oop_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
+<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
+<p id="ch6oop_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
+</div>
+<div class="section" title="12.2. Piping">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2730255"></a>12.2. Piping</h3></div></div></div>
+<p id="ch6oop_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
+A pipeline of three programs run on a text terminal:</p>
+<pre class="programlisting">$ command1 | command2</pre>
+<p id="ch6oop_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
+<p id="ch6oop_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
+<pre class="programlisting">$ command1 &gt; tempfile
+$ command2 &lt; tempfile
+$ rm tempfile</pre>
+<p id="ch6oop_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
+<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
+<p id="ch6oop_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
+</div>
+<div class="section" title="12.3. Redirecting to and from the standard file handles">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2730315"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
+<p id="ch6oop_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
+<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
+<col width="12">
+<col width="13">
+<col width="24">
+</colgroup></table>
+<p id="ch6oop_18d"></a>For example:</p>
+<pre class="programlisting">$ command1 2&gt; file1</pre>
+<p id="ch6oop_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
+<p id="ch6oop_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
+<p id="ch6oop_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
+<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
+<p id="ch6oop_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
+<p id="ch6oop_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
+<p id="ch6oop_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
+<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
+<p id="ch6oop_194"></a>A simplified form of the command:</p>
+<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
+<p id="ch6oop_195"></a>is:</p>
+<pre class="programlisting">$ command &amp;&gt;file</pre>
+<p id="ch6oop_196"></a>or:</p>
+<pre class="programlisting">$command &gt;&amp;file</pre>
+</div>
+<div class="section" title="12.4. Chained pipelines">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2730516"></a>12.4. Chained pipelines</h3></div></div></div>
+<p id="ch6oop_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
+<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
+<p id="ch6oop_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
+</div>
+<div class="section" title="12.5. Redirect to multiple outputs">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2730550"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
+<p id="ch6oop_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
+<pre class="programlisting">$ ls -lrt | tee xyz</pre>
+<p id="ch6oop_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
+</div>
+</div>
+<div class="section" title="13. More Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2730580"></a>13. More Text Processing</h2></div></div></div>
+<div class="section" title="13.1. grep">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2730589"></a>13.1. grep</h3></div></div></div>
+<p id="ch6oop_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
+<div class="section" title="13.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2730620"></a>13.1.1. Usage</h4></div></div></div>
+<p id="ch6oop_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
+<pre class="programlisting">$ grep apple fruitlist.txt</pre>
+<p id="ch6oop_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
+<p id="ch6oop_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
+<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
+<p id="ch6oop_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
+<p id="ch6oop_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
+<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
+<p id="ch6oop_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
+<div class="section" title="13.1.1.1. Variations">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2730698"></a>13.1.1.1. Variations</h5></div></div></div>
+<p id="ch6oop_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
+<p id="ch6oop_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
+<p id="ch6oop_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
+</div>
+</div>
+</div>
+<div class="section" title="13.2. tr">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2730777"></a>13.2. tr</h3></div></div></div>
+<p id="ch6oop_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
+<p id="ch6oop_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
+<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
+<p id="ch6oop_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
+<p id="ch6oop_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
+<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
+<p id="ch6oop_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
+<p id="ch6oop_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
+<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
+<p id="ch6oop_1ab"></a>therefore removes all non-alphanumeric characters.</p>
+<p id="ch6oop_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
+<pre class="programlisting">$ tr -s '\n' '\n'</pre>
+<p id="ch6oop_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
+<p id="ch6oop_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
+<pre class="programlisting">$ tr -d '\r'</pre>
+<p id="ch6oop_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
+<p id="ch6oop_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
+</div>
+</div>
+<div class="section" title="14. Elementary Regex">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2730925"></a>14. Elementary Regex</h2></div></div></div>
+<p id="ch6oop_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
+<p id="ch6oop_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
+<p id="ch6oop_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
+<p id="ch6oop_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
+<table summary="Elementary Regex" border="1"><colgroup>
+<col width="13">
+<col width="60">
+</colgroup></table>
+<div class="section" title="14.1. Lazy quantification">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2731134"></a>14.1. Lazy quantification</h3></div></div></div>
+<p id="ch6oop_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
+<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
+<p id="ch6oop_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
+<p id="ch6oop_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
+</div>
+</div>
+<div class="section" title="15. One Liners">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2731210"></a>15. One Liners</h2></div></div></div>
+<p id="ch6oop_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
+<p id="ch6oop_1cd"></a>The one liner can be</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem"><p id="ch6oop_1ce"></a>An expression written in the language of the shell.</p></li>
+<li class="listitem"><p id="ch6oop_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
+<li class="listitem"><p id="ch6oop_1d0"></a>The invocation of a compiler together with source to compile and
+instructions for executing the compiled program.</p></li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch6oop_1d1"></a>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.</p>
+<p id="ch6oop_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
+<p id="ch6oop_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
+<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
+<p id="ch6oop_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
+<p id="ch6oop_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
+<p id="ch6oop_1d6"></a>Here are the first few of them:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<p id="ch6oop_1d7"></a>Print the total number of input lines:</p>
+<p id="ch6oop_1d8"></a>END { print NR }</p>
+</li>
+<li class="listitem">
+<p id="ch6oop_1d9"></a>Print the tenth input line:</p>
+<p id="ch6oop_1da"></a>NR == 10</p>
+</li>
+<li class="listitem">
+<p id="ch6oop_1db"></a>Print the last field of every input line:</p>
+<p id="ch6oop_1dc"></a>{ print $NF }</p>
+</li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch6oop_1dd"></a>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.</p>
+<p id="ch6oop_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
+<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
+*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
+<p id="ch6oop_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
+<p id="ch6oop_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
+<pre class="programlisting">$ prog foo 'f??'; echo $?
+
+$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
+<p id="ch6oop_1e1"></a>Here is a one line shell script to show directories:</p>
+<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
+</div>
+</div>
+</div></body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/ch7interim_assessment.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1139 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Internal assesment </title>
+<link rel="stylesheet" href="/review/support/styles.css" type="text/css">
+<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
+<script type="text/javascript" src="/review/support/jquery-min.js"></script>
+<script type="text/javascript" src="/review/support/form.js"></script>
+<script type="text/javascript" src="/review/support/hsbook.js"></script>
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch7interim_assessment">
+<div class="titlepage"></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="article"><a href="#id2484740"></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2294864">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2484544">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2535791">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2536201">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2536342">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2536351">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2536630">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2536639">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2536803">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2536864">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2536967">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2537050">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2537230">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2537239">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2537322">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2537533">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2537625">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2537678">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2537687">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2537999">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2538132">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2538304">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2538397">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2538406">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2538493">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2538621">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2538708">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2538842">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2538959">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2538968">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2539156">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2539267">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2539510">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2539784">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2539801">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2539824">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2539833">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2540610">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2540646">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2540714">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2540776">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2540984">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2541018">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2541049">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2541057">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2541248">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2541399">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2541615">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2541692">15. One Liners</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="article">
+<div class="titlepage">
+<div><div><h2 class="title" id="id2484740"></a></h2></div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#id2294864">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2484544">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2535791">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2536201">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2536342">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2536351">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2536630">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2536639">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2536803">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2536864">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2536967">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2537050">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2537230">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2537239">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2537322">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2537533">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2537625">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2537678">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2537687">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2537999">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2538132">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2538304">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2538397">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2538406">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2538493">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2538621">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2538708">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2538842">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2538959">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2538968">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2539156">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2539267">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2539510">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2539784">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2539801">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2539824">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2539833">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2540610">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2540646">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2540714">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2540776">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2540984">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2541018">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2541049">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2541057">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2541248">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2541399">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2541615">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2541692">15. One Liners</a></span></dt>
+</dl>
+</div>
+<div class="section" title="1. Introducing Linux">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2294864"></a>1. Introducing Linux</h2></div></div></div>
+<p id="ch7interim_assessment_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
+<p id="ch7interim_assessment_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
+<p id="ch7interim_assessment_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
+<p id="ch7interim_assessment_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
+<div class="section" title="1.1. Historical Background">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2484544"></a>1.1. Historical Background</h3></div></div></div>
+<div class="section" title="1.1.1. Events leading to the creation">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2482525"></a>1.1.1. Events leading to the creation</h4></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
+</ul></div>
+</div>
+<div class="section" title="1.1.2. The Creation of Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2535756"></a>1.1.2. The Creation of Linux</h4></div></div></div>
+<p id="ch7interim_assessment_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
+<p id="ch7interim_assessment_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
+</div>
+</div>
+<div class="section" title="1.2. Design and Implications">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2535791"></a>1.2. Design and Implications</h3></div></div></div>
+<p id="ch7interim_assessment_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
+<div class="section" title="1.2.1. User Interface">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2535816"></a>1.2.1. User Interface</h4></div></div></div>
+<p id="ch7interim_assessment_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
+<p id="ch7interim_assessment_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
+</div>
+<div class="section" title="1.2.2. Development">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2535870"></a>1.2.2. Development</h4></div></div></div>
+<p id="ch7interim_assessment_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
+<p id="ch7interim_assessment_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
+<p id="ch7interim_assessment_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
+</div>
+<div class="section" title="1.2.3. Community">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2535571"></a>1.2.3. Community</h4></div></div></div>
+<p id="ch7interim_assessment_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
+<p id="ch7interim_assessment_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
+<p id="ch7interim_assessment_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
+</div>
+<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2535616"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
+<p id="ch7interim_assessment_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
+</div>
+<div class="section" title="1.2.5. Programming on Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2535662"></a>1.2.5. Programming on Linux</h4></div></div></div>
+<p id="ch7interim_assessment_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
+<p id="ch7interim_assessment_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
+<p id="ch7interim_assessment_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
+</div>
+</div>
+<div class="section" title="1.3. Reasons for Using Linux">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2536201"></a>1.3. Reasons for Using Linux</h3></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_16"></a>Linux is free:</p></li></ul></div>
+<p id="ch7interim_assessment_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
+Most of all, Linux is free as in "free speech":
+The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
+<p id="ch7interim_assessment_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_1a"></a>Linux was made to keep on running:</p></li></ul></div>
+<p id="ch7interim_assessment_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_1c"></a>Linux is secure and versatile:</p></li></ul></div>
+<p id="ch7interim_assessment_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_1e"></a>Linux is scalable:</p></li></ul></div>
+<p id="ch7interim_assessment_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
+<p id="ch7interim_assessment_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
+</div>
+</div>
+<div class="section" title="2. Getting Started">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2536342"></a>2. Getting Started</h2></div></div></div>
+<div class="section" title="2.1. Logging in, activating the user interface and logging out">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2536351"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
+<p id="ch7interim_assessment_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
+<div class="section" title="2.1.1. Graphical Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2536381"></a>2.1.1. Graphical Mode</h4></div></div></div>
+<p id="ch7interim_assessment_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
+<p id="ch7interim_assessment_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
+It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
+<p id="ch7interim_assessment_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
+<p id="ch7interim_assessment_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
+<p id="ch7interim_assessment_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
+<p id="ch7interim_assessment_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
+<p id="ch7interim_assessment_29"></a>Another common form for a prompt is this one:
+[</p>
+<div class="reference">
+<div class="titlepage"><hr></div>user@host</div>
+<p> dir]</p>
+<p id="ch7interim_assessment_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
+<p id="ch7interim_assessment_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
+</div>
+<div class="section" title="2.1.2. Text Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2536540"></a>2.1.2. Text Mode</h4></div></div></div>
+<p id="ch7interim_assessment_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
+<p id="ch7interim_assessment_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
+reasons.</p>
+<p id="ch7interim_assessment_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
+<p id="ch7interim_assessment_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
+<p id="ch7interim_assessment_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
+</div>
+</div>
+</div>
+<div class="section" title="3. Basic Commands">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2536630"></a>3. Basic Commands</h2></div></div></div>
+<div class="section" title="3.1. ls">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2536639"></a>3.1. ls</h3></div></div></div>
+<p id="ch7interim_assessment_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
+<p id="ch7interim_assessment_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
+<p id="ch7interim_assessment_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
+<pre class="programlisting">$ ls
+jeeves.rst psmith.html blandings.html
+$ ls -l
+drwxr--r--   1 plum  editors   4096  jeeves
+-rw-r--r--   1 plum  editors  30405  psmith
+-r-xr-xr-x   1 plum  plum      8460  blandings</pre>
+<p id="ch7interim_assessment_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
+</div>
+<div class="section" title="3.2. date">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2536803"></a>3.2. date</h3></div></div></div>
+<p id="ch7interim_assessment_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
+<p id="ch7interim_assessment_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
+<pre class="programlisting">$date
+Tue Sep  8 12:01:45 IST 2009</pre>
+<p id="ch7interim_assessment_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
+<pre class="programlisting">$date --set="20040908 01:22"</pre>
+<p id="ch7interim_assessment_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
+<pre class="programlisting">$man date</pre>
+<p id="ch7interim_assessment_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
+</div>
+<div class="section" title="3.3. cd">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2536864"></a>3.3. cd</h3></div></div></div>
+<p id="ch7interim_assessment_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
+<p id="ch7interim_assessment_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
+<p id="ch7interim_assessment_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
+<p id="ch7interim_assessment_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
+<p id="ch7interim_assessment_46"></a>Absolute paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch7interim_assessment_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_48"></a>For example to get to /boot/grub you would type:</p>
+<pre class="programlisting">$cd /boot/grub</pre>
+<p id="ch7interim_assessment_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
+<p id="ch7interim_assessment_4a"></a>Relative paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch7interim_assessment_4b"></a>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.</p>
+<p id="ch7interim_assessment_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
+<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_4d"></a>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.</p>
+</div>
+<div class="section" title="3.4. who">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2536967"></a>3.4. who</h3></div></div></div>
+<p id="ch7interim_assessment_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
+<p id="ch7interim_assessment_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
+<pre class="programlisting">$who
+beeblebrox tty7         2009-09-08 10:50 (:0)
+beeblebrox pts/0        2009-09-08 11:25 (:0.0)
+dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
+beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
+<p id="ch7interim_assessment_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
+<p id="ch7interim_assessment_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
+<pre class="programlisting">$man who</pre>
+<p id="ch7interim_assessment_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
+</div>
+<div class="section" title="3.5. mkdir">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2537050"></a>3.5. mkdir</h3></div></div></div>
+<p id="ch7interim_assessment_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
+<pre class="programlisting">$mkdir name_of_directory</pre>
+<p id="ch7interim_assessment_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
+<div class="section" title="3.5.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2537082"></a>3.5.1. Options</h4></div></div></div>
+<p id="ch7interim_assessment_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
+</div>
+<div class="section" title="3.5.2. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2537144"></a>3.5.2. Examples</h4></div></div></div>
+<p id="ch7interim_assessment_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
+<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
+<p id="ch7interim_assessment_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
+<p id="ch7interim_assessment_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
+<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
+<p id="ch7interim_assessment_5d"></a>This will create:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_5e"></a>tag</p></li>
+<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
+</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
+</div>
+</div>
+</div>
+<div class="section" title="4. Getting Help">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2537230"></a>4. Getting Help</h2></div></div></div>
+<div class="section" title="4.1. apropos and whatis">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2537239"></a>4.1. apropos and whatis</h3></div></div></div>
+<p id="ch7interim_assessment_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
+<pre class="programlisting">$ apropos grep
+egrep       egrep (1)       Search a file for a pattern using full regular expressions
+fgrep       fgrep (1)       Search a file for a fixed-character string
+fmlgrep     fmlgrep (1)     Search a file for a pattern
+grep        grep (1)        Search a file for a pattern
+gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
+nisgrep     nismatch (1)    Utilities for searching NIS+ tables
+pgrep       pgrep (1)       Find or signal a process by name or other attribute
+zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
+...</pre>
+<p id="ch7interim_assessment_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
+<p id="ch7interim_assessment_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
+<pre class="programlisting">$whatis ls
+ls (1)           - list directory contents</pre>
+<p id="ch7interim_assessment_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
+<p id="ch7interim_assessment_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
+<pre class="programlisting">$apropos browser
+gmusicbrowser (1)    - Jukebox for large collections of audio files
+infobrowser (1)      - read Info documents
+libsmbclient (7)     - An extension library for browsers and that               can be used...
+opera (1)            - a standards-compliant graphical Web browser
+sensible-browser (1) - sensible editing, paging, and web browsing
+smbtree (1)          - A text based smb network browser
+tvtk_doc (1)         - A GUI based TVTK documentation search browser.
+viewres (1)          - graphical class browser for Xt
+w3m (1)              - a text based Web browser and pager
+www-browser (1)      - a text based Web browser and pager
+...</pre>
+</div>
+<div class="section" title="4.2. man">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2537322"></a>4.2. man</h3></div></div></div>
+<p id="ch7interim_assessment_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
+<p id="ch7interim_assessment_66"></a>To read a manual page for a Unix command, one can use:</p>
+<pre class="programlisting">$ man &lt;command_name&gt;</pre>
+<p id="ch7interim_assessment_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
+<p id="ch7interim_assessment_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
+<pre class="programlisting">$man 3 printf</pre>
+<p id="ch7interim_assessment_69"></a>Another example:</p>
+<pre class="programlisting">$man man</pre>
+<p id="ch7interim_assessment_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
+<div class="section" title="4.2.1. Layout">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2537405"></a>4.2.1. Layout</h4></div></div></div>
+<p id="ch7interim_assessment_6b"></a>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:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch7interim_assessment_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch7interim_assessment_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch7interim_assessment_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch7interim_assessment_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch7interim_assessment_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch7interim_assessment_71"></a>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.</p>
+<p id="ch7interim_assessment_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
+<p id="ch7interim_assessment_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
+<p id="ch7interim_assessment_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
+<p id="ch7interim_assessment_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
+<p id="ch7interim_assessment_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
+</div>
+</div>
+<div class="section" title="4.3. info">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2537533"></a>4.3. info</h3></div></div></div>
+<p id="ch7interim_assessment_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
+<p id="ch7interim_assessment_78"></a>The syntax is</p>
+<pre class="programlisting">$ info &lt;command_name&gt;</pre>
+<p id="ch7interim_assessment_79"></a><span class="emphasis"><em>info</em></span> 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</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
+</div>
+<div class="section" title="4.4. --help">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2537625"></a>4.4. --help</h3></div></div></div>
+<p id="ch7interim_assessment_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
+<pre class="programlisting">$ userprompt@host: cat --help
+Usage: cat [OPTION] [FILE]...
+Concatenate FILE(s), or standard input, to standard output.
+
+  -A, --show-all           equivalent to -vET
+  -b, --number-nonblank    number nonempty output lines
+  -e                       equivalent to -vE
+  -E, --show-ends          display $ at end of each line
+  -n, --number             number all output lines
+  -s, --squeeze-blank      suppress repeated empty output lines
+  -t                       equivalent to -vT
+  -T, --show-tabs          display TAB characters as ^I
+  -u                       (ignored)
+  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
+  --help     display this help and exit
+  --version  output version information and exit
+
+With no FILE, or when FILE is -, read standard input.
+
+Examples:
+  cat f - g  Output f's contents, then standard input, then g's           contents.
+  cat        Copy standard input to standard output.
+
+Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
+</div>
+</div>
+<div class="section" title="5. Basic file handling">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2537678"></a>5. Basic file handling</h2></div></div></div>
+<div class="section" title="5.1. cp">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2537687"></a>5.1. cp</h3></div></div></div>
+<p id="ch7interim_assessment_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
+<div class="section" title="5.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2537704"></a>5.1.1. Usage</h4></div></div></div>
+<p id="ch7interim_assessment_82"></a>To copy a file to another file:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
+<p id="ch7interim_assessment_83"></a>To copy a file to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
+<p id="ch7interim_assessment_84"></a>To copy a directory to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
+SourceDirectory ... TargetDirectory</pre>
+</div>
+<div class="section" title="5.1.2. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2537738"></a>5.1.2. Flags</h4></div></div></div>
+<p id="ch7interim_assessment_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
+<p id="ch7interim_assessment_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
+<p id="ch7interim_assessment_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
+<p id="ch7interim_assessment_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_89"></a>The time of the last data modification and the time of the last access.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
+</div>
+<div class="section" title="5.1.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2537835"></a>5.1.3. Examples</h4></div></div></div>
+<p id="ch7interim_assessment_8d"></a>To make a copy of a file in the current directory, enter:</p>
+<pre class="programlisting">$ cp prog.c prog.bak</pre>
+<p id="ch7interim_assessment_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
+<p id="ch7interim_assessment_8f"></a>To copy a file in your current directory into another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
+<p id="ch7interim_assessment_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
+<p id="ch7interim_assessment_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
+<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
+<p id="ch7interim_assessment_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
+<p id="ch7interim_assessment_93"></a>To copy all the files in a directory to a new directory, enter:</p>
+<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
+<p id="ch7interim_assessment_94"></a>This copies only the files in the clients directory to the customers directory.</p>
+<p id="ch7interim_assessment_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch7interim_assessment_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
+<p id="ch7interim_assessment_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
+<p id="ch7interim_assessment_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
+<p id="ch7interim_assessment_9a"></a>To use pattern-matching characters to copy files, enter:</p>
+<pre class="programlisting">$ cp programs/*.py .</pre>
+<p id="ch7interim_assessment_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
+</div>
+</div>
+<div class="section" title="5.2. mv">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2537999"></a>5.2. mv</h3></div></div></div>
+<p id="ch7interim_assessment_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
+<div class="section" title="5.2.1. Conflicting existing file">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2538023"></a>5.2.1. Conflicting existing file</h4></div></div></div>
+<p id="ch7interim_assessment_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
+</div>
+<div class="section" title="5.2.2. Differences with copy and delete">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2538043"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
+<p id="ch7interim_assessment_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
+</div>
+<div class="section" title="5.2.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2538073"></a>5.2.3. Examples</h4></div></div></div>
+<pre class="programlisting">$ mv myfile mynewfilename    renames a file
+$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
+$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
+$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
+$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
+$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
+$ mv foo bar baz dir         moves multiple files to directory dir
+$ mv --help                  shows a very concise help about the                syntax of the command
+$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
+<p id="ch7interim_assessment_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
+<p id="ch7interim_assessment_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
+</div>
+</div>
+<div class="section" title="5.3. rm">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2538132"></a>5.3. rm</h3></div></div></div>
+<p id="ch7interim_assessment_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
+<p id="ch7interim_assessment_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
+<pre class="programlisting">$ rm -i foo
+remove foo? y</pre>
+<div class="section" title="5.3.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2538162"></a>5.3.1. Options</h4></div></div></div>
+<p id="ch7interim_assessment_a3"></a>Common options that rm accepts include:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
+<p id="ch7interim_assessment_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
+<p id="ch7interim_assessment_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
+<pre class="programlisting">xargs rm &lt; filelist</pre>
+<p id="ch7interim_assessment_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
+</div>
+<div class="section" title="5.3.2. Permissions">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2538265"></a>5.3.2. Permissions</h4></div></div></div>
+<p id="ch7interim_assessment_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
+<p id="ch7interim_assessment_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
+<p id="ch7interim_assessment_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
+</div>
+</div>
+</div>
+<div class="section" title="6. Command Line Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2538304"></a>6. Command Line Arguments</h2></div></div></div>
+<p id="ch7interim_assessment_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
+<p id="ch7interim_assessment_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
+<pre class="programlisting">rm file.s</pre>
+<p id="ch7interim_assessment_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
+<p id="ch7interim_assessment_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
+<p id="ch7interim_assessment_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
+<p id="ch7interim_assessment_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
+<p id="ch7interim_assessment_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
+</div>
+<div class="section" title="7. Basic Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2538397"></a>7. Basic Text Processing</h2></div></div></div>
+<div class="section" title="7.1. head">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2538406"></a>7.1. head</h3></div></div></div>
+<p id="ch7interim_assessment_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
+<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
+<p id="ch7interim_assessment_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
+<pre class="programlisting">$ head -n 20 filename</pre>
+<p id="ch7interim_assessment_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ head -n 5 foo*</pre>
+<p id="ch7interim_assessment_b9"></a>Some versions omit the n and just let you say -5.</p>
+<div class="section" title="7.1.1. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2538457"></a>7.1.1. Flags</h4></div></div></div>
+<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
+<p id="ch7interim_assessment_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
+<p id="ch7interim_assessment_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
+<pre class="programlisting">sed 5q foo</pre>
+<p id="ch7interim_assessment_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
+</div>
+</div>
+<div class="section" title="7.2. tail">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2538493"></a>7.2. tail</h3></div></div></div>
+<p id="ch7interim_assessment_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
+<p id="ch7interim_assessment_be"></a>The command-syntax is:</p>
+<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
+<p id="ch7interim_assessment_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
+<pre class="programlisting">$ tail -n 20 filename</pre>
+<p id="ch7interim_assessment_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ tail -c 15 foo*</pre>
+<p id="ch7interim_assessment_c1"></a>This example shows all lines of filename from the second line onwards:</p>
+<pre class="programlisting">$ tail -n +2 filename</pre>
+<p id="ch7interim_assessment_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
+<pre class="programlisting">$ tail -20 filename
+$ tail -50c filename</pre>
+<p id="ch7interim_assessment_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
+<div class="section" title="7.2.1. File monitoring">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2538572"></a>7.2.1. File monitoring</h4></div></div></div>
+<p id="ch7interim_assessment_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
+<pre class="programlisting">$ tail -f /var/adm/messages</pre>
+<p id="ch7interim_assessment_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
+<p id="ch7interim_assessment_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
+</div>
+</div>
+<div class="section" title="7.3. cut">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2538621"></a>7.3. cut</h3></div></div></div>
+<p id="ch7interim_assessment_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
+<p id="ch7interim_assessment_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
+<p id="ch7interim_assessment_c9"></a>Assuming a file named file containing the lines:</p>
+<pre class="programlisting">foo:bar:baz:qux:quux
+one:two:three:four:five:six:seven
+alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+<p id="ch7interim_assessment_ca"></a>To output the fourth through tenth characters of each line:</p>
+<pre class="programlisting">$ cut -c 4-10 file</pre>
+<p id="ch7interim_assessment_cb"></a>This gives the output:</p>
+<pre class="programlisting">:bar:ba
+:two:th
+ha:beta</pre>
+<p id="ch7interim_assessment_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
+<pre class="programlisting">$ cut -d : -f 5- file</pre>
+<p id="ch7interim_assessment_cd"></a>This gives the output:</p>
+<pre class="programlisting">quux
+five:six:seven
+epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+</div>
+<div class="section" title="7.4. paste">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2538708"></a>7.4. paste</h3></div></div></div>
+<p id="ch7interim_assessment_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
+<p id="ch7interim_assessment_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
+<pre class="programlisting">$ paste who where when &gt; www</pre>
+<p id="ch7interim_assessment_d0"></a>If the files contain:</p>
+<table summary="paste" border="1"><colgroup>
+<col width="11">
+<col width="12">
+<col width="12">
+</colgroup></table>
+<p id="ch7interim_assessment_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
+<pre class="programlisting">Batman            GothamCity       January 3
+Trillian          Andromeda        February 4
+Jeeves            London           March 19</pre>
+</div>
+</div>
+<div class="section" title="8. Shell Meta Characters">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2538842"></a>8. Shell Meta Characters</h2></div></div></div>
+<p id="ch7interim_assessment_de"></a>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.</p>
+<p id="ch7interim_assessment_df"></a>The shell meta characters include:</p>
+<p id="ch7interim_assessment_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
+<p id="ch7interim_assessment_e1"></a>Different shells may differ in the meta characters recognized.</p>
+<p id="ch7interim_assessment_e2"></a>As an example,</p>
+<pre class="programlisting">$ ls file.*</pre>
+<p id="ch7interim_assessment_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
+<pre class="programlisting">$ ls file.?</pre>
+<p id="ch7interim_assessment_e4"></a>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:</p>
+<pre class="programlisting">$ more c*</pre>
+<p id="ch7interim_assessment_e5"></a>because the c* matches that long file name.</p>
+<p id="ch7interim_assessment_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
+<pre class="programlisting">$ rm ??more</pre>
+<p id="ch7interim_assessment_e7"></a>or:</p>
+<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
+<p id="ch7interim_assessment_e8"></a>or:</p>
+<pre class="programlisting">$ rm ''*|more''</pre>
+</div>
+<div class="section" title="9. Looking At Files">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2538959"></a>9. Looking At Files</h2></div></div></div>
+<div class="section" title="9.1. cat">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2538968"></a>9.1. cat</h3></div></div></div>
+<p id="ch7interim_assessment_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
+<p id="ch7interim_assessment_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
+<p id="ch7interim_assessment_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
+<div class="section" title="9.1.1. Jargon File Definition">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2539011"></a>9.1.1. Jargon File Definition</h4></div></div></div>
+<p id="ch7interim_assessment_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
+<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
+     pause (syn. blast).
+
+2. By extension, to dump large amounts of data at an unprepared target or
+     with no intention of browsing it carefully. Usage: considered silly.
+     Rare outside Unix sites. See also dd, BLT.
+
+     Among Unix fans, *cat(1)* is considered an excellent example of
+     user-interface design, because it delivers the file contents without
+     such verbosity as spacing or headers between the files, and because
+     it does not require the files to consist of lines of text, but works
+     with any sort of data.
+
+     Among Unix critics, *cat(1)* is considered the canonical example of
+     bad user-interface design, because of its woefully unobvious name.
+     It is far more often used to blast a single file to standard output
+     than to concatenate two or more files. The name cat for the former
+     operation is just as unintuitive as, say, LISP's cdr.
+
+     Of such oppositions are holy wars made...</pre>
+</div>
+<div class="section" title="9.1.2. Useless Use of 'cat'">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2539050"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
+<p id="ch7interim_assessment_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
+<p id="ch7interim_assessment_ee"></a>Nevertheless one sees people doing:</p>
+<pre class="programlisting">$ cat file | some_command and its args ...</pre>
+<p id="ch7interim_assessment_ef"></a>instead of the equivalent and cheaper:</p>
+<pre class="programlisting">&lt;file some_command and its args ...</pre>
+<p id="ch7interim_assessment_f0"></a>or (equivalently and more classically):</p>
+<pre class="programlisting">some_command and its args ... &lt;file</pre>
+<p id="ch7interim_assessment_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
+<p id="ch7interim_assessment_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
+</div>
+<div class="section" title="9.1.3. zcat">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2539122"></a>9.1.3. zcat</h4></div></div></div>
+<p id="ch7interim_assessment_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
+</div>
+</div>
+<div class="section" title="9.2. more">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2539156"></a>9.2. more</h3></div></div></div>
+<p id="ch7interim_assessment_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
+<div class="section" title="9.2.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2539175"></a>9.2.1. Usage</h4></div></div></div>
+<p id="ch7interim_assessment_f5"></a>The command-syntax is:</p>
+<pre class="programlisting">$ more [options] [file_name]</pre>
+<p id="ch7interim_assessment_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
+<p id="ch7interim_assessment_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
+<p id="ch7interim_assessment_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
+<p id="ch7interim_assessment_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
+</div>
+</div>
+<div class="section" title="9.3. less">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2539267"></a>9.3. less</h3></div></div></div>
+<p id="ch7interim_assessment_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
+<div class="section" title="9.3.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2539296"></a>9.3.1. Usage</h4></div></div></div>
+<p id="ch7interim_assessment_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
+<p id="ch7interim_assessment_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
+<p id="ch7interim_assessment_fd"></a>The command-syntax is:</p>
+<pre class="programlisting">$ less [options] file_name</pre>
+</div>
+<div class="section" title="9.3.2. Frequently Used Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2539350"></a>9.3.2. Frequently Used Options</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_ff"></a>-I: Case-insensitive searches.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_103"></a>-?: Shows help.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.3. Frequently Used Commands">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2539404"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_105"></a>[Space bar]: Next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_106"></a>b: Previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_10a"></a>'^ or g: Go to start of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_10b"></a>'$ or G: Go to end of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_10d"></a>=: File information.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_10e"></a>h: Help.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_10f"></a>q: Quit.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.4. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2539494"></a>9.3.4. Examples</h4></div></div></div>
+<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
+$ less +F /var/log/mail.log              #Follow mode for log
+$ file * | less                          #Easier file analysis.
+$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
+</div>
+</div>
+</div>
+<div class="section" title="10. Directory Structure">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2539510"></a>10. Directory Structure</h2></div></div></div>
+<p id="ch7interim_assessment_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
+<p id="ch7interim_assessment_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
+<table summary="Directory Structure" border="1"><colgroup>
+<col width="15">
+<col width="48">
+</colgroup></table>
+<div class="section" title="10.1. man hier">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2539784"></a>10.1. man hier</h3></div></div></div>
+<p id="ch7interim_assessment_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
+<pre class="programlisting">$ man hier</pre>
+</div>
+<div class="section" title="10.2. ls -l">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2539801"></a>10.2. ls -l</h3></div></div></div>
+<p id="ch7interim_assessment_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
+<pre class="programlisting">$ ls -l</pre>
+<p id="ch7interim_assessment_138"></a>This can be done after entering the required directory.</p>
+</div>
+</div>
+<div class="section" title="11. Permissions and Ownership">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2539824"></a>11. Permissions and Ownership</h2></div></div></div>
+<div class="section" title="11.1. chmod">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2539833"></a>11.1. chmod</h3></div></div></div>
+<p id="ch7interim_assessment_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
+<div class="section" title="11.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2539859"></a>11.1.1. Usage</h4></div></div></div>
+<p id="ch7interim_assessment_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
+<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
+<p id="ch7interim_assessment_13b"></a>To view what the permissions currently are, type:</p>
+<pre class="programlisting">$ ls -l file</pre>
+</div>
+<div class="section" title="11.1.2. Command line options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2539887"></a>11.1.2. Command line options</h4></div></div></div>
+<p id="ch7interim_assessment_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
+</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2539924"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
+<p id="ch7interim_assessment_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
+<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
+<p id="ch7interim_assessment_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="8">
+<col width="45">
+</colgroup></table>
+<p id="ch7interim_assessment_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="54">
+</colgroup></table>
+<p id="ch7interim_assessment_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="5">
+<col width="14">
+<col width="48">
+</colgroup></table>
+<p id="ch7interim_assessment_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
+</div>
+<div class="section" title="11.1.2.2. Symbolic examples">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2540485"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
+<p id="ch7interim_assessment_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
+<pre class="programlisting">$ chmod ug+rw mydir
+$ ls -ld mydir
+drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
+<p id="ch7interim_assessment_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
+<pre class="programlisting">$ chmod a-w myfile
+$ ls -l myfile
+-r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
+<p id="ch7interim_assessment_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
+<pre class="programlisting">$ chmod ug=rx mydir
+$ ls -ld mydir
+dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
+</div>
+<div class="section" title="11.1.2.3. Octal numbers">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2540528"></a>11.1.2.3. Octal numbers</h5></div></div></div>
+<p id="ch7interim_assessment_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
+<pre class="programlisting">$ chmod 664 myfile
+$ ls -l myfile
+-rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
+<p id="ch7interim_assessment_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
+<pre class="programlisting">$ chmod 0664 myfile</pre>
+</div>
+<div class="section" title="11.1.2.4. Special modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2540566"></a>11.1.2.4. Special modes</h5></div></div></div>
+<p id="ch7interim_assessment_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
+<p id="ch7interim_assessment_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="12. Redirection and Piping">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2540610"></a>12. Redirection and Piping</h2></div></div></div>
+<p id="ch7interim_assessment_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
+<p id="ch7interim_assessment_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
+<div class="section" title="12.1. Redirecting standard input and standard output">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2540646"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
+<p id="ch7interim_assessment_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
+<pre class="programlisting">$ command1 &gt; file1</pre>
+<p id="ch7interim_assessment_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
+<pre class="programlisting">$ command1 &lt; file1</pre>
+<p id="ch7interim_assessment_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
+<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
+<p id="ch7interim_assessment_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
+</div>
+<div class="section" title="12.2. Piping">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2540714"></a>12.2. Piping</h3></div></div></div>
+<p id="ch7interim_assessment_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
+A pipeline of three programs run on a text terminal:</p>
+<pre class="programlisting">$ command1 | command2</pre>
+<p id="ch7interim_assessment_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
+<p id="ch7interim_assessment_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
+<pre class="programlisting">$ command1 &gt; tempfile
+$ command2 &lt; tempfile
+$ rm tempfile</pre>
+<p id="ch7interim_assessment_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
+<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
+<p id="ch7interim_assessment_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
+</div>
+<div class="section" title="12.3. Redirecting to and from the standard file handles">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2540776"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
+<p id="ch7interim_assessment_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
+<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
+<col width="12">
+<col width="13">
+<col width="24">
+</colgroup></table>
+<p id="ch7interim_assessment_18d"></a>For example:</p>
+<pre class="programlisting">$ command1 2&gt; file1</pre>
+<p id="ch7interim_assessment_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
+<p id="ch7interim_assessment_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
+<p id="ch7interim_assessment_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
+<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
+<p id="ch7interim_assessment_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
+<p id="ch7interim_assessment_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
+<p id="ch7interim_assessment_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
+<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
+<p id="ch7interim_assessment_194"></a>A simplified form of the command:</p>
+<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
+<p id="ch7interim_assessment_195"></a>is:</p>
+<pre class="programlisting">$ command &amp;&gt;file</pre>
+<p id="ch7interim_assessment_196"></a>or:</p>
+<pre class="programlisting">$command &gt;&amp;file</pre>
+</div>
+<div class="section" title="12.4. Chained pipelines">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2540984"></a>12.4. Chained pipelines</h3></div></div></div>
+<p id="ch7interim_assessment_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
+<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
+<p id="ch7interim_assessment_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
+</div>
+<div class="section" title="12.5. Redirect to multiple outputs">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2541018"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
+<p id="ch7interim_assessment_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
+<pre class="programlisting">$ ls -lrt | tee xyz</pre>
+<p id="ch7interim_assessment_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
+</div>
+</div>
+<div class="section" title="13. More Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2541049"></a>13. More Text Processing</h2></div></div></div>
+<div class="section" title="13.1. grep">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2541057"></a>13.1. grep</h3></div></div></div>
+<p id="ch7interim_assessment_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
+<div class="section" title="13.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2541089"></a>13.1.1. Usage</h4></div></div></div>
+<p id="ch7interim_assessment_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
+<pre class="programlisting">$ grep apple fruitlist.txt</pre>
+<p id="ch7interim_assessment_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
+<p id="ch7interim_assessment_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
+<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
+<p id="ch7interim_assessment_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
+<p id="ch7interim_assessment_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
+<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
+<p id="ch7interim_assessment_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
+<div class="section" title="13.1.1.1. Variations">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2541168"></a>13.1.1.1. Variations</h5></div></div></div>
+<p id="ch7interim_assessment_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
+<p id="ch7interim_assessment_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
+<p id="ch7interim_assessment_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
+</div>
+</div>
+</div>
+<div class="section" title="13.2. tr">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2541248"></a>13.2. tr</h3></div></div></div>
+<p id="ch7interim_assessment_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
+<p id="ch7interim_assessment_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
+<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
+<p id="ch7interim_assessment_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
+<p id="ch7interim_assessment_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
+<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
+<p id="ch7interim_assessment_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
+<p id="ch7interim_assessment_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
+<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
+<p id="ch7interim_assessment_1ab"></a>therefore removes all non-alphanumeric characters.</p>
+<p id="ch7interim_assessment_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
+<pre class="programlisting">$ tr -s '\n' '\n'</pre>
+<p id="ch7interim_assessment_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
+<p id="ch7interim_assessment_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
+<pre class="programlisting">$ tr -d '\r'</pre>
+<p id="ch7interim_assessment_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
+<p id="ch7interim_assessment_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
+</div>
+</div>
+<div class="section" title="14. Elementary Regex">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2541399"></a>14. Elementary Regex</h2></div></div></div>
+<p id="ch7interim_assessment_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
+<p id="ch7interim_assessment_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
+<p id="ch7interim_assessment_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
+<p id="ch7interim_assessment_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
+<table summary="Elementary Regex" border="1"><colgroup>
+<col width="13">
+<col width="60">
+</colgroup></table>
+<div class="section" title="14.1. Lazy quantification">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2541615"></a>14.1. Lazy quantification</h3></div></div></div>
+<p id="ch7interim_assessment_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
+<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
+<p id="ch7interim_assessment_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
+<p id="ch7interim_assessment_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
+</div>
+</div>
+<div class="section" title="15. One Liners">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2541692"></a>15. One Liners</h2></div></div></div>
+<p id="ch7interim_assessment_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
+<p id="ch7interim_assessment_1cd"></a>The one liner can be</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem"><p id="ch7interim_assessment_1ce"></a>An expression written in the language of the shell.</p></li>
+<li class="listitem"><p id="ch7interim_assessment_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
+<li class="listitem"><p id="ch7interim_assessment_1d0"></a>The invocation of a compiler together with source to compile and
+instructions for executing the compiled program.</p></li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_1d1"></a>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.</p>
+<p id="ch7interim_assessment_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
+<p id="ch7interim_assessment_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
+<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
+<p id="ch7interim_assessment_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
+<p id="ch7interim_assessment_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
+<p id="ch7interim_assessment_1d6"></a>Here are the first few of them:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<p id="ch7interim_assessment_1d7"></a>Print the total number of input lines:</p>
+<p id="ch7interim_assessment_1d8"></a>END { print NR }</p>
+</li>
+<li class="listitem">
+<p id="ch7interim_assessment_1d9"></a>Print the tenth input line:</p>
+<p id="ch7interim_assessment_1da"></a>NR == 10</p>
+</li>
+<li class="listitem">
+<p id="ch7interim_assessment_1db"></a>Print the last field of every input line:</p>
+<p id="ch7interim_assessment_1dc"></a>{ print $NF }</p>
+</li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_1dd"></a>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.</p>
+<p id="ch7interim_assessment_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
+<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
+*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
+<p id="ch7interim_assessment_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
+<p id="ch7interim_assessment_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
+<pre class="programlisting">$ prog foo 'f??'; echo $?
+
+$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
+<p id="ch7interim_assessment_1e1"></a>Here is a one line shell script to show directories:</p>
+<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
+</div>
+</div>
+</div></body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/ch8ult_module_plan.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1139 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>ULT Module Plan </title>
+<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
+<link rel="stylesheet" href="/review/support/styles.css" type="text/css">
+<script type="text/javascript" src="/review/support/jquery-min.js"></script>
+<script type="text/javascript" src="/review/support/form.js"></script>
+<script type="text/javascript" src="/review/support/hsbook.js"></script>
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch8ult_module_plan">
+<div class="titlepage"></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="article"><a href="#id2718075"></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2528200">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2717879">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2769136">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2769410">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2769551">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2769560">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2769839">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2769848">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2770012">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2770073">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2770176">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2770259">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2770440">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2770448">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2770542">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2770752">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2770844">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2770897">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2770906">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2771220">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2771353">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2771662">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2771755">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2771764">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2771851">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2771978">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2772065">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2772200">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2772308">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2772317">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2772505">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2772616">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2772859">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2773133">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2773150">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2773173">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2773182">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2773959">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2773995">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2774063">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2774125">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2774332">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2774367">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2774397">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2774406">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2774596">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2774748">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2774972">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2775048">15. One Liners</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="article">
+<div class="titlepage">
+<div><div><h2 class="title" id="id2718075"></a></h2></div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#id2528200">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2717879">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2769136">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2769410">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2769551">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2769560">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2769839">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2769848">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2770012">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2770073">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2770176">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2770259">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2770440">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2770448">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2770542">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2770752">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2770844">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2770897">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2770906">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2771220">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2771353">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2771662">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2771755">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2771764">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2771851">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2771978">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2772065">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2772200">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2772308">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2772317">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2772505">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2772616">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2772859">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2773133">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2773150">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2773173">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2773182">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2773959">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2773995">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2774063">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2774125">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2774332">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2774367">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2774397">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2774406">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2774596">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2774748">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2774972">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2775048">15. One Liners</a></span></dt>
+</dl>
+</div>
+<div class="section" title="1. Introducing Linux">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2528200"></a>1. Introducing Linux</h2></div></div></div>
+<p id="ch8ult_module_plan_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
+<p id="ch8ult_module_plan_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
+<p id="ch8ult_module_plan_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
+<p id="ch8ult_module_plan_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
+<div class="section" title="1.1. Historical Background">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2717879"></a>1.1. Historical Background</h3></div></div></div>
+<div class="section" title="1.1.1. Events leading to the creation">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2715861"></a>1.1.1. Events leading to the creation</h4></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
+</ul></div>
+</div>
+<div class="section" title="1.1.2. The Creation of Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2769092"></a>1.1.2. The Creation of Linux</h4></div></div></div>
+<p id="ch8ult_module_plan_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
+<p id="ch8ult_module_plan_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
+</div>
+</div>
+<div class="section" title="1.2. Design and Implications">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2769136"></a>1.2. Design and Implications</h3></div></div></div>
+<p id="ch8ult_module_plan_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
+<div class="section" title="1.2.1. User Interface">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2769161"></a>1.2.1. User Interface</h4></div></div></div>
+<p id="ch8ult_module_plan_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
+<p id="ch8ult_module_plan_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
+</div>
+<div class="section" title="1.2.2. Development">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2769215"></a>1.2.2. Development</h4></div></div></div>
+<p id="ch8ult_module_plan_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
+<p id="ch8ult_module_plan_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
+<p id="ch8ult_module_plan_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
+</div>
+<div class="section" title="1.2.3. Community">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2769272"></a>1.2.3. Community</h4></div></div></div>
+<p id="ch8ult_module_plan_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
+<p id="ch8ult_module_plan_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
+<p id="ch8ult_module_plan_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
+</div>
+<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2769317"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
+<p id="ch8ult_module_plan_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
+</div>
+<div class="section" title="1.2.5. Programming on Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2769363"></a>1.2.5. Programming on Linux</h4></div></div></div>
+<p id="ch8ult_module_plan_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
+<p id="ch8ult_module_plan_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
+<p id="ch8ult_module_plan_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
+</div>
+</div>
+<div class="section" title="1.3. Reasons for Using Linux">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2769410"></a>1.3. Reasons for Using Linux</h3></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_16"></a>Linux is free:</p></li></ul></div>
+<p id="ch8ult_module_plan_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
+Most of all, Linux is free as in "free speech":
+The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
+<p id="ch8ult_module_plan_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_1a"></a>Linux was made to keep on running:</p></li></ul></div>
+<p id="ch8ult_module_plan_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_1c"></a>Linux is secure and versatile:</p></li></ul></div>
+<p id="ch8ult_module_plan_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_1e"></a>Linux is scalable:</p></li></ul></div>
+<p id="ch8ult_module_plan_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
+<p id="ch8ult_module_plan_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
+</div>
+</div>
+<div class="section" title="2. Getting Started">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2769551"></a>2. Getting Started</h2></div></div></div>
+<div class="section" title="2.1. Logging in, activating the user interface and logging out">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2769560"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
+<p id="ch8ult_module_plan_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
+<div class="section" title="2.1.1. Graphical Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2769590"></a>2.1.1. Graphical Mode</h4></div></div></div>
+<p id="ch8ult_module_plan_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
+<p id="ch8ult_module_plan_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
+It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
+<p id="ch8ult_module_plan_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
+<p id="ch8ult_module_plan_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
+<p id="ch8ult_module_plan_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
+<p id="ch8ult_module_plan_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
+<p id="ch8ult_module_plan_29"></a>Another common form for a prompt is this one:
+[</p>
+<div class="reference">
+<div class="titlepage"><hr></div>user@host</div>
+<p> dir]</p>
+<p id="ch8ult_module_plan_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
+<p id="ch8ult_module_plan_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
+</div>
+<div class="section" title="2.1.2. Text Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2769750"></a>2.1.2. Text Mode</h4></div></div></div>
+<p id="ch8ult_module_plan_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
+<p id="ch8ult_module_plan_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
+reasons.</p>
+<p id="ch8ult_module_plan_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
+<p id="ch8ult_module_plan_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
+<p id="ch8ult_module_plan_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
+</div>
+</div>
+</div>
+<div class="section" title="3. Basic Commands">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2769839"></a>3. Basic Commands</h2></div></div></div>
+<div class="section" title="3.1. ls">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2769848"></a>3.1. ls</h3></div></div></div>
+<p id="ch8ult_module_plan_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
+<p id="ch8ult_module_plan_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
+<p id="ch8ult_module_plan_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
+<pre class="programlisting">$ ls
+jeeves.rst psmith.html blandings.html
+$ ls -l
+drwxr--r--   1 plum  editors   4096  jeeves
+-rw-r--r--   1 plum  editors  30405  psmith
+-r-xr-xr-x   1 plum  plum      8460  blandings</pre>
+<p id="ch8ult_module_plan_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
+</div>
+<div class="section" title="3.2. date">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2770012"></a>3.2. date</h3></div></div></div>
+<p id="ch8ult_module_plan_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
+<p id="ch8ult_module_plan_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
+<pre class="programlisting">$date
+Tue Sep  8 12:01:45 IST 2009</pre>
+<p id="ch8ult_module_plan_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
+<pre class="programlisting">$date --set="20040908 01:22"</pre>
+<p id="ch8ult_module_plan_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
+<pre class="programlisting">$man date</pre>
+<p id="ch8ult_module_plan_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
+</div>
+<div class="section" title="3.3. cd">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2770073"></a>3.3. cd</h3></div></div></div>
+<p id="ch8ult_module_plan_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
+<p id="ch8ult_module_plan_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
+<p id="ch8ult_module_plan_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
+<p id="ch8ult_module_plan_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
+<p id="ch8ult_module_plan_46"></a>Absolute paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch8ult_module_plan_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_48"></a>For example to get to /boot/grub you would type:</p>
+<pre class="programlisting">$cd /boot/grub</pre>
+<p id="ch8ult_module_plan_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
+<p id="ch8ult_module_plan_4a"></a>Relative paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch8ult_module_plan_4b"></a>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.</p>
+<p id="ch8ult_module_plan_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
+<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_4d"></a>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.</p>
+</div>
+<div class="section" title="3.4. who">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2770176"></a>3.4. who</h3></div></div></div>
+<p id="ch8ult_module_plan_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
+<p id="ch8ult_module_plan_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
+<pre class="programlisting">$who
+beeblebrox tty7         2009-09-08 10:50 (:0)
+beeblebrox pts/0        2009-09-08 11:25 (:0.0)
+dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
+beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
+<p id="ch8ult_module_plan_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
+<p id="ch8ult_module_plan_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
+<pre class="programlisting">$man who</pre>
+<p id="ch8ult_module_plan_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
+</div>
+<div class="section" title="3.5. mkdir">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2770259"></a>3.5. mkdir</h3></div></div></div>
+<p id="ch8ult_module_plan_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
+<pre class="programlisting">$mkdir name_of_directory</pre>
+<p id="ch8ult_module_plan_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
+<div class="section" title="3.5.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2770291"></a>3.5.1. Options</h4></div></div></div>
+<p id="ch8ult_module_plan_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
+</div>
+<div class="section" title="3.5.2. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2770353"></a>3.5.2. Examples</h4></div></div></div>
+<p id="ch8ult_module_plan_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
+<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
+<p id="ch8ult_module_plan_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
+<p id="ch8ult_module_plan_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
+<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
+<p id="ch8ult_module_plan_5d"></a>This will create:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_5e"></a>tag</p></li>
+<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
+</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
+</div>
+</div>
+</div>
+<div class="section" title="4. Getting Help">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2770440"></a>4. Getting Help</h2></div></div></div>
+<div class="section" title="4.1. apropos and whatis">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2770448"></a>4.1. apropos and whatis</h3></div></div></div>
+<p id="ch8ult_module_plan_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
+<pre class="programlisting">$ apropos grep
+egrep       egrep (1)       Search a file for a pattern using full regular expressions
+fgrep       fgrep (1)       Search a file for a fixed-character string
+fmlgrep     fmlgrep (1)     Search a file for a pattern
+grep        grep (1)        Search a file for a pattern
+gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
+nisgrep     nismatch (1)    Utilities for searching NIS+ tables
+pgrep       pgrep (1)       Find or signal a process by name or other attribute
+zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
+...</pre>
+<p id="ch8ult_module_plan_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
+<p id="ch8ult_module_plan_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
+<pre class="programlisting">$whatis ls
+ls (1)           - list directory contents</pre>
+<p id="ch8ult_module_plan_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
+<p id="ch8ult_module_plan_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
+<pre class="programlisting">$apropos browser
+gmusicbrowser (1)    - Jukebox for large collections of audio files
+infobrowser (1)      - read Info documents
+libsmbclient (7)     - An extension library for browsers and that               can be used...
+opera (1)            - a standards-compliant graphical Web browser
+sensible-browser (1) - sensible editing, paging, and web browsing
+smbtree (1)          - A text based smb network browser
+tvtk_doc (1)         - A GUI based TVTK documentation search browser.
+viewres (1)          - graphical class browser for Xt
+w3m (1)              - a text based Web browser and pager
+www-browser (1)      - a text based Web browser and pager
+...</pre>
+</div>
+<div class="section" title="4.2. man">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2770542"></a>4.2. man</h3></div></div></div>
+<p id="ch8ult_module_plan_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
+<p id="ch8ult_module_plan_66"></a>To read a manual page for a Unix command, one can use:</p>
+<pre class="programlisting">$ man &lt;command_name&gt;</pre>
+<p id="ch8ult_module_plan_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
+<p id="ch8ult_module_plan_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
+<pre class="programlisting">$man 3 printf</pre>
+<p id="ch8ult_module_plan_69"></a>Another example:</p>
+<pre class="programlisting">$man man</pre>
+<p id="ch8ult_module_plan_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
+<div class="section" title="4.2.1. Layout">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2770624"></a>4.2.1. Layout</h4></div></div></div>
+<p id="ch8ult_module_plan_6b"></a>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:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch8ult_module_plan_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch8ult_module_plan_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch8ult_module_plan_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch8ult_module_plan_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch8ult_module_plan_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch8ult_module_plan_71"></a>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.</p>
+<p id="ch8ult_module_plan_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
+<p id="ch8ult_module_plan_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
+<p id="ch8ult_module_plan_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
+<p id="ch8ult_module_plan_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
+<p id="ch8ult_module_plan_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
+</div>
+</div>
+<div class="section" title="4.3. info">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2770752"></a>4.3. info</h3></div></div></div>
+<p id="ch8ult_module_plan_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
+<p id="ch8ult_module_plan_78"></a>The syntax is</p>
+<pre class="programlisting">$ info &lt;command_name&gt;</pre>
+<p id="ch8ult_module_plan_79"></a><span class="emphasis"><em>info</em></span> 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</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
+</div>
+<div class="section" title="4.4. --help">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2770844"></a>4.4. --help</h3></div></div></div>
+<p id="ch8ult_module_plan_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
+<pre class="programlisting">$ userprompt@host: cat --help
+Usage: cat [OPTION] [FILE]...
+Concatenate FILE(s), or standard input, to standard output.
+
+  -A, --show-all           equivalent to -vET
+  -b, --number-nonblank    number nonempty output lines
+  -e                       equivalent to -vE
+  -E, --show-ends          display $ at end of each line
+  -n, --number             number all output lines
+  -s, --squeeze-blank      suppress repeated empty output lines
+  -t                       equivalent to -vT
+  -T, --show-tabs          display TAB characters as ^I
+  -u                       (ignored)
+  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
+  --help     display this help and exit
+  --version  output version information and exit
+
+With no FILE, or when FILE is -, read standard input.
+
+Examples:
+  cat f - g  Output f's contents, then standard input, then g's           contents.
+  cat        Copy standard input to standard output.
+
+Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
+</div>
+</div>
+<div class="section" title="5. Basic file handling">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2770897"></a>5. Basic file handling</h2></div></div></div>
+<div class="section" title="5.1. cp">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2770906"></a>5.1. cp</h3></div></div></div>
+<p id="ch8ult_module_plan_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
+<div class="section" title="5.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2770923"></a>5.1.1. Usage</h4></div></div></div>
+<p id="ch8ult_module_plan_82"></a>To copy a file to another file:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
+<p id="ch8ult_module_plan_83"></a>To copy a file to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
+<p id="ch8ult_module_plan_84"></a>To copy a directory to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
+SourceDirectory ... TargetDirectory</pre>
+</div>
+<div class="section" title="5.1.2. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2770957"></a>5.1.2. Flags</h4></div></div></div>
+<p id="ch8ult_module_plan_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
+<p id="ch8ult_module_plan_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
+<p id="ch8ult_module_plan_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
+<p id="ch8ult_module_plan_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_89"></a>The time of the last data modification and the time of the last access.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
+</div>
+<div class="section" title="5.1.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2771056"></a>5.1.3. Examples</h4></div></div></div>
+<p id="ch8ult_module_plan_8d"></a>To make a copy of a file in the current directory, enter:</p>
+<pre class="programlisting">$ cp prog.c prog.bak</pre>
+<p id="ch8ult_module_plan_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
+<p id="ch8ult_module_plan_8f"></a>To copy a file in your current directory into another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
+<p id="ch8ult_module_plan_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
+<p id="ch8ult_module_plan_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
+<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
+<p id="ch8ult_module_plan_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
+<p id="ch8ult_module_plan_93"></a>To copy all the files in a directory to a new directory, enter:</p>
+<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
+<p id="ch8ult_module_plan_94"></a>This copies only the files in the clients directory to the customers directory.</p>
+<p id="ch8ult_module_plan_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch8ult_module_plan_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
+<p id="ch8ult_module_plan_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
+<p id="ch8ult_module_plan_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
+<p id="ch8ult_module_plan_9a"></a>To use pattern-matching characters to copy files, enter:</p>
+<pre class="programlisting">$ cp programs/*.py .</pre>
+<p id="ch8ult_module_plan_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
+</div>
+</div>
+<div class="section" title="5.2. mv">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2771220"></a>5.2. mv</h3></div></div></div>
+<p id="ch8ult_module_plan_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
+<div class="section" title="5.2.1. Conflicting existing file">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2771244"></a>5.2.1. Conflicting existing file</h4></div></div></div>
+<p id="ch8ult_module_plan_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
+</div>
+<div class="section" title="5.2.2. Differences with copy and delete">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2771264"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
+<p id="ch8ult_module_plan_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
+</div>
+<div class="section" title="5.2.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2771294"></a>5.2.3. Examples</h4></div></div></div>
+<pre class="programlisting">$ mv myfile mynewfilename    renames a file
+$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
+$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
+$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
+$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
+$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
+$ mv foo bar baz dir         moves multiple files to directory dir
+$ mv --help                  shows a very concise help about the                syntax of the command
+$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
+<p id="ch8ult_module_plan_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
+<p id="ch8ult_module_plan_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
+</div>
+</div>
+<div class="section" title="5.3. rm">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2771353"></a>5.3. rm</h3></div></div></div>
+<p id="ch8ult_module_plan_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
+<p id="ch8ult_module_plan_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
+<pre class="programlisting">$ rm -i foo
+remove foo? y</pre>
+<div class="section" title="5.3.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2768880"></a>5.3.1. Options</h4></div></div></div>
+<p id="ch8ult_module_plan_a3"></a>Common options that rm accepts include:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
+<p id="ch8ult_module_plan_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
+<p id="ch8ult_module_plan_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
+<pre class="programlisting">xargs rm &lt; filelist</pre>
+<p id="ch8ult_module_plan_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
+</div>
+<div class="section" title="5.3.2. Permissions">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2768983"></a>5.3.2. Permissions</h4></div></div></div>
+<p id="ch8ult_module_plan_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
+<p id="ch8ult_module_plan_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
+<p id="ch8ult_module_plan_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
+</div>
+</div>
+</div>
+<div class="section" title="6. Command Line Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2771662"></a>6. Command Line Arguments</h2></div></div></div>
+<p id="ch8ult_module_plan_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
+<p id="ch8ult_module_plan_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
+<pre class="programlisting">rm file.s</pre>
+<p id="ch8ult_module_plan_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
+<p id="ch8ult_module_plan_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
+<p id="ch8ult_module_plan_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
+<p id="ch8ult_module_plan_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
+<p id="ch8ult_module_plan_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
+</div>
+<div class="section" title="7. Basic Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2771755"></a>7. Basic Text Processing</h2></div></div></div>
+<div class="section" title="7.1. head">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2771764"></a>7.1. head</h3></div></div></div>
+<p id="ch8ult_module_plan_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
+<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
+<p id="ch8ult_module_plan_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
+<pre class="programlisting">$ head -n 20 filename</pre>
+<p id="ch8ult_module_plan_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ head -n 5 foo*</pre>
+<p id="ch8ult_module_plan_b9"></a>Some versions omit the n and just let you say -5.</p>
+<div class="section" title="7.1.1. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2771815"></a>7.1.1. Flags</h4></div></div></div>
+<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
+<p id="ch8ult_module_plan_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
+<p id="ch8ult_module_plan_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
+<pre class="programlisting">sed 5q foo</pre>
+<p id="ch8ult_module_plan_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
+</div>
+</div>
+<div class="section" title="7.2. tail">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2771851"></a>7.2. tail</h3></div></div></div>
+<p id="ch8ult_module_plan_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
+<p id="ch8ult_module_plan_be"></a>The command-syntax is:</p>
+<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
+<p id="ch8ult_module_plan_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
+<pre class="programlisting">$ tail -n 20 filename</pre>
+<p id="ch8ult_module_plan_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ tail -c 15 foo*</pre>
+<p id="ch8ult_module_plan_c1"></a>This example shows all lines of filename from the second line onwards:</p>
+<pre class="programlisting">$ tail -n +2 filename</pre>
+<p id="ch8ult_module_plan_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
+<pre class="programlisting">$ tail -20 filename
+$ tail -50c filename</pre>
+<p id="ch8ult_module_plan_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
+<div class="section" title="7.2.1. File monitoring">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2771929"></a>7.2.1. File monitoring</h4></div></div></div>
+<p id="ch8ult_module_plan_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
+<pre class="programlisting">$ tail -f /var/adm/messages</pre>
+<p id="ch8ult_module_plan_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
+<p id="ch8ult_module_plan_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
+</div>
+</div>
+<div class="section" title="7.3. cut">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2771978"></a>7.3. cut</h3></div></div></div>
+<p id="ch8ult_module_plan_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
+<p id="ch8ult_module_plan_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
+<p id="ch8ult_module_plan_c9"></a>Assuming a file named file containing the lines:</p>
+<pre class="programlisting">foo:bar:baz:qux:quux
+one:two:three:four:five:six:seven
+alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+<p id="ch8ult_module_plan_ca"></a>To output the fourth through tenth characters of each line:</p>
+<pre class="programlisting">$ cut -c 4-10 file</pre>
+<p id="ch8ult_module_plan_cb"></a>This gives the output:</p>
+<pre class="programlisting">:bar:ba
+:two:th
+ha:beta</pre>
+<p id="ch8ult_module_plan_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
+<pre class="programlisting">$ cut -d : -f 5- file</pre>
+<p id="ch8ult_module_plan_cd"></a>This gives the output:</p>
+<pre class="programlisting">quux
+five:six:seven
+epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+</div>
+<div class="section" title="7.4. paste">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2772065"></a>7.4. paste</h3></div></div></div>
+<p id="ch8ult_module_plan_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
+<p id="ch8ult_module_plan_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
+<pre class="programlisting">$ paste who where when &gt; www</pre>
+<p id="ch8ult_module_plan_d0"></a>If the files contain:</p>
+<table summary="paste" border="1"><colgroup>
+<col width="11">
+<col width="12">
+<col width="12">
+</colgroup></table>
+<p id="ch8ult_module_plan_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
+<pre class="programlisting">Batman            GothamCity       January 3
+Trillian          Andromeda        February 4
+Jeeves            London           March 19</pre>
+</div>
+</div>
+<div class="section" title="8. Shell Meta Characters">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2772200"></a>8. Shell Meta Characters</h2></div></div></div>
+<p id="ch8ult_module_plan_de"></a>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.</p>
+<p id="ch8ult_module_plan_df"></a>The shell meta characters include:</p>
+<p id="ch8ult_module_plan_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
+<p id="ch8ult_module_plan_e1"></a>Different shells may differ in the meta characters recognized.</p>
+<p id="ch8ult_module_plan_e2"></a>As an example,</p>
+<pre class="programlisting">$ ls file.*</pre>
+<p id="ch8ult_module_plan_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
+<pre class="programlisting">$ ls file.?</pre>
+<p id="ch8ult_module_plan_e4"></a>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:</p>
+<pre class="programlisting">$ more c*</pre>
+<p id="ch8ult_module_plan_e5"></a>because the c* matches that long file name.</p>
+<p id="ch8ult_module_plan_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
+<pre class="programlisting">$ rm ??more</pre>
+<p id="ch8ult_module_plan_e7"></a>or:</p>
+<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
+<p id="ch8ult_module_plan_e8"></a>or:</p>
+<pre class="programlisting">$ rm ''*|more''</pre>
+</div>
+<div class="section" title="9. Looking At Files">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2772308"></a>9. Looking At Files</h2></div></div></div>
+<div class="section" title="9.1. cat">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2772317"></a>9.1. cat</h3></div></div></div>
+<p id="ch8ult_module_plan_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
+<p id="ch8ult_module_plan_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
+<p id="ch8ult_module_plan_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
+<div class="section" title="9.1.1. Jargon File Definition">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2772360"></a>9.1.1. Jargon File Definition</h4></div></div></div>
+<p id="ch8ult_module_plan_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
+<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
+     pause (syn. blast).
+
+2. By extension, to dump large amounts of data at an unprepared target or
+     with no intention of browsing it carefully. Usage: considered silly.
+     Rare outside Unix sites. See also dd, BLT.
+
+     Among Unix fans, *cat(1)* is considered an excellent example of
+     user-interface design, because it delivers the file contents without
+     such verbosity as spacing or headers between the files, and because
+     it does not require the files to consist of lines of text, but works
+     with any sort of data.
+
+     Among Unix critics, *cat(1)* is considered the canonical example of
+     bad user-interface design, because of its woefully unobvious name.
+     It is far more often used to blast a single file to standard output
+     than to concatenate two or more files. The name cat for the former
+     operation is just as unintuitive as, say, LISP's cdr.
+
+     Of such oppositions are holy wars made...</pre>
+</div>
+<div class="section" title="9.1.2. Useless Use of 'cat'">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2772400"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
+<p id="ch8ult_module_plan_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
+<p id="ch8ult_module_plan_ee"></a>Nevertheless one sees people doing:</p>
+<pre class="programlisting">$ cat file | some_command and its args ...</pre>
+<p id="ch8ult_module_plan_ef"></a>instead of the equivalent and cheaper:</p>
+<pre class="programlisting">&lt;file some_command and its args ...</pre>
+<p id="ch8ult_module_plan_f0"></a>or (equivalently and more classically):</p>
+<pre class="programlisting">some_command and its args ... &lt;file</pre>
+<p id="ch8ult_module_plan_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
+<p id="ch8ult_module_plan_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
+</div>
+<div class="section" title="9.1.3. zcat">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2772471"></a>9.1.3. zcat</h4></div></div></div>
+<p id="ch8ult_module_plan_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
+</div>
+</div>
+<div class="section" title="9.2. more">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2772505"></a>9.2. more</h3></div></div></div>
+<p id="ch8ult_module_plan_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
+<div class="section" title="9.2.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2772524"></a>9.2.1. Usage</h4></div></div></div>
+<p id="ch8ult_module_plan_f5"></a>The command-syntax is:</p>
+<pre class="programlisting">$ more [options] [file_name]</pre>
+<p id="ch8ult_module_plan_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
+<p id="ch8ult_module_plan_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
+<p id="ch8ult_module_plan_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
+<p id="ch8ult_module_plan_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
+</div>
+</div>
+<div class="section" title="9.3. less">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2772616"></a>9.3. less</h3></div></div></div>
+<p id="ch8ult_module_plan_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
+<div class="section" title="9.3.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2772644"></a>9.3.1. Usage</h4></div></div></div>
+<p id="ch8ult_module_plan_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
+<p id="ch8ult_module_plan_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
+<p id="ch8ult_module_plan_fd"></a>The command-syntax is:</p>
+<pre class="programlisting">$ less [options] file_name</pre>
+</div>
+<div class="section" title="9.3.2. Frequently Used Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2772699"></a>9.3.2. Frequently Used Options</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_ff"></a>-I: Case-insensitive searches.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_103"></a>-?: Shows help.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.3. Frequently Used Commands">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2772752"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_105"></a>[Space bar]: Next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_106"></a>b: Previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_10a"></a>'^ or g: Go to start of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_10b"></a>'$ or G: Go to end of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_10d"></a>=: File information.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_10e"></a>h: Help.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_10f"></a>q: Quit.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.4. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2772843"></a>9.3.4. Examples</h4></div></div></div>
+<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
+$ less +F /var/log/mail.log              #Follow mode for log
+$ file * | less                          #Easier file analysis.
+$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
+</div>
+</div>
+</div>
+<div class="section" title="10. Directory Structure">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2772859"></a>10. Directory Structure</h2></div></div></div>
+<p id="ch8ult_module_plan_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
+<p id="ch8ult_module_plan_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
+<table summary="Directory Structure" border="1"><colgroup>
+<col width="15">
+<col width="48">
+</colgroup></table>
+<div class="section" title="10.1. man hier">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2773133"></a>10.1. man hier</h3></div></div></div>
+<p id="ch8ult_module_plan_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
+<pre class="programlisting">$ man hier</pre>
+</div>
+<div class="section" title="10.2. ls -l">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2773150"></a>10.2. ls -l</h3></div></div></div>
+<p id="ch8ult_module_plan_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
+<pre class="programlisting">$ ls -l</pre>
+<p id="ch8ult_module_plan_138"></a>This can be done after entering the required directory.</p>
+</div>
+</div>
+<div class="section" title="11. Permissions and Ownership">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2773173"></a>11. Permissions and Ownership</h2></div></div></div>
+<div class="section" title="11.1. chmod">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2773182"></a>11.1. chmod</h3></div></div></div>
+<p id="ch8ult_module_plan_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
+<div class="section" title="11.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2773207"></a>11.1.1. Usage</h4></div></div></div>
+<p id="ch8ult_module_plan_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
+<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
+<p id="ch8ult_module_plan_13b"></a>To view what the permissions currently are, type:</p>
+<pre class="programlisting">$ ls -l file</pre>
+</div>
+<div class="section" title="11.1.2. Command line options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2773236"></a>11.1.2. Command line options</h4></div></div></div>
+<p id="ch8ult_module_plan_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
+</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2773272"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
+<p id="ch8ult_module_plan_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
+<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
+<p id="ch8ult_module_plan_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="8">
+<col width="45">
+</colgroup></table>
+<p id="ch8ult_module_plan_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="54">
+</colgroup></table>
+<p id="ch8ult_module_plan_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="5">
+<col width="14">
+<col width="48">
+</colgroup></table>
+<p id="ch8ult_module_plan_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
+</div>
+<div class="section" title="11.1.2.2. Symbolic examples">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2773833"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
+<p id="ch8ult_module_plan_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
+<pre class="programlisting">$ chmod ug+rw mydir
+$ ls -ld mydir
+drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
+<p id="ch8ult_module_plan_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
+<pre class="programlisting">$ chmod a-w myfile
+$ ls -l myfile
+-r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
+<p id="ch8ult_module_plan_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
+<pre class="programlisting">$ chmod ug=rx mydir
+$ ls -ld mydir
+dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
+</div>
+<div class="section" title="11.1.2.3. Octal numbers">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2773877"></a>11.1.2.3. Octal numbers</h5></div></div></div>
+<p id="ch8ult_module_plan_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
+<pre class="programlisting">$ chmod 664 myfile
+$ ls -l myfile
+-rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
+<p id="ch8ult_module_plan_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
+<pre class="programlisting">$ chmod 0664 myfile</pre>
+</div>
+<div class="section" title="11.1.2.4. Special modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2773915"></a>11.1.2.4. Special modes</h5></div></div></div>
+<p id="ch8ult_module_plan_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
+<p id="ch8ult_module_plan_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="12. Redirection and Piping">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2773959"></a>12. Redirection and Piping</h2></div></div></div>
+<p id="ch8ult_module_plan_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
+<p id="ch8ult_module_plan_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
+<div class="section" title="12.1. Redirecting standard input and standard output">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2773995"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
+<p id="ch8ult_module_plan_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
+<pre class="programlisting">$ command1 &gt; file1</pre>
+<p id="ch8ult_module_plan_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
+<pre class="programlisting">$ command1 &lt; file1</pre>
+<p id="ch8ult_module_plan_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
+<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
+<p id="ch8ult_module_plan_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
+</div>
+<div class="section" title="12.2. Piping">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2774063"></a>12.2. Piping</h3></div></div></div>
+<p id="ch8ult_module_plan_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
+A pipeline of three programs run on a text terminal:</p>
+<pre class="programlisting">$ command1 | command2</pre>
+<p id="ch8ult_module_plan_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
+<p id="ch8ult_module_plan_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
+<pre class="programlisting">$ command1 &gt; tempfile
+$ command2 &lt; tempfile
+$ rm tempfile</pre>
+<p id="ch8ult_module_plan_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
+<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
+<p id="ch8ult_module_plan_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
+</div>
+<div class="section" title="12.3. Redirecting to and from the standard file handles">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2774125"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
+<p id="ch8ult_module_plan_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
+<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
+<col width="12">
+<col width="13">
+<col width="24">
+</colgroup></table>
+<p id="ch8ult_module_plan_18d"></a>For example:</p>
+<pre class="programlisting">$ command1 2&gt; file1</pre>
+<p id="ch8ult_module_plan_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
+<p id="ch8ult_module_plan_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
+<p id="ch8ult_module_plan_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
+<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
+<p id="ch8ult_module_plan_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
+<p id="ch8ult_module_plan_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
+<p id="ch8ult_module_plan_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
+<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
+<p id="ch8ult_module_plan_194"></a>A simplified form of the command:</p>
+<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
+<p id="ch8ult_module_plan_195"></a>is:</p>
+<pre class="programlisting">$ command &amp;&gt;file</pre>
+<p id="ch8ult_module_plan_196"></a>or:</p>
+<pre class="programlisting">$command &gt;&amp;file</pre>
+</div>
+<div class="section" title="12.4. Chained pipelines">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2774332"></a>12.4. Chained pipelines</h3></div></div></div>
+<p id="ch8ult_module_plan_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
+<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
+<p id="ch8ult_module_plan_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
+</div>
+<div class="section" title="12.5. Redirect to multiple outputs">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2774367"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
+<p id="ch8ult_module_plan_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
+<pre class="programlisting">$ ls -lrt | tee xyz</pre>
+<p id="ch8ult_module_plan_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
+</div>
+</div>
+<div class="section" title="13. More Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2774397"></a>13. More Text Processing</h2></div></div></div>
+<div class="section" title="13.1. grep">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2774406"></a>13.1. grep</h3></div></div></div>
+<p id="ch8ult_module_plan_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
+<div class="section" title="13.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2774437"></a>13.1.1. Usage</h4></div></div></div>
+<p id="ch8ult_module_plan_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
+<pre class="programlisting">$ grep apple fruitlist.txt</pre>
+<p id="ch8ult_module_plan_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
+<p id="ch8ult_module_plan_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
+<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
+<p id="ch8ult_module_plan_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
+<p id="ch8ult_module_plan_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
+<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
+<p id="ch8ult_module_plan_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
+<div class="section" title="13.1.1.1. Variations">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2774517"></a>13.1.1.1. Variations</h5></div></div></div>
+<p id="ch8ult_module_plan_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
+<p id="ch8ult_module_plan_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
+<p id="ch8ult_module_plan_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
+</div>
+</div>
+</div>
+<div class="section" title="13.2. tr">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2774596"></a>13.2. tr</h3></div></div></div>
+<p id="ch8ult_module_plan_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
+<p id="ch8ult_module_plan_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
+<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
+<p id="ch8ult_module_plan_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
+<p id="ch8ult_module_plan_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
+<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
+<p id="ch8ult_module_plan_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
+<p id="ch8ult_module_plan_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
+<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
+<p id="ch8ult_module_plan_1ab"></a>therefore removes all non-alphanumeric characters.</p>
+<p id="ch8ult_module_plan_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
+<pre class="programlisting">$ tr -s '\n' '\n'</pre>
+<p id="ch8ult_module_plan_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
+<p id="ch8ult_module_plan_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
+<pre class="programlisting">$ tr -d '\r'</pre>
+<p id="ch8ult_module_plan_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
+<p id="ch8ult_module_plan_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
+</div>
+</div>
+<div class="section" title="14. Elementary Regex">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2774748"></a>14. Elementary Regex</h2></div></div></div>
+<p id="ch8ult_module_plan_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
+<p id="ch8ult_module_plan_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
+<p id="ch8ult_module_plan_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
+<p id="ch8ult_module_plan_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
+<table summary="Elementary Regex" border="1"><colgroup>
+<col width="13">
+<col width="60">
+</colgroup></table>
+<div class="section" title="14.1. Lazy quantification">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2774972"></a>14.1. Lazy quantification</h3></div></div></div>
+<p id="ch8ult_module_plan_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
+<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
+<p id="ch8ult_module_plan_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
+<p id="ch8ult_module_plan_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
+</div>
+</div>
+<div class="section" title="15. One Liners">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2775048"></a>15. One Liners</h2></div></div></div>
+<p id="ch8ult_module_plan_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
+<p id="ch8ult_module_plan_1cd"></a>The one liner can be</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem"><p id="ch8ult_module_plan_1ce"></a>An expression written in the language of the shell.</p></li>
+<li class="listitem"><p id="ch8ult_module_plan_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
+<li class="listitem"><p id="ch8ult_module_plan_1d0"></a>The invocation of a compiler together with source to compile and
+instructions for executing the compiled program.</p></li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_1d1"></a>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.</p>
+<p id="ch8ult_module_plan_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
+<p id="ch8ult_module_plan_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
+<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
+<p id="ch8ult_module_plan_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
+<p id="ch8ult_module_plan_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
+<p id="ch8ult_module_plan_1d6"></a>Here are the first few of them:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<p id="ch8ult_module_plan_1d7"></a>Print the total number of input lines:</p>
+<p id="ch8ult_module_plan_1d8"></a>END { print NR }</p>
+</li>
+<li class="listitem">
+<p id="ch8ult_module_plan_1d9"></a>Print the tenth input line:</p>
+<p id="ch8ult_module_plan_1da"></a>NR == 10</p>
+</li>
+<li class="listitem">
+<p id="ch8ult_module_plan_1db"></a>Print the last field of every input line:</p>
+<p id="ch8ult_module_plan_1dc"></a>{ print $NF }</p>
+</li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_1dd"></a>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.</p>
+<p id="ch8ult_module_plan_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
+<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
+*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
+<p id="ch8ult_module_plan_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
+<p id="ch8ult_module_plan_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
+<pre class="programlisting">$ prog foo 'f??'; echo $?
+
+$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
+<p id="ch8ult_module_plan_1e1"></a>Here is a one line shell script to show directories:</p>
+<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
+</div>
+</div>
+</div></body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/ch9Using_Linux_Tools.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1139 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Using Linux tools</title>
+<link rel="stylesheet" href="/review/support/styles.css" type="text/css">
+<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
+<script type="text/javascript" src="/review/support/jquery-min.js"></script>
+<script type="text/javascript" src="/review/support/form.js"></script>
+<script type="text/javascript" src="/review/support/hsbook.js"></script>
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch9Using_Linux_Tools">
+<div class="titlepage"></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="article"><a href="#id2938781"></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2748906">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2938586">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2989832">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2990243">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2990384">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2990392">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2990672">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2990680">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2990844">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2990905">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2991009">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2991092">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2991272">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2991280">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2991364">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2991575">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2991667">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2991720">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2991728">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2992043">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2992175">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2992348">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2992441">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2992450">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2992537">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2992664">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2992751">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2992886">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2992994">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2993003">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2993191">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2993302">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2993551">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2993825">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2993842">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2993865">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2993874">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2994651">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2994687">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2994755">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2994817">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2995024">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2995059">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2995089">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2995098">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2995288">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2995440">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2995656">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2995732">15. One Liners</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="article">
+<div class="titlepage">
+<div><div><h2 class="title" id="id2938781"></a></h2></div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#id2748906">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2938586">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2989832">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2990243">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2990384">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2990392">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2990672">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2990680">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2990844">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2990905">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2991009">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2991092">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2991272">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2991280">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2991364">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2991575">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2991667">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2991720">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2991728">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2992043">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2992175">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2992348">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2992441">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2992450">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2992537">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2992664">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2992751">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2992886">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2992994">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2993003">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2993191">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2993302">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2993551">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2993825">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2993842">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2993865">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2993874">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2994651">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2994687">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2994755">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2994817">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2995024">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2995059">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2995089">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2995098">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2995288">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2995440">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2995656">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2995732">15. One Liners</a></span></dt>
+</dl>
+</div>
+<div class="section" title="1. Introducing Linux">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2748906"></a>1. Introducing Linux</h2></div></div></div>
+<p id="ch9Using_Linux_Tools_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
+<p id="ch9Using_Linux_Tools_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
+<p id="ch9Using_Linux_Tools_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
+<p id="ch9Using_Linux_Tools_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
+<div class="section" title="1.1. Historical Background">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2938586"></a>1.1. Historical Background</h3></div></div></div>
+<div class="section" title="1.1.1. Events leading to the creation">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2936567"></a>1.1.1. Events leading to the creation</h4></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
+</ul></div>
+</div>
+<div class="section" title="1.1.2. The Creation of Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2989798"></a>1.1.2. The Creation of Linux</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
+<p id="ch9Using_Linux_Tools_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
+</div>
+</div>
+<div class="section" title="1.2. Design and Implications">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2989832"></a>1.2. Design and Implications</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
+<div class="section" title="1.2.1. User Interface">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2989857"></a>1.2.1. User Interface</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
+<p id="ch9Using_Linux_Tools_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
+</div>
+<div class="section" title="1.2.2. Development">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2989911"></a>1.2.2. Development</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
+<p id="ch9Using_Linux_Tools_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
+<p id="ch9Using_Linux_Tools_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
+</div>
+<div class="section" title="1.2.3. Community">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2989612"></a>1.2.3. Community</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
+<p id="ch9Using_Linux_Tools_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
+<p id="ch9Using_Linux_Tools_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
+</div>
+<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2989657"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
+</div>
+<div class="section" title="1.2.5. Programming on Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2989703"></a>1.2.5. Programming on Linux</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
+<p id="ch9Using_Linux_Tools_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
+<p id="ch9Using_Linux_Tools_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
+</div>
+</div>
+<div class="section" title="1.3. Reasons for Using Linux">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2990243"></a>1.3. Reasons for Using Linux</h3></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_16"></a>Linux is free:</p></li></ul></div>
+<p id="ch9Using_Linux_Tools_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
+Most of all, Linux is free as in "free speech":
+The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
+<p id="ch9Using_Linux_Tools_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_1a"></a>Linux was made to keep on running:</p></li></ul></div>
+<p id="ch9Using_Linux_Tools_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_1c"></a>Linux is secure and versatile:</p></li></ul></div>
+<p id="ch9Using_Linux_Tools_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_1e"></a>Linux is scalable:</p></li></ul></div>
+<p id="ch9Using_Linux_Tools_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
+<p id="ch9Using_Linux_Tools_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
+</div>
+</div>
+<div class="section" title="2. Getting Started">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2990384"></a>2. Getting Started</h2></div></div></div>
+<div class="section" title="2.1. Logging in, activating the user interface and logging out">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2990392"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
+<div class="section" title="2.1.1. Graphical Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2990423"></a>2.1.1. Graphical Mode</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
+<p id="ch9Using_Linux_Tools_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
+It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
+<p id="ch9Using_Linux_Tools_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
+<p id="ch9Using_Linux_Tools_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
+<p id="ch9Using_Linux_Tools_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
+<p id="ch9Using_Linux_Tools_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
+<p id="ch9Using_Linux_Tools_29"></a>Another common form for a prompt is this one:
+[</p>
+<div class="reference">
+<div class="titlepage"><hr></div>user@host</div>
+<p> dir]</p>
+<p id="ch9Using_Linux_Tools_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
+<p id="ch9Using_Linux_Tools_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
+</div>
+<div class="section" title="2.1.2. Text Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2990582"></a>2.1.2. Text Mode</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
+<p id="ch9Using_Linux_Tools_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
+reasons.</p>
+<p id="ch9Using_Linux_Tools_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
+<p id="ch9Using_Linux_Tools_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
+<p id="ch9Using_Linux_Tools_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
+</div>
+</div>
+</div>
+<div class="section" title="3. Basic Commands">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2990672"></a>3. Basic Commands</h2></div></div></div>
+<div class="section" title="3.1. ls">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2990680"></a>3.1. ls</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
+<p id="ch9Using_Linux_Tools_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
+<p id="ch9Using_Linux_Tools_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
+<pre class="programlisting">$ ls
+jeeves.rst psmith.html blandings.html
+$ ls -l
+drwxr--r--   1 plum  editors   4096  jeeves
+-rw-r--r--   1 plum  editors  30405  psmith
+-r-xr-xr-x   1 plum  plum      8460  blandings</pre>
+<p id="ch9Using_Linux_Tools_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
+</div>
+<div class="section" title="3.2. date">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2990844"></a>3.2. date</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
+<p id="ch9Using_Linux_Tools_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
+<pre class="programlisting">$date
+Tue Sep  8 12:01:45 IST 2009</pre>
+<p id="ch9Using_Linux_Tools_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
+<pre class="programlisting">$date --set="20040908 01:22"</pre>
+<p id="ch9Using_Linux_Tools_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
+<pre class="programlisting">$man date</pre>
+<p id="ch9Using_Linux_Tools_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
+</div>
+<div class="section" title="3.3. cd">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2990905"></a>3.3. cd</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
+<p id="ch9Using_Linux_Tools_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
+<p id="ch9Using_Linux_Tools_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
+<p id="ch9Using_Linux_Tools_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
+<p id="ch9Using_Linux_Tools_46"></a>Absolute paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch9Using_Linux_Tools_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_48"></a>For example to get to /boot/grub you would type:</p>
+<pre class="programlisting">$cd /boot/grub</pre>
+<p id="ch9Using_Linux_Tools_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
+<p id="ch9Using_Linux_Tools_4a"></a>Relative paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch9Using_Linux_Tools_4b"></a>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.</p>
+<p id="ch9Using_Linux_Tools_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
+<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_4d"></a>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.</p>
+</div>
+<div class="section" title="3.4. who">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2991009"></a>3.4. who</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
+<p id="ch9Using_Linux_Tools_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
+<pre class="programlisting">$who
+beeblebrox tty7         2009-09-08 10:50 (:0)
+beeblebrox pts/0        2009-09-08 11:25 (:0.0)
+dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
+beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
+<p id="ch9Using_Linux_Tools_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
+<p id="ch9Using_Linux_Tools_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
+<pre class="programlisting">$man who</pre>
+<p id="ch9Using_Linux_Tools_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
+</div>
+<div class="section" title="3.5. mkdir">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2991092"></a>3.5. mkdir</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
+<pre class="programlisting">$mkdir name_of_directory</pre>
+<p id="ch9Using_Linux_Tools_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
+<div class="section" title="3.5.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2991124"></a>3.5.1. Options</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
+</div>
+<div class="section" title="3.5.2. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2991185"></a>3.5.2. Examples</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
+<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
+<p id="ch9Using_Linux_Tools_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
+<p id="ch9Using_Linux_Tools_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
+<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
+<p id="ch9Using_Linux_Tools_5d"></a>This will create:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_5e"></a>tag</p></li>
+<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
+</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
+</div>
+</div>
+</div>
+<div class="section" title="4. Getting Help">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2991272"></a>4. Getting Help</h2></div></div></div>
+<div class="section" title="4.1. apropos and whatis">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2991280"></a>4.1. apropos and whatis</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
+<pre class="programlisting">$ apropos grep
+egrep       egrep (1)       Search a file for a pattern using full regular expressions
+fgrep       fgrep (1)       Search a file for a fixed-character string
+fmlgrep     fmlgrep (1)     Search a file for a pattern
+grep        grep (1)        Search a file for a pattern
+gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
+nisgrep     nismatch (1)    Utilities for searching NIS+ tables
+pgrep       pgrep (1)       Find or signal a process by name or other attribute
+zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
+...</pre>
+<p id="ch9Using_Linux_Tools_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
+<p id="ch9Using_Linux_Tools_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
+<pre class="programlisting">$whatis ls
+ls (1)           - list directory contents</pre>
+<p id="ch9Using_Linux_Tools_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
+<p id="ch9Using_Linux_Tools_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
+<pre class="programlisting">$apropos browser
+gmusicbrowser (1)    - Jukebox for large collections of audio files
+infobrowser (1)      - read Info documents
+libsmbclient (7)     - An extension library for browsers and that               can be used...
+opera (1)            - a standards-compliant graphical Web browser
+sensible-browser (1) - sensible editing, paging, and web browsing
+smbtree (1)          - A text based smb network browser
+tvtk_doc (1)         - A GUI based TVTK documentation search browser.
+viewres (1)          - graphical class browser for Xt
+w3m (1)              - a text based Web browser and pager
+www-browser (1)      - a text based Web browser and pager
+...</pre>
+</div>
+<div class="section" title="4.2. man">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2991364"></a>4.2. man</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
+<p id="ch9Using_Linux_Tools_66"></a>To read a manual page for a Unix command, one can use:</p>
+<pre class="programlisting">$ man &lt;command_name&gt;</pre>
+<p id="ch9Using_Linux_Tools_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
+<p id="ch9Using_Linux_Tools_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
+<pre class="programlisting">$man 3 printf</pre>
+<p id="ch9Using_Linux_Tools_69"></a>Another example:</p>
+<pre class="programlisting">$man man</pre>
+<p id="ch9Using_Linux_Tools_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
+<div class="section" title="4.2.1. Layout">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2991447"></a>4.2.1. Layout</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_6b"></a>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:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch9Using_Linux_Tools_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch9Using_Linux_Tools_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch9Using_Linux_Tools_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch9Using_Linux_Tools_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch9Using_Linux_Tools_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch9Using_Linux_Tools_71"></a>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.</p>
+<p id="ch9Using_Linux_Tools_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
+<p id="ch9Using_Linux_Tools_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
+<p id="ch9Using_Linux_Tools_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
+<p id="ch9Using_Linux_Tools_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
+<p id="ch9Using_Linux_Tools_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
+</div>
+</div>
+<div class="section" title="4.3. info">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2991575"></a>4.3. info</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
+<p id="ch9Using_Linux_Tools_78"></a>The syntax is</p>
+<pre class="programlisting">$ info &lt;command_name&gt;</pre>
+<p id="ch9Using_Linux_Tools_79"></a><span class="emphasis"><em>info</em></span> 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</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
+</div>
+<div class="section" title="4.4. --help">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2991667"></a>4.4. --help</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
+<pre class="programlisting">$ userprompt@host: cat --help
+Usage: cat [OPTION] [FILE]...
+Concatenate FILE(s), or standard input, to standard output.
+
+  -A, --show-all           equivalent to -vET
+  -b, --number-nonblank    number nonempty output lines
+  -e                       equivalent to -vE
+  -E, --show-ends          display $ at end of each line
+  -n, --number             number all output lines
+  -s, --squeeze-blank      suppress repeated empty output lines
+  -t                       equivalent to -vT
+  -T, --show-tabs          display TAB characters as ^I
+  -u                       (ignored)
+  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
+  --help     display this help and exit
+  --version  output version information and exit
+
+With no FILE, or when FILE is -, read standard input.
+
+Examples:
+  cat f - g  Output f's contents, then standard input, then g's           contents.
+  cat        Copy standard input to standard output.
+
+Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
+</div>
+</div>
+<div class="section" title="5. Basic file handling">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2991720"></a>5. Basic file handling</h2></div></div></div>
+<div class="section" title="5.1. cp">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2991728"></a>5.1. cp</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
+<div class="section" title="5.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2991746"></a>5.1.1. Usage</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_82"></a>To copy a file to another file:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
+<p id="ch9Using_Linux_Tools_83"></a>To copy a file to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
+<p id="ch9Using_Linux_Tools_84"></a>To copy a directory to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
+SourceDirectory ... TargetDirectory</pre>
+</div>
+<div class="section" title="5.1.2. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2991780"></a>5.1.2. Flags</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
+<p id="ch9Using_Linux_Tools_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
+<p id="ch9Using_Linux_Tools_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
+<p id="ch9Using_Linux_Tools_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_89"></a>The time of the last data modification and the time of the last access.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
+</div>
+<div class="section" title="5.1.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2991879"></a>5.1.3. Examples</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_8d"></a>To make a copy of a file in the current directory, enter:</p>
+<pre class="programlisting">$ cp prog.c prog.bak</pre>
+<p id="ch9Using_Linux_Tools_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
+<p id="ch9Using_Linux_Tools_8f"></a>To copy a file in your current directory into another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
+<p id="ch9Using_Linux_Tools_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
+<p id="ch9Using_Linux_Tools_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
+<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
+<p id="ch9Using_Linux_Tools_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
+<p id="ch9Using_Linux_Tools_93"></a>To copy all the files in a directory to a new directory, enter:</p>
+<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
+<p id="ch9Using_Linux_Tools_94"></a>This copies only the files in the clients directory to the customers directory.</p>
+<p id="ch9Using_Linux_Tools_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch9Using_Linux_Tools_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
+<p id="ch9Using_Linux_Tools_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
+<p id="ch9Using_Linux_Tools_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
+<p id="ch9Using_Linux_Tools_9a"></a>To use pattern-matching characters to copy files, enter:</p>
+<pre class="programlisting">$ cp programs/*.py .</pre>
+<p id="ch9Using_Linux_Tools_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
+</div>
+</div>
+<div class="section" title="5.2. mv">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2992043"></a>5.2. mv</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
+<div class="section" title="5.2.1. Conflicting existing file">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2992067"></a>5.2.1. Conflicting existing file</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
+</div>
+<div class="section" title="5.2.2. Differences with copy and delete">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2992086"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
+</div>
+<div class="section" title="5.2.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2992117"></a>5.2.3. Examples</h4></div></div></div>
+<pre class="programlisting">$ mv myfile mynewfilename    renames a file
+$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
+$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
+$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
+$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
+$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
+$ mv foo bar baz dir         moves multiple files to directory dir
+$ mv --help                  shows a very concise help about the                syntax of the command
+$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
+<p id="ch9Using_Linux_Tools_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
+<p id="ch9Using_Linux_Tools_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
+</div>
+</div>
+<div class="section" title="5.3. rm">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2992175"></a>5.3. rm</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
+<p id="ch9Using_Linux_Tools_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
+<pre class="programlisting">$ rm -i foo
+remove foo? y</pre>
+<div class="section" title="5.3.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2992205"></a>5.3.1. Options</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_a3"></a>Common options that rm accepts include:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
+<p id="ch9Using_Linux_Tools_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
+<p id="ch9Using_Linux_Tools_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
+<pre class="programlisting">xargs rm &lt; filelist</pre>
+<p id="ch9Using_Linux_Tools_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
+</div>
+<div class="section" title="5.3.2. Permissions">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2992308"></a>5.3.2. Permissions</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
+<p id="ch9Using_Linux_Tools_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
+<p id="ch9Using_Linux_Tools_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
+</div>
+</div>
+</div>
+<div class="section" title="6. Command Line Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2992348"></a>6. Command Line Arguments</h2></div></div></div>
+<p id="ch9Using_Linux_Tools_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
+<p id="ch9Using_Linux_Tools_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
+<pre class="programlisting">rm file.s</pre>
+<p id="ch9Using_Linux_Tools_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
+<p id="ch9Using_Linux_Tools_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
+<p id="ch9Using_Linux_Tools_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
+<p id="ch9Using_Linux_Tools_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
+<p id="ch9Using_Linux_Tools_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
+</div>
+<div class="section" title="7. Basic Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2992441"></a>7. Basic Text Processing</h2></div></div></div>
+<div class="section" title="7.1. head">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2992450"></a>7.1. head</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
+<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
+<p id="ch9Using_Linux_Tools_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
+<pre class="programlisting">$ head -n 20 filename</pre>
+<p id="ch9Using_Linux_Tools_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ head -n 5 foo*</pre>
+<p id="ch9Using_Linux_Tools_b9"></a>Some versions omit the n and just let you say -5.</p>
+<div class="section" title="7.1.1. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2992501"></a>7.1.1. Flags</h4></div></div></div>
+<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
+<p id="ch9Using_Linux_Tools_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
+<p id="ch9Using_Linux_Tools_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
+<pre class="programlisting">sed 5q foo</pre>
+<p id="ch9Using_Linux_Tools_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
+</div>
+</div>
+<div class="section" title="7.2. tail">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2992537"></a>7.2. tail</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
+<p id="ch9Using_Linux_Tools_be"></a>The command-syntax is:</p>
+<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
+<p id="ch9Using_Linux_Tools_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
+<pre class="programlisting">$ tail -n 20 filename</pre>
+<p id="ch9Using_Linux_Tools_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ tail -c 15 foo*</pre>
+<p id="ch9Using_Linux_Tools_c1"></a>This example shows all lines of filename from the second line onwards:</p>
+<pre class="programlisting">$ tail -n +2 filename</pre>
+<p id="ch9Using_Linux_Tools_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
+<pre class="programlisting">$ tail -20 filename
+$ tail -50c filename</pre>
+<p id="ch9Using_Linux_Tools_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
+<div class="section" title="7.2.1. File monitoring">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2992615"></a>7.2.1. File monitoring</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
+<pre class="programlisting">$ tail -f /var/adm/messages</pre>
+<p id="ch9Using_Linux_Tools_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
+<p id="ch9Using_Linux_Tools_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
+</div>
+</div>
+<div class="section" title="7.3. cut">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2992664"></a>7.3. cut</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
+<p id="ch9Using_Linux_Tools_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
+<p id="ch9Using_Linux_Tools_c9"></a>Assuming a file named file containing the lines:</p>
+<pre class="programlisting">foo:bar:baz:qux:quux
+one:two:three:four:five:six:seven
+alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+<p id="ch9Using_Linux_Tools_ca"></a>To output the fourth through tenth characters of each line:</p>
+<pre class="programlisting">$ cut -c 4-10 file</pre>
+<p id="ch9Using_Linux_Tools_cb"></a>This gives the output:</p>
+<pre class="programlisting">:bar:ba
+:two:th
+ha:beta</pre>
+<p id="ch9Using_Linux_Tools_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
+<pre class="programlisting">$ cut -d : -f 5- file</pre>
+<p id="ch9Using_Linux_Tools_cd"></a>This gives the output:</p>
+<pre class="programlisting">quux
+five:six:seven
+epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+</div>
+<div class="section" title="7.4. paste">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2992751"></a>7.4. paste</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
+<p id="ch9Using_Linux_Tools_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
+<pre class="programlisting">$ paste who where when &gt; www</pre>
+<p id="ch9Using_Linux_Tools_d0"></a>If the files contain:</p>
+<table summary="paste" border="1"><colgroup>
+<col width="11">
+<col width="12">
+<col width="12">
+</colgroup></table>
+<p id="ch9Using_Linux_Tools_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
+<pre class="programlisting">Batman            GothamCity       January 3
+Trillian          Andromeda        February 4
+Jeeves            London           March 19</pre>
+</div>
+</div>
+<div class="section" title="8. Shell Meta Characters">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2992886"></a>8. Shell Meta Characters</h2></div></div></div>
+<p id="ch9Using_Linux_Tools_de"></a>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.</p>
+<p id="ch9Using_Linux_Tools_df"></a>The shell meta characters include:</p>
+<p id="ch9Using_Linux_Tools_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
+<p id="ch9Using_Linux_Tools_e1"></a>Different shells may differ in the meta characters recognized.</p>
+<p id="ch9Using_Linux_Tools_e2"></a>As an example,</p>
+<pre class="programlisting">$ ls file.*</pre>
+<p id="ch9Using_Linux_Tools_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
+<pre class="programlisting">$ ls file.?</pre>
+<p id="ch9Using_Linux_Tools_e4"></a>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:</p>
+<pre class="programlisting">$ more c*</pre>
+<p id="ch9Using_Linux_Tools_e5"></a>because the c* matches that long file name.</p>
+<p id="ch9Using_Linux_Tools_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
+<pre class="programlisting">$ rm ??more</pre>
+<p id="ch9Using_Linux_Tools_e7"></a>or:</p>
+<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
+<p id="ch9Using_Linux_Tools_e8"></a>or:</p>
+<pre class="programlisting">$ rm ''*|more''</pre>
+</div>
+<div class="section" title="9. Looking At Files">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2992994"></a>9. Looking At Files</h2></div></div></div>
+<div class="section" title="9.1. cat">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2993003"></a>9.1. cat</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
+<p id="ch9Using_Linux_Tools_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
+<p id="ch9Using_Linux_Tools_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
+<div class="section" title="9.1.1. Jargon File Definition">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2993046"></a>9.1.1. Jargon File Definition</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
+<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
+     pause (syn. blast).
+
+2. By extension, to dump large amounts of data at an unprepared target or
+     with no intention of browsing it carefully. Usage: considered silly.
+     Rare outside Unix sites. See also dd, BLT.
+
+     Among Unix fans, *cat(1)* is considered an excellent example of
+     user-interface design, because it delivers the file contents without
+     such verbosity as spacing or headers between the files, and because
+     it does not require the files to consist of lines of text, but works
+     with any sort of data.
+
+     Among Unix critics, *cat(1)* is considered the canonical example of
+     bad user-interface design, because of its woefully unobvious name.
+     It is far more often used to blast a single file to standard output
+     than to concatenate two or more files. The name cat for the former
+     operation is just as unintuitive as, say, LISP's cdr.
+
+     Of such oppositions are holy wars made...</pre>
+</div>
+<div class="section" title="9.1.2. Useless Use of 'cat'">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2993086"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
+<p id="ch9Using_Linux_Tools_ee"></a>Nevertheless one sees people doing:</p>
+<pre class="programlisting">$ cat file | some_command and its args ...</pre>
+<p id="ch9Using_Linux_Tools_ef"></a>instead of the equivalent and cheaper:</p>
+<pre class="programlisting">&lt;file some_command and its args ...</pre>
+<p id="ch9Using_Linux_Tools_f0"></a>or (equivalently and more classically):</p>
+<pre class="programlisting">some_command and its args ... &lt;file</pre>
+<p id="ch9Using_Linux_Tools_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
+<p id="ch9Using_Linux_Tools_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
+</div>
+<div class="section" title="9.1.3. zcat">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2993157"></a>9.1.3. zcat</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
+</div>
+</div>
+<div class="section" title="9.2. more">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2993191"></a>9.2. more</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
+<div class="section" title="9.2.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2993210"></a>9.2.1. Usage</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_f5"></a>The command-syntax is:</p>
+<pre class="programlisting">$ more [options] [file_name]</pre>
+<p id="ch9Using_Linux_Tools_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
+<p id="ch9Using_Linux_Tools_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
+<p id="ch9Using_Linux_Tools_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
+<p id="ch9Using_Linux_Tools_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
+</div>
+</div>
+<div class="section" title="9.3. less">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2993302"></a>9.3. less</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
+<div class="section" title="9.3.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2993331"></a>9.3.1. Usage</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
+<p id="ch9Using_Linux_Tools_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
+<p id="ch9Using_Linux_Tools_fd"></a>The command-syntax is:</p>
+<pre class="programlisting">$ less [options] file_name</pre>
+</div>
+<div class="section" title="9.3.2. Frequently Used Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2993391"></a>9.3.2. Frequently Used Options</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_ff"></a>-I: Case-insensitive searches.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_103"></a>-?: Shows help.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.3. Frequently Used Commands">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2993444"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_105"></a>[Space bar]: Next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_106"></a>b: Previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_10a"></a>'^ or g: Go to start of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_10b"></a>'$ or G: Go to end of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_10d"></a>=: File information.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_10e"></a>h: Help.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_10f"></a>q: Quit.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.4. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2993535"></a>9.3.4. Examples</h4></div></div></div>
+<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
+$ less +F /var/log/mail.log              #Follow mode for log
+$ file * | less                          #Easier file analysis.
+$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
+</div>
+</div>
+</div>
+<div class="section" title="10. Directory Structure">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2993551"></a>10. Directory Structure</h2></div></div></div>
+<p id="ch9Using_Linux_Tools_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
+<p id="ch9Using_Linux_Tools_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
+<table summary="Directory Structure" border="1"><colgroup>
+<col width="15">
+<col width="48">
+</colgroup></table>
+<div class="section" title="10.1. man hier">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2993825"></a>10.1. man hier</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
+<pre class="programlisting">$ man hier</pre>
+</div>
+<div class="section" title="10.2. ls -l">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2993842"></a>10.2. ls -l</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
+<pre class="programlisting">$ ls -l</pre>
+<p id="ch9Using_Linux_Tools_138"></a>This can be done after entering the required directory.</p>
+</div>
+</div>
+<div class="section" title="11. Permissions and Ownership">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2993865"></a>11. Permissions and Ownership</h2></div></div></div>
+<div class="section" title="11.1. chmod">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2993874"></a>11.1. chmod</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
+<div class="section" title="11.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2993899"></a>11.1.1. Usage</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
+<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
+<p id="ch9Using_Linux_Tools_13b"></a>To view what the permissions currently are, type:</p>
+<pre class="programlisting">$ ls -l file</pre>
+</div>
+<div class="section" title="11.1.2. Command line options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2993928"></a>11.1.2. Command line options</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
+</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2993964"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
+<p id="ch9Using_Linux_Tools_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
+<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
+<p id="ch9Using_Linux_Tools_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="8">
+<col width="45">
+</colgroup></table>
+<p id="ch9Using_Linux_Tools_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="54">
+</colgroup></table>
+<p id="ch9Using_Linux_Tools_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="5">
+<col width="14">
+<col width="48">
+</colgroup></table>
+<p id="ch9Using_Linux_Tools_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
+</div>
+<div class="section" title="11.1.2.2. Symbolic examples">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2994525"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
+<p id="ch9Using_Linux_Tools_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
+<pre class="programlisting">$ chmod ug+rw mydir
+$ ls -ld mydir
+drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
+<p id="ch9Using_Linux_Tools_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
+<pre class="programlisting">$ chmod a-w myfile
+$ ls -l myfile
+-r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
+<p id="ch9Using_Linux_Tools_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
+<pre class="programlisting">$ chmod ug=rx mydir
+$ ls -ld mydir
+dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
+</div>
+<div class="section" title="11.1.2.3. Octal numbers">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2994569"></a>11.1.2.3. Octal numbers</h5></div></div></div>
+<p id="ch9Using_Linux_Tools_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
+<pre class="programlisting">$ chmod 664 myfile
+$ ls -l myfile
+-rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
+<p id="ch9Using_Linux_Tools_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
+<pre class="programlisting">$ chmod 0664 myfile</pre>
+</div>
+<div class="section" title="11.1.2.4. Special modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2994607"></a>11.1.2.4. Special modes</h5></div></div></div>
+<p id="ch9Using_Linux_Tools_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
+<p id="ch9Using_Linux_Tools_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="12. Redirection and Piping">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2994651"></a>12. Redirection and Piping</h2></div></div></div>
+<p id="ch9Using_Linux_Tools_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
+<p id="ch9Using_Linux_Tools_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
+<div class="section" title="12.1. Redirecting standard input and standard output">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2994687"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
+<pre class="programlisting">$ command1 &gt; file1</pre>
+<p id="ch9Using_Linux_Tools_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
+<pre class="programlisting">$ command1 &lt; file1</pre>
+<p id="ch9Using_Linux_Tools_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
+<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
+<p id="ch9Using_Linux_Tools_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
+</div>
+<div class="section" title="12.2. Piping">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2994755"></a>12.2. Piping</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
+A pipeline of three programs run on a text terminal:</p>
+<pre class="programlisting">$ command1 | command2</pre>
+<p id="ch9Using_Linux_Tools_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
+<p id="ch9Using_Linux_Tools_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
+<pre class="programlisting">$ command1 &gt; tempfile
+$ command2 &lt; tempfile
+$ rm tempfile</pre>
+<p id="ch9Using_Linux_Tools_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
+<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
+<p id="ch9Using_Linux_Tools_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
+</div>
+<div class="section" title="12.3. Redirecting to and from the standard file handles">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2994817"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
+<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
+<col width="12">
+<col width="13">
+<col width="24">
+</colgroup></table>
+<p id="ch9Using_Linux_Tools_18d"></a>For example:</p>
+<pre class="programlisting">$ command1 2&gt; file1</pre>
+<p id="ch9Using_Linux_Tools_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
+<p id="ch9Using_Linux_Tools_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
+<p id="ch9Using_Linux_Tools_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
+<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
+<p id="ch9Using_Linux_Tools_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
+<p id="ch9Using_Linux_Tools_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
+<p id="ch9Using_Linux_Tools_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
+<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
+<p id="ch9Using_Linux_Tools_194"></a>A simplified form of the command:</p>
+<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
+<p id="ch9Using_Linux_Tools_195"></a>is:</p>
+<pre class="programlisting">$ command &amp;&gt;file</pre>
+<p id="ch9Using_Linux_Tools_196"></a>or:</p>
+<pre class="programlisting">$command &gt;&amp;file</pre>
+</div>
+<div class="section" title="12.4. Chained pipelines">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2995024"></a>12.4. Chained pipelines</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
+<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
+<p id="ch9Using_Linux_Tools_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
+</div>
+<div class="section" title="12.5. Redirect to multiple outputs">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2995059"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
+<pre class="programlisting">$ ls -lrt | tee xyz</pre>
+<p id="ch9Using_Linux_Tools_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
+</div>
+</div>
+<div class="section" title="13. More Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2995089"></a>13. More Text Processing</h2></div></div></div>
+<div class="section" title="13.1. grep">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2995098"></a>13.1. grep</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
+<div class="section" title="13.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2995129"></a>13.1.1. Usage</h4></div></div></div>
+<p id="ch9Using_Linux_Tools_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
+<pre class="programlisting">$ grep apple fruitlist.txt</pre>
+<p id="ch9Using_Linux_Tools_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
+<p id="ch9Using_Linux_Tools_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
+<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
+<p id="ch9Using_Linux_Tools_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
+<p id="ch9Using_Linux_Tools_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
+<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
+<p id="ch9Using_Linux_Tools_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
+<div class="section" title="13.1.1.1. Variations">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2995209"></a>13.1.1.1. Variations</h5></div></div></div>
+<p id="ch9Using_Linux_Tools_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
+<p id="ch9Using_Linux_Tools_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
+<p id="ch9Using_Linux_Tools_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
+</div>
+</div>
+</div>
+<div class="section" title="13.2. tr">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2995288"></a>13.2. tr</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
+<p id="ch9Using_Linux_Tools_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
+<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
+<p id="ch9Using_Linux_Tools_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
+<p id="ch9Using_Linux_Tools_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
+<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
+<p id="ch9Using_Linux_Tools_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
+<p id="ch9Using_Linux_Tools_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
+<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
+<p id="ch9Using_Linux_Tools_1ab"></a>therefore removes all non-alphanumeric characters.</p>
+<p id="ch9Using_Linux_Tools_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
+<pre class="programlisting">$ tr -s '\n' '\n'</pre>
+<p id="ch9Using_Linux_Tools_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
+<p id="ch9Using_Linux_Tools_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
+<pre class="programlisting">$ tr -d '\r'</pre>
+<p id="ch9Using_Linux_Tools_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
+<p id="ch9Using_Linux_Tools_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
+</div>
+</div>
+<div class="section" title="14. Elementary Regex">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2995440"></a>14. Elementary Regex</h2></div></div></div>
+<p id="ch9Using_Linux_Tools_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
+<p id="ch9Using_Linux_Tools_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
+<p id="ch9Using_Linux_Tools_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
+<p id="ch9Using_Linux_Tools_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
+<table summary="Elementary Regex" border="1"><colgroup>
+<col width="13">
+<col width="60">
+</colgroup></table>
+<div class="section" title="14.1. Lazy quantification">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2995656"></a>14.1. Lazy quantification</h3></div></div></div>
+<p id="ch9Using_Linux_Tools_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
+<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
+<p id="ch9Using_Linux_Tools_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
+<p id="ch9Using_Linux_Tools_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
+</div>
+</div>
+<div class="section" title="15. One Liners">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2995732"></a>15. One Liners</h2></div></div></div>
+<p id="ch9Using_Linux_Tools_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
+<p id="ch9Using_Linux_Tools_1cd"></a>The one liner can be</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem"><p id="ch9Using_Linux_Tools_1ce"></a>An expression written in the language of the shell.</p></li>
+<li class="listitem"><p id="ch9Using_Linux_Tools_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
+<li class="listitem"><p id="ch9Using_Linux_Tools_1d0"></a>The invocation of a compiler together with source to compile and
+instructions for executing the compiled program.</p></li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_1d1"></a>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.</p>
+<p id="ch9Using_Linux_Tools_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
+<p id="ch9Using_Linux_Tools_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
+<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
+<p id="ch9Using_Linux_Tools_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
+<p id="ch9Using_Linux_Tools_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
+<p id="ch9Using_Linux_Tools_1d6"></a>Here are the first few of them:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<p id="ch9Using_Linux_Tools_1d7"></a>Print the total number of input lines:</p>
+<p id="ch9Using_Linux_Tools_1d8"></a>END { print NR }</p>
+</li>
+<li class="listitem">
+<p id="ch9Using_Linux_Tools_1d9"></a>Print the tenth input line:</p>
+<p id="ch9Using_Linux_Tools_1da"></a>NR == 10</p>
+</li>
+<li class="listitem">
+<p id="ch9Using_Linux_Tools_1db"></a>Print the last field of every input line:</p>
+<p id="ch9Using_Linux_Tools_1dc"></a>{ print $NF }</p>
+</li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_1dd"></a>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.</p>
+<p id="ch9Using_Linux_Tools_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
+<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
+*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
+<p id="ch9Using_Linux_Tools_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
+<p id="ch9Using_Linux_Tools_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
+<pre class="programlisting">$ prog foo 'f??'; echo $?
+
+$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
+<p id="ch9Using_Linux_Tools_1e1"></a>Here is a one line shell script to show directories:</p>
+<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
+</div>
+</div>
+</div></body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/chn10session4.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1139 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Session 4 </title>
+<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
+<link rel="stylesheet" href="/review/support/styles.css" type="text/css">
+<script type="text/javascript" src="/review/support/jquery-min.js"></script>
+<script type="text/javascript" src="/review/support/form.js"></script>
+<script type="text/javascript" src="/review/support/hsbook.js"></script>
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch10session4">
+<div class="titlepage"></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="article"><a href="#id2855701"></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2665826">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2853520">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2906761">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2907033">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2907165">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2907174">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2907452">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2907460">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2907622">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2907682">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2907784">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2907867">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2908045">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2908054">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2908136">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2906583">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2908572">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2908625">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2908633">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2908944">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2909093">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2909263">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2909355">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2909364">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2909450">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2909577">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2909663">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2909795">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2909902">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2909910">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2910114">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2910224">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2910464">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2910734">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2910750">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2910773">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2910782">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2911546">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2911583">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2911652">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2911713">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2911918">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2911952">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2911982">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2911991">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2912180">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2912329">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2912542">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2912618">15. One Liners</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="article">
+<div class="titlepage">
+<div><div><h2 class="title" id="id2855701"></a></h2></div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#id2665826">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2853520">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2906761">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2907033">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2907165">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2907174">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2907452">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2907460">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2907622">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2907682">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2907784">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2907867">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2908045">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2908054">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2908136">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2906583">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2908572">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2908625">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2908633">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2908944">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2909093">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2909263">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2909355">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2909364">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2909450">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2909577">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2909663">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2909795">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2909902">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2909910">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2910114">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2910224">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2910464">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2910734">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2910750">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2910773">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2910782">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2911546">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2911583">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2911652">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2911713">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2911918">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2911952">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2911982">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2911991">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2912180">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2912329">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2912542">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2912618">15. One Liners</a></span></dt>
+</dl>
+</div>
+<div class="section" title="1. Introducing Linux">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2665826"></a>1. Introducing Linux</h2></div></div></div>
+<p id="ch10session4_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
+<p id="ch10session4_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
+<p id="ch10session4_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
+<p id="ch10session4_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
+<div class="section" title="1.1. Historical Background">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2853520"></a>1.1. Historical Background</h3></div></div></div>
+<div class="section" title="1.1.1. Events leading to the creation">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2853486"></a>1.1.1. Events leading to the creation</h4></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
+</ul></div>
+</div>
+<div class="section" title="1.1.2. The Creation of Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2906716"></a>1.1.2. The Creation of Linux</h4></div></div></div>
+<p id="ch10session4_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
+<p id="ch10session4_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
+</div>
+</div>
+<div class="section" title="1.2. Design and Implications">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2906761"></a>1.2. Design and Implications</h3></div></div></div>
+<p id="ch10session4_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
+<div class="section" title="1.2.1. User Interface">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2906785"></a>1.2.1. User Interface</h4></div></div></div>
+<p id="ch10session4_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
+<p id="ch10session4_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
+</div>
+<div class="section" title="1.2.2. Development">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2906839"></a>1.2.2. Development</h4></div></div></div>
+<p id="ch10session4_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
+<p id="ch10session4_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
+<p id="ch10session4_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
+</div>
+<div class="section" title="1.2.3. Community">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2906896"></a>1.2.3. Community</h4></div></div></div>
+<p id="ch10session4_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
+<p id="ch10session4_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
+<p id="ch10session4_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
+</div>
+<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2906940"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
+<p id="ch10session4_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
+</div>
+<div class="section" title="1.2.5. Programming on Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2906986"></a>1.2.5. Programming on Linux</h4></div></div></div>
+<p id="ch10session4_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
+<p id="ch10session4_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
+<p id="ch10session4_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
+</div>
+</div>
+<div class="section" title="1.3. Reasons for Using Linux">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2907033"></a>1.3. Reasons for Using Linux</h3></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch10session4_16"></a>Linux is free:</p></li></ul></div>
+<p id="ch10session4_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
+Most of all, Linux is free as in "free speech":
+The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch10session4_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
+<p id="ch10session4_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch10session4_1a"></a>Linux was made to keep on running:</p></li></ul></div>
+<p id="ch10session4_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch10session4_1c"></a>Linux is secure and versatile:</p></li></ul></div>
+<p id="ch10session4_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch10session4_1e"></a>Linux is scalable:</p></li></ul></div>
+<p id="ch10session4_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch10session4_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
+<p id="ch10session4_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
+</div>
+</div>
+<div class="section" title="2. Getting Started">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2907165"></a>2. Getting Started</h2></div></div></div>
+<div class="section" title="2.1. Logging in, activating the user interface and logging out">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2907174"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
+<p id="ch10session4_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
+<div class="section" title="2.1.1. Graphical Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2907204"></a>2.1.1. Graphical Mode</h4></div></div></div>
+<p id="ch10session4_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
+<p id="ch10session4_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
+It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
+<p id="ch10session4_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
+<p id="ch10session4_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
+<p id="ch10session4_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
+<p id="ch10session4_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
+<p id="ch10session4_29"></a>Another common form for a prompt is this one:
+[</p>
+<div class="reference">
+<div class="titlepage"><hr></div>user@host</div>
+<p> dir]</p>
+<p id="ch10session4_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
+<p id="ch10session4_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
+</div>
+<div class="section" title="2.1.2. Text Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2907362"></a>2.1.2. Text Mode</h4></div></div></div>
+<p id="ch10session4_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
+<p id="ch10session4_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
+reasons.</p>
+<p id="ch10session4_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
+<p id="ch10session4_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
+<p id="ch10session4_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
+</div>
+</div>
+</div>
+<div class="section" title="3. Basic Commands">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2907452"></a>3. Basic Commands</h2></div></div></div>
+<div class="section" title="3.1. ls">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2907460"></a>3.1. ls</h3></div></div></div>
+<p id="ch10session4_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
+<p id="ch10session4_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
+<p id="ch10session4_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch10session4_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
+<pre class="programlisting">$ ls
+jeeves.rst psmith.html blandings.html
+$ ls -l
+drwxr--r--   1 plum  editors   4096  jeeves
+-rw-r--r--   1 plum  editors  30405  psmith
+-r-xr-xr-x   1 plum  plum      8460  blandings</pre>
+<p id="ch10session4_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
+</div>
+<div class="section" title="3.2. date">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2907622"></a>3.2. date</h3></div></div></div>
+<p id="ch10session4_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
+<p id="ch10session4_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
+<pre class="programlisting">$date
+Tue Sep  8 12:01:45 IST 2009</pre>
+<p id="ch10session4_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
+<pre class="programlisting">$date --set="20040908 01:22"</pre>
+<p id="ch10session4_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
+<pre class="programlisting">$man date</pre>
+<p id="ch10session4_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
+</div>
+<div class="section" title="3.3. cd">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2907682"></a>3.3. cd</h3></div></div></div>
+<p id="ch10session4_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
+<p id="ch10session4_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
+<p id="ch10session4_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
+<p id="ch10session4_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
+<p id="ch10session4_46"></a>Absolute paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch10session4_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch10session4_48"></a>For example to get to /boot/grub you would type:</p>
+<pre class="programlisting">$cd /boot/grub</pre>
+<p id="ch10session4_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
+<p id="ch10session4_4a"></a>Relative paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch10session4_4b"></a>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.</p>
+<p id="ch10session4_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
+<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch10session4_4d"></a>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.</p>
+</div>
+<div class="section" title="3.4. who">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2907784"></a>3.4. who</h3></div></div></div>
+<p id="ch10session4_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
+<p id="ch10session4_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
+<pre class="programlisting">$who
+beeblebrox tty7         2009-09-08 10:50 (:0)
+beeblebrox pts/0        2009-09-08 11:25 (:0.0)
+dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
+beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
+<p id="ch10session4_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
+<p id="ch10session4_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
+<pre class="programlisting">$man who</pre>
+<p id="ch10session4_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
+</div>
+<div class="section" title="3.5. mkdir">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2907867"></a>3.5. mkdir</h3></div></div></div>
+<p id="ch10session4_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
+<pre class="programlisting">$mkdir name_of_directory</pre>
+<p id="ch10session4_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
+<div class="section" title="3.5.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2907898"></a>3.5.1. Options</h4></div></div></div>
+<p id="ch10session4_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch10session4_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
+</div>
+<div class="section" title="3.5.2. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2907959"></a>3.5.2. Examples</h4></div></div></div>
+<p id="ch10session4_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
+<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
+<p id="ch10session4_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
+<p id="ch10session4_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
+<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
+<p id="ch10session4_5d"></a>This will create:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_5e"></a>tag</p></li>
+<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch10session4_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
+</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
+</div>
+</div>
+</div>
+<div class="section" title="4. Getting Help">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2908045"></a>4. Getting Help</h2></div></div></div>
+<div class="section" title="4.1. apropos and whatis">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2908054"></a>4.1. apropos and whatis</h3></div></div></div>
+<p id="ch10session4_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
+<pre class="programlisting">$ apropos grep
+egrep       egrep (1)       Search a file for a pattern using full regular expressions
+fgrep       fgrep (1)       Search a file for a fixed-character string
+fmlgrep     fmlgrep (1)     Search a file for a pattern
+grep        grep (1)        Search a file for a pattern
+gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
+nisgrep     nismatch (1)    Utilities for searching NIS+ tables
+pgrep       pgrep (1)       Find or signal a process by name or other attribute
+zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
+...</pre>
+<p id="ch10session4_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
+<p id="ch10session4_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
+<pre class="programlisting">$whatis ls
+ls (1)           - list directory contents</pre>
+<p id="ch10session4_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
+<p id="ch10session4_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
+<pre class="programlisting">$apropos browser
+gmusicbrowser (1)    - Jukebox for large collections of audio files
+infobrowser (1)      - read Info documents
+libsmbclient (7)     - An extension library for browsers and that               can be used...
+opera (1)            - a standards-compliant graphical Web browser
+sensible-browser (1) - sensible editing, paging, and web browsing
+smbtree (1)          - A text based smb network browser
+tvtk_doc (1)         - A GUI based TVTK documentation search browser.
+viewres (1)          - graphical class browser for Xt
+w3m (1)              - a text based Web browser and pager
+www-browser (1)      - a text based Web browser and pager
+...</pre>
+</div>
+<div class="section" title="4.2. man">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2908136"></a>4.2. man</h3></div></div></div>
+<p id="ch10session4_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
+<p id="ch10session4_66"></a>To read a manual page for a Unix command, one can use:</p>
+<pre class="programlisting">$ man &lt;command_name&gt;</pre>
+<p id="ch10session4_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
+<p id="ch10session4_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
+<pre class="programlisting">$man 3 printf</pre>
+<p id="ch10session4_69"></a>Another example:</p>
+<pre class="programlisting">$man man</pre>
+<p id="ch10session4_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
+<div class="section" title="4.2.1. Layout">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2908219"></a>4.2.1. Layout</h4></div></div></div>
+<p id="ch10session4_6b"></a>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:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch10session4_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch10session4_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch10session4_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch10session4_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch10session4_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch10session4_71"></a>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.</p>
+<p id="ch10session4_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
+<p id="ch10session4_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
+<p id="ch10session4_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
+<p id="ch10session4_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
+<p id="ch10session4_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
+</div>
+</div>
+<div class="section" title="4.3. info">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2906583"></a>4.3. info</h3></div></div></div>
+<p id="ch10session4_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
+<p id="ch10session4_78"></a>The syntax is</p>
+<pre class="programlisting">$ info &lt;command_name&gt;</pre>
+<p id="ch10session4_79"></a><span class="emphasis"><em>info</em></span> 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</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch10session4_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
+</div>
+<div class="section" title="4.4. --help">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2908572"></a>4.4. --help</h3></div></div></div>
+<p id="ch10session4_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
+<pre class="programlisting">$ userprompt@host: cat --help
+Usage: cat [OPTION] [FILE]...
+Concatenate FILE(s), or standard input, to standard output.
+
+  -A, --show-all           equivalent to -vET
+  -b, --number-nonblank    number nonempty output lines
+  -e                       equivalent to -vE
+  -E, --show-ends          display $ at end of each line
+  -n, --number             number all output lines
+  -s, --squeeze-blank      suppress repeated empty output lines
+  -t                       equivalent to -vT
+  -T, --show-tabs          display TAB characters as ^I
+  -u                       (ignored)
+  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
+  --help     display this help and exit
+  --version  output version information and exit
+
+With no FILE, or when FILE is -, read standard input.
+
+Examples:
+  cat f - g  Output f's contents, then standard input, then g's           contents.
+  cat        Copy standard input to standard output.
+
+Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
+</div>
+</div>
+<div class="section" title="5. Basic file handling">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2908625"></a>5. Basic file handling</h2></div></div></div>
+<div class="section" title="5.1. cp">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2908633"></a>5.1. cp</h3></div></div></div>
+<p id="ch10session4_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
+<div class="section" title="5.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2908651"></a>5.1.1. Usage</h4></div></div></div>
+<p id="ch10session4_82"></a>To copy a file to another file:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
+<p id="ch10session4_83"></a>To copy a file to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
+<p id="ch10session4_84"></a>To copy a directory to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
+SourceDirectory ... TargetDirectory</pre>
+</div>
+<div class="section" title="5.1.2. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2908685"></a>5.1.2. Flags</h4></div></div></div>
+<p id="ch10session4_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
+<p id="ch10session4_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
+<p id="ch10session4_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
+<p id="ch10session4_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_89"></a>The time of the last data modification and the time of the last access.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch10session4_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
+</div>
+<div class="section" title="5.1.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2908782"></a>5.1.3. Examples</h4></div></div></div>
+<p id="ch10session4_8d"></a>To make a copy of a file in the current directory, enter:</p>
+<pre class="programlisting">$ cp prog.c prog.bak</pre>
+<p id="ch10session4_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
+<p id="ch10session4_8f"></a>To copy a file in your current directory into another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
+<p id="ch10session4_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
+<p id="ch10session4_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
+<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
+<p id="ch10session4_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
+<p id="ch10session4_93"></a>To copy all the files in a directory to a new directory, enter:</p>
+<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
+<p id="ch10session4_94"></a>This copies only the files in the clients directory to the customers directory.</p>
+<p id="ch10session4_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch10session4_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch10session4_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
+<p id="ch10session4_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
+<p id="ch10session4_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
+<p id="ch10session4_9a"></a>To use pattern-matching characters to copy files, enter:</p>
+<pre class="programlisting">$ cp programs/*.py .</pre>
+<p id="ch10session4_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
+</div>
+</div>
+<div class="section" title="5.2. mv">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2908944"></a>5.2. mv</h3></div></div></div>
+<p id="ch10session4_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
+<div class="section" title="5.2.1. Conflicting existing file">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2908968"></a>5.2.1. Conflicting existing file</h4></div></div></div>
+<p id="ch10session4_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
+</div>
+<div class="section" title="5.2.2. Differences with copy and delete">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2908988"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
+<p id="ch10session4_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
+</div>
+<div class="section" title="5.2.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2909034"></a>5.2.3. Examples</h4></div></div></div>
+<pre class="programlisting">$ mv myfile mynewfilename    renames a file
+$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
+$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
+$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
+$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
+$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
+$ mv foo bar baz dir         moves multiple files to directory dir
+$ mv --help                  shows a very concise help about the                syntax of the command
+$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
+<p id="ch10session4_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
+<p id="ch10session4_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
+</div>
+</div>
+<div class="section" title="5.3. rm">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2909093"></a>5.3. rm</h3></div></div></div>
+<p id="ch10session4_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
+<p id="ch10session4_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
+<pre class="programlisting">$ rm -i foo
+remove foo? y</pre>
+<div class="section" title="5.3.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2909122"></a>5.3.1. Options</h4></div></div></div>
+<p id="ch10session4_a3"></a>Common options that rm accepts include:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch10session4_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
+<p id="ch10session4_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
+<p id="ch10session4_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
+<pre class="programlisting">xargs rm &lt; filelist</pre>
+<p id="ch10session4_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
+</div>
+<div class="section" title="5.3.2. Permissions">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2909224"></a>5.3.2. Permissions</h4></div></div></div>
+<p id="ch10session4_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
+<p id="ch10session4_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
+<p id="ch10session4_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
+</div>
+</div>
+</div>
+<div class="section" title="6. Command Line Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2909263"></a>6. Command Line Arguments</h2></div></div></div>
+<p id="ch10session4_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
+<p id="ch10session4_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
+<pre class="programlisting">rm file.s</pre>
+<p id="ch10session4_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
+<p id="ch10session4_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
+<p id="ch10session4_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
+<p id="ch10session4_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
+<p id="ch10session4_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
+</div>
+<div class="section" title="7. Basic Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2909355"></a>7. Basic Text Processing</h2></div></div></div>
+<div class="section" title="7.1. head">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2909364"></a>7.1. head</h3></div></div></div>
+<p id="ch10session4_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
+<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
+<p id="ch10session4_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
+<pre class="programlisting">$ head -n 20 filename</pre>
+<p id="ch10session4_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ head -n 5 foo*</pre>
+<p id="ch10session4_b9"></a>Some versions omit the n and just let you say -5.</p>
+<div class="section" title="7.1.1. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2909415"></a>7.1.1. Flags</h4></div></div></div>
+<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
+<p id="ch10session4_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
+<p id="ch10session4_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
+<pre class="programlisting">sed 5q foo</pre>
+<p id="ch10session4_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
+</div>
+</div>
+<div class="section" title="7.2. tail">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2909450"></a>7.2. tail</h3></div></div></div>
+<p id="ch10session4_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
+<p id="ch10session4_be"></a>The command-syntax is:</p>
+<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
+<p id="ch10session4_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
+<pre class="programlisting">$ tail -n 20 filename</pre>
+<p id="ch10session4_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ tail -c 15 foo*</pre>
+<p id="ch10session4_c1"></a>This example shows all lines of filename from the second line onwards:</p>
+<pre class="programlisting">$ tail -n +2 filename</pre>
+<p id="ch10session4_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
+<pre class="programlisting">$ tail -20 filename
+$ tail -50c filename</pre>
+<p id="ch10session4_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
+<div class="section" title="7.2.1. File monitoring">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2909528"></a>7.2.1. File monitoring</h4></div></div></div>
+<p id="ch10session4_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
+<pre class="programlisting">$ tail -f /var/adm/messages</pre>
+<p id="ch10session4_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
+<p id="ch10session4_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
+</div>
+</div>
+<div class="section" title="7.3. cut">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2909577"></a>7.3. cut</h3></div></div></div>
+<p id="ch10session4_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
+<p id="ch10session4_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
+<p id="ch10session4_c9"></a>Assuming a file named file containing the lines:</p>
+<pre class="programlisting">foo:bar:baz:qux:quux
+one:two:three:four:five:six:seven
+alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+<p id="ch10session4_ca"></a>To output the fourth through tenth characters of each line:</p>
+<pre class="programlisting">$ cut -c 4-10 file</pre>
+<p id="ch10session4_cb"></a>This gives the output:</p>
+<pre class="programlisting">:bar:ba
+:two:th
+ha:beta</pre>
+<p id="ch10session4_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
+<pre class="programlisting">$ cut -d : -f 5- file</pre>
+<p id="ch10session4_cd"></a>This gives the output:</p>
+<pre class="programlisting">quux
+five:six:seven
+epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+</div>
+<div class="section" title="7.4. paste">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2909663"></a>7.4. paste</h3></div></div></div>
+<p id="ch10session4_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
+<p id="ch10session4_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
+<pre class="programlisting">$ paste who where when &gt; www</pre>
+<p id="ch10session4_d0"></a>If the files contain:</p>
+<table summary="paste" border="1"><colgroup>
+<col width="11">
+<col width="12">
+<col width="12">
+</colgroup></table>
+<p id="ch10session4_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
+<pre class="programlisting">Batman            GothamCity       January 3
+Trillian          Andromeda        February 4
+Jeeves            London           March 19</pre>
+</div>
+</div>
+<div class="section" title="8. Shell Meta Characters">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2909795"></a>8. Shell Meta Characters</h2></div></div></div>
+<p id="ch10session4_de"></a>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.</p>
+<p id="ch10session4_df"></a>The shell meta characters include:</p>
+<p id="ch10session4_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
+<p id="ch10session4_e1"></a>Different shells may differ in the meta characters recognized.</p>
+<p id="ch10session4_e2"></a>As an example,</p>
+<pre class="programlisting">$ ls file.*</pre>
+<p id="ch10session4_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
+<pre class="programlisting">$ ls file.?</pre>
+<p id="ch10session4_e4"></a>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:</p>
+<pre class="programlisting">$ more c*</pre>
+<p id="ch10session4_e5"></a>because the c* matches that long file name.</p>
+<p id="ch10session4_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
+<pre class="programlisting">$ rm ??more</pre>
+<p id="ch10session4_e7"></a>or:</p>
+<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
+<p id="ch10session4_e8"></a>or:</p>
+<pre class="programlisting">$ rm ''*|more''</pre>
+</div>
+<div class="section" title="9. Looking At Files">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2909902"></a>9. Looking At Files</h2></div></div></div>
+<div class="section" title="9.1. cat">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2909910"></a>9.1. cat</h3></div></div></div>
+<p id="ch10session4_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
+<p id="ch10session4_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
+<p id="ch10session4_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
+<div class="section" title="9.1.1. Jargon File Definition">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2909954"></a>9.1.1. Jargon File Definition</h4></div></div></div>
+<p id="ch10session4_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
+<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
+     pause (syn. blast).
+
+2. By extension, to dump large amounts of data at an unprepared target or
+     with no intention of browsing it carefully. Usage: considered silly.
+     Rare outside Unix sites. See also dd, BLT.
+
+     Among Unix fans, *cat(1)* is considered an excellent example of
+     user-interface design, because it delivers the file contents without
+     such verbosity as spacing or headers between the files, and because
+     it does not require the files to consist of lines of text, but works
+     with any sort of data.
+
+     Among Unix critics, *cat(1)* is considered the canonical example of
+     bad user-interface design, because of its woefully unobvious name.
+     It is far more often used to blast a single file to standard output
+     than to concatenate two or more files. The name cat for the former
+     operation is just as unintuitive as, say, LISP's cdr.
+
+     Of such oppositions are holy wars made...</pre>
+</div>
+<div class="section" title="9.1.2. Useless Use of 'cat'">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2910010"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
+<p id="ch10session4_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
+<p id="ch10session4_ee"></a>Nevertheless one sees people doing:</p>
+<pre class="programlisting">$ cat file | some_command and its args ...</pre>
+<p id="ch10session4_ef"></a>instead of the equivalent and cheaper:</p>
+<pre class="programlisting">&lt;file some_command and its args ...</pre>
+<p id="ch10session4_f0"></a>or (equivalently and more classically):</p>
+<pre class="programlisting">some_command and its args ... &lt;file</pre>
+<p id="ch10session4_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
+<p id="ch10session4_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
+</div>
+<div class="section" title="9.1.3. zcat">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2910080"></a>9.1.3. zcat</h4></div></div></div>
+<p id="ch10session4_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
+</div>
+</div>
+<div class="section" title="9.2. more">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2910114"></a>9.2. more</h3></div></div></div>
+<p id="ch10session4_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
+<div class="section" title="9.2.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2910133"></a>9.2.1. Usage</h4></div></div></div>
+<p id="ch10session4_f5"></a>The command-syntax is:</p>
+<pre class="programlisting">$ more [options] [file_name]</pre>
+<p id="ch10session4_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
+<p id="ch10session4_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
+<p id="ch10session4_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
+<p id="ch10session4_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
+</div>
+</div>
+<div class="section" title="9.3. less">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2910224"></a>9.3. less</h3></div></div></div>
+<p id="ch10session4_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
+<div class="section" title="9.3.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2910253"></a>9.3.1. Usage</h4></div></div></div>
+<p id="ch10session4_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
+<p id="ch10session4_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
+<p id="ch10session4_fd"></a>The command-syntax is:</p>
+<pre class="programlisting">$ less [options] file_name</pre>
+</div>
+<div class="section" title="9.3.2. Frequently Used Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2910307"></a>9.3.2. Frequently Used Options</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_ff"></a>-I: Case-insensitive searches.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_103"></a>-?: Shows help.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.3. Frequently Used Commands">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2910360"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_105"></a>[Space bar]: Next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_106"></a>b: Previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_10a"></a>'^ or g: Go to start of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_10b"></a>'$ or G: Go to end of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_10d"></a>=: File information.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_10e"></a>h: Help.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_10f"></a>q: Quit.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.4. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2910449"></a>9.3.4. Examples</h4></div></div></div>
+<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
+$ less +F /var/log/mail.log              #Follow mode for log
+$ file * | less                          #Easier file analysis.
+$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
+</div>
+</div>
+</div>
+<div class="section" title="10. Directory Structure">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2910464"></a>10. Directory Structure</h2></div></div></div>
+<p id="ch10session4_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
+<p id="ch10session4_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
+<table summary="Directory Structure" border="1"><colgroup>
+<col width="15">
+<col width="48">
+</colgroup></table>
+<div class="section" title="10.1. man hier">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2910734"></a>10.1. man hier</h3></div></div></div>
+<p id="ch10session4_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
+<pre class="programlisting">$ man hier</pre>
+</div>
+<div class="section" title="10.2. ls -l">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2910750"></a>10.2. ls -l</h3></div></div></div>
+<p id="ch10session4_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
+<pre class="programlisting">$ ls -l</pre>
+<p id="ch10session4_138"></a>This can be done after entering the required directory.</p>
+</div>
+</div>
+<div class="section" title="11. Permissions and Ownership">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2910773"></a>11. Permissions and Ownership</h2></div></div></div>
+<div class="section" title="11.1. chmod">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2910782"></a>11.1. chmod</h3></div></div></div>
+<p id="ch10session4_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
+<div class="section" title="11.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2910807"></a>11.1.1. Usage</h4></div></div></div>
+<p id="ch10session4_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
+<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
+<p id="ch10session4_13b"></a>To view what the permissions currently are, type:</p>
+<pre class="programlisting">$ ls -l file</pre>
+</div>
+<div class="section" title="11.1.2. Command line options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2910835"></a>11.1.2. Command line options</h4></div></div></div>
+<p id="ch10session4_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch10session4_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
+</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2910872"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
+<p id="ch10session4_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
+<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
+<p id="ch10session4_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="8">
+<col width="45">
+</colgroup></table>
+<p id="ch10session4_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="54">
+</colgroup></table>
+<p id="ch10session4_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="5">
+<col width="14">
+<col width="48">
+</colgroup></table>
+<p id="ch10session4_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
+</div>
+<div class="section" title="11.1.2.2. Symbolic examples">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2911418"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
+<p id="ch10session4_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
+<pre class="programlisting">$ chmod ug+rw mydir
+$ ls -ld mydir
+drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
+<p id="ch10session4_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
+<pre class="programlisting">$ chmod a-w myfile
+$ ls -l myfile
+-r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
+<p id="ch10session4_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
+<pre class="programlisting">$ chmod ug=rx mydir
+$ ls -ld mydir
+dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
+</div>
+<div class="section" title="11.1.2.3. Octal numbers">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2911459"></a>11.1.2.3. Octal numbers</h5></div></div></div>
+<p id="ch10session4_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
+<pre class="programlisting">$ chmod 664 myfile
+$ ls -l myfile
+-rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
+<p id="ch10session4_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
+<pre class="programlisting">$ chmod 0664 myfile</pre>
+</div>
+<div class="section" title="11.1.2.4. Special modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2911498"></a>11.1.2.4. Special modes</h5></div></div></div>
+<p id="ch10session4_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
+<p id="ch10session4_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="12. Redirection and Piping">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2911546"></a>12. Redirection and Piping</h2></div></div></div>
+<p id="ch10session4_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
+<p id="ch10session4_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
+<div class="section" title="12.1. Redirecting standard input and standard output">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2911583"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
+<p id="ch10session4_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
+<pre class="programlisting">$ command1 &gt; file1</pre>
+<p id="ch10session4_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
+<pre class="programlisting">$ command1 &lt; file1</pre>
+<p id="ch10session4_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
+<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
+<p id="ch10session4_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
+</div>
+<div class="section" title="12.2. Piping">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2911652"></a>12.2. Piping</h3></div></div></div>
+<p id="ch10session4_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
+A pipeline of three programs run on a text terminal:</p>
+<pre class="programlisting">$ command1 | command2</pre>
+<p id="ch10session4_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
+<p id="ch10session4_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
+<pre class="programlisting">$ command1 &gt; tempfile
+$ command2 &lt; tempfile
+$ rm tempfile</pre>
+<p id="ch10session4_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
+<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
+<p id="ch10session4_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
+</div>
+<div class="section" title="12.3. Redirecting to and from the standard file handles">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2911713"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
+<p id="ch10session4_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
+<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
+<col width="12">
+<col width="13">
+<col width="24">
+</colgroup></table>
+<p id="ch10session4_18d"></a>For example:</p>
+<pre class="programlisting">$ command1 2&gt; file1</pre>
+<p id="ch10session4_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
+<p id="ch10session4_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
+<p id="ch10session4_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
+<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
+<p id="ch10session4_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
+<p id="ch10session4_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
+<p id="ch10session4_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
+<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
+<p id="ch10session4_194"></a>A simplified form of the command:</p>
+<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
+<p id="ch10session4_195"></a>is:</p>
+<pre class="programlisting">$ command &amp;&gt;file</pre>
+<p id="ch10session4_196"></a>or:</p>
+<pre class="programlisting">$command &gt;&amp;file</pre>
+</div>
+<div class="section" title="12.4. Chained pipelines">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2911918"></a>12.4. Chained pipelines</h3></div></div></div>
+<p id="ch10session4_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
+<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
+<p id="ch10session4_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
+</div>
+<div class="section" title="12.5. Redirect to multiple outputs">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2911952"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
+<p id="ch10session4_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
+<pre class="programlisting">$ ls -lrt | tee xyz</pre>
+<p id="ch10session4_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
+</div>
+</div>
+<div class="section" title="13. More Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2911982"></a>13. More Text Processing</h2></div></div></div>
+<div class="section" title="13.1. grep">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2911991"></a>13.1. grep</h3></div></div></div>
+<p id="ch10session4_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
+<div class="section" title="13.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2912022"></a>13.1.1. Usage</h4></div></div></div>
+<p id="ch10session4_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
+<pre class="programlisting">$ grep apple fruitlist.txt</pre>
+<p id="ch10session4_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
+<p id="ch10session4_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
+<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
+<p id="ch10session4_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
+<p id="ch10session4_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
+<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
+<p id="ch10session4_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
+<div class="section" title="13.1.1.1. Variations">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2912100"></a>13.1.1.1. Variations</h5></div></div></div>
+<p id="ch10session4_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
+<p id="ch10session4_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
+<p id="ch10session4_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
+</div>
+</div>
+</div>
+<div class="section" title="13.2. tr">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2912180"></a>13.2. tr</h3></div></div></div>
+<p id="ch10session4_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
+<p id="ch10session4_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
+<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
+<p id="ch10session4_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
+<p id="ch10session4_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
+<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
+<p id="ch10session4_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
+<p id="ch10session4_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
+<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
+<p id="ch10session4_1ab"></a>therefore removes all non-alphanumeric characters.</p>
+<p id="ch10session4_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
+<pre class="programlisting">$ tr -s '\n' '\n'</pre>
+<p id="ch10session4_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
+<p id="ch10session4_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
+<pre class="programlisting">$ tr -d '\r'</pre>
+<p id="ch10session4_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
+<p id="ch10session4_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
+</div>
+</div>
+<div class="section" title="14. Elementary Regex">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2912329"></a>14. Elementary Regex</h2></div></div></div>
+<p id="ch10session4_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
+<p id="ch10session4_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
+<p id="ch10session4_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
+<p id="ch10session4_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
+<table summary="Elementary Regex" border="1"><colgroup>
+<col width="13">
+<col width="60">
+</colgroup></table>
+<div class="section" title="14.1. Lazy quantification">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2912542"></a>14.1. Lazy quantification</h3></div></div></div>
+<p id="ch10session4_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
+<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
+<p id="ch10session4_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
+<p id="ch10session4_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
+</div>
+</div>
+<div class="section" title="15. One Liners">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2912618"></a>15. One Liners</h2></div></div></div>
+<p id="ch10session4_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
+<p id="ch10session4_1cd"></a>The one liner can be</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem"><p id="ch10session4_1ce"></a>An expression written in the language of the shell.</p></li>
+<li class="listitem"><p id="ch10session4_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
+<li class="listitem"><p id="ch10session4_1d0"></a>The invocation of a compiler together with source to compile and
+instructions for executing the compiled program.</p></li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch10session4_1d1"></a>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.</p>
+<p id="ch10session4_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
+<p id="ch10session4_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
+<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
+<p id="ch10session4_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
+<p id="ch10session4_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
+<p id="ch10session4_1d6"></a>Here are the first few of them:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<p id="ch10session4_1d7"></a>Print the total number of input lines:</p>
+<p id="ch10session4_1d8"></a>END { print NR }</p>
+</li>
+<li class="listitem">
+<p id="ch10session4_1d9"></a>Print the tenth input line:</p>
+<p id="ch10session4_1da"></a>NR == 10</p>
+</li>
+<li class="listitem">
+<p id="ch10session4_1db"></a>Print the last field of every input line:</p>
+<p id="ch10session4_1dc"></a>{ print $NF }</p>
+</li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch10session4_1dd"></a>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.</p>
+<p id="ch10session4_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
+<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
+*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
+<p id="ch10session4_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
+<p id="ch10session4_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
+<pre class="programlisting">$ prog foo 'f??'; echo $?
+
+$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
+<p id="ch10session4_1e1"></a>Here is a one line shell script to show directories:</p>
+<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
+</div>
+</div>
+</div></body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/chn11Section_5.html	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1138 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Section 5</title>
+<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
+<script type="text/javascript" src="/review/support/jquery-min.js"></script>
+<script type="text/javascript" src="/review/support/form.js"></script>
+<script type="text/javascript" src="/review/support/hsbook.js"></script>
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch11Section_5">
+<div class="titlepage"></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="article"><a href="#id2451767"></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2261892">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2449586">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2502827">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2503099">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2503232">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2503240">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2503518">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2503526">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2503688">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2503749">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2503851">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2503933">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2504112">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2504120">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2502619">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2504548">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2504638">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2504691">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2504700">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2505011">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2505142">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2505313">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2505405">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2505414">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2505500">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2505634">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2505719">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2505852">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2505959">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2505967">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2506170">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2506281">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2506521">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2506791">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2506807">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2506830">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2506838">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2507603">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2507640">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2507709">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2507770">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2507974">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2508008">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2508039">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2508048">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2508237">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2508386">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2508599">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2508675">15. One Liners</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="article">
+<div class="titlepage">
+<div><div><h2 class="title" id="id2451767"></a></h2></div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#id2261892">1. Introducing Linux</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2449586">1.1. Historical Background</a></span></dt>
+<dt><span class="section"><a href="#id2502827">1.2. Design and Implications</a></span></dt>
+<dt><span class="section"><a href="#id2503099">1.3. Reasons for Using Linux</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2503232">2. Getting Started</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2503240">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2503518">3. Basic Commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2503526">3.1. ls</a></span></dt>
+<dt><span class="section"><a href="#id2503688">3.2. date</a></span></dt>
+<dt><span class="section"><a href="#id2503749">3.3. cd</a></span></dt>
+<dt><span class="section"><a href="#id2503851">3.4. who</a></span></dt>
+<dt><span class="section"><a href="#id2503933">3.5. mkdir</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2504112">4. Getting Help</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2504120">4.1. apropos and whatis</a></span></dt>
+<dt><span class="section"><a href="#id2502619">4.2. man</a></span></dt>
+<dt><span class="section"><a href="#id2504548">4.3. info</a></span></dt>
+<dt><span class="section"><a href="#id2504638">4.4. --help</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2504691">5. Basic file handling</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2504700">5.1. cp</a></span></dt>
+<dt><span class="section"><a href="#id2505011">5.2. mv</a></span></dt>
+<dt><span class="section"><a href="#id2505142">5.3. rm</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2505313">6. Command Line Arguments</a></span></dt>
+<dt><span class="section"><a href="#id2505405">7. Basic Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2505414">7.1. head</a></span></dt>
+<dt><span class="section"><a href="#id2505500">7.2. tail</a></span></dt>
+<dt><span class="section"><a href="#id2505634">7.3. cut</a></span></dt>
+<dt><span class="section"><a href="#id2505719">7.4. paste</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2505852">8. Shell Meta Characters</a></span></dt>
+<dt><span class="section"><a href="#id2505959">9. Looking At Files</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2505967">9.1. cat</a></span></dt>
+<dt><span class="section"><a href="#id2506170">9.2. more</a></span></dt>
+<dt><span class="section"><a href="#id2506281">9.3. less</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2506521">10. Directory Structure</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2506791">10.1. man hier</a></span></dt>
+<dt><span class="section"><a href="#id2506807">10.2. ls -l</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2506830">11. Permissions and Ownership</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2506838">11.1. chmod</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2507603">12. Redirection and Piping</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2507640">12.1. Redirecting standard input and standard output</a></span></dt>
+<dt><span class="section"><a href="#id2507709">12.2. Piping</a></span></dt>
+<dt><span class="section"><a href="#id2507770">12.3. Redirecting to and from the standard file handles</a></span></dt>
+<dt><span class="section"><a href="#id2507974">12.4. Chained pipelines</a></span></dt>
+<dt><span class="section"><a href="#id2508008">12.5. Redirect to multiple outputs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2508039">13. More Text Processing</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#id2508048">13.1. grep</a></span></dt>
+<dt><span class="section"><a href="#id2508237">13.2. tr</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#id2508386">14. Elementary Regex</a></span></dt>
+<dd><dl><dt><span class="section"><a href="#id2508599">14.1. Lazy quantification</a></span></dt></dl></dd>
+<dt><span class="section"><a href="#id2508675">15. One Liners</a></span></dt>
+</dl>
+</div>
+<div class="section" title="1. Introducing Linux">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2261892"></a>1. Introducing Linux</h2></div></div></div>
+<p id="ch11Section_5_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
+<p id="ch11Section_5_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
+<p id="ch11Section_5_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
+<p id="ch11Section_5_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
+<div class="section" title="1.1. Historical Background">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2449586"></a>1.1. Historical Background</h3></div></div></div>
+<div class="section" title="1.1.1. Events leading to the creation">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2449553"></a>1.1.1. Events leading to the creation</h4></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
+</ul></div>
+</div>
+<div class="section" title="1.1.2. The Creation of Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2502782"></a>1.1.2. The Creation of Linux</h4></div></div></div>
+<p id="ch11Section_5_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
+<p id="ch11Section_5_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
+</div>
+</div>
+<div class="section" title="1.2. Design and Implications">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2502827"></a>1.2. Design and Implications</h3></div></div></div>
+<p id="ch11Section_5_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
+<div class="section" title="1.2.1. User Interface">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2502852"></a>1.2.1. User Interface</h4></div></div></div>
+<p id="ch11Section_5_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
+<p id="ch11Section_5_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
+</div>
+<div class="section" title="1.2.2. Development">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2502906"></a>1.2.2. Development</h4></div></div></div>
+<p id="ch11Section_5_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
+<p id="ch11Section_5_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
+<p id="ch11Section_5_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
+</div>
+<div class="section" title="1.2.3. Community">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2502962"></a>1.2.3. Community</h4></div></div></div>
+<p id="ch11Section_5_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
+<p id="ch11Section_5_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
+<p id="ch11Section_5_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
+</div>
+<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2503007"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
+<p id="ch11Section_5_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
+</div>
+<div class="section" title="1.2.5. Programming on Linux">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2503052"></a>1.2.5. Programming on Linux</h4></div></div></div>
+<p id="ch11Section_5_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
+<p id="ch11Section_5_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
+<p id="ch11Section_5_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
+</div>
+</div>
+<div class="section" title="1.3. Reasons for Using Linux">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2503099"></a>1.3. Reasons for Using Linux</h3></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch11Section_5_16"></a>Linux is free:</p></li></ul></div>
+<p id="ch11Section_5_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
+Most of all, Linux is free as in "free speech":
+The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch11Section_5_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
+<p id="ch11Section_5_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch11Section_5_1a"></a>Linux was made to keep on running:</p></li></ul></div>
+<p id="ch11Section_5_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch11Section_5_1c"></a>Linux is secure and versatile:</p></li></ul></div>
+<p id="ch11Section_5_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch11Section_5_1e"></a>Linux is scalable:</p></li></ul></div>
+<p id="ch11Section_5_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch11Section_5_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
+<p id="ch11Section_5_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
+</div>
+</div>
+<div class="section" title="2. Getting Started">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2503232"></a>2. Getting Started</h2></div></div></div>
+<div class="section" title="2.1. Logging in, activating the user interface and logging out">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2503240"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
+<p id="ch11Section_5_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
+<div class="section" title="2.1.1. Graphical Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2503270"></a>2.1.1. Graphical Mode</h4></div></div></div>
+<p id="ch11Section_5_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
+<p id="ch11Section_5_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
+It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
+<p id="ch11Section_5_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
+<p id="ch11Section_5_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
+<p id="ch11Section_5_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
+<p id="ch11Section_5_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
+<p id="ch11Section_5_29"></a>Another common form for a prompt is this one:
+[</p>
+<div class="reference">
+<div class="titlepage"><hr></div>user@host</div>
+<p> dir]</p>
+<p id="ch11Section_5_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
+<p id="ch11Section_5_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
+</div>
+<div class="section" title="2.1.2. Text Mode">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2503428"></a>2.1.2. Text Mode</h4></div></div></div>
+<p id="ch11Section_5_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
+<p id="ch11Section_5_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
+reasons.</p>
+<p id="ch11Section_5_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
+<p id="ch11Section_5_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
+<p id="ch11Section_5_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
+</div>
+</div>
+</div>
+<div class="section" title="3. Basic Commands">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2503518"></a>3. Basic Commands</h2></div></div></div>
+<div class="section" title="3.1. ls">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2503526"></a>3.1. ls</h3></div></div></div>
+<p id="ch11Section_5_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
+<p id="ch11Section_5_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
+<p id="ch11Section_5_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch11Section_5_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
+<pre class="programlisting">$ ls
+jeeves.rst psmith.html blandings.html
+$ ls -l
+drwxr--r--   1 plum  editors   4096  jeeves
+-rw-r--r--   1 plum  editors  30405  psmith
+-r-xr-xr-x   1 plum  plum      8460  blandings</pre>
+<p id="ch11Section_5_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
+</div>
+<div class="section" title="3.2. date">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2503688"></a>3.2. date</h3></div></div></div>
+<p id="ch11Section_5_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
+<p id="ch11Section_5_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
+<pre class="programlisting">$date
+Tue Sep  8 12:01:45 IST 2009</pre>
+<p id="ch11Section_5_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
+<pre class="programlisting">$date --set="20040908 01:22"</pre>
+<p id="ch11Section_5_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
+<pre class="programlisting">$man date</pre>
+<p id="ch11Section_5_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
+</div>
+<div class="section" title="3.3. cd">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2503749"></a>3.3. cd</h3></div></div></div>
+<p id="ch11Section_5_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
+<p id="ch11Section_5_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
+<p id="ch11Section_5_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
+<p id="ch11Section_5_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
+<p id="ch11Section_5_46"></a>Absolute paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch11Section_5_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch11Section_5_48"></a>For example to get to /boot/grub you would type:</p>
+<pre class="programlisting">$cd /boot/grub</pre>
+<p id="ch11Section_5_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
+<p id="ch11Section_5_4a"></a>Relative paths:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch11Section_5_4b"></a>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.</p>
+<p id="ch11Section_5_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
+<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch11Section_5_4d"></a>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.</p>
+</div>
+<div class="section" title="3.4. who">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2503851"></a>3.4. who</h3></div></div></div>
+<p id="ch11Section_5_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
+<p id="ch11Section_5_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
+<pre class="programlisting">$who
+beeblebrox tty7         2009-09-08 10:50 (:0)
+beeblebrox pts/0        2009-09-08 11:25 (:0.0)
+dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
+beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
+<p id="ch11Section_5_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
+<p id="ch11Section_5_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
+<pre class="programlisting">$man who</pre>
+<p id="ch11Section_5_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
+</div>
+<div class="section" title="3.5. mkdir">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2503933"></a>3.5. mkdir</h3></div></div></div>
+<p id="ch11Section_5_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
+<pre class="programlisting">$mkdir name_of_directory</pre>
+<p id="ch11Section_5_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
+<div class="section" title="3.5.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2503964"></a>3.5.1. Options</h4></div></div></div>
+<p id="ch11Section_5_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch11Section_5_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
+</div>
+<div class="section" title="3.5.2. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2504026"></a>3.5.2. Examples</h4></div></div></div>
+<p id="ch11Section_5_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
+<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
+<p id="ch11Section_5_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
+<p id="ch11Section_5_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
+<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
+<p id="ch11Section_5_5d"></a>This will create:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_5e"></a>tag</p></li>
+<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch11Section_5_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
+</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
+</div>
+</div>
+</div>
+<div class="section" title="4. Getting Help">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2504112"></a>4. Getting Help</h2></div></div></div>
+<div class="section" title="4.1. apropos and whatis">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2504120"></a>4.1. apropos and whatis</h3></div></div></div>
+<p id="ch11Section_5_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
+<pre class="programlisting">$ apropos grep
+egrep       egrep (1)       Search a file for a pattern using full regular expressions
+fgrep       fgrep (1)       Search a file for a fixed-character string
+fmlgrep     fmlgrep (1)     Search a file for a pattern
+grep        grep (1)        Search a file for a pattern
+gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
+nisgrep     nismatch (1)    Utilities for searching NIS+ tables
+pgrep       pgrep (1)       Find or signal a process by name or other attribute
+zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
+...</pre>
+<p id="ch11Section_5_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
+<p id="ch11Section_5_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
+<pre class="programlisting">$whatis ls
+ls (1)           - list directory contents</pre>
+<p id="ch11Section_5_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
+<p id="ch11Section_5_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
+<pre class="programlisting">$apropos browser
+gmusicbrowser (1)    - Jukebox for large collections of audio files
+infobrowser (1)      - read Info documents
+libsmbclient (7)     - An extension library for browsers and that               can be used...
+opera (1)            - a standards-compliant graphical Web browser
+sensible-browser (1) - sensible editing, paging, and web browsing
+smbtree (1)          - A text based smb network browser
+tvtk_doc (1)         - A GUI based TVTK documentation search browser.
+viewres (1)          - graphical class browser for Xt
+w3m (1)              - a text based Web browser and pager
+www-browser (1)      - a text based Web browser and pager
+...</pre>
+</div>
+<div class="section" title="4.2. man">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2502619"></a>4.2. man</h3></div></div></div>
+<p id="ch11Section_5_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
+<p id="ch11Section_5_66"></a>To read a manual page for a Unix command, one can use:</p>
+<pre class="programlisting">$ man &lt;command_name&gt;</pre>
+<p id="ch11Section_5_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
+<p id="ch11Section_5_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
+<pre class="programlisting">$man 3 printf</pre>
+<p id="ch11Section_5_69"></a>Another example:</p>
+<pre class="programlisting">$man man</pre>
+<p id="ch11Section_5_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
+<div class="section" title="4.2.1. Layout">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2504422"></a>4.2.1. Layout</h4></div></div></div>
+<p id="ch11Section_5_6b"></a>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:</p>
+<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch11Section_5_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch11Section_5_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch11Section_5_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch11Section_5_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch11Section_5_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch11Section_5_71"></a>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.</p>
+<p id="ch11Section_5_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
+<p id="ch11Section_5_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
+<p id="ch11Section_5_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
+<p id="ch11Section_5_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
+<p id="ch11Section_5_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
+</div>
+</div>
+<div class="section" title="4.3. info">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2504548"></a>4.3. info</h3></div></div></div>
+<p id="ch11Section_5_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
+<p id="ch11Section_5_78"></a>The syntax is</p>
+<pre class="programlisting">$ info &lt;command_name&gt;</pre>
+<p id="ch11Section_5_79"></a><span class="emphasis"><em>info</em></span> 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</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch11Section_5_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
+</div>
+<div class="section" title="4.4. --help">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2504638"></a>4.4. --help</h3></div></div></div>
+<p id="ch11Section_5_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
+<pre class="programlisting">$ userprompt@host: cat --help
+Usage: cat [OPTION] [FILE]...
+Concatenate FILE(s), or standard input, to standard output.
+
+  -A, --show-all           equivalent to -vET
+  -b, --number-nonblank    number nonempty output lines
+  -e                       equivalent to -vE
+  -E, --show-ends          display $ at end of each line
+  -n, --number             number all output lines
+  -s, --squeeze-blank      suppress repeated empty output lines
+  -t                       equivalent to -vT
+  -T, --show-tabs          display TAB characters as ^I
+  -u                       (ignored)
+  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
+  --help     display this help and exit
+  --version  output version information and exit
+
+With no FILE, or when FILE is -, read standard input.
+
+Examples:
+  cat f - g  Output f's contents, then standard input, then g's           contents.
+  cat        Copy standard input to standard output.
+
+Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
+</div>
+</div>
+<div class="section" title="5. Basic file handling">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2504691"></a>5. Basic file handling</h2></div></div></div>
+<div class="section" title="5.1. cp">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2504700"></a>5.1. cp</h3></div></div></div>
+<p id="ch11Section_5_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
+<div class="section" title="5.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2504717"></a>5.1.1. Usage</h4></div></div></div>
+<p id="ch11Section_5_82"></a>To copy a file to another file:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
+<p id="ch11Section_5_83"></a>To copy a file to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
+<p id="ch11Section_5_84"></a>To copy a directory to a directory:</p>
+<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
+SourceDirectory ... TargetDirectory</pre>
+</div>
+<div class="section" title="5.1.2. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2504751"></a>5.1.2. Flags</h4></div></div></div>
+<p id="ch11Section_5_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
+<p id="ch11Section_5_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
+<p id="ch11Section_5_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
+<p id="ch11Section_5_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_89"></a>The time of the last data modification and the time of the last access.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch11Section_5_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
+</div>
+<div class="section" title="5.1.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2504849"></a>5.1.3. Examples</h4></div></div></div>
+<p id="ch11Section_5_8d"></a>To make a copy of a file in the current directory, enter:</p>
+<pre class="programlisting">$ cp prog.c prog.bak</pre>
+<p id="ch11Section_5_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
+<p id="ch11Section_5_8f"></a>To copy a file in your current directory into another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
+<p id="ch11Section_5_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
+<p id="ch11Section_5_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
+<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
+<p id="ch11Section_5_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
+<p id="ch11Section_5_93"></a>To copy all the files in a directory to a new directory, enter:</p>
+<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
+<p id="ch11Section_5_94"></a>This copies only the files in the clients directory to the customers directory.</p>
+<p id="ch11Section_5_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
+<span style="color: red">&lt;block_quote&gt;<p id="ch11Section_5_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch11Section_5_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
+<p id="ch11Section_5_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
+<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
+<p id="ch11Section_5_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
+<p id="ch11Section_5_9a"></a>To use pattern-matching characters to copy files, enter:</p>
+<pre class="programlisting">$ cp programs/*.py .</pre>
+<p id="ch11Section_5_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
+</div>
+</div>
+<div class="section" title="5.2. mv">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2505011"></a>5.2. mv</h3></div></div></div>
+<p id="ch11Section_5_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
+<div class="section" title="5.2.1. Conflicting existing file">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2505034"></a>5.2.1. Conflicting existing file</h4></div></div></div>
+<p id="ch11Section_5_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
+</div>
+<div class="section" title="5.2.2. Differences with copy and delete">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2505054"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
+<p id="ch11Section_5_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
+</div>
+<div class="section" title="5.2.3. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2505084"></a>5.2.3. Examples</h4></div></div></div>
+<pre class="programlisting">$ mv myfile mynewfilename    renames a file
+$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
+$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
+$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
+$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
+$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
+$ mv foo bar baz dir         moves multiple files to directory dir
+$ mv --help                  shows a very concise help about the                syntax of the command
+$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
+<p id="ch11Section_5_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
+<p id="ch11Section_5_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
+</div>
+</div>
+<div class="section" title="5.3. rm">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2505142"></a>5.3. rm</h3></div></div></div>
+<p id="ch11Section_5_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
+<p id="ch11Section_5_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
+<pre class="programlisting">$ rm -i foo
+remove foo? y</pre>
+<div class="section" title="5.3.1. Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2505172"></a>5.3.1. Options</h4></div></div></div>
+<p id="ch11Section_5_a3"></a>Common options that rm accepts include:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
+</ul></div>&lt;/block_quote&gt;</span><p id="ch11Section_5_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
+<p id="ch11Section_5_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
+<p id="ch11Section_5_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
+<pre class="programlisting">xargs rm &lt; filelist</pre>
+<p id="ch11Section_5_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
+</div>
+<div class="section" title="5.3.2. Permissions">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2505274"></a>5.3.2. Permissions</h4></div></div></div>
+<p id="ch11Section_5_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
+<p id="ch11Section_5_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
+<p id="ch11Section_5_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
+</div>
+</div>
+</div>
+<div class="section" title="6. Command Line Arguments">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2505313"></a>6. Command Line Arguments</h2></div></div></div>
+<p id="ch11Section_5_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
+<p id="ch11Section_5_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
+<pre class="programlisting">rm file.s</pre>
+<p id="ch11Section_5_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
+<p id="ch11Section_5_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
+<p id="ch11Section_5_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
+<p id="ch11Section_5_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
+<p id="ch11Section_5_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
+</div>
+<div class="section" title="7. Basic Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2505405"></a>7. Basic Text Processing</h2></div></div></div>
+<div class="section" title="7.1. head">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2505414"></a>7.1. head</h3></div></div></div>
+<p id="ch11Section_5_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
+<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
+<p id="ch11Section_5_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
+<pre class="programlisting">$ head -n 20 filename</pre>
+<p id="ch11Section_5_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ head -n 5 foo*</pre>
+<p id="ch11Section_5_b9"></a>Some versions omit the n and just let you say -5.</p>
+<div class="section" title="7.1.1. Flags">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2505465"></a>7.1.1. Flags</h4></div></div></div>
+<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
+<p id="ch11Section_5_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
+<p id="ch11Section_5_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
+<pre class="programlisting">sed 5q foo</pre>
+<p id="ch11Section_5_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
+</div>
+</div>
+<div class="section" title="7.2. tail">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2505500"></a>7.2. tail</h3></div></div></div>
+<p id="ch11Section_5_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
+<p id="ch11Section_5_be"></a>The command-syntax is:</p>
+<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
+<p id="ch11Section_5_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
+<pre class="programlisting">$ tail -n 20 filename</pre>
+<p id="ch11Section_5_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
+<pre class="programlisting">$ tail -c 15 foo*</pre>
+<p id="ch11Section_5_c1"></a>This example shows all lines of filename from the second line onwards:</p>
+<pre class="programlisting">$ tail -n +2 filename</pre>
+<p id="ch11Section_5_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
+<pre class="programlisting">$ tail -20 filename
+$ tail -50c filename</pre>
+<p id="ch11Section_5_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
+<div class="section" title="7.2.1. File monitoring">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2505578"></a>7.2.1. File monitoring</h4></div></div></div>
+<p id="ch11Section_5_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
+<pre class="programlisting">$ tail -f /var/adm/messages</pre>
+<p id="ch11Section_5_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
+<p id="ch11Section_5_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
+</div>
+</div>
+<div class="section" title="7.3. cut">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2505634"></a>7.3. cut</h3></div></div></div>
+<p id="ch11Section_5_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
+<p id="ch11Section_5_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
+<p id="ch11Section_5_c9"></a>Assuming a file named file containing the lines:</p>
+<pre class="programlisting">foo:bar:baz:qux:quux
+one:two:three:four:five:six:seven
+alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+<p id="ch11Section_5_ca"></a>To output the fourth through tenth characters of each line:</p>
+<pre class="programlisting">$ cut -c 4-10 file</pre>
+<p id="ch11Section_5_cb"></a>This gives the output:</p>
+<pre class="programlisting">:bar:ba
+:two:th
+ha:beta</pre>
+<p id="ch11Section_5_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
+<pre class="programlisting">$ cut -d : -f 5- file</pre>
+<p id="ch11Section_5_cd"></a>This gives the output:</p>
+<pre class="programlisting">quux
+five:six:seven
+epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
+</div>
+<div class="section" title="7.4. paste">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2505719"></a>7.4. paste</h3></div></div></div>
+<p id="ch11Section_5_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
+<p id="ch11Section_5_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
+<pre class="programlisting">$ paste who where when &gt; www</pre>
+<p id="ch11Section_5_d0"></a>If the files contain:</p>
+<table summary="paste" border="1"><colgroup>
+<col width="11">
+<col width="12">
+<col width="12">
+</colgroup></table>
+<p id="ch11Section_5_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
+<pre class="programlisting">Batman            GothamCity       January 3
+Trillian          Andromeda        February 4
+Jeeves            London           March 19</pre>
+</div>
+</div>
+<div class="section" title="8. Shell Meta Characters">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2505852"></a>8. Shell Meta Characters</h2></div></div></div>
+<p id="ch11Section_5_de"></a>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.</p>
+<p id="ch11Section_5_df"></a>The shell meta characters include:</p>
+<p id="ch11Section_5_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
+<p id="ch11Section_5_e1"></a>Different shells may differ in the meta characters recognized.</p>
+<p id="ch11Section_5_e2"></a>As an example,</p>
+<pre class="programlisting">$ ls file.*</pre>
+<p id="ch11Section_5_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
+<pre class="programlisting">$ ls file.?</pre>
+<p id="ch11Section_5_e4"></a>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:</p>
+<pre class="programlisting">$ more c*</pre>
+<p id="ch11Section_5_e5"></a>because the c* matches that long file name.</p>
+<p id="ch11Section_5_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
+<pre class="programlisting">$ rm ??more</pre>
+<p id="ch11Section_5_e7"></a>or:</p>
+<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
+<p id="ch11Section_5_e8"></a>or:</p>
+<pre class="programlisting">$ rm ''*|more''</pre>
+</div>
+<div class="section" title="9. Looking At Files">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2505959"></a>9. Looking At Files</h2></div></div></div>
+<div class="section" title="9.1. cat">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2505967"></a>9.1. cat</h3></div></div></div>
+<p id="ch11Section_5_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
+<p id="ch11Section_5_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
+<p id="ch11Section_5_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
+<div class="section" title="9.1.1. Jargon File Definition">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2506010"></a>9.1.1. Jargon File Definition</h4></div></div></div>
+<p id="ch11Section_5_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
+<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
+     pause (syn. blast).
+
+2. By extension, to dump large amounts of data at an unprepared target or
+     with no intention of browsing it carefully. Usage: considered silly.
+     Rare outside Unix sites. See also dd, BLT.
+
+     Among Unix fans, *cat(1)* is considered an excellent example of
+     user-interface design, because it delivers the file contents without
+     such verbosity as spacing or headers between the files, and because
+     it does not require the files to consist of lines of text, but works
+     with any sort of data.
+
+     Among Unix critics, *cat(1)* is considered the canonical example of
+     bad user-interface design, because of its woefully unobvious name.
+     It is far more often used to blast a single file to standard output
+     than to concatenate two or more files. The name cat for the former
+     operation is just as unintuitive as, say, LISP's cdr.
+
+     Of such oppositions are holy wars made...</pre>
+</div>
+<div class="section" title="9.1.2. Useless Use of 'cat'">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2506066"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
+<p id="ch11Section_5_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
+<p id="ch11Section_5_ee"></a>Nevertheless one sees people doing:</p>
+<pre class="programlisting">$ cat file | some_command and its args ...</pre>
+<p id="ch11Section_5_ef"></a>instead of the equivalent and cheaper:</p>
+<pre class="programlisting">&lt;file some_command and its args ...</pre>
+<p id="ch11Section_5_f0"></a>or (equivalently and more classically):</p>
+<pre class="programlisting">some_command and its args ... &lt;file</pre>
+<p id="ch11Section_5_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
+<p id="ch11Section_5_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
+</div>
+<div class="section" title="9.1.3. zcat">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2506137"></a>9.1.3. zcat</h4></div></div></div>
+<p id="ch11Section_5_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
+</div>
+</div>
+<div class="section" title="9.2. more">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2506170"></a>9.2. more</h3></div></div></div>
+<p id="ch11Section_5_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
+<div class="section" title="9.2.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2506190"></a>9.2.1. Usage</h4></div></div></div>
+<p id="ch11Section_5_f5"></a>The command-syntax is:</p>
+<pre class="programlisting">$ more [options] [file_name]</pre>
+<p id="ch11Section_5_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
+<p id="ch11Section_5_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
+<p id="ch11Section_5_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
+<p id="ch11Section_5_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
+</div>
+</div>
+<div class="section" title="9.3. less">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2506281"></a>9.3. less</h3></div></div></div>
+<p id="ch11Section_5_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
+<div class="section" title="9.3.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2506310"></a>9.3.1. Usage</h4></div></div></div>
+<p id="ch11Section_5_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
+<p id="ch11Section_5_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
+<p id="ch11Section_5_fd"></a>The command-syntax is:</p>
+<pre class="programlisting">$ less [options] file_name</pre>
+</div>
+<div class="section" title="9.3.2. Frequently Used Options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2506364"></a>9.3.2. Frequently Used Options</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_ff"></a>-I: Case-insensitive searches.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_103"></a>-?: Shows help.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.3. Frequently Used Commands">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2506416"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_105"></a>[Space bar]: Next page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_106"></a>b: Previous page.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_10a"></a>'^ or g: Go to start of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_10b"></a>'$ or G: Go to end of file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_10d"></a>=: File information.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_10e"></a>h: Help.</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_10f"></a>q: Quit.</p></li>
+</ul></div>&lt;/block_quote&gt;</span>
+</div>
+<div class="section" title="9.3.4. Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2506506"></a>9.3.4. Examples</h4></div></div></div>
+<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
+$ less +F /var/log/mail.log              #Follow mode for log
+$ file * | less                          #Easier file analysis.
+$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
+</div>
+</div>
+</div>
+<div class="section" title="10. Directory Structure">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2506521"></a>10. Directory Structure</h2></div></div></div>
+<p id="ch11Section_5_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
+<p id="ch11Section_5_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
+<table summary="Directory Structure" border="1"><colgroup>
+<col width="15">
+<col width="48">
+</colgroup></table>
+<div class="section" title="10.1. man hier">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2506791"></a>10.1. man hier</h3></div></div></div>
+<p id="ch11Section_5_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
+<pre class="programlisting">$ man hier</pre>
+</div>
+<div class="section" title="10.2. ls -l">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2506807"></a>10.2. ls -l</h3></div></div></div>
+<p id="ch11Section_5_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
+<pre class="programlisting">$ ls -l</pre>
+<p id="ch11Section_5_138"></a>This can be done after entering the required directory.</p>
+</div>
+</div>
+<div class="section" title="11. Permissions and Ownership">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2506830"></a>11. Permissions and Ownership</h2></div></div></div>
+<div class="section" title="11.1. chmod">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2506838"></a>11.1. chmod</h3></div></div></div>
+<p id="ch11Section_5_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
+<div class="section" title="11.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2506864"></a>11.1.1. Usage</h4></div></div></div>
+<p id="ch11Section_5_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
+<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
+<p id="ch11Section_5_13b"></a>To view what the permissions currently are, type:</p>
+<pre class="programlisting">$ ls -l file</pre>
+</div>
+<div class="section" title="11.1.2. Command line options">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2506892"></a>11.1.2. Command line options</h4></div></div></div>
+<p id="ch11Section_5_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
+<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
+</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2506929"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
+<p id="ch11Section_5_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
+<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
+<p id="ch11Section_5_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="8">
+<col width="45">
+</colgroup></table>
+<p id="ch11Section_5_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="14">
+<col width="54">
+</colgroup></table>
+<p id="ch11Section_5_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
+<table summary="Symbolic modes" border="1"><colgroup>
+<col width="5">
+<col width="14">
+<col width="48">
+</colgroup></table>
+<p id="ch11Section_5_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
+</div>
+<div class="section" title="11.1.2.2. Symbolic examples">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2507475"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
+<p id="ch11Section_5_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
+<pre class="programlisting">$ chmod ug+rw mydir
+$ ls -ld mydir
+drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
+<p id="ch11Section_5_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
+<pre class="programlisting">$ chmod a-w myfile
+$ ls -l myfile
+-r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
+<p id="ch11Section_5_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
+<pre class="programlisting">$ chmod ug=rx mydir
+$ ls -ld mydir
+dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
+</div>
+<div class="section" title="11.1.2.3. Octal numbers">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2507516"></a>11.1.2.3. Octal numbers</h5></div></div></div>
+<p id="ch11Section_5_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
+<pre class="programlisting">$ chmod 664 myfile
+$ ls -l myfile
+-rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
+<p id="ch11Section_5_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
+<pre class="programlisting">$ chmod 0664 myfile</pre>
+</div>
+<div class="section" title="11.1.2.4. Special modes">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2507555"></a>11.1.2.4. Special modes</h5></div></div></div>
+<p id="ch11Section_5_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
+<p id="ch11Section_5_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="section" title="12. Redirection and Piping">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2507603"></a>12. Redirection and Piping</h2></div></div></div>
+<p id="ch11Section_5_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
+<p id="ch11Section_5_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
+<div class="section" title="12.1. Redirecting standard input and standard output">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2507640"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
+<p id="ch11Section_5_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
+<pre class="programlisting">$ command1 &gt; file1</pre>
+<p id="ch11Section_5_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
+<pre class="programlisting">$ command1 &lt; file1</pre>
+<p id="ch11Section_5_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
+<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
+<p id="ch11Section_5_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
+</div>
+<div class="section" title="12.2. Piping">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2507709"></a>12.2. Piping</h3></div></div></div>
+<p id="ch11Section_5_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
+A pipeline of three programs run on a text terminal:</p>
+<pre class="programlisting">$ command1 | command2</pre>
+<p id="ch11Section_5_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
+<p id="ch11Section_5_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
+<pre class="programlisting">$ command1 &gt; tempfile
+$ command2 &lt; tempfile
+$ rm tempfile</pre>
+<p id="ch11Section_5_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
+<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
+<p id="ch11Section_5_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
+</div>
+<div class="section" title="12.3. Redirecting to and from the standard file handles">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2507770"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
+<p id="ch11Section_5_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
+<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
+<col width="12">
+<col width="13">
+<col width="24">
+</colgroup></table>
+<p id="ch11Section_5_18d"></a>For example:</p>
+<pre class="programlisting">$ command1 2&gt; file1</pre>
+<p id="ch11Section_5_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
+<p id="ch11Section_5_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
+<p id="ch11Section_5_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
+<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
+<p id="ch11Section_5_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
+<p id="ch11Section_5_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
+<p id="ch11Section_5_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
+<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
+<p id="ch11Section_5_194"></a>A simplified form of the command:</p>
+<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
+<p id="ch11Section_5_195"></a>is:</p>
+<pre class="programlisting">$ command &amp;&gt;file</pre>
+<p id="ch11Section_5_196"></a>or:</p>
+<pre class="programlisting">$command &gt;&amp;file</pre>
+</div>
+<div class="section" title="12.4. Chained pipelines">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2507974"></a>12.4. Chained pipelines</h3></div></div></div>
+<p id="ch11Section_5_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
+<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
+<p id="ch11Section_5_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
+</div>
+<div class="section" title="12.5. Redirect to multiple outputs">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2508008"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
+<p id="ch11Section_5_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
+<pre class="programlisting">$ ls -lrt | tee xyz</pre>
+<p id="ch11Section_5_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
+</div>
+</div>
+<div class="section" title="13. More Text Processing">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2508039"></a>13. More Text Processing</h2></div></div></div>
+<div class="section" title="13.1. grep">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2508048"></a>13.1. grep</h3></div></div></div>
+<p id="ch11Section_5_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
+<div class="section" title="13.1.1. Usage">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id2508079"></a>13.1.1. Usage</h4></div></div></div>
+<p id="ch11Section_5_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
+<pre class="programlisting">$ grep apple fruitlist.txt</pre>
+<p id="ch11Section_5_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
+<p id="ch11Section_5_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
+<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
+<p id="ch11Section_5_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
+<p id="ch11Section_5_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
+<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
+<p id="ch11Section_5_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
+<div class="section" title="13.1.1.1. Variations">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="id2508157"></a>13.1.1.1. Variations</h5></div></div></div>
+<p id="ch11Section_5_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
+<p id="ch11Section_5_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
+<p id="ch11Section_5_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
+</div>
+</div>
+</div>
+<div class="section" title="13.2. tr">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2508237"></a>13.2. tr</h3></div></div></div>
+<p id="ch11Section_5_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
+<p id="ch11Section_5_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
+<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
+<p id="ch11Section_5_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
+<p id="ch11Section_5_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
+<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
+<p id="ch11Section_5_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
+<p id="ch11Section_5_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
+<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
+<p id="ch11Section_5_1ab"></a>therefore removes all non-alphanumeric characters.</p>
+<p id="ch11Section_5_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
+<pre class="programlisting">$ tr -s '\n' '\n'</pre>
+<p id="ch11Section_5_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
+<p id="ch11Section_5_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
+<pre class="programlisting">$ tr -d '\r'</pre>
+<p id="ch11Section_5_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
+<p id="ch11Section_5_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
+</div>
+</div>
+<div class="section" title="14. Elementary Regex">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2508386"></a>14. Elementary Regex</h2></div></div></div>
+<p id="ch11Section_5_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
+<p id="ch11Section_5_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
+<p id="ch11Section_5_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
+<p id="ch11Section_5_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
+<table summary="Elementary Regex" border="1"><colgroup>
+<col width="13">
+<col width="60">
+</colgroup></table>
+<div class="section" title="14.1. Lazy quantification">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id2508599"></a>14.1. Lazy quantification</h3></div></div></div>
+<p id="ch11Section_5_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
+<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
+<p id="ch11Section_5_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
+<p id="ch11Section_5_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
+</div>
+</div>
+<div class="section" title="15. One Liners">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="id2508675"></a>15. One Liners</h2></div></div></div>
+<p id="ch11Section_5_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
+<p id="ch11Section_5_1cd"></a>The one liner can be</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem"><p id="ch11Section_5_1ce"></a>An expression written in the language of the shell.</p></li>
+<li class="listitem"><p id="ch11Section_5_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
+<li class="listitem"><p id="ch11Section_5_1d0"></a>The invocation of a compiler together with source to compile and
+instructions for executing the compiled program.</p></li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch11Section_5_1d1"></a>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.</p>
+<p id="ch11Section_5_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
+<p id="ch11Section_5_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
+<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
+<p id="ch11Section_5_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
+<p id="ch11Section_5_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
+<p id="ch11Section_5_1d6"></a>Here are the first few of them:</p>
+<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+<p id="ch11Section_5_1d7"></a>Print the total number of input lines:</p>
+<p id="ch11Section_5_1d8"></a>END { print NR }</p>
+</li>
+<li class="listitem">
+<p id="ch11Section_5_1d9"></a>Print the tenth input line:</p>
+<p id="ch11Section_5_1da"></a>NR == 10</p>
+</li>
+<li class="listitem">
+<p id="ch11Section_5_1db"></a>Print the last field of every input line:</p>
+<p id="ch11Section_5_1dc"></a>{ print $NF }</p>
+</li>
+</ol></div>&lt;/block_quote&gt;</span><p id="ch11Section_5_1dd"></a>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.</p>
+<p id="ch11Section_5_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
+<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
+*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
+<p id="ch11Section_5_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
+<p id="ch11Section_5_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
+<pre class="programlisting">$ prog foo 'f??'; echo $?
+
+$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
+<p id="ch11Section_5_1e1"></a>Here is a one line shell script to show directories:</p>
+<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
+</div>
+</div>
+</div></body>
+</html>
Binary file SEESenv/web/html/support/figs/bad-merge-1.png has changed
Binary file SEESenv/web/html/support/figs/bad-merge-2.png has changed
Binary file SEESenv/web/html/support/figs/bad-merge-3.png has changed
Binary file SEESenv/web/html/support/figs/bad-merge-4.png has changed
Binary file SEESenv/web/html/support/figs/bad-merge-5.png has changed
Binary file SEESenv/web/html/support/figs/caution.png has changed
Binary file SEESenv/web/html/support/figs/feature-branches.png has changed
Binary file SEESenv/web/html/support/figs/filelog.png has changed
Binary file SEESenv/web/html/support/figs/kdiff3.png has changed
Binary file SEESenv/web/html/support/figs/metadata.png has changed
Binary file SEESenv/web/html/support/figs/mq-stack.png has changed
Binary file SEESenv/web/html/support/figs/note.png has changed
Binary file SEESenv/web/html/support/figs/revlog.png has changed
Binary file SEESenv/web/html/support/figs/rss.png has changed
Binary file SEESenv/web/html/support/figs/snapshot.png has changed
Binary file SEESenv/web/html/support/figs/tip.png has changed
Binary file SEESenv/web/html/support/figs/tour-history.png has changed
Binary file SEESenv/web/html/support/figs/tour-merge-conflict.png has changed
Binary file SEESenv/web/html/support/figs/tour-merge-merge.png has changed
Binary file SEESenv/web/html/support/figs/tour-merge-pull.png has changed
Binary file SEESenv/web/html/support/figs/tour-merge-sep-repos.png has changed
Binary file SEESenv/web/html/support/figs/undo-manual-merge.png has changed
Binary file SEESenv/web/html/support/figs/undo-manual.png has changed
Binary file SEESenv/web/html/support/figs/undo-non-tip.png has changed
Binary file SEESenv/web/html/support/figs/undo-simple.png has changed
Binary file SEESenv/web/html/support/figs/wdir-after-commit.png has changed
Binary file SEESenv/web/html/support/figs/wdir-branch.png has changed
Binary file SEESenv/web/html/support/figs/wdir-merge.png has changed
Binary file SEESenv/web/html/support/figs/wdir-pre-branch.png has changed
Binary file SEESenv/web/html/support/figs/wdir.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/support/form-min.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1 @@
+(function($){$.fn.ajaxSubmit=function(_2){if(typeof _2=="function"){_2={success:_2};}_2=$.extend({url:this.attr("action")||window.location,type:this.attr("method")||"GET"},_2||{});var _3={};$.event.trigger("form.pre.serialize",[this,_2,_3]);if(_3.veto){return this;}var a=this.formToArray(_2.semantic);if(_2.data){for(var n in _2.data){a.push({name:n,value:_2.data[n]});}}if(_2.beforeSubmit&&_2.beforeSubmit(a,this,_2)===false){return this;}$.event.trigger("form.submit.validate",[a,this,_2,_3]);if(_3.veto){return this;}var q=$.param(a);if(_2.type.toUpperCase()=="GET"){_2.url+=(_2.url.indexOf("?")>=0?"&":"?")+q;_2.data=null;}else{_2.data=q;}var _7=this,callbacks=[];if(_2.resetForm){callbacks.push(function(){_7.resetForm();});}if(_2.clearForm){callbacks.push(function(){_7.clearForm();});}if(!_2.dataType&&_2.target){var _8=_2.success||function(){};callbacks.push(function(_9){if(this.evalScripts){$(_2.target).attr("innerHTML",_9).evalScripts().each(_8,arguments);}else{$(_2.target).html(_9).each(_8,arguments);}});}else{if(_2.success){callbacks.push(_2.success);}}_2.success=function(_a,_b){for(var i=0,max=callbacks.length;i<max;i++){callbacks[i](_a,_b,_7);}};var _d=$("input:file",this).fieldValue();var _e=false;for(var j=0;j<_d.length;j++){if(_d[j]){_e=true;}}if(_2.iframe||_e){fileUpload();}else{$.ajax(_2);}$.event.trigger("form.submit.notify",[this,_2]);return this;function fileUpload(){var _10=_7[0];var _11=$.extend({},$.ajaxSettings,_2);var id="jqFormIO"+$.fn.ajaxSubmit.counter++;var $io=$("<iframe id=\""+id+"\" name=\""+id+"\" />");var io=$io[0];var op8=$.browser.opera&&window.opera.version()<9;if($.browser.msie||op8){io.src="javascript:false;document.write(\"\");";}$io.css({position:"absolute",top:"-1000px",left:"-1000px"});var xhr={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=_11.global;if(g&&!$.active++){$.event.trigger("ajaxStart");}if(g){$.event.trigger("ajaxSend",[xhr,_11]);}var _18=0;var _19=0;setTimeout(function(){$io.appendTo("body");io.attachEvent?io.attachEvent("onload",cb):io.addEventListener("load",cb,false);var _1a=_10.encoding?"encoding":"enctype";var t=_7.attr("target");_7.attr({target:id,method:"POST",action:_11.url});_10[_1a]="multipart/form-data";if(_11.timeout){setTimeout(function(){_19=true;cb();},_11.timeout);}_10.submit();_7.attr("target",t);},10);function cb(){if(_18++){return;}io.detachEvent?io.detachEvent("onload",cb):io.removeEventListener("load",cb,false);var ok=true;try{if(_19){throw "timeout";}var _1d,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(_11.dataType=="json"||_11.dataType=="script"){var ta=doc.getElementsByTagName("textarea")[0];_1d=ta?ta.value:xhr.responseText;if(_11.dataType=="json"){eval("data = "+_1d);}else{$.globalEval(_1d);}}else{if(_11.dataType=="xml"){_1d=xhr.responseXML;if(!_1d&&xhr.responseText!=null){_1d=toXml(xhr.responseText);}}else{_1d=xhr.responseText;}}}catch(e){ok=false;$.handleError(_11,xhr,"error",e);}if(ok){_11.success(_1d,"success");if(g){$.event.trigger("ajaxSuccess",[xhr,_11]);}}if(g){$.event.trigger("ajaxComplete",[xhr,_11]);}if(g&&!--$.active){$.event.trigger("ajaxStop");}if(_11.complete){_11.complete(xhr,ok?"success":"error");}setTimeout(function(){$io.remove();xhr.responseXML=null;},100);}function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s);}else{doc=(new DOMParser()).parseFromString(s,"text/xml");}return (doc&&doc.documentElement&&doc.documentElement.tagName!="parsererror")?doc:null;}}};$.fn.ajaxSubmit.counter=0;$.fn.ajaxForm=function(_21){return this.ajaxFormUnbind().submit(submitHandler).each(function(){this.formPluginId=$.fn.ajaxForm.counter++;$.fn.ajaxForm.optionHash[this.formPluginId]=_21;$(":submit,input:image",this).click(clickHandler);});};$.fn.ajaxForm.counter=1;$.fn.ajaxForm.optionHash={};function clickHandler(e){var _23=this.form;_23.clk=this;if(this.type=="image"){if(e.offsetX!=undefined){_23.clk_x=e.offsetX;_23.clk_y=e.offsetY;}else{if(typeof $.fn.offset=="function"){var _24=$(this).offset();_23.clk_x=e.pageX-_24.left;_23.clk_y=e.pageY-_24.top;}else{_23.clk_x=e.pageX-this.offsetLeft;_23.clk_y=e.pageY-this.offsetTop;}}}setTimeout(function(){_23.clk=_23.clk_x=_23.clk_y=null;},10);}function submitHandler(){var id=this.formPluginId;var _26=$.fn.ajaxForm.optionHash[id];$(this).ajaxSubmit(_26);return false;}$.fn.ajaxFormUnbind=function(){this.unbind("submit",submitHandler);return this.each(function(){$(":submit,input:image",this).unbind("click",clickHandler);});};$.fn.formToArray=function(_27){var a=[];if(this.length==0){return a;}var _29=this[0];var els=_27?_29.getElementsByTagName("*"):_29.elements;if(!els){return a;}for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n){continue;}if(_27&&_29.clk&&el.type=="image"){if(!el.disabled&&_29.clk==el){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}continue;}var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:n,value:v});}}}if(!_27&&_29.clk){var _30=_29.getElementsByTagName("input");for(var i=0,max=_30.length;i<max;i++){var _32=_30[i];var n=_32.name;if(n&&!_32.disabled&&_32.type=="image"&&_29.clk==_32){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}}}return a;};$.fn.formSerialize=function(_34){return $.param(this.formToArray(_34));};$.fn.fieldSerialize=function(_35){var a=[];this.each(function(){var n=this.name;if(!n){return;}var v=$.fieldValue(this,_35);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:this.name,value:v});}}});return $.param(a);};$.fn.fieldValue=function(_3a){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,_3a);if(v===null||typeof v=="undefined"||(v.constructor==Array&&!v.length)){continue;}v.constructor==Array?$.merge(val,v):val.push(v);}return val;};$.fieldValue=function(el,_3f){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof _3f=="undefined"){_3f=true;}if(_3f&&(!n||el.disabled||t=="reset"||t=="button"||(t=="checkbox"||t=="radio")&&!el.checked||(t=="submit"||t=="image")&&el.form&&el.form.clk!=el||tag=="select"&&el.selectedIndex==-1)){return null;}if(tag=="select"){var _41=el.selectedIndex;if(_41<0){return null;}var a=[],ops=el.options;var one=(t=="select-one");var max=(one?_41+1:ops.length);for(var i=(one?_41:0);i<max;i++){var op=ops[i];if(op.selected){var v=$.browser.msie&&!(op.attributes["value"].specified)?op.text:op.value;if(one){return v;}a.push(v);}}return a;}return el.value;};$.fn.clearForm=function(){return this.each(function(){$("input,select,textarea",this).clearFields();});};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=="text"||t=="password"||tag=="textarea"){this.value="";}else{if(t=="checkbox"||t=="radio"){this.checked=false;}else{if(tag=="select"){this.selectedIndex=-1;}}}});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset();}});};})(jQuery);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/support/form.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,819 @@
+/*
+ * jQuery Form Plugin
+ * @requires jQuery v1.1 or later
+ *
+ * Examples at: http://malsup.com/jquery/form/
+ * Dual licensed under the MIT and GPL licenses:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ *
+ * Revision: $Id$
+ */
+ (function($) {
+/**
+ * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.
+ *
+ * ajaxSubmit accepts a single argument which can be either a success callback function
+ * or an options Object.  If a function is provided it will be invoked upon successful
+ * completion of the submit and will be passed the response from the server.
+ * If an options Object is provided, the following attributes are supported:
+ *
+ *  target:   Identifies the element(s) in the page to be updated with the server response.
+ *            This value may be specified as a jQuery selection string, a jQuery object,
+ *            or a DOM element.
+ *            default value: null
+ *
+ *  url:      URL to which the form data will be submitted.
+ *            default value: value of form's 'action' attribute
+ *
+ *  type:     The method in which the form data should be submitted, 'GET' or 'POST'.
+ *            default value: value of form's 'method' attribute (or 'GET' if none found)
+ *
+ *  data:     Additional data to add to the request, specified as key/value pairs (see $.ajax).
+ *
+ *  beforeSubmit:  Callback method to be invoked before the form is submitted.
+ *            default value: null
+ *
+ *  success:  Callback method to be invoked after the form has been successfully submitted
+ *            and the response has been returned from the server
+ *            default value: null
+ *
+ *  dataType: Expected dataType of the response.  One of: null, 'xml', 'script', or 'json'
+ *            default value: null
+ *
+ *  semantic: Boolean flag indicating whether data must be submitted in semantic order (slower).
+ *            default value: false
+ *
+ *  resetForm: Boolean flag indicating whether the form should be reset if the submit is successful
+ *
+ *  clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful
+ *
+ *
+ * The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for
+ * validating the form data.  If the 'beforeSubmit' callback returns false then the form will
+ * not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data
+ * in array format, the jQuery object, and the options object passed into ajaxSubmit.
+ * The form data array takes the following form:
+ *
+ *     [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * If a 'success' callback method is provided it is invoked after the response has been returned
+ * from the server.  It is passed the responseText or responseXML value (depending on dataType).
+ * See jQuery.ajax for further details.
+ *
+ *
+ * The dataType option provides a means for specifying how the server response should be handled.
+ * This maps directly to the jQuery.httpData method.  The following values are supported:
+ *
+ *      'xml':    if dataType == 'xml' the server response is treated as XML and the 'success'
+ *                   callback method, if specified, will be passed the responseXML value
+ *      'json':   if dataType == 'json' the server response will be evaluted and passed to
+ *                   the 'success' callback, if specified
+ *      'script': if dataType == 'script' the server response is evaluated in the global context
+ *
+ *
+ * Note that it does not make sense to use both the 'target' and 'dataType' options.  If both
+ * are provided the target will be ignored.
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * This is normally true anyway, unless the form contains input elements of type='image'.
+ * If your form must be submitted with name/value pairs in semantic order and your form
+ * contains an input of type='image" then pass true for this arg, otherwise pass false
+ * (or nothing) to avoid the overhead for this logic.
+ *
+ *
+ * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this:
+ *
+ * $("#form-id").submit(function() {
+ *     $(this).ajaxSubmit(options);
+ *     return false; // cancel conventional submit
+ * });
+ *
+ * When using ajaxForm(), however, this is done for you.
+ *
+ * @example
+ * $('#myForm').ajaxSubmit(function(data) {
+ *     alert('Form submit succeeded! Server returned: ' + data);
+ * });
+ * @desc Submit form and alert server response
+ *
+ *
+ * @example
+ * var options = {
+ *     target: '#myTargetDiv'
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Submit form and update page element with server response
+ *
+ *
+ * @example
+ * var options = {
+ *     success: function(responseText) {
+ *         alert(responseText);
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Submit form and alert the server response
+ *
+ *
+ * @example
+ * var options = {
+ *     beforeSubmit: function(formArray, jqForm) {
+ *         if (formArray.length == 0) {
+ *             alert('Please enter data.');
+ *             return false;
+ *         }
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Pre-submit validation which aborts the submit operation if form data is empty
+ *
+ *
+ * @example
+ * var options = {
+ *     url: myJsonUrl.php,
+ *     dataType: 'json',
+ *     success: function(data) {
+ *        // 'data' is an object representing the the evaluated json data
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc json data returned and evaluated
+ *
+ *
+ * @example
+ * var options = {
+ *     url: myXmlUrl.php,
+ *     dataType: 'xml',
+ *     success: function(responseXML) {
+ *        // responseXML is XML document object
+ *        var data = $('myElement', responseXML).text();
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc XML data returned from server
+ *
+ *
+ * @example
+ * var options = {
+ *     resetForm: true
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc submit form and reset it if successful
+ *
+ * @example
+ * $('#myForm).submit(function() {
+ *    $(this).ajaxSubmit();
+ *    return false;
+ * });
+ * @desc Bind form's submit event to use ajaxSubmit
+ *
+ *
+ * @name ajaxSubmit
+ * @type jQuery
+ * @param options  object literal containing options which control the form submission process
+ * @cat Plugins/Form
+ * @return jQuery
+ */
+$.fn.ajaxSubmit = function(options) {
+    if (typeof options == 'function')
+        options = { success: options };
+
+    options = $.extend({
+        url:  this.attr('action') || window.location,
+        type: this.attr('method') || 'GET'
+    }, options || {});
+
+    // hook for manipulating the form data before it is extracted;
+    // convenient for use with rich editors like tinyMCE or FCKEditor
+    var veto = {};
+    $.event.trigger('form.pre.serialize', [this, options, veto]);
+    if (veto.veto) return this;
+
+    var a = this.formToArray(options.semantic);
+	if (options.data) {
+	    for (var n in options.data)
+	        a.push( { name: n, value: options.data[n] } );
+	}
+
+    // give pre-submit callback an opportunity to abort the submit
+    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this;
+
+    // fire vetoable 'validate' event
+    $.event.trigger('form.submit.validate', [a, this, options, veto]);
+    if (veto.veto) return this;
+
+    var q = $.param(a);//.replace(/%20/g,'+');
+
+    if (options.type.toUpperCase() == 'GET') {
+        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
+        options.data = null;  // data is null for 'get'
+    }
+    else
+        options.data = q; // data is the query string for 'post'
+
+    var $form = this, callbacks = [];
+    if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
+    if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
+
+    // perform a load on the target only if dataType is not provided
+    if (!options.dataType && options.target) {
+        var oldSuccess = options.success || function(){};
+        callbacks.push(function(data) {
+            if (this.evalScripts)
+                $(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments);
+            else // jQuery v1.1.4
+                $(options.target).html(data).each(oldSuccess, arguments);
+        });
+    }
+    else if (options.success)
+        callbacks.push(options.success);
+
+    options.success = function(data, status) {
+        for (var i=0, max=callbacks.length; i < max; i++)
+            callbacks[i](data, status, $form);
+    };
+
+    // are there files to upload?
+    var files = $('input:file', this).fieldValue();
+    var found = false;
+    for (var j=0; j < files.length; j++)
+        if (files[j])
+            found = true;
+
+    if (options.iframe || found) // options.iframe allows user to force iframe mode
+        fileUpload();
+    else
+        $.ajax(options);
+
+    // fire 'notify' event
+    $.event.trigger('form.submit.notify', [this, options]);
+    return this;
+
+
+    // private function for handling file uploads (hat tip to YAHOO!)
+    function fileUpload() {
+        var form = $form[0];
+        var opts = $.extend({}, $.ajaxSettings, options);
+
+        var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++;
+        var $io = $('<iframe id="' + id + '" name="' + id + '" />');
+        var io = $io[0];
+        var op8 = $.browser.opera && window.opera.version() < 9;
+        if ($.browser.msie || op8) io.src = 'javascript:false;document.write("");';
+        $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
+
+        var xhr = { // mock object
+            responseText: null,
+            responseXML: null,
+            status: 0,
+            statusText: 'n/a',
+            getAllResponseHeaders: function() {},
+            getResponseHeader: function() {},
+            setRequestHeader: function() {}
+        };
+
+        var g = opts.global;
+        // trigger ajax global events so that activity/block indicators work like normal
+        if (g && ! $.active++) $.event.trigger("ajaxStart");
+        if (g) $.event.trigger("ajaxSend", [xhr, opts]);
+
+        var cbInvoked = 0;
+        var timedOut = 0;
+
+        // take a breath so that pending repaints get some cpu time before the upload starts
+        setTimeout(function() {
+            $io.appendTo('body');
+            // jQuery's event binding doesn't work for iframe events in IE
+            io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
+
+            // make sure form attrs are set
+            var encAttr = form.encoding ? 'encoding' : 'enctype';
+            var t = $form.attr('target');
+            $form.attr({
+                target:   id,
+                method:  'POST',
+                action:   opts.url
+            });
+            form[encAttr] = 'multipart/form-data';
+
+            // support timout
+            if (opts.timeout)
+                setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
+
+            form.submit();
+            $form.attr('target', t); // reset target
+        }, 10);
+
+        function cb() {
+            if (cbInvoked++) return;
+
+            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
+
+            var ok = true;
+            try {
+                if (timedOut) throw 'timeout';
+                // extract the server response from the iframe
+                var data, doc;
+                doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
+                xhr.responseText = doc.body ? doc.body.innerHTML : null;
+                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
+
+                if (opts.dataType == 'json' || opts.dataType == 'script') {
+                    var ta = doc.getElementsByTagName('textarea')[0];
+                    data = ta ? ta.value : xhr.responseText;
+                    if (opts.dataType == 'json')
+                        eval("data = " + data);
+                    else
+                        $.globalEval(data);
+                }
+                else if (opts.dataType == 'xml') {
+                    data = xhr.responseXML;
+                    if (!data && xhr.responseText != null)
+                        data = toXml(xhr.responseText);
+                }
+                else {
+                    data = xhr.responseText;
+                }
+            }
+            catch(e){
+                ok = false;
+                $.handleError(opts, xhr, 'error', e);
+            }
+
+            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
+            if (ok) {
+                opts.success(data, 'success');
+                if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
+            }
+            if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
+            if (g && ! --$.active) $.event.trigger("ajaxStop");
+            if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
+
+            // clean up
+            setTimeout(function() {
+                $io.remove();
+                xhr.responseXML = null;
+            }, 100);
+        };
+
+        function toXml(s, doc) {
+            if (window.ActiveXObject) {
+                doc = new ActiveXObject('Microsoft.XMLDOM');
+                doc.async = 'false';
+                doc.loadXML(s);
+            }
+            else
+                doc = (new DOMParser()).parseFromString(s, 'text/xml');
+            return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
+        };
+    };
+};
+$.fn.ajaxSubmit.counter = 0; // used to create unique iframe ids
+
+/**
+ * ajaxForm() provides a mechanism for fully automating form submission.
+ *
+ * The advantages of using this method instead of ajaxSubmit() are:
+ *
+ * 1: This method will include coordinates for <input type="image" /> elements (if the element
+ *    is used to submit the form).
+ * 2. This method will include the submit element's name/value data (for the element that was
+ *    used to submit the form).
+ * 3. This method binds the submit() method to the form for you.
+ *
+ * Note that for accurate x/y coordinates of image submit elements in all browsers
+ * you need to also use the "dimensions" plugin (this method will auto-detect its presence).
+ *
+ * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
+ * passes the options argument along after properly binding events for submit elements and
+ * the form itself.  See ajaxSubmit for a full description of the options argument.
+ *
+ *
+ * @example
+ * var options = {
+ *     target: '#myTargetDiv'
+ * };
+ * $('#myForm').ajaxSForm(options);
+ * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response
+ *       when the form is submitted.
+ *
+ *
+ * @example
+ * var options = {
+ *     success: function(responseText) {
+ *         alert(responseText);
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Bind form's submit event so that server response is alerted after the form is submitted.
+ *
+ *
+ * @example
+ * var options = {
+ *     beforeSubmit: function(formArray, jqForm) {
+ *         if (formArray.length == 0) {
+ *             alert('Please enter data.');
+ *             return false;
+ *         }
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Bind form's submit event so that pre-submit callback is invoked before the form
+ *       is submitted.
+ *
+ *
+ * @name   ajaxForm
+ * @param  options  object literal containing options which control the form submission process
+ * @return jQuery
+ * @cat    Plugins/Form
+ * @type   jQuery
+ */
+$.fn.ajaxForm = function(options) {
+    return this.ajaxFormUnbind().submit(submitHandler).each(function() {
+        // store options in hash
+        this.formPluginId = $.fn.ajaxForm.counter++;
+        $.fn.ajaxForm.optionHash[this.formPluginId] = options;
+        $(":submit,input:image", this).click(clickHandler);
+    });
+};
+
+$.fn.ajaxForm.counter = 1;
+$.fn.ajaxForm.optionHash = {};
+
+function clickHandler(e) {
+    var $form = this.form;
+    $form.clk = this;
+    if (this.type == 'image') {
+        if (e.offsetX != undefined) {
+            $form.clk_x = e.offsetX;
+            $form.clk_y = e.offsetY;
+        } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
+            var offset = $(this).offset();
+            $form.clk_x = e.pageX - offset.left;
+            $form.clk_y = e.pageY - offset.top;
+        } else {
+            $form.clk_x = e.pageX - this.offsetLeft;
+            $form.clk_y = e.pageY - this.offsetTop;
+        }
+    }
+    // clear form vars
+    setTimeout(function() { $form.clk = $form.clk_x = $form.clk_y = null; }, 10);
+};
+
+function submitHandler() {
+    // retrieve options from hash
+    var id = this.formPluginId;
+    var options = $.fn.ajaxForm.optionHash[id];
+    $(this).ajaxSubmit(options);
+    return false;
+};
+
+/**
+ * ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
+ *
+ * @name   ajaxFormUnbind
+ * @return jQuery
+ * @cat    Plugins/Form
+ * @type   jQuery
+ */
+$.fn.ajaxFormUnbind = function() {
+    this.unbind('submit', submitHandler);
+    return this.each(function() {
+        $(":submit,input:image", this).unbind('click', clickHandler);
+    });
+
+};
+
+/**
+ * formToArray() gathers form element data into an array of objects that can
+ * be passed to any of the following ajax functions: $.get, $.post, or load.
+ * Each object in the array has both a 'name' and 'value' property.  An example of
+ * an array for a simple login form might be:
+ *
+ * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * It is this array that is passed to pre-submit callback functions provided to the
+ * ajaxSubmit() and ajaxForm() methods.
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * This is normally true anyway, unless the form contains input elements of type='image'.
+ * If your form must be submitted with name/value pairs in semantic order and your form
+ * contains an input of type='image" then pass true for this arg, otherwise pass false
+ * (or nothing) to avoid the overhead for this logic.
+ *
+ * @example var data = $("#myForm").formToArray();
+ * $.post( "myscript.cgi", data );
+ * @desc Collect all the data from a form and submit it to the server.
+ *
+ * @name formToArray
+ * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
+ * @type Array<Object>
+ * @cat Plugins/Form
+ */
+$.fn.formToArray = function(semantic) {
+    var a = [];
+    if (this.length == 0) return a;
+
+    var form = this[0];
+    var els = semantic ? form.getElementsByTagName('*') : form.elements;
+    if (!els) return a;
+    for(var i=0, max=els.length; i < max; i++) {
+        var el = els[i];
+        var n = el.name;
+        if (!n) continue;
+
+        if (semantic && form.clk && el.type == "image") {
+            // handle image inputs on the fly when semantic == true
+            if(!el.disabled && form.clk == el)
+                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+            continue;
+        }
+
+        var v = $.fieldValue(el, true);
+        if (v && v.constructor == Array) {
+            for(var j=0, jmax=v.length; j < jmax; j++)
+                a.push({name: n, value: v[j]});
+        }
+        else if (v !== null && typeof v != 'undefined')
+            a.push({name: n, value: v});
+    }
+
+    if (!semantic && form.clk) {
+        // input type=='image' are not found in elements array! handle them here
+        var inputs = form.getElementsByTagName("input");
+        for(var i=0, max=inputs.length; i < max; i++) {
+            var input = inputs[i];
+            var n = input.name;
+            if(n && !input.disabled && input.type == "image" && form.clk == input)
+                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+        }
+    }
+    return a;
+};
+
+
+/**
+ * Serializes form data into a 'submittable' string. This method will return a string
+ * in the format: name1=value1&amp;name2=value2
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * If your form must be submitted with name/value pairs in semantic order then pass
+ * true for this arg, otherwise pass false (or nothing) to avoid the overhead for
+ * this logic (which can be significant for very large forms).
+ *
+ * @example var data = $("#myForm").formSerialize();
+ * $.ajax('POST', "myscript.cgi", data);
+ * @desc Collect all the data from a form into a single string
+ *
+ * @name formSerialize
+ * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
+ * @type String
+ * @cat Plugins/Form
+ */
+$.fn.formSerialize = function(semantic) {
+    //hand off to jQuery.param for proper encoding
+    return $.param(this.formToArray(semantic));
+};
+
+
+/**
+ * Serializes all field elements in the jQuery object into a query string.
+ * This method will return a string in the format: name1=value1&amp;name2=value2
+ *
+ * The successful argument controls whether or not serialization is limited to
+ * 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.
+ *
+ * @example var data = $("input").formSerialize();
+ * @desc Collect the data from all successful input elements into a query string
+ *
+ * @example var data = $(":radio").formSerialize();
+ * @desc Collect the data from all successful radio input elements into a query string
+ *
+ * @example var data = $("#myForm :checkbox").formSerialize();
+ * @desc Collect the data from all successful checkbox input elements in myForm into a query string
+ *
+ * @example var data = $("#myForm :checkbox").formSerialize(false);
+ * @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string
+ *
+ * @example var data = $(":input").formSerialize();
+ * @desc Collect the data from all successful input, select, textarea and button elements into a query string
+ *
+ * @name fieldSerialize
+ * @param successful true if only successful controls should be serialized (default is true)
+ * @type String
+ * @cat Plugins/Form
+ */
+$.fn.fieldSerialize = function(successful) {
+    var a = [];
+    this.each(function() {
+        var n = this.name;
+        if (!n) return;
+        var v = $.fieldValue(this, successful);
+        if (v && v.constructor == Array) {
+            for (var i=0,max=v.length; i < max; i++)
+                a.push({name: n, value: v[i]});
+        }
+        else if (v !== null && typeof v != 'undefined')
+            a.push({name: this.name, value: v});
+    });
+    //hand off to jQuery.param for proper encoding
+    return $.param(a);
+};
+
+
+/**
+ * Returns the value(s) of the element in the matched set.  For example, consider the following form:
+ *
+ *  <form><fieldset>
+ *      <input name="A" type="text" />
+ *      <input name="A" type="text" />
+ *      <input name="B" type="checkbox" value="B1" />
+ *      <input name="B" type="checkbox" value="B2"/>
+ *      <input name="C" type="radio" value="C1" />
+ *      <input name="C" type="radio" value="C2" />
+ *  </fieldset></form>
+ *
+ *  var v = $(':text').fieldValue();
+ *  // if no values are entered into the text inputs
+ *  v == ['','']
+ *  // if values entered into the text inputs are 'foo' and 'bar'
+ *  v == ['foo','bar']
+ *
+ *  var v = $(':checkbox').fieldValue();
+ *  // if neither checkbox is checked
+ *  v === undefined
+ *  // if both checkboxes are checked
+ *  v == ['B1', 'B2']
+ *
+ *  var v = $(':radio').fieldValue();
+ *  // if neither radio is checked
+ *  v === undefined
+ *  // if first radio is checked
+ *  v == ['C1']
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.  If this value is false the value(s)
+ * for each element is returned.
+ *
+ * Note: This method *always* returns an array.  If no valid value can be determined the
+ *       array will be empty, otherwise it will contain one or more values.
+ *
+ * @example var data = $("#myPasswordElement").fieldValue();
+ * alert(data[0]);
+ * @desc Alerts the current value of the myPasswordElement element
+ *
+ * @example var data = $("#myForm :input").fieldValue();
+ * @desc Get the value(s) of the form elements in myForm
+ *
+ * @example var data = $("#myForm :checkbox").fieldValue();
+ * @desc Get the value(s) for the successful checkbox element(s) in the jQuery object.
+ *
+ * @example var data = $("#mySingleSelect").fieldValue();
+ * @desc Get the value(s) of the select control
+ *
+ * @example var data = $(':text').fieldValue();
+ * @desc Get the value(s) of the text input or textarea elements
+ *
+ * @example var data = $("#myMultiSelect").fieldValue();
+ * @desc Get the values for the select-multiple control
+ *
+ * @name fieldValue
+ * @param Boolean successful true if only the values for successful controls should be returned (default is true)
+ * @type Array<String>
+ * @cat Plugins/Form
+ */
+$.fn.fieldValue = function(successful) {
+    for (var val=[], i=0, max=this.length; i < max; i++) {
+        var el = this[i];
+        var v = $.fieldValue(el, successful);
+        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
+            continue;
+        v.constructor == Array ? $.merge(val, v) : val.push(v);
+    }
+    return val;
+};
+
+/**
+ * Returns the value of the field element.
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.  If the given element is not
+ * successful and the successful arg is not false then the returned value will be null.
+ *
+ * Note: If the successful flag is true (default) but the element is not successful, the return will be null
+ * Note: The value returned for a successful select-multiple element will always be an array.
+ * Note: If the element has no value the return value will be undefined.
+ *
+ * @example var data = jQuery.fieldValue($("#myPasswordElement")[0]);
+ * @desc Gets the current value of the myPasswordElement element
+ *
+ * @name fieldValue
+ * @param Element el The DOM element for which the value will be returned
+ * @param Boolean successful true if value returned must be for a successful controls (default is true)
+ * @type String or Array<String> or null or undefined
+ * @cat Plugins/Form
+ */
+$.fieldValue = function(el, successful) {
+    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
+    if (typeof successful == 'undefined') successful = true;
+
+    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
+        (t == 'checkbox' || t == 'radio') && !el.checked ||
+        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
+        tag == 'select' && el.selectedIndex == -1))
+            return null;
+
+    if (tag == 'select') {
+        var index = el.selectedIndex;
+        if (index < 0) return null;
+        var a = [], ops = el.options;
+        var one = (t == 'select-one');
+        var max = (one ? index+1 : ops.length);
+        for(var i=(one ? index : 0); i < max; i++) {
+            var op = ops[i];
+            if (op.selected) {
+                // extra pain for IE...
+                var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
+                if (one) return v;
+                a.push(v);
+            }
+        }
+        return a;
+    }
+    return el.value;
+};
+
+
+/**
+ * Clears the form data.  Takes the following actions on the form's input fields:
+ *  - input text fields will have their 'value' property set to the empty string
+ *  - select elements will have their 'selectedIndex' property set to -1
+ *  - checkbox and radio inputs will have their 'checked' property set to false
+ *  - inputs of type submit, button, reset, and hidden will *not* be effected
+ *  - button elements will *not* be effected
+ *
+ * @example $('form').clearForm();
+ * @desc Clears all forms on the page.
+ *
+ * @name clearForm
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.clearForm = function() {
+    return this.each(function() {
+        $('input,select,textarea', this).clearFields();
+    });
+};
+
+/**
+ * Clears the selected form elements.  Takes the following actions on the matched elements:
+ *  - input text fields will have their 'value' property set to the empty string
+ *  - select elements will have their 'selectedIndex' property set to -1
+ *  - checkbox and radio inputs will have their 'checked' property set to false
+ *  - inputs of type submit, button, reset, and hidden will *not* be effected
+ *  - button elements will *not* be effected
+ *
+ * @example $('.myInputs').clearFields();
+ * @desc Clears all inputs with class myInputs
+ *
+ * @name clearFields
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.clearFields = $.fn.clearInputs = function() {
+    return this.each(function() {
+        var t = this.type, tag = this.tagName.toLowerCase();
+        if (t == 'text' || t == 'password' || tag == 'textarea')
+            this.value = '';
+        else if (t == 'checkbox' || t == 'radio')
+            this.checked = false;
+        else if (tag == 'select')
+            this.selectedIndex = -1;
+    });
+};
+
+
+/**
+ * Resets the form data.  Causes all form elements to be reset to their original value.
+ *
+ * @example $('form').resetForm();
+ * @desc Resets all forms on the page.
+ *
+ * @name resetForm
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.resetForm = function() {
+    return this.each(function() {
+        // guard against an input with the name of 'reset'
+        // note that IE reports the reset function as an 'object'
+        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
+            this.reset();
+    });
+};
+
+})(jQuery);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/support/hsbook.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,95 @@
+function qid(id) {
+  return id.replace(/([.:])/g, "\\$1");
+}
+
+function beforeComment(formData, jqForm, options) {
+  var form = jqForm[0];
+  if (!form.comment.value) {
+    $(options.target + " span.comment_error").empty().append(
+      "<span class=\"comment_error\">Your comment is empty</span>");
+    return false;
+  }
+  if (!form.name.value) {
+    $(options.target + " span.comment_error").empty().append(
+      "<span class=\"comment_error\">Please provide a name</span>");
+    return false;
+  }
+  $(options.target + " span.comment_error").empty().after(
+    "<img src=\"/support/icons/throbber.gif\" style=\"vertical-align: middle\"/>");
+  $(options.target + " input[@name=submit]").attr("disabled", true);
+}
+
+function ajaxifyForm(id) {
+  var q = qid(id);
+  
+  $("#form_" + q).ajaxForm({ beforeSubmit: beforeComment,
+			     success: function() { ajaxifyForm(id); },
+			     target: "#comments_" + q });
+}
+
+function toggleComment(id) {
+  $("#toggle_" + qid(id)).nextAll().toggle();
+  return false;
+}
+
+function loadComments(id) {
+  $("#comments_" + qid(id)).load(location.protocol + "//" + location.host +
+				 "/comments/single/" + id + "/", function() {
+    ajaxifyForm(id);
+  });
+  return false;
+}
+
+function loadAllComments() {
+  $("a.commenttoggle").each(function() {
+    var id = $(this).attr("pid");
+    if (id) {
+      loadComments(id);
+    }
+  });
+}
+
+$(document).ready(function() {
+  function loading(id) {
+    return " <span id=\"comments_" + id + "\" class=\"comment\">" +
+      "<span pid=\"" + id + "\" class=\"commenttoggle\">Loading..." +
+      "</span></span>";
+  }
+  $("div.toc>p")
+    .after("<p style='display: none;'><a onclick='return loadAllComments()'>" +
+	   "Load all comments (<b>slow</b>)</a></p>")
+    .toggle(function() { $(this).nextAll().show("normal"); },
+	    function() { $(this).nextAll().hide("normal"); })
+    .hover(function() { $(this).fadeTo("normal", 0.8); },
+	   function() { $(this).fadeTo("normal", 0.35); });
+  $(".chapter p[@id]").each(function() {
+    $(this).append(loading($(this).attr("id")));
+  });
+  $(".chapter table[@id].equation").each(function() {
+    id = $(this).attr("id");
+    $("#" + id + " tr").after('<tr><td colspan="4">' + loading($(this).attr("id")) + '</td></tr>');
+  });
+  $(".chapter pre[@id]").each(function() {
+    $(this).after(loading($(this).attr("id")));
+  });
+  var chapid = $("div.preface, div.chapter, div.appendix, div.bibliography").attr("id");
+  $("#chapterfeed").attr("href",
+			 $("#chapterfeed").attr("href") + chapid + "/");
+  $.getJSON(location.protocol + "//" + location.host + "/comments/chapter/" +
+	    chapid + "/count/", function(data) {
+    $.each(data, function(id, item) {
+      var s = item == 1 ? "" : "s";
+      $("#comments_" + qid(id) + " span.commenttoggle").replaceWith(
+        "<a class='commenttoggle' id='toggle_" + id + "' " +
+	"pid='" + id + "' " +
+	"onclick='return loadComments(\"" + id + "\")' " +
+	"href='comments: show / hide'>" + item + " comment" + s + "</a>");
+    });
+    $("span.commenttoggle").each(function() {
+      var id = $(this).attr("pid");
+      $(this).replaceWith("<a class='commenttoggle' id='toggle_" + id + "' " +
+			  "onclick='return loadComments(\"" + id + "\")' " +
+			  "href='comment: add'>No comments</a>");
+    });
+  });
+});
Binary file SEESenv/web/html/support/icons/caution.png has changed
Binary file SEESenv/web/html/support/icons/favicon.png has changed
Binary file SEESenv/web/html/support/icons/important.png has changed
Binary file SEESenv/web/html/support/icons/note.png has changed
Binary file SEESenv/web/html/support/icons/remark.png has changed
Binary file SEESenv/web/html/support/icons/rss.png has changed
Binary file SEESenv/web/html/support/icons/shell.png has changed
Binary file SEESenv/web/html/support/icons/source.png has changed
Binary file SEESenv/web/html/support/icons/throbber.gif has changed
Binary file SEESenv/web/html/support/icons/tip.png has changed
Binary file SEESenv/web/html/support/icons/warning.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/support/javascript/form-min.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1 @@
+(function($){$.fn.ajaxSubmit=function(_2){if(typeof _2=="function"){_2={success:_2};}_2=$.extend({url:this.attr("action")||window.location,type:this.attr("method")||"GET"},_2||{});var _3={};$.event.trigger("form.pre.serialize",[this,_2,_3]);if(_3.veto){return this;}var a=this.formToArray(_2.semantic);if(_2.data){for(var n in _2.data){a.push({name:n,value:_2.data[n]});}}if(_2.beforeSubmit&&_2.beforeSubmit(a,this,_2)===false){return this;}$.event.trigger("form.submit.validate",[a,this,_2,_3]);if(_3.veto){return this;}var q=$.param(a);if(_2.type.toUpperCase()=="GET"){_2.url+=(_2.url.indexOf("?")>=0?"&":"?")+q;_2.data=null;}else{_2.data=q;}var _7=this,callbacks=[];if(_2.resetForm){callbacks.push(function(){_7.resetForm();});}if(_2.clearForm){callbacks.push(function(){_7.clearForm();});}if(!_2.dataType&&_2.target){var _8=_2.success||function(){};callbacks.push(function(_9){if(this.evalScripts){$(_2.target).attr("innerHTML",_9).evalScripts().each(_8,arguments);}else{$(_2.target).html(_9).each(_8,arguments);}});}else{if(_2.success){callbacks.push(_2.success);}}_2.success=function(_a,_b){for(var i=0,max=callbacks.length;i<max;i++){callbacks[i](_a,_b,_7);}};var _d=$("input:file",this).fieldValue();var _e=false;for(var j=0;j<_d.length;j++){if(_d[j]){_e=true;}}if(_2.iframe||_e){fileUpload();}else{$.ajax(_2);}$.event.trigger("form.submit.notify",[this,_2]);return this;function fileUpload(){var _10=_7[0];var _11=$.extend({},$.ajaxSettings,_2);var id="jqFormIO"+$.fn.ajaxSubmit.counter++;var $io=$("<iframe id=\""+id+"\" name=\""+id+"\" />");var io=$io[0];var op8=$.browser.opera&&window.opera.version()<9;if($.browser.msie||op8){io.src="javascript:false;document.write(\"\");";}$io.css({position:"absolute",top:"-1000px",left:"-1000px"});var xhr={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=_11.global;if(g&&!$.active++){$.event.trigger("ajaxStart");}if(g){$.event.trigger("ajaxSend",[xhr,_11]);}var _18=0;var _19=0;setTimeout(function(){$io.appendTo("body");io.attachEvent?io.attachEvent("onload",cb):io.addEventListener("load",cb,false);var _1a=_10.encoding?"encoding":"enctype";var t=_7.attr("target");_7.attr({target:id,method:"POST",action:_11.url});_10[_1a]="multipart/form-data";if(_11.timeout){setTimeout(function(){_19=true;cb();},_11.timeout);}_10.submit();_7.attr("target",t);},10);function cb(){if(_18++){return;}io.detachEvent?io.detachEvent("onload",cb):io.removeEventListener("load",cb,false);var ok=true;try{if(_19){throw "timeout";}var _1d,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(_11.dataType=="json"||_11.dataType=="script"){var ta=doc.getElementsByTagName("textarea")[0];_1d=ta?ta.value:xhr.responseText;if(_11.dataType=="json"){eval("data = "+_1d);}else{$.globalEval(_1d);}}else{if(_11.dataType=="xml"){_1d=xhr.responseXML;if(!_1d&&xhr.responseText!=null){_1d=toXml(xhr.responseText);}}else{_1d=xhr.responseText;}}}catch(e){ok=false;$.handleError(_11,xhr,"error",e);}if(ok){_11.success(_1d,"success");if(g){$.event.trigger("ajaxSuccess",[xhr,_11]);}}if(g){$.event.trigger("ajaxComplete",[xhr,_11]);}if(g&&!--$.active){$.event.trigger("ajaxStop");}if(_11.complete){_11.complete(xhr,ok?"success":"error");}setTimeout(function(){$io.remove();xhr.responseXML=null;},100);}function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s);}else{doc=(new DOMParser()).parseFromString(s,"text/xml");}return (doc&&doc.documentElement&&doc.documentElement.tagName!="parsererror")?doc:null;}}};$.fn.ajaxSubmit.counter=0;$.fn.ajaxForm=function(_21){return this.ajaxFormUnbind().submit(submitHandler).each(function(){this.formPluginId=$.fn.ajaxForm.counter++;$.fn.ajaxForm.optionHash[this.formPluginId]=_21;$(":submit,input:image",this).click(clickHandler);});};$.fn.ajaxForm.counter=1;$.fn.ajaxForm.optionHash={};function clickHandler(e){var _23=this.form;_23.clk=this;if(this.type=="image"){if(e.offsetX!=undefined){_23.clk_x=e.offsetX;_23.clk_y=e.offsetY;}else{if(typeof $.fn.offset=="function"){var _24=$(this).offset();_23.clk_x=e.pageX-_24.left;_23.clk_y=e.pageY-_24.top;}else{_23.clk_x=e.pageX-this.offsetLeft;_23.clk_y=e.pageY-this.offsetTop;}}}setTimeout(function(){_23.clk=_23.clk_x=_23.clk_y=null;},10);}function submitHandler(){var id=this.formPluginId;var _26=$.fn.ajaxForm.optionHash[id];$(this).ajaxSubmit(_26);return false;}$.fn.ajaxFormUnbind=function(){this.unbind("submit",submitHandler);return this.each(function(){$(":submit,input:image",this).unbind("click",clickHandler);});};$.fn.formToArray=function(_27){var a=[];if(this.length==0){return a;}var _29=this[0];var els=_27?_29.getElementsByTagName("*"):_29.elements;if(!els){return a;}for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n){continue;}if(_27&&_29.clk&&el.type=="image"){if(!el.disabled&&_29.clk==el){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}continue;}var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:n,value:v});}}}if(!_27&&_29.clk){var _30=_29.getElementsByTagName("input");for(var i=0,max=_30.length;i<max;i++){var _32=_30[i];var n=_32.name;if(n&&!_32.disabled&&_32.type=="image"&&_29.clk==_32){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}}}return a;};$.fn.formSerialize=function(_34){return $.param(this.formToArray(_34));};$.fn.fieldSerialize=function(_35){var a=[];this.each(function(){var n=this.name;if(!n){return;}var v=$.fieldValue(this,_35);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:this.name,value:v});}}});return $.param(a);};$.fn.fieldValue=function(_3a){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,_3a);if(v===null||typeof v=="undefined"||(v.constructor==Array&&!v.length)){continue;}v.constructor==Array?$.merge(val,v):val.push(v);}return val;};$.fieldValue=function(el,_3f){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof _3f=="undefined"){_3f=true;}if(_3f&&(!n||el.disabled||t=="reset"||t=="button"||(t=="checkbox"||t=="radio")&&!el.checked||(t=="submit"||t=="image")&&el.form&&el.form.clk!=el||tag=="select"&&el.selectedIndex==-1)){return null;}if(tag=="select"){var _41=el.selectedIndex;if(_41<0){return null;}var a=[],ops=el.options;var one=(t=="select-one");var max=(one?_41+1:ops.length);for(var i=(one?_41:0);i<max;i++){var op=ops[i];if(op.selected){var v=$.browser.msie&&!(op.attributes["value"].specified)?op.text:op.value;if(one){return v;}a.push(v);}}return a;}return el.value;};$.fn.clearForm=function(){return this.each(function(){$("input,select,textarea",this).clearFields();});};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=="text"||t=="password"||tag=="textarea"){this.value="";}else{if(t=="checkbox"||t=="radio"){this.checked=false;}else{if(tag=="select"){this.selectedIndex=-1;}}}});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset();}});};})(jQuery);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/support/javascript/form.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,819 @@
+/*
+ * jQuery Form Plugin
+ * @requires jQuery v1.1 or later
+ *
+ * Examples at: http://malsup.com/jquery/form/
+ * Dual licensed under the MIT and GPL licenses:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ *
+ * Revision: $Id$
+ */
+ (function($) {
+/**
+ * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.
+ *
+ * ajaxSubmit accepts a single argument which can be either a success callback function
+ * or an options Object.  If a function is provided it will be invoked upon successful
+ * completion of the submit and will be passed the response from the server.
+ * If an options Object is provided, the following attributes are supported:
+ *
+ *  target:   Identifies the element(s) in the page to be updated with the server response.
+ *            This value may be specified as a jQuery selection string, a jQuery object,
+ *            or a DOM element.
+ *            default value: null
+ *
+ *  url:      URL to which the form data will be submitted.
+ *            default value: value of form's 'action' attribute
+ *
+ *  type:     The method in which the form data should be submitted, 'GET' or 'POST'.
+ *            default value: value of form's 'method' attribute (or 'GET' if none found)
+ *
+ *  data:     Additional data to add to the request, specified as key/value pairs (see $.ajax).
+ *
+ *  beforeSubmit:  Callback method to be invoked before the form is submitted.
+ *            default value: null
+ *
+ *  success:  Callback method to be invoked after the form has been successfully submitted
+ *            and the response has been returned from the server
+ *            default value: null
+ *
+ *  dataType: Expected dataType of the response.  One of: null, 'xml', 'script', or 'json'
+ *            default value: null
+ *
+ *  semantic: Boolean flag indicating whether data must be submitted in semantic order (slower).
+ *            default value: false
+ *
+ *  resetForm: Boolean flag indicating whether the form should be reset if the submit is successful
+ *
+ *  clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful
+ *
+ *
+ * The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for
+ * validating the form data.  If the 'beforeSubmit' callback returns false then the form will
+ * not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data
+ * in array format, the jQuery object, and the options object passed into ajaxSubmit.
+ * The form data array takes the following form:
+ *
+ *     [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * If a 'success' callback method is provided it is invoked after the response has been returned
+ * from the server.  It is passed the responseText or responseXML value (depending on dataType).
+ * See jQuery.ajax for further details.
+ *
+ *
+ * The dataType option provides a means for specifying how the server response should be handled.
+ * This maps directly to the jQuery.httpData method.  The following values are supported:
+ *
+ *      'xml':    if dataType == 'xml' the server response is treated as XML and the 'success'
+ *                   callback method, if specified, will be passed the responseXML value
+ *      'json':   if dataType == 'json' the server response will be evaluted and passed to
+ *                   the 'success' callback, if specified
+ *      'script': if dataType == 'script' the server response is evaluated in the global context
+ *
+ *
+ * Note that it does not make sense to use both the 'target' and 'dataType' options.  If both
+ * are provided the target will be ignored.
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * This is normally true anyway, unless the form contains input elements of type='image'.
+ * If your form must be submitted with name/value pairs in semantic order and your form
+ * contains an input of type='image" then pass true for this arg, otherwise pass false
+ * (or nothing) to avoid the overhead for this logic.
+ *
+ *
+ * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this:
+ *
+ * $("#form-id").submit(function() {
+ *     $(this).ajaxSubmit(options);
+ *     return false; // cancel conventional submit
+ * });
+ *
+ * When using ajaxForm(), however, this is done for you.
+ *
+ * @example
+ * $('#myForm').ajaxSubmit(function(data) {
+ *     alert('Form submit succeeded! Server returned: ' + data);
+ * });
+ * @desc Submit form and alert server response
+ *
+ *
+ * @example
+ * var options = {
+ *     target: '#myTargetDiv'
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Submit form and update page element with server response
+ *
+ *
+ * @example
+ * var options = {
+ *     success: function(responseText) {
+ *         alert(responseText);
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Submit form and alert the server response
+ *
+ *
+ * @example
+ * var options = {
+ *     beforeSubmit: function(formArray, jqForm) {
+ *         if (formArray.length == 0) {
+ *             alert('Please enter data.');
+ *             return false;
+ *         }
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Pre-submit validation which aborts the submit operation if form data is empty
+ *
+ *
+ * @example
+ * var options = {
+ *     url: myJsonUrl.php,
+ *     dataType: 'json',
+ *     success: function(data) {
+ *        // 'data' is an object representing the the evaluated json data
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc json data returned and evaluated
+ *
+ *
+ * @example
+ * var options = {
+ *     url: myXmlUrl.php,
+ *     dataType: 'xml',
+ *     success: function(responseXML) {
+ *        // responseXML is XML document object
+ *        var data = $('myElement', responseXML).text();
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc XML data returned from server
+ *
+ *
+ * @example
+ * var options = {
+ *     resetForm: true
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc submit form and reset it if successful
+ *
+ * @example
+ * $('#myForm).submit(function() {
+ *    $(this).ajaxSubmit();
+ *    return false;
+ * });
+ * @desc Bind form's submit event to use ajaxSubmit
+ *
+ *
+ * @name ajaxSubmit
+ * @type jQuery
+ * @param options  object literal containing options which control the form submission process
+ * @cat Plugins/Form
+ * @return jQuery
+ */
+$.fn.ajaxSubmit = function(options) {
+    if (typeof options == 'function')
+        options = { success: options };
+
+    options = $.extend({
+        url:  this.attr('action') || window.location,
+        type: this.attr('method') || 'GET'
+    }, options || {});
+
+    // hook for manipulating the form data before it is extracted;
+    // convenient for use with rich editors like tinyMCE or FCKEditor
+    var veto = {};
+    $.event.trigger('form.pre.serialize', [this, options, veto]);
+    if (veto.veto) return this;
+
+    var a = this.formToArray(options.semantic);
+	if (options.data) {
+	    for (var n in options.data)
+	        a.push( { name: n, value: options.data[n] } );
+	}
+
+    // give pre-submit callback an opportunity to abort the submit
+    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this;
+
+    // fire vetoable 'validate' event
+    $.event.trigger('form.submit.validate', [a, this, options, veto]);
+    if (veto.veto) return this;
+
+    var q = $.param(a);//.replace(/%20/g,'+');
+
+    if (options.type.toUpperCase() == 'GET') {
+        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
+        options.data = null;  // data is null for 'get'
+    }
+    else
+        options.data = q; // data is the query string for 'post'
+
+    var $form = this, callbacks = [];
+    if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
+    if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
+
+    // perform a load on the target only if dataType is not provided
+    if (!options.dataType && options.target) {
+        var oldSuccess = options.success || function(){};
+        callbacks.push(function(data) {
+            if (this.evalScripts)
+                $(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments);
+            else // jQuery v1.1.4
+                $(options.target).html(data).each(oldSuccess, arguments);
+        });
+    }
+    else if (options.success)
+        callbacks.push(options.success);
+
+    options.success = function(data, status) {
+        for (var i=0, max=callbacks.length; i < max; i++)
+            callbacks[i](data, status, $form);
+    };
+
+    // are there files to upload?
+    var files = $('input:file', this).fieldValue();
+    var found = false;
+    for (var j=0; j < files.length; j++)
+        if (files[j])
+            found = true;
+
+    if (options.iframe || found) // options.iframe allows user to force iframe mode
+        fileUpload();
+    else
+        $.ajax(options);
+
+    // fire 'notify' event
+    $.event.trigger('form.submit.notify', [this, options]);
+    return this;
+
+
+    // private function for handling file uploads (hat tip to YAHOO!)
+    function fileUpload() {
+        var form = $form[0];
+        var opts = $.extend({}, $.ajaxSettings, options);
+
+        var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++;
+        var $io = $('<iframe id="' + id + '" name="' + id + '" />');
+        var io = $io[0];
+        var op8 = $.browser.opera && window.opera.version() < 9;
+        if ($.browser.msie || op8) io.src = 'javascript:false;document.write("");';
+        $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
+
+        var xhr = { // mock object
+            responseText: null,
+            responseXML: null,
+            status: 0,
+            statusText: 'n/a',
+            getAllResponseHeaders: function() {},
+            getResponseHeader: function() {},
+            setRequestHeader: function() {}
+        };
+
+        var g = opts.global;
+        // trigger ajax global events so that activity/block indicators work like normal
+        if (g && ! $.active++) $.event.trigger("ajaxStart");
+        if (g) $.event.trigger("ajaxSend", [xhr, opts]);
+
+        var cbInvoked = 0;
+        var timedOut = 0;
+
+        // take a breath so that pending repaints get some cpu time before the upload starts
+        setTimeout(function() {
+            $io.appendTo('body');
+            // jQuery's event binding doesn't work for iframe events in IE
+            io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
+
+            // make sure form attrs are set
+            var encAttr = form.encoding ? 'encoding' : 'enctype';
+            var t = $form.attr('target');
+            $form.attr({
+                target:   id,
+                method:  'POST',
+                action:   opts.url
+            });
+            form[encAttr] = 'multipart/form-data';
+
+            // support timout
+            if (opts.timeout)
+                setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
+
+            form.submit();
+            $form.attr('target', t); // reset target
+        }, 10);
+
+        function cb() {
+            if (cbInvoked++) return;
+
+            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
+
+            var ok = true;
+            try {
+                if (timedOut) throw 'timeout';
+                // extract the server response from the iframe
+                var data, doc;
+                doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
+                xhr.responseText = doc.body ? doc.body.innerHTML : null;
+                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
+
+                if (opts.dataType == 'json' || opts.dataType == 'script') {
+                    var ta = doc.getElementsByTagName('textarea')[0];
+                    data = ta ? ta.value : xhr.responseText;
+                    if (opts.dataType == 'json')
+                        eval("data = " + data);
+                    else
+                        $.globalEval(data);
+                }
+                else if (opts.dataType == 'xml') {
+                    data = xhr.responseXML;
+                    if (!data && xhr.responseText != null)
+                        data = toXml(xhr.responseText);
+                }
+                else {
+                    data = xhr.responseText;
+                }
+            }
+            catch(e){
+                ok = false;
+                $.handleError(opts, xhr, 'error', e);
+            }
+
+            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
+            if (ok) {
+                opts.success(data, 'success');
+                if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
+            }
+            if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
+            if (g && ! --$.active) $.event.trigger("ajaxStop");
+            if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
+
+            // clean up
+            setTimeout(function() {
+                $io.remove();
+                xhr.responseXML = null;
+            }, 100);
+        };
+
+        function toXml(s, doc) {
+            if (window.ActiveXObject) {
+                doc = new ActiveXObject('Microsoft.XMLDOM');
+                doc.async = 'false';
+                doc.loadXML(s);
+            }
+            else
+                doc = (new DOMParser()).parseFromString(s, 'text/xml');
+            return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
+        };
+    };
+};
+$.fn.ajaxSubmit.counter = 0; // used to create unique iframe ids
+
+/**
+ * ajaxForm() provides a mechanism for fully automating form submission.
+ *
+ * The advantages of using this method instead of ajaxSubmit() are:
+ *
+ * 1: This method will include coordinates for <input type="image" /> elements (if the element
+ *    is used to submit the form).
+ * 2. This method will include the submit element's name/value data (for the element that was
+ *    used to submit the form).
+ * 3. This method binds the submit() method to the form for you.
+ *
+ * Note that for accurate x/y coordinates of image submit elements in all browsers
+ * you need to also use the "dimensions" plugin (this method will auto-detect its presence).
+ *
+ * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
+ * passes the options argument along after properly binding events for submit elements and
+ * the form itself.  See ajaxSubmit for a full description of the options argument.
+ *
+ *
+ * @example
+ * var options = {
+ *     target: '#myTargetDiv'
+ * };
+ * $('#myForm').ajaxSForm(options);
+ * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response
+ *       when the form is submitted.
+ *
+ *
+ * @example
+ * var options = {
+ *     success: function(responseText) {
+ *         alert(responseText);
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Bind form's submit event so that server response is alerted after the form is submitted.
+ *
+ *
+ * @example
+ * var options = {
+ *     beforeSubmit: function(formArray, jqForm) {
+ *         if (formArray.length == 0) {
+ *             alert('Please enter data.');
+ *             return false;
+ *         }
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Bind form's submit event so that pre-submit callback is invoked before the form
+ *       is submitted.
+ *
+ *
+ * @name   ajaxForm
+ * @param  options  object literal containing options which control the form submission process
+ * @return jQuery
+ * @cat    Plugins/Form
+ * @type   jQuery
+ */
+$.fn.ajaxForm = function(options) {
+    return this.ajaxFormUnbind().submit(submitHandler).each(function() {
+        // store options in hash
+        this.formPluginId = $.fn.ajaxForm.counter++;
+        $.fn.ajaxForm.optionHash[this.formPluginId] = options;
+        $(":submit,input:image", this).click(clickHandler);
+    });
+};
+
+$.fn.ajaxForm.counter = 1;
+$.fn.ajaxForm.optionHash = {};
+
+function clickHandler(e) {
+    var $form = this.form;
+    $form.clk = this;
+    if (this.type == 'image') {
+        if (e.offsetX != undefined) {
+            $form.clk_x = e.offsetX;
+            $form.clk_y = e.offsetY;
+        } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
+            var offset = $(this).offset();
+            $form.clk_x = e.pageX - offset.left;
+            $form.clk_y = e.pageY - offset.top;
+        } else {
+            $form.clk_x = e.pageX - this.offsetLeft;
+            $form.clk_y = e.pageY - this.offsetTop;
+        }
+    }
+    // clear form vars
+    setTimeout(function() { $form.clk = $form.clk_x = $form.clk_y = null; }, 10);
+};
+
+function submitHandler() {
+    // retrieve options from hash
+    var id = this.formPluginId;
+    var options = $.fn.ajaxForm.optionHash[id];
+    $(this).ajaxSubmit(options);
+    return false;
+};
+
+/**
+ * ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
+ *
+ * @name   ajaxFormUnbind
+ * @return jQuery
+ * @cat    Plugins/Form
+ * @type   jQuery
+ */
+$.fn.ajaxFormUnbind = function() {
+    this.unbind('submit', submitHandler);
+    return this.each(function() {
+        $(":submit,input:image", this).unbind('click', clickHandler);
+    });
+
+};
+
+/**
+ * formToArray() gathers form element data into an array of objects that can
+ * be passed to any of the following ajax functions: $.get, $.post, or load.
+ * Each object in the array has both a 'name' and 'value' property.  An example of
+ * an array for a simple login form might be:
+ *
+ * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * It is this array that is passed to pre-submit callback functions provided to the
+ * ajaxSubmit() and ajaxForm() methods.
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * This is normally true anyway, unless the form contains input elements of type='image'.
+ * If your form must be submitted with name/value pairs in semantic order and your form
+ * contains an input of type='image" then pass true for this arg, otherwise pass false
+ * (or nothing) to avoid the overhead for this logic.
+ *
+ * @example var data = $("#myForm").formToArray();
+ * $.post( "myscript.cgi", data );
+ * @desc Collect all the data from a form and submit it to the server.
+ *
+ * @name formToArray
+ * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
+ * @type Array<Object>
+ * @cat Plugins/Form
+ */
+$.fn.formToArray = function(semantic) {
+    var a = [];
+    if (this.length == 0) return a;
+
+    var form = this[0];
+    var els = semantic ? form.getElementsByTagName('*') : form.elements;
+    if (!els) return a;
+    for(var i=0, max=els.length; i < max; i++) {
+        var el = els[i];
+        var n = el.name;
+        if (!n) continue;
+
+        if (semantic && form.clk && el.type == "image") {
+            // handle image inputs on the fly when semantic == true
+            if(!el.disabled && form.clk == el)
+                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+            continue;
+        }
+
+        var v = $.fieldValue(el, true);
+        if (v && v.constructor == Array) {
+            for(var j=0, jmax=v.length; j < jmax; j++)
+                a.push({name: n, value: v[j]});
+        }
+        else if (v !== null && typeof v != 'undefined')
+            a.push({name: n, value: v});
+    }
+
+    if (!semantic && form.clk) {
+        // input type=='image' are not found in elements array! handle them here
+        var inputs = form.getElementsByTagName("input");
+        for(var i=0, max=inputs.length; i < max; i++) {
+            var input = inputs[i];
+            var n = input.name;
+            if(n && !input.disabled && input.type == "image" && form.clk == input)
+                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+        }
+    }
+    return a;
+};
+
+
+/**
+ * Serializes form data into a 'submittable' string. This method will return a string
+ * in the format: name1=value1&amp;name2=value2
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * If your form must be submitted with name/value pairs in semantic order then pass
+ * true for this arg, otherwise pass false (or nothing) to avoid the overhead for
+ * this logic (which can be significant for very large forms).
+ *
+ * @example var data = $("#myForm").formSerialize();
+ * $.ajax('POST', "myscript.cgi", data);
+ * @desc Collect all the data from a form into a single string
+ *
+ * @name formSerialize
+ * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
+ * @type String
+ * @cat Plugins/Form
+ */
+$.fn.formSerialize = function(semantic) {
+    //hand off to jQuery.param for proper encoding
+    return $.param(this.formToArray(semantic));
+};
+
+
+/**
+ * Serializes all field elements in the jQuery object into a query string.
+ * This method will return a string in the format: name1=value1&amp;name2=value2
+ *
+ * The successful argument controls whether or not serialization is limited to
+ * 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.
+ *
+ * @example var data = $("input").formSerialize();
+ * @desc Collect the data from all successful input elements into a query string
+ *
+ * @example var data = $(":radio").formSerialize();
+ * @desc Collect the data from all successful radio input elements into a query string
+ *
+ * @example var data = $("#myForm :checkbox").formSerialize();
+ * @desc Collect the data from all successful checkbox input elements in myForm into a query string
+ *
+ * @example var data = $("#myForm :checkbox").formSerialize(false);
+ * @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string
+ *
+ * @example var data = $(":input").formSerialize();
+ * @desc Collect the data from all successful input, select, textarea and button elements into a query string
+ *
+ * @name fieldSerialize
+ * @param successful true if only successful controls should be serialized (default is true)
+ * @type String
+ * @cat Plugins/Form
+ */
+$.fn.fieldSerialize = function(successful) {
+    var a = [];
+    this.each(function() {
+        var n = this.name;
+        if (!n) return;
+        var v = $.fieldValue(this, successful);
+        if (v && v.constructor == Array) {
+            for (var i=0,max=v.length; i < max; i++)
+                a.push({name: n, value: v[i]});
+        }
+        else if (v !== null && typeof v != 'undefined')
+            a.push({name: this.name, value: v});
+    });
+    //hand off to jQuery.param for proper encoding
+    return $.param(a);
+};
+
+
+/**
+ * Returns the value(s) of the element in the matched set.  For example, consider the following form:
+ *
+ *  <form><fieldset>
+ *      <input name="A" type="text" />
+ *      <input name="A" type="text" />
+ *      <input name="B" type="checkbox" value="B1" />
+ *      <input name="B" type="checkbox" value="B2"/>
+ *      <input name="C" type="radio" value="C1" />
+ *      <input name="C" type="radio" value="C2" />
+ *  </fieldset></form>
+ *
+ *  var v = $(':text').fieldValue();
+ *  // if no values are entered into the text inputs
+ *  v == ['','']
+ *  // if values entered into the text inputs are 'foo' and 'bar'
+ *  v == ['foo','bar']
+ *
+ *  var v = $(':checkbox').fieldValue();
+ *  // if neither checkbox is checked
+ *  v === undefined
+ *  // if both checkboxes are checked
+ *  v == ['B1', 'B2']
+ *
+ *  var v = $(':radio').fieldValue();
+ *  // if neither radio is checked
+ *  v === undefined
+ *  // if first radio is checked
+ *  v == ['C1']
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.  If this value is false the value(s)
+ * for each element is returned.
+ *
+ * Note: This method *always* returns an array.  If no valid value can be determined the
+ *       array will be empty, otherwise it will contain one or more values.
+ *
+ * @example var data = $("#myPasswordElement").fieldValue();
+ * alert(data[0]);
+ * @desc Alerts the current value of the myPasswordElement element
+ *
+ * @example var data = $("#myForm :input").fieldValue();
+ * @desc Get the value(s) of the form elements in myForm
+ *
+ * @example var data = $("#myForm :checkbox").fieldValue();
+ * @desc Get the value(s) for the successful checkbox element(s) in the jQuery object.
+ *
+ * @example var data = $("#mySingleSelect").fieldValue();
+ * @desc Get the value(s) of the select control
+ *
+ * @example var data = $(':text').fieldValue();
+ * @desc Get the value(s) of the text input or textarea elements
+ *
+ * @example var data = $("#myMultiSelect").fieldValue();
+ * @desc Get the values for the select-multiple control
+ *
+ * @name fieldValue
+ * @param Boolean successful true if only the values for successful controls should be returned (default is true)
+ * @type Array<String>
+ * @cat Plugins/Form
+ */
+$.fn.fieldValue = function(successful) {
+    for (var val=[], i=0, max=this.length; i < max; i++) {
+        var el = this[i];
+        var v = $.fieldValue(el, successful);
+        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
+            continue;
+        v.constructor == Array ? $.merge(val, v) : val.push(v);
+    }
+    return val;
+};
+
+/**
+ * Returns the value of the field element.
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.  If the given element is not
+ * successful and the successful arg is not false then the returned value will be null.
+ *
+ * Note: If the successful flag is true (default) but the element is not successful, the return will be null
+ * Note: The value returned for a successful select-multiple element will always be an array.
+ * Note: If the element has no value the return value will be undefined.
+ *
+ * @example var data = jQuery.fieldValue($("#myPasswordElement")[0]);
+ * @desc Gets the current value of the myPasswordElement element
+ *
+ * @name fieldValue
+ * @param Element el The DOM element for which the value will be returned
+ * @param Boolean successful true if value returned must be for a successful controls (default is true)
+ * @type String or Array<String> or null or undefined
+ * @cat Plugins/Form
+ */
+$.fieldValue = function(el, successful) {
+    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
+    if (typeof successful == 'undefined') successful = true;
+
+    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
+        (t == 'checkbox' || t == 'radio') && !el.checked ||
+        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
+        tag == 'select' && el.selectedIndex == -1))
+            return null;
+
+    if (tag == 'select') {
+        var index = el.selectedIndex;
+        if (index < 0) return null;
+        var a = [], ops = el.options;
+        var one = (t == 'select-one');
+        var max = (one ? index+1 : ops.length);
+        for(var i=(one ? index : 0); i < max; i++) {
+            var op = ops[i];
+            if (op.selected) {
+                // extra pain for IE...
+                var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
+                if (one) return v;
+                a.push(v);
+            }
+        }
+        return a;
+    }
+    return el.value;
+};
+
+
+/**
+ * Clears the form data.  Takes the following actions on the form's input fields:
+ *  - input text fields will have their 'value' property set to the empty string
+ *  - select elements will have their 'selectedIndex' property set to -1
+ *  - checkbox and radio inputs will have their 'checked' property set to false
+ *  - inputs of type submit, button, reset, and hidden will *not* be effected
+ *  - button elements will *not* be effected
+ *
+ * @example $('form').clearForm();
+ * @desc Clears all forms on the page.
+ *
+ * @name clearForm
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.clearForm = function() {
+    return this.each(function() {
+        $('input,select,textarea', this).clearFields();
+    });
+};
+
+/**
+ * Clears the selected form elements.  Takes the following actions on the matched elements:
+ *  - input text fields will have their 'value' property set to the empty string
+ *  - select elements will have their 'selectedIndex' property set to -1
+ *  - checkbox and radio inputs will have their 'checked' property set to false
+ *  - inputs of type submit, button, reset, and hidden will *not* be effected
+ *  - button elements will *not* be effected
+ *
+ * @example $('.myInputs').clearFields();
+ * @desc Clears all inputs with class myInputs
+ *
+ * @name clearFields
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.clearFields = $.fn.clearInputs = function() {
+    return this.each(function() {
+        var t = this.type, tag = this.tagName.toLowerCase();
+        if (t == 'text' || t == 'password' || tag == 'textarea')
+            this.value = '';
+        else if (t == 'checkbox' || t == 'radio')
+            this.checked = false;
+        else if (tag == 'select')
+            this.selectedIndex = -1;
+    });
+};
+
+
+/**
+ * Resets the form data.  Causes all form elements to be reset to their original value.
+ *
+ * @example $('form').resetForm();
+ * @desc Resets all forms on the page.
+ *
+ * @name resetForm
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.resetForm = function() {
+    return this.each(function() {
+        // guard against an input with the name of 'reset'
+        // note that IE reports the reset function as an 'object'
+        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
+            this.reset();
+    });
+};
+
+})(jQuery);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/support/javascript/hsbook.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,95 @@
+function qid(id) {
+  return id.replace(/([.:])/g, "\\$1");
+}
+
+function beforeComment(formData, jqForm, options) {
+  var form = jqForm[0];
+  if (!form.comment.value) {
+    $(options.target + " span.comment_error").empty().append(
+      "<span class=\"comment_error\">Your comment is empty</span>");
+    return false;
+  }
+  if (!form.name.value) {
+    $(options.target + " span.comment_error").empty().append(
+      "<span class=\"comment_error\">Please provide a name</span>");
+    return false;
+  }
+  $(options.target + " span.comment_error").empty().after(
+    "<img src=\"/support/icons/throbber.gif\" style=\"vertical-align: middle\"/>");
+  $(options.target + " input[@name=submit]").attr("disabled", true);
+}
+
+function ajaxifyForm(id) {
+  var q = qid(id);
+  
+  $("#form_" + q).ajaxForm({ beforeSubmit: beforeComment,
+			     success: function() { ajaxifyForm(id); },
+			     target: "#comments_" + q });
+}
+
+function toggleComment(id) {
+  $("#toggle_" + qid(id)).nextAll().toggle();
+  return false;
+}
+
+function loadComments(id) {
+  $("#comments_" + qid(id)).load(location.protocol + "//" + location.host +
+				 "/comments/single/" + id + "/", function() {
+    ajaxifyForm(id);
+  });
+  return false;
+}
+
+function loadAllComments() {
+  $("a.commenttoggle").each(function() {
+    var id = $(this).attr("pid");
+    if (id) {
+      loadComments(id);
+    }
+  });
+}
+
+$(document).ready(function() {
+  function loading(id) {
+    return " <span id=\"comments_" + id + "\" class=\"comment\">" +
+      "<span pid=\"" + id + "\" class=\"commenttoggle\">Loading..." +
+      "</span></span>";
+  }
+  $("div.toc>p")
+    .after("<p style='display: none;'><a onclick='return loadAllComments()'>" +
+	   "Load all comments (<b>slow</b>)</a></p>")
+    .toggle(function() { $(this).nextAll().show("normal"); },
+	    function() { $(this).nextAll().hide("normal"); })
+    .hover(function() { $(this).fadeTo("normal", 0.8); },
+	   function() { $(this).fadeTo("normal", 0.35); });
+  $(".chapter p[@id]").each(function() {
+    $(this).append(loading($(this).attr("id")));
+  });
+  $(".chapter table[@id].equation").each(function() {
+    id = $(this).attr("id");
+    $("#" + id + " tr").after('<tr><td colspan="4">' + loading($(this).attr("id")) + '</td></tr>');
+  });
+  $(".chapter pre[@id]").each(function() {
+    $(this).after(loading($(this).attr("id")));
+  });
+  var chapid = $("div.preface, div.chapter, div.appendix, div.bibliography").attr("id");
+  $("#chapterfeed").attr("href",
+			 $("#chapterfeed").attr("href") + chapid + "/");
+  $.getJSON(location.protocol + "//" + location.host + "/comments/chapter/" +
+	    chapid + "/count/", function(data) {
+    $.each(data, function(id, item) {
+      var s = item == 1 ? "" : "s";
+      $("#comments_" + qid(id) + " span.commenttoggle").replaceWith(
+        "<a class='commenttoggle' id='toggle_" + id + "' " +
+	"pid='" + id + "' " +
+	"onclick='return loadComments(\"" + id + "\")' " +
+	"href='comments: show / hide'>" + item + " comment" + s + "</a>");
+    });
+    $("span.commenttoggle").each(function() {
+      var id = $(this).attr("pid");
+      $(this).replaceWith("<a class='commenttoggle' id='toggle_" + id + "' " +
+			  "onclick='return loadComments(\"" + id + "\")' " +
+			  "href='comment: add'>No comments</a>");
+    });
+  });
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/support/javascript/jquery-min.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,31 @@
+/*
+ * jQuery 1.2.1 - New Wave Javascript
+ *
+ * Copyright (c) 2007 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
+ * $Rev: 3353 $
+ */
+(function(){if(typeof jQuery!="undefined")var _jQuery=jQuery;var jQuery=window.jQuery=function(selector,context){return this instanceof jQuery?this.init(selector,context):new jQuery(selector,context);};if(typeof $!="undefined")var _$=$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(typeof selector=="string"){var m=quickExpr.exec(selector);if(m&&(m[1]||!context)){if(m[1])selector=jQuery.clean([m[1]],context);else{var tmp=document.getElementById(m[3]);if(tmp)if(tmp.id!=m[3])return jQuery().find(selector);else{this[0]=tmp;this.length=1;return this;}else
+selector=[];}}else
+return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.1",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(a){var ret=jQuery(a);ret.prevObject=this;return ret;},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this;},each:function(fn,args){return jQuery.each(this,fn,args);},index:function(obj){var pos=-1;this.each(function(i){if(this==obj)pos=i;});return pos;},attr:function(key,value,type){var obj=key;if(key.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],key)||undefined;else{obj={};obj[key]=value;}return this.each(function(index){for(var prop in obj)jQuery.attr(type?this.style:this,prop,jQuery.prop(this,obj[prop],type,index,prop));});},css:function(key,value){return this.attr(key,value,"curCSS");},text:function(e){if(typeof e!="object"&&e!=null)return this.empty().append(document.createTextNode(e));var t="";jQuery.each(e||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)t+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return t;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,1,function(a){this.appendChild(a);});},prepend:function(){return this.domManip(arguments,true,-1,function(a){this.insertBefore(a,this.firstChild);});},before:function(){return this.domManip(arguments,false,1,function(a){this.parentNode.insertBefore(a,this);});},after:function(){return this.domManip(arguments,false,-1,function(a){this.parentNode.insertBefore(a,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(t){var data=jQuery.map(this,function(a){return jQuery.find(t,a);});return this.pushStack(/[^+>] [^+>]/.test(t)||t.indexOf("..")>-1?jQuery.unique(data):data);},clone:function(events){var ret=this.map(function(){return this.outerHTML?jQuery(this.outerHTML)[0]:this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(t){return this.pushStack(jQuery.isFunction(t)&&jQuery.grep(this,function(el,index){return t.apply(el,[index]);})||jQuery.multiFilter(t,this));},not:function(t){return this.pushStack(t.constructor==String&&jQuery.multiFilter(t,this,true)||jQuery.grep(this,function(a){return(t.constructor==Array||t.jquery)?jQuery.inArray(a,t)<0:a!=t;}));},add:function(t){return this.pushStack(jQuery.merge(this.get(),t.constructor==String?jQuery(t).get():t.length!=undefined&&(!t.nodeName||jQuery.nodeName(t,"form"))?t:[t]));},is:function(expr){return expr?jQuery.multiFilter(expr,this).length>0:false;},hasClass:function(expr){return this.is("."+expr);},val:function(val){if(val==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,a=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){var val=jQuery.browser.msie&&!option.attributes["value"].specified?option.text:option.value;if(one)return val;a.push(val);}}return a;}else
+return this[0].value.replace(/\r/g,"");}}else
+return this.each(function(){if(val.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,val)>=0||jQuery.inArray(this.name,val)>=0);else if(jQuery.nodeName(this,"select")){var tmp=val.constructor==Array?val:[val];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,tmp)>=0||jQuery.inArray(this.text,tmp)>=0);});if(!tmp.length)this.selectedIndex=-1;}else
+this.value=val;});},html:function(val){return val==undefined?(this.length?this[0].innerHTML:null):this.empty().append(val);},replaceWith:function(val){return this.after(val).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(fn){return this.pushStack(jQuery.map(this,function(elem,i){return fn.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},domManip:function(args,table,dir,fn){var clone=this.length>1,a;return this.each(function(){if(!a){a=jQuery.clean(args,this.ownerDocument);if(dir<0)a.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(a[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(document.createElement("tbody"));jQuery.each(a,function(){var elem=clone?this.cloneNode(true):this;if(!evalScript(0,elem))fn.call(obj,elem);});});}};function evalScript(i,elem){var script=jQuery.nodeName(elem,"script");if(script){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
+jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}else if(elem.nodeType==1)jQuery("script",elem).each(evalScript);return script;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},a=1,al=arguments.length,deep=false;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};}if(al==1){target=this;a=0;}var prop;for(;a<al;a++)if((prop=arguments[a])!=null)for(var i in prop){if(target==prop[i])continue;if(deep&&typeof prop[i]=='object'&&target[i])jQuery.extend(target[i],prop[i]);else if(prop[i]!=undefined)target[i]=prop[i];}return target;};var expando="jQuery"+(new Date()).getTime(),uuid=0,win={};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/function/i.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){if(window.execScript)window.execScript(data);else if(jQuery.browser.safari)window.setTimeout(data,0);else
+eval.call(window,data);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?win:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!=undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?win:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(obj,fn,args){if(args){if(obj.length==undefined)for(var i in obj)fn.apply(obj[i],args);else
+for(var i=0,ol=obj.length;i<ol;i++)if(fn.apply(obj[i],args)===false)break;}else{if(obj.length==undefined)for(var i in obj)fn.call(obj[i],i,obj[i]);else
+for(var i=0,ol=obj.length,val=obj[0];i<ol&&fn.call(val,i,val)!==false;val=obj[++i]){}}return obj;},prop:function(elem,value,type,index,prop){if(jQuery.isFunction(value))value=value.call(elem,[index]);var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i;return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(prop)?value+"px":value;},className:{add:function(elem,c){jQuery.each((c||"").split(/\s+/),function(i,cur){if(!jQuery.className.has(elem.className,cur))elem.className+=(elem.className?" ":"")+cur;});},remove:function(elem,c){elem.className=c!=undefined?jQuery.grep(elem.className.split(/\s+/),function(cur){return!jQuery.className.has(c,cur);}).join(" "):"";},has:function(t,c){return jQuery.inArray(c,(t.className||t).toString().split(/\s+/))>-1;}},swap:function(e,o,f){for(var i in o){e.style["old"+i]=e.style[i];e.style[i]=o[i];}f.apply(e,[]);for(var i in o)e.style[i]=e.style["old"+i];},css:function(e,p){if(p=="height"||p=="width"){var old={},oHeight,oWidth,d=["Top","Bottom","Right","Left"];jQuery.each(d,function(){old["padding"+this]=0;old["border"+this+"Width"]=0;});jQuery.swap(e,old,function(){if(jQuery(e).is(':visible')){oHeight=e.offsetHeight;oWidth=e.offsetWidth;}else{e=jQuery(e.cloneNode(true)).find(":radio").removeAttr("checked").end().css({visibility:"hidden",position:"absolute",display:"block",right:"0",left:"0"}).appendTo(e.parentNode)[0];var parPos=jQuery.css(e.parentNode,"position")||"static";if(parPos=="static")e.parentNode.style.position="relative";oHeight=e.clientHeight;oWidth=e.clientWidth;if(parPos=="static")e.parentNode.style.position="static";e.parentNode.removeChild(e);}});return p=="height"?oHeight:oWidth;}return jQuery.curCSS(e,p);},curCSS:function(elem,prop,force){var ret,stack=[],swap=[];function color(a){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(a,null);return!ret||ret.getPropertyValue("color")=="";}if(prop=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(prop.match(/float/i))prop=styleFloat;if(!force&&elem.style[prop])ret=elem.style[prop];else if(document.defaultView&&document.defaultView.getComputedStyle){if(prop.match(/float/i))prop="float";prop=prop.replace(/([A-Z])/g,"-$1").toLowerCase();var cur=document.defaultView.getComputedStyle(elem,null);if(cur&&!color(elem))ret=cur.getPropertyValue(prop);else{for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(a=0;a<stack.length;a++)if(color(stack[a])){swap[a]=stack[a].style.display;stack[a].style.display="block";}ret=prop=="display"&&swap[stack.length-1]!=null?"none":document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop)||"";for(a=0;a<swap.length;a++)if(swap[a]!=null)stack[a].style.display=swap[a];}if(prop=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var newProp=prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});ret=elem.currentStyle[prop]||elem.currentStyle[newProp];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var style=elem.style.left;var runtimeStyle=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;elem.style.left=ret||0;ret=elem.style.pixelLeft+"px";elem.style.left=style;elem.runtimeStyle.left=runtimeStyle;}}return ret;},clean:function(a,doc){var r=[];doc=doc||document;jQuery.each(a,function(i,arg){if(!arg)return;if(arg.constructor==Number)arg=arg.toString();if(typeof arg=="string"){arg=arg.replace(/(<(\w+)[^>]*?)\/>/g,function(m,all,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)?m:all+"></"+tag+">";});var s=jQuery.trim(arg).toLowerCase(),div=doc.createElement("div"),tb=[];var wrap=!s.indexOf("<opt")&&[1,"<select>","</select>"]||!s.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||s.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!s.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!s.indexOf("<td")||!s.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!s.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+arg+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){if(!s.indexOf("<table")&&s.indexOf("<tbody")<0)tb=div.firstChild&&div.firstChild.childNodes;else if(wrap[1]=="<table>"&&s.indexOf("<tbody")<0)tb=div.childNodes;for(var n=tb.length-1;n>=0;--n)if(jQuery.nodeName(tb[n],"tbody")&&!tb[n].childNodes.length)tb[n].parentNode.removeChild(tb[n]);if(/^\s/.test(arg))div.insertBefore(doc.createTextNode(arg.match(/^\s*/)[0]),div.firstChild);}arg=jQuery.makeArray(div.childNodes);}if(0===arg.length&&(!jQuery.nodeName(arg,"form")&&!jQuery.nodeName(arg,"select")))return;if(arg[0]==undefined||jQuery.nodeName(arg,"form")||arg.options)r.push(arg);else
+r=jQuery.merge(r,arg);});return r;},attr:function(elem,name,value){var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(t){return(t||"").replace(/^\s+|\s+$/g,"");},makeArray:function(a){var r=[];if(typeof a!="array")for(var i=0,al=a.length;i<al;i++)r.push(a[i]);else
+r=a.slice(0);return r;},inArray:function(b,a){for(var i=0,al=a.length;i<al;i++)if(a[i]==b)return i;return-1;},merge:function(first,second){if(jQuery.browser.msie){for(var i=0;second[i];i++)if(second[i].nodeType!=8)first.push(second[i]);}else
+for(var i=0;second[i];i++)first.push(second[i]);return first;},unique:function(first){var r=[],done={};try{for(var i=0,fl=first.length;i<fl;i++){var id=jQuery.data(first[i]);if(!done[id]){done[id]=true;r.push(first[i]);}}}catch(e){r=first;}return r;},grep:function(elems,fn,inv){if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++)if(!inv&&fn(elems[i],i)||inv&&!fn(elems[i],i))result.push(elems[i]);return result;},map:function(elems,fn){if(typeof fn=="string")fn=eval("false||function(a){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++){var val=fn(elems[i],i);if(val!==null&&val!=undefined){if(val.constructor!=Array)val=[val];result=result.concat(val);}}return result;}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",styleFloat:jQuery.browser.msie?"styleFloat":"cssFloat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,innerHTML:"innerHTML",className:"className",value:"value",disabled:"disabled",checked:"checked",readonly:"readOnly",selected:"selected",maxlength:"maxLength"}});jQuery.each({parent:"a.parentNode",parents:"jQuery.dir(a,'parentNode')",next:"jQuery.nth(a,2,'nextSibling')",prev:"jQuery.nth(a,2,'previousSibling')",nextAll:"jQuery.dir(a,'nextSibling')",prevAll:"jQuery.dir(a,'previousSibling')",siblings:"jQuery.sibling(a.parentNode.firstChild,a)",children:"jQuery.sibling(a.firstChild)",contents:"jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"},function(i,n){jQuery.fn[i]=function(a){var ret=jQuery.map(this,n);if(a&&typeof a=="string")ret=jQuery.multiFilter(a,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(i,n){jQuery.fn[i]=function(){var a=arguments;return this.each(function(){for(var j=0,al=a.length;j<al;j++)jQuery(a[j])[n](this);});};});jQuery.each({removeAttr:function(key){jQuery.attr(this,key,"");this.removeAttribute(key);},addClass:function(c){jQuery.className.add(this,c);},removeClass:function(c){jQuery.className.remove(this,c);},toggleClass:function(c){jQuery.className[jQuery.className.has(this,c)?"remove":"add"](this,c);},remove:function(a){if(!a||jQuery.filter(a,[this]).r.length){jQuery.removeData(this);this.parentNode.removeChild(this);}},empty:function(){jQuery("*",this).each(function(){jQuery.removeData(this);});while(this.firstChild)this.removeChild(this.firstChild);}},function(i,n){jQuery.fn[i]=function(){return this.each(n,arguments);};});jQuery.each(["Height","Width"],function(i,name){var n=name.toLowerCase();jQuery.fn[n]=function(h){return this[0]==window?jQuery.browser.safari&&self["inner"+name]||jQuery.boxModel&&Math.max(document.documentElement["client"+name],document.body["client"+name])||document.body["client"+name]:this[0]==document?Math.max(document.body["scroll"+name],document.body["offset"+name]):h==undefined?(this.length?jQuery.css(this[0],n):null):this.css(n,h.constructor==String?h:h+"px");};});var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":"m[2]=='*'||jQuery.nodeName(a,m[2])","#":"a.getAttribute('id')==m[2]",":":{lt:"i<m[3]-0",gt:"i>m[3]-0",nth:"m[3]-0==i",eq:"m[3]-0==i",first:"i==0",last:"i==r.length-1",even:"i%2==0",odd:"i%2","first-child":"a.parentNode.getElementsByTagName('*')[0]==a","last-child":"jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a","only-child":"!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",parent:"a.firstChild",empty:"!a.firstChild",contains:"(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",visible:'"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',hidden:'"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',enabled:"!a.disabled",disabled:"a.disabled",checked:"a.checked",selected:"a.selected||jQuery.attr(a,'selected')",text:"'text'==a.type",radio:"'radio'==a.type",checkbox:"'checkbox'==a.type",file:"'file'==a.type",password:"'password'==a.type",submit:"'submit'==a.type",image:"'image'==a.type",reset:"'reset'==a.type",button:'"button"==a.type||jQuery.nodeName(a,"button")',input:"/input|select|textarea|button/i.test(a.nodeName)",has:"jQuery.find(m[3],a).length",header:"/h\\d/i.test(a.nodeName)",animated:"jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&!context.nodeType)context=null;context=context||document;var ret=[context],done=[],last;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){var nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName.toUpperCase()))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var nodeName=m[2],merge={};m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName.toUpperCase()){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=jQuery.filter(m[3],r,true).r;else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(\d*)n\+?(\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"n+"+m[3]||m[3]),first=(test[1]||1)-0,last=test[2]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==1){if(last==0||node.nodeIndex==last)add=true;}else if((node.nodeIndex+last)%first==0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var f=jQuery.expr[m[1]];if(typeof f!="string")f=jQuery.expr[m[1]][m[2]];f=eval("false||function(a,i){return "+f+"}");r=jQuery.grep(r,f,not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(element,type,handler,data){if(jQuery.browser.msie&&element.setInterval!=undefined)element=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var parts=type.split(".");type=parts[0];handler.type=parts[1];var events=jQuery.data(element,"events")||jQuery.data(element,"events",{});var handle=jQuery.data(element,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(element,arguments);return val;});var handlers=events[type];if(!handlers){handlers=events[type]={};if(element.addEventListener)element.addEventListener(type,handle,false);else
+element.attachEvent("on"+type,handle);}handlers[handler.guid]=handler;this.global[type]=true;},guid:1,global:{},remove:function(element,type,handler){var events=jQuery.data(element,"events"),ret,index;if(typeof type=="string"){var parts=type.split(".");type=parts[0];}if(events){if(type&&type.type){handler=type.handler;type=type.type;}if(!type){for(type in events)this.remove(element,type);}else if(events[type]){if(handler)delete events[type][handler.guid];else
+for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(element.removeEventListener)element.removeEventListener(type,jQuery.data(element,"handle"),false);else
+element.detachEvent("on"+type,jQuery.data(element,"handle"));ret=null;delete events[type];}}for(ret in events)break;if(!ret){jQuery.removeData(element,"events");jQuery.removeData(element,"handle");}}},trigger:function(type,data,element,donative,extra){data=jQuery.makeArray(data||[]);if(!element){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{var val,ret,fn=jQuery.isFunction(element[type]||null),evt=!data[0]||!data[0].preventDefault;if(evt)data.unshift(this.fix({type:type,target:element}));data[0].type=type;if(jQuery.isFunction(jQuery.data(element,"handle")))val=jQuery.data(element,"handle").apply(element,data);if(!fn&&element["on"+type]&&element["on"+type].apply(element,data)===false)val=false;if(evt)data.shift();if(extra&&extra.apply(element,data)===false)val=false;if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(element,'a')&&type=="click")){this.triggered=true;element[type]();}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var c=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in c){args[0].handler=c[j];args[0].data=c[j].data;if(!parts[1]||c[j].type==parts[1]){var tmp=c[j].apply(this,args);if(val!==false)val=tmp;if(tmp===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target&&event.srcElement)event.target=event.srcElement;if(jQuery.browser.safari&&event.target.nodeType==3)event.target=originalEvent.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var e=document.documentElement,b=document.body;event.pageX=event.clientX+(e&&e.scrollLeft||b.scrollLeft||0);event.pageY=event.clientY+(e&&e.scrollTop||b.scrollTop||0);}if(!event.which&&(event.charCode||event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(){var a=arguments;return this.click(function(e){this.lastToggle=0==this.lastToggle?1:0;e.preventDefault();return a[this.lastToggle].apply(this,[e])||false;});},hover:function(f,g){function handleHover(e){var p=e.relatedTarget;while(p&&p!=this)try{p=p.parentNode;}catch(e){p=this;};if(p==this)return false;return(e.type=="mouseover"?f:g).apply(this,[e]);}return this.mouseover(handleHover).mouseout(handleHover);},ready:function(f){bindReady();if(jQuery.isReady)f.apply(document,[jQuery]);else
+jQuery.readyList.push(function(){return f.apply(this,[jQuery]);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}if(jQuery.browser.mozilla||jQuery.browser.opera)document.removeEventListener("DOMContentLoaded",jQuery.ready,false);if(!window.frames.length)jQuery(window).load(function(){jQuery("#__ie_init").remove();});}}});jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,o){jQuery.fn[o]=function(f){return f?this.bind(o,f):this.trigger(o);};});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(jQuery.browser.mozilla||jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);else if(jQuery.browser.msie){document.write("<scr"+"ipt id=__ie_init defer=true "+"src=//:><\/script>");var script=document.getElementById("__ie_init");if(script)script.onreadystatechange=function(){if(this.readyState!="complete")return;jQuery.ready();};script=null;}else if(jQuery.browser.safari)jQuery.safariTimer=setInterval(function(){if(document.readyState=="loaded"||document.readyState=="complete"){clearInterval(jQuery.safariTimer);jQuery.safariTimer=null;jQuery.ready();}},10);jQuery.event.add(window,"load",jQuery.ready);}jQuery.fn.extend({load:function(url,params,callback){if(jQuery.isFunction(url))return this.bind("load",url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);setTimeout(function(){self.each(callback,[res.responseText,status,res]);},13);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null},lastModified:{},ajax:function(s){var jsonp,jsre=/=(\?|%3F)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=s.data.replace(jsre,"="+jsonp);s.url=s.url.replace(jsre,"="+jsonp);s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get")s.url+=(s.url.match(/\?/)?"&":"?")+"_="+(new Date()).getTime();if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if(!s.url.indexOf("http")&&s.dataType=="script"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(!jsonp&&(s.success||s.complete)){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async);if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
+jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();return xml;function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
+for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
+s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock?this.oldblock:"";if(jQuery.css(this,"display")=="none")this.style.display="block";}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");if(this.oldblock=="none")this.oldblock="block";this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var opt=jQuery.speed(speed,easing,callback);return this[opt.queue===false?"each":"queue"](function(){opt=jQuery.extend({},opt);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
+e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(){var timers=jQuery.timers;return this.each(function(){for(var i=0;i<timers.length;i++)if(timers[i].elem==this)timers.splice(i--,1);}).dequeue();}});var queue=function(elem,type,array){if(!elem)return;var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.curCSS(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.css(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(){return self.step();}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timers.length==1){var timer=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length)clearInterval(timer);},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(){var t=(new Date()).getTime();if(t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var absolute=jQuery.css(elem,"position")=="absolute",parent=elem.parentNode,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522;if(elem.getBoundingClientRect){box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));if(msie){var border=jQuery("html").css("borderWidth");border=(border=="medium"||jQuery.boxModel&&parseInt(version)>=7)&&2||border;add(-border,-border);}}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&/^t[d|h]$/i.test(parent.tagName)||!safari2)border(offsetParent);if(safari2&&!absolute&&jQuery.css(offsetParent,"position")=="absolute")absolute=true;offsetParent=offsetParent.offsetParent;}while(parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table-row.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if(safari2&&absolute)add(-doc.body.offsetLeft,-doc.body.offsetTop);}results={top:top,left:left};}return results;function border(elem){add(jQuery.css(elem,"borderLeftWidth"),jQuery.css(elem,"borderTopWidth"));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}};})();
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/support/javascript/jquery.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,2992 @@
+(function(){
+/*
+ * jQuery 1.2.1 - New Wave Javascript
+ *
+ * Copyright (c) 2007 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
+ * $Rev: 3353 $
+ */
+
+// Map over jQuery in case of overwrite
+if ( typeof jQuery != "undefined" )
+	var _jQuery = jQuery;
+
+var jQuery = window.jQuery = function(selector, context) {
+	// If the context is a namespace object, return a new object
+	return this instanceof jQuery ?
+		this.init(selector, context) :
+		new jQuery(selector, context);
+};
+
+// Map over the $ in case of overwrite
+if ( typeof $ != "undefined" )
+	var _$ = $;
+	
+// Map the jQuery namespace to the '$' one
+window.$ = jQuery;
+
+var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;
+
+jQuery.fn = jQuery.prototype = {
+	init: function(selector, context) {
+		// Make sure that a selection was provided
+		selector = selector || document;
+
+		// Handle HTML strings
+		if ( typeof selector  == "string" ) {
+			var m = quickExpr.exec(selector);
+			if ( m && (m[1] || !context) ) {
+				// HANDLE: $(html) -> $(array)
+				if ( m[1] )
+					selector = jQuery.clean( [ m[1] ], context );
+
+				// HANDLE: $("#id")
+				else {
+					var tmp = document.getElementById( m[3] );
+					if ( tmp )
+						// Handle the case where IE and Opera return items
+						// by name instead of ID
+						if ( tmp.id != m[3] )
+							return jQuery().find( selector );
+						else {
+							this[0] = tmp;
+							this.length = 1;
+							return this;
+						}
+					else
+						selector = [];
+				}
+
+			// HANDLE: $(expr)
+			} else
+				return new jQuery( context ).find( selector );
+
+		// HANDLE: $(function)
+		// Shortcut for document ready
+		} else if ( jQuery.isFunction(selector) )
+			return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( selector );
+
+		return this.setArray(
+			// HANDLE: $(array)
+			selector.constructor == Array && selector ||
+
+			// HANDLE: $(arraylike)
+			// Watch for when an array-like object is passed as the selector
+			(selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) ||
+
+			// HANDLE: $(*)
+			[ selector ] );
+	},
+	
+	jquery: "1.2.1",
+
+	size: function() {
+		return this.length;
+	},
+	
+	length: 0,
+
+	get: function( num ) {
+		return num == undefined ?
+
+			// Return a 'clean' array
+			jQuery.makeArray( this ) :
+
+			// Return just the object
+			this[num];
+	},
+	
+	pushStack: function( a ) {
+		var ret = jQuery(a);
+		ret.prevObject = this;
+		return ret;
+	},
+	
+	setArray: function( a ) {
+		this.length = 0;
+		Array.prototype.push.apply( this, a );
+		return this;
+	},
+
+	each: function( fn, args ) {
+		return jQuery.each( this, fn, args );
+	},
+
+	index: function( obj ) {
+		var pos = -1;
+		this.each(function(i){
+			if ( this == obj ) pos = i;
+		});
+		return pos;
+	},
+
+	attr: function( key, value, type ) {
+		var obj = key;
+		
+		// Look for the case where we're accessing a style value
+		if ( key.constructor == String )
+			if ( value == undefined )
+				return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined;
+			else {
+				obj = {};
+				obj[ key ] = value;
+			}
+		
+		// Check to see if we're setting style values
+		return this.each(function(index){
+			// Set all the styles
+			for ( var prop in obj )
+				jQuery.attr(
+					type ? this.style : this,
+					prop, jQuery.prop(this, obj[prop], type, index, prop)
+				);
+		});
+	},
+
+	css: function( key, value ) {
+		return this.attr( key, value, "curCSS" );
+	},
+
+	text: function(e) {
+		if ( typeof e != "object" && e != null )
+			return this.empty().append( document.createTextNode( e ) );
+
+		var t = "";
+		jQuery.each( e || this, function(){
+			jQuery.each( this.childNodes, function(){
+				if ( this.nodeType != 8 )
+					t += this.nodeType != 1 ?
+						this.nodeValue : jQuery.fn.text([ this ]);
+			});
+		});
+		return t;
+	},
+
+	wrapAll: function(html) {
+		if ( this[0] )
+			// The elements to wrap the target around
+			jQuery(html, this[0].ownerDocument)
+				.clone()
+				.insertBefore(this[0])
+				.map(function(){
+					var elem = this;
+					while ( elem.firstChild )
+						elem = elem.firstChild;
+					return elem;
+				})
+				.append(this);
+
+		return this;
+	},
+
+	wrapInner: function(html) {
+		return this.each(function(){
+			jQuery(this).contents().wrapAll(html);
+		});
+	},
+
+	wrap: function(html) {
+		return this.each(function(){
+			jQuery(this).wrapAll(html);
+		});
+	},
+
+	append: function() {
+		return this.domManip(arguments, true, 1, function(a){
+			this.appendChild( a );
+		});
+	},
+
+	prepend: function() {
+		return this.domManip(arguments, true, -1, function(a){
+			this.insertBefore( a, this.firstChild );
+		});
+	},
+	
+	before: function() {
+		return this.domManip(arguments, false, 1, function(a){
+			this.parentNode.insertBefore( a, this );
+		});
+	},
+
+	after: function() {
+		return this.domManip(arguments, false, -1, function(a){
+			this.parentNode.insertBefore( a, this.nextSibling );
+		});
+	},
+
+	end: function() {
+		return this.prevObject || jQuery([]);
+	},
+
+	find: function(t) {
+		var data = jQuery.map(this, function(a){ return jQuery.find(t,a); });
+		return this.pushStack( /[^+>] [^+>]/.test( t ) || t.indexOf("..") > -1 ?
+			jQuery.unique( data ) : data );
+	},
+
+	clone: function(events) {
+		// Do the clone
+		var ret = this.map(function(){
+			return this.outerHTML ? jQuery(this.outerHTML)[0] : this.cloneNode(true);
+		});
+
+		// Need to set the expando to null on the cloned set if it exists
+		// removeData doesn't work here, IE removes it from the original as well
+		// this is primarily for IE but the data expando shouldn't be copied over in any browser
+		var clone = ret.find("*").andSelf().each(function(){
+			if ( this[ expando ] != undefined )
+				this[ expando ] = null;
+		});
+		
+		// Copy the events from the original to the clone
+		if (events === true)
+			this.find("*").andSelf().each(function(i) {
+				var events = jQuery.data(this, "events");
+				for ( var type in events )
+					for ( var handler in events[type] )
+						jQuery.event.add(clone[i], type, events[type][handler], events[type][handler].data);
+			});
+
+		// Return the cloned set
+		return ret;
+	},
+
+	filter: function(t) {
+		return this.pushStack(
+			jQuery.isFunction( t ) &&
+			jQuery.grep(this, function(el, index){
+				return t.apply(el, [index]);
+			}) ||
+
+			jQuery.multiFilter(t,this) );
+	},
+
+	not: function(t) {
+		return this.pushStack(
+			t.constructor == String &&
+			jQuery.multiFilter(t, this, true) ||
+
+			jQuery.grep(this, function(a) {
+				return ( t.constructor == Array || t.jquery )
+					? jQuery.inArray( a, t ) < 0
+					: a != t;
+			})
+		);
+	},
+
+	add: function(t) {
+		return this.pushStack( jQuery.merge(
+			this.get(),
+			t.constructor == String ?
+				jQuery(t).get() :
+				t.length != undefined && (!t.nodeName || jQuery.nodeName(t, "form")) ?
+					t : [t] )
+		);
+	},
+
+	is: function(expr) {
+		return expr ? jQuery.multiFilter(expr,this).length > 0 : false;
+	},
+
+	hasClass: function(expr) {
+		return this.is("." + expr);
+	},
+	
+	val: function( val ) {
+		if ( val == undefined ) {
+			if ( this.length ) {
+				var elem = this[0];
+		    	
+				// We need to handle select boxes special
+				if ( jQuery.nodeName(elem, "select") ) {
+					var index = elem.selectedIndex,
+						a = [],
+						options = elem.options,
+						one = elem.type == "select-one";
+					
+					// Nothing was selected
+					if ( index < 0 )
+						return null;
+
+					// Loop through all the selected options
+					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+						var option = options[i];
+						if ( option.selected ) {
+							// Get the specifc value for the option
+							var val = jQuery.browser.msie && !option.attributes["value"].specified ? option.text : option.value;
+							
+							// We don't need an array for one selects
+							if ( one )
+								return val;
+							
+							// Multi-Selects return an array
+							a.push(val);
+						}
+					}
+					
+					return a;
+					
+				// Everything else, we just grab the value
+				} else
+					return this[0].value.replace(/\r/g, "");
+			}
+		} else
+			return this.each(function(){
+				if ( val.constructor == Array && /radio|checkbox/.test(this.type) )
+					this.checked = (jQuery.inArray(this.value, val) >= 0 ||
+						jQuery.inArray(this.name, val) >= 0);
+				else if ( jQuery.nodeName(this, "select") ) {
+					var tmp = val.constructor == Array ? val : [val];
+
+					jQuery("option", this).each(function(){
+						this.selected = (jQuery.inArray(this.value, tmp) >= 0 ||
+						jQuery.inArray(this.text, tmp) >= 0);
+					});
+
+					if ( !tmp.length )
+						this.selectedIndex = -1;
+				} else
+					this.value = val;
+			});
+	},
+	
+	html: function( val ) {
+		return val == undefined ?
+			( this.length ? this[0].innerHTML : null ) :
+			this.empty().append( val );
+	},
+
+	replaceWith: function( val ) {
+		return this.after( val ).remove();
+	},
+
+	eq: function(i){
+		return this.slice(i, i+1);
+	},
+
+	slice: function() {
+		return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
+	},
+
+	map: function(fn) {
+		return this.pushStack(jQuery.map( this, function(elem,i){
+			return fn.call( elem, i, elem );
+		}));
+	},
+
+	andSelf: function() {
+		return this.add( this.prevObject );
+	},
+	
+	domManip: function(args, table, dir, fn) {
+		var clone = this.length > 1, a; 
+
+		return this.each(function(){
+			if ( !a ) {
+				a = jQuery.clean(args, this.ownerDocument);
+				if ( dir < 0 )
+					a.reverse();
+			}
+
+			var obj = this;
+
+			if ( table && jQuery.nodeName(this, "table") && jQuery.nodeName(a[0], "tr") )
+				obj = this.getElementsByTagName("tbody")[0] || this.appendChild(document.createElement("tbody"));
+
+			jQuery.each( a, function(){
+				var elem = clone ? this.cloneNode(true) : this;
+				if ( !evalScript(0, elem) )
+					fn.call( obj, elem );
+			});
+		});
+	}
+};
+
+function evalScript(i, elem){
+	var script = jQuery.nodeName(elem, "script");
+
+	if ( script ) {
+		if ( elem.src )
+			jQuery.ajax({ url: elem.src, async: false, dataType: "script" });
+		else
+			jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
+	
+		if ( elem.parentNode )
+			elem.parentNode.removeChild(elem);
+
+	} else if ( elem.nodeType == 1 )
+    jQuery("script", elem).each(evalScript);
+
+	return script;
+}
+
+jQuery.extend = jQuery.fn.extend = function() {
+	// copy reference to target object
+	var target = arguments[0] || {}, a = 1, al = arguments.length, deep = false;
+
+	// Handle a deep copy situation
+	if ( target.constructor == Boolean ) {
+		deep = target;
+		target = arguments[1] || {};
+	}
+
+	// extend jQuery itself if only one argument is passed
+	if ( al == 1 ) {
+		target = this;
+		a = 0;
+	}
+
+	var prop;
+
+	for ( ; a < al; a++ )
+		// Only deal with non-null/undefined values
+		if ( (prop = arguments[a]) != null )
+			// Extend the base object
+			for ( var i in prop ) {
+				// Prevent never-ending loop
+				if ( target == prop[i] )
+					continue;
+
+				// Recurse if we're merging object values
+				if ( deep && typeof prop[i] == 'object' && target[i] )
+					jQuery.extend( target[i], prop[i] );
+
+				// Don't bring in undefined values
+				else if ( prop[i] != undefined )
+					target[i] = prop[i];
+			}
+
+	// Return the modified object
+	return target;
+};
+
+var expando = "jQuery" + (new Date()).getTime(), uuid = 0, win = {};
+
+jQuery.extend({
+	noConflict: function(deep) {
+		window.$ = _$;
+		if ( deep )
+			window.jQuery = _jQuery;
+		return jQuery;
+	},
+
+	// This may seem like some crazy code, but trust me when I say that this
+	// is the only cross-browser way to do this. --John
+	isFunction: function( fn ) {
+		return !!fn && typeof fn != "string" && !fn.nodeName && 
+			fn.constructor != Array && /function/i.test( fn + "" );
+	},
+	
+	// check if an element is in a XML document
+	isXMLDoc: function(elem) {
+		return elem.documentElement && !elem.body ||
+			elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
+	},
+
+	// Evalulates a script in a global context
+	// Evaluates Async. in Safari 2 :-(
+	globalEval: function( data ) {
+		data = jQuery.trim( data );
+		if ( data ) {
+			if ( window.execScript )
+				window.execScript( data );
+			else if ( jQuery.browser.safari )
+				// safari doesn't provide a synchronous global eval
+				window.setTimeout( data, 0 );
+			else
+				eval.call( window, data );
+		}
+	},
+
+	nodeName: function( elem, name ) {
+		return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
+	},
+	
+	cache: {},
+	
+	data: function( elem, name, data ) {
+		elem = elem == window ? win : elem;
+
+		var id = elem[ expando ];
+
+		// Compute a unique ID for the element
+		if ( !id ) 
+			id = elem[ expando ] = ++uuid;
+
+		// Only generate the data cache if we're
+		// trying to access or manipulate it
+		if ( name && !jQuery.cache[ id ] )
+			jQuery.cache[ id ] = {};
+		
+		// Prevent overriding the named cache with undefined values
+		if ( data != undefined )
+			jQuery.cache[ id ][ name ] = data;
+		
+		// Return the named cache data, or the ID for the element	
+		return name ? jQuery.cache[ id ][ name ] : id;
+	},
+	
+	removeData: function( elem, name ) {
+		elem = elem == window ? win : elem;
+
+		var id = elem[ expando ];
+
+		// If we want to remove a specific section of the element's data
+		if ( name ) {
+			if ( jQuery.cache[ id ] ) {
+				// Remove the section of cache data
+				delete jQuery.cache[ id ][ name ];
+
+				// If we've removed all the data, remove the element's cache
+				name = "";
+				for ( name in jQuery.cache[ id ] ) break;
+				if ( !name )
+					jQuery.removeData( elem );
+			}
+
+		// Otherwise, we want to remove all of the element's data
+		} else {
+			// Clean up the element expando
+			try {
+				delete elem[ expando ];
+			} catch(e){
+				// IE has trouble directly removing the expando
+				// but it's ok with using removeAttribute
+				if ( elem.removeAttribute )
+					elem.removeAttribute( expando );
+			}
+
+			// Completely remove the data cache
+			delete jQuery.cache[ id ];
+		}
+	},
+
+	// args is for internal usage only
+	each: function( obj, fn, args ) {
+		if ( args ) {
+			if ( obj.length == undefined )
+				for ( var i in obj )
+					fn.apply( obj[i], args );
+			else
+				for ( var i = 0, ol = obj.length; i < ol; i++ )
+					if ( fn.apply( obj[i], args ) === false ) break;
+
+		// A special, fast, case for the most common use of each
+		} else {
+			if ( obj.length == undefined )
+				for ( var i in obj )
+					fn.call( obj[i], i, obj[i] );
+			else
+				for ( var i = 0, ol = obj.length, val = obj[0]; 
+					i < ol && fn.call(val,i,val) !== false; val = obj[++i] ){}
+		}
+
+		return obj;
+	},
+	
+	prop: function(elem, value, type, index, prop){
+			// Handle executable functions
+			if ( jQuery.isFunction( value ) )
+				value = value.call( elem, [index] );
+				
+			// exclude the following css properties to add px
+			var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
+
+			// Handle passing in a number to a CSS property
+			return value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) ?
+				value + "px" :
+				value;
+	},
+
+	className: {
+		// internal only, use addClass("class")
+		add: function( elem, c ){
+			jQuery.each( (c || "").split(/\s+/), function(i, cur){
+				if ( !jQuery.className.has( elem.className, cur ) )
+					elem.className += ( elem.className ? " " : "" ) + cur;
+			});
+		},
+
+		// internal only, use removeClass("class")
+		remove: function( elem, c ){
+			elem.className = c != undefined ?
+				jQuery.grep( elem.className.split(/\s+/), function(cur){
+					return !jQuery.className.has( c, cur );	
+				}).join(" ") : "";
+		},
+
+		// internal only, use is(".class")
+		has: function( t, c ) {
+			return jQuery.inArray( c, (t.className || t).toString().split(/\s+/) ) > -1;
+		}
+	},
+
+	swap: function(e,o,f) {
+		for ( var i in o ) {
+			e.style["old"+i] = e.style[i];
+			e.style[i] = o[i];
+		}
+		f.apply( e, [] );
+		for ( var i in o )
+			e.style[i] = e.style["old"+i];
+	},
+
+	css: function(e,p) {
+		if ( p == "height" || p == "width" ) {
+			var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"];
+
+			jQuery.each( d, function(){
+				old["padding" + this] = 0;
+				old["border" + this + "Width"] = 0;
+			});
+
+			jQuery.swap( e, old, function() {
+				if ( jQuery(e).is(':visible') ) {
+					oHeight = e.offsetHeight;
+					oWidth = e.offsetWidth;
+				} else {
+					e = jQuery(e.cloneNode(true))
+						.find(":radio").removeAttr("checked").end()
+						.css({
+							visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0"
+						}).appendTo(e.parentNode)[0];
+
+					var parPos = jQuery.css(e.parentNode,"position") || "static";
+					if ( parPos == "static" )
+						e.parentNode.style.position = "relative";
+
+					oHeight = e.clientHeight;
+					oWidth = e.clientWidth;
+
+					if ( parPos == "static" )
+						e.parentNode.style.position = "static";
+
+					e.parentNode.removeChild(e);
+				}
+			});
+
+			return p == "height" ? oHeight : oWidth;
+		}
+
+		return jQuery.curCSS( e, p );
+	},
+
+	curCSS: function(elem, prop, force) {
+		var ret, stack = [], swap = [];
+
+		// A helper method for determining if an element's values are broken
+		function color(a){
+			if ( !jQuery.browser.safari )
+				return false;
+
+			var ret = document.defaultView.getComputedStyle(a,null);
+			return !ret || ret.getPropertyValue("color") == "";
+		}
+
+		if (prop == "opacity" && jQuery.browser.msie) {
+			ret = jQuery.attr(elem.style, "opacity");
+			return ret == "" ? "1" : ret;
+		}
+		
+		if (prop.match(/float/i))
+			prop = styleFloat;
+
+		if (!force && elem.style[prop])
+			ret = elem.style[prop];
+
+		else if (document.defaultView && document.defaultView.getComputedStyle) {
+
+			if (prop.match(/float/i))
+				prop = "float";
+
+			prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase();
+			var cur = document.defaultView.getComputedStyle(elem, null);
+
+			if ( cur && !color(elem) )
+				ret = cur.getPropertyValue(prop);
+
+			// If the element isn't reporting its values properly in Safari
+			// then some display: none elements are involved
+			else {
+				// Locate all of the parent display: none elements
+				for ( var a = elem; a && color(a); a = a.parentNode )
+					stack.unshift(a);
+
+				// Go through and make them visible, but in reverse
+				// (It would be better if we knew the exact display type that they had)
+				for ( a = 0; a < stack.length; a++ )
+					if ( color(stack[a]) ) {
+						swap[a] = stack[a].style.display;
+						stack[a].style.display = "block";
+					}
+
+				// Since we flip the display style, we have to handle that
+				// one special, otherwise get the value
+				ret = prop == "display" && swap[stack.length-1] != null ?
+					"none" :
+					document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop) || "";
+
+				// Finally, revert the display styles back
+				for ( a = 0; a < swap.length; a++ )
+					if ( swap[a] != null )
+						stack[a].style.display = swap[a];
+			}
+
+			if ( prop == "opacity" && ret == "" )
+				ret = "1";
+
+		} else if (elem.currentStyle) {
+			var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});
+			ret = elem.currentStyle[prop] || elem.currentStyle[newProp];
+
+			// From the awesome hack by Dean Edwards
+			// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+			// If we're not dealing with a regular pixel number
+			// but a number that has a weird ending, we need to convert it to pixels
+			if ( !/^\d+(px)?$/i.test(ret) && /^\d/.test(ret) ) {
+				var style = elem.style.left;
+				var runtimeStyle = elem.runtimeStyle.left;
+				elem.runtimeStyle.left = elem.currentStyle.left;
+				elem.style.left = ret || 0;
+				ret = elem.style.pixelLeft + "px";
+				elem.style.left = style;
+				elem.runtimeStyle.left = runtimeStyle;
+			}
+		}
+
+		return ret;
+	},
+	
+	clean: function(a, doc) {
+		var r = [];
+		doc = doc || document;
+
+		jQuery.each( a, function(i,arg){
+			if ( !arg ) return;
+
+			if ( arg.constructor == Number )
+				arg = arg.toString();
+			
+			// Convert html string into DOM nodes
+			if ( typeof arg == "string" ) {
+				// Fix "XHTML"-style tags in all browsers
+				arg = arg.replace(/(<(\w+)[^>]*?)\/>/g, function(m, all, tag){
+					return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)? m : all+"></"+tag+">";
+				});
+
+				// Trim whitespace, otherwise indexOf won't work as expected
+				var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = [];
+
+				var wrap =
+					// option or optgroup
+					!s.indexOf("<opt") &&
+					[1, "<select>", "</select>"] ||
+					
+					!s.indexOf("<leg") &&
+					[1, "<fieldset>", "</fieldset>"] ||
+					
+					s.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
+					[1, "<table>", "</table>"] ||
+					
+					!s.indexOf("<tr") &&
+					[2, "<table><tbody>", "</tbody></table>"] ||
+					
+				 	// <thead> matched above
+					(!s.indexOf("<td") || !s.indexOf("<th")) &&
+					[3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
+					
+					!s.indexOf("<col") &&
+					[2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] ||
+
+					// IE can't serialize <link> and <script> tags normally
+					jQuery.browser.msie &&
+					[1, "div<div>", "</div>"] ||
+					
+					[0,"",""];
+
+				// Go to html and back, then peel off extra wrappers
+				div.innerHTML = wrap[1] + arg + wrap[2];
+				
+				// Move to the right depth
+				while ( wrap[0]-- )
+					div = div.lastChild;
+				
+				// Remove IE's autoinserted <tbody> from table fragments
+				if ( jQuery.browser.msie ) {
+					
+					// String was a <table>, *may* have spurious <tbody>
+					if ( !s.indexOf("<table") && s.indexOf("<tbody") < 0 ) 
+						tb = div.firstChild && div.firstChild.childNodes;
+						
+					// String was a bare <thead> or <tfoot>
+					else if ( wrap[1] == "<table>" && s.indexOf("<tbody") < 0 )
+						tb = div.childNodes;
+
+					for ( var n = tb.length-1; n >= 0 ; --n )
+						if ( jQuery.nodeName(tb[n], "tbody") && !tb[n].childNodes.length )
+							tb[n].parentNode.removeChild(tb[n]);
+	
+					// IE completely kills leading whitespace when innerHTML is used	
+					if ( /^\s/.test(arg) )	
+						div.insertBefore( doc.createTextNode( arg.match(/^\s*/)[0] ), div.firstChild );
+
+				}
+				
+				arg = jQuery.makeArray( div.childNodes );
+			}
+
+			if ( 0 === arg.length && (!jQuery.nodeName(arg, "form") && !jQuery.nodeName(arg, "select")) )
+				return;
+
+			if ( arg[0] == undefined || jQuery.nodeName(arg, "form") || arg.options )
+				r.push( arg );
+			else
+				r = jQuery.merge( r, arg );
+
+		});
+
+		return r;
+	},
+	
+	attr: function(elem, name, value){
+		var fix = jQuery.isXMLDoc(elem) ? {} : jQuery.props;
+
+		// Safari mis-reports the default selected property of a hidden option
+		// Accessing the parent's selectedIndex property fixes it
+		if ( name == "selected" && jQuery.browser.safari )
+			elem.parentNode.selectedIndex;
+		
+		// Certain attributes only work when accessed via the old DOM 0 way
+		if ( fix[name] ) {
+			if ( value != undefined ) elem[fix[name]] = value;
+			return elem[fix[name]];
+		} else if ( jQuery.browser.msie && name == "style" )
+			return jQuery.attr( elem.style, "cssText", value );
+
+		else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName(elem, "form") && (name == "action" || name == "method") )
+			return elem.getAttributeNode(name).nodeValue;
+
+		// IE elem.getAttribute passes even for style
+		else if ( elem.tagName ) {
+
+			if ( value != undefined ) {
+				if ( name == "type" && jQuery.nodeName(elem,"input") && elem.parentNode )
+					throw "type property can't be changed";
+				elem.setAttribute( name, value );
+			}
+
+			if ( jQuery.browser.msie && /href|src/.test(name) && !jQuery.isXMLDoc(elem) ) 
+				return elem.getAttribute( name, 2 );
+
+			return elem.getAttribute( name );
+
+		// elem is actually elem.style ... set the style
+		} else {
+			// IE actually uses filters for opacity
+			if ( name == "opacity" && jQuery.browser.msie ) {
+				if ( value != undefined ) {
+					// IE has trouble with opacity if it does not have layout
+					// Force it by setting the zoom level
+					elem.zoom = 1; 
+	
+					// Set the alpha filter to set the opacity
+					elem.filter = (elem.filter || "").replace(/alpha\([^)]*\)/,"") +
+						(parseFloat(value).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
+				}
+	
+				return elem.filter ? 
+					(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100).toString() : "";
+			}
+			name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});
+			if ( value != undefined ) elem[name] = value;
+			return elem[name];
+		}
+	},
+	
+	trim: function(t){
+		return (t||"").replace(/^\s+|\s+$/g, "");
+	},
+
+	makeArray: function( a ) {
+		var r = [];
+
+		// Need to use typeof to fight Safari childNodes crashes
+		if ( typeof a != "array" )
+			for ( var i = 0, al = a.length; i < al; i++ )
+				r.push( a[i] );
+		else
+			r = a.slice( 0 );
+
+		return r;
+	},
+
+	inArray: function( b, a ) {
+		for ( var i = 0, al = a.length; i < al; i++ )
+			if ( a[i] == b )
+				return i;
+		return -1;
+	},
+
+	merge: function(first, second) {
+		// We have to loop this way because IE & Opera overwrite the length
+		// expando of getElementsByTagName
+
+		// Also, we need to make sure that the correct elements are being returned
+		// (IE returns comment nodes in a '*' query)
+		if ( jQuery.browser.msie ) {
+			for ( var i = 0; second[i]; i++ )
+				if ( second[i].nodeType != 8 )
+					first.push(second[i]);
+		} else
+			for ( var i = 0; second[i]; i++ )
+				first.push(second[i]);
+
+		return first;
+	},
+
+	unique: function(first) {
+		var r = [], done = {};
+
+		try {
+			for ( var i = 0, fl = first.length; i < fl; i++ ) {
+				var id = jQuery.data(first[i]);
+				if ( !done[id] ) {
+					done[id] = true;
+					r.push(first[i]);
+				}
+			}
+		} catch(e) {
+			r = first;
+		}
+
+		return r;
+	},
+
+	grep: function(elems, fn, inv) {
+		// If a string is passed in for the function, make a function
+		// for it (a handy shortcut)
+		if ( typeof fn == "string" )
+			fn = eval("false||function(a,i){return " + fn + "}");
+
+		var result = [];
+
+		// Go through the array, only saving the items
+		// that pass the validator function
+		for ( var i = 0, el = elems.length; i < el; i++ )
+			if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )
+				result.push( elems[i] );
+
+		return result;
+	},
+
+	map: function(elems, fn) {
+		// If a string is passed in for the function, make a function
+		// for it (a handy shortcut)
+		if ( typeof fn == "string" )
+			fn = eval("false||function(a){return " + fn + "}");
+
+		var result = [];
+
+		// Go through the array, translating each of the items to their
+		// new value (or values).
+		for ( var i = 0, el = elems.length; i < el; i++ ) {
+			var val = fn(elems[i],i);
+
+			if ( val !== null && val != undefined ) {
+				if ( val.constructor != Array ) val = [val];
+				result = result.concat( val );
+			}
+		}
+
+		return result;
+	}
+});
+
+var userAgent = navigator.userAgent.toLowerCase();
+
+// Figure out what browser is being used
+jQuery.browser = {
+	version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
+	safari: /webkit/.test(userAgent),
+	opera: /opera/.test(userAgent),
+	msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
+	mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
+};
+
+var styleFloat = jQuery.browser.msie ? "styleFloat" : "cssFloat";
+	
+jQuery.extend({
+	// Check to see if the W3C box model is being used
+	boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",
+	
+	styleFloat: jQuery.browser.msie ? "styleFloat" : "cssFloat",
+	
+	props: {
+		"for": "htmlFor",
+		"class": "className",
+		"float": styleFloat,
+		cssFloat: styleFloat,
+		styleFloat: styleFloat,
+		innerHTML: "innerHTML",
+		className: "className",
+		value: "value",
+		disabled: "disabled",
+		checked: "checked",
+		readonly: "readOnly",
+		selected: "selected",
+		maxlength: "maxLength"
+	}
+});
+
+jQuery.each({
+	parent: "a.parentNode",
+	parents: "jQuery.dir(a,'parentNode')",
+	next: "jQuery.nth(a,2,'nextSibling')",
+	prev: "jQuery.nth(a,2,'previousSibling')",
+	nextAll: "jQuery.dir(a,'nextSibling')",
+	prevAll: "jQuery.dir(a,'previousSibling')",
+	siblings: "jQuery.sibling(a.parentNode.firstChild,a)",
+	children: "jQuery.sibling(a.firstChild)",
+	contents: "jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"
+}, function(i,n){
+	jQuery.fn[ i ] = function(a) {
+		var ret = jQuery.map(this,n);
+		if ( a && typeof a == "string" )
+			ret = jQuery.multiFilter(a,ret);
+		return this.pushStack( jQuery.unique(ret) );
+	};
+});
+
+jQuery.each({
+	appendTo: "append",
+	prependTo: "prepend",
+	insertBefore: "before",
+	insertAfter: "after",
+	replaceAll: "replaceWith"
+}, function(i,n){
+	jQuery.fn[ i ] = function(){
+		var a = arguments;
+		return this.each(function(){
+			for ( var j = 0, al = a.length; j < al; j++ )
+				jQuery(a[j])[n]( this );
+		});
+	};
+});
+
+jQuery.each( {
+	removeAttr: function( key ) {
+		jQuery.attr( this, key, "" );
+		this.removeAttribute( key );
+	},
+	addClass: function(c){
+		jQuery.className.add(this,c);
+	},
+	removeClass: function(c){
+		jQuery.className.remove(this,c);
+	},
+	toggleClass: function( c ){
+		jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this, c);
+	},
+	remove: function(a){
+		if ( !a || jQuery.filter( a, [this] ).r.length ) {
+			jQuery.removeData( this );
+			this.parentNode.removeChild( this );
+		}
+	},
+	empty: function() {
+		// Clean up the cache
+		jQuery("*", this).each(function(){ jQuery.removeData(this); });
+
+		while ( this.firstChild )
+			this.removeChild( this.firstChild );
+	}
+}, function(i,n){
+	jQuery.fn[ i ] = function() {
+		return this.each( n, arguments );
+	};
+});
+
+jQuery.each( [ "Height", "Width" ], function(i,name){
+	var n = name.toLowerCase();
+	
+	jQuery.fn[ n ] = function(h) {
+		return this[0] == window ?
+			jQuery.browser.safari && self["inner" + name] ||
+			jQuery.boxModel && Math.max(document.documentElement["client" + name], document.body["client" + name]) ||
+			document.body["client" + name] :
+		
+			this[0] == document ?
+				Math.max( document.body["scroll" + name], document.body["offset" + name] ) :
+        
+				h == undefined ?
+					( this.length ? jQuery.css( this[0], n ) : null ) :
+					this.css( n, h.constructor == String ? h : h + "px" );
+	};
+});
+
+var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
+		"(?:[\\w*_-]|\\\\.)" :
+		"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
+	quickChild = new RegExp("^>\\s*(" + chars + "+)"),
+	quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
+	quickClass = new RegExp("^([#.]?)(" + chars + "*)");
+
+jQuery.extend({
+	expr: {
+		"": "m[2]=='*'||jQuery.nodeName(a,m[2])",
+		"#": "a.getAttribute('id')==m[2]",
+		":": {
+			// Position Checks
+			lt: "i<m[3]-0",
+			gt: "i>m[3]-0",
+			nth: "m[3]-0==i",
+			eq: "m[3]-0==i",
+			first: "i==0",
+			last: "i==r.length-1",
+			even: "i%2==0",
+			odd: "i%2",
+
+			// Child Checks
+			"first-child": "a.parentNode.getElementsByTagName('*')[0]==a",
+			"last-child": "jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a",
+			"only-child": "!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",
+
+			// Parent Checks
+			parent: "a.firstChild",
+			empty: "!a.firstChild",
+
+			// Text Check
+			contains: "(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",
+
+			// Visibility
+			visible: '"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',
+			hidden: '"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',
+
+			// Form attributes
+			enabled: "!a.disabled",
+			disabled: "a.disabled",
+			checked: "a.checked",
+			selected: "a.selected||jQuery.attr(a,'selected')",
+
+			// Form elements
+			text: "'text'==a.type",
+			radio: "'radio'==a.type",
+			checkbox: "'checkbox'==a.type",
+			file: "'file'==a.type",
+			password: "'password'==a.type",
+			submit: "'submit'==a.type",
+			image: "'image'==a.type",
+			reset: "'reset'==a.type",
+			button: '"button"==a.type||jQuery.nodeName(a,"button")',
+			input: "/input|select|textarea|button/i.test(a.nodeName)",
+
+			// :has()
+			has: "jQuery.find(m[3],a).length",
+
+			// :header
+			header: "/h\\d/i.test(a.nodeName)",
+
+			// :animated
+			animated: "jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"
+		}
+	},
+	
+	// The regular expressions that power the parsing engine
+	parse: [
+		// Match: [@value='test'], [@foo]
+		/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,
+
+		// Match: :contains('foo')
+		/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,
+
+		// Match: :even, :last-chlid, #id, .class
+		new RegExp("^([:.#]*)(" + chars + "+)")
+	],
+
+	multiFilter: function( expr, elems, not ) {
+		var old, cur = [];
+
+		while ( expr && expr != old ) {
+			old = expr;
+			var f = jQuery.filter( expr, elems, not );
+			expr = f.t.replace(/^\s*,\s*/, "" );
+			cur = not ? elems = f.r : jQuery.merge( cur, f.r );
+		}
+
+		return cur;
+	},
+
+	find: function( t, context ) {
+		// Quickly handle non-string expressions
+		if ( typeof t != "string" )
+			return [ t ];
+
+		// Make sure that the context is a DOM Element
+		if ( context && !context.nodeType )
+			context = null;
+
+		// Set the correct context (if none is provided)
+		context = context || document;
+
+		// Initialize the search
+		var ret = [context], done = [], last;
+
+		// Continue while a selector expression exists, and while
+		// we're no longer looping upon ourselves
+		while ( t && last != t ) {
+			var r = [];
+			last = t;
+
+			t = jQuery.trim(t);
+
+			var foundToken = false;
+
+			// An attempt at speeding up child selectors that
+			// point to a specific element tag
+			var re = quickChild;
+			var m = re.exec(t);
+
+			if ( m ) {
+				var nodeName = m[1].toUpperCase();
+
+				// Perform our own iteration and filter
+				for ( var i = 0; ret[i]; i++ )
+					for ( var c = ret[i].firstChild; c; c = c.nextSibling )
+						if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName.toUpperCase()) )
+							r.push( c );
+
+				ret = r;
+				t = t.replace( re, "" );
+				if ( t.indexOf(" ") == 0 ) continue;
+				foundToken = true;
+			} else {
+				re = /^([>+~])\s*(\w*)/i;
+
+				if ( (m = re.exec(t)) != null ) {
+					r = [];
+
+					var nodeName = m[2], merge = {};
+					m = m[1];
+
+					for ( var j = 0, rl = ret.length; j < rl; j++ ) {
+						var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
+						for ( ; n; n = n.nextSibling )
+							if ( n.nodeType == 1 ) {
+								var id = jQuery.data(n);
+
+								if ( m == "~" && merge[id] ) break;
+								
+								if (!nodeName || n.nodeName.toUpperCase() == nodeName.toUpperCase() ) {
+									if ( m == "~" ) merge[id] = true;
+									r.push( n );
+								}
+								
+								if ( m == "+" ) break;
+							}
+					}
+
+					ret = r;
+
+					// And remove the token
+					t = jQuery.trim( t.replace( re, "" ) );
+					foundToken = true;
+				}
+			}
+
+			// See if there's still an expression, and that we haven't already
+			// matched a token
+			if ( t && !foundToken ) {
+				// Handle multiple expressions
+				if ( !t.indexOf(",") ) {
+					// Clean the result set
+					if ( context == ret[0] ) ret.shift();
+
+					// Merge the result sets
+					done = jQuery.merge( done, ret );
+
+					// Reset the context
+					r = ret = [context];
+
+					// Touch up the selector string
+					t = " " + t.substr(1,t.length);
+
+				} else {
+					// Optimize for the case nodeName#idName
+					var re2 = quickID;
+					var m = re2.exec(t);
+					
+					// Re-organize the results, so that they're consistent
+					if ( m ) {
+					   m = [ 0, m[2], m[3], m[1] ];
+
+					} else {
+						// Otherwise, do a traditional filter check for
+						// ID, class, and element selectors
+						re2 = quickClass;
+						m = re2.exec(t);
+					}
+
+					m[2] = m[2].replace(/\\/g, "");
+
+					var elem = ret[ret.length-1];
+
+					// Try to do a global search by ID, where we can
+					if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
+						// Optimization for HTML document case
+						var oid = elem.getElementById(m[2]);
+						
+						// Do a quick check for the existence of the actual ID attribute
+						// to avoid selecting by the name attribute in IE
+						// also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
+						if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
+							oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
+
+						// Do a quick check for node name (where applicable) so
+						// that div#foo searches will be really fast
+						ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
+					} else {
+						// We need to find all descendant elements
+						for ( var i = 0; ret[i]; i++ ) {
+							// Grab the tag name being searched for
+							var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];
+
+							// Handle IE7 being really dumb about <object>s
+							if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
+								tag = "param";
+
+							r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
+						}
+
+						// It's faster to filter by class and be done with it
+						if ( m[1] == "." )
+							r = jQuery.classFilter( r, m[2] );
+
+						// Same with ID filtering
+						if ( m[1] == "#" ) {
+							var tmp = [];
+
+							// Try to find the element with the ID
+							for ( var i = 0; r[i]; i++ )
+								if ( r[i].getAttribute("id") == m[2] ) {
+									tmp = [ r[i] ];
+									break;
+								}
+
+							r = tmp;
+						}
+
+						ret = r;
+					}
+
+					t = t.replace( re2, "" );
+				}
+
+			}
+
+			// If a selector string still exists
+			if ( t ) {
+				// Attempt to filter it
+				var val = jQuery.filter(t,r);
+				ret = r = val.r;
+				t = jQuery.trim(val.t);
+			}
+		}
+
+		// An error occurred with the selector;
+		// just return an empty set instead
+		if ( t )
+			ret = [];
+
+		// Remove the root context
+		if ( ret && context == ret[0] )
+			ret.shift();
+
+		// And combine the results
+		done = jQuery.merge( done, ret );
+
+		return done;
+	},
+
+	classFilter: function(r,m,not){
+		m = " " + m + " ";
+		var tmp = [];
+		for ( var i = 0; r[i]; i++ ) {
+			var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
+			if ( !not && pass || not && !pass )
+				tmp.push( r[i] );
+		}
+		return tmp;
+	},
+
+	filter: function(t,r,not) {
+		var last;
+
+		// Look for common filter expressions
+		while ( t  && t != last ) {
+			last = t;
+
+			var p = jQuery.parse, m;
+
+			for ( var i = 0; p[i]; i++ ) {
+				m = p[i].exec( t );
+
+				if ( m ) {
+					// Remove what we just matched
+					t = t.substring( m[0].length );
+
+					m[2] = m[2].replace(/\\/g, "");
+					break;
+				}
+			}
+
+			if ( !m )
+				break;
+
+			// :not() is a special case that can be optimized by
+			// keeping it out of the expression list
+			if ( m[1] == ":" && m[2] == "not" )
+				r = jQuery.filter(m[3], r, true).r;
+
+			// We can get a big speed boost by filtering by class here
+			else if ( m[1] == "." )
+				r = jQuery.classFilter(r, m[2], not);
+
+			else if ( m[1] == "[" ) {
+				var tmp = [], type = m[3];
+				
+				for ( var i = 0, rl = r.length; i < rl; i++ ) {
+					var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
+					
+					if ( z == null || /href|src|selected/.test(m[2]) )
+						z = jQuery.attr(a,m[2]) || '';
+
+					if ( (type == "" && !!z ||
+						 type == "=" && z == m[5] ||
+						 type == "!=" && z != m[5] ||
+						 type == "^=" && z && !z.indexOf(m[5]) ||
+						 type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
+						 (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
+							tmp.push( a );
+				}
+				
+				r = tmp;
+
+			// We can get a speed boost by handling nth-child here
+			} else if ( m[1] == ":" && m[2] == "nth-child" ) {
+				var merge = {}, tmp = [],
+					test = /(\d*)n\+?(\d*)/.exec(
+						m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
+						!/\D/.test(m[3]) && "n+" + m[3] || m[3]),
+					first = (test[1] || 1) - 0, last = test[2] - 0;
+
+				for ( var i = 0, rl = r.length; i < rl; i++ ) {
+					var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);
+
+					if ( !merge[id] ) {
+						var c = 1;
+
+						for ( var n = parentNode.firstChild; n; n = n.nextSibling )
+							if ( n.nodeType == 1 )
+								n.nodeIndex = c++;
+
+						merge[id] = true;
+					}
+
+					var add = false;
+
+					if ( first == 1 ) {
+						if ( last == 0 || node.nodeIndex == last )
+							add = true;
+					} else if ( (node.nodeIndex + last) % first == 0 )
+						add = true;
+
+					if ( add ^ not )
+						tmp.push( node );
+				}
+
+				r = tmp;
+
+			// Otherwise, find the expression to execute
+			} else {
+				var f = jQuery.expr[m[1]];
+				if ( typeof f != "string" )
+					f = jQuery.expr[m[1]][m[2]];
+
+				// Build a custom macro to enclose it
+				f = eval("false||function(a,i){return " + f + "}");
+
+				// Execute it against the current filter
+				r = jQuery.grep( r, f, not );
+			}
+		}
+
+		// Return an array of filtered elements (r)
+		// and the modified expression string (t)
+		return { r: r, t: t };
+	},
+
+	dir: function( elem, dir ){
+		var matched = [];
+		var cur = elem[dir];
+		while ( cur && cur != document ) {
+			if ( cur.nodeType == 1 )
+				matched.push( cur );
+			cur = cur[dir];
+		}
+		return matched;
+	},
+	
+	nth: function(cur,result,dir,elem){
+		result = result || 1;
+		var num = 0;
+
+		for ( ; cur; cur = cur[dir] )
+			if ( cur.nodeType == 1 && ++num == result )
+				break;
+
+		return cur;
+	},
+	
+	sibling: function( n, elem ) {
+		var r = [];
+
+		for ( ; n; n = n.nextSibling ) {
+			if ( n.nodeType == 1 && (!elem || n != elem) )
+				r.push( n );
+		}
+
+		return r;
+	}
+});
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code orignated from 
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+	// Bind an event to an element
+	// Original by Dean Edwards
+	add: function(element, type, handler, data) {
+		// For whatever reason, IE has trouble passing the window object
+		// around, causing it to be cloned in the process
+		if ( jQuery.browser.msie && element.setInterval != undefined )
+			element = window;
+
+		// Make sure that the function being executed has a unique ID
+		if ( !handler.guid )
+			handler.guid = this.guid++;
+			
+		// if data is passed, bind to handler 
+		if( data != undefined ) { 
+        		// Create temporary function pointer to original handler 
+			var fn = handler; 
+
+			// Create unique handler function, wrapped around original handler 
+			handler = function() { 
+				// Pass arguments and context to original handler 
+				return fn.apply(this, arguments); 
+			};
+
+			// Store data in unique handler 
+			handler.data = data;
+
+			// Set the guid of unique handler to the same of original handler, so it can be removed 
+			handler.guid = fn.guid;
+		}
+
+		// Namespaced event handlers
+		var parts = type.split(".");
+		type = parts[0];
+		handler.type = parts[1];
+
+		// Init the element's event structure
+		var events = jQuery.data(element, "events") || jQuery.data(element, "events", {});
+		
+		var handle = jQuery.data(element, "handle", function(){
+			// returned undefined or false
+			var val;
+
+			// Handle the second event of a trigger and when
+			// an event is called after a page has unloaded
+			if ( typeof jQuery == "undefined" || jQuery.event.triggered )
+				return val;
+			
+			val = jQuery.event.handle.apply(element, arguments);
+			
+			return val;
+		});
+
+		// Get the current list of functions bound to this event
+		var handlers = events[type];
+
+		// Init the event handler queue
+		if (!handlers) {
+			handlers = events[type] = {};	
+			
+			// And bind the global event handler to the element
+			if (element.addEventListener)
+				element.addEventListener(type, handle, false);
+			else
+				element.attachEvent("on" + type, handle);
+		}
+
+		// Add the function to the element's handler list
+		handlers[handler.guid] = handler;
+
+		// Keep track of which events have been used, for global triggering
+		this.global[type] = true;
+	},
+
+	guid: 1,
+	global: {},
+
+	// Detach an event or set of events from an element
+	remove: function(element, type, handler) {
+		var events = jQuery.data(element, "events"), ret, index;
+
+		// Namespaced event handlers
+		if ( typeof type == "string" ) {
+			var parts = type.split(".");
+			type = parts[0];
+		}
+
+		if ( events ) {
+			// type is actually an event object here
+			if ( type && type.type ) {
+				handler = type.handler;
+				type = type.type;
+			}
+			
+			if ( !type ) {
+				for ( type in events )
+					this.remove( element, type );
+
+			} else if ( events[type] ) {
+				// remove the given handler for the given type
+				if ( handler )
+					delete events[type][handler.guid];
+				
+				// remove all handlers for the given type
+				else
+					for ( handler in events[type] )
+						// Handle the removal of namespaced events
+						if ( !parts[1] || events[type][handler].type == parts[1] )
+							delete events[type][handler];
+
+				// remove generic event handler if no more handlers exist
+				for ( ret in events[type] ) break;
+				if ( !ret ) {
+					if (element.removeEventListener)
+						element.removeEventListener(type, jQuery.data(element, "handle"), false);
+					else
+						element.detachEvent("on" + type, jQuery.data(element, "handle"));
+					ret = null;
+					delete events[type];
+				}
+			}
+
+			// Remove the expando if it's no longer used
+			for ( ret in events ) break;
+			if ( !ret ) {
+				jQuery.removeData( element, "events" );
+				jQuery.removeData( element, "handle" );
+			}
+		}
+	},
+
+	trigger: function(type, data, element, donative, extra) {
+		// Clone the incoming data, if any
+		data = jQuery.makeArray(data || []);
+
+		// Handle a global trigger
+		if ( !element ) {
+			// Only trigger if we've ever bound an event for it
+			if ( this.global[type] )
+				jQuery("*").add([window, document]).trigger(type, data);
+
+		// Handle triggering a single element
+		} else {
+			var val, ret, fn = jQuery.isFunction( element[ type ] || null ),
+				// Check to see if we need to provide a fake event, or not
+				evt = !data[0] || !data[0].preventDefault;
+			
+			// Pass along a fake event
+			if ( evt )
+				data.unshift( this.fix({ type: type, target: element }) );
+
+			// Enforce the right trigger type
+			data[0].type = type;
+
+			// Trigger the event
+			if ( jQuery.isFunction( jQuery.data(element, "handle") ) )
+				val = jQuery.data(element, "handle").apply( element, data );
+
+			// Handle triggering native .onfoo handlers
+			if ( !fn && element["on"+type] && element["on"+type].apply( element, data ) === false )
+				val = false;
+
+			// Extra functions don't get the custom event object
+			if ( evt )
+				data.shift();
+
+			// Handle triggering of extra function
+			if ( extra && extra.apply( element, data ) === false )
+				val = false;
+
+			// Trigger the native events (except for clicks on links)
+			if ( fn && donative !== false && val !== false && !(jQuery.nodeName(element, 'a') && type == "click") ) {
+				this.triggered = true;
+				element[ type ]();
+			}
+
+			this.triggered = false;
+		}
+
+		return val;
+	},
+
+	handle: function(event) {
+		// returned undefined or false
+		var val;
+
+		// Empty object is for triggered events with no data
+		event = jQuery.event.fix( event || window.event || {} ); 
+
+		// Namespaced event handlers
+		var parts = event.type.split(".");
+		event.type = parts[0];
+
+		var c = jQuery.data(this, "events") && jQuery.data(this, "events")[event.type], args = Array.prototype.slice.call( arguments, 1 );
+		args.unshift( event );
+
+		for ( var j in c ) {
+			// Pass in a reference to the handler function itself
+			// So that we can later remove it
+			args[0].handler = c[j];
+			args[0].data = c[j].data;
+
+			// Filter the functions by class
+			if ( !parts[1] || c[j].type == parts[1] ) {
+				var tmp = c[j].apply( this, args );
+
+				if ( val !== false )
+					val = tmp;
+
+				if ( tmp === false ) {
+					event.preventDefault();
+					event.stopPropagation();
+				}
+			}
+		}
+
+		// Clean up added properties in IE to prevent memory leak
+		if (jQuery.browser.msie)
+			event.target = event.preventDefault = event.stopPropagation =
+				event.handler = event.data = null;
+
+		return val;
+	},
+
+	fix: function(event) {
+		// store a copy of the original event object 
+		// and clone to set read-only properties
+		var originalEvent = event;
+		event = jQuery.extend({}, originalEvent);
+		
+		// add preventDefault and stopPropagation since 
+		// they will not work on the clone
+		event.preventDefault = function() {
+			// if preventDefault exists run it on the original event
+			if (originalEvent.preventDefault)
+				originalEvent.preventDefault();
+			// otherwise set the returnValue property of the original event to false (IE)
+			originalEvent.returnValue = false;
+		};
+		event.stopPropagation = function() {
+			// if stopPropagation exists run it on the original event
+			if (originalEvent.stopPropagation)
+				originalEvent.stopPropagation();
+			// otherwise set the cancelBubble property of the original event to true (IE)
+			originalEvent.cancelBubble = true;
+		};
+		
+		// Fix target property, if necessary
+		if ( !event.target && event.srcElement )
+			event.target = event.srcElement;
+				
+		// check if target is a textnode (safari)
+		if (jQuery.browser.safari && event.target.nodeType == 3)
+			event.target = originalEvent.target.parentNode;
+
+		// Add relatedTarget, if necessary
+		if ( !event.relatedTarget && event.fromElement )
+			event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
+
+		// Calculate pageX/Y if missing and clientX/Y available
+		if ( event.pageX == null && event.clientX != null ) {
+			var e = document.documentElement, b = document.body;
+			event.pageX = event.clientX + (e && e.scrollLeft || b.scrollLeft || 0);
+			event.pageY = event.clientY + (e && e.scrollTop || b.scrollTop || 0);
+		}
+			
+		// Add which for key events
+		if ( !event.which && (event.charCode || event.keyCode) )
+			event.which = event.charCode || event.keyCode;
+		
+		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+		if ( !event.metaKey && event.ctrlKey )
+			event.metaKey = event.ctrlKey;
+
+		// Add which for click: 1 == left; 2 == middle; 3 == right
+		// Note: button is not normalized, so don't use it
+		if ( !event.which && event.button )
+			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+			
+		return event;
+	}
+};
+
+jQuery.fn.extend({
+	bind: function( type, data, fn ) {
+		return type == "unload" ? this.one(type, data, fn) : this.each(function(){
+			jQuery.event.add( this, type, fn || data, fn && data );
+		});
+	},
+	
+	one: function( type, data, fn ) {
+		return this.each(function(){
+			jQuery.event.add( this, type, function(event) {
+				jQuery(this).unbind(event);
+				return (fn || data).apply( this, arguments);
+			}, fn && data);
+		});
+	},
+
+	unbind: function( type, fn ) {
+		return this.each(function(){
+			jQuery.event.remove( this, type, fn );
+		});
+	},
+
+	trigger: function( type, data, fn ) {
+		return this.each(function(){
+			jQuery.event.trigger( type, data, this, true, fn );
+		});
+	},
+
+	triggerHandler: function( type, data, fn ) {
+		if ( this[0] )
+			return jQuery.event.trigger( type, data, this[0], false, fn );
+	},
+
+	toggle: function() {
+		// Save reference to arguments for access in closure
+		var a = arguments;
+
+		return this.click(function(e) {
+			// Figure out which function to execute
+			this.lastToggle = 0 == this.lastToggle ? 1 : 0;
+			
+			// Make sure that clicks stop
+			e.preventDefault();
+			
+			// and execute the function
+			return a[this.lastToggle].apply( this, [e] ) || false;
+		});
+	},
+
+	hover: function(f,g) {
+		
+		// A private function for handling mouse 'hovering'
+		function handleHover(e) {
+			// Check if mouse(over|out) are still within the same parent element
+			var p = e.relatedTarget;
+	
+			// Traverse up the tree
+			while ( p && p != this ) try { p = p.parentNode; } catch(e) { p = this; };
+			
+			// If we actually just moused on to a sub-element, ignore it
+			if ( p == this ) return false;
+			
+			// Execute the right function
+			return (e.type == "mouseover" ? f : g).apply(this, [e]);
+		}
+		
+		// Bind the function to the two event listeners
+		return this.mouseover(handleHover).mouseout(handleHover);
+	},
+	
+	ready: function(f) {
+		// Attach the listeners
+		bindReady();
+
+		// If the DOM is already ready
+		if ( jQuery.isReady )
+			// Execute the function immediately
+			f.apply( document, [jQuery] );
+			
+		// Otherwise, remember the function for later
+		else
+			// Add the function to the wait list
+			jQuery.readyList.push( function() { return f.apply(this, [jQuery]); } );
+	
+		return this;
+	}
+});
+
+jQuery.extend({
+	/*
+	 * All the code that makes DOM Ready work nicely.
+	 */
+	isReady: false,
+	readyList: [],
+	
+	// Handle when the DOM is ready
+	ready: function() {
+		// Make sure that the DOM is not already loaded
+		if ( !jQuery.isReady ) {
+			// Remember that the DOM is ready
+			jQuery.isReady = true;
+			
+			// If there are functions bound, to execute
+			if ( jQuery.readyList ) {
+				// Execute all of them
+				jQuery.each( jQuery.readyList, function(){
+					this.apply( document );
+				});
+				
+				// Reset the list of functions
+				jQuery.readyList = null;
+			}
+			// Remove event listener to avoid memory leak
+			if ( jQuery.browser.mozilla || jQuery.browser.opera )
+				document.removeEventListener( "DOMContentLoaded", jQuery.ready, false );
+			
+			// Remove script element used by IE hack
+			if( !window.frames.length ) // don't remove if frames are present (#1187)
+				jQuery(window).load(function(){ jQuery("#__ie_init").remove(); });
+		}
+	}
+});
+
+jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
+	"mousedown,mouseup,mousemove,mouseover,mouseout,change,select," + 
+	"submit,keydown,keypress,keyup,error").split(","), function(i,o){
+	
+	// Handle event binding
+	jQuery.fn[o] = function(f){
+		return f ? this.bind(o, f) : this.trigger(o);
+	};
+});
+
+var readyBound = false;
+
+function bindReady(){
+	if ( readyBound ) return;
+	readyBound = true;
+
+	// If Mozilla is used
+	if ( jQuery.browser.mozilla || jQuery.browser.opera )
+		// Use the handy event callback
+		document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
+	
+	// If IE is used, use the excellent hack by Matthias Miller
+	// http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited
+	else if ( jQuery.browser.msie ) {
+	
+		// Only works if you document.write() it
+		document.write("<scr" + "ipt id=__ie_init defer=true " + 
+			"src=//:><\/script>");
+	
+		// Use the defer script hack
+		var script = document.getElementById("__ie_init");
+		
+		// script does not exist if jQuery is loaded dynamically
+		if ( script ) 
+			script.onreadystatechange = function() {
+				if ( this.readyState != "complete" ) return;
+				jQuery.ready();
+			};
+	
+		// Clear from memory
+		script = null;
+	
+	// If Safari  is used
+	} else if ( jQuery.browser.safari )
+		// Continually check to see if the document.readyState is valid
+		jQuery.safariTimer = setInterval(function(){
+			// loaded and complete are both valid states
+			if ( document.readyState == "loaded" || 
+				document.readyState == "complete" ) {
+	
+				// If either one are found, remove the timer
+				clearInterval( jQuery.safariTimer );
+				jQuery.safariTimer = null;
+	
+				// and execute any waiting functions
+				jQuery.ready();
+			}
+		}, 10); 
+
+	// A fallback to window.onload, that will always work
+	jQuery.event.add( window, "load", jQuery.ready );
+}
+jQuery.fn.extend({
+	load: function( url, params, callback ) {
+		if ( jQuery.isFunction( url ) )
+			return this.bind("load", url);
+
+		var off = url.indexOf(" ");
+		if ( off >= 0 ) {
+			var selector = url.slice(off, url.length);
+			url = url.slice(0, off);
+		}
+
+		callback = callback || function(){};
+
+		// Default to a GET request
+		var type = "GET";
+
+		// If the second parameter was provided
+		if ( params )
+			// If it's a function
+			if ( jQuery.isFunction( params ) ) {
+				// We assume that it's the callback
+				callback = params;
+				params = null;
+
+			// Otherwise, build a param string
+			} else {
+				params = jQuery.param( params );
+				type = "POST";
+			}
+
+		var self = this;
+
+		// Request the remote document
+		jQuery.ajax({
+			url: url,
+			type: type,
+			data: params,
+			complete: function(res, status){
+				// If successful, inject the HTML into all the matched elements
+				if ( status == "success" || status == "notmodified" )
+					// See if a selector was specified
+					self.html( selector ?
+						// Create a dummy div to hold the results
+						jQuery("<div/>")
+							// inject the contents of the document in, removing the scripts
+							// to avoid any 'Permission Denied' errors in IE
+							.append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
+
+							// Locate the specified elements
+							.find(selector) :
+
+						// If not, just inject the full result
+						res.responseText );
+
+				// Add delay to account for Safari's delay in globalEval
+				setTimeout(function(){
+					self.each( callback, [res.responseText, status, res] );
+				}, 13);
+			}
+		});
+		return this;
+	},
+
+	serialize: function() {
+		return jQuery.param(this.serializeArray());
+	},
+	serializeArray: function() {
+		return this.map(function(){
+			return jQuery.nodeName(this, "form") ?
+				jQuery.makeArray(this.elements) : this;
+		})
+		.filter(function(){
+			return this.name && !this.disabled && 
+				(this.checked || /select|textarea/i.test(this.nodeName) || 
+					/text|hidden|password/i.test(this.type));
+		})
+		.map(function(i, elem){
+			var val = jQuery(this).val();
+			return val == null ? null :
+				val.constructor == Array ?
+					jQuery.map( val, function(val, i){
+						return {name: elem.name, value: val};
+					}) :
+					{name: elem.name, value: val};
+		}).get();
+	}
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
+	jQuery.fn[o] = function(f){
+		return this.bind(o, f);
+	};
+});
+
+var jsc = (new Date).getTime();
+
+jQuery.extend({
+	get: function( url, data, callback, type ) {
+		// shift arguments if data argument was ommited
+		if ( jQuery.isFunction( data ) ) {
+			callback = data;
+			data = null;
+		}
+		
+		return jQuery.ajax({
+			type: "GET",
+			url: url,
+			data: data,
+			success: callback,
+			dataType: type
+		});
+	},
+
+	getScript: function( url, callback ) {
+		return jQuery.get(url, null, callback, "script");
+	},
+
+	getJSON: function( url, data, callback ) {
+		return jQuery.get(url, data, callback, "json");
+	},
+
+	post: function( url, data, callback, type ) {
+		if ( jQuery.isFunction( data ) ) {
+			callback = data;
+			data = {};
+		}
+
+		return jQuery.ajax({
+			type: "POST",
+			url: url,
+			data: data,
+			success: callback,
+			dataType: type
+		});
+	},
+
+	ajaxSetup: function( settings ) {
+		jQuery.extend( jQuery.ajaxSettings, settings );
+	},
+
+	ajaxSettings: {
+		global: true,
+		type: "GET",
+		timeout: 0,
+		contentType: "application/x-www-form-urlencoded",
+		processData: true,
+		async: true,
+		data: null
+	},
+	
+	// Last-Modified header cache for next request
+	lastModified: {},
+
+	ajax: function( s ) {
+		var jsonp, jsre = /=(\?|%3F)/g, status, data;
+
+		// Extend the settings, but re-extend 's' so that it can be
+		// checked again later (in the test suite, specifically)
+		s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
+
+		// convert data if not already a string
+		if ( s.data && s.processData && typeof s.data != "string" )
+			s.data = jQuery.param(s.data);
+
+		// Handle JSONP Parameter Callbacks
+		if ( s.dataType == "jsonp" ) {
+			if ( s.type.toLowerCase() == "get" ) {
+				if ( !s.url.match(jsre) )
+					s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
+			} else if ( !s.data || !s.data.match(jsre) )
+				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
+			s.dataType = "json";
+		}
+
+		// Build temporary JSONP function
+		if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
+			jsonp = "jsonp" + jsc++;
+
+			// Replace the =? sequence both in the query string and the data
+			if ( s.data )
+				s.data = s.data.replace(jsre, "=" + jsonp);
+			s.url = s.url.replace(jsre, "=" + jsonp);
+
+			// We need to make sure
+			// that a JSONP style response is executed properly
+			s.dataType = "script";
+
+			// Handle JSONP-style loading
+			window[ jsonp ] = function(tmp){
+				data = tmp;
+				success();
+				complete();
+				// Garbage collect
+				window[ jsonp ] = undefined;
+				try{ delete window[ jsonp ]; } catch(e){}
+			};
+		}
+
+		if ( s.dataType == "script" && s.cache == null )
+			s.cache = false;
+
+		if ( s.cache === false && s.type.toLowerCase() == "get" )
+			s.url += (s.url.match(/\?/) ? "&" : "?") + "_=" + (new Date()).getTime();
+
+		// If data is available, append data to url for get requests
+		if ( s.data && s.type.toLowerCase() == "get" ) {
+			s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
+
+			// IE likes to send both get and post data, prevent this
+			s.data = null;
+		}
+
+		// Watch for a new set of requests
+		if ( s.global && ! jQuery.active++ )
+			jQuery.event.trigger( "ajaxStart" );
+
+		// If we're requesting a remote document
+		// and trying to load JSON or Script
+		if ( !s.url.indexOf("http") && s.dataType == "script" ) {
+			var head = document.getElementsByTagName("head")[0];
+			var script = document.createElement("script");
+			script.src = s.url;
+
+			// Handle Script loading
+			if ( !jsonp && (s.success || s.complete) ) {
+				var done = false;
+
+				// Attach handlers for all browsers
+				script.onload = script.onreadystatechange = function(){
+					if ( !done && (!this.readyState || 
+							this.readyState == "loaded" || this.readyState == "complete") ) {
+						done = true;
+						success();
+						complete();
+						head.removeChild( script );
+					}
+				};
+			}
+
+			head.appendChild(script);
+
+			// We handle everything using the script element injection
+			return;
+		}
+
+		var requestDone = false;
+
+		// Create the request object; Microsoft failed to properly
+		// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
+		var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
+
+		// Open the socket
+		xml.open(s.type, s.url, s.async);
+
+		// Set the correct header, if data is being sent
+		if ( s.data )
+			xml.setRequestHeader("Content-Type", s.contentType);
+
+		// Set the If-Modified-Since header, if ifModified mode.
+		if ( s.ifModified )
+			xml.setRequestHeader("If-Modified-Since",
+				jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
+
+		// Set header so the called script knows that it's an XMLHttpRequest
+		xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+
+		// Allow custom headers/mimetypes
+		if ( s.beforeSend )
+			s.beforeSend(xml);
+			
+		if ( s.global )
+		    jQuery.event.trigger("ajaxSend", [xml, s]);
+
+		// Wait for a response to come back
+		var onreadystatechange = function(isTimeout){
+			// The transfer is complete and the data is available, or the request timed out
+			if ( !requestDone && xml && (xml.readyState == 4 || isTimeout == "timeout") ) {
+				requestDone = true;
+				
+				// clear poll interval
+				if (ival) {
+					clearInterval(ival);
+					ival = null;
+				}
+				
+				status = isTimeout == "timeout" && "timeout" ||
+					!jQuery.httpSuccess( xml ) && "error" ||
+					s.ifModified && jQuery.httpNotModified( xml, s.url ) && "notmodified" ||
+					"success";
+
+				if ( status == "success" ) {
+					// Watch for, and catch, XML document parse errors
+					try {
+						// process the data (runs the xml through httpData regardless of callback)
+						data = jQuery.httpData( xml, s.dataType );
+					} catch(e) {
+						status = "parsererror";
+					}
+				}
+
+				// Make sure that the request was successful or notmodified
+				if ( status == "success" ) {
+					// Cache Last-Modified header, if ifModified mode.
+					var modRes;
+					try {
+						modRes = xml.getResponseHeader("Last-Modified");
+					} catch(e) {} // swallow exception thrown by FF if header is not available
+	
+					if ( s.ifModified && modRes )
+						jQuery.lastModified[s.url] = modRes;
+
+					// JSONP handles its own success callback
+					if ( !jsonp )
+						success();	
+				} else
+					jQuery.handleError(s, xml, status);
+
+				// Fire the complete handlers
+				complete();
+
+				// Stop memory leaks
+				if ( s.async )
+					xml = null;
+			}
+		};
+		
+		if ( s.async ) {
+			// don't attach the handler to the request, just poll it instead
+			var ival = setInterval(onreadystatechange, 13); 
+
+			// Timeout checker
+			if ( s.timeout > 0 )
+				setTimeout(function(){
+					// Check to see if the request is still happening
+					if ( xml ) {
+						// Cancel the request
+						xml.abort();
+	
+						if( !requestDone )
+							onreadystatechange( "timeout" );
+					}
+				}, s.timeout);
+		}
+			
+		// Send the data
+		try {
+			xml.send(s.data);
+		} catch(e) {
+			jQuery.handleError(s, xml, null, e);
+		}
+		
+		// firefox 1.5 doesn't fire statechange for sync requests
+		if ( !s.async )
+			onreadystatechange();
+		
+		// return XMLHttpRequest to allow aborting the request etc.
+		return xml;
+
+		function success(){
+			// If a local callback was specified, fire it and pass it the data
+			if ( s.success )
+				s.success( data, status );
+
+			// Fire the global callback
+			if ( s.global )
+				jQuery.event.trigger( "ajaxSuccess", [xml, s] );
+		}
+
+		function complete(){
+			// Process result
+			if ( s.complete )
+				s.complete(xml, status);
+
+			// The request was completed
+			if ( s.global )
+				jQuery.event.trigger( "ajaxComplete", [xml, s] );
+
+			// Handle the global AJAX counter
+			if ( s.global && ! --jQuery.active )
+				jQuery.event.trigger( "ajaxStop" );
+		}
+	},
+
+	handleError: function( s, xml, status, e ) {
+		// If a local callback was specified, fire it
+		if ( s.error ) s.error( xml, status, e );
+
+		// Fire the global callback
+		if ( s.global )
+			jQuery.event.trigger( "ajaxError", [xml, s, e] );
+	},
+
+	// Counter for holding the number of active queries
+	active: 0,
+
+	// Determines if an XMLHttpRequest was successful or not
+	httpSuccess: function( r ) {
+		try {
+			return !r.status && location.protocol == "file:" ||
+				( r.status >= 200 && r.status < 300 ) || r.status == 304 ||
+				jQuery.browser.safari && r.status == undefined;
+		} catch(e){}
+		return false;
+	},
+
+	// Determines if an XMLHttpRequest returns NotModified
+	httpNotModified: function( xml, url ) {
+		try {
+			var xmlRes = xml.getResponseHeader("Last-Modified");
+
+			// Firefox always returns 200. check Last-Modified date
+			return xml.status == 304 || xmlRes == jQuery.lastModified[url] ||
+				jQuery.browser.safari && xml.status == undefined;
+		} catch(e){}
+		return false;
+	},
+
+	httpData: function( r, type ) {
+		var ct = r.getResponseHeader("content-type");
+		var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0;
+		var data = xml ? r.responseXML : r.responseText;
+
+		if ( xml && data.documentElement.tagName == "parsererror" )
+			throw "parsererror";
+
+		// If the type is "script", eval it in global context
+		if ( type == "script" )
+			jQuery.globalEval( data );
+
+		// Get the JavaScript object, if JSON is used.
+		if ( type == "json" )
+			data = eval("(" + data + ")");
+
+		return data;
+	},
+
+	// Serialize an array of form elements or a set of
+	// key/values into a query string
+	param: function( a ) {
+		var s = [];
+
+		// If an array was passed in, assume that it is an array
+		// of form elements
+		if ( a.constructor == Array || a.jquery )
+			// Serialize the form elements
+			jQuery.each( a, function(){
+				s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) );
+			});
+
+		// Otherwise, assume that it's an object of key/value pairs
+		else
+			// Serialize the key/values
+			for ( var j in a )
+				// If the value is an array then the key names need to be repeated
+				if ( a[j] && a[j].constructor == Array )
+					jQuery.each( a[j], function(){
+						s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) );
+					});
+				else
+					s.push( encodeURIComponent(j) + "=" + encodeURIComponent( a[j] ) );
+
+		// Return the resulting serialization
+		return s.join("&").replace(/%20/g, "+");
+	}
+
+});
+jQuery.fn.extend({
+	show: function(speed,callback){
+		return speed ?
+			this.animate({
+				height: "show", width: "show", opacity: "show"
+			}, speed, callback) :
+			
+			this.filter(":hidden").each(function(){
+				this.style.display = this.oldblock ? this.oldblock : "";
+				if ( jQuery.css(this,"display") == "none" )
+					this.style.display = "block";
+			}).end();
+	},
+	
+	hide: function(speed,callback){
+		return speed ?
+			this.animate({
+				height: "hide", width: "hide", opacity: "hide"
+			}, speed, callback) :
+			
+			this.filter(":visible").each(function(){
+				this.oldblock = this.oldblock || jQuery.css(this,"display");
+				if ( this.oldblock == "none" )
+					this.oldblock = "block";
+				this.style.display = "none";
+			}).end();
+	},
+
+	// Save the old toggle function
+	_toggle: jQuery.fn.toggle,
+	
+	toggle: function( fn, fn2 ){
+		return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
+			this._toggle( fn, fn2 ) :
+			fn ?
+				this.animate({
+					height: "toggle", width: "toggle", opacity: "toggle"
+				}, fn, fn2) :
+				this.each(function(){
+					jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
+				});
+	},
+	
+	slideDown: function(speed,callback){
+		return this.animate({height: "show"}, speed, callback);
+	},
+	
+	slideUp: function(speed,callback){
+		return this.animate({height: "hide"}, speed, callback);
+	},
+
+	slideToggle: function(speed, callback){
+		return this.animate({height: "toggle"}, speed, callback);
+	},
+	
+	fadeIn: function(speed, callback){
+		return this.animate({opacity: "show"}, speed, callback);
+	},
+	
+	fadeOut: function(speed, callback){
+		return this.animate({opacity: "hide"}, speed, callback);
+	},
+	
+	fadeTo: function(speed,to,callback){
+		return this.animate({opacity: to}, speed, callback);
+	},
+	
+	animate: function( prop, speed, easing, callback ) {
+		var opt = jQuery.speed(speed, easing, callback);
+
+		return this[ opt.queue === false ? "each" : "queue" ](function(){
+			opt = jQuery.extend({}, opt);
+			var hidden = jQuery(this).is(":hidden"), self = this;
+			
+			for ( var p in prop ) {
+				if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
+					return jQuery.isFunction(opt.complete) && opt.complete.apply(this);
+
+				if ( p == "height" || p == "width" ) {
+					// Store display property
+					opt.display = jQuery.css(this, "display");
+
+					// Make sure that nothing sneaks out
+					opt.overflow = this.style.overflow;
+				}
+			}
+
+			if ( opt.overflow != null )
+				this.style.overflow = "hidden";
+
+			opt.curAnim = jQuery.extend({}, prop);
+			
+			jQuery.each( prop, function(name, val){
+				var e = new jQuery.fx( self, opt, name );
+
+				if ( /toggle|show|hide/.test(val) )
+					e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
+				else {
+					var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
+						start = e.cur(true) || 0;
+
+					if ( parts ) {
+						var end = parseFloat(parts[2]),
+							unit = parts[3] || "px";
+
+						// We need to compute starting value
+						if ( unit != "px" ) {
+							self.style[ name ] = (end || 1) + unit;
+							start = ((end || 1) / e.cur(true)) * start;
+							self.style[ name ] = start + unit;
+						}
+
+						// If a +=/-= token was provided, we're doing a relative animation
+						if ( parts[1] )
+							end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
+
+						e.custom( start, end, unit );
+					} else
+						e.custom( start, val, "" );
+				}
+			});
+
+			// For JS strict compliance
+			return true;
+		});
+	},
+	
+	queue: function(type, fn){
+		if ( jQuery.isFunction(type) ) {
+			fn = type;
+			type = "fx";
+		}
+
+		if ( !type || (typeof type == "string" && !fn) )
+			return queue( this[0], type );
+
+		return this.each(function(){
+			if ( fn.constructor == Array )
+				queue(this, type, fn);
+			else {
+				queue(this, type).push( fn );
+			
+				if ( queue(this, type).length == 1 )
+					fn.apply(this);
+			}
+		});
+	},
+
+	stop: function(){
+		var timers = jQuery.timers;
+
+		return this.each(function(){
+			for ( var i = 0; i < timers.length; i++ )
+				if ( timers[i].elem == this )
+					timers.splice(i--, 1);
+		}).dequeue();
+	}
+
+});
+
+var queue = function( elem, type, array ) {
+	if ( !elem )
+		return;
+
+	var q = jQuery.data( elem, type + "queue" );
+
+	if ( !q || array )
+		q = jQuery.data( elem, type + "queue", 
+			array ? jQuery.makeArray(array) : [] );
+
+	return q;
+};
+
+jQuery.fn.dequeue = function(type){
+	type = type || "fx";
+
+	return this.each(function(){
+		var q = queue(this, type);
+
+		q.shift();
+
+		if ( q.length )
+			q[0].apply( this );
+	});
+};
+
+jQuery.extend({
+	
+	speed: function(speed, easing, fn) {
+		var opt = speed && speed.constructor == Object ? speed : {
+			complete: fn || !fn && easing || 
+				jQuery.isFunction( speed ) && speed,
+			duration: speed,
+			easing: fn && easing || easing && easing.constructor != Function && easing
+		};
+
+		opt.duration = (opt.duration && opt.duration.constructor == Number ? 
+			opt.duration : 
+			{ slow: 600, fast: 200 }[opt.duration]) || 400;
+	
+		// Queueing
+		opt.old = opt.complete;
+		opt.complete = function(){
+			jQuery(this).dequeue();
+			if ( jQuery.isFunction( opt.old ) )
+				opt.old.apply( this );
+		};
+	
+		return opt;
+	},
+	
+	easing: {
+		linear: function( p, n, firstNum, diff ) {
+			return firstNum + diff * p;
+		},
+		swing: function( p, n, firstNum, diff ) {
+			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+		}
+	},
+	
+	timers: [],
+
+	fx: function( elem, options, prop ){
+		this.options = options;
+		this.elem = elem;
+		this.prop = prop;
+
+		if ( !options.orig )
+			options.orig = {};
+	}
+
+});
+
+jQuery.fx.prototype = {
+
+	// Simple function for setting a style value
+	update: function(){
+		if ( this.options.step )
+			this.options.step.apply( this.elem, [ this.now, this ] );
+
+		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+
+		// Set display property to block for height/width animations
+		if ( this.prop == "height" || this.prop == "width" )
+			this.elem.style.display = "block";
+	},
+
+	// Get the current size
+	cur: function(force){
+		if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null )
+			return this.elem[ this.prop ];
+
+		var r = parseFloat(jQuery.curCSS(this.elem, this.prop, force));
+		return r && r > -10000 ? r : parseFloat(jQuery.css(this.elem, this.prop)) || 0;
+	},
+
+	// Start an animation from one number to another
+	custom: function(from, to, unit){
+		this.startTime = (new Date()).getTime();
+		this.start = from;
+		this.end = to;
+		this.unit = unit || this.unit || "px";
+		this.now = this.start;
+		this.pos = this.state = 0;
+		this.update();
+
+		var self = this;
+		function t(){
+			return self.step();
+		}
+
+		t.elem = this.elem;
+
+		jQuery.timers.push(t);
+
+		if ( jQuery.timers.length == 1 ) {
+			var timer = setInterval(function(){
+				var timers = jQuery.timers;
+				
+				for ( var i = 0; i < timers.length; i++ )
+					if ( !timers[i]() )
+						timers.splice(i--, 1);
+
+				if ( !timers.length )
+					clearInterval( timer );
+			}, 13);
+		}
+	},
+
+	// Simple 'show' function
+	show: function(){
+		// Remember where we started, so that we can go back to it later
+		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
+		this.options.show = true;
+
+		// Begin the animation
+		this.custom(0, this.cur());
+
+		// Make sure that we start at a small width/height to avoid any
+		// flash of content
+		if ( this.prop == "width" || this.prop == "height" )
+			this.elem.style[this.prop] = "1px";
+		
+		// Start by showing the element
+		jQuery(this.elem).show();
+	},
+
+	// Simple 'hide' function
+	hide: function(){
+		// Remember where we started, so that we can go back to it later
+		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
+		this.options.hide = true;
+
+		// Begin the animation
+		this.custom(this.cur(), 0);
+	},
+
+	// Each step of an animation
+	step: function(){
+		var t = (new Date()).getTime();
+
+		if ( t > this.options.duration + this.startTime ) {
+			this.now = this.end;
+			this.pos = this.state = 1;
+			this.update();
+
+			this.options.curAnim[ this.prop ] = true;
+
+			var done = true;
+			for ( var i in this.options.curAnim )
+				if ( this.options.curAnim[i] !== true )
+					done = false;
+
+			if ( done ) {
+				if ( this.options.display != null ) {
+					// Reset the overflow
+					this.elem.style.overflow = this.options.overflow;
+				
+					// Reset the display
+					this.elem.style.display = this.options.display;
+					if ( jQuery.css(this.elem, "display") == "none" )
+						this.elem.style.display = "block";
+				}
+
+				// Hide the element if the "hide" operation was done
+				if ( this.options.hide )
+					this.elem.style.display = "none";
+
+				// Reset the properties, if the item has been hidden or shown
+				if ( this.options.hide || this.options.show )
+					for ( var p in this.options.curAnim )
+						jQuery.attr(this.elem.style, p, this.options.orig[p]);
+			}
+
+			// If a callback was provided, execute it
+			if ( done && jQuery.isFunction( this.options.complete ) )
+				// Execute the complete function
+				this.options.complete.apply( this.elem );
+
+			return false;
+		} else {
+			var n = t - this.startTime;
+			this.state = n / this.options.duration;
+
+			// Perform the easing function, defaults to swing
+			this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
+			this.now = this.start + ((this.end - this.start) * this.pos);
+
+			// Perform the next step of the animation
+			this.update();
+		}
+
+		return true;
+	}
+
+};
+
+jQuery.fx.step = {
+	scrollLeft: function(fx){
+		fx.elem.scrollLeft = fx.now;
+	},
+
+	scrollTop: function(fx){
+		fx.elem.scrollTop = fx.now;
+	},
+
+	opacity: function(fx){
+		jQuery.attr(fx.elem.style, "opacity", fx.now);
+	},
+
+	_default: function(fx){
+		fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+	}
+};
+// The Offset Method
+// Originally By Brandon Aaron, part of the Dimension Plugin
+// http://jquery.com/plugins/project/dimensions
+jQuery.fn.offset = function() {
+	var left = 0, top = 0, elem = this[0], results;
+	
+	if ( elem ) with ( jQuery.browser ) {
+		var	absolute     = jQuery.css(elem, "position") == "absolute", 
+		    parent       = elem.parentNode, 
+		    offsetParent = elem.offsetParent, 
+		    doc          = elem.ownerDocument,
+		    safari2      = safari && parseInt(version) < 522;
+	
+		// Use getBoundingClientRect if available
+		if ( elem.getBoundingClientRect ) {
+			box = elem.getBoundingClientRect();
+		
+			// Add the document scroll offsets
+			add(
+				box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
+				box.top  + Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop)
+			);
+		
+			// IE adds the HTML element's border, by default it is medium which is 2px
+			// IE 6 and IE 7 quirks mode the border width is overwritable by the following css html { border: 0; }
+			// IE 7 standards mode, the border is always 2px
+			if ( msie ) {
+				var border = jQuery("html").css("borderWidth");
+				border = (border == "medium" || jQuery.boxModel && parseInt(version) >= 7) && 2 || border;
+				add( -border, -border );
+			}
+	
+		// Otherwise loop through the offsetParents and parentNodes
+		} else {
+		
+			// Initial element offsets
+			add( elem.offsetLeft, elem.offsetTop );
+		
+			// Get parent offsets
+			while ( offsetParent ) {
+				// Add offsetParent offsets
+				add( offsetParent.offsetLeft, offsetParent.offsetTop );
+			
+				// Mozilla and Safari > 2 does not include the border on offset parents
+				// However Mozilla adds the border for table cells
+				if ( mozilla && /^t[d|h]$/i.test(parent.tagName) || !safari2 )
+					border( offsetParent );
+				
+				// Safari <= 2 doubles body offsets with an absolutely positioned element or parent
+				if ( safari2 && !absolute && jQuery.css(offsetParent, "position") == "absolute" )
+					absolute = true;
+			
+				// Get next offsetParent
+				offsetParent = offsetParent.offsetParent;
+			}
+		
+			// Get parent scroll offsets
+			while ( parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
+				// Work around opera inline/table scrollLeft/Top bug
+				if ( !/^inline|table-row.*$/i.test(jQuery.css(parent, "display")) )
+					// Subtract parent scroll offsets
+					add( -parent.scrollLeft, -parent.scrollTop );
+			
+				// Mozilla does not add the border for a parent that has overflow != visible
+				if ( mozilla && jQuery.css(parent, "overflow") != "visible" )
+					border( parent );
+			
+				// Get next parent
+				parent = parent.parentNode;
+			}
+		
+			// Safari doubles body offsets with an absolutely positioned element or parent
+			if ( safari2 && absolute )
+				add( -doc.body.offsetLeft, -doc.body.offsetTop );
+		}
+
+		// Return an object with top and left properties
+		results = { top: top, left: left };
+	}
+
+	return results;
+
+	function border(elem) {
+		add( jQuery.css(elem, "borderLeftWidth"), jQuery.css(elem, "borderTopWidth") );
+	}
+
+	function add(l, t) {
+		left += parseInt(l) || 0;
+		top += parseInt(t) || 0;
+	}
+};
+})();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/support/jquery-min.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,31 @@
+/*
+ * jQuery 1.2.1 - New Wave Javascript
+ *
+ * Copyright (c) 2007 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
+ * $Rev: 3353 $
+ */
+(function(){if(typeof jQuery!="undefined")var _jQuery=jQuery;var jQuery=window.jQuery=function(selector,context){return this instanceof jQuery?this.init(selector,context):new jQuery(selector,context);};if(typeof $!="undefined")var _$=$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(typeof selector=="string"){var m=quickExpr.exec(selector);if(m&&(m[1]||!context)){if(m[1])selector=jQuery.clean([m[1]],context);else{var tmp=document.getElementById(m[3]);if(tmp)if(tmp.id!=m[3])return jQuery().find(selector);else{this[0]=tmp;this.length=1;return this;}else
+selector=[];}}else
+return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.1",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(a){var ret=jQuery(a);ret.prevObject=this;return ret;},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this;},each:function(fn,args){return jQuery.each(this,fn,args);},index:function(obj){var pos=-1;this.each(function(i){if(this==obj)pos=i;});return pos;},attr:function(key,value,type){var obj=key;if(key.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],key)||undefined;else{obj={};obj[key]=value;}return this.each(function(index){for(var prop in obj)jQuery.attr(type?this.style:this,prop,jQuery.prop(this,obj[prop],type,index,prop));});},css:function(key,value){return this.attr(key,value,"curCSS");},text:function(e){if(typeof e!="object"&&e!=null)return this.empty().append(document.createTextNode(e));var t="";jQuery.each(e||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)t+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return t;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,1,function(a){this.appendChild(a);});},prepend:function(){return this.domManip(arguments,true,-1,function(a){this.insertBefore(a,this.firstChild);});},before:function(){return this.domManip(arguments,false,1,function(a){this.parentNode.insertBefore(a,this);});},after:function(){return this.domManip(arguments,false,-1,function(a){this.parentNode.insertBefore(a,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(t){var data=jQuery.map(this,function(a){return jQuery.find(t,a);});return this.pushStack(/[^+>] [^+>]/.test(t)||t.indexOf("..")>-1?jQuery.unique(data):data);},clone:function(events){var ret=this.map(function(){return this.outerHTML?jQuery(this.outerHTML)[0]:this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(t){return this.pushStack(jQuery.isFunction(t)&&jQuery.grep(this,function(el,index){return t.apply(el,[index]);})||jQuery.multiFilter(t,this));},not:function(t){return this.pushStack(t.constructor==String&&jQuery.multiFilter(t,this,true)||jQuery.grep(this,function(a){return(t.constructor==Array||t.jquery)?jQuery.inArray(a,t)<0:a!=t;}));},add:function(t){return this.pushStack(jQuery.merge(this.get(),t.constructor==String?jQuery(t).get():t.length!=undefined&&(!t.nodeName||jQuery.nodeName(t,"form"))?t:[t]));},is:function(expr){return expr?jQuery.multiFilter(expr,this).length>0:false;},hasClass:function(expr){return this.is("."+expr);},val:function(val){if(val==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,a=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){var val=jQuery.browser.msie&&!option.attributes["value"].specified?option.text:option.value;if(one)return val;a.push(val);}}return a;}else
+return this[0].value.replace(/\r/g,"");}}else
+return this.each(function(){if(val.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,val)>=0||jQuery.inArray(this.name,val)>=0);else if(jQuery.nodeName(this,"select")){var tmp=val.constructor==Array?val:[val];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,tmp)>=0||jQuery.inArray(this.text,tmp)>=0);});if(!tmp.length)this.selectedIndex=-1;}else
+this.value=val;});},html:function(val){return val==undefined?(this.length?this[0].innerHTML:null):this.empty().append(val);},replaceWith:function(val){return this.after(val).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(fn){return this.pushStack(jQuery.map(this,function(elem,i){return fn.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},domManip:function(args,table,dir,fn){var clone=this.length>1,a;return this.each(function(){if(!a){a=jQuery.clean(args,this.ownerDocument);if(dir<0)a.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(a[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(document.createElement("tbody"));jQuery.each(a,function(){var elem=clone?this.cloneNode(true):this;if(!evalScript(0,elem))fn.call(obj,elem);});});}};function evalScript(i,elem){var script=jQuery.nodeName(elem,"script");if(script){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
+jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}else if(elem.nodeType==1)jQuery("script",elem).each(evalScript);return script;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},a=1,al=arguments.length,deep=false;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};}if(al==1){target=this;a=0;}var prop;for(;a<al;a++)if((prop=arguments[a])!=null)for(var i in prop){if(target==prop[i])continue;if(deep&&typeof prop[i]=='object'&&target[i])jQuery.extend(target[i],prop[i]);else if(prop[i]!=undefined)target[i]=prop[i];}return target;};var expando="jQuery"+(new Date()).getTime(),uuid=0,win={};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/function/i.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){if(window.execScript)window.execScript(data);else if(jQuery.browser.safari)window.setTimeout(data,0);else
+eval.call(window,data);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?win:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!=undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?win:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(obj,fn,args){if(args){if(obj.length==undefined)for(var i in obj)fn.apply(obj[i],args);else
+for(var i=0,ol=obj.length;i<ol;i++)if(fn.apply(obj[i],args)===false)break;}else{if(obj.length==undefined)for(var i in obj)fn.call(obj[i],i,obj[i]);else
+for(var i=0,ol=obj.length,val=obj[0];i<ol&&fn.call(val,i,val)!==false;val=obj[++i]){}}return obj;},prop:function(elem,value,type,index,prop){if(jQuery.isFunction(value))value=value.call(elem,[index]);var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i;return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(prop)?value+"px":value;},className:{add:function(elem,c){jQuery.each((c||"").split(/\s+/),function(i,cur){if(!jQuery.className.has(elem.className,cur))elem.className+=(elem.className?" ":"")+cur;});},remove:function(elem,c){elem.className=c!=undefined?jQuery.grep(elem.className.split(/\s+/),function(cur){return!jQuery.className.has(c,cur);}).join(" "):"";},has:function(t,c){return jQuery.inArray(c,(t.className||t).toString().split(/\s+/))>-1;}},swap:function(e,o,f){for(var i in o){e.style["old"+i]=e.style[i];e.style[i]=o[i];}f.apply(e,[]);for(var i in o)e.style[i]=e.style["old"+i];},css:function(e,p){if(p=="height"||p=="width"){var old={},oHeight,oWidth,d=["Top","Bottom","Right","Left"];jQuery.each(d,function(){old["padding"+this]=0;old["border"+this+"Width"]=0;});jQuery.swap(e,old,function(){if(jQuery(e).is(':visible')){oHeight=e.offsetHeight;oWidth=e.offsetWidth;}else{e=jQuery(e.cloneNode(true)).find(":radio").removeAttr("checked").end().css({visibility:"hidden",position:"absolute",display:"block",right:"0",left:"0"}).appendTo(e.parentNode)[0];var parPos=jQuery.css(e.parentNode,"position")||"static";if(parPos=="static")e.parentNode.style.position="relative";oHeight=e.clientHeight;oWidth=e.clientWidth;if(parPos=="static")e.parentNode.style.position="static";e.parentNode.removeChild(e);}});return p=="height"?oHeight:oWidth;}return jQuery.curCSS(e,p);},curCSS:function(elem,prop,force){var ret,stack=[],swap=[];function color(a){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(a,null);return!ret||ret.getPropertyValue("color")=="";}if(prop=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(prop.match(/float/i))prop=styleFloat;if(!force&&elem.style[prop])ret=elem.style[prop];else if(document.defaultView&&document.defaultView.getComputedStyle){if(prop.match(/float/i))prop="float";prop=prop.replace(/([A-Z])/g,"-$1").toLowerCase();var cur=document.defaultView.getComputedStyle(elem,null);if(cur&&!color(elem))ret=cur.getPropertyValue(prop);else{for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(a=0;a<stack.length;a++)if(color(stack[a])){swap[a]=stack[a].style.display;stack[a].style.display="block";}ret=prop=="display"&&swap[stack.length-1]!=null?"none":document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop)||"";for(a=0;a<swap.length;a++)if(swap[a]!=null)stack[a].style.display=swap[a];}if(prop=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var newProp=prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});ret=elem.currentStyle[prop]||elem.currentStyle[newProp];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var style=elem.style.left;var runtimeStyle=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;elem.style.left=ret||0;ret=elem.style.pixelLeft+"px";elem.style.left=style;elem.runtimeStyle.left=runtimeStyle;}}return ret;},clean:function(a,doc){var r=[];doc=doc||document;jQuery.each(a,function(i,arg){if(!arg)return;if(arg.constructor==Number)arg=arg.toString();if(typeof arg=="string"){arg=arg.replace(/(<(\w+)[^>]*?)\/>/g,function(m,all,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)?m:all+"></"+tag+">";});var s=jQuery.trim(arg).toLowerCase(),div=doc.createElement("div"),tb=[];var wrap=!s.indexOf("<opt")&&[1,"<select>","</select>"]||!s.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||s.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!s.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!s.indexOf("<td")||!s.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!s.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+arg+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){if(!s.indexOf("<table")&&s.indexOf("<tbody")<0)tb=div.firstChild&&div.firstChild.childNodes;else if(wrap[1]=="<table>"&&s.indexOf("<tbody")<0)tb=div.childNodes;for(var n=tb.length-1;n>=0;--n)if(jQuery.nodeName(tb[n],"tbody")&&!tb[n].childNodes.length)tb[n].parentNode.removeChild(tb[n]);if(/^\s/.test(arg))div.insertBefore(doc.createTextNode(arg.match(/^\s*/)[0]),div.firstChild);}arg=jQuery.makeArray(div.childNodes);}if(0===arg.length&&(!jQuery.nodeName(arg,"form")&&!jQuery.nodeName(arg,"select")))return;if(arg[0]==undefined||jQuery.nodeName(arg,"form")||arg.options)r.push(arg);else
+r=jQuery.merge(r,arg);});return r;},attr:function(elem,name,value){var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(t){return(t||"").replace(/^\s+|\s+$/g,"");},makeArray:function(a){var r=[];if(typeof a!="array")for(var i=0,al=a.length;i<al;i++)r.push(a[i]);else
+r=a.slice(0);return r;},inArray:function(b,a){for(var i=0,al=a.length;i<al;i++)if(a[i]==b)return i;return-1;},merge:function(first,second){if(jQuery.browser.msie){for(var i=0;second[i];i++)if(second[i].nodeType!=8)first.push(second[i]);}else
+for(var i=0;second[i];i++)first.push(second[i]);return first;},unique:function(first){var r=[],done={};try{for(var i=0,fl=first.length;i<fl;i++){var id=jQuery.data(first[i]);if(!done[id]){done[id]=true;r.push(first[i]);}}}catch(e){r=first;}return r;},grep:function(elems,fn,inv){if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++)if(!inv&&fn(elems[i],i)||inv&&!fn(elems[i],i))result.push(elems[i]);return result;},map:function(elems,fn){if(typeof fn=="string")fn=eval("false||function(a){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++){var val=fn(elems[i],i);if(val!==null&&val!=undefined){if(val.constructor!=Array)val=[val];result=result.concat(val);}}return result;}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",styleFloat:jQuery.browser.msie?"styleFloat":"cssFloat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,innerHTML:"innerHTML",className:"className",value:"value",disabled:"disabled",checked:"checked",readonly:"readOnly",selected:"selected",maxlength:"maxLength"}});jQuery.each({parent:"a.parentNode",parents:"jQuery.dir(a,'parentNode')",next:"jQuery.nth(a,2,'nextSibling')",prev:"jQuery.nth(a,2,'previousSibling')",nextAll:"jQuery.dir(a,'nextSibling')",prevAll:"jQuery.dir(a,'previousSibling')",siblings:"jQuery.sibling(a.parentNode.firstChild,a)",children:"jQuery.sibling(a.firstChild)",contents:"jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"},function(i,n){jQuery.fn[i]=function(a){var ret=jQuery.map(this,n);if(a&&typeof a=="string")ret=jQuery.multiFilter(a,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(i,n){jQuery.fn[i]=function(){var a=arguments;return this.each(function(){for(var j=0,al=a.length;j<al;j++)jQuery(a[j])[n](this);});};});jQuery.each({removeAttr:function(key){jQuery.attr(this,key,"");this.removeAttribute(key);},addClass:function(c){jQuery.className.add(this,c);},removeClass:function(c){jQuery.className.remove(this,c);},toggleClass:function(c){jQuery.className[jQuery.className.has(this,c)?"remove":"add"](this,c);},remove:function(a){if(!a||jQuery.filter(a,[this]).r.length){jQuery.removeData(this);this.parentNode.removeChild(this);}},empty:function(){jQuery("*",this).each(function(){jQuery.removeData(this);});while(this.firstChild)this.removeChild(this.firstChild);}},function(i,n){jQuery.fn[i]=function(){return this.each(n,arguments);};});jQuery.each(["Height","Width"],function(i,name){var n=name.toLowerCase();jQuery.fn[n]=function(h){return this[0]==window?jQuery.browser.safari&&self["inner"+name]||jQuery.boxModel&&Math.max(document.documentElement["client"+name],document.body["client"+name])||document.body["client"+name]:this[0]==document?Math.max(document.body["scroll"+name],document.body["offset"+name]):h==undefined?(this.length?jQuery.css(this[0],n):null):this.css(n,h.constructor==String?h:h+"px");};});var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":"m[2]=='*'||jQuery.nodeName(a,m[2])","#":"a.getAttribute('id')==m[2]",":":{lt:"i<m[3]-0",gt:"i>m[3]-0",nth:"m[3]-0==i",eq:"m[3]-0==i",first:"i==0",last:"i==r.length-1",even:"i%2==0",odd:"i%2","first-child":"a.parentNode.getElementsByTagName('*')[0]==a","last-child":"jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a","only-child":"!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",parent:"a.firstChild",empty:"!a.firstChild",contains:"(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",visible:'"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',hidden:'"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',enabled:"!a.disabled",disabled:"a.disabled",checked:"a.checked",selected:"a.selected||jQuery.attr(a,'selected')",text:"'text'==a.type",radio:"'radio'==a.type",checkbox:"'checkbox'==a.type",file:"'file'==a.type",password:"'password'==a.type",submit:"'submit'==a.type",image:"'image'==a.type",reset:"'reset'==a.type",button:'"button"==a.type||jQuery.nodeName(a,"button")',input:"/input|select|textarea|button/i.test(a.nodeName)",has:"jQuery.find(m[3],a).length",header:"/h\\d/i.test(a.nodeName)",animated:"jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&!context.nodeType)context=null;context=context||document;var ret=[context],done=[],last;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){var nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName.toUpperCase()))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var nodeName=m[2],merge={};m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName.toUpperCase()){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=jQuery.filter(m[3],r,true).r;else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(\d*)n\+?(\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"n+"+m[3]||m[3]),first=(test[1]||1)-0,last=test[2]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==1){if(last==0||node.nodeIndex==last)add=true;}else if((node.nodeIndex+last)%first==0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var f=jQuery.expr[m[1]];if(typeof f!="string")f=jQuery.expr[m[1]][m[2]];f=eval("false||function(a,i){return "+f+"}");r=jQuery.grep(r,f,not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(element,type,handler,data){if(jQuery.browser.msie&&element.setInterval!=undefined)element=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var parts=type.split(".");type=parts[0];handler.type=parts[1];var events=jQuery.data(element,"events")||jQuery.data(element,"events",{});var handle=jQuery.data(element,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(element,arguments);return val;});var handlers=events[type];if(!handlers){handlers=events[type]={};if(element.addEventListener)element.addEventListener(type,handle,false);else
+element.attachEvent("on"+type,handle);}handlers[handler.guid]=handler;this.global[type]=true;},guid:1,global:{},remove:function(element,type,handler){var events=jQuery.data(element,"events"),ret,index;if(typeof type=="string"){var parts=type.split(".");type=parts[0];}if(events){if(type&&type.type){handler=type.handler;type=type.type;}if(!type){for(type in events)this.remove(element,type);}else if(events[type]){if(handler)delete events[type][handler.guid];else
+for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(element.removeEventListener)element.removeEventListener(type,jQuery.data(element,"handle"),false);else
+element.detachEvent("on"+type,jQuery.data(element,"handle"));ret=null;delete events[type];}}for(ret in events)break;if(!ret){jQuery.removeData(element,"events");jQuery.removeData(element,"handle");}}},trigger:function(type,data,element,donative,extra){data=jQuery.makeArray(data||[]);if(!element){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{var val,ret,fn=jQuery.isFunction(element[type]||null),evt=!data[0]||!data[0].preventDefault;if(evt)data.unshift(this.fix({type:type,target:element}));data[0].type=type;if(jQuery.isFunction(jQuery.data(element,"handle")))val=jQuery.data(element,"handle").apply(element,data);if(!fn&&element["on"+type]&&element["on"+type].apply(element,data)===false)val=false;if(evt)data.shift();if(extra&&extra.apply(element,data)===false)val=false;if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(element,'a')&&type=="click")){this.triggered=true;element[type]();}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var c=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in c){args[0].handler=c[j];args[0].data=c[j].data;if(!parts[1]||c[j].type==parts[1]){var tmp=c[j].apply(this,args);if(val!==false)val=tmp;if(tmp===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target&&event.srcElement)event.target=event.srcElement;if(jQuery.browser.safari&&event.target.nodeType==3)event.target=originalEvent.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var e=document.documentElement,b=document.body;event.pageX=event.clientX+(e&&e.scrollLeft||b.scrollLeft||0);event.pageY=event.clientY+(e&&e.scrollTop||b.scrollTop||0);}if(!event.which&&(event.charCode||event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(){var a=arguments;return this.click(function(e){this.lastToggle=0==this.lastToggle?1:0;e.preventDefault();return a[this.lastToggle].apply(this,[e])||false;});},hover:function(f,g){function handleHover(e){var p=e.relatedTarget;while(p&&p!=this)try{p=p.parentNode;}catch(e){p=this;};if(p==this)return false;return(e.type=="mouseover"?f:g).apply(this,[e]);}return this.mouseover(handleHover).mouseout(handleHover);},ready:function(f){bindReady();if(jQuery.isReady)f.apply(document,[jQuery]);else
+jQuery.readyList.push(function(){return f.apply(this,[jQuery]);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}if(jQuery.browser.mozilla||jQuery.browser.opera)document.removeEventListener("DOMContentLoaded",jQuery.ready,false);if(!window.frames.length)jQuery(window).load(function(){jQuery("#__ie_init").remove();});}}});jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,o){jQuery.fn[o]=function(f){return f?this.bind(o,f):this.trigger(o);};});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(jQuery.browser.mozilla||jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);else if(jQuery.browser.msie){document.write("<scr"+"ipt id=__ie_init defer=true "+"src=//:><\/script>");var script=document.getElementById("__ie_init");if(script)script.onreadystatechange=function(){if(this.readyState!="complete")return;jQuery.ready();};script=null;}else if(jQuery.browser.safari)jQuery.safariTimer=setInterval(function(){if(document.readyState=="loaded"||document.readyState=="complete"){clearInterval(jQuery.safariTimer);jQuery.safariTimer=null;jQuery.ready();}},10);jQuery.event.add(window,"load",jQuery.ready);}jQuery.fn.extend({load:function(url,params,callback){if(jQuery.isFunction(url))return this.bind("load",url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);setTimeout(function(){self.each(callback,[res.responseText,status,res]);},13);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null},lastModified:{},ajax:function(s){var jsonp,jsre=/=(\?|%3F)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=s.data.replace(jsre,"="+jsonp);s.url=s.url.replace(jsre,"="+jsonp);s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get")s.url+=(s.url.match(/\?/)?"&":"?")+"_="+(new Date()).getTime();if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if(!s.url.indexOf("http")&&s.dataType=="script"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(!jsonp&&(s.success||s.complete)){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async);if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
+jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();return xml;function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
+for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
+s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock?this.oldblock:"";if(jQuery.css(this,"display")=="none")this.style.display="block";}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");if(this.oldblock=="none")this.oldblock="block";this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var opt=jQuery.speed(speed,easing,callback);return this[opt.queue===false?"each":"queue"](function(){opt=jQuery.extend({},opt);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
+e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(){var timers=jQuery.timers;return this.each(function(){for(var i=0;i<timers.length;i++)if(timers[i].elem==this)timers.splice(i--,1);}).dequeue();}});var queue=function(elem,type,array){if(!elem)return;var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.curCSS(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.css(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(){return self.step();}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timers.length==1){var timer=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length)clearInterval(timer);},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(){var t=(new Date()).getTime();if(t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var absolute=jQuery.css(elem,"position")=="absolute",parent=elem.parentNode,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522;if(elem.getBoundingClientRect){box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));if(msie){var border=jQuery("html").css("borderWidth");border=(border=="medium"||jQuery.boxModel&&parseInt(version)>=7)&&2||border;add(-border,-border);}}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&/^t[d|h]$/i.test(parent.tagName)||!safari2)border(offsetParent);if(safari2&&!absolute&&jQuery.css(offsetParent,"position")=="absolute")absolute=true;offsetParent=offsetParent.offsetParent;}while(parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table-row.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if(safari2&&absolute)add(-doc.body.offsetLeft,-doc.body.offsetTop);}results={top:top,left:left};}return results;function border(elem){add(jQuery.css(elem,"borderLeftWidth"),jQuery.css(elem,"borderTopWidth"));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}};})();
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/support/jquery.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,2992 @@
+(function(){
+/*
+ * jQuery 1.2.1 - New Wave Javascript
+ *
+ * Copyright (c) 2007 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
+ * $Rev: 3353 $
+ */
+
+// Map over jQuery in case of overwrite
+if ( typeof jQuery != "undefined" )
+	var _jQuery = jQuery;
+
+var jQuery = window.jQuery = function(selector, context) {
+	// If the context is a namespace object, return a new object
+	return this instanceof jQuery ?
+		this.init(selector, context) :
+		new jQuery(selector, context);
+};
+
+// Map over the $ in case of overwrite
+if ( typeof $ != "undefined" )
+	var _$ = $;
+	
+// Map the jQuery namespace to the '$' one
+window.$ = jQuery;
+
+var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;
+
+jQuery.fn = jQuery.prototype = {
+	init: function(selector, context) {
+		// Make sure that a selection was provided
+		selector = selector || document;
+
+		// Handle HTML strings
+		if ( typeof selector  == "string" ) {
+			var m = quickExpr.exec(selector);
+			if ( m && (m[1] || !context) ) {
+				// HANDLE: $(html) -> $(array)
+				if ( m[1] )
+					selector = jQuery.clean( [ m[1] ], context );
+
+				// HANDLE: $("#id")
+				else {
+					var tmp = document.getElementById( m[3] );
+					if ( tmp )
+						// Handle the case where IE and Opera return items
+						// by name instead of ID
+						if ( tmp.id != m[3] )
+							return jQuery().find( selector );
+						else {
+							this[0] = tmp;
+							this.length = 1;
+							return this;
+						}
+					else
+						selector = [];
+				}
+
+			// HANDLE: $(expr)
+			} else
+				return new jQuery( context ).find( selector );
+
+		// HANDLE: $(function)
+		// Shortcut for document ready
+		} else if ( jQuery.isFunction(selector) )
+			return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( selector );
+
+		return this.setArray(
+			// HANDLE: $(array)
+			selector.constructor == Array && selector ||
+
+			// HANDLE: $(arraylike)
+			// Watch for when an array-like object is passed as the selector
+			(selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) ||
+
+			// HANDLE: $(*)
+			[ selector ] );
+	},
+	
+	jquery: "1.2.1",
+
+	size: function() {
+		return this.length;
+	},
+	
+	length: 0,
+
+	get: function( num ) {
+		return num == undefined ?
+
+			// Return a 'clean' array
+			jQuery.makeArray( this ) :
+
+			// Return just the object
+			this[num];
+	},
+	
+	pushStack: function( a ) {
+		var ret = jQuery(a);
+		ret.prevObject = this;
+		return ret;
+	},
+	
+	setArray: function( a ) {
+		this.length = 0;
+		Array.prototype.push.apply( this, a );
+		return this;
+	},
+
+	each: function( fn, args ) {
+		return jQuery.each( this, fn, args );
+	},
+
+	index: function( obj ) {
+		var pos = -1;
+		this.each(function(i){
+			if ( this == obj ) pos = i;
+		});
+		return pos;
+	},
+
+	attr: function( key, value, type ) {
+		var obj = key;
+		
+		// Look for the case where we're accessing a style value
+		if ( key.constructor == String )
+			if ( value == undefined )
+				return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined;
+			else {
+				obj = {};
+				obj[ key ] = value;
+			}
+		
+		// Check to see if we're setting style values
+		return this.each(function(index){
+			// Set all the styles
+			for ( var prop in obj )
+				jQuery.attr(
+					type ? this.style : this,
+					prop, jQuery.prop(this, obj[prop], type, index, prop)
+				);
+		});
+	},
+
+	css: function( key, value ) {
+		return this.attr( key, value, "curCSS" );
+	},
+
+	text: function(e) {
+		if ( typeof e != "object" && e != null )
+			return this.empty().append( document.createTextNode( e ) );
+
+		var t = "";
+		jQuery.each( e || this, function(){
+			jQuery.each( this.childNodes, function(){
+				if ( this.nodeType != 8 )
+					t += this.nodeType != 1 ?
+						this.nodeValue : jQuery.fn.text([ this ]);
+			});
+		});
+		return t;
+	},
+
+	wrapAll: function(html) {
+		if ( this[0] )
+			// The elements to wrap the target around
+			jQuery(html, this[0].ownerDocument)
+				.clone()
+				.insertBefore(this[0])
+				.map(function(){
+					var elem = this;
+					while ( elem.firstChild )
+						elem = elem.firstChild;
+					return elem;
+				})
+				.append(this);
+
+		return this;
+	},
+
+	wrapInner: function(html) {
+		return this.each(function(){
+			jQuery(this).contents().wrapAll(html);
+		});
+	},
+
+	wrap: function(html) {
+		return this.each(function(){
+			jQuery(this).wrapAll(html);
+		});
+	},
+
+	append: function() {
+		return this.domManip(arguments, true, 1, function(a){
+			this.appendChild( a );
+		});
+	},
+
+	prepend: function() {
+		return this.domManip(arguments, true, -1, function(a){
+			this.insertBefore( a, this.firstChild );
+		});
+	},
+	
+	before: function() {
+		return this.domManip(arguments, false, 1, function(a){
+			this.parentNode.insertBefore( a, this );
+		});
+	},
+
+	after: function() {
+		return this.domManip(arguments, false, -1, function(a){
+			this.parentNode.insertBefore( a, this.nextSibling );
+		});
+	},
+
+	end: function() {
+		return this.prevObject || jQuery([]);
+	},
+
+	find: function(t) {
+		var data = jQuery.map(this, function(a){ return jQuery.find(t,a); });
+		return this.pushStack( /[^+>] [^+>]/.test( t ) || t.indexOf("..") > -1 ?
+			jQuery.unique( data ) : data );
+	},
+
+	clone: function(events) {
+		// Do the clone
+		var ret = this.map(function(){
+			return this.outerHTML ? jQuery(this.outerHTML)[0] : this.cloneNode(true);
+		});
+
+		// Need to set the expando to null on the cloned set if it exists
+		// removeData doesn't work here, IE removes it from the original as well
+		// this is primarily for IE but the data expando shouldn't be copied over in any browser
+		var clone = ret.find("*").andSelf().each(function(){
+			if ( this[ expando ] != undefined )
+				this[ expando ] = null;
+		});
+		
+		// Copy the events from the original to the clone
+		if (events === true)
+			this.find("*").andSelf().each(function(i) {
+				var events = jQuery.data(this, "events");
+				for ( var type in events )
+					for ( var handler in events[type] )
+						jQuery.event.add(clone[i], type, events[type][handler], events[type][handler].data);
+			});
+
+		// Return the cloned set
+		return ret;
+	},
+
+	filter: function(t) {
+		return this.pushStack(
+			jQuery.isFunction( t ) &&
+			jQuery.grep(this, function(el, index){
+				return t.apply(el, [index]);
+			}) ||
+
+			jQuery.multiFilter(t,this) );
+	},
+
+	not: function(t) {
+		return this.pushStack(
+			t.constructor == String &&
+			jQuery.multiFilter(t, this, true) ||
+
+			jQuery.grep(this, function(a) {
+				return ( t.constructor == Array || t.jquery )
+					? jQuery.inArray( a, t ) < 0
+					: a != t;
+			})
+		);
+	},
+
+	add: function(t) {
+		return this.pushStack( jQuery.merge(
+			this.get(),
+			t.constructor == String ?
+				jQuery(t).get() :
+				t.length != undefined && (!t.nodeName || jQuery.nodeName(t, "form")) ?
+					t : [t] )
+		);
+	},
+
+	is: function(expr) {
+		return expr ? jQuery.multiFilter(expr,this).length > 0 : false;
+	},
+
+	hasClass: function(expr) {
+		return this.is("." + expr);
+	},
+	
+	val: function( val ) {
+		if ( val == undefined ) {
+			if ( this.length ) {
+				var elem = this[0];
+		    	
+				// We need to handle select boxes special
+				if ( jQuery.nodeName(elem, "select") ) {
+					var index = elem.selectedIndex,
+						a = [],
+						options = elem.options,
+						one = elem.type == "select-one";
+					
+					// Nothing was selected
+					if ( index < 0 )
+						return null;
+
+					// Loop through all the selected options
+					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+						var option = options[i];
+						if ( option.selected ) {
+							// Get the specifc value for the option
+							var val = jQuery.browser.msie && !option.attributes["value"].specified ? option.text : option.value;
+							
+							// We don't need an array for one selects
+							if ( one )
+								return val;
+							
+							// Multi-Selects return an array
+							a.push(val);
+						}
+					}
+					
+					return a;
+					
+				// Everything else, we just grab the value
+				} else
+					return this[0].value.replace(/\r/g, "");
+			}
+		} else
+			return this.each(function(){
+				if ( val.constructor == Array && /radio|checkbox/.test(this.type) )
+					this.checked = (jQuery.inArray(this.value, val) >= 0 ||
+						jQuery.inArray(this.name, val) >= 0);
+				else if ( jQuery.nodeName(this, "select") ) {
+					var tmp = val.constructor == Array ? val : [val];
+
+					jQuery("option", this).each(function(){
+						this.selected = (jQuery.inArray(this.value, tmp) >= 0 ||
+						jQuery.inArray(this.text, tmp) >= 0);
+					});
+
+					if ( !tmp.length )
+						this.selectedIndex = -1;
+				} else
+					this.value = val;
+			});
+	},
+	
+	html: function( val ) {
+		return val == undefined ?
+			( this.length ? this[0].innerHTML : null ) :
+			this.empty().append( val );
+	},
+
+	replaceWith: function( val ) {
+		return this.after( val ).remove();
+	},
+
+	eq: function(i){
+		return this.slice(i, i+1);
+	},
+
+	slice: function() {
+		return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
+	},
+
+	map: function(fn) {
+		return this.pushStack(jQuery.map( this, function(elem,i){
+			return fn.call( elem, i, elem );
+		}));
+	},
+
+	andSelf: function() {
+		return this.add( this.prevObject );
+	},
+	
+	domManip: function(args, table, dir, fn) {
+		var clone = this.length > 1, a; 
+
+		return this.each(function(){
+			if ( !a ) {
+				a = jQuery.clean(args, this.ownerDocument);
+				if ( dir < 0 )
+					a.reverse();
+			}
+
+			var obj = this;
+
+			if ( table && jQuery.nodeName(this, "table") && jQuery.nodeName(a[0], "tr") )
+				obj = this.getElementsByTagName("tbody")[0] || this.appendChild(document.createElement("tbody"));
+
+			jQuery.each( a, function(){
+				var elem = clone ? this.cloneNode(true) : this;
+				if ( !evalScript(0, elem) )
+					fn.call( obj, elem );
+			});
+		});
+	}
+};
+
+function evalScript(i, elem){
+	var script = jQuery.nodeName(elem, "script");
+
+	if ( script ) {
+		if ( elem.src )
+			jQuery.ajax({ url: elem.src, async: false, dataType: "script" });
+		else
+			jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
+	
+		if ( elem.parentNode )
+			elem.parentNode.removeChild(elem);
+
+	} else if ( elem.nodeType == 1 )
+    jQuery("script", elem).each(evalScript);
+
+	return script;
+}
+
+jQuery.extend = jQuery.fn.extend = function() {
+	// copy reference to target object
+	var target = arguments[0] || {}, a = 1, al = arguments.length, deep = false;
+
+	// Handle a deep copy situation
+	if ( target.constructor == Boolean ) {
+		deep = target;
+		target = arguments[1] || {};
+	}
+
+	// extend jQuery itself if only one argument is passed
+	if ( al == 1 ) {
+		target = this;
+		a = 0;
+	}
+
+	var prop;
+
+	for ( ; a < al; a++ )
+		// Only deal with non-null/undefined values
+		if ( (prop = arguments[a]) != null )
+			// Extend the base object
+			for ( var i in prop ) {
+				// Prevent never-ending loop
+				if ( target == prop[i] )
+					continue;
+
+				// Recurse if we're merging object values
+				if ( deep && typeof prop[i] == 'object' && target[i] )
+					jQuery.extend( target[i], prop[i] );
+
+				// Don't bring in undefined values
+				else if ( prop[i] != undefined )
+					target[i] = prop[i];
+			}
+
+	// Return the modified object
+	return target;
+};
+
+var expando = "jQuery" + (new Date()).getTime(), uuid = 0, win = {};
+
+jQuery.extend({
+	noConflict: function(deep) {
+		window.$ = _$;
+		if ( deep )
+			window.jQuery = _jQuery;
+		return jQuery;
+	},
+
+	// This may seem like some crazy code, but trust me when I say that this
+	// is the only cross-browser way to do this. --John
+	isFunction: function( fn ) {
+		return !!fn && typeof fn != "string" && !fn.nodeName && 
+			fn.constructor != Array && /function/i.test( fn + "" );
+	},
+	
+	// check if an element is in a XML document
+	isXMLDoc: function(elem) {
+		return elem.documentElement && !elem.body ||
+			elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
+	},
+
+	// Evalulates a script in a global context
+	// Evaluates Async. in Safari 2 :-(
+	globalEval: function( data ) {
+		data = jQuery.trim( data );
+		if ( data ) {
+			if ( window.execScript )
+				window.execScript( data );
+			else if ( jQuery.browser.safari )
+				// safari doesn't provide a synchronous global eval
+				window.setTimeout( data, 0 );
+			else
+				eval.call( window, data );
+		}
+	},
+
+	nodeName: function( elem, name ) {
+		return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
+	},
+	
+	cache: {},
+	
+	data: function( elem, name, data ) {
+		elem = elem == window ? win : elem;
+
+		var id = elem[ expando ];
+
+		// Compute a unique ID for the element
+		if ( !id ) 
+			id = elem[ expando ] = ++uuid;
+
+		// Only generate the data cache if we're
+		// trying to access or manipulate it
+		if ( name && !jQuery.cache[ id ] )
+			jQuery.cache[ id ] = {};
+		
+		// Prevent overriding the named cache with undefined values
+		if ( data != undefined )
+			jQuery.cache[ id ][ name ] = data;
+		
+		// Return the named cache data, or the ID for the element	
+		return name ? jQuery.cache[ id ][ name ] : id;
+	},
+	
+	removeData: function( elem, name ) {
+		elem = elem == window ? win : elem;
+
+		var id = elem[ expando ];
+
+		// If we want to remove a specific section of the element's data
+		if ( name ) {
+			if ( jQuery.cache[ id ] ) {
+				// Remove the section of cache data
+				delete jQuery.cache[ id ][ name ];
+
+				// If we've removed all the data, remove the element's cache
+				name = "";
+				for ( name in jQuery.cache[ id ] ) break;
+				if ( !name )
+					jQuery.removeData( elem );
+			}
+
+		// Otherwise, we want to remove all of the element's data
+		} else {
+			// Clean up the element expando
+			try {
+				delete elem[ expando ];
+			} catch(e){
+				// IE has trouble directly removing the expando
+				// but it's ok with using removeAttribute
+				if ( elem.removeAttribute )
+					elem.removeAttribute( expando );
+			}
+
+			// Completely remove the data cache
+			delete jQuery.cache[ id ];
+		}
+	},
+
+	// args is for internal usage only
+	each: function( obj, fn, args ) {
+		if ( args ) {
+			if ( obj.length == undefined )
+				for ( var i in obj )
+					fn.apply( obj[i], args );
+			else
+				for ( var i = 0, ol = obj.length; i < ol; i++ )
+					if ( fn.apply( obj[i], args ) === false ) break;
+
+		// A special, fast, case for the most common use of each
+		} else {
+			if ( obj.length == undefined )
+				for ( var i in obj )
+					fn.call( obj[i], i, obj[i] );
+			else
+				for ( var i = 0, ol = obj.length, val = obj[0]; 
+					i < ol && fn.call(val,i,val) !== false; val = obj[++i] ){}
+		}
+
+		return obj;
+	},
+	
+	prop: function(elem, value, type, index, prop){
+			// Handle executable functions
+			if ( jQuery.isFunction( value ) )
+				value = value.call( elem, [index] );
+				
+			// exclude the following css properties to add px
+			var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
+
+			// Handle passing in a number to a CSS property
+			return value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) ?
+				value + "px" :
+				value;
+	},
+
+	className: {
+		// internal only, use addClass("class")
+		add: function( elem, c ){
+			jQuery.each( (c || "").split(/\s+/), function(i, cur){
+				if ( !jQuery.className.has( elem.className, cur ) )
+					elem.className += ( elem.className ? " " : "" ) + cur;
+			});
+		},
+
+		// internal only, use removeClass("class")
+		remove: function( elem, c ){
+			elem.className = c != undefined ?
+				jQuery.grep( elem.className.split(/\s+/), function(cur){
+					return !jQuery.className.has( c, cur );	
+				}).join(" ") : "";
+		},
+
+		// internal only, use is(".class")
+		has: function( t, c ) {
+			return jQuery.inArray( c, (t.className || t).toString().split(/\s+/) ) > -1;
+		}
+	},
+
+	swap: function(e,o,f) {
+		for ( var i in o ) {
+			e.style["old"+i] = e.style[i];
+			e.style[i] = o[i];
+		}
+		f.apply( e, [] );
+		for ( var i in o )
+			e.style[i] = e.style["old"+i];
+	},
+
+	css: function(e,p) {
+		if ( p == "height" || p == "width" ) {
+			var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"];
+
+			jQuery.each( d, function(){
+				old["padding" + this] = 0;
+				old["border" + this + "Width"] = 0;
+			});
+
+			jQuery.swap( e, old, function() {
+				if ( jQuery(e).is(':visible') ) {
+					oHeight = e.offsetHeight;
+					oWidth = e.offsetWidth;
+				} else {
+					e = jQuery(e.cloneNode(true))
+						.find(":radio").removeAttr("checked").end()
+						.css({
+							visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0"
+						}).appendTo(e.parentNode)[0];
+
+					var parPos = jQuery.css(e.parentNode,"position") || "static";
+					if ( parPos == "static" )
+						e.parentNode.style.position = "relative";
+
+					oHeight = e.clientHeight;
+					oWidth = e.clientWidth;
+
+					if ( parPos == "static" )
+						e.parentNode.style.position = "static";
+
+					e.parentNode.removeChild(e);
+				}
+			});
+
+			return p == "height" ? oHeight : oWidth;
+		}
+
+		return jQuery.curCSS( e, p );
+	},
+
+	curCSS: function(elem, prop, force) {
+		var ret, stack = [], swap = [];
+
+		// A helper method for determining if an element's values are broken
+		function color(a){
+			if ( !jQuery.browser.safari )
+				return false;
+
+			var ret = document.defaultView.getComputedStyle(a,null);
+			return !ret || ret.getPropertyValue("color") == "";
+		}
+
+		if (prop == "opacity" && jQuery.browser.msie) {
+			ret = jQuery.attr(elem.style, "opacity");
+			return ret == "" ? "1" : ret;
+		}
+		
+		if (prop.match(/float/i))
+			prop = styleFloat;
+
+		if (!force && elem.style[prop])
+			ret = elem.style[prop];
+
+		else if (document.defaultView && document.defaultView.getComputedStyle) {
+
+			if (prop.match(/float/i))
+				prop = "float";
+
+			prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase();
+			var cur = document.defaultView.getComputedStyle(elem, null);
+
+			if ( cur && !color(elem) )
+				ret = cur.getPropertyValue(prop);
+
+			// If the element isn't reporting its values properly in Safari
+			// then some display: none elements are involved
+			else {
+				// Locate all of the parent display: none elements
+				for ( var a = elem; a && color(a); a = a.parentNode )
+					stack.unshift(a);
+
+				// Go through and make them visible, but in reverse
+				// (It would be better if we knew the exact display type that they had)
+				for ( a = 0; a < stack.length; a++ )
+					if ( color(stack[a]) ) {
+						swap[a] = stack[a].style.display;
+						stack[a].style.display = "block";
+					}
+
+				// Since we flip the display style, we have to handle that
+				// one special, otherwise get the value
+				ret = prop == "display" && swap[stack.length-1] != null ?
+					"none" :
+					document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop) || "";
+
+				// Finally, revert the display styles back
+				for ( a = 0; a < swap.length; a++ )
+					if ( swap[a] != null )
+						stack[a].style.display = swap[a];
+			}
+
+			if ( prop == "opacity" && ret == "" )
+				ret = "1";
+
+		} else if (elem.currentStyle) {
+			var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});
+			ret = elem.currentStyle[prop] || elem.currentStyle[newProp];
+
+			// From the awesome hack by Dean Edwards
+			// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+			// If we're not dealing with a regular pixel number
+			// but a number that has a weird ending, we need to convert it to pixels
+			if ( !/^\d+(px)?$/i.test(ret) && /^\d/.test(ret) ) {
+				var style = elem.style.left;
+				var runtimeStyle = elem.runtimeStyle.left;
+				elem.runtimeStyle.left = elem.currentStyle.left;
+				elem.style.left = ret || 0;
+				ret = elem.style.pixelLeft + "px";
+				elem.style.left = style;
+				elem.runtimeStyle.left = runtimeStyle;
+			}
+		}
+
+		return ret;
+	},
+	
+	clean: function(a, doc) {
+		var r = [];
+		doc = doc || document;
+
+		jQuery.each( a, function(i,arg){
+			if ( !arg ) return;
+
+			if ( arg.constructor == Number )
+				arg = arg.toString();
+			
+			// Convert html string into DOM nodes
+			if ( typeof arg == "string" ) {
+				// Fix "XHTML"-style tags in all browsers
+				arg = arg.replace(/(<(\w+)[^>]*?)\/>/g, function(m, all, tag){
+					return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)? m : all+"></"+tag+">";
+				});
+
+				// Trim whitespace, otherwise indexOf won't work as expected
+				var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = [];
+
+				var wrap =
+					// option or optgroup
+					!s.indexOf("<opt") &&
+					[1, "<select>", "</select>"] ||
+					
+					!s.indexOf("<leg") &&
+					[1, "<fieldset>", "</fieldset>"] ||
+					
+					s.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
+					[1, "<table>", "</table>"] ||
+					
+					!s.indexOf("<tr") &&
+					[2, "<table><tbody>", "</tbody></table>"] ||
+					
+				 	// <thead> matched above
+					(!s.indexOf("<td") || !s.indexOf("<th")) &&
+					[3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
+					
+					!s.indexOf("<col") &&
+					[2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] ||
+
+					// IE can't serialize <link> and <script> tags normally
+					jQuery.browser.msie &&
+					[1, "div<div>", "</div>"] ||
+					
+					[0,"",""];
+
+				// Go to html and back, then peel off extra wrappers
+				div.innerHTML = wrap[1] + arg + wrap[2];
+				
+				// Move to the right depth
+				while ( wrap[0]-- )
+					div = div.lastChild;
+				
+				// Remove IE's autoinserted <tbody> from table fragments
+				if ( jQuery.browser.msie ) {
+					
+					// String was a <table>, *may* have spurious <tbody>
+					if ( !s.indexOf("<table") && s.indexOf("<tbody") < 0 ) 
+						tb = div.firstChild && div.firstChild.childNodes;
+						
+					// String was a bare <thead> or <tfoot>
+					else if ( wrap[1] == "<table>" && s.indexOf("<tbody") < 0 )
+						tb = div.childNodes;
+
+					for ( var n = tb.length-1; n >= 0 ; --n )
+						if ( jQuery.nodeName(tb[n], "tbody") && !tb[n].childNodes.length )
+							tb[n].parentNode.removeChild(tb[n]);
+	
+					// IE completely kills leading whitespace when innerHTML is used	
+					if ( /^\s/.test(arg) )	
+						div.insertBefore( doc.createTextNode( arg.match(/^\s*/)[0] ), div.firstChild );
+
+				}
+				
+				arg = jQuery.makeArray( div.childNodes );
+			}
+
+			if ( 0 === arg.length && (!jQuery.nodeName(arg, "form") && !jQuery.nodeName(arg, "select")) )
+				return;
+
+			if ( arg[0] == undefined || jQuery.nodeName(arg, "form") || arg.options )
+				r.push( arg );
+			else
+				r = jQuery.merge( r, arg );
+
+		});
+
+		return r;
+	},
+	
+	attr: function(elem, name, value){
+		var fix = jQuery.isXMLDoc(elem) ? {} : jQuery.props;
+
+		// Safari mis-reports the default selected property of a hidden option
+		// Accessing the parent's selectedIndex property fixes it
+		if ( name == "selected" && jQuery.browser.safari )
+			elem.parentNode.selectedIndex;
+		
+		// Certain attributes only work when accessed via the old DOM 0 way
+		if ( fix[name] ) {
+			if ( value != undefined ) elem[fix[name]] = value;
+			return elem[fix[name]];
+		} else if ( jQuery.browser.msie && name == "style" )
+			return jQuery.attr( elem.style, "cssText", value );
+
+		else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName(elem, "form") && (name == "action" || name == "method") )
+			return elem.getAttributeNode(name).nodeValue;
+
+		// IE elem.getAttribute passes even for style
+		else if ( elem.tagName ) {
+
+			if ( value != undefined ) {
+				if ( name == "type" && jQuery.nodeName(elem,"input") && elem.parentNode )
+					throw "type property can't be changed";
+				elem.setAttribute( name, value );
+			}
+
+			if ( jQuery.browser.msie && /href|src/.test(name) && !jQuery.isXMLDoc(elem) ) 
+				return elem.getAttribute( name, 2 );
+
+			return elem.getAttribute( name );
+
+		// elem is actually elem.style ... set the style
+		} else {
+			// IE actually uses filters for opacity
+			if ( name == "opacity" && jQuery.browser.msie ) {
+				if ( value != undefined ) {
+					// IE has trouble with opacity if it does not have layout
+					// Force it by setting the zoom level
+					elem.zoom = 1; 
+	
+					// Set the alpha filter to set the opacity
+					elem.filter = (elem.filter || "").replace(/alpha\([^)]*\)/,"") +
+						(parseFloat(value).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
+				}
+	
+				return elem.filter ? 
+					(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100).toString() : "";
+			}
+			name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});
+			if ( value != undefined ) elem[name] = value;
+			return elem[name];
+		}
+	},
+	
+	trim: function(t){
+		return (t||"").replace(/^\s+|\s+$/g, "");
+	},
+
+	makeArray: function( a ) {
+		var r = [];
+
+		// Need to use typeof to fight Safari childNodes crashes
+		if ( typeof a != "array" )
+			for ( var i = 0, al = a.length; i < al; i++ )
+				r.push( a[i] );
+		else
+			r = a.slice( 0 );
+
+		return r;
+	},
+
+	inArray: function( b, a ) {
+		for ( var i = 0, al = a.length; i < al; i++ )
+			if ( a[i] == b )
+				return i;
+		return -1;
+	},
+
+	merge: function(first, second) {
+		// We have to loop this way because IE & Opera overwrite the length
+		// expando of getElementsByTagName
+
+		// Also, we need to make sure that the correct elements are being returned
+		// (IE returns comment nodes in a '*' query)
+		if ( jQuery.browser.msie ) {
+			for ( var i = 0; second[i]; i++ )
+				if ( second[i].nodeType != 8 )
+					first.push(second[i]);
+		} else
+			for ( var i = 0; second[i]; i++ )
+				first.push(second[i]);
+
+		return first;
+	},
+
+	unique: function(first) {
+		var r = [], done = {};
+
+		try {
+			for ( var i = 0, fl = first.length; i < fl; i++ ) {
+				var id = jQuery.data(first[i]);
+				if ( !done[id] ) {
+					done[id] = true;
+					r.push(first[i]);
+				}
+			}
+		} catch(e) {
+			r = first;
+		}
+
+		return r;
+	},
+
+	grep: function(elems, fn, inv) {
+		// If a string is passed in for the function, make a function
+		// for it (a handy shortcut)
+		if ( typeof fn == "string" )
+			fn = eval("false||function(a,i){return " + fn + "}");
+
+		var result = [];
+
+		// Go through the array, only saving the items
+		// that pass the validator function
+		for ( var i = 0, el = elems.length; i < el; i++ )
+			if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )
+				result.push( elems[i] );
+
+		return result;
+	},
+
+	map: function(elems, fn) {
+		// If a string is passed in for the function, make a function
+		// for it (a handy shortcut)
+		if ( typeof fn == "string" )
+			fn = eval("false||function(a){return " + fn + "}");
+
+		var result = [];
+
+		// Go through the array, translating each of the items to their
+		// new value (or values).
+		for ( var i = 0, el = elems.length; i < el; i++ ) {
+			var val = fn(elems[i],i);
+
+			if ( val !== null && val != undefined ) {
+				if ( val.constructor != Array ) val = [val];
+				result = result.concat( val );
+			}
+		}
+
+		return result;
+	}
+});
+
+var userAgent = navigator.userAgent.toLowerCase();
+
+// Figure out what browser is being used
+jQuery.browser = {
+	version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
+	safari: /webkit/.test(userAgent),
+	opera: /opera/.test(userAgent),
+	msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
+	mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
+};
+
+var styleFloat = jQuery.browser.msie ? "styleFloat" : "cssFloat";
+	
+jQuery.extend({
+	// Check to see if the W3C box model is being used
+	boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",
+	
+	styleFloat: jQuery.browser.msie ? "styleFloat" : "cssFloat",
+	
+	props: {
+		"for": "htmlFor",
+		"class": "className",
+		"float": styleFloat,
+		cssFloat: styleFloat,
+		styleFloat: styleFloat,
+		innerHTML: "innerHTML",
+		className: "className",
+		value: "value",
+		disabled: "disabled",
+		checked: "checked",
+		readonly: "readOnly",
+		selected: "selected",
+		maxlength: "maxLength"
+	}
+});
+
+jQuery.each({
+	parent: "a.parentNode",
+	parents: "jQuery.dir(a,'parentNode')",
+	next: "jQuery.nth(a,2,'nextSibling')",
+	prev: "jQuery.nth(a,2,'previousSibling')",
+	nextAll: "jQuery.dir(a,'nextSibling')",
+	prevAll: "jQuery.dir(a,'previousSibling')",
+	siblings: "jQuery.sibling(a.parentNode.firstChild,a)",
+	children: "jQuery.sibling(a.firstChild)",
+	contents: "jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"
+}, function(i,n){
+	jQuery.fn[ i ] = function(a) {
+		var ret = jQuery.map(this,n);
+		if ( a && typeof a == "string" )
+			ret = jQuery.multiFilter(a,ret);
+		return this.pushStack( jQuery.unique(ret) );
+	};
+});
+
+jQuery.each({
+	appendTo: "append",
+	prependTo: "prepend",
+	insertBefore: "before",
+	insertAfter: "after",
+	replaceAll: "replaceWith"
+}, function(i,n){
+	jQuery.fn[ i ] = function(){
+		var a = arguments;
+		return this.each(function(){
+			for ( var j = 0, al = a.length; j < al; j++ )
+				jQuery(a[j])[n]( this );
+		});
+	};
+});
+
+jQuery.each( {
+	removeAttr: function( key ) {
+		jQuery.attr( this, key, "" );
+		this.removeAttribute( key );
+	},
+	addClass: function(c){
+		jQuery.className.add(this,c);
+	},
+	removeClass: function(c){
+		jQuery.className.remove(this,c);
+	},
+	toggleClass: function( c ){
+		jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this, c);
+	},
+	remove: function(a){
+		if ( !a || jQuery.filter( a, [this] ).r.length ) {
+			jQuery.removeData( this );
+			this.parentNode.removeChild( this );
+		}
+	},
+	empty: function() {
+		// Clean up the cache
+		jQuery("*", this).each(function(){ jQuery.removeData(this); });
+
+		while ( this.firstChild )
+			this.removeChild( this.firstChild );
+	}
+}, function(i,n){
+	jQuery.fn[ i ] = function() {
+		return this.each( n, arguments );
+	};
+});
+
+jQuery.each( [ "Height", "Width" ], function(i,name){
+	var n = name.toLowerCase();
+	
+	jQuery.fn[ n ] = function(h) {
+		return this[0] == window ?
+			jQuery.browser.safari && self["inner" + name] ||
+			jQuery.boxModel && Math.max(document.documentElement["client" + name], document.body["client" + name]) ||
+			document.body["client" + name] :
+		
+			this[0] == document ?
+				Math.max( document.body["scroll" + name], document.body["offset" + name] ) :
+        
+				h == undefined ?
+					( this.length ? jQuery.css( this[0], n ) : null ) :
+					this.css( n, h.constructor == String ? h : h + "px" );
+	};
+});
+
+var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
+		"(?:[\\w*_-]|\\\\.)" :
+		"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
+	quickChild = new RegExp("^>\\s*(" + chars + "+)"),
+	quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
+	quickClass = new RegExp("^([#.]?)(" + chars + "*)");
+
+jQuery.extend({
+	expr: {
+		"": "m[2]=='*'||jQuery.nodeName(a,m[2])",
+		"#": "a.getAttribute('id')==m[2]",
+		":": {
+			// Position Checks
+			lt: "i<m[3]-0",
+			gt: "i>m[3]-0",
+			nth: "m[3]-0==i",
+			eq: "m[3]-0==i",
+			first: "i==0",
+			last: "i==r.length-1",
+			even: "i%2==0",
+			odd: "i%2",
+
+			// Child Checks
+			"first-child": "a.parentNode.getElementsByTagName('*')[0]==a",
+			"last-child": "jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a",
+			"only-child": "!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",
+
+			// Parent Checks
+			parent: "a.firstChild",
+			empty: "!a.firstChild",
+
+			// Text Check
+			contains: "(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",
+
+			// Visibility
+			visible: '"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',
+			hidden: '"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',
+
+			// Form attributes
+			enabled: "!a.disabled",
+			disabled: "a.disabled",
+			checked: "a.checked",
+			selected: "a.selected||jQuery.attr(a,'selected')",
+
+			// Form elements
+			text: "'text'==a.type",
+			radio: "'radio'==a.type",
+			checkbox: "'checkbox'==a.type",
+			file: "'file'==a.type",
+			password: "'password'==a.type",
+			submit: "'submit'==a.type",
+			image: "'image'==a.type",
+			reset: "'reset'==a.type",
+			button: '"button"==a.type||jQuery.nodeName(a,"button")',
+			input: "/input|select|textarea|button/i.test(a.nodeName)",
+
+			// :has()
+			has: "jQuery.find(m[3],a).length",
+
+			// :header
+			header: "/h\\d/i.test(a.nodeName)",
+
+			// :animated
+			animated: "jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"
+		}
+	},
+	
+	// The regular expressions that power the parsing engine
+	parse: [
+		// Match: [@value='test'], [@foo]
+		/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,
+
+		// Match: :contains('foo')
+		/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,
+
+		// Match: :even, :last-chlid, #id, .class
+		new RegExp("^([:.#]*)(" + chars + "+)")
+	],
+
+	multiFilter: function( expr, elems, not ) {
+		var old, cur = [];
+
+		while ( expr && expr != old ) {
+			old = expr;
+			var f = jQuery.filter( expr, elems, not );
+			expr = f.t.replace(/^\s*,\s*/, "" );
+			cur = not ? elems = f.r : jQuery.merge( cur, f.r );
+		}
+
+		return cur;
+	},
+
+	find: function( t, context ) {
+		// Quickly handle non-string expressions
+		if ( typeof t != "string" )
+			return [ t ];
+
+		// Make sure that the context is a DOM Element
+		if ( context && !context.nodeType )
+			context = null;
+
+		// Set the correct context (if none is provided)
+		context = context || document;
+
+		// Initialize the search
+		var ret = [context], done = [], last;
+
+		// Continue while a selector expression exists, and while
+		// we're no longer looping upon ourselves
+		while ( t && last != t ) {
+			var r = [];
+			last = t;
+
+			t = jQuery.trim(t);
+
+			var foundToken = false;
+
+			// An attempt at speeding up child selectors that
+			// point to a specific element tag
+			var re = quickChild;
+			var m = re.exec(t);
+
+			if ( m ) {
+				var nodeName = m[1].toUpperCase();
+
+				// Perform our own iteration and filter
+				for ( var i = 0; ret[i]; i++ )
+					for ( var c = ret[i].firstChild; c; c = c.nextSibling )
+						if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName.toUpperCase()) )
+							r.push( c );
+
+				ret = r;
+				t = t.replace( re, "" );
+				if ( t.indexOf(" ") == 0 ) continue;
+				foundToken = true;
+			} else {
+				re = /^([>+~])\s*(\w*)/i;
+
+				if ( (m = re.exec(t)) != null ) {
+					r = [];
+
+					var nodeName = m[2], merge = {};
+					m = m[1];
+
+					for ( var j = 0, rl = ret.length; j < rl; j++ ) {
+						var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
+						for ( ; n; n = n.nextSibling )
+							if ( n.nodeType == 1 ) {
+								var id = jQuery.data(n);
+
+								if ( m == "~" && merge[id] ) break;
+								
+								if (!nodeName || n.nodeName.toUpperCase() == nodeName.toUpperCase() ) {
+									if ( m == "~" ) merge[id] = true;
+									r.push( n );
+								}
+								
+								if ( m == "+" ) break;
+							}
+					}
+
+					ret = r;
+
+					// And remove the token
+					t = jQuery.trim( t.replace( re, "" ) );
+					foundToken = true;
+				}
+			}
+
+			// See if there's still an expression, and that we haven't already
+			// matched a token
+			if ( t && !foundToken ) {
+				// Handle multiple expressions
+				if ( !t.indexOf(",") ) {
+					// Clean the result set
+					if ( context == ret[0] ) ret.shift();
+
+					// Merge the result sets
+					done = jQuery.merge( done, ret );
+
+					// Reset the context
+					r = ret = [context];
+
+					// Touch up the selector string
+					t = " " + t.substr(1,t.length);
+
+				} else {
+					// Optimize for the case nodeName#idName
+					var re2 = quickID;
+					var m = re2.exec(t);
+					
+					// Re-organize the results, so that they're consistent
+					if ( m ) {
+					   m = [ 0, m[2], m[3], m[1] ];
+
+					} else {
+						// Otherwise, do a traditional filter check for
+						// ID, class, and element selectors
+						re2 = quickClass;
+						m = re2.exec(t);
+					}
+
+					m[2] = m[2].replace(/\\/g, "");
+
+					var elem = ret[ret.length-1];
+
+					// Try to do a global search by ID, where we can
+					if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
+						// Optimization for HTML document case
+						var oid = elem.getElementById(m[2]);
+						
+						// Do a quick check for the existence of the actual ID attribute
+						// to avoid selecting by the name attribute in IE
+						// also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
+						if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
+							oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
+
+						// Do a quick check for node name (where applicable) so
+						// that div#foo searches will be really fast
+						ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
+					} else {
+						// We need to find all descendant elements
+						for ( var i = 0; ret[i]; i++ ) {
+							// Grab the tag name being searched for
+							var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];
+
+							// Handle IE7 being really dumb about <object>s
+							if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
+								tag = "param";
+
+							r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
+						}
+
+						// It's faster to filter by class and be done with it
+						if ( m[1] == "." )
+							r = jQuery.classFilter( r, m[2] );
+
+						// Same with ID filtering
+						if ( m[1] == "#" ) {
+							var tmp = [];
+
+							// Try to find the element with the ID
+							for ( var i = 0; r[i]; i++ )
+								if ( r[i].getAttribute("id") == m[2] ) {
+									tmp = [ r[i] ];
+									break;
+								}
+
+							r = tmp;
+						}
+
+						ret = r;
+					}
+
+					t = t.replace( re2, "" );
+				}
+
+			}
+
+			// If a selector string still exists
+			if ( t ) {
+				// Attempt to filter it
+				var val = jQuery.filter(t,r);
+				ret = r = val.r;
+				t = jQuery.trim(val.t);
+			}
+		}
+
+		// An error occurred with the selector;
+		// just return an empty set instead
+		if ( t )
+			ret = [];
+
+		// Remove the root context
+		if ( ret && context == ret[0] )
+			ret.shift();
+
+		// And combine the results
+		done = jQuery.merge( done, ret );
+
+		return done;
+	},
+
+	classFilter: function(r,m,not){
+		m = " " + m + " ";
+		var tmp = [];
+		for ( var i = 0; r[i]; i++ ) {
+			var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
+			if ( !not && pass || not && !pass )
+				tmp.push( r[i] );
+		}
+		return tmp;
+	},
+
+	filter: function(t,r,not) {
+		var last;
+
+		// Look for common filter expressions
+		while ( t  && t != last ) {
+			last = t;
+
+			var p = jQuery.parse, m;
+
+			for ( var i = 0; p[i]; i++ ) {
+				m = p[i].exec( t );
+
+				if ( m ) {
+					// Remove what we just matched
+					t = t.substring( m[0].length );
+
+					m[2] = m[2].replace(/\\/g, "");
+					break;
+				}
+			}
+
+			if ( !m )
+				break;
+
+			// :not() is a special case that can be optimized by
+			// keeping it out of the expression list
+			if ( m[1] == ":" && m[2] == "not" )
+				r = jQuery.filter(m[3], r, true).r;
+
+			// We can get a big speed boost by filtering by class here
+			else if ( m[1] == "." )
+				r = jQuery.classFilter(r, m[2], not);
+
+			else if ( m[1] == "[" ) {
+				var tmp = [], type = m[3];
+				
+				for ( var i = 0, rl = r.length; i < rl; i++ ) {
+					var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
+					
+					if ( z == null || /href|src|selected/.test(m[2]) )
+						z = jQuery.attr(a,m[2]) || '';
+
+					if ( (type == "" && !!z ||
+						 type == "=" && z == m[5] ||
+						 type == "!=" && z != m[5] ||
+						 type == "^=" && z && !z.indexOf(m[5]) ||
+						 type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
+						 (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
+							tmp.push( a );
+				}
+				
+				r = tmp;
+
+			// We can get a speed boost by handling nth-child here
+			} else if ( m[1] == ":" && m[2] == "nth-child" ) {
+				var merge = {}, tmp = [],
+					test = /(\d*)n\+?(\d*)/.exec(
+						m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
+						!/\D/.test(m[3]) && "n+" + m[3] || m[3]),
+					first = (test[1] || 1) - 0, last = test[2] - 0;
+
+				for ( var i = 0, rl = r.length; i < rl; i++ ) {
+					var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);
+
+					if ( !merge[id] ) {
+						var c = 1;
+
+						for ( var n = parentNode.firstChild; n; n = n.nextSibling )
+							if ( n.nodeType == 1 )
+								n.nodeIndex = c++;
+
+						merge[id] = true;
+					}
+
+					var add = false;
+
+					if ( first == 1 ) {
+						if ( last == 0 || node.nodeIndex == last )
+							add = true;
+					} else if ( (node.nodeIndex + last) % first == 0 )
+						add = true;
+
+					if ( add ^ not )
+						tmp.push( node );
+				}
+
+				r = tmp;
+
+			// Otherwise, find the expression to execute
+			} else {
+				var f = jQuery.expr[m[1]];
+				if ( typeof f != "string" )
+					f = jQuery.expr[m[1]][m[2]];
+
+				// Build a custom macro to enclose it
+				f = eval("false||function(a,i){return " + f + "}");
+
+				// Execute it against the current filter
+				r = jQuery.grep( r, f, not );
+			}
+		}
+
+		// Return an array of filtered elements (r)
+		// and the modified expression string (t)
+		return { r: r, t: t };
+	},
+
+	dir: function( elem, dir ){
+		var matched = [];
+		var cur = elem[dir];
+		while ( cur && cur != document ) {
+			if ( cur.nodeType == 1 )
+				matched.push( cur );
+			cur = cur[dir];
+		}
+		return matched;
+	},
+	
+	nth: function(cur,result,dir,elem){
+		result = result || 1;
+		var num = 0;
+
+		for ( ; cur; cur = cur[dir] )
+			if ( cur.nodeType == 1 && ++num == result )
+				break;
+
+		return cur;
+	},
+	
+	sibling: function( n, elem ) {
+		var r = [];
+
+		for ( ; n; n = n.nextSibling ) {
+			if ( n.nodeType == 1 && (!elem || n != elem) )
+				r.push( n );
+		}
+
+		return r;
+	}
+});
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code orignated from 
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+	// Bind an event to an element
+	// Original by Dean Edwards
+	add: function(element, type, handler, data) {
+		// For whatever reason, IE has trouble passing the window object
+		// around, causing it to be cloned in the process
+		if ( jQuery.browser.msie && element.setInterval != undefined )
+			element = window;
+
+		// Make sure that the function being executed has a unique ID
+		if ( !handler.guid )
+			handler.guid = this.guid++;
+			
+		// if data is passed, bind to handler 
+		if( data != undefined ) { 
+        		// Create temporary function pointer to original handler 
+			var fn = handler; 
+
+			// Create unique handler function, wrapped around original handler 
+			handler = function() { 
+				// Pass arguments and context to original handler 
+				return fn.apply(this, arguments); 
+			};
+
+			// Store data in unique handler 
+			handler.data = data;
+
+			// Set the guid of unique handler to the same of original handler, so it can be removed 
+			handler.guid = fn.guid;
+		}
+
+		// Namespaced event handlers
+		var parts = type.split(".");
+		type = parts[0];
+		handler.type = parts[1];
+
+		// Init the element's event structure
+		var events = jQuery.data(element, "events") || jQuery.data(element, "events", {});
+		
+		var handle = jQuery.data(element, "handle", function(){
+			// returned undefined or false
+			var val;
+
+			// Handle the second event of a trigger and when
+			// an event is called after a page has unloaded
+			if ( typeof jQuery == "undefined" || jQuery.event.triggered )
+				return val;
+			
+			val = jQuery.event.handle.apply(element, arguments);
+			
+			return val;
+		});
+
+		// Get the current list of functions bound to this event
+		var handlers = events[type];
+
+		// Init the event handler queue
+		if (!handlers) {
+			handlers = events[type] = {};	
+			
+			// And bind the global event handler to the element
+			if (element.addEventListener)
+				element.addEventListener(type, handle, false);
+			else
+				element.attachEvent("on" + type, handle);
+		}
+
+		// Add the function to the element's handler list
+		handlers[handler.guid] = handler;
+
+		// Keep track of which events have been used, for global triggering
+		this.global[type] = true;
+	},
+
+	guid: 1,
+	global: {},
+
+	// Detach an event or set of events from an element
+	remove: function(element, type, handler) {
+		var events = jQuery.data(element, "events"), ret, index;
+
+		// Namespaced event handlers
+		if ( typeof type == "string" ) {
+			var parts = type.split(".");
+			type = parts[0];
+		}
+
+		if ( events ) {
+			// type is actually an event object here
+			if ( type && type.type ) {
+				handler = type.handler;
+				type = type.type;
+			}
+			
+			if ( !type ) {
+				for ( type in events )
+					this.remove( element, type );
+
+			} else if ( events[type] ) {
+				// remove the given handler for the given type
+				if ( handler )
+					delete events[type][handler.guid];
+				
+				// remove all handlers for the given type
+				else
+					for ( handler in events[type] )
+						// Handle the removal of namespaced events
+						if ( !parts[1] || events[type][handler].type == parts[1] )
+							delete events[type][handler];
+
+				// remove generic event handler if no more handlers exist
+				for ( ret in events[type] ) break;
+				if ( !ret ) {
+					if (element.removeEventListener)
+						element.removeEventListener(type, jQuery.data(element, "handle"), false);
+					else
+						element.detachEvent("on" + type, jQuery.data(element, "handle"));
+					ret = null;
+					delete events[type];
+				}
+			}
+
+			// Remove the expando if it's no longer used
+			for ( ret in events ) break;
+			if ( !ret ) {
+				jQuery.removeData( element, "events" );
+				jQuery.removeData( element, "handle" );
+			}
+		}
+	},
+
+	trigger: function(type, data, element, donative, extra) {
+		// Clone the incoming data, if any
+		data = jQuery.makeArray(data || []);
+
+		// Handle a global trigger
+		if ( !element ) {
+			// Only trigger if we've ever bound an event for it
+			if ( this.global[type] )
+				jQuery("*").add([window, document]).trigger(type, data);
+
+		// Handle triggering a single element
+		} else {
+			var val, ret, fn = jQuery.isFunction( element[ type ] || null ),
+				// Check to see if we need to provide a fake event, or not
+				evt = !data[0] || !data[0].preventDefault;
+			
+			// Pass along a fake event
+			if ( evt )
+				data.unshift( this.fix({ type: type, target: element }) );
+
+			// Enforce the right trigger type
+			data[0].type = type;
+
+			// Trigger the event
+			if ( jQuery.isFunction( jQuery.data(element, "handle") ) )
+				val = jQuery.data(element, "handle").apply( element, data );
+
+			// Handle triggering native .onfoo handlers
+			if ( !fn && element["on"+type] && element["on"+type].apply( element, data ) === false )
+				val = false;
+
+			// Extra functions don't get the custom event object
+			if ( evt )
+				data.shift();
+
+			// Handle triggering of extra function
+			if ( extra && extra.apply( element, data ) === false )
+				val = false;
+
+			// Trigger the native events (except for clicks on links)
+			if ( fn && donative !== false && val !== false && !(jQuery.nodeName(element, 'a') && type == "click") ) {
+				this.triggered = true;
+				element[ type ]();
+			}
+
+			this.triggered = false;
+		}
+
+		return val;
+	},
+
+	handle: function(event) {
+		// returned undefined or false
+		var val;
+
+		// Empty object is for triggered events with no data
+		event = jQuery.event.fix( event || window.event || {} ); 
+
+		// Namespaced event handlers
+		var parts = event.type.split(".");
+		event.type = parts[0];
+
+		var c = jQuery.data(this, "events") && jQuery.data(this, "events")[event.type], args = Array.prototype.slice.call( arguments, 1 );
+		args.unshift( event );
+
+		for ( var j in c ) {
+			// Pass in a reference to the handler function itself
+			// So that we can later remove it
+			args[0].handler = c[j];
+			args[0].data = c[j].data;
+
+			// Filter the functions by class
+			if ( !parts[1] || c[j].type == parts[1] ) {
+				var tmp = c[j].apply( this, args );
+
+				if ( val !== false )
+					val = tmp;
+
+				if ( tmp === false ) {
+					event.preventDefault();
+					event.stopPropagation();
+				}
+			}
+		}
+
+		// Clean up added properties in IE to prevent memory leak
+		if (jQuery.browser.msie)
+			event.target = event.preventDefault = event.stopPropagation =
+				event.handler = event.data = null;
+
+		return val;
+	},
+
+	fix: function(event) {
+		// store a copy of the original event object 
+		// and clone to set read-only properties
+		var originalEvent = event;
+		event = jQuery.extend({}, originalEvent);
+		
+		// add preventDefault and stopPropagation since 
+		// they will not work on the clone
+		event.preventDefault = function() {
+			// if preventDefault exists run it on the original event
+			if (originalEvent.preventDefault)
+				originalEvent.preventDefault();
+			// otherwise set the returnValue property of the original event to false (IE)
+			originalEvent.returnValue = false;
+		};
+		event.stopPropagation = function() {
+			// if stopPropagation exists run it on the original event
+			if (originalEvent.stopPropagation)
+				originalEvent.stopPropagation();
+			// otherwise set the cancelBubble property of the original event to true (IE)
+			originalEvent.cancelBubble = true;
+		};
+		
+		// Fix target property, if necessary
+		if ( !event.target && event.srcElement )
+			event.target = event.srcElement;
+				
+		// check if target is a textnode (safari)
+		if (jQuery.browser.safari && event.target.nodeType == 3)
+			event.target = originalEvent.target.parentNode;
+
+		// Add relatedTarget, if necessary
+		if ( !event.relatedTarget && event.fromElement )
+			event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
+
+		// Calculate pageX/Y if missing and clientX/Y available
+		if ( event.pageX == null && event.clientX != null ) {
+			var e = document.documentElement, b = document.body;
+			event.pageX = event.clientX + (e && e.scrollLeft || b.scrollLeft || 0);
+			event.pageY = event.clientY + (e && e.scrollTop || b.scrollTop || 0);
+		}
+			
+		// Add which for key events
+		if ( !event.which && (event.charCode || event.keyCode) )
+			event.which = event.charCode || event.keyCode;
+		
+		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+		if ( !event.metaKey && event.ctrlKey )
+			event.metaKey = event.ctrlKey;
+
+		// Add which for click: 1 == left; 2 == middle; 3 == right
+		// Note: button is not normalized, so don't use it
+		if ( !event.which && event.button )
+			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+			
+		return event;
+	}
+};
+
+jQuery.fn.extend({
+	bind: function( type, data, fn ) {
+		return type == "unload" ? this.one(type, data, fn) : this.each(function(){
+			jQuery.event.add( this, type, fn || data, fn && data );
+		});
+	},
+	
+	one: function( type, data, fn ) {
+		return this.each(function(){
+			jQuery.event.add( this, type, function(event) {
+				jQuery(this).unbind(event);
+				return (fn || data).apply( this, arguments);
+			}, fn && data);
+		});
+	},
+
+	unbind: function( type, fn ) {
+		return this.each(function(){
+			jQuery.event.remove( this, type, fn );
+		});
+	},
+
+	trigger: function( type, data, fn ) {
+		return this.each(function(){
+			jQuery.event.trigger( type, data, this, true, fn );
+		});
+	},
+
+	triggerHandler: function( type, data, fn ) {
+		if ( this[0] )
+			return jQuery.event.trigger( type, data, this[0], false, fn );
+	},
+
+	toggle: function() {
+		// Save reference to arguments for access in closure
+		var a = arguments;
+
+		return this.click(function(e) {
+			// Figure out which function to execute
+			this.lastToggle = 0 == this.lastToggle ? 1 : 0;
+			
+			// Make sure that clicks stop
+			e.preventDefault();
+			
+			// and execute the function
+			return a[this.lastToggle].apply( this, [e] ) || false;
+		});
+	},
+
+	hover: function(f,g) {
+		
+		// A private function for handling mouse 'hovering'
+		function handleHover(e) {
+			// Check if mouse(over|out) are still within the same parent element
+			var p = e.relatedTarget;
+	
+			// Traverse up the tree
+			while ( p && p != this ) try { p = p.parentNode; } catch(e) { p = this; };
+			
+			// If we actually just moused on to a sub-element, ignore it
+			if ( p == this ) return false;
+			
+			// Execute the right function
+			return (e.type == "mouseover" ? f : g).apply(this, [e]);
+		}
+		
+		// Bind the function to the two event listeners
+		return this.mouseover(handleHover).mouseout(handleHover);
+	},
+	
+	ready: function(f) {
+		// Attach the listeners
+		bindReady();
+
+		// If the DOM is already ready
+		if ( jQuery.isReady )
+			// Execute the function immediately
+			f.apply( document, [jQuery] );
+			
+		// Otherwise, remember the function for later
+		else
+			// Add the function to the wait list
+			jQuery.readyList.push( function() { return f.apply(this, [jQuery]); } );
+	
+		return this;
+	}
+});
+
+jQuery.extend({
+	/*
+	 * All the code that makes DOM Ready work nicely.
+	 */
+	isReady: false,
+	readyList: [],
+	
+	// Handle when the DOM is ready
+	ready: function() {
+		// Make sure that the DOM is not already loaded
+		if ( !jQuery.isReady ) {
+			// Remember that the DOM is ready
+			jQuery.isReady = true;
+			
+			// If there are functions bound, to execute
+			if ( jQuery.readyList ) {
+				// Execute all of them
+				jQuery.each( jQuery.readyList, function(){
+					this.apply( document );
+				});
+				
+				// Reset the list of functions
+				jQuery.readyList = null;
+			}
+			// Remove event listener to avoid memory leak
+			if ( jQuery.browser.mozilla || jQuery.browser.opera )
+				document.removeEventListener( "DOMContentLoaded", jQuery.ready, false );
+			
+			// Remove script element used by IE hack
+			if( !window.frames.length ) // don't remove if frames are present (#1187)
+				jQuery(window).load(function(){ jQuery("#__ie_init").remove(); });
+		}
+	}
+});
+
+jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
+	"mousedown,mouseup,mousemove,mouseover,mouseout,change,select," + 
+	"submit,keydown,keypress,keyup,error").split(","), function(i,o){
+	
+	// Handle event binding
+	jQuery.fn[o] = function(f){
+		return f ? this.bind(o, f) : this.trigger(o);
+	};
+});
+
+var readyBound = false;
+
+function bindReady(){
+	if ( readyBound ) return;
+	readyBound = true;
+
+	// If Mozilla is used
+	if ( jQuery.browser.mozilla || jQuery.browser.opera )
+		// Use the handy event callback
+		document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
+	
+	// If IE is used, use the excellent hack by Matthias Miller
+	// http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited
+	else if ( jQuery.browser.msie ) {
+	
+		// Only works if you document.write() it
+		document.write("<scr" + "ipt id=__ie_init defer=true " + 
+			"src=//:><\/script>");
+	
+		// Use the defer script hack
+		var script = document.getElementById("__ie_init");
+		
+		// script does not exist if jQuery is loaded dynamically
+		if ( script ) 
+			script.onreadystatechange = function() {
+				if ( this.readyState != "complete" ) return;
+				jQuery.ready();
+			};
+	
+		// Clear from memory
+		script = null;
+	
+	// If Safari  is used
+	} else if ( jQuery.browser.safari )
+		// Continually check to see if the document.readyState is valid
+		jQuery.safariTimer = setInterval(function(){
+			// loaded and complete are both valid states
+			if ( document.readyState == "loaded" || 
+				document.readyState == "complete" ) {
+	
+				// If either one are found, remove the timer
+				clearInterval( jQuery.safariTimer );
+				jQuery.safariTimer = null;
+	
+				// and execute any waiting functions
+				jQuery.ready();
+			}
+		}, 10); 
+
+	// A fallback to window.onload, that will always work
+	jQuery.event.add( window, "load", jQuery.ready );
+}
+jQuery.fn.extend({
+	load: function( url, params, callback ) {
+		if ( jQuery.isFunction( url ) )
+			return this.bind("load", url);
+
+		var off = url.indexOf(" ");
+		if ( off >= 0 ) {
+			var selector = url.slice(off, url.length);
+			url = url.slice(0, off);
+		}
+
+		callback = callback || function(){};
+
+		// Default to a GET request
+		var type = "GET";
+
+		// If the second parameter was provided
+		if ( params )
+			// If it's a function
+			if ( jQuery.isFunction( params ) ) {
+				// We assume that it's the callback
+				callback = params;
+				params = null;
+
+			// Otherwise, build a param string
+			} else {
+				params = jQuery.param( params );
+				type = "POST";
+			}
+
+		var self = this;
+
+		// Request the remote document
+		jQuery.ajax({
+			url: url,
+			type: type,
+			data: params,
+			complete: function(res, status){
+				// If successful, inject the HTML into all the matched elements
+				if ( status == "success" || status == "notmodified" )
+					// See if a selector was specified
+					self.html( selector ?
+						// Create a dummy div to hold the results
+						jQuery("<div/>")
+							// inject the contents of the document in, removing the scripts
+							// to avoid any 'Permission Denied' errors in IE
+							.append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
+
+							// Locate the specified elements
+							.find(selector) :
+
+						// If not, just inject the full result
+						res.responseText );
+
+				// Add delay to account for Safari's delay in globalEval
+				setTimeout(function(){
+					self.each( callback, [res.responseText, status, res] );
+				}, 13);
+			}
+		});
+		return this;
+	},
+
+	serialize: function() {
+		return jQuery.param(this.serializeArray());
+	},
+	serializeArray: function() {
+		return this.map(function(){
+			return jQuery.nodeName(this, "form") ?
+				jQuery.makeArray(this.elements) : this;
+		})
+		.filter(function(){
+			return this.name && !this.disabled && 
+				(this.checked || /select|textarea/i.test(this.nodeName) || 
+					/text|hidden|password/i.test(this.type));
+		})
+		.map(function(i, elem){
+			var val = jQuery(this).val();
+			return val == null ? null :
+				val.constructor == Array ?
+					jQuery.map( val, function(val, i){
+						return {name: elem.name, value: val};
+					}) :
+					{name: elem.name, value: val};
+		}).get();
+	}
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
+	jQuery.fn[o] = function(f){
+		return this.bind(o, f);
+	};
+});
+
+var jsc = (new Date).getTime();
+
+jQuery.extend({
+	get: function( url, data, callback, type ) {
+		// shift arguments if data argument was ommited
+		if ( jQuery.isFunction( data ) ) {
+			callback = data;
+			data = null;
+		}
+		
+		return jQuery.ajax({
+			type: "GET",
+			url: url,
+			data: data,
+			success: callback,
+			dataType: type
+		});
+	},
+
+	getScript: function( url, callback ) {
+		return jQuery.get(url, null, callback, "script");
+	},
+
+	getJSON: function( url, data, callback ) {
+		return jQuery.get(url, data, callback, "json");
+	},
+
+	post: function( url, data, callback, type ) {
+		if ( jQuery.isFunction( data ) ) {
+			callback = data;
+			data = {};
+		}
+
+		return jQuery.ajax({
+			type: "POST",
+			url: url,
+			data: data,
+			success: callback,
+			dataType: type
+		});
+	},
+
+	ajaxSetup: function( settings ) {
+		jQuery.extend( jQuery.ajaxSettings, settings );
+	},
+
+	ajaxSettings: {
+		global: true,
+		type: "GET",
+		timeout: 0,
+		contentType: "application/x-www-form-urlencoded",
+		processData: true,
+		async: true,
+		data: null
+	},
+	
+	// Last-Modified header cache for next request
+	lastModified: {},
+
+	ajax: function( s ) {
+		var jsonp, jsre = /=(\?|%3F)/g, status, data;
+
+		// Extend the settings, but re-extend 's' so that it can be
+		// checked again later (in the test suite, specifically)
+		s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
+
+		// convert data if not already a string
+		if ( s.data && s.processData && typeof s.data != "string" )
+			s.data = jQuery.param(s.data);
+
+		// Handle JSONP Parameter Callbacks
+		if ( s.dataType == "jsonp" ) {
+			if ( s.type.toLowerCase() == "get" ) {
+				if ( !s.url.match(jsre) )
+					s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
+			} else if ( !s.data || !s.data.match(jsre) )
+				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
+			s.dataType = "json";
+		}
+
+		// Build temporary JSONP function
+		if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
+			jsonp = "jsonp" + jsc++;
+
+			// Replace the =? sequence both in the query string and the data
+			if ( s.data )
+				s.data = s.data.replace(jsre, "=" + jsonp);
+			s.url = s.url.replace(jsre, "=" + jsonp);
+
+			// We need to make sure
+			// that a JSONP style response is executed properly
+			s.dataType = "script";
+
+			// Handle JSONP-style loading
+			window[ jsonp ] = function(tmp){
+				data = tmp;
+				success();
+				complete();
+				// Garbage collect
+				window[ jsonp ] = undefined;
+				try{ delete window[ jsonp ]; } catch(e){}
+			};
+		}
+
+		if ( s.dataType == "script" && s.cache == null )
+			s.cache = false;
+
+		if ( s.cache === false && s.type.toLowerCase() == "get" )
+			s.url += (s.url.match(/\?/) ? "&" : "?") + "_=" + (new Date()).getTime();
+
+		// If data is available, append data to url for get requests
+		if ( s.data && s.type.toLowerCase() == "get" ) {
+			s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
+
+			// IE likes to send both get and post data, prevent this
+			s.data = null;
+		}
+
+		// Watch for a new set of requests
+		if ( s.global && ! jQuery.active++ )
+			jQuery.event.trigger( "ajaxStart" );
+
+		// If we're requesting a remote document
+		// and trying to load JSON or Script
+		if ( !s.url.indexOf("http") && s.dataType == "script" ) {
+			var head = document.getElementsByTagName("head")[0];
+			var script = document.createElement("script");
+			script.src = s.url;
+
+			// Handle Script loading
+			if ( !jsonp && (s.success || s.complete) ) {
+				var done = false;
+
+				// Attach handlers for all browsers
+				script.onload = script.onreadystatechange = function(){
+					if ( !done && (!this.readyState || 
+							this.readyState == "loaded" || this.readyState == "complete") ) {
+						done = true;
+						success();
+						complete();
+						head.removeChild( script );
+					}
+				};
+			}
+
+			head.appendChild(script);
+
+			// We handle everything using the script element injection
+			return;
+		}
+
+		var requestDone = false;
+
+		// Create the request object; Microsoft failed to properly
+		// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
+		var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
+
+		// Open the socket
+		xml.open(s.type, s.url, s.async);
+
+		// Set the correct header, if data is being sent
+		if ( s.data )
+			xml.setRequestHeader("Content-Type", s.contentType);
+
+		// Set the If-Modified-Since header, if ifModified mode.
+		if ( s.ifModified )
+			xml.setRequestHeader("If-Modified-Since",
+				jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
+
+		// Set header so the called script knows that it's an XMLHttpRequest
+		xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+
+		// Allow custom headers/mimetypes
+		if ( s.beforeSend )
+			s.beforeSend(xml);
+			
+		if ( s.global )
+		    jQuery.event.trigger("ajaxSend", [xml, s]);
+
+		// Wait for a response to come back
+		var onreadystatechange = function(isTimeout){
+			// The transfer is complete and the data is available, or the request timed out
+			if ( !requestDone && xml && (xml.readyState == 4 || isTimeout == "timeout") ) {
+				requestDone = true;
+				
+				// clear poll interval
+				if (ival) {
+					clearInterval(ival);
+					ival = null;
+				}
+				
+				status = isTimeout == "timeout" && "timeout" ||
+					!jQuery.httpSuccess( xml ) && "error" ||
+					s.ifModified && jQuery.httpNotModified( xml, s.url ) && "notmodified" ||
+					"success";
+
+				if ( status == "success" ) {
+					// Watch for, and catch, XML document parse errors
+					try {
+						// process the data (runs the xml through httpData regardless of callback)
+						data = jQuery.httpData( xml, s.dataType );
+					} catch(e) {
+						status = "parsererror";
+					}
+				}
+
+				// Make sure that the request was successful or notmodified
+				if ( status == "success" ) {
+					// Cache Last-Modified header, if ifModified mode.
+					var modRes;
+					try {
+						modRes = xml.getResponseHeader("Last-Modified");
+					} catch(e) {} // swallow exception thrown by FF if header is not available
+	
+					if ( s.ifModified && modRes )
+						jQuery.lastModified[s.url] = modRes;
+
+					// JSONP handles its own success callback
+					if ( !jsonp )
+						success();	
+				} else
+					jQuery.handleError(s, xml, status);
+
+				// Fire the complete handlers
+				complete();
+
+				// Stop memory leaks
+				if ( s.async )
+					xml = null;
+			}
+		};
+		
+		if ( s.async ) {
+			// don't attach the handler to the request, just poll it instead
+			var ival = setInterval(onreadystatechange, 13); 
+
+			// Timeout checker
+			if ( s.timeout > 0 )
+				setTimeout(function(){
+					// Check to see if the request is still happening
+					if ( xml ) {
+						// Cancel the request
+						xml.abort();
+	
+						if( !requestDone )
+							onreadystatechange( "timeout" );
+					}
+				}, s.timeout);
+		}
+			
+		// Send the data
+		try {
+			xml.send(s.data);
+		} catch(e) {
+			jQuery.handleError(s, xml, null, e);
+		}
+		
+		// firefox 1.5 doesn't fire statechange for sync requests
+		if ( !s.async )
+			onreadystatechange();
+		
+		// return XMLHttpRequest to allow aborting the request etc.
+		return xml;
+
+		function success(){
+			// If a local callback was specified, fire it and pass it the data
+			if ( s.success )
+				s.success( data, status );
+
+			// Fire the global callback
+			if ( s.global )
+				jQuery.event.trigger( "ajaxSuccess", [xml, s] );
+		}
+
+		function complete(){
+			// Process result
+			if ( s.complete )
+				s.complete(xml, status);
+
+			// The request was completed
+			if ( s.global )
+				jQuery.event.trigger( "ajaxComplete", [xml, s] );
+
+			// Handle the global AJAX counter
+			if ( s.global && ! --jQuery.active )
+				jQuery.event.trigger( "ajaxStop" );
+		}
+	},
+
+	handleError: function( s, xml, status, e ) {
+		// If a local callback was specified, fire it
+		if ( s.error ) s.error( xml, status, e );
+
+		// Fire the global callback
+		if ( s.global )
+			jQuery.event.trigger( "ajaxError", [xml, s, e] );
+	},
+
+	// Counter for holding the number of active queries
+	active: 0,
+
+	// Determines if an XMLHttpRequest was successful or not
+	httpSuccess: function( r ) {
+		try {
+			return !r.status && location.protocol == "file:" ||
+				( r.status >= 200 && r.status < 300 ) || r.status == 304 ||
+				jQuery.browser.safari && r.status == undefined;
+		} catch(e){}
+		return false;
+	},
+
+	// Determines if an XMLHttpRequest returns NotModified
+	httpNotModified: function( xml, url ) {
+		try {
+			var xmlRes = xml.getResponseHeader("Last-Modified");
+
+			// Firefox always returns 200. check Last-Modified date
+			return xml.status == 304 || xmlRes == jQuery.lastModified[url] ||
+				jQuery.browser.safari && xml.status == undefined;
+		} catch(e){}
+		return false;
+	},
+
+	httpData: function( r, type ) {
+		var ct = r.getResponseHeader("content-type");
+		var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0;
+		var data = xml ? r.responseXML : r.responseText;
+
+		if ( xml && data.documentElement.tagName == "parsererror" )
+			throw "parsererror";
+
+		// If the type is "script", eval it in global context
+		if ( type == "script" )
+			jQuery.globalEval( data );
+
+		// Get the JavaScript object, if JSON is used.
+		if ( type == "json" )
+			data = eval("(" + data + ")");
+
+		return data;
+	},
+
+	// Serialize an array of form elements or a set of
+	// key/values into a query string
+	param: function( a ) {
+		var s = [];
+
+		// If an array was passed in, assume that it is an array
+		// of form elements
+		if ( a.constructor == Array || a.jquery )
+			// Serialize the form elements
+			jQuery.each( a, function(){
+				s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) );
+			});
+
+		// Otherwise, assume that it's an object of key/value pairs
+		else
+			// Serialize the key/values
+			for ( var j in a )
+				// If the value is an array then the key names need to be repeated
+				if ( a[j] && a[j].constructor == Array )
+					jQuery.each( a[j], function(){
+						s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) );
+					});
+				else
+					s.push( encodeURIComponent(j) + "=" + encodeURIComponent( a[j] ) );
+
+		// Return the resulting serialization
+		return s.join("&").replace(/%20/g, "+");
+	}
+
+});
+jQuery.fn.extend({
+	show: function(speed,callback){
+		return speed ?
+			this.animate({
+				height: "show", width: "show", opacity: "show"
+			}, speed, callback) :
+			
+			this.filter(":hidden").each(function(){
+				this.style.display = this.oldblock ? this.oldblock : "";
+				if ( jQuery.css(this,"display") == "none" )
+					this.style.display = "block";
+			}).end();
+	},
+	
+	hide: function(speed,callback){
+		return speed ?
+			this.animate({
+				height: "hide", width: "hide", opacity: "hide"
+			}, speed, callback) :
+			
+			this.filter(":visible").each(function(){
+				this.oldblock = this.oldblock || jQuery.css(this,"display");
+				if ( this.oldblock == "none" )
+					this.oldblock = "block";
+				this.style.display = "none";
+			}).end();
+	},
+
+	// Save the old toggle function
+	_toggle: jQuery.fn.toggle,
+	
+	toggle: function( fn, fn2 ){
+		return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
+			this._toggle( fn, fn2 ) :
+			fn ?
+				this.animate({
+					height: "toggle", width: "toggle", opacity: "toggle"
+				}, fn, fn2) :
+				this.each(function(){
+					jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
+				});
+	},
+	
+	slideDown: function(speed,callback){
+		return this.animate({height: "show"}, speed, callback);
+	},
+	
+	slideUp: function(speed,callback){
+		return this.animate({height: "hide"}, speed, callback);
+	},
+
+	slideToggle: function(speed, callback){
+		return this.animate({height: "toggle"}, speed, callback);
+	},
+	
+	fadeIn: function(speed, callback){
+		return this.animate({opacity: "show"}, speed, callback);
+	},
+	
+	fadeOut: function(speed, callback){
+		return this.animate({opacity: "hide"}, speed, callback);
+	},
+	
+	fadeTo: function(speed,to,callback){
+		return this.animate({opacity: to}, speed, callback);
+	},
+	
+	animate: function( prop, speed, easing, callback ) {
+		var opt = jQuery.speed(speed, easing, callback);
+
+		return this[ opt.queue === false ? "each" : "queue" ](function(){
+			opt = jQuery.extend({}, opt);
+			var hidden = jQuery(this).is(":hidden"), self = this;
+			
+			for ( var p in prop ) {
+				if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
+					return jQuery.isFunction(opt.complete) && opt.complete.apply(this);
+
+				if ( p == "height" || p == "width" ) {
+					// Store display property
+					opt.display = jQuery.css(this, "display");
+
+					// Make sure that nothing sneaks out
+					opt.overflow = this.style.overflow;
+				}
+			}
+
+			if ( opt.overflow != null )
+				this.style.overflow = "hidden";
+
+			opt.curAnim = jQuery.extend({}, prop);
+			
+			jQuery.each( prop, function(name, val){
+				var e = new jQuery.fx( self, opt, name );
+
+				if ( /toggle|show|hide/.test(val) )
+					e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
+				else {
+					var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
+						start = e.cur(true) || 0;
+
+					if ( parts ) {
+						var end = parseFloat(parts[2]),
+							unit = parts[3] || "px";
+
+						// We need to compute starting value
+						if ( unit != "px" ) {
+							self.style[ name ] = (end || 1) + unit;
+							start = ((end || 1) / e.cur(true)) * start;
+							self.style[ name ] = start + unit;
+						}
+
+						// If a +=/-= token was provided, we're doing a relative animation
+						if ( parts[1] )
+							end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
+
+						e.custom( start, end, unit );
+					} else
+						e.custom( start, val, "" );
+				}
+			});
+
+			// For JS strict compliance
+			return true;
+		});
+	},
+	
+	queue: function(type, fn){
+		if ( jQuery.isFunction(type) ) {
+			fn = type;
+			type = "fx";
+		}
+
+		if ( !type || (typeof type == "string" && !fn) )
+			return queue( this[0], type );
+
+		return this.each(function(){
+			if ( fn.constructor == Array )
+				queue(this, type, fn);
+			else {
+				queue(this, type).push( fn );
+			
+				if ( queue(this, type).length == 1 )
+					fn.apply(this);
+			}
+		});
+	},
+
+	stop: function(){
+		var timers = jQuery.timers;
+
+		return this.each(function(){
+			for ( var i = 0; i < timers.length; i++ )
+				if ( timers[i].elem == this )
+					timers.splice(i--, 1);
+		}).dequeue();
+	}
+
+});
+
+var queue = function( elem, type, array ) {
+	if ( !elem )
+		return;
+
+	var q = jQuery.data( elem, type + "queue" );
+
+	if ( !q || array )
+		q = jQuery.data( elem, type + "queue", 
+			array ? jQuery.makeArray(array) : [] );
+
+	return q;
+};
+
+jQuery.fn.dequeue = function(type){
+	type = type || "fx";
+
+	return this.each(function(){
+		var q = queue(this, type);
+
+		q.shift();
+
+		if ( q.length )
+			q[0].apply( this );
+	});
+};
+
+jQuery.extend({
+	
+	speed: function(speed, easing, fn) {
+		var opt = speed && speed.constructor == Object ? speed : {
+			complete: fn || !fn && easing || 
+				jQuery.isFunction( speed ) && speed,
+			duration: speed,
+			easing: fn && easing || easing && easing.constructor != Function && easing
+		};
+
+		opt.duration = (opt.duration && opt.duration.constructor == Number ? 
+			opt.duration : 
+			{ slow: 600, fast: 200 }[opt.duration]) || 400;
+	
+		// Queueing
+		opt.old = opt.complete;
+		opt.complete = function(){
+			jQuery(this).dequeue();
+			if ( jQuery.isFunction( opt.old ) )
+				opt.old.apply( this );
+		};
+	
+		return opt;
+	},
+	
+	easing: {
+		linear: function( p, n, firstNum, diff ) {
+			return firstNum + diff * p;
+		},
+		swing: function( p, n, firstNum, diff ) {
+			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+		}
+	},
+	
+	timers: [],
+
+	fx: function( elem, options, prop ){
+		this.options = options;
+		this.elem = elem;
+		this.prop = prop;
+
+		if ( !options.orig )
+			options.orig = {};
+	}
+
+});
+
+jQuery.fx.prototype = {
+
+	// Simple function for setting a style value
+	update: function(){
+		if ( this.options.step )
+			this.options.step.apply( this.elem, [ this.now, this ] );
+
+		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+
+		// Set display property to block for height/width animations
+		if ( this.prop == "height" || this.prop == "width" )
+			this.elem.style.display = "block";
+	},
+
+	// Get the current size
+	cur: function(force){
+		if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null )
+			return this.elem[ this.prop ];
+
+		var r = parseFloat(jQuery.curCSS(this.elem, this.prop, force));
+		return r && r > -10000 ? r : parseFloat(jQuery.css(this.elem, this.prop)) || 0;
+	},
+
+	// Start an animation from one number to another
+	custom: function(from, to, unit){
+		this.startTime = (new Date()).getTime();
+		this.start = from;
+		this.end = to;
+		this.unit = unit || this.unit || "px";
+		this.now = this.start;
+		this.pos = this.state = 0;
+		this.update();
+
+		var self = this;
+		function t(){
+			return self.step();
+		}
+
+		t.elem = this.elem;
+
+		jQuery.timers.push(t);
+
+		if ( jQuery.timers.length == 1 ) {
+			var timer = setInterval(function(){
+				var timers = jQuery.timers;
+				
+				for ( var i = 0; i < timers.length; i++ )
+					if ( !timers[i]() )
+						timers.splice(i--, 1);
+
+				if ( !timers.length )
+					clearInterval( timer );
+			}, 13);
+		}
+	},
+
+	// Simple 'show' function
+	show: function(){
+		// Remember where we started, so that we can go back to it later
+		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
+		this.options.show = true;
+
+		// Begin the animation
+		this.custom(0, this.cur());
+
+		// Make sure that we start at a small width/height to avoid any
+		// flash of content
+		if ( this.prop == "width" || this.prop == "height" )
+			this.elem.style[this.prop] = "1px";
+		
+		// Start by showing the element
+		jQuery(this.elem).show();
+	},
+
+	// Simple 'hide' function
+	hide: function(){
+		// Remember where we started, so that we can go back to it later
+		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
+		this.options.hide = true;
+
+		// Begin the animation
+		this.custom(this.cur(), 0);
+	},
+
+	// Each step of an animation
+	step: function(){
+		var t = (new Date()).getTime();
+
+		if ( t > this.options.duration + this.startTime ) {
+			this.now = this.end;
+			this.pos = this.state = 1;
+			this.update();
+
+			this.options.curAnim[ this.prop ] = true;
+
+			var done = true;
+			for ( var i in this.options.curAnim )
+				if ( this.options.curAnim[i] !== true )
+					done = false;
+
+			if ( done ) {
+				if ( this.options.display != null ) {
+					// Reset the overflow
+					this.elem.style.overflow = this.options.overflow;
+				
+					// Reset the display
+					this.elem.style.display = this.options.display;
+					if ( jQuery.css(this.elem, "display") == "none" )
+						this.elem.style.display = "block";
+				}
+
+				// Hide the element if the "hide" operation was done
+				if ( this.options.hide )
+					this.elem.style.display = "none";
+
+				// Reset the properties, if the item has been hidden or shown
+				if ( this.options.hide || this.options.show )
+					for ( var p in this.options.curAnim )
+						jQuery.attr(this.elem.style, p, this.options.orig[p]);
+			}
+
+			// If a callback was provided, execute it
+			if ( done && jQuery.isFunction( this.options.complete ) )
+				// Execute the complete function
+				this.options.complete.apply( this.elem );
+
+			return false;
+		} else {
+			var n = t - this.startTime;
+			this.state = n / this.options.duration;
+
+			// Perform the easing function, defaults to swing
+			this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
+			this.now = this.start + ((this.end - this.start) * this.pos);
+
+			// Perform the next step of the animation
+			this.update();
+		}
+
+		return true;
+	}
+
+};
+
+jQuery.fx.step = {
+	scrollLeft: function(fx){
+		fx.elem.scrollLeft = fx.now;
+	},
+
+	scrollTop: function(fx){
+		fx.elem.scrollTop = fx.now;
+	},
+
+	opacity: function(fx){
+		jQuery.attr(fx.elem.style, "opacity", fx.now);
+	},
+
+	_default: function(fx){
+		fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+	}
+};
+// The Offset Method
+// Originally By Brandon Aaron, part of the Dimension Plugin
+// http://jquery.com/plugins/project/dimensions
+jQuery.fn.offset = function() {
+	var left = 0, top = 0, elem = this[0], results;
+	
+	if ( elem ) with ( jQuery.browser ) {
+		var	absolute     = jQuery.css(elem, "position") == "absolute", 
+		    parent       = elem.parentNode, 
+		    offsetParent = elem.offsetParent, 
+		    doc          = elem.ownerDocument,
+		    safari2      = safari && parseInt(version) < 522;
+	
+		// Use getBoundingClientRect if available
+		if ( elem.getBoundingClientRect ) {
+			box = elem.getBoundingClientRect();
+		
+			// Add the document scroll offsets
+			add(
+				box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
+				box.top  + Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop)
+			);
+		
+			// IE adds the HTML element's border, by default it is medium which is 2px
+			// IE 6 and IE 7 quirks mode the border width is overwritable by the following css html { border: 0; }
+			// IE 7 standards mode, the border is always 2px
+			if ( msie ) {
+				var border = jQuery("html").css("borderWidth");
+				border = (border == "medium" || jQuery.boxModel && parseInt(version) >= 7) && 2 || border;
+				add( -border, -border );
+			}
+	
+		// Otherwise loop through the offsetParents and parentNodes
+		} else {
+		
+			// Initial element offsets
+			add( elem.offsetLeft, elem.offsetTop );
+		
+			// Get parent offsets
+			while ( offsetParent ) {
+				// Add offsetParent offsets
+				add( offsetParent.offsetLeft, offsetParent.offsetTop );
+			
+				// Mozilla and Safari > 2 does not include the border on offset parents
+				// However Mozilla adds the border for table cells
+				if ( mozilla && /^t[d|h]$/i.test(parent.tagName) || !safari2 )
+					border( offsetParent );
+				
+				// Safari <= 2 doubles body offsets with an absolutely positioned element or parent
+				if ( safari2 && !absolute && jQuery.css(offsetParent, "position") == "absolute" )
+					absolute = true;
+			
+				// Get next offsetParent
+				offsetParent = offsetParent.offsetParent;
+			}
+		
+			// Get parent scroll offsets
+			while ( parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
+				// Work around opera inline/table scrollLeft/Top bug
+				if ( !/^inline|table-row.*$/i.test(jQuery.css(parent, "display")) )
+					// Subtract parent scroll offsets
+					add( -parent.scrollLeft, -parent.scrollTop );
+			
+				// Mozilla does not add the border for a parent that has overflow != visible
+				if ( mozilla && jQuery.css(parent, "overflow") != "visible" )
+					border( parent );
+			
+				// Get next parent
+				parent = parent.parentNode;
+			}
+		
+			// Safari doubles body offsets with an absolutely positioned element or parent
+			if ( safari2 && absolute )
+				add( -doc.body.offsetLeft, -doc.body.offsetTop );
+		}
+
+		// Return an object with top and left properties
+		results = { top: top, left: left };
+	}
+
+	return results;
+
+	function border(elem) {
+		add( jQuery.css(elem, "borderLeftWidth"), jQuery.css(elem, "borderTopWidth") );
+	}
+
+	function add(l, t) {
+		left += parseInt(l) || 0;
+		top += parseInt(t) || 0;
+	}
+};
+})();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/support/styles.css	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,293 @@
+body {
+  background: #F2F1F0;
+  font-family: verdana,sans-serif;
+}
+
+.navheader, .book, .preface, .chapter, .appendix, .bibliography, .navfooter, .basetemplate {
+  width: 50em;
+  margin-left: auto;
+  margin-right: auto;
+}
+
+a.commenttoggle:hover, a.commenttoggle:active {
+  opacity: 0.7;
+}
+
+.book, .preface, .chapter, .appendix, .bibliography, .basetemplate {
+  background: white;
+  padding: 2em;
+}
+
+h1 {
+  margin-top: 1.5em;
+}
+
+span.beta {
+  font-size: 80%;
+  font-style: italic;
+  opacity: 0.4;
+}
+
+h2, h3 {
+  margin-top: 2em;
+}
+
+h1, h2, h3 {
+  font-family: georgia,serif;
+  font-weight: normal;
+  margin-bottom: 0.5em;
+}
+
+h1.booktitle {
+  margin-bottom: 0px;
+}
+
+h2.booktitle {
+  text-align: center;
+}
+
+h2.booktitle > a {
+  color: black;
+}
+
+.authors {
+  font-size: 80%;
+  opacity: 0.55;
+  padding-left: 0.5em;
+}
+
+div.note th, div.tip th, div.warning th {
+  font-family: georgia,serif;
+  font-weight: normal;
+  font-size: 110%;
+}
+
+div.navheader th, div.navfooter td {
+  font-family: georgia,serif;
+}
+
+div.navheader th {
+  opacity: 0;
+  font-size: 0;
+}
+
+pre.screen {
+  background-image: url(/support/icons/shell.png);
+}
+
+pre.programlisting {
+  background-image: url(/support/icons/source.png);
+}
+
+pre.programlisting, pre.screen, p.remark {
+  border-style: solid;
+  border-width: 1px;
+  font-size: medium;
+  padding: 1em;
+  background-repeat: no-repeat;
+  background-position: 10px 10px;
+  padding-left: 70px;
+}
+
+strong.command, code, pre, span.type {
+  font-family: monospace;
+  font-weight: normal;
+}
+
+strong.userinput > code {
+  font-weight: bolder;
+  color: #303030;
+}
+
+div.toc > p {
+  opacity: 0.35;
+  font-family: georgia,serif;
+  cursor: pointer;
+}
+
+div.toc b {
+  font-weight: normal;
+  font-size: large;
+}
+
+ul.booktoc {
+  padding-left: 0px;
+  list-style-type: none;
+}
+
+.booktoc > li {
+  padding: 0.5em;
+}
+
+.chapinfo {
+  float: right;
+  color: #a0a0a0;
+}
+
+.unpublished {
+  color: #a0a0a0;
+}
+
+.chapinfo img {
+  vertical-align: -35%;
+  border: 0px;
+}
+
+.zebra_b {
+  background: #f4f4f4;
+}
+
+.book .titlepage {
+  display: none;
+}
+
+.chapter div.toc > dl {
+  display: none;
+}
+
+pre.programlisting, pre.screen, p.remark {
+  overflow: hidden;
+}
+
+p.remark {
+  background-image: url(/support/icons/remark.png);
+}
+
+div.warning, p.remark {
+  background-color: #FFEFE8;
+  border-color: #e0a8a0;
+}
+
+span.remark {
+  font-style: normal;
+  color: #707070;
+}
+
+.screen {
+  background: #e7ffc7 none repeat scroll 0% 50%;
+  border-color: #94DA3A;
+}
+
+.programlisting {
+  background: #F0F4FF none repeat scroll 0% 50%;
+  border-color: #B4BAEA;
+}
+
+.prompt {
+  color: #448844;
+}
+
+div.note, div.tip {
+  background: #ffffc9;
+  border-color: #B4BAEA;
+}
+
+div.note, div.warning, div.tip {
+  border-style: solid;
+  border-width: 1px;
+  padding: 1em;
+}
+
+.note .title {
+  font-size: 90%;
+}
+
+.comment {
+  font-size: 80%;
+}
+
+div.comment, div.new_comment {
+  padding: 0.5em;
+  margin: 0.5em;
+  margin-left: 2em;
+  border-style: solid;
+  border-width: 1px;
+  border-color: #aaaaff;
+}
+
+div.comment {
+  background: #eeeeff;
+}
+
+div.new_comment {
+  background: #d0d0ff;
+}
+
+.commenttoggle {
+  opacity: 0.35;
+}
+
+.comment_help {
+  font-size: 80%;
+}
+
+.comment_header {
+  opacity: 0.75;
+}
+
+.comment_id {
+  float: right;
+  opacity: 0.3;
+  font-size: 60%;
+}
+
+.comment_name {
+  font-weight: bolder;
+}
+
+.comment_reviewed {
+  color: darkgreen;
+  margin-left: 1em;
+  font-style: italic;
+}
+
+.comment_date {
+  opacity: 0.75;
+}
+
+.comment_thanks {
+  color: darkblue;
+  margin-left: 1em;
+  font-style: italic;
+  font-weight: bolder;
+}
+
+.comment_error {
+  padding-left: 1em;
+  font-weight: bolder;
+  font-size: 80%;
+  color: darkred;
+}
+
+.hgbookfooter {
+  width: 60em;
+  margin-left: auto;
+  margin-right: auto;
+  margin-top: 2em;
+  padding: 2em;
+  margin-bottom: 2em;
+  font-size: 80%;
+  color: #727272;
+  border-top: 1px solid grey;
+}
+
+.hgbookfooter a {
+  color: #5555ff;
+}
+
+.hgbookfooter a:visited {
+  opacity: 0.7;
+}
+
+.hgbookfooter img {
+  vertical-align: -45%;
+}
+
+table.equation a.commenttoggle {
+  text-align: right;
+  display: block;
+}
+
+div.comment, div.new_comment, form.comment {
+  text-align: left;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/html/support/styles/styles.css	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,293 @@
+body {
+  background: #F2F1F0;
+  font-family: verdana,sans-serif;
+}
+
+.navheader, .book, .preface, .chapter, .appendix, .bibliography, .navfooter, .basetemplate {
+  width: 50em;
+  margin-left: auto;
+  margin-right: auto;
+}
+
+a.commenttoggle:hover, a.commenttoggle:active {
+  opacity: 0.7;
+}
+
+.book, .preface, .chapter, .appendix, .bibliography, .basetemplate {
+  background: white;
+  padding: 2em;
+}
+
+h1 {
+  margin-top: 1.5em;
+}
+
+span.beta {
+  font-size: 80%;
+  font-style: italic;
+  opacity: 0.4;
+}
+
+h2, h3 {
+  margin-top: 2em;
+}
+
+h1, h2, h3 {
+  font-family: georgia,serif;
+  font-weight: normal;
+  margin-bottom: 0.5em;
+}
+
+h1.booktitle {
+  margin-bottom: 0px;
+}
+
+h2.booktitle {
+  text-align: center;
+}
+
+h2.booktitle > a {
+  color: black;
+}
+
+.authors {
+  font-size: 80%;
+  opacity: 0.55;
+  padding-left: 0.5em;
+}
+
+div.note th, div.tip th, div.warning th {
+  font-family: georgia,serif;
+  font-weight: normal;
+  font-size: 110%;
+}
+
+div.navheader th, div.navfooter td {
+  font-family: georgia,serif;
+}
+
+div.navheader th {
+  opacity: 0;
+  font-size: 0;
+}
+
+pre.screen {
+  background-image: url(/support/icons/shell.png);
+}
+
+pre.programlisting {
+  background-image: url(/support/icons/source.png);
+}
+
+pre.programlisting, pre.screen, p.remark {
+  border-style: solid;
+  border-width: 1px;
+  font-size: medium;
+  padding: 1em;
+  background-repeat: no-repeat;
+  background-position: 10px 10px;
+  padding-left: 70px;
+}
+
+strong.command, code, pre, span.type {
+  font-family: monospace;
+  font-weight: normal;
+}
+
+strong.userinput > code {
+  font-weight: bolder;
+  color: #303030;
+}
+
+div.toc > p {
+  opacity: 0.35;
+  font-family: georgia,serif;
+  cursor: pointer;
+}
+
+div.toc b {
+  font-weight: normal;
+  font-size: large;
+}
+
+ul.booktoc {
+  padding-left: 0px;
+  list-style-type: none;
+}
+
+.booktoc > li {
+  padding: 0.5em;
+}
+
+.chapinfo {
+  float: right;
+  color: #a0a0a0;
+}
+
+.unpublished {
+  color: #a0a0a0;
+}
+
+.chapinfo img {
+  vertical-align: -35%;
+  border: 0px;
+}
+
+.zebra_b {
+  background: #f4f4f4;
+}
+
+.book .titlepage {
+  display: none;
+}
+
+.chapter div.toc > dl {
+  display: none;
+}
+
+pre.programlisting, pre.screen, p.remark {
+  overflow: hidden;
+}
+
+p.remark {
+  background-image: url(/support/icons/remark.png);
+}
+
+div.warning, p.remark {
+  background-color: #FFEFE8;
+  border-color: #e0a8a0;
+}
+
+span.remark {
+  font-style: normal;
+  color: #707070;
+}
+
+.screen {
+  background: #e7ffc7 none repeat scroll 0% 50%;
+  border-color: #94DA3A;
+}
+
+.programlisting {
+  background: #F0F4FF none repeat scroll 0% 50%;
+  border-color: #B4BAEA;
+}
+
+.prompt {
+  color: #448844;
+}
+
+div.note, div.tip {
+  background: #ffffc9;
+  border-color: #B4BAEA;
+}
+
+div.note, div.warning, div.tip {
+  border-style: solid;
+  border-width: 1px;
+  padding: 1em;
+}
+
+.note .title {
+  font-size: 90%;
+}
+
+.comment {
+  font-size: 80%;
+}
+
+div.comment, div.new_comment {
+  padding: 0.5em;
+  margin: 0.5em;
+  margin-left: 2em;
+  border-style: solid;
+  border-width: 1px;
+  border-color: #aaaaff;
+}
+
+div.comment {
+  background: #eeeeff;
+}
+
+div.new_comment {
+  background: #d0d0ff;
+}
+
+.commenttoggle {
+  opacity: 0.35;
+}
+
+.comment_help {
+  font-size: 80%;
+}
+
+.comment_header {
+  opacity: 0.75;
+}
+
+.comment_id {
+  float: right;
+  opacity: 0.3;
+  font-size: 60%;
+}
+
+.comment_name {
+  font-weight: bolder;
+}
+
+.comment_reviewed {
+  color: darkgreen;
+  margin-left: 1em;
+  font-style: italic;
+}
+
+.comment_date {
+  opacity: 0.75;
+}
+
+.comment_thanks {
+  color: darkblue;
+  margin-left: 1em;
+  font-style: italic;
+  font-weight: bolder;
+}
+
+.comment_error {
+  padding-left: 1em;
+  font-weight: bolder;
+  font-size: 80%;
+  color: darkred;
+}
+
+.hgbookfooter {
+  width: 60em;
+  margin-left: auto;
+  margin-right: auto;
+  margin-top: 2em;
+  padding: 2em;
+  margin-bottom: 2em;
+  font-size: 80%;
+  color: #727272;
+  border-top: 1px solid grey;
+}
+
+.hgbookfooter a {
+  color: #5555ff;
+}
+
+.hgbookfooter a:visited {
+  opacity: 0.7;
+}
+
+.hgbookfooter img {
+  vertical-align: -45%;
+}
+
+table.equation a.commenttoggle {
+  text-align: right;
+  display: block;
+}
+
+div.comment, div.new_comment, form.comment {
+  text-align: left;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/index.html.in	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,85 @@
+<!-- -*- html -*- -->
+{% extends "boilerplate.html" %}
+
+{% block bodycontent %}
+<div class="navheader"><h1 class="booktitle">Mercurial: The Definitive Guide<div class="authors">by Bryan O'Sullivan</div></h1></div>
+
+<div class="book">
+  <h2>Welcome to Mercurial: The Definitive Guide</h2>
+
+  <p>This is the online home of the book &#8220;Mercurial: The
+    Definitive Guide&#8221;.  
+    It was published in 2009 by O'Reilly Media.</p>
+
+  <p><a href="http://www.selenic.com/mercurial">Mercurial</a> is a
+    fast, lightweight source control management system
+    designed for easy and efficient handling of very large distributed
+    projects.  My book tells you what it is, why you should care, and
+    how you can use it effectively.</p>
+
+  <h2>Read it online</h2>
+
+  <p>I make the content freely available online: you
+    can <a href="/read/"><i>read it here</i></a>.  If you like it,
+    please <a href="#buy">buy a copy</a>!</p>
+
+  <p>For news updates, please
+    visit <a href="http://www.serpentine.com/blog/">my blog</a>.  You
+    should follow me on
+    Twitter <a href="http://twitter.com/bos31337">here</a>.</p>
+
+  <h2><a name="#buy">How</a> to buy</h2>
+
+  <p>If you like the book, please support the work of the Software
+    Freedom Conservancy (<a href="#sfc">see below</a>) by buying a
+    copy.</p>
+
+  <ul>
+    <li><a href="http://www.amazon.com/gp/product/0596800673?ie=UTF8&tag=reaworhas-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0596800673">Amazon.com</a><img src="http://www.assoc-amazon.com/e/ir?t=reaworhas-20&l=as2&o=1&a=0596800673" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></li>
+    <li><a href="http://oreilly.com/catalog/9780596800673/">O'Reilly Media</a></li>
+  </ul>
+
+  <h2>You should contribute!</h2>
+
+  <p>I publish the source code for this book
+    as <a href="http://bitbucket.org/bos/hgbook">a
+      Mercurial repository</a>.  Please feel
+    welcome to clone it, make modifications to your copy, and send me
+    changes.  Getting a copy of the source takes just a few seconds if
+    you have Mercurial installed:</p>
+
+  <pre class="screen">hg clone http://bitbucket.org/bos/hgbook</pre>
+
+  <p>The online version of the book includes a comment system
+    that you can use to send feedback involving errors, omissions, and
+    suggestions.</p>
+
+  <p>(If you would like to adapt the comment system for a
+    publishing project of your own, the source for the web application
+    is included with the book source at the link above.)</p>
+
+  <h2><a name="sfc">How</a> I help Mercurial and free software, and
+    you can too</h2>
+
+  <p>Mercurial is a member of the <a href="http://conservancy.softwarefreedom.org/">Software Freedom Conservancy</a>, a
+    wonderful non-profit organisation that offers its member projects
+    legal and administrative advice.</p>
+
+  <p>I donate my royalties from the sales of this book to the
+    Software Freedom Conservancy, and I encourage you to support their
+    work, too.</p>
+
+  <p>The SFC can
+    accept <a href="http://conservancy.softwarefreedom.org/?donate">accept
+    donations</a> (tax-free under IRS 501(c)(3), within the United
+    States) on behalf of its member projects. If you would like to
+    support Mercurial directly, please consider making a donation to
+    the SFC on its behalf.</p>
+
+  <p>If you would like to help free software developers to provide
+    their important public services without being impeded by legal
+    issues, please consider donating to the SFC's sister organisation,
+    the <a href="http://www.softwarefreedom.org/">Software Freedom Law
+    Center</a>.</p>
+</div>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/javascript/hsbook.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,94 @@
+function qid(id) {
+  return id.replace(/([.:])/g, "\\$1");
+}
+
+function beforeComment(formData, jqForm, options) {
+  var form = jqForm[0];
+  if (!form.comment.value) {
+    $(options.target + " span.comment_error").empty().append(
+      "<span class=\"comment_error\">Your comment is empty</span>");
+    return false;
+  }
+  if (!form.name.value) {
+    $(options.target + " span.comment_error").empty().append(
+      "<span class=\"comment_error\">Please provide a name</span>");
+    return false;
+  }
+  $(options.target + " span.comment_error").empty().after(
+    "<img src=\"figs/throbber.gif\" style=\"vertical-align: middle\"/>");
+  $(options.target + " input[@name=submit]").attr("disabled", true);
+}
+
+function ajaxifyForm(id) {
+  var q = qid(id);
+  
+  $("#form_" + q).ajaxForm({ beforeSubmit: beforeComment,
+			     success: function() { ajaxifyForm(id); },
+			     target: "#comments_" + q });
+}
+
+function toggleComment(id) {
+  $("#toggle_" + qid(id)).nextAll().toggle();
+  return false;
+}
+
+function loadComments(id) {
+  $("#comments_" + qid(id)).load(location.protocol + "//" + location.host +
+				 "/comments/single/" + id + "/", function() {
+    ajaxifyForm(id);
+  });
+  return false;
+}
+
+function loadAllComments() {
+  $("a.commenttoggle").each(function() {
+    var id = $(this).attr("pid");
+    if (id) {
+      loadComments(id);
+    }
+  });
+}
+
+$(document).ready(function() {
+  function loading(id) {
+    return " <span id=\"comments_" + id + "\" class=\"comment\">" +
+      "<span pid=\"" + id + "\" class=\"commenttoggle\">Loading..." +
+      "</span></span>";
+  }
+  $("div.toc>p")
+    .after("<p style='display: none;'><a onclick='return loadAllComments()'>" +
+	   "Load all comments (<b>slow</b>)</a></p>")
+    .toggle(function() { $(this).nextAll().show("normal"); },
+	    function() { $(this).nextAll().hide("normal"); })
+    .hover(function() { $(this).fadeTo("normal", 0.8); },
+	   function() { $(this).fadeTo("normal", 0.35); });
+  $("p[@id]").each(function() {
+    $(this).append(loading($(this).attr("id")));
+  });
+  $("table[@id].equation").each(function() {
+    $(this).after(loading($(this).attr("id")));
+  });
+  $("pre[@id]").each(function() {
+    $(this).after(loading($(this).attr("id")));
+  });
+  var chapid = $("body, div.preface, div.chapter, div.appendix, div.bibliography").attr("id");
+  $("#chapterfeed").attr("href",
+			 $("#chapterfeed").attr("href") + chapid + "/");
+  $.getJSON(location.protocol + "//" + location.host + "/comments/chapter/" +
+	    chapid + "/count/", function(data) {
+    $.each(data, function(id, item) {
+      var s = item == 1 ? "" : "s";
+      $("#comments_" + qid(id) + " span.commenttoggle").replaceWith(
+        "<a class='commenttoggle' id='toggle_" + id + "' " +
+	"pid='" + id + "' " +
+	"onclick='return loadComments(\"" + id + "\")' " +
+	"href='comments: show / hide'>" + item + " comment" + s + "</a>");
+    });
+    $("span.commenttoggle").each(function() {
+      var id = $(this).attr("pid");
+      $(this).replaceWith("<a class='commenttoggle' id='toggle_" + id + "' " +
+			  "onclick='return loadComments(\"" + id + "\")' " +
+			  "href='comment: add'>No comments</a>");
+    });
+  });
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/robots.txt	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,2 @@
+User-agent: *
+Disallow: /feeds/
Binary file SEESenv/web/support/figs/bad-merge-1.png has changed
Binary file SEESenv/web/support/figs/bad-merge-2.png has changed
Binary file SEESenv/web/support/figs/bad-merge-3.png has changed
Binary file SEESenv/web/support/figs/bad-merge-4.png has changed
Binary file SEESenv/web/support/figs/bad-merge-5.png has changed
Binary file SEESenv/web/support/figs/caution.png has changed
Binary file SEESenv/web/support/figs/feature-branches.png has changed
Binary file SEESenv/web/support/figs/filelog.png has changed
Binary file SEESenv/web/support/figs/kdiff3.png has changed
Binary file SEESenv/web/support/figs/metadata.png has changed
Binary file SEESenv/web/support/figs/mq-stack.png has changed
Binary file SEESenv/web/support/figs/note.png has changed
Binary file SEESenv/web/support/figs/revlog.png has changed
Binary file SEESenv/web/support/figs/rss.png has changed
Binary file SEESenv/web/support/figs/snapshot.png has changed
Binary file SEESenv/web/support/figs/tip.png has changed
Binary file SEESenv/web/support/figs/tour-history.png has changed
Binary file SEESenv/web/support/figs/tour-merge-conflict.png has changed
Binary file SEESenv/web/support/figs/tour-merge-merge.png has changed
Binary file SEESenv/web/support/figs/tour-merge-pull.png has changed
Binary file SEESenv/web/support/figs/tour-merge-sep-repos.png has changed
Binary file SEESenv/web/support/figs/undo-manual-merge.png has changed
Binary file SEESenv/web/support/figs/undo-manual.png has changed
Binary file SEESenv/web/support/figs/undo-non-tip.png has changed
Binary file SEESenv/web/support/figs/undo-simple.png has changed
Binary file SEESenv/web/support/figs/wdir-after-commit.png has changed
Binary file SEESenv/web/support/figs/wdir-branch.png has changed
Binary file SEESenv/web/support/figs/wdir-merge.png has changed
Binary file SEESenv/web/support/figs/wdir-pre-branch.png has changed
Binary file SEESenv/web/support/figs/wdir.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/support/form-min.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1 @@
+(function($){$.fn.ajaxSubmit=function(_2){if(typeof _2=="function"){_2={success:_2};}_2=$.extend({url:this.attr("action")||window.location,type:this.attr("method")||"GET"},_2||{});var _3={};$.event.trigger("form.pre.serialize",[this,_2,_3]);if(_3.veto){return this;}var a=this.formToArray(_2.semantic);if(_2.data){for(var n in _2.data){a.push({name:n,value:_2.data[n]});}}if(_2.beforeSubmit&&_2.beforeSubmit(a,this,_2)===false){return this;}$.event.trigger("form.submit.validate",[a,this,_2,_3]);if(_3.veto){return this;}var q=$.param(a);if(_2.type.toUpperCase()=="GET"){_2.url+=(_2.url.indexOf("?")>=0?"&":"?")+q;_2.data=null;}else{_2.data=q;}var _7=this,callbacks=[];if(_2.resetForm){callbacks.push(function(){_7.resetForm();});}if(_2.clearForm){callbacks.push(function(){_7.clearForm();});}if(!_2.dataType&&_2.target){var _8=_2.success||function(){};callbacks.push(function(_9){if(this.evalScripts){$(_2.target).attr("innerHTML",_9).evalScripts().each(_8,arguments);}else{$(_2.target).html(_9).each(_8,arguments);}});}else{if(_2.success){callbacks.push(_2.success);}}_2.success=function(_a,_b){for(var i=0,max=callbacks.length;i<max;i++){callbacks[i](_a,_b,_7);}};var _d=$("input:file",this).fieldValue();var _e=false;for(var j=0;j<_d.length;j++){if(_d[j]){_e=true;}}if(_2.iframe||_e){fileUpload();}else{$.ajax(_2);}$.event.trigger("form.submit.notify",[this,_2]);return this;function fileUpload(){var _10=_7[0];var _11=$.extend({},$.ajaxSettings,_2);var id="jqFormIO"+$.fn.ajaxSubmit.counter++;var $io=$("<iframe id=\""+id+"\" name=\""+id+"\" />");var io=$io[0];var op8=$.browser.opera&&window.opera.version()<9;if($.browser.msie||op8){io.src="javascript:false;document.write(\"\");";}$io.css({position:"absolute",top:"-1000px",left:"-1000px"});var xhr={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=_11.global;if(g&&!$.active++){$.event.trigger("ajaxStart");}if(g){$.event.trigger("ajaxSend",[xhr,_11]);}var _18=0;var _19=0;setTimeout(function(){$io.appendTo("body");io.attachEvent?io.attachEvent("onload",cb):io.addEventListener("load",cb,false);var _1a=_10.encoding?"encoding":"enctype";var t=_7.attr("target");_7.attr({target:id,method:"POST",action:_11.url});_10[_1a]="multipart/form-data";if(_11.timeout){setTimeout(function(){_19=true;cb();},_11.timeout);}_10.submit();_7.attr("target",t);},10);function cb(){if(_18++){return;}io.detachEvent?io.detachEvent("onload",cb):io.removeEventListener("load",cb,false);var ok=true;try{if(_19){throw "timeout";}var _1d,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(_11.dataType=="json"||_11.dataType=="script"){var ta=doc.getElementsByTagName("textarea")[0];_1d=ta?ta.value:xhr.responseText;if(_11.dataType=="json"){eval("data = "+_1d);}else{$.globalEval(_1d);}}else{if(_11.dataType=="xml"){_1d=xhr.responseXML;if(!_1d&&xhr.responseText!=null){_1d=toXml(xhr.responseText);}}else{_1d=xhr.responseText;}}}catch(e){ok=false;$.handleError(_11,xhr,"error",e);}if(ok){_11.success(_1d,"success");if(g){$.event.trigger("ajaxSuccess",[xhr,_11]);}}if(g){$.event.trigger("ajaxComplete",[xhr,_11]);}if(g&&!--$.active){$.event.trigger("ajaxStop");}if(_11.complete){_11.complete(xhr,ok?"success":"error");}setTimeout(function(){$io.remove();xhr.responseXML=null;},100);}function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s);}else{doc=(new DOMParser()).parseFromString(s,"text/xml");}return (doc&&doc.documentElement&&doc.documentElement.tagName!="parsererror")?doc:null;}}};$.fn.ajaxSubmit.counter=0;$.fn.ajaxForm=function(_21){return this.ajaxFormUnbind().submit(submitHandler).each(function(){this.formPluginId=$.fn.ajaxForm.counter++;$.fn.ajaxForm.optionHash[this.formPluginId]=_21;$(":submit,input:image",this).click(clickHandler);});};$.fn.ajaxForm.counter=1;$.fn.ajaxForm.optionHash={};function clickHandler(e){var _23=this.form;_23.clk=this;if(this.type=="image"){if(e.offsetX!=undefined){_23.clk_x=e.offsetX;_23.clk_y=e.offsetY;}else{if(typeof $.fn.offset=="function"){var _24=$(this).offset();_23.clk_x=e.pageX-_24.left;_23.clk_y=e.pageY-_24.top;}else{_23.clk_x=e.pageX-this.offsetLeft;_23.clk_y=e.pageY-this.offsetTop;}}}setTimeout(function(){_23.clk=_23.clk_x=_23.clk_y=null;},10);}function submitHandler(){var id=this.formPluginId;var _26=$.fn.ajaxForm.optionHash[id];$(this).ajaxSubmit(_26);return false;}$.fn.ajaxFormUnbind=function(){this.unbind("submit",submitHandler);return this.each(function(){$(":submit,input:image",this).unbind("click",clickHandler);});};$.fn.formToArray=function(_27){var a=[];if(this.length==0){return a;}var _29=this[0];var els=_27?_29.getElementsByTagName("*"):_29.elements;if(!els){return a;}for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n){continue;}if(_27&&_29.clk&&el.type=="image"){if(!el.disabled&&_29.clk==el){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}continue;}var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:n,value:v});}}}if(!_27&&_29.clk){var _30=_29.getElementsByTagName("input");for(var i=0,max=_30.length;i<max;i++){var _32=_30[i];var n=_32.name;if(n&&!_32.disabled&&_32.type=="image"&&_29.clk==_32){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}}}return a;};$.fn.formSerialize=function(_34){return $.param(this.formToArray(_34));};$.fn.fieldSerialize=function(_35){var a=[];this.each(function(){var n=this.name;if(!n){return;}var v=$.fieldValue(this,_35);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:this.name,value:v});}}});return $.param(a);};$.fn.fieldValue=function(_3a){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,_3a);if(v===null||typeof v=="undefined"||(v.constructor==Array&&!v.length)){continue;}v.constructor==Array?$.merge(val,v):val.push(v);}return val;};$.fieldValue=function(el,_3f){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof _3f=="undefined"){_3f=true;}if(_3f&&(!n||el.disabled||t=="reset"||t=="button"||(t=="checkbox"||t=="radio")&&!el.checked||(t=="submit"||t=="image")&&el.form&&el.form.clk!=el||tag=="select"&&el.selectedIndex==-1)){return null;}if(tag=="select"){var _41=el.selectedIndex;if(_41<0){return null;}var a=[],ops=el.options;var one=(t=="select-one");var max=(one?_41+1:ops.length);for(var i=(one?_41:0);i<max;i++){var op=ops[i];if(op.selected){var v=$.browser.msie&&!(op.attributes["value"].specified)?op.text:op.value;if(one){return v;}a.push(v);}}return a;}return el.value;};$.fn.clearForm=function(){return this.each(function(){$("input,select,textarea",this).clearFields();});};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=="text"||t=="password"||tag=="textarea"){this.value="";}else{if(t=="checkbox"||t=="radio"){this.checked=false;}else{if(tag=="select"){this.selectedIndex=-1;}}}});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset();}});};})(jQuery);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/support/form.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,819 @@
+/*
+ * jQuery Form Plugin
+ * @requires jQuery v1.1 or later
+ *
+ * Examples at: http://malsup.com/jquery/form/
+ * Dual licensed under the MIT and GPL licenses:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ *
+ * Revision: $Id$
+ */
+ (function($) {
+/**
+ * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.
+ *
+ * ajaxSubmit accepts a single argument which can be either a success callback function
+ * or an options Object.  If a function is provided it will be invoked upon successful
+ * completion of the submit and will be passed the response from the server.
+ * If an options Object is provided, the following attributes are supported:
+ *
+ *  target:   Identifies the element(s) in the page to be updated with the server response.
+ *            This value may be specified as a jQuery selection string, a jQuery object,
+ *            or a DOM element.
+ *            default value: null
+ *
+ *  url:      URL to which the form data will be submitted.
+ *            default value: value of form's 'action' attribute
+ *
+ *  type:     The method in which the form data should be submitted, 'GET' or 'POST'.
+ *            default value: value of form's 'method' attribute (or 'GET' if none found)
+ *
+ *  data:     Additional data to add to the request, specified as key/value pairs (see $.ajax).
+ *
+ *  beforeSubmit:  Callback method to be invoked before the form is submitted.
+ *            default value: null
+ *
+ *  success:  Callback method to be invoked after the form has been successfully submitted
+ *            and the response has been returned from the server
+ *            default value: null
+ *
+ *  dataType: Expected dataType of the response.  One of: null, 'xml', 'script', or 'json'
+ *            default value: null
+ *
+ *  semantic: Boolean flag indicating whether data must be submitted in semantic order (slower).
+ *            default value: false
+ *
+ *  resetForm: Boolean flag indicating whether the form should be reset if the submit is successful
+ *
+ *  clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful
+ *
+ *
+ * The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for
+ * validating the form data.  If the 'beforeSubmit' callback returns false then the form will
+ * not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data
+ * in array format, the jQuery object, and the options object passed into ajaxSubmit.
+ * The form data array takes the following form:
+ *
+ *     [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * If a 'success' callback method is provided it is invoked after the response has been returned
+ * from the server.  It is passed the responseText or responseXML value (depending on dataType).
+ * See jQuery.ajax for further details.
+ *
+ *
+ * The dataType option provides a means for specifying how the server response should be handled.
+ * This maps directly to the jQuery.httpData method.  The following values are supported:
+ *
+ *      'xml':    if dataType == 'xml' the server response is treated as XML and the 'success'
+ *                   callback method, if specified, will be passed the responseXML value
+ *      'json':   if dataType == 'json' the server response will be evaluted and passed to
+ *                   the 'success' callback, if specified
+ *      'script': if dataType == 'script' the server response is evaluated in the global context
+ *
+ *
+ * Note that it does not make sense to use both the 'target' and 'dataType' options.  If both
+ * are provided the target will be ignored.
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * This is normally true anyway, unless the form contains input elements of type='image'.
+ * If your form must be submitted with name/value pairs in semantic order and your form
+ * contains an input of type='image" then pass true for this arg, otherwise pass false
+ * (or nothing) to avoid the overhead for this logic.
+ *
+ *
+ * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this:
+ *
+ * $("#form-id").submit(function() {
+ *     $(this).ajaxSubmit(options);
+ *     return false; // cancel conventional submit
+ * });
+ *
+ * When using ajaxForm(), however, this is done for you.
+ *
+ * @example
+ * $('#myForm').ajaxSubmit(function(data) {
+ *     alert('Form submit succeeded! Server returned: ' + data);
+ * });
+ * @desc Submit form and alert server response
+ *
+ *
+ * @example
+ * var options = {
+ *     target: '#myTargetDiv'
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Submit form and update page element with server response
+ *
+ *
+ * @example
+ * var options = {
+ *     success: function(responseText) {
+ *         alert(responseText);
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Submit form and alert the server response
+ *
+ *
+ * @example
+ * var options = {
+ *     beforeSubmit: function(formArray, jqForm) {
+ *         if (formArray.length == 0) {
+ *             alert('Please enter data.');
+ *             return false;
+ *         }
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Pre-submit validation which aborts the submit operation if form data is empty
+ *
+ *
+ * @example
+ * var options = {
+ *     url: myJsonUrl.php,
+ *     dataType: 'json',
+ *     success: function(data) {
+ *        // 'data' is an object representing the the evaluated json data
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc json data returned and evaluated
+ *
+ *
+ * @example
+ * var options = {
+ *     url: myXmlUrl.php,
+ *     dataType: 'xml',
+ *     success: function(responseXML) {
+ *        // responseXML is XML document object
+ *        var data = $('myElement', responseXML).text();
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc XML data returned from server
+ *
+ *
+ * @example
+ * var options = {
+ *     resetForm: true
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc submit form and reset it if successful
+ *
+ * @example
+ * $('#myForm).submit(function() {
+ *    $(this).ajaxSubmit();
+ *    return false;
+ * });
+ * @desc Bind form's submit event to use ajaxSubmit
+ *
+ *
+ * @name ajaxSubmit
+ * @type jQuery
+ * @param options  object literal containing options which control the form submission process
+ * @cat Plugins/Form
+ * @return jQuery
+ */
+$.fn.ajaxSubmit = function(options) {
+    if (typeof options == 'function')
+        options = { success: options };
+
+    options = $.extend({
+        url:  this.attr('action') || window.location,
+        type: this.attr('method') || 'GET'
+    }, options || {});
+
+    // hook for manipulating the form data before it is extracted;
+    // convenient for use with rich editors like tinyMCE or FCKEditor
+    var veto = {};
+    $.event.trigger('form.pre.serialize', [this, options, veto]);
+    if (veto.veto) return this;
+
+    var a = this.formToArray(options.semantic);
+	if (options.data) {
+	    for (var n in options.data)
+	        a.push( { name: n, value: options.data[n] } );
+	}
+
+    // give pre-submit callback an opportunity to abort the submit
+    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this;
+
+    // fire vetoable 'validate' event
+    $.event.trigger('form.submit.validate', [a, this, options, veto]);
+    if (veto.veto) return this;
+
+    var q = $.param(a);//.replace(/%20/g,'+');
+
+    if (options.type.toUpperCase() == 'GET') {
+        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
+        options.data = null;  // data is null for 'get'
+    }
+    else
+        options.data = q; // data is the query string for 'post'
+
+    var $form = this, callbacks = [];
+    if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
+    if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
+
+    // perform a load on the target only if dataType is not provided
+    if (!options.dataType && options.target) {
+        var oldSuccess = options.success || function(){};
+        callbacks.push(function(data) {
+            if (this.evalScripts)
+                $(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments);
+            else // jQuery v1.1.4
+                $(options.target).html(data).each(oldSuccess, arguments);
+        });
+    }
+    else if (options.success)
+        callbacks.push(options.success);
+
+    options.success = function(data, status) {
+        for (var i=0, max=callbacks.length; i < max; i++)
+            callbacks[i](data, status, $form);
+    };
+
+    // are there files to upload?
+    var files = $('input:file', this).fieldValue();
+    var found = false;
+    for (var j=0; j < files.length; j++)
+        if (files[j])
+            found = true;
+
+    if (options.iframe || found) // options.iframe allows user to force iframe mode
+        fileUpload();
+    else
+        $.ajax(options);
+
+    // fire 'notify' event
+    $.event.trigger('form.submit.notify', [this, options]);
+    return this;
+
+
+    // private function for handling file uploads (hat tip to YAHOO!)
+    function fileUpload() {
+        var form = $form[0];
+        var opts = $.extend({}, $.ajaxSettings, options);
+
+        var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++;
+        var $io = $('<iframe id="' + id + '" name="' + id + '" />');
+        var io = $io[0];
+        var op8 = $.browser.opera && window.opera.version() < 9;
+        if ($.browser.msie || op8) io.src = 'javascript:false;document.write("");';
+        $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
+
+        var xhr = { // mock object
+            responseText: null,
+            responseXML: null,
+            status: 0,
+            statusText: 'n/a',
+            getAllResponseHeaders: function() {},
+            getResponseHeader: function() {},
+            setRequestHeader: function() {}
+        };
+
+        var g = opts.global;
+        // trigger ajax global events so that activity/block indicators work like normal
+        if (g && ! $.active++) $.event.trigger("ajaxStart");
+        if (g) $.event.trigger("ajaxSend", [xhr, opts]);
+
+        var cbInvoked = 0;
+        var timedOut = 0;
+
+        // take a breath so that pending repaints get some cpu time before the upload starts
+        setTimeout(function() {
+            $io.appendTo('body');
+            // jQuery's event binding doesn't work for iframe events in IE
+            io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
+
+            // make sure form attrs are set
+            var encAttr = form.encoding ? 'encoding' : 'enctype';
+            var t = $form.attr('target');
+            $form.attr({
+                target:   id,
+                method:  'POST',
+                action:  opts.url
+            });
+            form[encAttr] = 'multipart/form-data';
+
+            // support timout
+            if (opts.timeout)
+                setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
+
+            form.submit();
+            $form.attr('target', t); // reset target
+        }, 10);
+
+        function cb() {
+            if (cbInvoked++) return;
+
+            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
+
+            var ok = true;
+            try {
+                if (timedOut) throw 'timeout';
+                // extract the server response from the iframe
+                var data, doc;
+                doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
+                xhr.responseText = doc.body ? doc.body.innerHTML : null;
+                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
+
+                if (opts.dataType == 'json' || opts.dataType == 'script') {
+                    var ta = doc.getElementsByTagName('textarea')[0];
+                    data = ta ? ta.value : xhr.responseText;
+                    if (opts.dataType == 'json')
+                        eval("data = " + data);
+                    else
+                        $.globalEval(data);
+                }
+                else if (opts.dataType == 'xml') {
+                    data = xhr.responseXML;
+                    if (!data && xhr.responseText != null)
+                        data = toXml(xhr.responseText);
+                }
+                else {
+                    data = xhr.responseText;
+                }
+            }
+            catch(e){
+                ok = false;
+                $.handleError(opts, xhr, 'error', e);
+            }
+
+            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
+            if (ok) {
+                opts.success(data, 'success');
+                if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
+            }
+            if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
+            if (g && ! --$.active) $.event.trigger("ajaxStop");
+            if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
+
+            // clean up
+            setTimeout(function() {
+                $io.remove();
+                xhr.responseXML = null;
+            }, 100);
+        };
+
+        function toXml(s, doc) {
+            if (window.ActiveXObject) {
+                doc = new ActiveXObject('Microsoft.XMLDOM');
+                doc.async = 'false';
+                doc.loadXML(s);
+            }
+            else
+                doc = (new DOMParser()).parseFromString(s, 'text/xml');
+            return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
+        };
+    };
+};
+$.fn.ajaxSubmit.counter = 0; // used to create unique iframe ids
+
+/**
+ * ajaxForm() provides a mechanism for fully automating form submission.
+ *
+ * The advantages of using this method instead of ajaxSubmit() are:
+ *
+ * 1: This method will include coordinates for <input type="image" /> elements (if the element
+ *    is used to submit the form).
+ * 2. This method will include the submit element's name/value data (for the element that was
+ *    used to submit the form).
+ * 3. This method binds the submit() method to the form for you.
+ *
+ * Note that for accurate x/y coordinates of image submit elements in all browsers
+ * you need to also use the "dimensions" plugin (this method will auto-detect its presence).
+ *
+ * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
+ * passes the options argument along after properly binding events for submit elements and
+ * the form itself.  See ajaxSubmit for a full description of the options argument.
+ *
+ *
+ * @example
+ * var options = {
+ *     target: '#myTargetDiv'
+ * };
+ * $('#myForm').ajaxSForm(options);
+ * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response
+ *       when the form is submitted.
+ *
+ *
+ * @example
+ * var options = {
+ *     success: function(responseText) {
+ *         alert(responseText);
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Bind form's submit event so that server response is alerted after the form is submitted.
+ *
+ *
+ * @example
+ * var options = {
+ *     beforeSubmit: function(formArray, jqForm) {
+ *         if (formArray.length == 0) {
+ *             alert('Please enter data.');
+ *             return false;
+ *         }
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Bind form's submit event so that pre-submit callback is invoked before the form
+ *       is submitted.
+ *
+ *
+ * @name   ajaxForm
+ * @param  options  object literal containing options which control the form submission process
+ * @return jQuery
+ * @cat    Plugins/Form
+ * @type   jQuery
+ */
+$.fn.ajaxForm = function(options) {
+    return this.ajaxFormUnbind().submit(submitHandler).each(function() {
+        // store options in hash
+        this.formPluginId = $.fn.ajaxForm.counter++;
+        $.fn.ajaxForm.optionHash[this.formPluginId] = options;
+        $(":submit,input:image", this).click(clickHandler);
+    });
+};
+
+$.fn.ajaxForm.counter = 1;
+$.fn.ajaxForm.optionHash = {};
+
+function clickHandler(e) {
+    var $form = this.form;
+    $form.clk = this;
+    if (this.type == 'image') {
+        if (e.offsetX != undefined) {
+            $form.clk_x = e.offsetX;
+            $form.clk_y = e.offsetY;
+        } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
+            var offset = $(this).offset();
+            $form.clk_x = e.pageX - offset.left;
+            $form.clk_y = e.pageY - offset.top;
+        } else {
+            $form.clk_x = e.pageX - this.offsetLeft;
+            $form.clk_y = e.pageY - this.offsetTop;
+        }
+    }
+    // clear form vars
+    setTimeout(function() { $form.clk = $form.clk_x = $form.clk_y = null; }, 10);
+};
+
+function submitHandler() {
+    // retrieve options from hash
+    var id = this.formPluginId;
+    var options = $.fn.ajaxForm.optionHash[id];
+    $(this).ajaxSubmit(options);
+    return false;
+};
+
+/**
+ * ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
+ *
+ * @name   ajaxFormUnbind
+ * @return jQuery
+ * @cat    Plugins/Form
+ * @type   jQuery
+ */
+$.fn.ajaxFormUnbind = function() {
+    this.unbind('submit', submitHandler);
+    return this.each(function() {
+        $(":submit,input:image", this).unbind('click', clickHandler);
+    });
+
+};
+
+/**
+ * formToArray() gathers form element data into an array of objects that can
+ * be passed to any of the following ajax functions: $.get, $.post, or load.
+ * Each object in the array has both a 'name' and 'value' property.  An example of
+ * an array for a simple login form might be:
+ *
+ * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * It is this array that is passed to pre-submit callback functions provided to the
+ * ajaxSubmit() and ajaxForm() methods.
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * This is normally true anyway, unless the form contains input elements of type='image'.
+ * If your form must be submitted with name/value pairs in semantic order and your form
+ * contains an input of type='image" then pass true for this arg, otherwise pass false
+ * (or nothing) to avoid the overhead for this logic.
+ *
+ * @example var data = $("#myForm").formToArray();
+ * $.post( "myscript.cgi", data );
+ * @desc Collect all the data from a form and submit it to the server.
+ *
+ * @name formToArray
+ * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
+ * @type Array<Object>
+ * @cat Plugins/Form
+ */
+$.fn.formToArray = function(semantic) {
+    var a = [];
+    if (this.length == 0) return a;
+
+    var form = this[0];
+    var els = semantic ? form.getElementsByTagName('*') : form.elements;
+    if (!els) return a;
+    for(var i=0, max=els.length; i < max; i++) {
+        var el = els[i];
+        var n = el.name;
+        if (!n) continue;
+
+        if (semantic && form.clk && el.type == "image") {
+            // handle image inputs on the fly when semantic == true
+            if(!el.disabled && form.clk == el)
+                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+            continue;
+        }
+
+        var v = $.fieldValue(el, true);
+        if (v && v.constructor == Array) {
+            for(var j=0, jmax=v.length; j < jmax; j++)
+                a.push({name: n, value: v[j]});
+        }
+        else if (v !== null && typeof v != 'undefined')
+            a.push({name: n, value: v});
+    }
+
+    if (!semantic && form.clk) {
+        // input type=='image' are not found in elements array! handle them here
+        var inputs = form.getElementsByTagName("input");
+        for(var i=0, max=inputs.length; i < max; i++) {
+            var input = inputs[i];
+            var n = input.name;
+            if(n && !input.disabled && input.type == "image" && form.clk == input)
+                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+        }
+    }
+    return a;
+};
+
+
+/**
+ * Serializes form data into a 'submittable' string. This method will return a string
+ * in the format: name1=value1&amp;name2=value2
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * If your form must be submitted with name/value pairs in semantic order then pass
+ * true for this arg, otherwise pass false (or nothing) to avoid the overhead for
+ * this logic (which can be significant for very large forms).
+ *
+ * @example var data = $("#myForm").formSerialize();
+ * $.ajax('POST', "myscript.cgi", data);
+ * @desc Collect all the data from a form into a single string
+ *
+ * @name formSerialize
+ * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
+ * @type String
+ * @cat Plugins/Form
+ */
+$.fn.formSerialize = function(semantic) {
+    //hand off to jQuery.param for proper encoding
+    return $.param(this.formToArray(semantic));
+};
+
+
+/**
+ * Serializes all field elements in the jQuery object into a query string.
+ * This method will return a string in the format: name1=value1&amp;name2=value2
+ *
+ * The successful argument controls whether or not serialization is limited to
+ * 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.
+ *
+ * @example var data = $("input").formSerialize();
+ * @desc Collect the data from all successful input elements into a query string
+ *
+ * @example var data = $(":radio").formSerialize();
+ * @desc Collect the data from all successful radio input elements into a query string
+ *
+ * @example var data = $("#myForm :checkbox").formSerialize();
+ * @desc Collect the data from all successful checkbox input elements in myForm into a query string
+ *
+ * @example var data = $("#myForm :checkbox").formSerialize(false);
+ * @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string
+ *
+ * @example var data = $(":input").formSerialize();
+ * @desc Collect the data from all successful input, select, textarea and button elements into a query string
+ *
+ * @name fieldSerialize
+ * @param successful true if only successful controls should be serialized (default is true)
+ * @type String
+ * @cat Plugins/Form
+ */
+$.fn.fieldSerialize = function(successful) {
+    var a = [];
+    this.each(function() {
+        var n = this.name;
+        if (!n) return;
+        var v = $.fieldValue(this, successful);
+        if (v && v.constructor == Array) {
+            for (var i=0,max=v.length; i < max; i++)
+                a.push({name: n, value: v[i]});
+        }
+        else if (v !== null && typeof v != 'undefined')
+            a.push({name: this.name, value: v});
+    });
+    //hand off to jQuery.param for proper encoding
+    return $.param(a);
+};
+
+
+/**
+ * Returns the value(s) of the element in the matched set.  For example, consider the following form:
+ *
+ *  <form><fieldset>
+ *      <input name="A" type="text" />
+ *      <input name="A" type="text" />
+ *      <input name="B" type="checkbox" value="B1" />
+ *      <input name="B" type="checkbox" value="B2"/>
+ *      <input name="C" type="radio" value="C1" />
+ *      <input name="C" type="radio" value="C2" />
+ *  </fieldset></form>
+ *
+ *  var v = $(':text').fieldValue();
+ *  // if no values are entered into the text inputs
+ *  v == ['','']
+ *  // if values entered into the text inputs are 'foo' and 'bar'
+ *  v == ['foo','bar']
+ *
+ *  var v = $(':checkbox').fieldValue();
+ *  // if neither checkbox is checked
+ *  v === undefined
+ *  // if both checkboxes are checked
+ *  v == ['B1', 'B2']
+ *
+ *  var v = $(':radio').fieldValue();
+ *  // if neither radio is checked
+ *  v === undefined
+ *  // if first radio is checked
+ *  v == ['C1']
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.  If this value is false the value(s)
+ * for each element is returned.
+ *
+ * Note: This method *always* returns an array.  If no valid value can be determined the
+ *       array will be empty, otherwise it will contain one or more values.
+ *
+ * @example var data = $("#myPasswordElement").fieldValue();
+ * alert(data[0]);
+ * @desc Alerts the current value of the myPasswordElement element
+ *
+ * @example var data = $("#myForm :input").fieldValue();
+ * @desc Get the value(s) of the form elements in myForm
+ *
+ * @example var data = $("#myForm :checkbox").fieldValue();
+ * @desc Get the value(s) for the successful checkbox element(s) in the jQuery object.
+ *
+ * @example var data = $("#mySingleSelect").fieldValue();
+ * @desc Get the value(s) of the select control
+ *
+ * @example var data = $(':text').fieldValue();
+ * @desc Get the value(s) of the text input or textarea elements
+ *
+ * @example var data = $("#myMultiSelect").fieldValue();
+ * @desc Get the values for the select-multiple control
+ *
+ * @name fieldValue
+ * @param Boolean successful true if only the values for successful controls should be returned (default is true)
+ * @type Array<String>
+ * @cat Plugins/Form
+ */
+$.fn.fieldValue = function(successful) {
+    for (var val=[], i=0, max=this.length; i < max; i++) {
+        var el = this[i];
+        var v = $.fieldValue(el, successful);
+        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
+            continue;
+        v.constructor == Array ? $.merge(val, v) : val.push(v);
+    }
+    return val;
+};
+
+/**
+ * Returns the value of the field element.
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.  If the given element is not
+ * successful and the successful arg is not false then the returned value will be null.
+ *
+ * Note: If the successful flag is true (default) but the element is not successful, the return will be null
+ * Note: The value returned for a successful select-multiple element will always be an array.
+ * Note: If the element has no value the return value will be undefined.
+ *
+ * @example var data = jQuery.fieldValue($("#myPasswordElement")[0]);
+ * @desc Gets the current value of the myPasswordElement element
+ *
+ * @name fieldValue
+ * @param Element el The DOM element for which the value will be returned
+ * @param Boolean successful true if value returned must be for a successful controls (default is true)
+ * @type String or Array<String> or null or undefined
+ * @cat Plugins/Form
+ */
+$.fieldValue = function(el, successful) {
+    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
+    if (typeof successful == 'undefined') successful = true;
+
+    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
+        (t == 'checkbox' || t == 'radio') && !el.checked ||
+        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
+        tag == 'select' && el.selectedIndex == -1))
+            return null;
+
+    if (tag == 'select') {
+        var index = el.selectedIndex;
+        if (index < 0) return null;
+        var a = [], ops = el.options;
+        var one = (t == 'select-one');
+        var max = (one ? index+1 : ops.length);
+        for(var i=(one ? index : 0); i < max; i++) {
+            var op = ops[i];
+            if (op.selected) {
+                // extra pain for IE...
+                var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
+                if (one) return v;
+                a.push(v);
+            }
+        }
+        return a;
+    }
+    return el.value;
+};
+
+
+/**
+ * Clears the form data.  Takes the following actions on the form's input fields:
+ *  - input text fields will have their 'value' property set to the empty string
+ *  - select elements will have their 'selectedIndex' property set to -1
+ *  - checkbox and radio inputs will have their 'checked' property set to false
+ *  - inputs of type submit, button, reset, and hidden will *not* be effected
+ *  - button elements will *not* be effected
+ *
+ * @example $('form').clearForm();
+ * @desc Clears all forms on the page.
+ *
+ * @name clearForm
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.clearForm = function() {
+    return this.each(function() {
+        $('input,select,textarea', this).clearFields();
+    });
+};
+
+/**
+ * Clears the selected form elements.  Takes the following actions on the matched elements:
+ *  - input text fields will have their 'value' property set to the empty string
+ *  - select elements will have their 'selectedIndex' property set to -1
+ *  - checkbox and radio inputs will have their 'checked' property set to false
+ *  - inputs of type submit, button, reset, and hidden will *not* be effected
+ *  - button elements will *not* be effected
+ *
+ * @example $('.myInputs').clearFields();
+ * @desc Clears all inputs with class myInputs
+ *
+ * @name clearFields
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.clearFields = $.fn.clearInputs = function() {
+    return this.each(function() {
+        var t = this.type, tag = this.tagName.toLowerCase();
+        if (t == 'text' || t == 'password' || tag == 'textarea')
+            this.value = '';
+        else if (t == 'checkbox' || t == 'radio')
+            this.checked = false;
+        else if (tag == 'select')
+            this.selectedIndex = -1;
+    });
+};
+
+
+/**
+ * Resets the form data.  Causes all form elements to be reset to their original value.
+ *
+ * @example $('form').resetForm();
+ * @desc Resets all forms on the page.
+ *
+ * @name resetForm
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.resetForm = function() {
+    return this.each(function() {
+        // guard against an input with the name of 'reset'
+        // note that IE reports the reset function as an 'object'
+        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
+            this.reset();
+    });
+};
+
+})(jQuery);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/support/form.js~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,819 @@
+/*
+ * jQuery Form Plugin
+ * @requires jQuery v1.1 or later
+ *
+ * Examples at: http://malsup.com/jquery/form/
+ * Dual licensed under the MIT and GPL licenses:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ *
+ * Revision: $Id$
+ */
+ (function($) {
+/**
+ * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.
+ *
+ * ajaxSubmit accepts a single argument which can be either a success callback function
+ * or an options Object.  If a function is provided it will be invoked upon successful
+ * completion of the submit and will be passed the response from the server.
+ * If an options Object is provided, the following attributes are supported:
+ *
+ *  target:   Identifies the element(s) in the page to be updated with the server response.
+ *            This value may be specified as a jQuery selection string, a jQuery object,
+ *            or a DOM element.
+ *            default value: null
+ *
+ *  url:      URL to which the form data will be submitted.
+ *            default value: value of form's 'action' attribute
+ *
+ *  type:     The method in which the form data should be submitted, 'GET' or 'POST'.
+ *            default value: value of form's 'method' attribute (or 'GET' if none found)
+ *
+ *  data:     Additional data to add to the request, specified as key/value pairs (see $.ajax).
+ *
+ *  beforeSubmit:  Callback method to be invoked before the form is submitted.
+ *            default value: null
+ *
+ *  success:  Callback method to be invoked after the form has been successfully submitted
+ *            and the response has been returned from the server
+ *            default value: null
+ *
+ *  dataType: Expected dataType of the response.  One of: null, 'xml', 'script', or 'json'
+ *            default value: null
+ *
+ *  semantic: Boolean flag indicating whether data must be submitted in semantic order (slower).
+ *            default value: false
+ *
+ *  resetForm: Boolean flag indicating whether the form should be reset if the submit is successful
+ *
+ *  clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful
+ *
+ *
+ * The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for
+ * validating the form data.  If the 'beforeSubmit' callback returns false then the form will
+ * not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data
+ * in array format, the jQuery object, and the options object passed into ajaxSubmit.
+ * The form data array takes the following form:
+ *
+ *     [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * If a 'success' callback method is provided it is invoked after the response has been returned
+ * from the server.  It is passed the responseText or responseXML value (depending on dataType).
+ * See jQuery.ajax for further details.
+ *
+ *
+ * The dataType option provides a means for specifying how the server response should be handled.
+ * This maps directly to the jQuery.httpData method.  The following values are supported:
+ *
+ *      'xml':    if dataType == 'xml' the server response is treated as XML and the 'success'
+ *                   callback method, if specified, will be passed the responseXML value
+ *      'json':   if dataType == 'json' the server response will be evaluted and passed to
+ *                   the 'success' callback, if specified
+ *      'script': if dataType == 'script' the server response is evaluated in the global context
+ *
+ *
+ * Note that it does not make sense to use both the 'target' and 'dataType' options.  If both
+ * are provided the target will be ignored.
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * This is normally true anyway, unless the form contains input elements of type='image'.
+ * If your form must be submitted with name/value pairs in semantic order and your form
+ * contains an input of type='image" then pass true for this arg, otherwise pass false
+ * (or nothing) to avoid the overhead for this logic.
+ *
+ *
+ * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this:
+ *
+ * $("#form-id").submit(function() {
+ *     $(this).ajaxSubmit(options);
+ *     return false; // cancel conventional submit
+ * });
+ *
+ * When using ajaxForm(), however, this is done for you.
+ *
+ * @example
+ * $('#myForm').ajaxSubmit(function(data) {
+ *     alert('Form submit succeeded! Server returned: ' + data);
+ * });
+ * @desc Submit form and alert server response
+ *
+ *
+ * @example
+ * var options = {
+ *     target: '#myTargetDiv'
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Submit form and update page element with server response
+ *
+ *
+ * @example
+ * var options = {
+ *     success: function(responseText) {
+ *         alert(responseText);
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Submit form and alert the server response
+ *
+ *
+ * @example
+ * var options = {
+ *     beforeSubmit: function(formArray, jqForm) {
+ *         if (formArray.length == 0) {
+ *             alert('Please enter data.');
+ *             return false;
+ *         }
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Pre-submit validation which aborts the submit operation if form data is empty
+ *
+ *
+ * @example
+ * var options = {
+ *     url: myJsonUrl.php,
+ *     dataType: 'json',
+ *     success: function(data) {
+ *        // 'data' is an object representing the the evaluated json data
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc json data returned and evaluated
+ *
+ *
+ * @example
+ * var options = {
+ *     url: myXmlUrl.php,
+ *     dataType: 'xml',
+ *     success: function(responseXML) {
+ *        // responseXML is XML document object
+ *        var data = $('myElement', responseXML).text();
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc XML data returned from server
+ *
+ *
+ * @example
+ * var options = {
+ *     resetForm: true
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc submit form and reset it if successful
+ *
+ * @example
+ * $('#myForm).submit(function() {
+ *    $(this).ajaxSubmit();
+ *    return false;
+ * });
+ * @desc Bind form's submit event to use ajaxSubmit
+ *
+ *
+ * @name ajaxSubmit
+ * @type jQuery
+ * @param options  object literal containing options which control the form submission process
+ * @cat Plugins/Form
+ * @return jQuery
+ */
+$.fn.ajaxSubmit = function(options) {
+    if (typeof options == 'function')
+        options = { success: options };
+
+    options = $.extend({
+        url:  this.attr('action') || window.location,
+        type: this.attr('method') || 'GET'
+    }, options || {});
+
+    // hook for manipulating the form data before it is extracted;
+    // convenient for use with rich editors like tinyMCE or FCKEditor
+    var veto = {};
+    $.event.trigger('form.pre.serialize', [this, options, veto]);
+    if (veto.veto) return this;
+
+    var a = this.formToArray(options.semantic);
+	if (options.data) {
+	    for (var n in options.data)
+	        a.push( { name: n, value: options.data[n] } );
+	}
+
+    // give pre-submit callback an opportunity to abort the submit
+    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this;
+
+    // fire vetoable 'validate' event
+    $.event.trigger('form.submit.validate', [a, this, options, veto]);
+    if (veto.veto) return this;
+
+    var q = $.param(a);//.replace(/%20/g,'+');
+
+    if (options.type.toUpperCase() == 'GET') {
+        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
+        options.data = null;  // data is null for 'get'
+    }
+    else
+        options.data = q; // data is the query string for 'post'
+
+    var $form = this, callbacks = [];
+    if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
+    if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
+
+    // perform a load on the target only if dataType is not provided
+    if (!options.dataType && options.target) {
+        var oldSuccess = options.success || function(){};
+        callbacks.push(function(data) {
+            if (this.evalScripts)
+                $(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments);
+            else // jQuery v1.1.4
+                $(options.target).html(data).each(oldSuccess, arguments);
+        });
+    }
+    else if (options.success)
+        callbacks.push(options.success);
+
+    options.success = function(data, status) {
+        for (var i=0, max=callbacks.length; i < max; i++)
+            callbacks[i](data, status, $form);
+    };
+
+    // are there files to upload?
+    var files = $('input:file', this).fieldValue();
+    var found = false;
+    for (var j=0; j < files.length; j++)
+        if (files[j])
+            found = true;
+
+    if (options.iframe || found) // options.iframe allows user to force iframe mode
+        fileUpload();
+    else
+        $.ajax(options);
+
+    // fire 'notify' event
+    $.event.trigger('form.submit.notify', [this, options]);
+    return this;
+
+
+    // private function for handling file uploads (hat tip to YAHOO!)
+    function fileUpload() {
+        var form = $form[0];
+        var opts = $.extend({}, $.ajaxSettings, options);
+
+        var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++;
+        var $io = $('<iframe id="' + id + '" name="' + id + '" />');
+        var io = $io[0];
+        var op8 = $.browser.opera && window.opera.version() < 9;
+        if ($.browser.msie || op8) io.src = 'javascript:false;document.write("");';
+        $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
+
+        var xhr = { // mock object
+            responseText: null,
+            responseXML: null,
+            status: 0,
+            statusText: 'n/a',
+            getAllResponseHeaders: function() {},
+            getResponseHeader: function() {},
+            setRequestHeader: function() {}
+        };
+
+        var g = opts.global;
+        // trigger ajax global events so that activity/block indicators work like normal
+        if (g && ! $.active++) $.event.trigger("ajaxStart");
+        if (g) $.event.trigger("ajaxSend", [xhr, opts]);
+
+        var cbInvoked = 0;
+        var timedOut = 0;
+
+        // take a breath so that pending repaints get some cpu time before the upload starts
+        setTimeout(function() {
+            $io.appendTo('body');
+            // jQuery's event binding doesn't work for iframe events in IE
+            io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
+
+            // make sure form attrs are set
+            var encAttr = form.encoding ? 'encoding' : 'enctype';
+            var t = $form.attr('target');
+            $form.attr({
+                target:   id,
+                method:  'POST',
+                action:   'review/'+opts.url
+            });
+            form[encAttr] = 'multipart/form-data';
+
+            // support timout
+            if (opts.timeout)
+                setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
+
+            form.submit();
+            $form.attr('target', t); // reset target
+        }, 10);
+
+        function cb() {
+            if (cbInvoked++) return;
+
+            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
+
+            var ok = true;
+            try {
+                if (timedOut) throw 'timeout';
+                // extract the server response from the iframe
+                var data, doc;
+                doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
+                xhr.responseText = doc.body ? doc.body.innerHTML : null;
+                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
+
+                if (opts.dataType == 'json' || opts.dataType == 'script') {
+                    var ta = doc.getElementsByTagName('textarea')[0];
+                    data = ta ? ta.value : xhr.responseText;
+                    if (opts.dataType == 'json')
+                        eval("data = " + data);
+                    else
+                        $.globalEval(data);
+                }
+                else if (opts.dataType == 'xml') {
+                    data = xhr.responseXML;
+                    if (!data && xhr.responseText != null)
+                        data = toXml(xhr.responseText);
+                }
+                else {
+                    data = xhr.responseText;
+                }
+            }
+            catch(e){
+                ok = false;
+                $.handleError(opts, xhr, 'error', e);
+            }
+
+            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
+            if (ok) {
+                opts.success(data, 'success');
+                if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
+            }
+            if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
+            if (g && ! --$.active) $.event.trigger("ajaxStop");
+            if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
+
+            // clean up
+            setTimeout(function() {
+                $io.remove();
+                xhr.responseXML = null;
+            }, 100);
+        };
+
+        function toXml(s, doc) {
+            if (window.ActiveXObject) {
+                doc = new ActiveXObject('Microsoft.XMLDOM');
+                doc.async = 'false';
+                doc.loadXML(s);
+            }
+            else
+                doc = (new DOMParser()).parseFromString(s, 'text/xml');
+            return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
+        };
+    };
+};
+$.fn.ajaxSubmit.counter = 0; // used to create unique iframe ids
+
+/**
+ * ajaxForm() provides a mechanism for fully automating form submission.
+ *
+ * The advantages of using this method instead of ajaxSubmit() are:
+ *
+ * 1: This method will include coordinates for <input type="image" /> elements (if the element
+ *    is used to submit the form).
+ * 2. This method will include the submit element's name/value data (for the element that was
+ *    used to submit the form).
+ * 3. This method binds the submit() method to the form for you.
+ *
+ * Note that for accurate x/y coordinates of image submit elements in all browsers
+ * you need to also use the "dimensions" plugin (this method will auto-detect its presence).
+ *
+ * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
+ * passes the options argument along after properly binding events for submit elements and
+ * the form itself.  See ajaxSubmit for a full description of the options argument.
+ *
+ *
+ * @example
+ * var options = {
+ *     target: '#myTargetDiv'
+ * };
+ * $('#myForm').ajaxSForm(options);
+ * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response
+ *       when the form is submitted.
+ *
+ *
+ * @example
+ * var options = {
+ *     success: function(responseText) {
+ *         alert(responseText);
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Bind form's submit event so that server response is alerted after the form is submitted.
+ *
+ *
+ * @example
+ * var options = {
+ *     beforeSubmit: function(formArray, jqForm) {
+ *         if (formArray.length == 0) {
+ *             alert('Please enter data.');
+ *             return false;
+ *         }
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Bind form's submit event so that pre-submit callback is invoked before the form
+ *       is submitted.
+ *
+ *
+ * @name   ajaxForm
+ * @param  options  object literal containing options which control the form submission process
+ * @return jQuery
+ * @cat    Plugins/Form
+ * @type   jQuery
+ */
+$.fn.ajaxForm = function(options) {
+    return this.ajaxFormUnbind().submit(submitHandler).each(function() {
+        // store options in hash
+        this.formPluginId = $.fn.ajaxForm.counter++;
+        $.fn.ajaxForm.optionHash[this.formPluginId] = options;
+        $(":submit,input:image", this).click(clickHandler);
+    });
+};
+
+$.fn.ajaxForm.counter = 1;
+$.fn.ajaxForm.optionHash = {};
+
+function clickHandler(e) {
+    var $form = this.form;
+    $form.clk = this;
+    if (this.type == 'image') {
+        if (e.offsetX != undefined) {
+            $form.clk_x = e.offsetX;
+            $form.clk_y = e.offsetY;
+        } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
+            var offset = $(this).offset();
+            $form.clk_x = e.pageX - offset.left;
+            $form.clk_y = e.pageY - offset.top;
+        } else {
+            $form.clk_x = e.pageX - this.offsetLeft;
+            $form.clk_y = e.pageY - this.offsetTop;
+        }
+    }
+    // clear form vars
+    setTimeout(function() { $form.clk = $form.clk_x = $form.clk_y = null; }, 10);
+};
+
+function submitHandler() {
+    // retrieve options from hash
+    var id = this.formPluginId;
+    var options = $.fn.ajaxForm.optionHash[id];
+    $(this).ajaxSubmit(options);
+    return false;
+};
+
+/**
+ * ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
+ *
+ * @name   ajaxFormUnbind
+ * @return jQuery
+ * @cat    Plugins/Form
+ * @type   jQuery
+ */
+$.fn.ajaxFormUnbind = function() {
+    this.unbind('submit', submitHandler);
+    return this.each(function() {
+        $(":submit,input:image", this).unbind('click', clickHandler);
+    });
+
+};
+
+/**
+ * formToArray() gathers form element data into an array of objects that can
+ * be passed to any of the following ajax functions: $.get, $.post, or load.
+ * Each object in the array has both a 'name' and 'value' property.  An example of
+ * an array for a simple login form might be:
+ *
+ * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * It is this array that is passed to pre-submit callback functions provided to the
+ * ajaxSubmit() and ajaxForm() methods.
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * This is normally true anyway, unless the form contains input elements of type='image'.
+ * If your form must be submitted with name/value pairs in semantic order and your form
+ * contains an input of type='image" then pass true for this arg, otherwise pass false
+ * (or nothing) to avoid the overhead for this logic.
+ *
+ * @example var data = $("#myForm").formToArray();
+ * $.post( "myscript.cgi", data );
+ * @desc Collect all the data from a form and submit it to the server.
+ *
+ * @name formToArray
+ * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
+ * @type Array<Object>
+ * @cat Plugins/Form
+ */
+$.fn.formToArray = function(semantic) {
+    var a = [];
+    if (this.length == 0) return a;
+
+    var form = this[0];
+    var els = semantic ? form.getElementsByTagName('*') : form.elements;
+    if (!els) return a;
+    for(var i=0, max=els.length; i < max; i++) {
+        var el = els[i];
+        var n = el.name;
+        if (!n) continue;
+
+        if (semantic && form.clk && el.type == "image") {
+            // handle image inputs on the fly when semantic == true
+            if(!el.disabled && form.clk == el)
+                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+            continue;
+        }
+
+        var v = $.fieldValue(el, true);
+        if (v && v.constructor == Array) {
+            for(var j=0, jmax=v.length; j < jmax; j++)
+                a.push({name: n, value: v[j]});
+        }
+        else if (v !== null && typeof v != 'undefined')
+            a.push({name: n, value: v});
+    }
+
+    if (!semantic && form.clk) {
+        // input type=='image' are not found in elements array! handle them here
+        var inputs = form.getElementsByTagName("input");
+        for(var i=0, max=inputs.length; i < max; i++) {
+            var input = inputs[i];
+            var n = input.name;
+            if(n && !input.disabled && input.type == "image" && form.clk == input)
+                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+        }
+    }
+    return a;
+};
+
+
+/**
+ * Serializes form data into a 'submittable' string. This method will return a string
+ * in the format: name1=value1&amp;name2=value2
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * If your form must be submitted with name/value pairs in semantic order then pass
+ * true for this arg, otherwise pass false (or nothing) to avoid the overhead for
+ * this logic (which can be significant for very large forms).
+ *
+ * @example var data = $("#myForm").formSerialize();
+ * $.ajax('POST', "myscript.cgi", data);
+ * @desc Collect all the data from a form into a single string
+ *
+ * @name formSerialize
+ * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
+ * @type String
+ * @cat Plugins/Form
+ */
+$.fn.formSerialize = function(semantic) {
+    //hand off to jQuery.param for proper encoding
+    return $.param(this.formToArray(semantic));
+};
+
+
+/**
+ * Serializes all field elements in the jQuery object into a query string.
+ * This method will return a string in the format: name1=value1&amp;name2=value2
+ *
+ * The successful argument controls whether or not serialization is limited to
+ * 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.
+ *
+ * @example var data = $("input").formSerialize();
+ * @desc Collect the data from all successful input elements into a query string
+ *
+ * @example var data = $(":radio").formSerialize();
+ * @desc Collect the data from all successful radio input elements into a query string
+ *
+ * @example var data = $("#myForm :checkbox").formSerialize();
+ * @desc Collect the data from all successful checkbox input elements in myForm into a query string
+ *
+ * @example var data = $("#myForm :checkbox").formSerialize(false);
+ * @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string
+ *
+ * @example var data = $(":input").formSerialize();
+ * @desc Collect the data from all successful input, select, textarea and button elements into a query string
+ *
+ * @name fieldSerialize
+ * @param successful true if only successful controls should be serialized (default is true)
+ * @type String
+ * @cat Plugins/Form
+ */
+$.fn.fieldSerialize = function(successful) {
+    var a = [];
+    this.each(function() {
+        var n = this.name;
+        if (!n) return;
+        var v = $.fieldValue(this, successful);
+        if (v && v.constructor == Array) {
+            for (var i=0,max=v.length; i < max; i++)
+                a.push({name: n, value: v[i]});
+        }
+        else if (v !== null && typeof v != 'undefined')
+            a.push({name: this.name, value: v});
+    });
+    //hand off to jQuery.param for proper encoding
+    return $.param(a);
+};
+
+
+/**
+ * Returns the value(s) of the element in the matched set.  For example, consider the following form:
+ *
+ *  <form><fieldset>
+ *      <input name="A" type="text" />
+ *      <input name="A" type="text" />
+ *      <input name="B" type="checkbox" value="B1" />
+ *      <input name="B" type="checkbox" value="B2"/>
+ *      <input name="C" type="radio" value="C1" />
+ *      <input name="C" type="radio" value="C2" />
+ *  </fieldset></form>
+ *
+ *  var v = $(':text').fieldValue();
+ *  // if no values are entered into the text inputs
+ *  v == ['','']
+ *  // if values entered into the text inputs are 'foo' and 'bar'
+ *  v == ['foo','bar']
+ *
+ *  var v = $(':checkbox').fieldValue();
+ *  // if neither checkbox is checked
+ *  v === undefined
+ *  // if both checkboxes are checked
+ *  v == ['B1', 'B2']
+ *
+ *  var v = $(':radio').fieldValue();
+ *  // if neither radio is checked
+ *  v === undefined
+ *  // if first radio is checked
+ *  v == ['C1']
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.  If this value is false the value(s)
+ * for each element is returned.
+ *
+ * Note: This method *always* returns an array.  If no valid value can be determined the
+ *       array will be empty, otherwise it will contain one or more values.
+ *
+ * @example var data = $("#myPasswordElement").fieldValue();
+ * alert(data[0]);
+ * @desc Alerts the current value of the myPasswordElement element
+ *
+ * @example var data = $("#myForm :input").fieldValue();
+ * @desc Get the value(s) of the form elements in myForm
+ *
+ * @example var data = $("#myForm :checkbox").fieldValue();
+ * @desc Get the value(s) for the successful checkbox element(s) in the jQuery object.
+ *
+ * @example var data = $("#mySingleSelect").fieldValue();
+ * @desc Get the value(s) of the select control
+ *
+ * @example var data = $(':text').fieldValue();
+ * @desc Get the value(s) of the text input or textarea elements
+ *
+ * @example var data = $("#myMultiSelect").fieldValue();
+ * @desc Get the values for the select-multiple control
+ *
+ * @name fieldValue
+ * @param Boolean successful true if only the values for successful controls should be returned (default is true)
+ * @type Array<String>
+ * @cat Plugins/Form
+ */
+$.fn.fieldValue = function(successful) {
+    for (var val=[], i=0, max=this.length; i < max; i++) {
+        var el = this[i];
+        var v = $.fieldValue(el, successful);
+        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
+            continue;
+        v.constructor == Array ? $.merge(val, v) : val.push(v);
+    }
+    return val;
+};
+
+/**
+ * Returns the value of the field element.
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.  If the given element is not
+ * successful and the successful arg is not false then the returned value will be null.
+ *
+ * Note: If the successful flag is true (default) but the element is not successful, the return will be null
+ * Note: The value returned for a successful select-multiple element will always be an array.
+ * Note: If the element has no value the return value will be undefined.
+ *
+ * @example var data = jQuery.fieldValue($("#myPasswordElement")[0]);
+ * @desc Gets the current value of the myPasswordElement element
+ *
+ * @name fieldValue
+ * @param Element el The DOM element for which the value will be returned
+ * @param Boolean successful true if value returned must be for a successful controls (default is true)
+ * @type String or Array<String> or null or undefined
+ * @cat Plugins/Form
+ */
+$.fieldValue = function(el, successful) {
+    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
+    if (typeof successful == 'undefined') successful = true;
+
+    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
+        (t == 'checkbox' || t == 'radio') && !el.checked ||
+        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
+        tag == 'select' && el.selectedIndex == -1))
+            return null;
+
+    if (tag == 'select') {
+        var index = el.selectedIndex;
+        if (index < 0) return null;
+        var a = [], ops = el.options;
+        var one = (t == 'select-one');
+        var max = (one ? index+1 : ops.length);
+        for(var i=(one ? index : 0); i < max; i++) {
+            var op = ops[i];
+            if (op.selected) {
+                // extra pain for IE...
+                var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
+                if (one) return v;
+                a.push(v);
+            }
+        }
+        return a;
+    }
+    return el.value;
+};
+
+
+/**
+ * Clears the form data.  Takes the following actions on the form's input fields:
+ *  - input text fields will have their 'value' property set to the empty string
+ *  - select elements will have their 'selectedIndex' property set to -1
+ *  - checkbox and radio inputs will have their 'checked' property set to false
+ *  - inputs of type submit, button, reset, and hidden will *not* be effected
+ *  - button elements will *not* be effected
+ *
+ * @example $('form').clearForm();
+ * @desc Clears all forms on the page.
+ *
+ * @name clearForm
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.clearForm = function() {
+    return this.each(function() {
+        $('input,select,textarea', this).clearFields();
+    });
+};
+
+/**
+ * Clears the selected form elements.  Takes the following actions on the matched elements:
+ *  - input text fields will have their 'value' property set to the empty string
+ *  - select elements will have their 'selectedIndex' property set to -1
+ *  - checkbox and radio inputs will have their 'checked' property set to false
+ *  - inputs of type submit, button, reset, and hidden will *not* be effected
+ *  - button elements will *not* be effected
+ *
+ * @example $('.myInputs').clearFields();
+ * @desc Clears all inputs with class myInputs
+ *
+ * @name clearFields
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.clearFields = $.fn.clearInputs = function() {
+    return this.each(function() {
+        var t = this.type, tag = this.tagName.toLowerCase();
+        if (t == 'text' || t == 'password' || tag == 'textarea')
+            this.value = '';
+        else if (t == 'checkbox' || t == 'radio')
+            this.checked = false;
+        else if (tag == 'select')
+            this.selectedIndex = -1;
+    });
+};
+
+
+/**
+ * Resets the form data.  Causes all form elements to be reset to their original value.
+ *
+ * @example $('form').resetForm();
+ * @desc Resets all forms on the page.
+ *
+ * @name resetForm
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.resetForm = function() {
+    return this.each(function() {
+        // guard against an input with the name of 'reset'
+        // note that IE reports the reset function as an 'object'
+        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
+            this.reset();
+    });
+};
+
+})(jQuery);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/support/hsbook.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,95 @@
+function qid(id) {
+  return id.replace(/([.:])/g, "\\$1");
+}
+
+function beforeComment(formData, jqForm, options) {
+  var form = jqForm[0];
+  if (!form.comment.value) {
+    $(options.target + " span.comment_error").empty().append(
+      "<span class=\"comment_error\">Your comment is empty</span>");
+    return false;
+  }
+  if (!form.name.value) {
+    $(options.target + " span.comment_error").empty().append(
+      "<span class=\"comment_error\">Please provide a name</span>");
+    return false;
+  }
+  $(options.target + " span.comment_error").empty().after(
+    "<img src=\"/support/icons/throbber.gif\" style=\"vertical-align: middle\"/>");
+  $(options.target + " input[@name=submit]").attr("disabled", true);
+}
+
+function ajaxifyForm(id) {
+  var q = qid(id);
+  
+  $("#form_" + q).ajaxForm({ beforeSubmit: beforeComment,
+			     success: function() { ajaxifyForm(id); },
+			     target: "#comments_" + q });
+}
+
+function toggleComment(id) {
+  $("#toggle_" + qid(id)).nextAll().toggle();
+  return false;
+}
+
+function loadComments(id) {
+  $("#comments_" + qid(id)).load(location.protocol + "//" + location.host +
+				 "/review/comments/single/" + id + "/", function() {
+    ajaxifyForm(id);
+  });
+  return false;
+}
+
+function loadAllComments() {
+  $("a.commenttoggle").each(function() {
+    var id = $(this).attr("pid");
+    if (id) {
+      loadComments(id);
+    }
+  });
+}
+
+$(document).ready(function() {
+  function loading(id) {
+    return " <span id=\"comments_" + id + "\" class=\"comment\">" +
+      "<span pid=\"" + id + "\" class=\"commenttoggle\">Loading..." +
+      "</span></span>";
+  }
+  $("div.toc>p")
+    .after("<p style='display: none;'><a onclick='return loadAllComments()'>" +
+	   "Load all comments (<b>slow</b>)</a></p>")
+    .toggle(function() { $(this).nextAll().show("normal"); },
+	    function() { $(this).nextAll().hide("normal"); })
+    .hover(function() { $(this).fadeTo("normal", 0.8); },
+	   function() { $(this).fadeTo("normal", 0.35); });
+  $(".chapter p[@id]").each(function() {
+    $(this).append(loading($(this).attr("id")));
+  });
+  $(".chapter table[@id].equation").each(function() {
+    id = $(this).attr("id");
+    $("#" + id + " tr").after('<tr><td colspan="4">' + loading($(this).attr("id")) + '</td></tr>');
+  });
+  $(".chapter pre[@id]").each(function() {
+    $(this).after(loading($(this).attr("id")));
+  });
+  var chapid = $("div.preface, div.chapter, div.appendix, div.bibliography").attr("id");
+  $("#chapterfeed").attr("href",
+			 $("#chapterfeed").attr("href") + chapid + "/");
+  $.getJSON(location.protocol + "//" + location.host + "/review/comments/chapter/" +
+	    chapid + "/count/", function(data) {
+    $.each(data, function(id, item) {
+      var s = item == 1 ? "" : "s";
+      $("#comments_" + qid(id) + " span.commenttoggle").replaceWith(
+        "<a class='commenttoggle' id='toggle_" + id + "' " +
+	"pid='" + id + "' " +
+	"onclick='return loadComments(\"" + id + "\")' " +
+	"href='comments: show / hide'>" + item + " comment" + s + "</a>");
+    });
+    $("span.commenttoggle").each(function() {
+      var id = $(this).attr("pid");
+      $(this).replaceWith("<a class='commenttoggle' id='toggle_" + id + "' " +
+			  "onclick='return loadComments(\"" + id + "\")' " +
+			  "href='comment: add'>No comments</a>");
+    });
+  });
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/support/hsbook.js~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,95 @@
+function qid(id) {
+  return id.replace(/([.:])/g, "\\$1");
+}
+
+function beforeComment(formData, jqForm, options) {
+  var form = jqForm[0];
+  if (!form.comment.value) {
+    $(options.target + " span.comment_error").empty().append(
+      "<span class=\"comment_error\">Your comment is empty</span>");
+    return false;
+  }
+  if (!form.name.value) {
+    $(options.target + " span.comment_error").empty().append(
+      "<span class=\"comment_error\">Please provide a name</span>");
+    return false;
+  }
+  $(options.target + " span.comment_error").empty().after(
+    "<img src=\"/support/icons/throbber.gif\" style=\"vertical-align: middle\"/>");
+  $(options.target + " input[@name=submit]").attr("disabled", true);
+}
+
+function ajaxifyForm(id) {
+  var q = qid(id);
+  
+  $("#form_" + q).ajaxForm({ beforeSubmit: beforeComment,
+			     success: function() { ajaxifyForm(id); },
+			     target: "#comments_" + q });
+}
+
+function toggleComment(id) {
+  $("#toggle_" + qid(id)).nextAll().toggle();
+  return false;
+}
+
+function loadComments(id) {
+  $("#comments_" + qid(id)).load(location.protocol + "//" + location.host +
+				 "/comments/single/" + id + "/", function() {
+    ajaxifyForm(id);
+  });
+  return false;
+}
+
+function loadAllComments() {
+  $("a.commenttoggle").each(function() {
+    var id = $(this).attr("pid");
+    if (id) {
+      loadComments(id);
+    }
+  });
+}
+
+$(document).ready(function() {
+  function loading(id) {
+    return " <span id=\"comments_" + id + "\" class=\"comment\">" +
+      "<span pid=\"" + id + "\" class=\"commenttoggle\">Loading..." +
+      "</span></span>";
+  }
+  $("div.toc>p")
+    .after("<p style='display: none;'><a onclick='return loadAllComments()'>" +
+	   "Load all comments (<b>slow</b>)</a></p>")
+    .toggle(function() { $(this).nextAll().show("normal"); },
+	    function() { $(this).nextAll().hide("normal"); })
+    .hover(function() { $(this).fadeTo("normal", 0.8); },
+	   function() { $(this).fadeTo("normal", 0.35); });
+  $(".chapter p[@id]").each(function() {
+    $(this).append(loading($(this).attr("id")));
+  });
+  $(".chapter table[@id].equation").each(function() {
+    id = $(this).attr("id");
+    $("#" + id + " tr").after('<tr><td colspan="4">' + loading($(this).attr("id")) + '</td></tr>');
+  });
+  $(".chapter pre[@id]").each(function() {
+    $(this).after(loading($(this).attr("id")));
+  });
+  var chapid = $("div.preface, div.chapter, div.appendix, div.bibliography").attr("id");
+  $("#chapterfeed").attr("href",
+			 $("#chapterfeed").attr("href") + chapid + "/");
+  $.getJSON(location.protocol + "//" + location.host + "/comments/chapter/" +
+	    chapid + "/count/", function(data) {
+    $.each(data, function(id, item) {
+      var s = item == 1 ? "" : "s";
+      $("#comments_" + qid(id) + " span.commenttoggle").replaceWith(
+        "<a class='commenttoggle' id='toggle_" + id + "' " +
+	"pid='" + id + "' " +
+	"onclick='return loadComments(\"" + id + "\")' " +
+	"href='comments: show / hide'>" + item + " comment" + s + "</a>");
+    });
+    $("span.commenttoggle").each(function() {
+      var id = $(this).attr("pid");
+      $(this).replaceWith("<a class='commenttoggle' id='toggle_" + id + "' " +
+			  "onclick='return loadComments(\"" + id + "\")' " +
+			  "href='comment: add'>No comments</a>");
+    });
+  });
+});
Binary file SEESenv/web/support/icons/caution.png has changed
Binary file SEESenv/web/support/icons/favicon.png has changed
Binary file SEESenv/web/support/icons/important.png has changed
Binary file SEESenv/web/support/icons/note.png has changed
Binary file SEESenv/web/support/icons/remark.png has changed
Binary file SEESenv/web/support/icons/rss.png has changed
Binary file SEESenv/web/support/icons/shell.png has changed
Binary file SEESenv/web/support/icons/source.png has changed
Binary file SEESenv/web/support/icons/throbber.gif has changed
Binary file SEESenv/web/support/icons/tip.png has changed
Binary file SEESenv/web/support/icons/warning.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/support/javascript/form-min.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,1 @@
+(function($){$.fn.ajaxSubmit=function(_2){if(typeof _2=="function"){_2={success:_2};}_2=$.extend({url:this.attr("action")||window.location,type:this.attr("method")||"GET"},_2||{});var _3={};$.event.trigger("form.pre.serialize",[this,_2,_3]);if(_3.veto){return this;}var a=this.formToArray(_2.semantic);if(_2.data){for(var n in _2.data){a.push({name:n,value:_2.data[n]});}}if(_2.beforeSubmit&&_2.beforeSubmit(a,this,_2)===false){return this;}$.event.trigger("form.submit.validate",[a,this,_2,_3]);if(_3.veto){return this;}var q=$.param(a);if(_2.type.toUpperCase()=="GET"){_2.url+=(_2.url.indexOf("?")>=0?"&":"?")+q;_2.data=null;}else{_2.data=q;}var _7=this,callbacks=[];if(_2.resetForm){callbacks.push(function(){_7.resetForm();});}if(_2.clearForm){callbacks.push(function(){_7.clearForm();});}if(!_2.dataType&&_2.target){var _8=_2.success||function(){};callbacks.push(function(_9){if(this.evalScripts){$(_2.target).attr("innerHTML",_9).evalScripts().each(_8,arguments);}else{$(_2.target).html(_9).each(_8,arguments);}});}else{if(_2.success){callbacks.push(_2.success);}}_2.success=function(_a,_b){for(var i=0,max=callbacks.length;i<max;i++){callbacks[i](_a,_b,_7);}};var _d=$("input:file",this).fieldValue();var _e=false;for(var j=0;j<_d.length;j++){if(_d[j]){_e=true;}}if(_2.iframe||_e){fileUpload();}else{$.ajax(_2);}$.event.trigger("form.submit.notify",[this,_2]);return this;function fileUpload(){var _10=_7[0];var _11=$.extend({},$.ajaxSettings,_2);var id="jqFormIO"+$.fn.ajaxSubmit.counter++;var $io=$("<iframe id=\""+id+"\" name=\""+id+"\" />");var io=$io[0];var op8=$.browser.opera&&window.opera.version()<9;if($.browser.msie||op8){io.src="javascript:false;document.write(\"\");";}$io.css({position:"absolute",top:"-1000px",left:"-1000px"});var xhr={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=_11.global;if(g&&!$.active++){$.event.trigger("ajaxStart");}if(g){$.event.trigger("ajaxSend",[xhr,_11]);}var _18=0;var _19=0;setTimeout(function(){$io.appendTo("body");io.attachEvent?io.attachEvent("onload",cb):io.addEventListener("load",cb,false);var _1a=_10.encoding?"encoding":"enctype";var t=_7.attr("target");_7.attr({target:id,method:"POST",action:_11.url});_10[_1a]="multipart/form-data";if(_11.timeout){setTimeout(function(){_19=true;cb();},_11.timeout);}_10.submit();_7.attr("target",t);},10);function cb(){if(_18++){return;}io.detachEvent?io.detachEvent("onload",cb):io.removeEventListener("load",cb,false);var ok=true;try{if(_19){throw "timeout";}var _1d,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(_11.dataType=="json"||_11.dataType=="script"){var ta=doc.getElementsByTagName("textarea")[0];_1d=ta?ta.value:xhr.responseText;if(_11.dataType=="json"){eval("data = "+_1d);}else{$.globalEval(_1d);}}else{if(_11.dataType=="xml"){_1d=xhr.responseXML;if(!_1d&&xhr.responseText!=null){_1d=toXml(xhr.responseText);}}else{_1d=xhr.responseText;}}}catch(e){ok=false;$.handleError(_11,xhr,"error",e);}if(ok){_11.success(_1d,"success");if(g){$.event.trigger("ajaxSuccess",[xhr,_11]);}}if(g){$.event.trigger("ajaxComplete",[xhr,_11]);}if(g&&!--$.active){$.event.trigger("ajaxStop");}if(_11.complete){_11.complete(xhr,ok?"success":"error");}setTimeout(function(){$io.remove();xhr.responseXML=null;},100);}function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s);}else{doc=(new DOMParser()).parseFromString(s,"text/xml");}return (doc&&doc.documentElement&&doc.documentElement.tagName!="parsererror")?doc:null;}}};$.fn.ajaxSubmit.counter=0;$.fn.ajaxForm=function(_21){return this.ajaxFormUnbind().submit(submitHandler).each(function(){this.formPluginId=$.fn.ajaxForm.counter++;$.fn.ajaxForm.optionHash[this.formPluginId]=_21;$(":submit,input:image",this).click(clickHandler);});};$.fn.ajaxForm.counter=1;$.fn.ajaxForm.optionHash={};function clickHandler(e){var _23=this.form;_23.clk=this;if(this.type=="image"){if(e.offsetX!=undefined){_23.clk_x=e.offsetX;_23.clk_y=e.offsetY;}else{if(typeof $.fn.offset=="function"){var _24=$(this).offset();_23.clk_x=e.pageX-_24.left;_23.clk_y=e.pageY-_24.top;}else{_23.clk_x=e.pageX-this.offsetLeft;_23.clk_y=e.pageY-this.offsetTop;}}}setTimeout(function(){_23.clk=_23.clk_x=_23.clk_y=null;},10);}function submitHandler(){var id=this.formPluginId;var _26=$.fn.ajaxForm.optionHash[id];$(this).ajaxSubmit(_26);return false;}$.fn.ajaxFormUnbind=function(){this.unbind("submit",submitHandler);return this.each(function(){$(":submit,input:image",this).unbind("click",clickHandler);});};$.fn.formToArray=function(_27){var a=[];if(this.length==0){return a;}var _29=this[0];var els=_27?_29.getElementsByTagName("*"):_29.elements;if(!els){return a;}for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n){continue;}if(_27&&_29.clk&&el.type=="image"){if(!el.disabled&&_29.clk==el){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}continue;}var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:n,value:v});}}}if(!_27&&_29.clk){var _30=_29.getElementsByTagName("input");for(var i=0,max=_30.length;i<max;i++){var _32=_30[i];var n=_32.name;if(n&&!_32.disabled&&_32.type=="image"&&_29.clk==_32){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}}}return a;};$.fn.formSerialize=function(_34){return $.param(this.formToArray(_34));};$.fn.fieldSerialize=function(_35){var a=[];this.each(function(){var n=this.name;if(!n){return;}var v=$.fieldValue(this,_35);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:this.name,value:v});}}});return $.param(a);};$.fn.fieldValue=function(_3a){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,_3a);if(v===null||typeof v=="undefined"||(v.constructor==Array&&!v.length)){continue;}v.constructor==Array?$.merge(val,v):val.push(v);}return val;};$.fieldValue=function(el,_3f){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof _3f=="undefined"){_3f=true;}if(_3f&&(!n||el.disabled||t=="reset"||t=="button"||(t=="checkbox"||t=="radio")&&!el.checked||(t=="submit"||t=="image")&&el.form&&el.form.clk!=el||tag=="select"&&el.selectedIndex==-1)){return null;}if(tag=="select"){var _41=el.selectedIndex;if(_41<0){return null;}var a=[],ops=el.options;var one=(t=="select-one");var max=(one?_41+1:ops.length);for(var i=(one?_41:0);i<max;i++){var op=ops[i];if(op.selected){var v=$.browser.msie&&!(op.attributes["value"].specified)?op.text:op.value;if(one){return v;}a.push(v);}}return a;}return el.value;};$.fn.clearForm=function(){return this.each(function(){$("input,select,textarea",this).clearFields();});};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=="text"||t=="password"||tag=="textarea"){this.value="";}else{if(t=="checkbox"||t=="radio"){this.checked=false;}else{if(tag=="select"){this.selectedIndex=-1;}}}});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset();}});};})(jQuery);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/support/javascript/form.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,819 @@
+/*
+ * jQuery Form Plugin
+ * @requires jQuery v1.1 or later
+ *
+ * Examples at: http://malsup.com/jquery/form/
+ * Dual licensed under the MIT and GPL licenses:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ *
+ * Revision: $Id$
+ */
+ (function($) {
+/**
+ * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.
+ *
+ * ajaxSubmit accepts a single argument which can be either a success callback function
+ * or an options Object.  If a function is provided it will be invoked upon successful
+ * completion of the submit and will be passed the response from the server.
+ * If an options Object is provided, the following attributes are supported:
+ *
+ *  target:   Identifies the element(s) in the page to be updated with the server response.
+ *            This value may be specified as a jQuery selection string, a jQuery object,
+ *            or a DOM element.
+ *            default value: null
+ *
+ *  url:      URL to which the form data will be submitted.
+ *            default value: value of form's 'action' attribute
+ *
+ *  type:     The method in which the form data should be submitted, 'GET' or 'POST'.
+ *            default value: value of form's 'method' attribute (or 'GET' if none found)
+ *
+ *  data:     Additional data to add to the request, specified as key/value pairs (see $.ajax).
+ *
+ *  beforeSubmit:  Callback method to be invoked before the form is submitted.
+ *            default value: null
+ *
+ *  success:  Callback method to be invoked after the form has been successfully submitted
+ *            and the response has been returned from the server
+ *            default value: null
+ *
+ *  dataType: Expected dataType of the response.  One of: null, 'xml', 'script', or 'json'
+ *            default value: null
+ *
+ *  semantic: Boolean flag indicating whether data must be submitted in semantic order (slower).
+ *            default value: false
+ *
+ *  resetForm: Boolean flag indicating whether the form should be reset if the submit is successful
+ *
+ *  clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful
+ *
+ *
+ * The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for
+ * validating the form data.  If the 'beforeSubmit' callback returns false then the form will
+ * not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data
+ * in array format, the jQuery object, and the options object passed into ajaxSubmit.
+ * The form data array takes the following form:
+ *
+ *     [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * If a 'success' callback method is provided it is invoked after the response has been returned
+ * from the server.  It is passed the responseText or responseXML value (depending on dataType).
+ * See jQuery.ajax for further details.
+ *
+ *
+ * The dataType option provides a means for specifying how the server response should be handled.
+ * This maps directly to the jQuery.httpData method.  The following values are supported:
+ *
+ *      'xml':    if dataType == 'xml' the server response is treated as XML and the 'success'
+ *                   callback method, if specified, will be passed the responseXML value
+ *      'json':   if dataType == 'json' the server response will be evaluted and passed to
+ *                   the 'success' callback, if specified
+ *      'script': if dataType == 'script' the server response is evaluated in the global context
+ *
+ *
+ * Note that it does not make sense to use both the 'target' and 'dataType' options.  If both
+ * are provided the target will be ignored.
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * This is normally true anyway, unless the form contains input elements of type='image'.
+ * If your form must be submitted with name/value pairs in semantic order and your form
+ * contains an input of type='image" then pass true for this arg, otherwise pass false
+ * (or nothing) to avoid the overhead for this logic.
+ *
+ *
+ * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this:
+ *
+ * $("#form-id").submit(function() {
+ *     $(this).ajaxSubmit(options);
+ *     return false; // cancel conventional submit
+ * });
+ *
+ * When using ajaxForm(), however, this is done for you.
+ *
+ * @example
+ * $('#myForm').ajaxSubmit(function(data) {
+ *     alert('Form submit succeeded! Server returned: ' + data);
+ * });
+ * @desc Submit form and alert server response
+ *
+ *
+ * @example
+ * var options = {
+ *     target: '#myTargetDiv'
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Submit form and update page element with server response
+ *
+ *
+ * @example
+ * var options = {
+ *     success: function(responseText) {
+ *         alert(responseText);
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Submit form and alert the server response
+ *
+ *
+ * @example
+ * var options = {
+ *     beforeSubmit: function(formArray, jqForm) {
+ *         if (formArray.length == 0) {
+ *             alert('Please enter data.');
+ *             return false;
+ *         }
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Pre-submit validation which aborts the submit operation if form data is empty
+ *
+ *
+ * @example
+ * var options = {
+ *     url: myJsonUrl.php,
+ *     dataType: 'json',
+ *     success: function(data) {
+ *        // 'data' is an object representing the the evaluated json data
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc json data returned and evaluated
+ *
+ *
+ * @example
+ * var options = {
+ *     url: myXmlUrl.php,
+ *     dataType: 'xml',
+ *     success: function(responseXML) {
+ *        // responseXML is XML document object
+ *        var data = $('myElement', responseXML).text();
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc XML data returned from server
+ *
+ *
+ * @example
+ * var options = {
+ *     resetForm: true
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc submit form and reset it if successful
+ *
+ * @example
+ * $('#myForm).submit(function() {
+ *    $(this).ajaxSubmit();
+ *    return false;
+ * });
+ * @desc Bind form's submit event to use ajaxSubmit
+ *
+ *
+ * @name ajaxSubmit
+ * @type jQuery
+ * @param options  object literal containing options which control the form submission process
+ * @cat Plugins/Form
+ * @return jQuery
+ */
+$.fn.ajaxSubmit = function(options) {
+    if (typeof options == 'function')
+        options = { success: options };
+
+    options = $.extend({
+        url:  this.attr('action') || window.location,
+        type: this.attr('method') || 'GET'
+    }, options || {});
+
+    // hook for manipulating the form data before it is extracted;
+    // convenient for use with rich editors like tinyMCE or FCKEditor
+    var veto = {};
+    $.event.trigger('form.pre.serialize', [this, options, veto]);
+    if (veto.veto) return this;
+
+    var a = this.formToArray(options.semantic);
+	if (options.data) {
+	    for (var n in options.data)
+	        a.push( { name: n, value: options.data[n] } );
+	}
+
+    // give pre-submit callback an opportunity to abort the submit
+    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this;
+
+    // fire vetoable 'validate' event
+    $.event.trigger('form.submit.validate', [a, this, options, veto]);
+    if (veto.veto) return this;
+
+    var q = $.param(a);//.replace(/%20/g,'+');
+
+    if (options.type.toUpperCase() == 'GET') {
+        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
+        options.data = null;  // data is null for 'get'
+    }
+    else
+        options.data = q; // data is the query string for 'post'
+
+    var $form = this, callbacks = [];
+    if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
+    if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
+
+    // perform a load on the target only if dataType is not provided
+    if (!options.dataType && options.target) {
+        var oldSuccess = options.success || function(){};
+        callbacks.push(function(data) {
+            if (this.evalScripts)
+                $(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments);
+            else // jQuery v1.1.4
+                $(options.target).html(data).each(oldSuccess, arguments);
+        });
+    }
+    else if (options.success)
+        callbacks.push(options.success);
+
+    options.success = function(data, status) {
+        for (var i=0, max=callbacks.length; i < max; i++)
+            callbacks[i](data, status, $form);
+    };
+
+    // are there files to upload?
+    var files = $('input:file', this).fieldValue();
+    var found = false;
+    for (var j=0; j < files.length; j++)
+        if (files[j])
+            found = true;
+
+    if (options.iframe || found) // options.iframe allows user to force iframe mode
+        fileUpload();
+    else
+        $.ajax(options);
+
+    // fire 'notify' event
+    $.event.trigger('form.submit.notify', [this, options]);
+    return this;
+
+
+    // private function for handling file uploads (hat tip to YAHOO!)
+    function fileUpload() {
+        var form = $form[0];
+        var opts = $.extend({}, $.ajaxSettings, options);
+
+        var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++;
+        var $io = $('<iframe id="' + id + '" name="' + id + '" />');
+        var io = $io[0];
+        var op8 = $.browser.opera && window.opera.version() < 9;
+        if ($.browser.msie || op8) io.src = 'javascript:false;document.write("");';
+        $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
+
+        var xhr = { // mock object
+            responseText: null,
+            responseXML: null,
+            status: 0,
+            statusText: 'n/a',
+            getAllResponseHeaders: function() {},
+            getResponseHeader: function() {},
+            setRequestHeader: function() {}
+        };
+
+        var g = opts.global;
+        // trigger ajax global events so that activity/block indicators work like normal
+        if (g && ! $.active++) $.event.trigger("ajaxStart");
+        if (g) $.event.trigger("ajaxSend", [xhr, opts]);
+
+        var cbInvoked = 0;
+        var timedOut = 0;
+
+        // take a breath so that pending repaints get some cpu time before the upload starts
+        setTimeout(function() {
+            $io.appendTo('body');
+            // jQuery's event binding doesn't work for iframe events in IE
+            io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
+
+            // make sure form attrs are set
+            var encAttr = form.encoding ? 'encoding' : 'enctype';
+            var t = $form.attr('target');
+            $form.attr({
+                target:   id,
+                method:  'POST',
+                action:   opts.url
+            });
+            form[encAttr] = 'multipart/form-data';
+
+            // support timout
+            if (opts.timeout)
+                setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
+
+            form.submit();
+            $form.attr('target', t); // reset target
+        }, 10);
+
+        function cb() {
+            if (cbInvoked++) return;
+
+            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
+
+            var ok = true;
+            try {
+                if (timedOut) throw 'timeout';
+                // extract the server response from the iframe
+                var data, doc;
+                doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
+                xhr.responseText = doc.body ? doc.body.innerHTML : null;
+                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
+
+                if (opts.dataType == 'json' || opts.dataType == 'script') {
+                    var ta = doc.getElementsByTagName('textarea')[0];
+                    data = ta ? ta.value : xhr.responseText;
+                    if (opts.dataType == 'json')
+                        eval("data = " + data);
+                    else
+                        $.globalEval(data);
+                }
+                else if (opts.dataType == 'xml') {
+                    data = xhr.responseXML;
+                    if (!data && xhr.responseText != null)
+                        data = toXml(xhr.responseText);
+                }
+                else {
+                    data = xhr.responseText;
+                }
+            }
+            catch(e){
+                ok = false;
+                $.handleError(opts, xhr, 'error', e);
+            }
+
+            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
+            if (ok) {
+                opts.success(data, 'success');
+                if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
+            }
+            if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
+            if (g && ! --$.active) $.event.trigger("ajaxStop");
+            if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
+
+            // clean up
+            setTimeout(function() {
+                $io.remove();
+                xhr.responseXML = null;
+            }, 100);
+        };
+
+        function toXml(s, doc) {
+            if (window.ActiveXObject) {
+                doc = new ActiveXObject('Microsoft.XMLDOM');
+                doc.async = 'false';
+                doc.loadXML(s);
+            }
+            else
+                doc = (new DOMParser()).parseFromString(s, 'text/xml');
+            return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
+        };
+    };
+};
+$.fn.ajaxSubmit.counter = 0; // used to create unique iframe ids
+
+/**
+ * ajaxForm() provides a mechanism for fully automating form submission.
+ *
+ * The advantages of using this method instead of ajaxSubmit() are:
+ *
+ * 1: This method will include coordinates for <input type="image" /> elements (if the element
+ *    is used to submit the form).
+ * 2. This method will include the submit element's name/value data (for the element that was
+ *    used to submit the form).
+ * 3. This method binds the submit() method to the form for you.
+ *
+ * Note that for accurate x/y coordinates of image submit elements in all browsers
+ * you need to also use the "dimensions" plugin (this method will auto-detect its presence).
+ *
+ * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
+ * passes the options argument along after properly binding events for submit elements and
+ * the form itself.  See ajaxSubmit for a full description of the options argument.
+ *
+ *
+ * @example
+ * var options = {
+ *     target: '#myTargetDiv'
+ * };
+ * $('#myForm').ajaxSForm(options);
+ * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response
+ *       when the form is submitted.
+ *
+ *
+ * @example
+ * var options = {
+ *     success: function(responseText) {
+ *         alert(responseText);
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Bind form's submit event so that server response is alerted after the form is submitted.
+ *
+ *
+ * @example
+ * var options = {
+ *     beforeSubmit: function(formArray, jqForm) {
+ *         if (formArray.length == 0) {
+ *             alert('Please enter data.');
+ *             return false;
+ *         }
+ *     }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Bind form's submit event so that pre-submit callback is invoked before the form
+ *       is submitted.
+ *
+ *
+ * @name   ajaxForm
+ * @param  options  object literal containing options which control the form submission process
+ * @return jQuery
+ * @cat    Plugins/Form
+ * @type   jQuery
+ */
+$.fn.ajaxForm = function(options) {
+    return this.ajaxFormUnbind().submit(submitHandler).each(function() {
+        // store options in hash
+        this.formPluginId = $.fn.ajaxForm.counter++;
+        $.fn.ajaxForm.optionHash[this.formPluginId] = options;
+        $(":submit,input:image", this).click(clickHandler);
+    });
+};
+
+$.fn.ajaxForm.counter = 1;
+$.fn.ajaxForm.optionHash = {};
+
+function clickHandler(e) {
+    var $form = this.form;
+    $form.clk = this;
+    if (this.type == 'image') {
+        if (e.offsetX != undefined) {
+            $form.clk_x = e.offsetX;
+            $form.clk_y = e.offsetY;
+        } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
+            var offset = $(this).offset();
+            $form.clk_x = e.pageX - offset.left;
+            $form.clk_y = e.pageY - offset.top;
+        } else {
+            $form.clk_x = e.pageX - this.offsetLeft;
+            $form.clk_y = e.pageY - this.offsetTop;
+        }
+    }
+    // clear form vars
+    setTimeout(function() { $form.clk = $form.clk_x = $form.clk_y = null; }, 10);
+};
+
+function submitHandler() {
+    // retrieve options from hash
+    var id = this.formPluginId;
+    var options = $.fn.ajaxForm.optionHash[id];
+    $(this).ajaxSubmit(options);
+    return false;
+};
+
+/**
+ * ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
+ *
+ * @name   ajaxFormUnbind
+ * @return jQuery
+ * @cat    Plugins/Form
+ * @type   jQuery
+ */
+$.fn.ajaxFormUnbind = function() {
+    this.unbind('submit', submitHandler);
+    return this.each(function() {
+        $(":submit,input:image", this).unbind('click', clickHandler);
+    });
+
+};
+
+/**
+ * formToArray() gathers form element data into an array of objects that can
+ * be passed to any of the following ajax functions: $.get, $.post, or load.
+ * Each object in the array has both a 'name' and 'value' property.  An example of
+ * an array for a simple login form might be:
+ *
+ * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * It is this array that is passed to pre-submit callback functions provided to the
+ * ajaxSubmit() and ajaxForm() methods.
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * This is normally true anyway, unless the form contains input elements of type='image'.
+ * If your form must be submitted with name/value pairs in semantic order and your form
+ * contains an input of type='image" then pass true for this arg, otherwise pass false
+ * (or nothing) to avoid the overhead for this logic.
+ *
+ * @example var data = $("#myForm").formToArray();
+ * $.post( "myscript.cgi", data );
+ * @desc Collect all the data from a form and submit it to the server.
+ *
+ * @name formToArray
+ * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
+ * @type Array<Object>
+ * @cat Plugins/Form
+ */
+$.fn.formToArray = function(semantic) {
+    var a = [];
+    if (this.length == 0) return a;
+
+    var form = this[0];
+    var els = semantic ? form.getElementsByTagName('*') : form.elements;
+    if (!els) return a;
+    for(var i=0, max=els.length; i < max; i++) {
+        var el = els[i];
+        var n = el.name;
+        if (!n) continue;
+
+        if (semantic && form.clk && el.type == "image") {
+            // handle image inputs on the fly when semantic == true
+            if(!el.disabled && form.clk == el)
+                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+            continue;
+        }
+
+        var v = $.fieldValue(el, true);
+        if (v && v.constructor == Array) {
+            for(var j=0, jmax=v.length; j < jmax; j++)
+                a.push({name: n, value: v[j]});
+        }
+        else if (v !== null && typeof v != 'undefined')
+            a.push({name: n, value: v});
+    }
+
+    if (!semantic && form.clk) {
+        // input type=='image' are not found in elements array! handle them here
+        var inputs = form.getElementsByTagName("input");
+        for(var i=0, max=inputs.length; i < max; i++) {
+            var input = inputs[i];
+            var n = input.name;
+            if(n && !input.disabled && input.type == "image" && form.clk == input)
+                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+        }
+    }
+    return a;
+};
+
+
+/**
+ * Serializes form data into a 'submittable' string. This method will return a string
+ * in the format: name1=value1&amp;name2=value2
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * If your form must be submitted with name/value pairs in semantic order then pass
+ * true for this arg, otherwise pass false (or nothing) to avoid the overhead for
+ * this logic (which can be significant for very large forms).
+ *
+ * @example var data = $("#myForm").formSerialize();
+ * $.ajax('POST', "myscript.cgi", data);
+ * @desc Collect all the data from a form into a single string
+ *
+ * @name formSerialize
+ * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
+ * @type String
+ * @cat Plugins/Form
+ */
+$.fn.formSerialize = function(semantic) {
+    //hand off to jQuery.param for proper encoding
+    return $.param(this.formToArray(semantic));
+};
+
+
+/**
+ * Serializes all field elements in the jQuery object into a query string.
+ * This method will return a string in the format: name1=value1&amp;name2=value2
+ *
+ * The successful argument controls whether or not serialization is limited to
+ * 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.
+ *
+ * @example var data = $("input").formSerialize();
+ * @desc Collect the data from all successful input elements into a query string
+ *
+ * @example var data = $(":radio").formSerialize();
+ * @desc Collect the data from all successful radio input elements into a query string
+ *
+ * @example var data = $("#myForm :checkbox").formSerialize();
+ * @desc Collect the data from all successful checkbox input elements in myForm into a query string
+ *
+ * @example var data = $("#myForm :checkbox").formSerialize(false);
+ * @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string
+ *
+ * @example var data = $(":input").formSerialize();
+ * @desc Collect the data from all successful input, select, textarea and button elements into a query string
+ *
+ * @name fieldSerialize
+ * @param successful true if only successful controls should be serialized (default is true)
+ * @type String
+ * @cat Plugins/Form
+ */
+$.fn.fieldSerialize = function(successful) {
+    var a = [];
+    this.each(function() {
+        var n = this.name;
+        if (!n) return;
+        var v = $.fieldValue(this, successful);
+        if (v && v.constructor == Array) {
+            for (var i=0,max=v.length; i < max; i++)
+                a.push({name: n, value: v[i]});
+        }
+        else if (v !== null && typeof v != 'undefined')
+            a.push({name: this.name, value: v});
+    });
+    //hand off to jQuery.param for proper encoding
+    return $.param(a);
+};
+
+
+/**
+ * Returns the value(s) of the element in the matched set.  For example, consider the following form:
+ *
+ *  <form><fieldset>
+ *      <input name="A" type="text" />
+ *      <input name="A" type="text" />
+ *      <input name="B" type="checkbox" value="B1" />
+ *      <input name="B" type="checkbox" value="B2"/>
+ *      <input name="C" type="radio" value="C1" />
+ *      <input name="C" type="radio" value="C2" />
+ *  </fieldset></form>
+ *
+ *  var v = $(':text').fieldValue();
+ *  // if no values are entered into the text inputs
+ *  v == ['','']
+ *  // if values entered into the text inputs are 'foo' and 'bar'
+ *  v == ['foo','bar']
+ *
+ *  var v = $(':checkbox').fieldValue();
+ *  // if neither checkbox is checked
+ *  v === undefined
+ *  // if both checkboxes are checked
+ *  v == ['B1', 'B2']
+ *
+ *  var v = $(':radio').fieldValue();
+ *  // if neither radio is checked
+ *  v === undefined
+ *  // if first radio is checked
+ *  v == ['C1']
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.  If this value is false the value(s)
+ * for each element is returned.
+ *
+ * Note: This method *always* returns an array.  If no valid value can be determined the
+ *       array will be empty, otherwise it will contain one or more values.
+ *
+ * @example var data = $("#myPasswordElement").fieldValue();
+ * alert(data[0]);
+ * @desc Alerts the current value of the myPasswordElement element
+ *
+ * @example var data = $("#myForm :input").fieldValue();
+ * @desc Get the value(s) of the form elements in myForm
+ *
+ * @example var data = $("#myForm :checkbox").fieldValue();
+ * @desc Get the value(s) for the successful checkbox element(s) in the jQuery object.
+ *
+ * @example var data = $("#mySingleSelect").fieldValue();
+ * @desc Get the value(s) of the select control
+ *
+ * @example var data = $(':text').fieldValue();
+ * @desc Get the value(s) of the text input or textarea elements
+ *
+ * @example var data = $("#myMultiSelect").fieldValue();
+ * @desc Get the values for the select-multiple control
+ *
+ * @name fieldValue
+ * @param Boolean successful true if only the values for successful controls should be returned (default is true)
+ * @type Array<String>
+ * @cat Plugins/Form
+ */
+$.fn.fieldValue = function(successful) {
+    for (var val=[], i=0, max=this.length; i < max; i++) {
+        var el = this[i];
+        var v = $.fieldValue(el, successful);
+        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
+            continue;
+        v.constructor == Array ? $.merge(val, v) : val.push(v);
+    }
+    return val;
+};
+
+/**
+ * Returns the value of the field element.
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.  If the given element is not
+ * successful and the successful arg is not false then the returned value will be null.
+ *
+ * Note: If the successful flag is true (default) but the element is not successful, the return will be null
+ * Note: The value returned for a successful select-multiple element will always be an array.
+ * Note: If the element has no value the return value will be undefined.
+ *
+ * @example var data = jQuery.fieldValue($("#myPasswordElement")[0]);
+ * @desc Gets the current value of the myPasswordElement element
+ *
+ * @name fieldValue
+ * @param Element el The DOM element for which the value will be returned
+ * @param Boolean successful true if value returned must be for a successful controls (default is true)
+ * @type String or Array<String> or null or undefined
+ * @cat Plugins/Form
+ */
+$.fieldValue = function(el, successful) {
+    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
+    if (typeof successful == 'undefined') successful = true;
+
+    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
+        (t == 'checkbox' || t == 'radio') && !el.checked ||
+        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
+        tag == 'select' && el.selectedIndex == -1))
+            return null;
+
+    if (tag == 'select') {
+        var index = el.selectedIndex;
+        if (index < 0) return null;
+        var a = [], ops = el.options;
+        var one = (t == 'select-one');
+        var max = (one ? index+1 : ops.length);
+        for(var i=(one ? index : 0); i < max; i++) {
+            var op = ops[i];
+            if (op.selected) {
+                // extra pain for IE...
+                var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
+                if (one) return v;
+                a.push(v);
+            }
+        }
+        return a;
+    }
+    return el.value;
+};
+
+
+/**
+ * Clears the form data.  Takes the following actions on the form's input fields:
+ *  - input text fields will have their 'value' property set to the empty string
+ *  - select elements will have their 'selectedIndex' property set to -1
+ *  - checkbox and radio inputs will have their 'checked' property set to false
+ *  - inputs of type submit, button, reset, and hidden will *not* be effected
+ *  - button elements will *not* be effected
+ *
+ * @example $('form').clearForm();
+ * @desc Clears all forms on the page.
+ *
+ * @name clearForm
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.clearForm = function() {
+    return this.each(function() {
+        $('input,select,textarea', this).clearFields();
+    });
+};
+
+/**
+ * Clears the selected form elements.  Takes the following actions on the matched elements:
+ *  - input text fields will have their 'value' property set to the empty string
+ *  - select elements will have their 'selectedIndex' property set to -1
+ *  - checkbox and radio inputs will have their 'checked' property set to false
+ *  - inputs of type submit, button, reset, and hidden will *not* be effected
+ *  - button elements will *not* be effected
+ *
+ * @example $('.myInputs').clearFields();
+ * @desc Clears all inputs with class myInputs
+ *
+ * @name clearFields
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.clearFields = $.fn.clearInputs = function() {
+    return this.each(function() {
+        var t = this.type, tag = this.tagName.toLowerCase();
+        if (t == 'text' || t == 'password' || tag == 'textarea')
+            this.value = '';
+        else if (t == 'checkbox' || t == 'radio')
+            this.checked = false;
+        else if (tag == 'select')
+            this.selectedIndex = -1;
+    });
+};
+
+
+/**
+ * Resets the form data.  Causes all form elements to be reset to their original value.
+ *
+ * @example $('form').resetForm();
+ * @desc Resets all forms on the page.
+ *
+ * @name resetForm
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.resetForm = function() {
+    return this.each(function() {
+        // guard against an input with the name of 'reset'
+        // note that IE reports the reset function as an 'object'
+        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
+            this.reset();
+    });
+};
+
+})(jQuery);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/support/javascript/hsbook.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,95 @@
+function qid(id) {
+  return id.replace(/([.:])/g, "\\$1");
+}
+
+function beforeComment(formData, jqForm, options) {
+  var form = jqForm[0];
+  if (!form.comment.value) {
+    $(options.target + " span.comment_error").empty().append(
+      "<span class=\"comment_error\">Your comment is empty</span>");
+    return false;
+  }
+  if (!form.name.value) {
+    $(options.target + " span.comment_error").empty().append(
+      "<span class=\"comment_error\">Please provide a name</span>");
+    return false;
+  }
+  $(options.target + " span.comment_error").empty().after(
+    "<img src=\"/support/icons/throbber.gif\" style=\"vertical-align: middle\"/>");
+  $(options.target + " input[@name=submit]").attr("disabled", true);
+}
+
+function ajaxifyForm(id) {
+  var q = qid(id);
+  
+  $("#form_" + q).ajaxForm({ beforeSubmit: beforeComment,
+			     success: function() { ajaxifyForm(id); },
+			     target: "#comments_" + q });
+}
+
+function toggleComment(id) {
+  $("#toggle_" + qid(id)).nextAll().toggle();
+  return false;
+}
+
+function loadComments(id) {
+  $("#comments_" + qid(id)).load(location.protocol + "//" + location.host +
+				 "/comments/single/" + id + "/", function() {
+    ajaxifyForm(id);
+  });
+  return false;
+}
+
+function loadAllComments() {
+  $("a.commenttoggle").each(function() {
+    var id = $(this).attr("pid");
+    if (id) {
+      loadComments(id);
+    }
+  });
+}
+
+$(document).ready(function() {
+  function loading(id) {
+    return " <span id=\"comments_" + id + "\" class=\"comment\">" +
+      "<span pid=\"" + id + "\" class=\"commenttoggle\">Loading..." +
+      "</span></span>";
+  }
+  $("div.toc>p")
+    .after("<p style='display: none;'><a onclick='return loadAllComments()'>" +
+	   "Load all comments (<b>slow</b>)</a></p>")
+    .toggle(function() { $(this).nextAll().show("normal"); },
+	    function() { $(this).nextAll().hide("normal"); })
+    .hover(function() { $(this).fadeTo("normal", 0.8); },
+	   function() { $(this).fadeTo("normal", 0.35); });
+  $(".chapter p[@id]").each(function() {
+    $(this).append(loading($(this).attr("id")));
+  });
+  $(".chapter table[@id].equation").each(function() {
+    id = $(this).attr("id");
+    $("#" + id + " tr").after('<tr><td colspan="4">' + loading($(this).attr("id")) + '</td></tr>');
+  });
+  $(".chapter pre[@id]").each(function() {
+    $(this).after(loading($(this).attr("id")));
+  });
+  var chapid = $("div.preface, div.chapter, div.appendix, div.bibliography").attr("id");
+  $("#chapterfeed").attr("href",
+			 $("#chapterfeed").attr("href") + chapid + "/");
+  $.getJSON(location.protocol + "//" + location.host + "/comments/chapter/" +
+	    chapid + "/count/", function(data) {
+    $.each(data, function(id, item) {
+      var s = item == 1 ? "" : "s";
+      $("#comments_" + qid(id) + " span.commenttoggle").replaceWith(
+        "<a class='commenttoggle' id='toggle_" + id + "' " +
+	"pid='" + id + "' " +
+	"onclick='return loadComments(\"" + id + "\")' " +
+	"href='comments: show / hide'>" + item + " comment" + s + "</a>");
+    });
+    $("span.commenttoggle").each(function() {
+      var id = $(this).attr("pid");
+      $(this).replaceWith("<a class='commenttoggle' id='toggle_" + id + "' " +
+			  "onclick='return loadComments(\"" + id + "\")' " +
+			  "href='comment: add'>No comments</a>");
+    });
+  });
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/support/javascript/jquery-min.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,31 @@
+/*
+ * jQuery 1.2.1 - New Wave Javascript
+ *
+ * Copyright (c) 2007 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
+ * $Rev: 3353 $
+ */
+(function(){if(typeof jQuery!="undefined")var _jQuery=jQuery;var jQuery=window.jQuery=function(selector,context){return this instanceof jQuery?this.init(selector,context):new jQuery(selector,context);};if(typeof $!="undefined")var _$=$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(typeof selector=="string"){var m=quickExpr.exec(selector);if(m&&(m[1]||!context)){if(m[1])selector=jQuery.clean([m[1]],context);else{var tmp=document.getElementById(m[3]);if(tmp)if(tmp.id!=m[3])return jQuery().find(selector);else{this[0]=tmp;this.length=1;return this;}else
+selector=[];}}else
+return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.1",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(a){var ret=jQuery(a);ret.prevObject=this;return ret;},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this;},each:function(fn,args){return jQuery.each(this,fn,args);},index:function(obj){var pos=-1;this.each(function(i){if(this==obj)pos=i;});return pos;},attr:function(key,value,type){var obj=key;if(key.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],key)||undefined;else{obj={};obj[key]=value;}return this.each(function(index){for(var prop in obj)jQuery.attr(type?this.style:this,prop,jQuery.prop(this,obj[prop],type,index,prop));});},css:function(key,value){return this.attr(key,value,"curCSS");},text:function(e){if(typeof e!="object"&&e!=null)return this.empty().append(document.createTextNode(e));var t="";jQuery.each(e||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)t+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return t;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,1,function(a){this.appendChild(a);});},prepend:function(){return this.domManip(arguments,true,-1,function(a){this.insertBefore(a,this.firstChild);});},before:function(){return this.domManip(arguments,false,1,function(a){this.parentNode.insertBefore(a,this);});},after:function(){return this.domManip(arguments,false,-1,function(a){this.parentNode.insertBefore(a,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(t){var data=jQuery.map(this,function(a){return jQuery.find(t,a);});return this.pushStack(/[^+>] [^+>]/.test(t)||t.indexOf("..")>-1?jQuery.unique(data):data);},clone:function(events){var ret=this.map(function(){return this.outerHTML?jQuery(this.outerHTML)[0]:this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(t){return this.pushStack(jQuery.isFunction(t)&&jQuery.grep(this,function(el,index){return t.apply(el,[index]);})||jQuery.multiFilter(t,this));},not:function(t){return this.pushStack(t.constructor==String&&jQuery.multiFilter(t,this,true)||jQuery.grep(this,function(a){return(t.constructor==Array||t.jquery)?jQuery.inArray(a,t)<0:a!=t;}));},add:function(t){return this.pushStack(jQuery.merge(this.get(),t.constructor==String?jQuery(t).get():t.length!=undefined&&(!t.nodeName||jQuery.nodeName(t,"form"))?t:[t]));},is:function(expr){return expr?jQuery.multiFilter(expr,this).length>0:false;},hasClass:function(expr){return this.is("."+expr);},val:function(val){if(val==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,a=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){var val=jQuery.browser.msie&&!option.attributes["value"].specified?option.text:option.value;if(one)return val;a.push(val);}}return a;}else
+return this[0].value.replace(/\r/g,"");}}else
+return this.each(function(){if(val.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,val)>=0||jQuery.inArray(this.name,val)>=0);else if(jQuery.nodeName(this,"select")){var tmp=val.constructor==Array?val:[val];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,tmp)>=0||jQuery.inArray(this.text,tmp)>=0);});if(!tmp.length)this.selectedIndex=-1;}else
+this.value=val;});},html:function(val){return val==undefined?(this.length?this[0].innerHTML:null):this.empty().append(val);},replaceWith:function(val){return this.after(val).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(fn){return this.pushStack(jQuery.map(this,function(elem,i){return fn.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},domManip:function(args,table,dir,fn){var clone=this.length>1,a;return this.each(function(){if(!a){a=jQuery.clean(args,this.ownerDocument);if(dir<0)a.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(a[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(document.createElement("tbody"));jQuery.each(a,function(){var elem=clone?this.cloneNode(true):this;if(!evalScript(0,elem))fn.call(obj,elem);});});}};function evalScript(i,elem){var script=jQuery.nodeName(elem,"script");if(script){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
+jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}else if(elem.nodeType==1)jQuery("script",elem).each(evalScript);return script;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},a=1,al=arguments.length,deep=false;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};}if(al==1){target=this;a=0;}var prop;for(;a<al;a++)if((prop=arguments[a])!=null)for(var i in prop){if(target==prop[i])continue;if(deep&&typeof prop[i]=='object'&&target[i])jQuery.extend(target[i],prop[i]);else if(prop[i]!=undefined)target[i]=prop[i];}return target;};var expando="jQuery"+(new Date()).getTime(),uuid=0,win={};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/function/i.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){if(window.execScript)window.execScript(data);else if(jQuery.browser.safari)window.setTimeout(data,0);else
+eval.call(window,data);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?win:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!=undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?win:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(obj,fn,args){if(args){if(obj.length==undefined)for(var i in obj)fn.apply(obj[i],args);else
+for(var i=0,ol=obj.length;i<ol;i++)if(fn.apply(obj[i],args)===false)break;}else{if(obj.length==undefined)for(var i in obj)fn.call(obj[i],i,obj[i]);else
+for(var i=0,ol=obj.length,val=obj[0];i<ol&&fn.call(val,i,val)!==false;val=obj[++i]){}}return obj;},prop:function(elem,value,type,index,prop){if(jQuery.isFunction(value))value=value.call(elem,[index]);var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i;return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(prop)?value+"px":value;},className:{add:function(elem,c){jQuery.each((c||"").split(/\s+/),function(i,cur){if(!jQuery.className.has(elem.className,cur))elem.className+=(elem.className?" ":"")+cur;});},remove:function(elem,c){elem.className=c!=undefined?jQuery.grep(elem.className.split(/\s+/),function(cur){return!jQuery.className.has(c,cur);}).join(" "):"";},has:function(t,c){return jQuery.inArray(c,(t.className||t).toString().split(/\s+/))>-1;}},swap:function(e,o,f){for(var i in o){e.style["old"+i]=e.style[i];e.style[i]=o[i];}f.apply(e,[]);for(var i in o)e.style[i]=e.style["old"+i];},css:function(e,p){if(p=="height"||p=="width"){var old={},oHeight,oWidth,d=["Top","Bottom","Right","Left"];jQuery.each(d,function(){old["padding"+this]=0;old["border"+this+"Width"]=0;});jQuery.swap(e,old,function(){if(jQuery(e).is(':visible')){oHeight=e.offsetHeight;oWidth=e.offsetWidth;}else{e=jQuery(e.cloneNode(true)).find(":radio").removeAttr("checked").end().css({visibility:"hidden",position:"absolute",display:"block",right:"0",left:"0"}).appendTo(e.parentNode)[0];var parPos=jQuery.css(e.parentNode,"position")||"static";if(parPos=="static")e.parentNode.style.position="relative";oHeight=e.clientHeight;oWidth=e.clientWidth;if(parPos=="static")e.parentNode.style.position="static";e.parentNode.removeChild(e);}});return p=="height"?oHeight:oWidth;}return jQuery.curCSS(e,p);},curCSS:function(elem,prop,force){var ret,stack=[],swap=[];function color(a){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(a,null);return!ret||ret.getPropertyValue("color")=="";}if(prop=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(prop.match(/float/i))prop=styleFloat;if(!force&&elem.style[prop])ret=elem.style[prop];else if(document.defaultView&&document.defaultView.getComputedStyle){if(prop.match(/float/i))prop="float";prop=prop.replace(/([A-Z])/g,"-$1").toLowerCase();var cur=document.defaultView.getComputedStyle(elem,null);if(cur&&!color(elem))ret=cur.getPropertyValue(prop);else{for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(a=0;a<stack.length;a++)if(color(stack[a])){swap[a]=stack[a].style.display;stack[a].style.display="block";}ret=prop=="display"&&swap[stack.length-1]!=null?"none":document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop)||"";for(a=0;a<swap.length;a++)if(swap[a]!=null)stack[a].style.display=swap[a];}if(prop=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var newProp=prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});ret=elem.currentStyle[prop]||elem.currentStyle[newProp];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var style=elem.style.left;var runtimeStyle=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;elem.style.left=ret||0;ret=elem.style.pixelLeft+"px";elem.style.left=style;elem.runtimeStyle.left=runtimeStyle;}}return ret;},clean:function(a,doc){var r=[];doc=doc||document;jQuery.each(a,function(i,arg){if(!arg)return;if(arg.constructor==Number)arg=arg.toString();if(typeof arg=="string"){arg=arg.replace(/(<(\w+)[^>]*?)\/>/g,function(m,all,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)?m:all+"></"+tag+">";});var s=jQuery.trim(arg).toLowerCase(),div=doc.createElement("div"),tb=[];var wrap=!s.indexOf("<opt")&&[1,"<select>","</select>"]||!s.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||s.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!s.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!s.indexOf("<td")||!s.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!s.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+arg+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){if(!s.indexOf("<table")&&s.indexOf("<tbody")<0)tb=div.firstChild&&div.firstChild.childNodes;else if(wrap[1]=="<table>"&&s.indexOf("<tbody")<0)tb=div.childNodes;for(var n=tb.length-1;n>=0;--n)if(jQuery.nodeName(tb[n],"tbody")&&!tb[n].childNodes.length)tb[n].parentNode.removeChild(tb[n]);if(/^\s/.test(arg))div.insertBefore(doc.createTextNode(arg.match(/^\s*/)[0]),div.firstChild);}arg=jQuery.makeArray(div.childNodes);}if(0===arg.length&&(!jQuery.nodeName(arg,"form")&&!jQuery.nodeName(arg,"select")))return;if(arg[0]==undefined||jQuery.nodeName(arg,"form")||arg.options)r.push(arg);else
+r=jQuery.merge(r,arg);});return r;},attr:function(elem,name,value){var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(t){return(t||"").replace(/^\s+|\s+$/g,"");},makeArray:function(a){var r=[];if(typeof a!="array")for(var i=0,al=a.length;i<al;i++)r.push(a[i]);else
+r=a.slice(0);return r;},inArray:function(b,a){for(var i=0,al=a.length;i<al;i++)if(a[i]==b)return i;return-1;},merge:function(first,second){if(jQuery.browser.msie){for(var i=0;second[i];i++)if(second[i].nodeType!=8)first.push(second[i]);}else
+for(var i=0;second[i];i++)first.push(second[i]);return first;},unique:function(first){var r=[],done={};try{for(var i=0,fl=first.length;i<fl;i++){var id=jQuery.data(first[i]);if(!done[id]){done[id]=true;r.push(first[i]);}}}catch(e){r=first;}return r;},grep:function(elems,fn,inv){if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++)if(!inv&&fn(elems[i],i)||inv&&!fn(elems[i],i))result.push(elems[i]);return result;},map:function(elems,fn){if(typeof fn=="string")fn=eval("false||function(a){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++){var val=fn(elems[i],i);if(val!==null&&val!=undefined){if(val.constructor!=Array)val=[val];result=result.concat(val);}}return result;}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",styleFloat:jQuery.browser.msie?"styleFloat":"cssFloat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,innerHTML:"innerHTML",className:"className",value:"value",disabled:"disabled",checked:"checked",readonly:"readOnly",selected:"selected",maxlength:"maxLength"}});jQuery.each({parent:"a.parentNode",parents:"jQuery.dir(a,'parentNode')",next:"jQuery.nth(a,2,'nextSibling')",prev:"jQuery.nth(a,2,'previousSibling')",nextAll:"jQuery.dir(a,'nextSibling')",prevAll:"jQuery.dir(a,'previousSibling')",siblings:"jQuery.sibling(a.parentNode.firstChild,a)",children:"jQuery.sibling(a.firstChild)",contents:"jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"},function(i,n){jQuery.fn[i]=function(a){var ret=jQuery.map(this,n);if(a&&typeof a=="string")ret=jQuery.multiFilter(a,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(i,n){jQuery.fn[i]=function(){var a=arguments;return this.each(function(){for(var j=0,al=a.length;j<al;j++)jQuery(a[j])[n](this);});};});jQuery.each({removeAttr:function(key){jQuery.attr(this,key,"");this.removeAttribute(key);},addClass:function(c){jQuery.className.add(this,c);},removeClass:function(c){jQuery.className.remove(this,c);},toggleClass:function(c){jQuery.className[jQuery.className.has(this,c)?"remove":"add"](this,c);},remove:function(a){if(!a||jQuery.filter(a,[this]).r.length){jQuery.removeData(this);this.parentNode.removeChild(this);}},empty:function(){jQuery("*",this).each(function(){jQuery.removeData(this);});while(this.firstChild)this.removeChild(this.firstChild);}},function(i,n){jQuery.fn[i]=function(){return this.each(n,arguments);};});jQuery.each(["Height","Width"],function(i,name){var n=name.toLowerCase();jQuery.fn[n]=function(h){return this[0]==window?jQuery.browser.safari&&self["inner"+name]||jQuery.boxModel&&Math.max(document.documentElement["client"+name],document.body["client"+name])||document.body["client"+name]:this[0]==document?Math.max(document.body["scroll"+name],document.body["offset"+name]):h==undefined?(this.length?jQuery.css(this[0],n):null):this.css(n,h.constructor==String?h:h+"px");};});var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":"m[2]=='*'||jQuery.nodeName(a,m[2])","#":"a.getAttribute('id')==m[2]",":":{lt:"i<m[3]-0",gt:"i>m[3]-0",nth:"m[3]-0==i",eq:"m[3]-0==i",first:"i==0",last:"i==r.length-1",even:"i%2==0",odd:"i%2","first-child":"a.parentNode.getElementsByTagName('*')[0]==a","last-child":"jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a","only-child":"!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",parent:"a.firstChild",empty:"!a.firstChild",contains:"(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",visible:'"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',hidden:'"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',enabled:"!a.disabled",disabled:"a.disabled",checked:"a.checked",selected:"a.selected||jQuery.attr(a,'selected')",text:"'text'==a.type",radio:"'radio'==a.type",checkbox:"'checkbox'==a.type",file:"'file'==a.type",password:"'password'==a.type",submit:"'submit'==a.type",image:"'image'==a.type",reset:"'reset'==a.type",button:'"button"==a.type||jQuery.nodeName(a,"button")',input:"/input|select|textarea|button/i.test(a.nodeName)",has:"jQuery.find(m[3],a).length",header:"/h\\d/i.test(a.nodeName)",animated:"jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&!context.nodeType)context=null;context=context||document;var ret=[context],done=[],last;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){var nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName.toUpperCase()))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var nodeName=m[2],merge={};m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName.toUpperCase()){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=jQuery.filter(m[3],r,true).r;else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(\d*)n\+?(\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"n+"+m[3]||m[3]),first=(test[1]||1)-0,last=test[2]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==1){if(last==0||node.nodeIndex==last)add=true;}else if((node.nodeIndex+last)%first==0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var f=jQuery.expr[m[1]];if(typeof f!="string")f=jQuery.expr[m[1]][m[2]];f=eval("false||function(a,i){return "+f+"}");r=jQuery.grep(r,f,not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(element,type,handler,data){if(jQuery.browser.msie&&element.setInterval!=undefined)element=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var parts=type.split(".");type=parts[0];handler.type=parts[1];var events=jQuery.data(element,"events")||jQuery.data(element,"events",{});var handle=jQuery.data(element,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(element,arguments);return val;});var handlers=events[type];if(!handlers){handlers=events[type]={};if(element.addEventListener)element.addEventListener(type,handle,false);else
+element.attachEvent("on"+type,handle);}handlers[handler.guid]=handler;this.global[type]=true;},guid:1,global:{},remove:function(element,type,handler){var events=jQuery.data(element,"events"),ret,index;if(typeof type=="string"){var parts=type.split(".");type=parts[0];}if(events){if(type&&type.type){handler=type.handler;type=type.type;}if(!type){for(type in events)this.remove(element,type);}else if(events[type]){if(handler)delete events[type][handler.guid];else
+for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(element.removeEventListener)element.removeEventListener(type,jQuery.data(element,"handle"),false);else
+element.detachEvent("on"+type,jQuery.data(element,"handle"));ret=null;delete events[type];}}for(ret in events)break;if(!ret){jQuery.removeData(element,"events");jQuery.removeData(element,"handle");}}},trigger:function(type,data,element,donative,extra){data=jQuery.makeArray(data||[]);if(!element){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{var val,ret,fn=jQuery.isFunction(element[type]||null),evt=!data[0]||!data[0].preventDefault;if(evt)data.unshift(this.fix({type:type,target:element}));data[0].type=type;if(jQuery.isFunction(jQuery.data(element,"handle")))val=jQuery.data(element,"handle").apply(element,data);if(!fn&&element["on"+type]&&element["on"+type].apply(element,data)===false)val=false;if(evt)data.shift();if(extra&&extra.apply(element,data)===false)val=false;if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(element,'a')&&type=="click")){this.triggered=true;element[type]();}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var c=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in c){args[0].handler=c[j];args[0].data=c[j].data;if(!parts[1]||c[j].type==parts[1]){var tmp=c[j].apply(this,args);if(val!==false)val=tmp;if(tmp===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target&&event.srcElement)event.target=event.srcElement;if(jQuery.browser.safari&&event.target.nodeType==3)event.target=originalEvent.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var e=document.documentElement,b=document.body;event.pageX=event.clientX+(e&&e.scrollLeft||b.scrollLeft||0);event.pageY=event.clientY+(e&&e.scrollTop||b.scrollTop||0);}if(!event.which&&(event.charCode||event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(){var a=arguments;return this.click(function(e){this.lastToggle=0==this.lastToggle?1:0;e.preventDefault();return a[this.lastToggle].apply(this,[e])||false;});},hover:function(f,g){function handleHover(e){var p=e.relatedTarget;while(p&&p!=this)try{p=p.parentNode;}catch(e){p=this;};if(p==this)return false;return(e.type=="mouseover"?f:g).apply(this,[e]);}return this.mouseover(handleHover).mouseout(handleHover);},ready:function(f){bindReady();if(jQuery.isReady)f.apply(document,[jQuery]);else
+jQuery.readyList.push(function(){return f.apply(this,[jQuery]);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}if(jQuery.browser.mozilla||jQuery.browser.opera)document.removeEventListener("DOMContentLoaded",jQuery.ready,false);if(!window.frames.length)jQuery(window).load(function(){jQuery("#__ie_init").remove();});}}});jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,o){jQuery.fn[o]=function(f){return f?this.bind(o,f):this.trigger(o);};});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(jQuery.browser.mozilla||jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);else if(jQuery.browser.msie){document.write("<scr"+"ipt id=__ie_init defer=true "+"src=//:><\/script>");var script=document.getElementById("__ie_init");if(script)script.onreadystatechange=function(){if(this.readyState!="complete")return;jQuery.ready();};script=null;}else if(jQuery.browser.safari)jQuery.safariTimer=setInterval(function(){if(document.readyState=="loaded"||document.readyState=="complete"){clearInterval(jQuery.safariTimer);jQuery.safariTimer=null;jQuery.ready();}},10);jQuery.event.add(window,"load",jQuery.ready);}jQuery.fn.extend({load:function(url,params,callback){if(jQuery.isFunction(url))return this.bind("load",url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);setTimeout(function(){self.each(callback,[res.responseText,status,res]);},13);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null},lastModified:{},ajax:function(s){var jsonp,jsre=/=(\?|%3F)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=s.data.replace(jsre,"="+jsonp);s.url=s.url.replace(jsre,"="+jsonp);s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get")s.url+=(s.url.match(/\?/)?"&":"?")+"_="+(new Date()).getTime();if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if(!s.url.indexOf("http")&&s.dataType=="script"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(!jsonp&&(s.success||s.complete)){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async);if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
+jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();return xml;function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
+for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
+s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock?this.oldblock:"";if(jQuery.css(this,"display")=="none")this.style.display="block";}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");if(this.oldblock=="none")this.oldblock="block";this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var opt=jQuery.speed(speed,easing,callback);return this[opt.queue===false?"each":"queue"](function(){opt=jQuery.extend({},opt);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
+e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(){var timers=jQuery.timers;return this.each(function(){for(var i=0;i<timers.length;i++)if(timers[i].elem==this)timers.splice(i--,1);}).dequeue();}});var queue=function(elem,type,array){if(!elem)return;var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.curCSS(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.css(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(){return self.step();}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timers.length==1){var timer=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length)clearInterval(timer);},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(){var t=(new Date()).getTime();if(t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var absolute=jQuery.css(elem,"position")=="absolute",parent=elem.parentNode,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522;if(elem.getBoundingClientRect){box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));if(msie){var border=jQuery("html").css("borderWidth");border=(border=="medium"||jQuery.boxModel&&parseInt(version)>=7)&&2||border;add(-border,-border);}}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&/^t[d|h]$/i.test(parent.tagName)||!safari2)border(offsetParent);if(safari2&&!absolute&&jQuery.css(offsetParent,"position")=="absolute")absolute=true;offsetParent=offsetParent.offsetParent;}while(parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table-row.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if(safari2&&absolute)add(-doc.body.offsetLeft,-doc.body.offsetTop);}results={top:top,left:left};}return results;function border(elem){add(jQuery.css(elem,"borderLeftWidth"),jQuery.css(elem,"borderTopWidth"));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}};})();
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/support/javascript/jquery.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,2992 @@
+(function(){
+/*
+ * jQuery 1.2.1 - New Wave Javascript
+ *
+ * Copyright (c) 2007 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
+ * $Rev: 3353 $
+ */
+
+// Map over jQuery in case of overwrite
+if ( typeof jQuery != "undefined" )
+	var _jQuery = jQuery;
+
+var jQuery = window.jQuery = function(selector, context) {
+	// If the context is a namespace object, return a new object
+	return this instanceof jQuery ?
+		this.init(selector, context) :
+		new jQuery(selector, context);
+};
+
+// Map over the $ in case of overwrite
+if ( typeof $ != "undefined" )
+	var _$ = $;
+	
+// Map the jQuery namespace to the '$' one
+window.$ = jQuery;
+
+var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;
+
+jQuery.fn = jQuery.prototype = {
+	init: function(selector, context) {
+		// Make sure that a selection was provided
+		selector = selector || document;
+
+		// Handle HTML strings
+		if ( typeof selector  == "string" ) {
+			var m = quickExpr.exec(selector);
+			if ( m && (m[1] || !context) ) {
+				// HANDLE: $(html) -> $(array)
+				if ( m[1] )
+					selector = jQuery.clean( [ m[1] ], context );
+
+				// HANDLE: $("#id")
+				else {
+					var tmp = document.getElementById( m[3] );
+					if ( tmp )
+						// Handle the case where IE and Opera return items
+						// by name instead of ID
+						if ( tmp.id != m[3] )
+							return jQuery().find( selector );
+						else {
+							this[0] = tmp;
+							this.length = 1;
+							return this;
+						}
+					else
+						selector = [];
+				}
+
+			// HANDLE: $(expr)
+			} else
+				return new jQuery( context ).find( selector );
+
+		// HANDLE: $(function)
+		// Shortcut for document ready
+		} else if ( jQuery.isFunction(selector) )
+			return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( selector );
+
+		return this.setArray(
+			// HANDLE: $(array)
+			selector.constructor == Array && selector ||
+
+			// HANDLE: $(arraylike)
+			// Watch for when an array-like object is passed as the selector
+			(selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) ||
+
+			// HANDLE: $(*)
+			[ selector ] );
+	},
+	
+	jquery: "1.2.1",
+
+	size: function() {
+		return this.length;
+	},
+	
+	length: 0,
+
+	get: function( num ) {
+		return num == undefined ?
+
+			// Return a 'clean' array
+			jQuery.makeArray( this ) :
+
+			// Return just the object
+			this[num];
+	},
+	
+	pushStack: function( a ) {
+		var ret = jQuery(a);
+		ret.prevObject = this;
+		return ret;
+	},
+	
+	setArray: function( a ) {
+		this.length = 0;
+		Array.prototype.push.apply( this, a );
+		return this;
+	},
+
+	each: function( fn, args ) {
+		return jQuery.each( this, fn, args );
+	},
+
+	index: function( obj ) {
+		var pos = -1;
+		this.each(function(i){
+			if ( this == obj ) pos = i;
+		});
+		return pos;
+	},
+
+	attr: function( key, value, type ) {
+		var obj = key;
+		
+		// Look for the case where we're accessing a style value
+		if ( key.constructor == String )
+			if ( value == undefined )
+				return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined;
+			else {
+				obj = {};
+				obj[ key ] = value;
+			}
+		
+		// Check to see if we're setting style values
+		return this.each(function(index){
+			// Set all the styles
+			for ( var prop in obj )
+				jQuery.attr(
+					type ? this.style : this,
+					prop, jQuery.prop(this, obj[prop], type, index, prop)
+				);
+		});
+	},
+
+	css: function( key, value ) {
+		return this.attr( key, value, "curCSS" );
+	},
+
+	text: function(e) {
+		if ( typeof e != "object" && e != null )
+			return this.empty().append( document.createTextNode( e ) );
+
+		var t = "";
+		jQuery.each( e || this, function(){
+			jQuery.each( this.childNodes, function(){
+				if ( this.nodeType != 8 )
+					t += this.nodeType != 1 ?
+						this.nodeValue : jQuery.fn.text([ this ]);
+			});
+		});
+		return t;
+	},
+
+	wrapAll: function(html) {
+		if ( this[0] )
+			// The elements to wrap the target around
+			jQuery(html, this[0].ownerDocument)
+				.clone()
+				.insertBefore(this[0])
+				.map(function(){
+					var elem = this;
+					while ( elem.firstChild )
+						elem = elem.firstChild;
+					return elem;
+				})
+				.append(this);
+
+		return this;
+	},
+
+	wrapInner: function(html) {
+		return this.each(function(){
+			jQuery(this).contents().wrapAll(html);
+		});
+	},
+
+	wrap: function(html) {
+		return this.each(function(){
+			jQuery(this).wrapAll(html);
+		});
+	},
+
+	append: function() {
+		return this.domManip(arguments, true, 1, function(a){
+			this.appendChild( a );
+		});
+	},
+
+	prepend: function() {
+		return this.domManip(arguments, true, -1, function(a){
+			this.insertBefore( a, this.firstChild );
+		});
+	},
+	
+	before: function() {
+		return this.domManip(arguments, false, 1, function(a){
+			this.parentNode.insertBefore( a, this );
+		});
+	},
+
+	after: function() {
+		return this.domManip(arguments, false, -1, function(a){
+			this.parentNode.insertBefore( a, this.nextSibling );
+		});
+	},
+
+	end: function() {
+		return this.prevObject || jQuery([]);
+	},
+
+	find: function(t) {
+		var data = jQuery.map(this, function(a){ return jQuery.find(t,a); });
+		return this.pushStack( /[^+>] [^+>]/.test( t ) || t.indexOf("..") > -1 ?
+			jQuery.unique( data ) : data );
+	},
+
+	clone: function(events) {
+		// Do the clone
+		var ret = this.map(function(){
+			return this.outerHTML ? jQuery(this.outerHTML)[0] : this.cloneNode(true);
+		});
+
+		// Need to set the expando to null on the cloned set if it exists
+		// removeData doesn't work here, IE removes it from the original as well
+		// this is primarily for IE but the data expando shouldn't be copied over in any browser
+		var clone = ret.find("*").andSelf().each(function(){
+			if ( this[ expando ] != undefined )
+				this[ expando ] = null;
+		});
+		
+		// Copy the events from the original to the clone
+		if (events === true)
+			this.find("*").andSelf().each(function(i) {
+				var events = jQuery.data(this, "events");
+				for ( var type in events )
+					for ( var handler in events[type] )
+						jQuery.event.add(clone[i], type, events[type][handler], events[type][handler].data);
+			});
+
+		// Return the cloned set
+		return ret;
+	},
+
+	filter: function(t) {
+		return this.pushStack(
+			jQuery.isFunction( t ) &&
+			jQuery.grep(this, function(el, index){
+				return t.apply(el, [index]);
+			}) ||
+
+			jQuery.multiFilter(t,this) );
+	},
+
+	not: function(t) {
+		return this.pushStack(
+			t.constructor == String &&
+			jQuery.multiFilter(t, this, true) ||
+
+			jQuery.grep(this, function(a) {
+				return ( t.constructor == Array || t.jquery )
+					? jQuery.inArray( a, t ) < 0
+					: a != t;
+			})
+		);
+	},
+
+	add: function(t) {
+		return this.pushStack( jQuery.merge(
+			this.get(),
+			t.constructor == String ?
+				jQuery(t).get() :
+				t.length != undefined && (!t.nodeName || jQuery.nodeName(t, "form")) ?
+					t : [t] )
+		);
+	},
+
+	is: function(expr) {
+		return expr ? jQuery.multiFilter(expr,this).length > 0 : false;
+	},
+
+	hasClass: function(expr) {
+		return this.is("." + expr);
+	},
+	
+	val: function( val ) {
+		if ( val == undefined ) {
+			if ( this.length ) {
+				var elem = this[0];
+		    	
+				// We need to handle select boxes special
+				if ( jQuery.nodeName(elem, "select") ) {
+					var index = elem.selectedIndex,
+						a = [],
+						options = elem.options,
+						one = elem.type == "select-one";
+					
+					// Nothing was selected
+					if ( index < 0 )
+						return null;
+
+					// Loop through all the selected options
+					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+						var option = options[i];
+						if ( option.selected ) {
+							// Get the specifc value for the option
+							var val = jQuery.browser.msie && !option.attributes["value"].specified ? option.text : option.value;
+							
+							// We don't need an array for one selects
+							if ( one )
+								return val;
+							
+							// Multi-Selects return an array
+							a.push(val);
+						}
+					}
+					
+					return a;
+					
+				// Everything else, we just grab the value
+				} else
+					return this[0].value.replace(/\r/g, "");
+			}
+		} else
+			return this.each(function(){
+				if ( val.constructor == Array && /radio|checkbox/.test(this.type) )
+					this.checked = (jQuery.inArray(this.value, val) >= 0 ||
+						jQuery.inArray(this.name, val) >= 0);
+				else if ( jQuery.nodeName(this, "select") ) {
+					var tmp = val.constructor == Array ? val : [val];
+
+					jQuery("option", this).each(function(){
+						this.selected = (jQuery.inArray(this.value, tmp) >= 0 ||
+						jQuery.inArray(this.text, tmp) >= 0);
+					});
+
+					if ( !tmp.length )
+						this.selectedIndex = -1;
+				} else
+					this.value = val;
+			});
+	},
+	
+	html: function( val ) {
+		return val == undefined ?
+			( this.length ? this[0].innerHTML : null ) :
+			this.empty().append( val );
+	},
+
+	replaceWith: function( val ) {
+		return this.after( val ).remove();
+	},
+
+	eq: function(i){
+		return this.slice(i, i+1);
+	},
+
+	slice: function() {
+		return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
+	},
+
+	map: function(fn) {
+		return this.pushStack(jQuery.map( this, function(elem,i){
+			return fn.call( elem, i, elem );
+		}));
+	},
+
+	andSelf: function() {
+		return this.add( this.prevObject );
+	},
+	
+	domManip: function(args, table, dir, fn) {
+		var clone = this.length > 1, a; 
+
+		return this.each(function(){
+			if ( !a ) {
+				a = jQuery.clean(args, this.ownerDocument);
+				if ( dir < 0 )
+					a.reverse();
+			}
+
+			var obj = this;
+
+			if ( table && jQuery.nodeName(this, "table") && jQuery.nodeName(a[0], "tr") )
+				obj = this.getElementsByTagName("tbody")[0] || this.appendChild(document.createElement("tbody"));
+
+			jQuery.each( a, function(){
+				var elem = clone ? this.cloneNode(true) : this;
+				if ( !evalScript(0, elem) )
+					fn.call( obj, elem );
+			});
+		});
+	}
+};
+
+function evalScript(i, elem){
+	var script = jQuery.nodeName(elem, "script");
+
+	if ( script ) {
+		if ( elem.src )
+			jQuery.ajax({ url: elem.src, async: false, dataType: "script" });
+		else
+			jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
+	
+		if ( elem.parentNode )
+			elem.parentNode.removeChild(elem);
+
+	} else if ( elem.nodeType == 1 )
+    jQuery("script", elem).each(evalScript);
+
+	return script;
+}
+
+jQuery.extend = jQuery.fn.extend = function() {
+	// copy reference to target object
+	var target = arguments[0] || {}, a = 1, al = arguments.length, deep = false;
+
+	// Handle a deep copy situation
+	if ( target.constructor == Boolean ) {
+		deep = target;
+		target = arguments[1] || {};
+	}
+
+	// extend jQuery itself if only one argument is passed
+	if ( al == 1 ) {
+		target = this;
+		a = 0;
+	}
+
+	var prop;
+
+	for ( ; a < al; a++ )
+		// Only deal with non-null/undefined values
+		if ( (prop = arguments[a]) != null )
+			// Extend the base object
+			for ( var i in prop ) {
+				// Prevent never-ending loop
+				if ( target == prop[i] )
+					continue;
+
+				// Recurse if we're merging object values
+				if ( deep && typeof prop[i] == 'object' && target[i] )
+					jQuery.extend( target[i], prop[i] );
+
+				// Don't bring in undefined values
+				else if ( prop[i] != undefined )
+					target[i] = prop[i];
+			}
+
+	// Return the modified object
+	return target;
+};
+
+var expando = "jQuery" + (new Date()).getTime(), uuid = 0, win = {};
+
+jQuery.extend({
+	noConflict: function(deep) {
+		window.$ = _$;
+		if ( deep )
+			window.jQuery = _jQuery;
+		return jQuery;
+	},
+
+	// This may seem like some crazy code, but trust me when I say that this
+	// is the only cross-browser way to do this. --John
+	isFunction: function( fn ) {
+		return !!fn && typeof fn != "string" && !fn.nodeName && 
+			fn.constructor != Array && /function/i.test( fn + "" );
+	},
+	
+	// check if an element is in a XML document
+	isXMLDoc: function(elem) {
+		return elem.documentElement && !elem.body ||
+			elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
+	},
+
+	// Evalulates a script in a global context
+	// Evaluates Async. in Safari 2 :-(
+	globalEval: function( data ) {
+		data = jQuery.trim( data );
+		if ( data ) {
+			if ( window.execScript )
+				window.execScript( data );
+			else if ( jQuery.browser.safari )
+				// safari doesn't provide a synchronous global eval
+				window.setTimeout( data, 0 );
+			else
+				eval.call( window, data );
+		}
+	},
+
+	nodeName: function( elem, name ) {
+		return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
+	},
+	
+	cache: {},
+	
+	data: function( elem, name, data ) {
+		elem = elem == window ? win : elem;
+
+		var id = elem[ expando ];
+
+		// Compute a unique ID for the element
+		if ( !id ) 
+			id = elem[ expando ] = ++uuid;
+
+		// Only generate the data cache if we're
+		// trying to access or manipulate it
+		if ( name && !jQuery.cache[ id ] )
+			jQuery.cache[ id ] = {};
+		
+		// Prevent overriding the named cache with undefined values
+		if ( data != undefined )
+			jQuery.cache[ id ][ name ] = data;
+		
+		// Return the named cache data, or the ID for the element	
+		return name ? jQuery.cache[ id ][ name ] : id;
+	},
+	
+	removeData: function( elem, name ) {
+		elem = elem == window ? win : elem;
+
+		var id = elem[ expando ];
+
+		// If we want to remove a specific section of the element's data
+		if ( name ) {
+			if ( jQuery.cache[ id ] ) {
+				// Remove the section of cache data
+				delete jQuery.cache[ id ][ name ];
+
+				// If we've removed all the data, remove the element's cache
+				name = "";
+				for ( name in jQuery.cache[ id ] ) break;
+				if ( !name )
+					jQuery.removeData( elem );
+			}
+
+		// Otherwise, we want to remove all of the element's data
+		} else {
+			// Clean up the element expando
+			try {
+				delete elem[ expando ];
+			} catch(e){
+				// IE has trouble directly removing the expando
+				// but it's ok with using removeAttribute
+				if ( elem.removeAttribute )
+					elem.removeAttribute( expando );
+			}
+
+			// Completely remove the data cache
+			delete jQuery.cache[ id ];
+		}
+	},
+
+	// args is for internal usage only
+	each: function( obj, fn, args ) {
+		if ( args ) {
+			if ( obj.length == undefined )
+				for ( var i in obj )
+					fn.apply( obj[i], args );
+			else
+				for ( var i = 0, ol = obj.length; i < ol; i++ )
+					if ( fn.apply( obj[i], args ) === false ) break;
+
+		// A special, fast, case for the most common use of each
+		} else {
+			if ( obj.length == undefined )
+				for ( var i in obj )
+					fn.call( obj[i], i, obj[i] );
+			else
+				for ( var i = 0, ol = obj.length, val = obj[0]; 
+					i < ol && fn.call(val,i,val) !== false; val = obj[++i] ){}
+		}
+
+		return obj;
+	},
+	
+	prop: function(elem, value, type, index, prop){
+			// Handle executable functions
+			if ( jQuery.isFunction( value ) )
+				value = value.call( elem, [index] );
+				
+			// exclude the following css properties to add px
+			var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
+
+			// Handle passing in a number to a CSS property
+			return value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) ?
+				value + "px" :
+				value;
+	},
+
+	className: {
+		// internal only, use addClass("class")
+		add: function( elem, c ){
+			jQuery.each( (c || "").split(/\s+/), function(i, cur){
+				if ( !jQuery.className.has( elem.className, cur ) )
+					elem.className += ( elem.className ? " " : "" ) + cur;
+			});
+		},
+
+		// internal only, use removeClass("class")
+		remove: function( elem, c ){
+			elem.className = c != undefined ?
+				jQuery.grep( elem.className.split(/\s+/), function(cur){
+					return !jQuery.className.has( c, cur );	
+				}).join(" ") : "";
+		},
+
+		// internal only, use is(".class")
+		has: function( t, c ) {
+			return jQuery.inArray( c, (t.className || t).toString().split(/\s+/) ) > -1;
+		}
+	},
+
+	swap: function(e,o,f) {
+		for ( var i in o ) {
+			e.style["old"+i] = e.style[i];
+			e.style[i] = o[i];
+		}
+		f.apply( e, [] );
+		for ( var i in o )
+			e.style[i] = e.style["old"+i];
+	},
+
+	css: function(e,p) {
+		if ( p == "height" || p == "width" ) {
+			var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"];
+
+			jQuery.each( d, function(){
+				old["padding" + this] = 0;
+				old["border" + this + "Width"] = 0;
+			});
+
+			jQuery.swap( e, old, function() {
+				if ( jQuery(e).is(':visible') ) {
+					oHeight = e.offsetHeight;
+					oWidth = e.offsetWidth;
+				} else {
+					e = jQuery(e.cloneNode(true))
+						.find(":radio").removeAttr("checked").end()
+						.css({
+							visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0"
+						}).appendTo(e.parentNode)[0];
+
+					var parPos = jQuery.css(e.parentNode,"position") || "static";
+					if ( parPos == "static" )
+						e.parentNode.style.position = "relative";
+
+					oHeight = e.clientHeight;
+					oWidth = e.clientWidth;
+
+					if ( parPos == "static" )
+						e.parentNode.style.position = "static";
+
+					e.parentNode.removeChild(e);
+				}
+			});
+
+			return p == "height" ? oHeight : oWidth;
+		}
+
+		return jQuery.curCSS( e, p );
+	},
+
+	curCSS: function(elem, prop, force) {
+		var ret, stack = [], swap = [];
+
+		// A helper method for determining if an element's values are broken
+		function color(a){
+			if ( !jQuery.browser.safari )
+				return false;
+
+			var ret = document.defaultView.getComputedStyle(a,null);
+			return !ret || ret.getPropertyValue("color") == "";
+		}
+
+		if (prop == "opacity" && jQuery.browser.msie) {
+			ret = jQuery.attr(elem.style, "opacity");
+			return ret == "" ? "1" : ret;
+		}
+		
+		if (prop.match(/float/i))
+			prop = styleFloat;
+
+		if (!force && elem.style[prop])
+			ret = elem.style[prop];
+
+		else if (document.defaultView && document.defaultView.getComputedStyle) {
+
+			if (prop.match(/float/i))
+				prop = "float";
+
+			prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase();
+			var cur = document.defaultView.getComputedStyle(elem, null);
+
+			if ( cur && !color(elem) )
+				ret = cur.getPropertyValue(prop);
+
+			// If the element isn't reporting its values properly in Safari
+			// then some display: none elements are involved
+			else {
+				// Locate all of the parent display: none elements
+				for ( var a = elem; a && color(a); a = a.parentNode )
+					stack.unshift(a);
+
+				// Go through and make them visible, but in reverse
+				// (It would be better if we knew the exact display type that they had)
+				for ( a = 0; a < stack.length; a++ )
+					if ( color(stack[a]) ) {
+						swap[a] = stack[a].style.display;
+						stack[a].style.display = "block";
+					}
+
+				// Since we flip the display style, we have to handle that
+				// one special, otherwise get the value
+				ret = prop == "display" && swap[stack.length-1] != null ?
+					"none" :
+					document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop) || "";
+
+				// Finally, revert the display styles back
+				for ( a = 0; a < swap.length; a++ )
+					if ( swap[a] != null )
+						stack[a].style.display = swap[a];
+			}
+
+			if ( prop == "opacity" && ret == "" )
+				ret = "1";
+
+		} else if (elem.currentStyle) {
+			var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});
+			ret = elem.currentStyle[prop] || elem.currentStyle[newProp];
+
+			// From the awesome hack by Dean Edwards
+			// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+			// If we're not dealing with a regular pixel number
+			// but a number that has a weird ending, we need to convert it to pixels
+			if ( !/^\d+(px)?$/i.test(ret) && /^\d/.test(ret) ) {
+				var style = elem.style.left;
+				var runtimeStyle = elem.runtimeStyle.left;
+				elem.runtimeStyle.left = elem.currentStyle.left;
+				elem.style.left = ret || 0;
+				ret = elem.style.pixelLeft + "px";
+				elem.style.left = style;
+				elem.runtimeStyle.left = runtimeStyle;
+			}
+		}
+
+		return ret;
+	},
+	
+	clean: function(a, doc) {
+		var r = [];
+		doc = doc || document;
+
+		jQuery.each( a, function(i,arg){
+			if ( !arg ) return;
+
+			if ( arg.constructor == Number )
+				arg = arg.toString();
+			
+			// Convert html string into DOM nodes
+			if ( typeof arg == "string" ) {
+				// Fix "XHTML"-style tags in all browsers
+				arg = arg.replace(/(<(\w+)[^>]*?)\/>/g, function(m, all, tag){
+					return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)? m : all+"></"+tag+">";
+				});
+
+				// Trim whitespace, otherwise indexOf won't work as expected
+				var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = [];
+
+				var wrap =
+					// option or optgroup
+					!s.indexOf("<opt") &&
+					[1, "<select>", "</select>"] ||
+					
+					!s.indexOf("<leg") &&
+					[1, "<fieldset>", "</fieldset>"] ||
+					
+					s.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
+					[1, "<table>", "</table>"] ||
+					
+					!s.indexOf("<tr") &&
+					[2, "<table><tbody>", "</tbody></table>"] ||
+					
+				 	// <thead> matched above
+					(!s.indexOf("<td") || !s.indexOf("<th")) &&
+					[3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
+					
+					!s.indexOf("<col") &&
+					[2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] ||
+
+					// IE can't serialize <link> and <script> tags normally
+					jQuery.browser.msie &&
+					[1, "div<div>", "</div>"] ||
+					
+					[0,"",""];
+
+				// Go to html and back, then peel off extra wrappers
+				div.innerHTML = wrap[1] + arg + wrap[2];
+				
+				// Move to the right depth
+				while ( wrap[0]-- )
+					div = div.lastChild;
+				
+				// Remove IE's autoinserted <tbody> from table fragments
+				if ( jQuery.browser.msie ) {
+					
+					// String was a <table>, *may* have spurious <tbody>
+					if ( !s.indexOf("<table") && s.indexOf("<tbody") < 0 ) 
+						tb = div.firstChild && div.firstChild.childNodes;
+						
+					// String was a bare <thead> or <tfoot>
+					else if ( wrap[1] == "<table>" && s.indexOf("<tbody") < 0 )
+						tb = div.childNodes;
+
+					for ( var n = tb.length-1; n >= 0 ; --n )
+						if ( jQuery.nodeName(tb[n], "tbody") && !tb[n].childNodes.length )
+							tb[n].parentNode.removeChild(tb[n]);
+	
+					// IE completely kills leading whitespace when innerHTML is used	
+					if ( /^\s/.test(arg) )	
+						div.insertBefore( doc.createTextNode( arg.match(/^\s*/)[0] ), div.firstChild );
+
+				}
+				
+				arg = jQuery.makeArray( div.childNodes );
+			}
+
+			if ( 0 === arg.length && (!jQuery.nodeName(arg, "form") && !jQuery.nodeName(arg, "select")) )
+				return;
+
+			if ( arg[0] == undefined || jQuery.nodeName(arg, "form") || arg.options )
+				r.push( arg );
+			else
+				r = jQuery.merge( r, arg );
+
+		});
+
+		return r;
+	},
+	
+	attr: function(elem, name, value){
+		var fix = jQuery.isXMLDoc(elem) ? {} : jQuery.props;
+
+		// Safari mis-reports the default selected property of a hidden option
+		// Accessing the parent's selectedIndex property fixes it
+		if ( name == "selected" && jQuery.browser.safari )
+			elem.parentNode.selectedIndex;
+		
+		// Certain attributes only work when accessed via the old DOM 0 way
+		if ( fix[name] ) {
+			if ( value != undefined ) elem[fix[name]] = value;
+			return elem[fix[name]];
+		} else if ( jQuery.browser.msie && name == "style" )
+			return jQuery.attr( elem.style, "cssText", value );
+
+		else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName(elem, "form") && (name == "action" || name == "method") )
+			return elem.getAttributeNode(name).nodeValue;
+
+		// IE elem.getAttribute passes even for style
+		else if ( elem.tagName ) {
+
+			if ( value != undefined ) {
+				if ( name == "type" && jQuery.nodeName(elem,"input") && elem.parentNode )
+					throw "type property can't be changed";
+				elem.setAttribute( name, value );
+			}
+
+			if ( jQuery.browser.msie && /href|src/.test(name) && !jQuery.isXMLDoc(elem) ) 
+				return elem.getAttribute( name, 2 );
+
+			return elem.getAttribute( name );
+
+		// elem is actually elem.style ... set the style
+		} else {
+			// IE actually uses filters for opacity
+			if ( name == "opacity" && jQuery.browser.msie ) {
+				if ( value != undefined ) {
+					// IE has trouble with opacity if it does not have layout
+					// Force it by setting the zoom level
+					elem.zoom = 1; 
+	
+					// Set the alpha filter to set the opacity
+					elem.filter = (elem.filter || "").replace(/alpha\([^)]*\)/,"") +
+						(parseFloat(value).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
+				}
+	
+				return elem.filter ? 
+					(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100).toString() : "";
+			}
+			name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});
+			if ( value != undefined ) elem[name] = value;
+			return elem[name];
+		}
+	},
+	
+	trim: function(t){
+		return (t||"").replace(/^\s+|\s+$/g, "");
+	},
+
+	makeArray: function( a ) {
+		var r = [];
+
+		// Need to use typeof to fight Safari childNodes crashes
+		if ( typeof a != "array" )
+			for ( var i = 0, al = a.length; i < al; i++ )
+				r.push( a[i] );
+		else
+			r = a.slice( 0 );
+
+		return r;
+	},
+
+	inArray: function( b, a ) {
+		for ( var i = 0, al = a.length; i < al; i++ )
+			if ( a[i] == b )
+				return i;
+		return -1;
+	},
+
+	merge: function(first, second) {
+		// We have to loop this way because IE & Opera overwrite the length
+		// expando of getElementsByTagName
+
+		// Also, we need to make sure that the correct elements are being returned
+		// (IE returns comment nodes in a '*' query)
+		if ( jQuery.browser.msie ) {
+			for ( var i = 0; second[i]; i++ )
+				if ( second[i].nodeType != 8 )
+					first.push(second[i]);
+		} else
+			for ( var i = 0; second[i]; i++ )
+				first.push(second[i]);
+
+		return first;
+	},
+
+	unique: function(first) {
+		var r = [], done = {};
+
+		try {
+			for ( var i = 0, fl = first.length; i < fl; i++ ) {
+				var id = jQuery.data(first[i]);
+				if ( !done[id] ) {
+					done[id] = true;
+					r.push(first[i]);
+				}
+			}
+		} catch(e) {
+			r = first;
+		}
+
+		return r;
+	},
+
+	grep: function(elems, fn, inv) {
+		// If a string is passed in for the function, make a function
+		// for it (a handy shortcut)
+		if ( typeof fn == "string" )
+			fn = eval("false||function(a,i){return " + fn + "}");
+
+		var result = [];
+
+		// Go through the array, only saving the items
+		// that pass the validator function
+		for ( var i = 0, el = elems.length; i < el; i++ )
+			if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )
+				result.push( elems[i] );
+
+		return result;
+	},
+
+	map: function(elems, fn) {
+		// If a string is passed in for the function, make a function
+		// for it (a handy shortcut)
+		if ( typeof fn == "string" )
+			fn = eval("false||function(a){return " + fn + "}");
+
+		var result = [];
+
+		// Go through the array, translating each of the items to their
+		// new value (or values).
+		for ( var i = 0, el = elems.length; i < el; i++ ) {
+			var val = fn(elems[i],i);
+
+			if ( val !== null && val != undefined ) {
+				if ( val.constructor != Array ) val = [val];
+				result = result.concat( val );
+			}
+		}
+
+		return result;
+	}
+});
+
+var userAgent = navigator.userAgent.toLowerCase();
+
+// Figure out what browser is being used
+jQuery.browser = {
+	version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
+	safari: /webkit/.test(userAgent),
+	opera: /opera/.test(userAgent),
+	msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
+	mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
+};
+
+var styleFloat = jQuery.browser.msie ? "styleFloat" : "cssFloat";
+	
+jQuery.extend({
+	// Check to see if the W3C box model is being used
+	boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",
+	
+	styleFloat: jQuery.browser.msie ? "styleFloat" : "cssFloat",
+	
+	props: {
+		"for": "htmlFor",
+		"class": "className",
+		"float": styleFloat,
+		cssFloat: styleFloat,
+		styleFloat: styleFloat,
+		innerHTML: "innerHTML",
+		className: "className",
+		value: "value",
+		disabled: "disabled",
+		checked: "checked",
+		readonly: "readOnly",
+		selected: "selected",
+		maxlength: "maxLength"
+	}
+});
+
+jQuery.each({
+	parent: "a.parentNode",
+	parents: "jQuery.dir(a,'parentNode')",
+	next: "jQuery.nth(a,2,'nextSibling')",
+	prev: "jQuery.nth(a,2,'previousSibling')",
+	nextAll: "jQuery.dir(a,'nextSibling')",
+	prevAll: "jQuery.dir(a,'previousSibling')",
+	siblings: "jQuery.sibling(a.parentNode.firstChild,a)",
+	children: "jQuery.sibling(a.firstChild)",
+	contents: "jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"
+}, function(i,n){
+	jQuery.fn[ i ] = function(a) {
+		var ret = jQuery.map(this,n);
+		if ( a && typeof a == "string" )
+			ret = jQuery.multiFilter(a,ret);
+		return this.pushStack( jQuery.unique(ret) );
+	};
+});
+
+jQuery.each({
+	appendTo: "append",
+	prependTo: "prepend",
+	insertBefore: "before",
+	insertAfter: "after",
+	replaceAll: "replaceWith"
+}, function(i,n){
+	jQuery.fn[ i ] = function(){
+		var a = arguments;
+		return this.each(function(){
+			for ( var j = 0, al = a.length; j < al; j++ )
+				jQuery(a[j])[n]( this );
+		});
+	};
+});
+
+jQuery.each( {
+	removeAttr: function( key ) {
+		jQuery.attr( this, key, "" );
+		this.removeAttribute( key );
+	},
+	addClass: function(c){
+		jQuery.className.add(this,c);
+	},
+	removeClass: function(c){
+		jQuery.className.remove(this,c);
+	},
+	toggleClass: function( c ){
+		jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this, c);
+	},
+	remove: function(a){
+		if ( !a || jQuery.filter( a, [this] ).r.length ) {
+			jQuery.removeData( this );
+			this.parentNode.removeChild( this );
+		}
+	},
+	empty: function() {
+		// Clean up the cache
+		jQuery("*", this).each(function(){ jQuery.removeData(this); });
+
+		while ( this.firstChild )
+			this.removeChild( this.firstChild );
+	}
+}, function(i,n){
+	jQuery.fn[ i ] = function() {
+		return this.each( n, arguments );
+	};
+});
+
+jQuery.each( [ "Height", "Width" ], function(i,name){
+	var n = name.toLowerCase();
+	
+	jQuery.fn[ n ] = function(h) {
+		return this[0] == window ?
+			jQuery.browser.safari && self["inner" + name] ||
+			jQuery.boxModel && Math.max(document.documentElement["client" + name], document.body["client" + name]) ||
+			document.body["client" + name] :
+		
+			this[0] == document ?
+				Math.max( document.body["scroll" + name], document.body["offset" + name] ) :
+        
+				h == undefined ?
+					( this.length ? jQuery.css( this[0], n ) : null ) :
+					this.css( n, h.constructor == String ? h : h + "px" );
+	};
+});
+
+var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
+		"(?:[\\w*_-]|\\\\.)" :
+		"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
+	quickChild = new RegExp("^>\\s*(" + chars + "+)"),
+	quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
+	quickClass = new RegExp("^([#.]?)(" + chars + "*)");
+
+jQuery.extend({
+	expr: {
+		"": "m[2]=='*'||jQuery.nodeName(a,m[2])",
+		"#": "a.getAttribute('id')==m[2]",
+		":": {
+			// Position Checks
+			lt: "i<m[3]-0",
+			gt: "i>m[3]-0",
+			nth: "m[3]-0==i",
+			eq: "m[3]-0==i",
+			first: "i==0",
+			last: "i==r.length-1",
+			even: "i%2==0",
+			odd: "i%2",
+
+			// Child Checks
+			"first-child": "a.parentNode.getElementsByTagName('*')[0]==a",
+			"last-child": "jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a",
+			"only-child": "!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",
+
+			// Parent Checks
+			parent: "a.firstChild",
+			empty: "!a.firstChild",
+
+			// Text Check
+			contains: "(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",
+
+			// Visibility
+			visible: '"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',
+			hidden: '"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',
+
+			// Form attributes
+			enabled: "!a.disabled",
+			disabled: "a.disabled",
+			checked: "a.checked",
+			selected: "a.selected||jQuery.attr(a,'selected')",
+
+			// Form elements
+			text: "'text'==a.type",
+			radio: "'radio'==a.type",
+			checkbox: "'checkbox'==a.type",
+			file: "'file'==a.type",
+			password: "'password'==a.type",
+			submit: "'submit'==a.type",
+			image: "'image'==a.type",
+			reset: "'reset'==a.type",
+			button: '"button"==a.type||jQuery.nodeName(a,"button")',
+			input: "/input|select|textarea|button/i.test(a.nodeName)",
+
+			// :has()
+			has: "jQuery.find(m[3],a).length",
+
+			// :header
+			header: "/h\\d/i.test(a.nodeName)",
+
+			// :animated
+			animated: "jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"
+		}
+	},
+	
+	// The regular expressions that power the parsing engine
+	parse: [
+		// Match: [@value='test'], [@foo]
+		/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,
+
+		// Match: :contains('foo')
+		/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,
+
+		// Match: :even, :last-chlid, #id, .class
+		new RegExp("^([:.#]*)(" + chars + "+)")
+	],
+
+	multiFilter: function( expr, elems, not ) {
+		var old, cur = [];
+
+		while ( expr && expr != old ) {
+			old = expr;
+			var f = jQuery.filter( expr, elems, not );
+			expr = f.t.replace(/^\s*,\s*/, "" );
+			cur = not ? elems = f.r : jQuery.merge( cur, f.r );
+		}
+
+		return cur;
+	},
+
+	find: function( t, context ) {
+		// Quickly handle non-string expressions
+		if ( typeof t != "string" )
+			return [ t ];
+
+		// Make sure that the context is a DOM Element
+		if ( context && !context.nodeType )
+			context = null;
+
+		// Set the correct context (if none is provided)
+		context = context || document;
+
+		// Initialize the search
+		var ret = [context], done = [], last;
+
+		// Continue while a selector expression exists, and while
+		// we're no longer looping upon ourselves
+		while ( t && last != t ) {
+			var r = [];
+			last = t;
+
+			t = jQuery.trim(t);
+
+			var foundToken = false;
+
+			// An attempt at speeding up child selectors that
+			// point to a specific element tag
+			var re = quickChild;
+			var m = re.exec(t);
+
+			if ( m ) {
+				var nodeName = m[1].toUpperCase();
+
+				// Perform our own iteration and filter
+				for ( var i = 0; ret[i]; i++ )
+					for ( var c = ret[i].firstChild; c; c = c.nextSibling )
+						if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName.toUpperCase()) )
+							r.push( c );
+
+				ret = r;
+				t = t.replace( re, "" );
+				if ( t.indexOf(" ") == 0 ) continue;
+				foundToken = true;
+			} else {
+				re = /^([>+~])\s*(\w*)/i;
+
+				if ( (m = re.exec(t)) != null ) {
+					r = [];
+
+					var nodeName = m[2], merge = {};
+					m = m[1];
+
+					for ( var j = 0, rl = ret.length; j < rl; j++ ) {
+						var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
+						for ( ; n; n = n.nextSibling )
+							if ( n.nodeType == 1 ) {
+								var id = jQuery.data(n);
+
+								if ( m == "~" && merge[id] ) break;
+								
+								if (!nodeName || n.nodeName.toUpperCase() == nodeName.toUpperCase() ) {
+									if ( m == "~" ) merge[id] = true;
+									r.push( n );
+								}
+								
+								if ( m == "+" ) break;
+							}
+					}
+
+					ret = r;
+
+					// And remove the token
+					t = jQuery.trim( t.replace( re, "" ) );
+					foundToken = true;
+				}
+			}
+
+			// See if there's still an expression, and that we haven't already
+			// matched a token
+			if ( t && !foundToken ) {
+				// Handle multiple expressions
+				if ( !t.indexOf(",") ) {
+					// Clean the result set
+					if ( context == ret[0] ) ret.shift();
+
+					// Merge the result sets
+					done = jQuery.merge( done, ret );
+
+					// Reset the context
+					r = ret = [context];
+
+					// Touch up the selector string
+					t = " " + t.substr(1,t.length);
+
+				} else {
+					// Optimize for the case nodeName#idName
+					var re2 = quickID;
+					var m = re2.exec(t);
+					
+					// Re-organize the results, so that they're consistent
+					if ( m ) {
+					   m = [ 0, m[2], m[3], m[1] ];
+
+					} else {
+						// Otherwise, do a traditional filter check for
+						// ID, class, and element selectors
+						re2 = quickClass;
+						m = re2.exec(t);
+					}
+
+					m[2] = m[2].replace(/\\/g, "");
+
+					var elem = ret[ret.length-1];
+
+					// Try to do a global search by ID, where we can
+					if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
+						// Optimization for HTML document case
+						var oid = elem.getElementById(m[2]);
+						
+						// Do a quick check for the existence of the actual ID attribute
+						// to avoid selecting by the name attribute in IE
+						// also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
+						if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
+							oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
+
+						// Do a quick check for node name (where applicable) so
+						// that div#foo searches will be really fast
+						ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
+					} else {
+						// We need to find all descendant elements
+						for ( var i = 0; ret[i]; i++ ) {
+							// Grab the tag name being searched for
+							var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];
+
+							// Handle IE7 being really dumb about <object>s
+							if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
+								tag = "param";
+
+							r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
+						}
+
+						// It's faster to filter by class and be done with it
+						if ( m[1] == "." )
+							r = jQuery.classFilter( r, m[2] );
+
+						// Same with ID filtering
+						if ( m[1] == "#" ) {
+							var tmp = [];
+
+							// Try to find the element with the ID
+							for ( var i = 0; r[i]; i++ )
+								if ( r[i].getAttribute("id") == m[2] ) {
+									tmp = [ r[i] ];
+									break;
+								}
+
+							r = tmp;
+						}
+
+						ret = r;
+					}
+
+					t = t.replace( re2, "" );
+				}
+
+			}
+
+			// If a selector string still exists
+			if ( t ) {
+				// Attempt to filter it
+				var val = jQuery.filter(t,r);
+				ret = r = val.r;
+				t = jQuery.trim(val.t);
+			}
+		}
+
+		// An error occurred with the selector;
+		// just return an empty set instead
+		if ( t )
+			ret = [];
+
+		// Remove the root context
+		if ( ret && context == ret[0] )
+			ret.shift();
+
+		// And combine the results
+		done = jQuery.merge( done, ret );
+
+		return done;
+	},
+
+	classFilter: function(r,m,not){
+		m = " " + m + " ";
+		var tmp = [];
+		for ( var i = 0; r[i]; i++ ) {
+			var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
+			if ( !not && pass || not && !pass )
+				tmp.push( r[i] );
+		}
+		return tmp;
+	},
+
+	filter: function(t,r,not) {
+		var last;
+
+		// Look for common filter expressions
+		while ( t  && t != last ) {
+			last = t;
+
+			var p = jQuery.parse, m;
+
+			for ( var i = 0; p[i]; i++ ) {
+				m = p[i].exec( t );
+
+				if ( m ) {
+					// Remove what we just matched
+					t = t.substring( m[0].length );
+
+					m[2] = m[2].replace(/\\/g, "");
+					break;
+				}
+			}
+
+			if ( !m )
+				break;
+
+			// :not() is a special case that can be optimized by
+			// keeping it out of the expression list
+			if ( m[1] == ":" && m[2] == "not" )
+				r = jQuery.filter(m[3], r, true).r;
+
+			// We can get a big speed boost by filtering by class here
+			else if ( m[1] == "." )
+				r = jQuery.classFilter(r, m[2], not);
+
+			else if ( m[1] == "[" ) {
+				var tmp = [], type = m[3];
+				
+				for ( var i = 0, rl = r.length; i < rl; i++ ) {
+					var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
+					
+					if ( z == null || /href|src|selected/.test(m[2]) )
+						z = jQuery.attr(a,m[2]) || '';
+
+					if ( (type == "" && !!z ||
+						 type == "=" && z == m[5] ||
+						 type == "!=" && z != m[5] ||
+						 type == "^=" && z && !z.indexOf(m[5]) ||
+						 type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
+						 (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
+							tmp.push( a );
+				}
+				
+				r = tmp;
+
+			// We can get a speed boost by handling nth-child here
+			} else if ( m[1] == ":" && m[2] == "nth-child" ) {
+				var merge = {}, tmp = [],
+					test = /(\d*)n\+?(\d*)/.exec(
+						m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
+						!/\D/.test(m[3]) && "n+" + m[3] || m[3]),
+					first = (test[1] || 1) - 0, last = test[2] - 0;
+
+				for ( var i = 0, rl = r.length; i < rl; i++ ) {
+					var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);
+
+					if ( !merge[id] ) {
+						var c = 1;
+
+						for ( var n = parentNode.firstChild; n; n = n.nextSibling )
+							if ( n.nodeType == 1 )
+								n.nodeIndex = c++;
+
+						merge[id] = true;
+					}
+
+					var add = false;
+
+					if ( first == 1 ) {
+						if ( last == 0 || node.nodeIndex == last )
+							add = true;
+					} else if ( (node.nodeIndex + last) % first == 0 )
+						add = true;
+
+					if ( add ^ not )
+						tmp.push( node );
+				}
+
+				r = tmp;
+
+			// Otherwise, find the expression to execute
+			} else {
+				var f = jQuery.expr[m[1]];
+				if ( typeof f != "string" )
+					f = jQuery.expr[m[1]][m[2]];
+
+				// Build a custom macro to enclose it
+				f = eval("false||function(a,i){return " + f + "}");
+
+				// Execute it against the current filter
+				r = jQuery.grep( r, f, not );
+			}
+		}
+
+		// Return an array of filtered elements (r)
+		// and the modified expression string (t)
+		return { r: r, t: t };
+	},
+
+	dir: function( elem, dir ){
+		var matched = [];
+		var cur = elem[dir];
+		while ( cur && cur != document ) {
+			if ( cur.nodeType == 1 )
+				matched.push( cur );
+			cur = cur[dir];
+		}
+		return matched;
+	},
+	
+	nth: function(cur,result,dir,elem){
+		result = result || 1;
+		var num = 0;
+
+		for ( ; cur; cur = cur[dir] )
+			if ( cur.nodeType == 1 && ++num == result )
+				break;
+
+		return cur;
+	},
+	
+	sibling: function( n, elem ) {
+		var r = [];
+
+		for ( ; n; n = n.nextSibling ) {
+			if ( n.nodeType == 1 && (!elem || n != elem) )
+				r.push( n );
+		}
+
+		return r;
+	}
+});
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code orignated from 
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+	// Bind an event to an element
+	// Original by Dean Edwards
+	add: function(element, type, handler, data) {
+		// For whatever reason, IE has trouble passing the window object
+		// around, causing it to be cloned in the process
+		if ( jQuery.browser.msie && element.setInterval != undefined )
+			element = window;
+
+		// Make sure that the function being executed has a unique ID
+		if ( !handler.guid )
+			handler.guid = this.guid++;
+			
+		// if data is passed, bind to handler 
+		if( data != undefined ) { 
+        		// Create temporary function pointer to original handler 
+			var fn = handler; 
+
+			// Create unique handler function, wrapped around original handler 
+			handler = function() { 
+				// Pass arguments and context to original handler 
+				return fn.apply(this, arguments); 
+			};
+
+			// Store data in unique handler 
+			handler.data = data;
+
+			// Set the guid of unique handler to the same of original handler, so it can be removed 
+			handler.guid = fn.guid;
+		}
+
+		// Namespaced event handlers
+		var parts = type.split(".");
+		type = parts[0];
+		handler.type = parts[1];
+
+		// Init the element's event structure
+		var events = jQuery.data(element, "events") || jQuery.data(element, "events", {});
+		
+		var handle = jQuery.data(element, "handle", function(){
+			// returned undefined or false
+			var val;
+
+			// Handle the second event of a trigger and when
+			// an event is called after a page has unloaded
+			if ( typeof jQuery == "undefined" || jQuery.event.triggered )
+				return val;
+			
+			val = jQuery.event.handle.apply(element, arguments);
+			
+			return val;
+		});
+
+		// Get the current list of functions bound to this event
+		var handlers = events[type];
+
+		// Init the event handler queue
+		if (!handlers) {
+			handlers = events[type] = {};	
+			
+			// And bind the global event handler to the element
+			if (element.addEventListener)
+				element.addEventListener(type, handle, false);
+			else
+				element.attachEvent("on" + type, handle);
+		}
+
+		// Add the function to the element's handler list
+		handlers[handler.guid] = handler;
+
+		// Keep track of which events have been used, for global triggering
+		this.global[type] = true;
+	},
+
+	guid: 1,
+	global: {},
+
+	// Detach an event or set of events from an element
+	remove: function(element, type, handler) {
+		var events = jQuery.data(element, "events"), ret, index;
+
+		// Namespaced event handlers
+		if ( typeof type == "string" ) {
+			var parts = type.split(".");
+			type = parts[0];
+		}
+
+		if ( events ) {
+			// type is actually an event object here
+			if ( type && type.type ) {
+				handler = type.handler;
+				type = type.type;
+			}
+			
+			if ( !type ) {
+				for ( type in events )
+					this.remove( element, type );
+
+			} else if ( events[type] ) {
+				// remove the given handler for the given type
+				if ( handler )
+					delete events[type][handler.guid];
+				
+				// remove all handlers for the given type
+				else
+					for ( handler in events[type] )
+						// Handle the removal of namespaced events
+						if ( !parts[1] || events[type][handler].type == parts[1] )
+							delete events[type][handler];
+
+				// remove generic event handler if no more handlers exist
+				for ( ret in events[type] ) break;
+				if ( !ret ) {
+					if (element.removeEventListener)
+						element.removeEventListener(type, jQuery.data(element, "handle"), false);
+					else
+						element.detachEvent("on" + type, jQuery.data(element, "handle"));
+					ret = null;
+					delete events[type];
+				}
+			}
+
+			// Remove the expando if it's no longer used
+			for ( ret in events ) break;
+			if ( !ret ) {
+				jQuery.removeData( element, "events" );
+				jQuery.removeData( element, "handle" );
+			}
+		}
+	},
+
+	trigger: function(type, data, element, donative, extra) {
+		// Clone the incoming data, if any
+		data = jQuery.makeArray(data || []);
+
+		// Handle a global trigger
+		if ( !element ) {
+			// Only trigger if we've ever bound an event for it
+			if ( this.global[type] )
+				jQuery("*").add([window, document]).trigger(type, data);
+
+		// Handle triggering a single element
+		} else {
+			var val, ret, fn = jQuery.isFunction( element[ type ] || null ),
+				// Check to see if we need to provide a fake event, or not
+				evt = !data[0] || !data[0].preventDefault;
+			
+			// Pass along a fake event
+			if ( evt )
+				data.unshift( this.fix({ type: type, target: element }) );
+
+			// Enforce the right trigger type
+			data[0].type = type;
+
+			// Trigger the event
+			if ( jQuery.isFunction( jQuery.data(element, "handle") ) )
+				val = jQuery.data(element, "handle").apply( element, data );
+
+			// Handle triggering native .onfoo handlers
+			if ( !fn && element["on"+type] && element["on"+type].apply( element, data ) === false )
+				val = false;
+
+			// Extra functions don't get the custom event object
+			if ( evt )
+				data.shift();
+
+			// Handle triggering of extra function
+			if ( extra && extra.apply( element, data ) === false )
+				val = false;
+
+			// Trigger the native events (except for clicks on links)
+			if ( fn && donative !== false && val !== false && !(jQuery.nodeName(element, 'a') && type == "click") ) {
+				this.triggered = true;
+				element[ type ]();
+			}
+
+			this.triggered = false;
+		}
+
+		return val;
+	},
+
+	handle: function(event) {
+		// returned undefined or false
+		var val;
+
+		// Empty object is for triggered events with no data
+		event = jQuery.event.fix( event || window.event || {} ); 
+
+		// Namespaced event handlers
+		var parts = event.type.split(".");
+		event.type = parts[0];
+
+		var c = jQuery.data(this, "events") && jQuery.data(this, "events")[event.type], args = Array.prototype.slice.call( arguments, 1 );
+		args.unshift( event );
+
+		for ( var j in c ) {
+			// Pass in a reference to the handler function itself
+			// So that we can later remove it
+			args[0].handler = c[j];
+			args[0].data = c[j].data;
+
+			// Filter the functions by class
+			if ( !parts[1] || c[j].type == parts[1] ) {
+				var tmp = c[j].apply( this, args );
+
+				if ( val !== false )
+					val = tmp;
+
+				if ( tmp === false ) {
+					event.preventDefault();
+					event.stopPropagation();
+				}
+			}
+		}
+
+		// Clean up added properties in IE to prevent memory leak
+		if (jQuery.browser.msie)
+			event.target = event.preventDefault = event.stopPropagation =
+				event.handler = event.data = null;
+
+		return val;
+	},
+
+	fix: function(event) {
+		// store a copy of the original event object 
+		// and clone to set read-only properties
+		var originalEvent = event;
+		event = jQuery.extend({}, originalEvent);
+		
+		// add preventDefault and stopPropagation since 
+		// they will not work on the clone
+		event.preventDefault = function() {
+			// if preventDefault exists run it on the original event
+			if (originalEvent.preventDefault)
+				originalEvent.preventDefault();
+			// otherwise set the returnValue property of the original event to false (IE)
+			originalEvent.returnValue = false;
+		};
+		event.stopPropagation = function() {
+			// if stopPropagation exists run it on the original event
+			if (originalEvent.stopPropagation)
+				originalEvent.stopPropagation();
+			// otherwise set the cancelBubble property of the original event to true (IE)
+			originalEvent.cancelBubble = true;
+		};
+		
+		// Fix target property, if necessary
+		if ( !event.target && event.srcElement )
+			event.target = event.srcElement;
+				
+		// check if target is a textnode (safari)
+		if (jQuery.browser.safari && event.target.nodeType == 3)
+			event.target = originalEvent.target.parentNode;
+
+		// Add relatedTarget, if necessary
+		if ( !event.relatedTarget && event.fromElement )
+			event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
+
+		// Calculate pageX/Y if missing and clientX/Y available
+		if ( event.pageX == null && event.clientX != null ) {
+			var e = document.documentElement, b = document.body;
+			event.pageX = event.clientX + (e && e.scrollLeft || b.scrollLeft || 0);
+			event.pageY = event.clientY + (e && e.scrollTop || b.scrollTop || 0);
+		}
+			
+		// Add which for key events
+		if ( !event.which && (event.charCode || event.keyCode) )
+			event.which = event.charCode || event.keyCode;
+		
+		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+		if ( !event.metaKey && event.ctrlKey )
+			event.metaKey = event.ctrlKey;
+
+		// Add which for click: 1 == left; 2 == middle; 3 == right
+		// Note: button is not normalized, so don't use it
+		if ( !event.which && event.button )
+			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+			
+		return event;
+	}
+};
+
+jQuery.fn.extend({
+	bind: function( type, data, fn ) {
+		return type == "unload" ? this.one(type, data, fn) : this.each(function(){
+			jQuery.event.add( this, type, fn || data, fn && data );
+		});
+	},
+	
+	one: function( type, data, fn ) {
+		return this.each(function(){
+			jQuery.event.add( this, type, function(event) {
+				jQuery(this).unbind(event);
+				return (fn || data).apply( this, arguments);
+			}, fn && data);
+		});
+	},
+
+	unbind: function( type, fn ) {
+		return this.each(function(){
+			jQuery.event.remove( this, type, fn );
+		});
+	},
+
+	trigger: function( type, data, fn ) {
+		return this.each(function(){
+			jQuery.event.trigger( type, data, this, true, fn );
+		});
+	},
+
+	triggerHandler: function( type, data, fn ) {
+		if ( this[0] )
+			return jQuery.event.trigger( type, data, this[0], false, fn );
+	},
+
+	toggle: function() {
+		// Save reference to arguments for access in closure
+		var a = arguments;
+
+		return this.click(function(e) {
+			// Figure out which function to execute
+			this.lastToggle = 0 == this.lastToggle ? 1 : 0;
+			
+			// Make sure that clicks stop
+			e.preventDefault();
+			
+			// and execute the function
+			return a[this.lastToggle].apply( this, [e] ) || false;
+		});
+	},
+
+	hover: function(f,g) {
+		
+		// A private function for handling mouse 'hovering'
+		function handleHover(e) {
+			// Check if mouse(over|out) are still within the same parent element
+			var p = e.relatedTarget;
+	
+			// Traverse up the tree
+			while ( p && p != this ) try { p = p.parentNode; } catch(e) { p = this; };
+			
+			// If we actually just moused on to a sub-element, ignore it
+			if ( p == this ) return false;
+			
+			// Execute the right function
+			return (e.type == "mouseover" ? f : g).apply(this, [e]);
+		}
+		
+		// Bind the function to the two event listeners
+		return this.mouseover(handleHover).mouseout(handleHover);
+	},
+	
+	ready: function(f) {
+		// Attach the listeners
+		bindReady();
+
+		// If the DOM is already ready
+		if ( jQuery.isReady )
+			// Execute the function immediately
+			f.apply( document, [jQuery] );
+			
+		// Otherwise, remember the function for later
+		else
+			// Add the function to the wait list
+			jQuery.readyList.push( function() { return f.apply(this, [jQuery]); } );
+	
+		return this;
+	}
+});
+
+jQuery.extend({
+	/*
+	 * All the code that makes DOM Ready work nicely.
+	 */
+	isReady: false,
+	readyList: [],
+	
+	// Handle when the DOM is ready
+	ready: function() {
+		// Make sure that the DOM is not already loaded
+		if ( !jQuery.isReady ) {
+			// Remember that the DOM is ready
+			jQuery.isReady = true;
+			
+			// If there are functions bound, to execute
+			if ( jQuery.readyList ) {
+				// Execute all of them
+				jQuery.each( jQuery.readyList, function(){
+					this.apply( document );
+				});
+				
+				// Reset the list of functions
+				jQuery.readyList = null;
+			}
+			// Remove event listener to avoid memory leak
+			if ( jQuery.browser.mozilla || jQuery.browser.opera )
+				document.removeEventListener( "DOMContentLoaded", jQuery.ready, false );
+			
+			// Remove script element used by IE hack
+			if( !window.frames.length ) // don't remove if frames are present (#1187)
+				jQuery(window).load(function(){ jQuery("#__ie_init").remove(); });
+		}
+	}
+});
+
+jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
+	"mousedown,mouseup,mousemove,mouseover,mouseout,change,select," + 
+	"submit,keydown,keypress,keyup,error").split(","), function(i,o){
+	
+	// Handle event binding
+	jQuery.fn[o] = function(f){
+		return f ? this.bind(o, f) : this.trigger(o);
+	};
+});
+
+var readyBound = false;
+
+function bindReady(){
+	if ( readyBound ) return;
+	readyBound = true;
+
+	// If Mozilla is used
+	if ( jQuery.browser.mozilla || jQuery.browser.opera )
+		// Use the handy event callback
+		document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
+	
+	// If IE is used, use the excellent hack by Matthias Miller
+	// http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited
+	else if ( jQuery.browser.msie ) {
+	
+		// Only works if you document.write() it
+		document.write("<scr" + "ipt id=__ie_init defer=true " + 
+			"src=//:><\/script>");
+	
+		// Use the defer script hack
+		var script = document.getElementById("__ie_init");
+		
+		// script does not exist if jQuery is loaded dynamically
+		if ( script ) 
+			script.onreadystatechange = function() {
+				if ( this.readyState != "complete" ) return;
+				jQuery.ready();
+			};
+	
+		// Clear from memory
+		script = null;
+	
+	// If Safari  is used
+	} else if ( jQuery.browser.safari )
+		// Continually check to see if the document.readyState is valid
+		jQuery.safariTimer = setInterval(function(){
+			// loaded and complete are both valid states
+			if ( document.readyState == "loaded" || 
+				document.readyState == "complete" ) {
+	
+				// If either one are found, remove the timer
+				clearInterval( jQuery.safariTimer );
+				jQuery.safariTimer = null;
+	
+				// and execute any waiting functions
+				jQuery.ready();
+			}
+		}, 10); 
+
+	// A fallback to window.onload, that will always work
+	jQuery.event.add( window, "load", jQuery.ready );
+}
+jQuery.fn.extend({
+	load: function( url, params, callback ) {
+		if ( jQuery.isFunction( url ) )
+			return this.bind("load", url);
+
+		var off = url.indexOf(" ");
+		if ( off >= 0 ) {
+			var selector = url.slice(off, url.length);
+			url = url.slice(0, off);
+		}
+
+		callback = callback || function(){};
+
+		// Default to a GET request
+		var type = "GET";
+
+		// If the second parameter was provided
+		if ( params )
+			// If it's a function
+			if ( jQuery.isFunction( params ) ) {
+				// We assume that it's the callback
+				callback = params;
+				params = null;
+
+			// Otherwise, build a param string
+			} else {
+				params = jQuery.param( params );
+				type = "POST";
+			}
+
+		var self = this;
+
+		// Request the remote document
+		jQuery.ajax({
+			url: url,
+			type: type,
+			data: params,
+			complete: function(res, status){
+				// If successful, inject the HTML into all the matched elements
+				if ( status == "success" || status == "notmodified" )
+					// See if a selector was specified
+					self.html( selector ?
+						// Create a dummy div to hold the results
+						jQuery("<div/>")
+							// inject the contents of the document in, removing the scripts
+							// to avoid any 'Permission Denied' errors in IE
+							.append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
+
+							// Locate the specified elements
+							.find(selector) :
+
+						// If not, just inject the full result
+						res.responseText );
+
+				// Add delay to account for Safari's delay in globalEval
+				setTimeout(function(){
+					self.each( callback, [res.responseText, status, res] );
+				}, 13);
+			}
+		});
+		return this;
+	},
+
+	serialize: function() {
+		return jQuery.param(this.serializeArray());
+	},
+	serializeArray: function() {
+		return this.map(function(){
+			return jQuery.nodeName(this, "form") ?
+				jQuery.makeArray(this.elements) : this;
+		})
+		.filter(function(){
+			return this.name && !this.disabled && 
+				(this.checked || /select|textarea/i.test(this.nodeName) || 
+					/text|hidden|password/i.test(this.type));
+		})
+		.map(function(i, elem){
+			var val = jQuery(this).val();
+			return val == null ? null :
+				val.constructor == Array ?
+					jQuery.map( val, function(val, i){
+						return {name: elem.name, value: val};
+					}) :
+					{name: elem.name, value: val};
+		}).get();
+	}
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
+	jQuery.fn[o] = function(f){
+		return this.bind(o, f);
+	};
+});
+
+var jsc = (new Date).getTime();
+
+jQuery.extend({
+	get: function( url, data, callback, type ) {
+		// shift arguments if data argument was ommited
+		if ( jQuery.isFunction( data ) ) {
+			callback = data;
+			data = null;
+		}
+		
+		return jQuery.ajax({
+			type: "GET",
+			url: url,
+			data: data,
+			success: callback,
+			dataType: type
+		});
+	},
+
+	getScript: function( url, callback ) {
+		return jQuery.get(url, null, callback, "script");
+	},
+
+	getJSON: function( url, data, callback ) {
+		return jQuery.get(url, data, callback, "json");
+	},
+
+	post: function( url, data, callback, type ) {
+		if ( jQuery.isFunction( data ) ) {
+			callback = data;
+			data = {};
+		}
+
+		return jQuery.ajax({
+			type: "POST",
+			url: url,
+			data: data,
+			success: callback,
+			dataType: type
+		});
+	},
+
+	ajaxSetup: function( settings ) {
+		jQuery.extend( jQuery.ajaxSettings, settings );
+	},
+
+	ajaxSettings: {
+		global: true,
+		type: "GET",
+		timeout: 0,
+		contentType: "application/x-www-form-urlencoded",
+		processData: true,
+		async: true,
+		data: null
+	},
+	
+	// Last-Modified header cache for next request
+	lastModified: {},
+
+	ajax: function( s ) {
+		var jsonp, jsre = /=(\?|%3F)/g, status, data;
+
+		// Extend the settings, but re-extend 's' so that it can be
+		// checked again later (in the test suite, specifically)
+		s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
+
+		// convert data if not already a string
+		if ( s.data && s.processData && typeof s.data != "string" )
+			s.data = jQuery.param(s.data);
+
+		// Handle JSONP Parameter Callbacks
+		if ( s.dataType == "jsonp" ) {
+			if ( s.type.toLowerCase() == "get" ) {
+				if ( !s.url.match(jsre) )
+					s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
+			} else if ( !s.data || !s.data.match(jsre) )
+				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
+			s.dataType = "json";
+		}
+
+		// Build temporary JSONP function
+		if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
+			jsonp = "jsonp" + jsc++;
+
+			// Replace the =? sequence both in the query string and the data
+			if ( s.data )
+				s.data = s.data.replace(jsre, "=" + jsonp);
+			s.url = s.url.replace(jsre, "=" + jsonp);
+
+			// We need to make sure
+			// that a JSONP style response is executed properly
+			s.dataType = "script";
+
+			// Handle JSONP-style loading
+			window[ jsonp ] = function(tmp){
+				data = tmp;
+				success();
+				complete();
+				// Garbage collect
+				window[ jsonp ] = undefined;
+				try{ delete window[ jsonp ]; } catch(e){}
+			};
+		}
+
+		if ( s.dataType == "script" && s.cache == null )
+			s.cache = false;
+
+		if ( s.cache === false && s.type.toLowerCase() == "get" )
+			s.url += (s.url.match(/\?/) ? "&" : "?") + "_=" + (new Date()).getTime();
+
+		// If data is available, append data to url for get requests
+		if ( s.data && s.type.toLowerCase() == "get" ) {
+			s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
+
+			// IE likes to send both get and post data, prevent this
+			s.data = null;
+		}
+
+		// Watch for a new set of requests
+		if ( s.global && ! jQuery.active++ )
+			jQuery.event.trigger( "ajaxStart" );
+
+		// If we're requesting a remote document
+		// and trying to load JSON or Script
+		if ( !s.url.indexOf("http") && s.dataType == "script" ) {
+			var head = document.getElementsByTagName("head")[0];
+			var script = document.createElement("script");
+			script.src = s.url;
+
+			// Handle Script loading
+			if ( !jsonp && (s.success || s.complete) ) {
+				var done = false;
+
+				// Attach handlers for all browsers
+				script.onload = script.onreadystatechange = function(){
+					if ( !done && (!this.readyState || 
+							this.readyState == "loaded" || this.readyState == "complete") ) {
+						done = true;
+						success();
+						complete();
+						head.removeChild( script );
+					}
+				};
+			}
+
+			head.appendChild(script);
+
+			// We handle everything using the script element injection
+			return;
+		}
+
+		var requestDone = false;
+
+		// Create the request object; Microsoft failed to properly
+		// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
+		var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
+
+		// Open the socket
+		xml.open(s.type, s.url, s.async);
+
+		// Set the correct header, if data is being sent
+		if ( s.data )
+			xml.setRequestHeader("Content-Type", s.contentType);
+
+		// Set the If-Modified-Since header, if ifModified mode.
+		if ( s.ifModified )
+			xml.setRequestHeader("If-Modified-Since",
+				jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
+
+		// Set header so the called script knows that it's an XMLHttpRequest
+		xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+
+		// Allow custom headers/mimetypes
+		if ( s.beforeSend )
+			s.beforeSend(xml);
+			
+		if ( s.global )
+		    jQuery.event.trigger("ajaxSend", [xml, s]);
+
+		// Wait for a response to come back
+		var onreadystatechange = function(isTimeout){
+			// The transfer is complete and the data is available, or the request timed out
+			if ( !requestDone && xml && (xml.readyState == 4 || isTimeout == "timeout") ) {
+				requestDone = true;
+				
+				// clear poll interval
+				if (ival) {
+					clearInterval(ival);
+					ival = null;
+				}
+				
+				status = isTimeout == "timeout" && "timeout" ||
+					!jQuery.httpSuccess( xml ) && "error" ||
+					s.ifModified && jQuery.httpNotModified( xml, s.url ) && "notmodified" ||
+					"success";
+
+				if ( status == "success" ) {
+					// Watch for, and catch, XML document parse errors
+					try {
+						// process the data (runs the xml through httpData regardless of callback)
+						data = jQuery.httpData( xml, s.dataType );
+					} catch(e) {
+						status = "parsererror";
+					}
+				}
+
+				// Make sure that the request was successful or notmodified
+				if ( status == "success" ) {
+					// Cache Last-Modified header, if ifModified mode.
+					var modRes;
+					try {
+						modRes = xml.getResponseHeader("Last-Modified");
+					} catch(e) {} // swallow exception thrown by FF if header is not available
+	
+					if ( s.ifModified && modRes )
+						jQuery.lastModified[s.url] = modRes;
+
+					// JSONP handles its own success callback
+					if ( !jsonp )
+						success();	
+				} else
+					jQuery.handleError(s, xml, status);
+
+				// Fire the complete handlers
+				complete();
+
+				// Stop memory leaks
+				if ( s.async )
+					xml = null;
+			}
+		};
+		
+		if ( s.async ) {
+			// don't attach the handler to the request, just poll it instead
+			var ival = setInterval(onreadystatechange, 13); 
+
+			// Timeout checker
+			if ( s.timeout > 0 )
+				setTimeout(function(){
+					// Check to see if the request is still happening
+					if ( xml ) {
+						// Cancel the request
+						xml.abort();
+	
+						if( !requestDone )
+							onreadystatechange( "timeout" );
+					}
+				}, s.timeout);
+		}
+			
+		// Send the data
+		try {
+			xml.send(s.data);
+		} catch(e) {
+			jQuery.handleError(s, xml, null, e);
+		}
+		
+		// firefox 1.5 doesn't fire statechange for sync requests
+		if ( !s.async )
+			onreadystatechange();
+		
+		// return XMLHttpRequest to allow aborting the request etc.
+		return xml;
+
+		function success(){
+			// If a local callback was specified, fire it and pass it the data
+			if ( s.success )
+				s.success( data, status );
+
+			// Fire the global callback
+			if ( s.global )
+				jQuery.event.trigger( "ajaxSuccess", [xml, s] );
+		}
+
+		function complete(){
+			// Process result
+			if ( s.complete )
+				s.complete(xml, status);
+
+			// The request was completed
+			if ( s.global )
+				jQuery.event.trigger( "ajaxComplete", [xml, s] );
+
+			// Handle the global AJAX counter
+			if ( s.global && ! --jQuery.active )
+				jQuery.event.trigger( "ajaxStop" );
+		}
+	},
+
+	handleError: function( s, xml, status, e ) {
+		// If a local callback was specified, fire it
+		if ( s.error ) s.error( xml, status, e );
+
+		// Fire the global callback
+		if ( s.global )
+			jQuery.event.trigger( "ajaxError", [xml, s, e] );
+	},
+
+	// Counter for holding the number of active queries
+	active: 0,
+
+	// Determines if an XMLHttpRequest was successful or not
+	httpSuccess: function( r ) {
+		try {
+			return !r.status && location.protocol == "file:" ||
+				( r.status >= 200 && r.status < 300 ) || r.status == 304 ||
+				jQuery.browser.safari && r.status == undefined;
+		} catch(e){}
+		return false;
+	},
+
+	// Determines if an XMLHttpRequest returns NotModified
+	httpNotModified: function( xml, url ) {
+		try {
+			var xmlRes = xml.getResponseHeader("Last-Modified");
+
+			// Firefox always returns 200. check Last-Modified date
+			return xml.status == 304 || xmlRes == jQuery.lastModified[url] ||
+				jQuery.browser.safari && xml.status == undefined;
+		} catch(e){}
+		return false;
+	},
+
+	httpData: function( r, type ) {
+		var ct = r.getResponseHeader("content-type");
+		var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0;
+		var data = xml ? r.responseXML : r.responseText;
+
+		if ( xml && data.documentElement.tagName == "parsererror" )
+			throw "parsererror";
+
+		// If the type is "script", eval it in global context
+		if ( type == "script" )
+			jQuery.globalEval( data );
+
+		// Get the JavaScript object, if JSON is used.
+		if ( type == "json" )
+			data = eval("(" + data + ")");
+
+		return data;
+	},
+
+	// Serialize an array of form elements or a set of
+	// key/values into a query string
+	param: function( a ) {
+		var s = [];
+
+		// If an array was passed in, assume that it is an array
+		// of form elements
+		if ( a.constructor == Array || a.jquery )
+			// Serialize the form elements
+			jQuery.each( a, function(){
+				s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) );
+			});
+
+		// Otherwise, assume that it's an object of key/value pairs
+		else
+			// Serialize the key/values
+			for ( var j in a )
+				// If the value is an array then the key names need to be repeated
+				if ( a[j] && a[j].constructor == Array )
+					jQuery.each( a[j], function(){
+						s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) );
+					});
+				else
+					s.push( encodeURIComponent(j) + "=" + encodeURIComponent( a[j] ) );
+
+		// Return the resulting serialization
+		return s.join("&").replace(/%20/g, "+");
+	}
+
+});
+jQuery.fn.extend({
+	show: function(speed,callback){
+		return speed ?
+			this.animate({
+				height: "show", width: "show", opacity: "show"
+			}, speed, callback) :
+			
+			this.filter(":hidden").each(function(){
+				this.style.display = this.oldblock ? this.oldblock : "";
+				if ( jQuery.css(this,"display") == "none" )
+					this.style.display = "block";
+			}).end();
+	},
+	
+	hide: function(speed,callback){
+		return speed ?
+			this.animate({
+				height: "hide", width: "hide", opacity: "hide"
+			}, speed, callback) :
+			
+			this.filter(":visible").each(function(){
+				this.oldblock = this.oldblock || jQuery.css(this,"display");
+				if ( this.oldblock == "none" )
+					this.oldblock = "block";
+				this.style.display = "none";
+			}).end();
+	},
+
+	// Save the old toggle function
+	_toggle: jQuery.fn.toggle,
+	
+	toggle: function( fn, fn2 ){
+		return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
+			this._toggle( fn, fn2 ) :
+			fn ?
+				this.animate({
+					height: "toggle", width: "toggle", opacity: "toggle"
+				}, fn, fn2) :
+				this.each(function(){
+					jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
+				});
+	},
+	
+	slideDown: function(speed,callback){
+		return this.animate({height: "show"}, speed, callback);
+	},
+	
+	slideUp: function(speed,callback){
+		return this.animate({height: "hide"}, speed, callback);
+	},
+
+	slideToggle: function(speed, callback){
+		return this.animate({height: "toggle"}, speed, callback);
+	},
+	
+	fadeIn: function(speed, callback){
+		return this.animate({opacity: "show"}, speed, callback);
+	},
+	
+	fadeOut: function(speed, callback){
+		return this.animate({opacity: "hide"}, speed, callback);
+	},
+	
+	fadeTo: function(speed,to,callback){
+		return this.animate({opacity: to}, speed, callback);
+	},
+	
+	animate: function( prop, speed, easing, callback ) {
+		var opt = jQuery.speed(speed, easing, callback);
+
+		return this[ opt.queue === false ? "each" : "queue" ](function(){
+			opt = jQuery.extend({}, opt);
+			var hidden = jQuery(this).is(":hidden"), self = this;
+			
+			for ( var p in prop ) {
+				if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
+					return jQuery.isFunction(opt.complete) && opt.complete.apply(this);
+
+				if ( p == "height" || p == "width" ) {
+					// Store display property
+					opt.display = jQuery.css(this, "display");
+
+					// Make sure that nothing sneaks out
+					opt.overflow = this.style.overflow;
+				}
+			}
+
+			if ( opt.overflow != null )
+				this.style.overflow = "hidden";
+
+			opt.curAnim = jQuery.extend({}, prop);
+			
+			jQuery.each( prop, function(name, val){
+				var e = new jQuery.fx( self, opt, name );
+
+				if ( /toggle|show|hide/.test(val) )
+					e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
+				else {
+					var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
+						start = e.cur(true) || 0;
+
+					if ( parts ) {
+						var end = parseFloat(parts[2]),
+							unit = parts[3] || "px";
+
+						// We need to compute starting value
+						if ( unit != "px" ) {
+							self.style[ name ] = (end || 1) + unit;
+							start = ((end || 1) / e.cur(true)) * start;
+							self.style[ name ] = start + unit;
+						}
+
+						// If a +=/-= token was provided, we're doing a relative animation
+						if ( parts[1] )
+							end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
+
+						e.custom( start, end, unit );
+					} else
+						e.custom( start, val, "" );
+				}
+			});
+
+			// For JS strict compliance
+			return true;
+		});
+	},
+	
+	queue: function(type, fn){
+		if ( jQuery.isFunction(type) ) {
+			fn = type;
+			type = "fx";
+		}
+
+		if ( !type || (typeof type == "string" && !fn) )
+			return queue( this[0], type );
+
+		return this.each(function(){
+			if ( fn.constructor == Array )
+				queue(this, type, fn);
+			else {
+				queue(this, type).push( fn );
+			
+				if ( queue(this, type).length == 1 )
+					fn.apply(this);
+			}
+		});
+	},
+
+	stop: function(){
+		var timers = jQuery.timers;
+
+		return this.each(function(){
+			for ( var i = 0; i < timers.length; i++ )
+				if ( timers[i].elem == this )
+					timers.splice(i--, 1);
+		}).dequeue();
+	}
+
+});
+
+var queue = function( elem, type, array ) {
+	if ( !elem )
+		return;
+
+	var q = jQuery.data( elem, type + "queue" );
+
+	if ( !q || array )
+		q = jQuery.data( elem, type + "queue", 
+			array ? jQuery.makeArray(array) : [] );
+
+	return q;
+};
+
+jQuery.fn.dequeue = function(type){
+	type = type || "fx";
+
+	return this.each(function(){
+		var q = queue(this, type);
+
+		q.shift();
+
+		if ( q.length )
+			q[0].apply( this );
+	});
+};
+
+jQuery.extend({
+	
+	speed: function(speed, easing, fn) {
+		var opt = speed && speed.constructor == Object ? speed : {
+			complete: fn || !fn && easing || 
+				jQuery.isFunction( speed ) && speed,
+			duration: speed,
+			easing: fn && easing || easing && easing.constructor != Function && easing
+		};
+
+		opt.duration = (opt.duration && opt.duration.constructor == Number ? 
+			opt.duration : 
+			{ slow: 600, fast: 200 }[opt.duration]) || 400;
+	
+		// Queueing
+		opt.old = opt.complete;
+		opt.complete = function(){
+			jQuery(this).dequeue();
+			if ( jQuery.isFunction( opt.old ) )
+				opt.old.apply( this );
+		};
+	
+		return opt;
+	},
+	
+	easing: {
+		linear: function( p, n, firstNum, diff ) {
+			return firstNum + diff * p;
+		},
+		swing: function( p, n, firstNum, diff ) {
+			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+		}
+	},
+	
+	timers: [],
+
+	fx: function( elem, options, prop ){
+		this.options = options;
+		this.elem = elem;
+		this.prop = prop;
+
+		if ( !options.orig )
+			options.orig = {};
+	}
+
+});
+
+jQuery.fx.prototype = {
+
+	// Simple function for setting a style value
+	update: function(){
+		if ( this.options.step )
+			this.options.step.apply( this.elem, [ this.now, this ] );
+
+		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+
+		// Set display property to block for height/width animations
+		if ( this.prop == "height" || this.prop == "width" )
+			this.elem.style.display = "block";
+	},
+
+	// Get the current size
+	cur: function(force){
+		if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null )
+			return this.elem[ this.prop ];
+
+		var r = parseFloat(jQuery.curCSS(this.elem, this.prop, force));
+		return r && r > -10000 ? r : parseFloat(jQuery.css(this.elem, this.prop)) || 0;
+	},
+
+	// Start an animation from one number to another
+	custom: function(from, to, unit){
+		this.startTime = (new Date()).getTime();
+		this.start = from;
+		this.end = to;
+		this.unit = unit || this.unit || "px";
+		this.now = this.start;
+		this.pos = this.state = 0;
+		this.update();
+
+		var self = this;
+		function t(){
+			return self.step();
+		}
+
+		t.elem = this.elem;
+
+		jQuery.timers.push(t);
+
+		if ( jQuery.timers.length == 1 ) {
+			var timer = setInterval(function(){
+				var timers = jQuery.timers;
+				
+				for ( var i = 0; i < timers.length; i++ )
+					if ( !timers[i]() )
+						timers.splice(i--, 1);
+
+				if ( !timers.length )
+					clearInterval( timer );
+			}, 13);
+		}
+	},
+
+	// Simple 'show' function
+	show: function(){
+		// Remember where we started, so that we can go back to it later
+		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
+		this.options.show = true;
+
+		// Begin the animation
+		this.custom(0, this.cur());
+
+		// Make sure that we start at a small width/height to avoid any
+		// flash of content
+		if ( this.prop == "width" || this.prop == "height" )
+			this.elem.style[this.prop] = "1px";
+		
+		// Start by showing the element
+		jQuery(this.elem).show();
+	},
+
+	// Simple 'hide' function
+	hide: function(){
+		// Remember where we started, so that we can go back to it later
+		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
+		this.options.hide = true;
+
+		// Begin the animation
+		this.custom(this.cur(), 0);
+	},
+
+	// Each step of an animation
+	step: function(){
+		var t = (new Date()).getTime();
+
+		if ( t > this.options.duration + this.startTime ) {
+			this.now = this.end;
+			this.pos = this.state = 1;
+			this.update();
+
+			this.options.curAnim[ this.prop ] = true;
+
+			var done = true;
+			for ( var i in this.options.curAnim )
+				if ( this.options.curAnim[i] !== true )
+					done = false;
+
+			if ( done ) {
+				if ( this.options.display != null ) {
+					// Reset the overflow
+					this.elem.style.overflow = this.options.overflow;
+				
+					// Reset the display
+					this.elem.style.display = this.options.display;
+					if ( jQuery.css(this.elem, "display") == "none" )
+						this.elem.style.display = "block";
+				}
+
+				// Hide the element if the "hide" operation was done
+				if ( this.options.hide )
+					this.elem.style.display = "none";
+
+				// Reset the properties, if the item has been hidden or shown
+				if ( this.options.hide || this.options.show )
+					for ( var p in this.options.curAnim )
+						jQuery.attr(this.elem.style, p, this.options.orig[p]);
+			}
+
+			// If a callback was provided, execute it
+			if ( done && jQuery.isFunction( this.options.complete ) )
+				// Execute the complete function
+				this.options.complete.apply( this.elem );
+
+			return false;
+		} else {
+			var n = t - this.startTime;
+			this.state = n / this.options.duration;
+
+			// Perform the easing function, defaults to swing
+			this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
+			this.now = this.start + ((this.end - this.start) * this.pos);
+
+			// Perform the next step of the animation
+			this.update();
+		}
+
+		return true;
+	}
+
+};
+
+jQuery.fx.step = {
+	scrollLeft: function(fx){
+		fx.elem.scrollLeft = fx.now;
+	},
+
+	scrollTop: function(fx){
+		fx.elem.scrollTop = fx.now;
+	},
+
+	opacity: function(fx){
+		jQuery.attr(fx.elem.style, "opacity", fx.now);
+	},
+
+	_default: function(fx){
+		fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+	}
+};
+// The Offset Method
+// Originally By Brandon Aaron, part of the Dimension Plugin
+// http://jquery.com/plugins/project/dimensions
+jQuery.fn.offset = function() {
+	var left = 0, top = 0, elem = this[0], results;
+	
+	if ( elem ) with ( jQuery.browser ) {
+		var	absolute     = jQuery.css(elem, "position") == "absolute", 
+		    parent       = elem.parentNode, 
+		    offsetParent = elem.offsetParent, 
+		    doc          = elem.ownerDocument,
+		    safari2      = safari && parseInt(version) < 522;
+	
+		// Use getBoundingClientRect if available
+		if ( elem.getBoundingClientRect ) {
+			box = elem.getBoundingClientRect();
+		
+			// Add the document scroll offsets
+			add(
+				box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
+				box.top  + Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop)
+			);
+		
+			// IE adds the HTML element's border, by default it is medium which is 2px
+			// IE 6 and IE 7 quirks mode the border width is overwritable by the following css html { border: 0; }
+			// IE 7 standards mode, the border is always 2px
+			if ( msie ) {
+				var border = jQuery("html").css("borderWidth");
+				border = (border == "medium" || jQuery.boxModel && parseInt(version) >= 7) && 2 || border;
+				add( -border, -border );
+			}
+	
+		// Otherwise loop through the offsetParents and parentNodes
+		} else {
+		
+			// Initial element offsets
+			add( elem.offsetLeft, elem.offsetTop );
+		
+			// Get parent offsets
+			while ( offsetParent ) {
+				// Add offsetParent offsets
+				add( offsetParent.offsetLeft, offsetParent.offsetTop );
+			
+				// Mozilla and Safari > 2 does not include the border on offset parents
+				// However Mozilla adds the border for table cells
+				if ( mozilla && /^t[d|h]$/i.test(parent.tagName) || !safari2 )
+					border( offsetParent );
+				
+				// Safari <= 2 doubles body offsets with an absolutely positioned element or parent
+				if ( safari2 && !absolute && jQuery.css(offsetParent, "position") == "absolute" )
+					absolute = true;
+			
+				// Get next offsetParent
+				offsetParent = offsetParent.offsetParent;
+			}
+		
+			// Get parent scroll offsets
+			while ( parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
+				// Work around opera inline/table scrollLeft/Top bug
+				if ( !/^inline|table-row.*$/i.test(jQuery.css(parent, "display")) )
+					// Subtract parent scroll offsets
+					add( -parent.scrollLeft, -parent.scrollTop );
+			
+				// Mozilla does not add the border for a parent that has overflow != visible
+				if ( mozilla && jQuery.css(parent, "overflow") != "visible" )
+					border( parent );
+			
+				// Get next parent
+				parent = parent.parentNode;
+			}
+		
+			// Safari doubles body offsets with an absolutely positioned element or parent
+			if ( safari2 && absolute )
+				add( -doc.body.offsetLeft, -doc.body.offsetTop );
+		}
+
+		// Return an object with top and left properties
+		results = { top: top, left: left };
+	}
+
+	return results;
+
+	function border(elem) {
+		add( jQuery.css(elem, "borderLeftWidth"), jQuery.css(elem, "borderTopWidth") );
+	}
+
+	function add(l, t) {
+		left += parseInt(l) || 0;
+		top += parseInt(t) || 0;
+	}
+};
+})();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/support/jquery-min.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,31 @@
+/*
+ * jQuery 1.2.1 - New Wave Javascript
+ *
+ * Copyright (c) 2007 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
+ * $Rev: 3353 $
+ */
+(function(){if(typeof jQuery!="undefined")var _jQuery=jQuery;var jQuery=window.jQuery=function(selector,context){return this instanceof jQuery?this.init(selector,context):new jQuery(selector,context);};if(typeof $!="undefined")var _$=$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(typeof selector=="string"){var m=quickExpr.exec(selector);if(m&&(m[1]||!context)){if(m[1])selector=jQuery.clean([m[1]],context);else{var tmp=document.getElementById(m[3]);if(tmp)if(tmp.id!=m[3])return jQuery().find(selector);else{this[0]=tmp;this.length=1;return this;}else
+selector=[];}}else
+return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.1",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(a){var ret=jQuery(a);ret.prevObject=this;return ret;},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this;},each:function(fn,args){return jQuery.each(this,fn,args);},index:function(obj){var pos=-1;this.each(function(i){if(this==obj)pos=i;});return pos;},attr:function(key,value,type){var obj=key;if(key.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],key)||undefined;else{obj={};obj[key]=value;}return this.each(function(index){for(var prop in obj)jQuery.attr(type?this.style:this,prop,jQuery.prop(this,obj[prop],type,index,prop));});},css:function(key,value){return this.attr(key,value,"curCSS");},text:function(e){if(typeof e!="object"&&e!=null)return this.empty().append(document.createTextNode(e));var t="";jQuery.each(e||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)t+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return t;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,1,function(a){this.appendChild(a);});},prepend:function(){return this.domManip(arguments,true,-1,function(a){this.insertBefore(a,this.firstChild);});},before:function(){return this.domManip(arguments,false,1,function(a){this.parentNode.insertBefore(a,this);});},after:function(){return this.domManip(arguments,false,-1,function(a){this.parentNode.insertBefore(a,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(t){var data=jQuery.map(this,function(a){return jQuery.find(t,a);});return this.pushStack(/[^+>] [^+>]/.test(t)||t.indexOf("..")>-1?jQuery.unique(data):data);},clone:function(events){var ret=this.map(function(){return this.outerHTML?jQuery(this.outerHTML)[0]:this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(t){return this.pushStack(jQuery.isFunction(t)&&jQuery.grep(this,function(el,index){return t.apply(el,[index]);})||jQuery.multiFilter(t,this));},not:function(t){return this.pushStack(t.constructor==String&&jQuery.multiFilter(t,this,true)||jQuery.grep(this,function(a){return(t.constructor==Array||t.jquery)?jQuery.inArray(a,t)<0:a!=t;}));},add:function(t){return this.pushStack(jQuery.merge(this.get(),t.constructor==String?jQuery(t).get():t.length!=undefined&&(!t.nodeName||jQuery.nodeName(t,"form"))?t:[t]));},is:function(expr){return expr?jQuery.multiFilter(expr,this).length>0:false;},hasClass:function(expr){return this.is("."+expr);},val:function(val){if(val==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,a=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){var val=jQuery.browser.msie&&!option.attributes["value"].specified?option.text:option.value;if(one)return val;a.push(val);}}return a;}else
+return this[0].value.replace(/\r/g,"");}}else
+return this.each(function(){if(val.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,val)>=0||jQuery.inArray(this.name,val)>=0);else if(jQuery.nodeName(this,"select")){var tmp=val.constructor==Array?val:[val];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,tmp)>=0||jQuery.inArray(this.text,tmp)>=0);});if(!tmp.length)this.selectedIndex=-1;}else
+this.value=val;});},html:function(val){return val==undefined?(this.length?this[0].innerHTML:null):this.empty().append(val);},replaceWith:function(val){return this.after(val).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(fn){return this.pushStack(jQuery.map(this,function(elem,i){return fn.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},domManip:function(args,table,dir,fn){var clone=this.length>1,a;return this.each(function(){if(!a){a=jQuery.clean(args,this.ownerDocument);if(dir<0)a.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(a[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(document.createElement("tbody"));jQuery.each(a,function(){var elem=clone?this.cloneNode(true):this;if(!evalScript(0,elem))fn.call(obj,elem);});});}};function evalScript(i,elem){var script=jQuery.nodeName(elem,"script");if(script){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
+jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}else if(elem.nodeType==1)jQuery("script",elem).each(evalScript);return script;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},a=1,al=arguments.length,deep=false;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};}if(al==1){target=this;a=0;}var prop;for(;a<al;a++)if((prop=arguments[a])!=null)for(var i in prop){if(target==prop[i])continue;if(deep&&typeof prop[i]=='object'&&target[i])jQuery.extend(target[i],prop[i]);else if(prop[i]!=undefined)target[i]=prop[i];}return target;};var expando="jQuery"+(new Date()).getTime(),uuid=0,win={};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/function/i.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){if(window.execScript)window.execScript(data);else if(jQuery.browser.safari)window.setTimeout(data,0);else
+eval.call(window,data);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?win:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!=undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?win:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(obj,fn,args){if(args){if(obj.length==undefined)for(var i in obj)fn.apply(obj[i],args);else
+for(var i=0,ol=obj.length;i<ol;i++)if(fn.apply(obj[i],args)===false)break;}else{if(obj.length==undefined)for(var i in obj)fn.call(obj[i],i,obj[i]);else
+for(var i=0,ol=obj.length,val=obj[0];i<ol&&fn.call(val,i,val)!==false;val=obj[++i]){}}return obj;},prop:function(elem,value,type,index,prop){if(jQuery.isFunction(value))value=value.call(elem,[index]);var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i;return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(prop)?value+"px":value;},className:{add:function(elem,c){jQuery.each((c||"").split(/\s+/),function(i,cur){if(!jQuery.className.has(elem.className,cur))elem.className+=(elem.className?" ":"")+cur;});},remove:function(elem,c){elem.className=c!=undefined?jQuery.grep(elem.className.split(/\s+/),function(cur){return!jQuery.className.has(c,cur);}).join(" "):"";},has:function(t,c){return jQuery.inArray(c,(t.className||t).toString().split(/\s+/))>-1;}},swap:function(e,o,f){for(var i in o){e.style["old"+i]=e.style[i];e.style[i]=o[i];}f.apply(e,[]);for(var i in o)e.style[i]=e.style["old"+i];},css:function(e,p){if(p=="height"||p=="width"){var old={},oHeight,oWidth,d=["Top","Bottom","Right","Left"];jQuery.each(d,function(){old["padding"+this]=0;old["border"+this+"Width"]=0;});jQuery.swap(e,old,function(){if(jQuery(e).is(':visible')){oHeight=e.offsetHeight;oWidth=e.offsetWidth;}else{e=jQuery(e.cloneNode(true)).find(":radio").removeAttr("checked").end().css({visibility:"hidden",position:"absolute",display:"block",right:"0",left:"0"}).appendTo(e.parentNode)[0];var parPos=jQuery.css(e.parentNode,"position")||"static";if(parPos=="static")e.parentNode.style.position="relative";oHeight=e.clientHeight;oWidth=e.clientWidth;if(parPos=="static")e.parentNode.style.position="static";e.parentNode.removeChild(e);}});return p=="height"?oHeight:oWidth;}return jQuery.curCSS(e,p);},curCSS:function(elem,prop,force){var ret,stack=[],swap=[];function color(a){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(a,null);return!ret||ret.getPropertyValue("color")=="";}if(prop=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(prop.match(/float/i))prop=styleFloat;if(!force&&elem.style[prop])ret=elem.style[prop];else if(document.defaultView&&document.defaultView.getComputedStyle){if(prop.match(/float/i))prop="float";prop=prop.replace(/([A-Z])/g,"-$1").toLowerCase();var cur=document.defaultView.getComputedStyle(elem,null);if(cur&&!color(elem))ret=cur.getPropertyValue(prop);else{for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(a=0;a<stack.length;a++)if(color(stack[a])){swap[a]=stack[a].style.display;stack[a].style.display="block";}ret=prop=="display"&&swap[stack.length-1]!=null?"none":document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop)||"";for(a=0;a<swap.length;a++)if(swap[a]!=null)stack[a].style.display=swap[a];}if(prop=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var newProp=prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});ret=elem.currentStyle[prop]||elem.currentStyle[newProp];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var style=elem.style.left;var runtimeStyle=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;elem.style.left=ret||0;ret=elem.style.pixelLeft+"px";elem.style.left=style;elem.runtimeStyle.left=runtimeStyle;}}return ret;},clean:function(a,doc){var r=[];doc=doc||document;jQuery.each(a,function(i,arg){if(!arg)return;if(arg.constructor==Number)arg=arg.toString();if(typeof arg=="string"){arg=arg.replace(/(<(\w+)[^>]*?)\/>/g,function(m,all,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)?m:all+"></"+tag+">";});var s=jQuery.trim(arg).toLowerCase(),div=doc.createElement("div"),tb=[];var wrap=!s.indexOf("<opt")&&[1,"<select>","</select>"]||!s.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||s.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!s.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!s.indexOf("<td")||!s.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!s.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+arg+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){if(!s.indexOf("<table")&&s.indexOf("<tbody")<0)tb=div.firstChild&&div.firstChild.childNodes;else if(wrap[1]=="<table>"&&s.indexOf("<tbody")<0)tb=div.childNodes;for(var n=tb.length-1;n>=0;--n)if(jQuery.nodeName(tb[n],"tbody")&&!tb[n].childNodes.length)tb[n].parentNode.removeChild(tb[n]);if(/^\s/.test(arg))div.insertBefore(doc.createTextNode(arg.match(/^\s*/)[0]),div.firstChild);}arg=jQuery.makeArray(div.childNodes);}if(0===arg.length&&(!jQuery.nodeName(arg,"form")&&!jQuery.nodeName(arg,"select")))return;if(arg[0]==undefined||jQuery.nodeName(arg,"form")||arg.options)r.push(arg);else
+r=jQuery.merge(r,arg);});return r;},attr:function(elem,name,value){var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(t){return(t||"").replace(/^\s+|\s+$/g,"");},makeArray:function(a){var r=[];if(typeof a!="array")for(var i=0,al=a.length;i<al;i++)r.push(a[i]);else
+r=a.slice(0);return r;},inArray:function(b,a){for(var i=0,al=a.length;i<al;i++)if(a[i]==b)return i;return-1;},merge:function(first,second){if(jQuery.browser.msie){for(var i=0;second[i];i++)if(second[i].nodeType!=8)first.push(second[i]);}else
+for(var i=0;second[i];i++)first.push(second[i]);return first;},unique:function(first){var r=[],done={};try{for(var i=0,fl=first.length;i<fl;i++){var id=jQuery.data(first[i]);if(!done[id]){done[id]=true;r.push(first[i]);}}}catch(e){r=first;}return r;},grep:function(elems,fn,inv){if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++)if(!inv&&fn(elems[i],i)||inv&&!fn(elems[i],i))result.push(elems[i]);return result;},map:function(elems,fn){if(typeof fn=="string")fn=eval("false||function(a){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++){var val=fn(elems[i],i);if(val!==null&&val!=undefined){if(val.constructor!=Array)val=[val];result=result.concat(val);}}return result;}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",styleFloat:jQuery.browser.msie?"styleFloat":"cssFloat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,innerHTML:"innerHTML",className:"className",value:"value",disabled:"disabled",checked:"checked",readonly:"readOnly",selected:"selected",maxlength:"maxLength"}});jQuery.each({parent:"a.parentNode",parents:"jQuery.dir(a,'parentNode')",next:"jQuery.nth(a,2,'nextSibling')",prev:"jQuery.nth(a,2,'previousSibling')",nextAll:"jQuery.dir(a,'nextSibling')",prevAll:"jQuery.dir(a,'previousSibling')",siblings:"jQuery.sibling(a.parentNode.firstChild,a)",children:"jQuery.sibling(a.firstChild)",contents:"jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"},function(i,n){jQuery.fn[i]=function(a){var ret=jQuery.map(this,n);if(a&&typeof a=="string")ret=jQuery.multiFilter(a,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(i,n){jQuery.fn[i]=function(){var a=arguments;return this.each(function(){for(var j=0,al=a.length;j<al;j++)jQuery(a[j])[n](this);});};});jQuery.each({removeAttr:function(key){jQuery.attr(this,key,"");this.removeAttribute(key);},addClass:function(c){jQuery.className.add(this,c);},removeClass:function(c){jQuery.className.remove(this,c);},toggleClass:function(c){jQuery.className[jQuery.className.has(this,c)?"remove":"add"](this,c);},remove:function(a){if(!a||jQuery.filter(a,[this]).r.length){jQuery.removeData(this);this.parentNode.removeChild(this);}},empty:function(){jQuery("*",this).each(function(){jQuery.removeData(this);});while(this.firstChild)this.removeChild(this.firstChild);}},function(i,n){jQuery.fn[i]=function(){return this.each(n,arguments);};});jQuery.each(["Height","Width"],function(i,name){var n=name.toLowerCase();jQuery.fn[n]=function(h){return this[0]==window?jQuery.browser.safari&&self["inner"+name]||jQuery.boxModel&&Math.max(document.documentElement["client"+name],document.body["client"+name])||document.body["client"+name]:this[0]==document?Math.max(document.body["scroll"+name],document.body["offset"+name]):h==undefined?(this.length?jQuery.css(this[0],n):null):this.css(n,h.constructor==String?h:h+"px");};});var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":"m[2]=='*'||jQuery.nodeName(a,m[2])","#":"a.getAttribute('id')==m[2]",":":{lt:"i<m[3]-0",gt:"i>m[3]-0",nth:"m[3]-0==i",eq:"m[3]-0==i",first:"i==0",last:"i==r.length-1",even:"i%2==0",odd:"i%2","first-child":"a.parentNode.getElementsByTagName('*')[0]==a","last-child":"jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a","only-child":"!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",parent:"a.firstChild",empty:"!a.firstChild",contains:"(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",visible:'"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',hidden:'"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',enabled:"!a.disabled",disabled:"a.disabled",checked:"a.checked",selected:"a.selected||jQuery.attr(a,'selected')",text:"'text'==a.type",radio:"'radio'==a.type",checkbox:"'checkbox'==a.type",file:"'file'==a.type",password:"'password'==a.type",submit:"'submit'==a.type",image:"'image'==a.type",reset:"'reset'==a.type",button:'"button"==a.type||jQuery.nodeName(a,"button")',input:"/input|select|textarea|button/i.test(a.nodeName)",has:"jQuery.find(m[3],a).length",header:"/h\\d/i.test(a.nodeName)",animated:"jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&!context.nodeType)context=null;context=context||document;var ret=[context],done=[],last;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){var nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName.toUpperCase()))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var nodeName=m[2],merge={};m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName.toUpperCase()){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=jQuery.filter(m[3],r,true).r;else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(\d*)n\+?(\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"n+"+m[3]||m[3]),first=(test[1]||1)-0,last=test[2]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==1){if(last==0||node.nodeIndex==last)add=true;}else if((node.nodeIndex+last)%first==0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var f=jQuery.expr[m[1]];if(typeof f!="string")f=jQuery.expr[m[1]][m[2]];f=eval("false||function(a,i){return "+f+"}");r=jQuery.grep(r,f,not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(element,type,handler,data){if(jQuery.browser.msie&&element.setInterval!=undefined)element=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var parts=type.split(".");type=parts[0];handler.type=parts[1];var events=jQuery.data(element,"events")||jQuery.data(element,"events",{});var handle=jQuery.data(element,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(element,arguments);return val;});var handlers=events[type];if(!handlers){handlers=events[type]={};if(element.addEventListener)element.addEventListener(type,handle,false);else
+element.attachEvent("on"+type,handle);}handlers[handler.guid]=handler;this.global[type]=true;},guid:1,global:{},remove:function(element,type,handler){var events=jQuery.data(element,"events"),ret,index;if(typeof type=="string"){var parts=type.split(".");type=parts[0];}if(events){if(type&&type.type){handler=type.handler;type=type.type;}if(!type){for(type in events)this.remove(element,type);}else if(events[type]){if(handler)delete events[type][handler.guid];else
+for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(element.removeEventListener)element.removeEventListener(type,jQuery.data(element,"handle"),false);else
+element.detachEvent("on"+type,jQuery.data(element,"handle"));ret=null;delete events[type];}}for(ret in events)break;if(!ret){jQuery.removeData(element,"events");jQuery.removeData(element,"handle");}}},trigger:function(type,data,element,donative,extra){data=jQuery.makeArray(data||[]);if(!element){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{var val,ret,fn=jQuery.isFunction(element[type]||null),evt=!data[0]||!data[0].preventDefault;if(evt)data.unshift(this.fix({type:type,target:element}));data[0].type=type;if(jQuery.isFunction(jQuery.data(element,"handle")))val=jQuery.data(element,"handle").apply(element,data);if(!fn&&element["on"+type]&&element["on"+type].apply(element,data)===false)val=false;if(evt)data.shift();if(extra&&extra.apply(element,data)===false)val=false;if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(element,'a')&&type=="click")){this.triggered=true;element[type]();}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var c=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in c){args[0].handler=c[j];args[0].data=c[j].data;if(!parts[1]||c[j].type==parts[1]){var tmp=c[j].apply(this,args);if(val!==false)val=tmp;if(tmp===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target&&event.srcElement)event.target=event.srcElement;if(jQuery.browser.safari&&event.target.nodeType==3)event.target=originalEvent.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var e=document.documentElement,b=document.body;event.pageX=event.clientX+(e&&e.scrollLeft||b.scrollLeft||0);event.pageY=event.clientY+(e&&e.scrollTop||b.scrollTop||0);}if(!event.which&&(event.charCode||event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(){var a=arguments;return this.click(function(e){this.lastToggle=0==this.lastToggle?1:0;e.preventDefault();return a[this.lastToggle].apply(this,[e])||false;});},hover:function(f,g){function handleHover(e){var p=e.relatedTarget;while(p&&p!=this)try{p=p.parentNode;}catch(e){p=this;};if(p==this)return false;return(e.type=="mouseover"?f:g).apply(this,[e]);}return this.mouseover(handleHover).mouseout(handleHover);},ready:function(f){bindReady();if(jQuery.isReady)f.apply(document,[jQuery]);else
+jQuery.readyList.push(function(){return f.apply(this,[jQuery]);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}if(jQuery.browser.mozilla||jQuery.browser.opera)document.removeEventListener("DOMContentLoaded",jQuery.ready,false);if(!window.frames.length)jQuery(window).load(function(){jQuery("#__ie_init").remove();});}}});jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,o){jQuery.fn[o]=function(f){return f?this.bind(o,f):this.trigger(o);};});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(jQuery.browser.mozilla||jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);else if(jQuery.browser.msie){document.write("<scr"+"ipt id=__ie_init defer=true "+"src=//:><\/script>");var script=document.getElementById("__ie_init");if(script)script.onreadystatechange=function(){if(this.readyState!="complete")return;jQuery.ready();};script=null;}else if(jQuery.browser.safari)jQuery.safariTimer=setInterval(function(){if(document.readyState=="loaded"||document.readyState=="complete"){clearInterval(jQuery.safariTimer);jQuery.safariTimer=null;jQuery.ready();}},10);jQuery.event.add(window,"load",jQuery.ready);}jQuery.fn.extend({load:function(url,params,callback){if(jQuery.isFunction(url))return this.bind("load",url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);setTimeout(function(){self.each(callback,[res.responseText,status,res]);},13);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null},lastModified:{},ajax:function(s){var jsonp,jsre=/=(\?|%3F)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=s.data.replace(jsre,"="+jsonp);s.url=s.url.replace(jsre,"="+jsonp);s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get")s.url+=(s.url.match(/\?/)?"&":"?")+"_="+(new Date()).getTime();if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if(!s.url.indexOf("http")&&s.dataType=="script"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(!jsonp&&(s.success||s.complete)){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async);if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
+jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();return xml;function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
+for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
+s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock?this.oldblock:"";if(jQuery.css(this,"display")=="none")this.style.display="block";}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");if(this.oldblock=="none")this.oldblock="block";this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var opt=jQuery.speed(speed,easing,callback);return this[opt.queue===false?"each":"queue"](function(){opt=jQuery.extend({},opt);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
+e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(){var timers=jQuery.timers;return this.each(function(){for(var i=0;i<timers.length;i++)if(timers[i].elem==this)timers.splice(i--,1);}).dequeue();}});var queue=function(elem,type,array){if(!elem)return;var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.curCSS(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.css(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(){return self.step();}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timers.length==1){var timer=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length)clearInterval(timer);},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(){var t=(new Date()).getTime();if(t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var absolute=jQuery.css(elem,"position")=="absolute",parent=elem.parentNode,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522;if(elem.getBoundingClientRect){box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));if(msie){var border=jQuery("html").css("borderWidth");border=(border=="medium"||jQuery.boxModel&&parseInt(version)>=7)&&2||border;add(-border,-border);}}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&/^t[d|h]$/i.test(parent.tagName)||!safari2)border(offsetParent);if(safari2&&!absolute&&jQuery.css(offsetParent,"position")=="absolute")absolute=true;offsetParent=offsetParent.offsetParent;}while(parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table-row.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if(safari2&&absolute)add(-doc.body.offsetLeft,-doc.body.offsetTop);}results={top:top,left:left};}return results;function border(elem){add(jQuery.css(elem,"borderLeftWidth"),jQuery.css(elem,"borderTopWidth"));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}};})();
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/support/jquery.js	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,2992 @@
+(function(){
+/*
+ * jQuery 1.2.1 - New Wave Javascript
+ *
+ * Copyright (c) 2007 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
+ * $Rev: 3353 $
+ */
+
+// Map over jQuery in case of overwrite
+if ( typeof jQuery != "undefined" )
+	var _jQuery = jQuery;
+
+var jQuery = window.jQuery = function(selector, context) {
+	// If the context is a namespace object, return a new object
+	return this instanceof jQuery ?
+		this.init(selector, context) :
+		new jQuery(selector, context);
+};
+
+// Map over the $ in case of overwrite
+if ( typeof $ != "undefined" )
+	var _$ = $;
+	
+// Map the jQuery namespace to the '$' one
+window.$ = jQuery;
+
+var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;
+
+jQuery.fn = jQuery.prototype = {
+	init: function(selector, context) {
+		// Make sure that a selection was provided
+		selector = selector || document;
+
+		// Handle HTML strings
+		if ( typeof selector  == "string" ) {
+			var m = quickExpr.exec(selector);
+			if ( m && (m[1] || !context) ) {
+				// HANDLE: $(html) -> $(array)
+				if ( m[1] )
+					selector = jQuery.clean( [ m[1] ], context );
+
+				// HANDLE: $("#id")
+				else {
+					var tmp = document.getElementById( m[3] );
+					if ( tmp )
+						// Handle the case where IE and Opera return items
+						// by name instead of ID
+						if ( tmp.id != m[3] )
+							return jQuery().find( selector );
+						else {
+							this[0] = tmp;
+							this.length = 1;
+							return this;
+						}
+					else
+						selector = [];
+				}
+
+			// HANDLE: $(expr)
+			} else
+				return new jQuery( context ).find( selector );
+
+		// HANDLE: $(function)
+		// Shortcut for document ready
+		} else if ( jQuery.isFunction(selector) )
+			return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( selector );
+
+		return this.setArray(
+			// HANDLE: $(array)
+			selector.constructor == Array && selector ||
+
+			// HANDLE: $(arraylike)
+			// Watch for when an array-like object is passed as the selector
+			(selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) ||
+
+			// HANDLE: $(*)
+			[ selector ] );
+	},
+	
+	jquery: "1.2.1",
+
+	size: function() {
+		return this.length;
+	},
+	
+	length: 0,
+
+	get: function( num ) {
+		return num == undefined ?
+
+			// Return a 'clean' array
+			jQuery.makeArray( this ) :
+
+			// Return just the object
+			this[num];
+	},
+	
+	pushStack: function( a ) {
+		var ret = jQuery(a);
+		ret.prevObject = this;
+		return ret;
+	},
+	
+	setArray: function( a ) {
+		this.length = 0;
+		Array.prototype.push.apply( this, a );
+		return this;
+	},
+
+	each: function( fn, args ) {
+		return jQuery.each( this, fn, args );
+	},
+
+	index: function( obj ) {
+		var pos = -1;
+		this.each(function(i){
+			if ( this == obj ) pos = i;
+		});
+		return pos;
+	},
+
+	attr: function( key, value, type ) {
+		var obj = key;
+		
+		// Look for the case where we're accessing a style value
+		if ( key.constructor == String )
+			if ( value == undefined )
+				return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined;
+			else {
+				obj = {};
+				obj[ key ] = value;
+			}
+		
+		// Check to see if we're setting style values
+		return this.each(function(index){
+			// Set all the styles
+			for ( var prop in obj )
+				jQuery.attr(
+					type ? this.style : this,
+					prop, jQuery.prop(this, obj[prop], type, index, prop)
+				);
+		});
+	},
+
+	css: function( key, value ) {
+		return this.attr( key, value, "curCSS" );
+	},
+
+	text: function(e) {
+		if ( typeof e != "object" && e != null )
+			return this.empty().append( document.createTextNode( e ) );
+
+		var t = "";
+		jQuery.each( e || this, function(){
+			jQuery.each( this.childNodes, function(){
+				if ( this.nodeType != 8 )
+					t += this.nodeType != 1 ?
+						this.nodeValue : jQuery.fn.text([ this ]);
+			});
+		});
+		return t;
+	},
+
+	wrapAll: function(html) {
+		if ( this[0] )
+			// The elements to wrap the target around
+			jQuery(html, this[0].ownerDocument)
+				.clone()
+				.insertBefore(this[0])
+				.map(function(){
+					var elem = this;
+					while ( elem.firstChild )
+						elem = elem.firstChild;
+					return elem;
+				})
+				.append(this);
+
+		return this;
+	},
+
+	wrapInner: function(html) {
+		return this.each(function(){
+			jQuery(this).contents().wrapAll(html);
+		});
+	},
+
+	wrap: function(html) {
+		return this.each(function(){
+			jQuery(this).wrapAll(html);
+		});
+	},
+
+	append: function() {
+		return this.domManip(arguments, true, 1, function(a){
+			this.appendChild( a );
+		});
+	},
+
+	prepend: function() {
+		return this.domManip(arguments, true, -1, function(a){
+			this.insertBefore( a, this.firstChild );
+		});
+	},
+	
+	before: function() {
+		return this.domManip(arguments, false, 1, function(a){
+			this.parentNode.insertBefore( a, this );
+		});
+	},
+
+	after: function() {
+		return this.domManip(arguments, false, -1, function(a){
+			this.parentNode.insertBefore( a, this.nextSibling );
+		});
+	},
+
+	end: function() {
+		return this.prevObject || jQuery([]);
+	},
+
+	find: function(t) {
+		var data = jQuery.map(this, function(a){ return jQuery.find(t,a); });
+		return this.pushStack( /[^+>] [^+>]/.test( t ) || t.indexOf("..") > -1 ?
+			jQuery.unique( data ) : data );
+	},
+
+	clone: function(events) {
+		// Do the clone
+		var ret = this.map(function(){
+			return this.outerHTML ? jQuery(this.outerHTML)[0] : this.cloneNode(true);
+		});
+
+		// Need to set the expando to null on the cloned set if it exists
+		// removeData doesn't work here, IE removes it from the original as well
+		// this is primarily for IE but the data expando shouldn't be copied over in any browser
+		var clone = ret.find("*").andSelf().each(function(){
+			if ( this[ expando ] != undefined )
+				this[ expando ] = null;
+		});
+		
+		// Copy the events from the original to the clone
+		if (events === true)
+			this.find("*").andSelf().each(function(i) {
+				var events = jQuery.data(this, "events");
+				for ( var type in events )
+					for ( var handler in events[type] )
+						jQuery.event.add(clone[i], type, events[type][handler], events[type][handler].data);
+			});
+
+		// Return the cloned set
+		return ret;
+	},
+
+	filter: function(t) {
+		return this.pushStack(
+			jQuery.isFunction( t ) &&
+			jQuery.grep(this, function(el, index){
+				return t.apply(el, [index]);
+			}) ||
+
+			jQuery.multiFilter(t,this) );
+	},
+
+	not: function(t) {
+		return this.pushStack(
+			t.constructor == String &&
+			jQuery.multiFilter(t, this, true) ||
+
+			jQuery.grep(this, function(a) {
+				return ( t.constructor == Array || t.jquery )
+					? jQuery.inArray( a, t ) < 0
+					: a != t;
+			})
+		);
+	},
+
+	add: function(t) {
+		return this.pushStack( jQuery.merge(
+			this.get(),
+			t.constructor == String ?
+				jQuery(t).get() :
+				t.length != undefined && (!t.nodeName || jQuery.nodeName(t, "form")) ?
+					t : [t] )
+		);
+	},
+
+	is: function(expr) {
+		return expr ? jQuery.multiFilter(expr,this).length > 0 : false;
+	},
+
+	hasClass: function(expr) {
+		return this.is("." + expr);
+	},
+	
+	val: function( val ) {
+		if ( val == undefined ) {
+			if ( this.length ) {
+				var elem = this[0];
+		    	
+				// We need to handle select boxes special
+				if ( jQuery.nodeName(elem, "select") ) {
+					var index = elem.selectedIndex,
+						a = [],
+						options = elem.options,
+						one = elem.type == "select-one";
+					
+					// Nothing was selected
+					if ( index < 0 )
+						return null;
+
+					// Loop through all the selected options
+					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+						var option = options[i];
+						if ( option.selected ) {
+							// Get the specifc value for the option
+							var val = jQuery.browser.msie && !option.attributes["value"].specified ? option.text : option.value;
+							
+							// We don't need an array for one selects
+							if ( one )
+								return val;
+							
+							// Multi-Selects return an array
+							a.push(val);
+						}
+					}
+					
+					return a;
+					
+				// Everything else, we just grab the value
+				} else
+					return this[0].value.replace(/\r/g, "");
+			}
+		} else
+			return this.each(function(){
+				if ( val.constructor == Array && /radio|checkbox/.test(this.type) )
+					this.checked = (jQuery.inArray(this.value, val) >= 0 ||
+						jQuery.inArray(this.name, val) >= 0);
+				else if ( jQuery.nodeName(this, "select") ) {
+					var tmp = val.constructor == Array ? val : [val];
+
+					jQuery("option", this).each(function(){
+						this.selected = (jQuery.inArray(this.value, tmp) >= 0 ||
+						jQuery.inArray(this.text, tmp) >= 0);
+					});
+
+					if ( !tmp.length )
+						this.selectedIndex = -1;
+				} else
+					this.value = val;
+			});
+	},
+	
+	html: function( val ) {
+		return val == undefined ?
+			( this.length ? this[0].innerHTML : null ) :
+			this.empty().append( val );
+	},
+
+	replaceWith: function( val ) {
+		return this.after( val ).remove();
+	},
+
+	eq: function(i){
+		return this.slice(i, i+1);
+	},
+
+	slice: function() {
+		return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
+	},
+
+	map: function(fn) {
+		return this.pushStack(jQuery.map( this, function(elem,i){
+			return fn.call( elem, i, elem );
+		}));
+	},
+
+	andSelf: function() {
+		return this.add( this.prevObject );
+	},
+	
+	domManip: function(args, table, dir, fn) {
+		var clone = this.length > 1, a; 
+
+		return this.each(function(){
+			if ( !a ) {
+				a = jQuery.clean(args, this.ownerDocument);
+				if ( dir < 0 )
+					a.reverse();
+			}
+
+			var obj = this;
+
+			if ( table && jQuery.nodeName(this, "table") && jQuery.nodeName(a[0], "tr") )
+				obj = this.getElementsByTagName("tbody")[0] || this.appendChild(document.createElement("tbody"));
+
+			jQuery.each( a, function(){
+				var elem = clone ? this.cloneNode(true) : this;
+				if ( !evalScript(0, elem) )
+					fn.call( obj, elem );
+			});
+		});
+	}
+};
+
+function evalScript(i, elem){
+	var script = jQuery.nodeName(elem, "script");
+
+	if ( script ) {
+		if ( elem.src )
+			jQuery.ajax({ url: elem.src, async: false, dataType: "script" });
+		else
+			jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
+	
+		if ( elem.parentNode )
+			elem.parentNode.removeChild(elem);
+
+	} else if ( elem.nodeType == 1 )
+    jQuery("script", elem).each(evalScript);
+
+	return script;
+}
+
+jQuery.extend = jQuery.fn.extend = function() {
+	// copy reference to target object
+	var target = arguments[0] || {}, a = 1, al = arguments.length, deep = false;
+
+	// Handle a deep copy situation
+	if ( target.constructor == Boolean ) {
+		deep = target;
+		target = arguments[1] || {};
+	}
+
+	// extend jQuery itself if only one argument is passed
+	if ( al == 1 ) {
+		target = this;
+		a = 0;
+	}
+
+	var prop;
+
+	for ( ; a < al; a++ )
+		// Only deal with non-null/undefined values
+		if ( (prop = arguments[a]) != null )
+			// Extend the base object
+			for ( var i in prop ) {
+				// Prevent never-ending loop
+				if ( target == prop[i] )
+					continue;
+
+				// Recurse if we're merging object values
+				if ( deep && typeof prop[i] == 'object' && target[i] )
+					jQuery.extend( target[i], prop[i] );
+
+				// Don't bring in undefined values
+				else if ( prop[i] != undefined )
+					target[i] = prop[i];
+			}
+
+	// Return the modified object
+	return target;
+};
+
+var expando = "jQuery" + (new Date()).getTime(), uuid = 0, win = {};
+
+jQuery.extend({
+	noConflict: function(deep) {
+		window.$ = _$;
+		if ( deep )
+			window.jQuery = _jQuery;
+		return jQuery;
+	},
+
+	// This may seem like some crazy code, but trust me when I say that this
+	// is the only cross-browser way to do this. --John
+	isFunction: function( fn ) {
+		return !!fn && typeof fn != "string" && !fn.nodeName && 
+			fn.constructor != Array && /function/i.test( fn + "" );
+	},
+	
+	// check if an element is in a XML document
+	isXMLDoc: function(elem) {
+		return elem.documentElement && !elem.body ||
+			elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
+	},
+
+	// Evalulates a script in a global context
+	// Evaluates Async. in Safari 2 :-(
+	globalEval: function( data ) {
+		data = jQuery.trim( data );
+		if ( data ) {
+			if ( window.execScript )
+				window.execScript( data );
+			else if ( jQuery.browser.safari )
+				// safari doesn't provide a synchronous global eval
+				window.setTimeout( data, 0 );
+			else
+				eval.call( window, data );
+		}
+	},
+
+	nodeName: function( elem, name ) {
+		return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
+	},
+	
+	cache: {},
+	
+	data: function( elem, name, data ) {
+		elem = elem == window ? win : elem;
+
+		var id = elem[ expando ];
+
+		// Compute a unique ID for the element
+		if ( !id ) 
+			id = elem[ expando ] = ++uuid;
+
+		// Only generate the data cache if we're
+		// trying to access or manipulate it
+		if ( name && !jQuery.cache[ id ] )
+			jQuery.cache[ id ] = {};
+		
+		// Prevent overriding the named cache with undefined values
+		if ( data != undefined )
+			jQuery.cache[ id ][ name ] = data;
+		
+		// Return the named cache data, or the ID for the element	
+		return name ? jQuery.cache[ id ][ name ] : id;
+	},
+	
+	removeData: function( elem, name ) {
+		elem = elem == window ? win : elem;
+
+		var id = elem[ expando ];
+
+		// If we want to remove a specific section of the element's data
+		if ( name ) {
+			if ( jQuery.cache[ id ] ) {
+				// Remove the section of cache data
+				delete jQuery.cache[ id ][ name ];
+
+				// If we've removed all the data, remove the element's cache
+				name = "";
+				for ( name in jQuery.cache[ id ] ) break;
+				if ( !name )
+					jQuery.removeData( elem );
+			}
+
+		// Otherwise, we want to remove all of the element's data
+		} else {
+			// Clean up the element expando
+			try {
+				delete elem[ expando ];
+			} catch(e){
+				// IE has trouble directly removing the expando
+				// but it's ok with using removeAttribute
+				if ( elem.removeAttribute )
+					elem.removeAttribute( expando );
+			}
+
+			// Completely remove the data cache
+			delete jQuery.cache[ id ];
+		}
+	},
+
+	// args is for internal usage only
+	each: function( obj, fn, args ) {
+		if ( args ) {
+			if ( obj.length == undefined )
+				for ( var i in obj )
+					fn.apply( obj[i], args );
+			else
+				for ( var i = 0, ol = obj.length; i < ol; i++ )
+					if ( fn.apply( obj[i], args ) === false ) break;
+
+		// A special, fast, case for the most common use of each
+		} else {
+			if ( obj.length == undefined )
+				for ( var i in obj )
+					fn.call( obj[i], i, obj[i] );
+			else
+				for ( var i = 0, ol = obj.length, val = obj[0]; 
+					i < ol && fn.call(val,i,val) !== false; val = obj[++i] ){}
+		}
+
+		return obj;
+	},
+	
+	prop: function(elem, value, type, index, prop){
+			// Handle executable functions
+			if ( jQuery.isFunction( value ) )
+				value = value.call( elem, [index] );
+				
+			// exclude the following css properties to add px
+			var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
+
+			// Handle passing in a number to a CSS property
+			return value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) ?
+				value + "px" :
+				value;
+	},
+
+	className: {
+		// internal only, use addClass("class")
+		add: function( elem, c ){
+			jQuery.each( (c || "").split(/\s+/), function(i, cur){
+				if ( !jQuery.className.has( elem.className, cur ) )
+					elem.className += ( elem.className ? " " : "" ) + cur;
+			});
+		},
+
+		// internal only, use removeClass("class")
+		remove: function( elem, c ){
+			elem.className = c != undefined ?
+				jQuery.grep( elem.className.split(/\s+/), function(cur){
+					return !jQuery.className.has( c, cur );	
+				}).join(" ") : "";
+		},
+
+		// internal only, use is(".class")
+		has: function( t, c ) {
+			return jQuery.inArray( c, (t.className || t).toString().split(/\s+/) ) > -1;
+		}
+	},
+
+	swap: function(e,o,f) {
+		for ( var i in o ) {
+			e.style["old"+i] = e.style[i];
+			e.style[i] = o[i];
+		}
+		f.apply( e, [] );
+		for ( var i in o )
+			e.style[i] = e.style["old"+i];
+	},
+
+	css: function(e,p) {
+		if ( p == "height" || p == "width" ) {
+			var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"];
+
+			jQuery.each( d, function(){
+				old["padding" + this] = 0;
+				old["border" + this + "Width"] = 0;
+			});
+
+			jQuery.swap( e, old, function() {
+				if ( jQuery(e).is(':visible') ) {
+					oHeight = e.offsetHeight;
+					oWidth = e.offsetWidth;
+				} else {
+					e = jQuery(e.cloneNode(true))
+						.find(":radio").removeAttr("checked").end()
+						.css({
+							visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0"
+						}).appendTo(e.parentNode)[0];
+
+					var parPos = jQuery.css(e.parentNode,"position") || "static";
+					if ( parPos == "static" )
+						e.parentNode.style.position = "relative";
+
+					oHeight = e.clientHeight;
+					oWidth = e.clientWidth;
+
+					if ( parPos == "static" )
+						e.parentNode.style.position = "static";
+
+					e.parentNode.removeChild(e);
+				}
+			});
+
+			return p == "height" ? oHeight : oWidth;
+		}
+
+		return jQuery.curCSS( e, p );
+	},
+
+	curCSS: function(elem, prop, force) {
+		var ret, stack = [], swap = [];
+
+		// A helper method for determining if an element's values are broken
+		function color(a){
+			if ( !jQuery.browser.safari )
+				return false;
+
+			var ret = document.defaultView.getComputedStyle(a,null);
+			return !ret || ret.getPropertyValue("color") == "";
+		}
+
+		if (prop == "opacity" && jQuery.browser.msie) {
+			ret = jQuery.attr(elem.style, "opacity");
+			return ret == "" ? "1" : ret;
+		}
+		
+		if (prop.match(/float/i))
+			prop = styleFloat;
+
+		if (!force && elem.style[prop])
+			ret = elem.style[prop];
+
+		else if (document.defaultView && document.defaultView.getComputedStyle) {
+
+			if (prop.match(/float/i))
+				prop = "float";
+
+			prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase();
+			var cur = document.defaultView.getComputedStyle(elem, null);
+
+			if ( cur && !color(elem) )
+				ret = cur.getPropertyValue(prop);
+
+			// If the element isn't reporting its values properly in Safari
+			// then some display: none elements are involved
+			else {
+				// Locate all of the parent display: none elements
+				for ( var a = elem; a && color(a); a = a.parentNode )
+					stack.unshift(a);
+
+				// Go through and make them visible, but in reverse
+				// (It would be better if we knew the exact display type that they had)
+				for ( a = 0; a < stack.length; a++ )
+					if ( color(stack[a]) ) {
+						swap[a] = stack[a].style.display;
+						stack[a].style.display = "block";
+					}
+
+				// Since we flip the display style, we have to handle that
+				// one special, otherwise get the value
+				ret = prop == "display" && swap[stack.length-1] != null ?
+					"none" :
+					document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop) || "";
+
+				// Finally, revert the display styles back
+				for ( a = 0; a < swap.length; a++ )
+					if ( swap[a] != null )
+						stack[a].style.display = swap[a];
+			}
+
+			if ( prop == "opacity" && ret == "" )
+				ret = "1";
+
+		} else if (elem.currentStyle) {
+			var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});
+			ret = elem.currentStyle[prop] || elem.currentStyle[newProp];
+
+			// From the awesome hack by Dean Edwards
+			// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+			// If we're not dealing with a regular pixel number
+			// but a number that has a weird ending, we need to convert it to pixels
+			if ( !/^\d+(px)?$/i.test(ret) && /^\d/.test(ret) ) {
+				var style = elem.style.left;
+				var runtimeStyle = elem.runtimeStyle.left;
+				elem.runtimeStyle.left = elem.currentStyle.left;
+				elem.style.left = ret || 0;
+				ret = elem.style.pixelLeft + "px";
+				elem.style.left = style;
+				elem.runtimeStyle.left = runtimeStyle;
+			}
+		}
+
+		return ret;
+	},
+	
+	clean: function(a, doc) {
+		var r = [];
+		doc = doc || document;
+
+		jQuery.each( a, function(i,arg){
+			if ( !arg ) return;
+
+			if ( arg.constructor == Number )
+				arg = arg.toString();
+			
+			// Convert html string into DOM nodes
+			if ( typeof arg == "string" ) {
+				// Fix "XHTML"-style tags in all browsers
+				arg = arg.replace(/(<(\w+)[^>]*?)\/>/g, function(m, all, tag){
+					return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)? m : all+"></"+tag+">";
+				});
+
+				// Trim whitespace, otherwise indexOf won't work as expected
+				var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = [];
+
+				var wrap =
+					// option or optgroup
+					!s.indexOf("<opt") &&
+					[1, "<select>", "</select>"] ||
+					
+					!s.indexOf("<leg") &&
+					[1, "<fieldset>", "</fieldset>"] ||
+					
+					s.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
+					[1, "<table>", "</table>"] ||
+					
+					!s.indexOf("<tr") &&
+					[2, "<table><tbody>", "</tbody></table>"] ||
+					
+				 	// <thead> matched above
+					(!s.indexOf("<td") || !s.indexOf("<th")) &&
+					[3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
+					
+					!s.indexOf("<col") &&
+					[2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] ||
+
+					// IE can't serialize <link> and <script> tags normally
+					jQuery.browser.msie &&
+					[1, "div<div>", "</div>"] ||
+					
+					[0,"",""];
+
+				// Go to html and back, then peel off extra wrappers
+				div.innerHTML = wrap[1] + arg + wrap[2];
+				
+				// Move to the right depth
+				while ( wrap[0]-- )
+					div = div.lastChild;
+				
+				// Remove IE's autoinserted <tbody> from table fragments
+				if ( jQuery.browser.msie ) {
+					
+					// String was a <table>, *may* have spurious <tbody>
+					if ( !s.indexOf("<table") && s.indexOf("<tbody") < 0 ) 
+						tb = div.firstChild && div.firstChild.childNodes;
+						
+					// String was a bare <thead> or <tfoot>
+					else if ( wrap[1] == "<table>" && s.indexOf("<tbody") < 0 )
+						tb = div.childNodes;
+
+					for ( var n = tb.length-1; n >= 0 ; --n )
+						if ( jQuery.nodeName(tb[n], "tbody") && !tb[n].childNodes.length )
+							tb[n].parentNode.removeChild(tb[n]);
+	
+					// IE completely kills leading whitespace when innerHTML is used	
+					if ( /^\s/.test(arg) )	
+						div.insertBefore( doc.createTextNode( arg.match(/^\s*/)[0] ), div.firstChild );
+
+				}
+				
+				arg = jQuery.makeArray( div.childNodes );
+			}
+
+			if ( 0 === arg.length && (!jQuery.nodeName(arg, "form") && !jQuery.nodeName(arg, "select")) )
+				return;
+
+			if ( arg[0] == undefined || jQuery.nodeName(arg, "form") || arg.options )
+				r.push( arg );
+			else
+				r = jQuery.merge( r, arg );
+
+		});
+
+		return r;
+	},
+	
+	attr: function(elem, name, value){
+		var fix = jQuery.isXMLDoc(elem) ? {} : jQuery.props;
+
+		// Safari mis-reports the default selected property of a hidden option
+		// Accessing the parent's selectedIndex property fixes it
+		if ( name == "selected" && jQuery.browser.safari )
+			elem.parentNode.selectedIndex;
+		
+		// Certain attributes only work when accessed via the old DOM 0 way
+		if ( fix[name] ) {
+			if ( value != undefined ) elem[fix[name]] = value;
+			return elem[fix[name]];
+		} else if ( jQuery.browser.msie && name == "style" )
+			return jQuery.attr( elem.style, "cssText", value );
+
+		else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName(elem, "form") && (name == "action" || name == "method") )
+			return elem.getAttributeNode(name).nodeValue;
+
+		// IE elem.getAttribute passes even for style
+		else if ( elem.tagName ) {
+
+			if ( value != undefined ) {
+				if ( name == "type" && jQuery.nodeName(elem,"input") && elem.parentNode )
+					throw "type property can't be changed";
+				elem.setAttribute( name, value );
+			}
+
+			if ( jQuery.browser.msie && /href|src/.test(name) && !jQuery.isXMLDoc(elem) ) 
+				return elem.getAttribute( name, 2 );
+
+			return elem.getAttribute( name );
+
+		// elem is actually elem.style ... set the style
+		} else {
+			// IE actually uses filters for opacity
+			if ( name == "opacity" && jQuery.browser.msie ) {
+				if ( value != undefined ) {
+					// IE has trouble with opacity if it does not have layout
+					// Force it by setting the zoom level
+					elem.zoom = 1; 
+	
+					// Set the alpha filter to set the opacity
+					elem.filter = (elem.filter || "").replace(/alpha\([^)]*\)/,"") +
+						(parseFloat(value).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
+				}
+	
+				return elem.filter ? 
+					(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100).toString() : "";
+			}
+			name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});
+			if ( value != undefined ) elem[name] = value;
+			return elem[name];
+		}
+	},
+	
+	trim: function(t){
+		return (t||"").replace(/^\s+|\s+$/g, "");
+	},
+
+	makeArray: function( a ) {
+		var r = [];
+
+		// Need to use typeof to fight Safari childNodes crashes
+		if ( typeof a != "array" )
+			for ( var i = 0, al = a.length; i < al; i++ )
+				r.push( a[i] );
+		else
+			r = a.slice( 0 );
+
+		return r;
+	},
+
+	inArray: function( b, a ) {
+		for ( var i = 0, al = a.length; i < al; i++ )
+			if ( a[i] == b )
+				return i;
+		return -1;
+	},
+
+	merge: function(first, second) {
+		// We have to loop this way because IE & Opera overwrite the length
+		// expando of getElementsByTagName
+
+		// Also, we need to make sure that the correct elements are being returned
+		// (IE returns comment nodes in a '*' query)
+		if ( jQuery.browser.msie ) {
+			for ( var i = 0; second[i]; i++ )
+				if ( second[i].nodeType != 8 )
+					first.push(second[i]);
+		} else
+			for ( var i = 0; second[i]; i++ )
+				first.push(second[i]);
+
+		return first;
+	},
+
+	unique: function(first) {
+		var r = [], done = {};
+
+		try {
+			for ( var i = 0, fl = first.length; i < fl; i++ ) {
+				var id = jQuery.data(first[i]);
+				if ( !done[id] ) {
+					done[id] = true;
+					r.push(first[i]);
+				}
+			}
+		} catch(e) {
+			r = first;
+		}
+
+		return r;
+	},
+
+	grep: function(elems, fn, inv) {
+		// If a string is passed in for the function, make a function
+		// for it (a handy shortcut)
+		if ( typeof fn == "string" )
+			fn = eval("false||function(a,i){return " + fn + "}");
+
+		var result = [];
+
+		// Go through the array, only saving the items
+		// that pass the validator function
+		for ( var i = 0, el = elems.length; i < el; i++ )
+			if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )
+				result.push( elems[i] );
+
+		return result;
+	},
+
+	map: function(elems, fn) {
+		// If a string is passed in for the function, make a function
+		// for it (a handy shortcut)
+		if ( typeof fn == "string" )
+			fn = eval("false||function(a){return " + fn + "}");
+
+		var result = [];
+
+		// Go through the array, translating each of the items to their
+		// new value (or values).
+		for ( var i = 0, el = elems.length; i < el; i++ ) {
+			var val = fn(elems[i],i);
+
+			if ( val !== null && val != undefined ) {
+				if ( val.constructor != Array ) val = [val];
+				result = result.concat( val );
+			}
+		}
+
+		return result;
+	}
+});
+
+var userAgent = navigator.userAgent.toLowerCase();
+
+// Figure out what browser is being used
+jQuery.browser = {
+	version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
+	safari: /webkit/.test(userAgent),
+	opera: /opera/.test(userAgent),
+	msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
+	mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
+};
+
+var styleFloat = jQuery.browser.msie ? "styleFloat" : "cssFloat";
+	
+jQuery.extend({
+	// Check to see if the W3C box model is being used
+	boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",
+	
+	styleFloat: jQuery.browser.msie ? "styleFloat" : "cssFloat",
+	
+	props: {
+		"for": "htmlFor",
+		"class": "className",
+		"float": styleFloat,
+		cssFloat: styleFloat,
+		styleFloat: styleFloat,
+		innerHTML: "innerHTML",
+		className: "className",
+		value: "value",
+		disabled: "disabled",
+		checked: "checked",
+		readonly: "readOnly",
+		selected: "selected",
+		maxlength: "maxLength"
+	}
+});
+
+jQuery.each({
+	parent: "a.parentNode",
+	parents: "jQuery.dir(a,'parentNode')",
+	next: "jQuery.nth(a,2,'nextSibling')",
+	prev: "jQuery.nth(a,2,'previousSibling')",
+	nextAll: "jQuery.dir(a,'nextSibling')",
+	prevAll: "jQuery.dir(a,'previousSibling')",
+	siblings: "jQuery.sibling(a.parentNode.firstChild,a)",
+	children: "jQuery.sibling(a.firstChild)",
+	contents: "jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"
+}, function(i,n){
+	jQuery.fn[ i ] = function(a) {
+		var ret = jQuery.map(this,n);
+		if ( a && typeof a == "string" )
+			ret = jQuery.multiFilter(a,ret);
+		return this.pushStack( jQuery.unique(ret) );
+	};
+});
+
+jQuery.each({
+	appendTo: "append",
+	prependTo: "prepend",
+	insertBefore: "before",
+	insertAfter: "after",
+	replaceAll: "replaceWith"
+}, function(i,n){
+	jQuery.fn[ i ] = function(){
+		var a = arguments;
+		return this.each(function(){
+			for ( var j = 0, al = a.length; j < al; j++ )
+				jQuery(a[j])[n]( this );
+		});
+	};
+});
+
+jQuery.each( {
+	removeAttr: function( key ) {
+		jQuery.attr( this, key, "" );
+		this.removeAttribute( key );
+	},
+	addClass: function(c){
+		jQuery.className.add(this,c);
+	},
+	removeClass: function(c){
+		jQuery.className.remove(this,c);
+	},
+	toggleClass: function( c ){
+		jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this, c);
+	},
+	remove: function(a){
+		if ( !a || jQuery.filter( a, [this] ).r.length ) {
+			jQuery.removeData( this );
+			this.parentNode.removeChild( this );
+		}
+	},
+	empty: function() {
+		// Clean up the cache
+		jQuery("*", this).each(function(){ jQuery.removeData(this); });
+
+		while ( this.firstChild )
+			this.removeChild( this.firstChild );
+	}
+}, function(i,n){
+	jQuery.fn[ i ] = function() {
+		return this.each( n, arguments );
+	};
+});
+
+jQuery.each( [ "Height", "Width" ], function(i,name){
+	var n = name.toLowerCase();
+	
+	jQuery.fn[ n ] = function(h) {
+		return this[0] == window ?
+			jQuery.browser.safari && self["inner" + name] ||
+			jQuery.boxModel && Math.max(document.documentElement["client" + name], document.body["client" + name]) ||
+			document.body["client" + name] :
+		
+			this[0] == document ?
+				Math.max( document.body["scroll" + name], document.body["offset" + name] ) :
+        
+				h == undefined ?
+					( this.length ? jQuery.css( this[0], n ) : null ) :
+					this.css( n, h.constructor == String ? h : h + "px" );
+	};
+});
+
+var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
+		"(?:[\\w*_-]|\\\\.)" :
+		"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
+	quickChild = new RegExp("^>\\s*(" + chars + "+)"),
+	quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
+	quickClass = new RegExp("^([#.]?)(" + chars + "*)");
+
+jQuery.extend({
+	expr: {
+		"": "m[2]=='*'||jQuery.nodeName(a,m[2])",
+		"#": "a.getAttribute('id')==m[2]",
+		":": {
+			// Position Checks
+			lt: "i<m[3]-0",
+			gt: "i>m[3]-0",
+			nth: "m[3]-0==i",
+			eq: "m[3]-0==i",
+			first: "i==0",
+			last: "i==r.length-1",
+			even: "i%2==0",
+			odd: "i%2",
+
+			// Child Checks
+			"first-child": "a.parentNode.getElementsByTagName('*')[0]==a",
+			"last-child": "jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a",
+			"only-child": "!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",
+
+			// Parent Checks
+			parent: "a.firstChild",
+			empty: "!a.firstChild",
+
+			// Text Check
+			contains: "(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",
+
+			// Visibility
+			visible: '"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',
+			hidden: '"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',
+
+			// Form attributes
+			enabled: "!a.disabled",
+			disabled: "a.disabled",
+			checked: "a.checked",
+			selected: "a.selected||jQuery.attr(a,'selected')",
+
+			// Form elements
+			text: "'text'==a.type",
+			radio: "'radio'==a.type",
+			checkbox: "'checkbox'==a.type",
+			file: "'file'==a.type",
+			password: "'password'==a.type",
+			submit: "'submit'==a.type",
+			image: "'image'==a.type",
+			reset: "'reset'==a.type",
+			button: '"button"==a.type||jQuery.nodeName(a,"button")',
+			input: "/input|select|textarea|button/i.test(a.nodeName)",
+
+			// :has()
+			has: "jQuery.find(m[3],a).length",
+
+			// :header
+			header: "/h\\d/i.test(a.nodeName)",
+
+			// :animated
+			animated: "jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"
+		}
+	},
+	
+	// The regular expressions that power the parsing engine
+	parse: [
+		// Match: [@value='test'], [@foo]
+		/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,
+
+		// Match: :contains('foo')
+		/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,
+
+		// Match: :even, :last-chlid, #id, .class
+		new RegExp("^([:.#]*)(" + chars + "+)")
+	],
+
+	multiFilter: function( expr, elems, not ) {
+		var old, cur = [];
+
+		while ( expr && expr != old ) {
+			old = expr;
+			var f = jQuery.filter( expr, elems, not );
+			expr = f.t.replace(/^\s*,\s*/, "" );
+			cur = not ? elems = f.r : jQuery.merge( cur, f.r );
+		}
+
+		return cur;
+	},
+
+	find: function( t, context ) {
+		// Quickly handle non-string expressions
+		if ( typeof t != "string" )
+			return [ t ];
+
+		// Make sure that the context is a DOM Element
+		if ( context && !context.nodeType )
+			context = null;
+
+		// Set the correct context (if none is provided)
+		context = context || document;
+
+		// Initialize the search
+		var ret = [context], done = [], last;
+
+		// Continue while a selector expression exists, and while
+		// we're no longer looping upon ourselves
+		while ( t && last != t ) {
+			var r = [];
+			last = t;
+
+			t = jQuery.trim(t);
+
+			var foundToken = false;
+
+			// An attempt at speeding up child selectors that
+			// point to a specific element tag
+			var re = quickChild;
+			var m = re.exec(t);
+
+			if ( m ) {
+				var nodeName = m[1].toUpperCase();
+
+				// Perform our own iteration and filter
+				for ( var i = 0; ret[i]; i++ )
+					for ( var c = ret[i].firstChild; c; c = c.nextSibling )
+						if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName.toUpperCase()) )
+							r.push( c );
+
+				ret = r;
+				t = t.replace( re, "" );
+				if ( t.indexOf(" ") == 0 ) continue;
+				foundToken = true;
+			} else {
+				re = /^([>+~])\s*(\w*)/i;
+
+				if ( (m = re.exec(t)) != null ) {
+					r = [];
+
+					var nodeName = m[2], merge = {};
+					m = m[1];
+
+					for ( var j = 0, rl = ret.length; j < rl; j++ ) {
+						var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
+						for ( ; n; n = n.nextSibling )
+							if ( n.nodeType == 1 ) {
+								var id = jQuery.data(n);
+
+								if ( m == "~" && merge[id] ) break;
+								
+								if (!nodeName || n.nodeName.toUpperCase() == nodeName.toUpperCase() ) {
+									if ( m == "~" ) merge[id] = true;
+									r.push( n );
+								}
+								
+								if ( m == "+" ) break;
+							}
+					}
+
+					ret = r;
+
+					// And remove the token
+					t = jQuery.trim( t.replace( re, "" ) );
+					foundToken = true;
+				}
+			}
+
+			// See if there's still an expression, and that we haven't already
+			// matched a token
+			if ( t && !foundToken ) {
+				// Handle multiple expressions
+				if ( !t.indexOf(",") ) {
+					// Clean the result set
+					if ( context == ret[0] ) ret.shift();
+
+					// Merge the result sets
+					done = jQuery.merge( done, ret );
+
+					// Reset the context
+					r = ret = [context];
+
+					// Touch up the selector string
+					t = " " + t.substr(1,t.length);
+
+				} else {
+					// Optimize for the case nodeName#idName
+					var re2 = quickID;
+					var m = re2.exec(t);
+					
+					// Re-organize the results, so that they're consistent
+					if ( m ) {
+					   m = [ 0, m[2], m[3], m[1] ];
+
+					} else {
+						// Otherwise, do a traditional filter check for
+						// ID, class, and element selectors
+						re2 = quickClass;
+						m = re2.exec(t);
+					}
+
+					m[2] = m[2].replace(/\\/g, "");
+
+					var elem = ret[ret.length-1];
+
+					// Try to do a global search by ID, where we can
+					if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
+						// Optimization for HTML document case
+						var oid = elem.getElementById(m[2]);
+						
+						// Do a quick check for the existence of the actual ID attribute
+						// to avoid selecting by the name attribute in IE
+						// also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
+						if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
+							oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
+
+						// Do a quick check for node name (where applicable) so
+						// that div#foo searches will be really fast
+						ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
+					} else {
+						// We need to find all descendant elements
+						for ( var i = 0; ret[i]; i++ ) {
+							// Grab the tag name being searched for
+							var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];
+
+							// Handle IE7 being really dumb about <object>s
+							if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
+								tag = "param";
+
+							r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
+						}
+
+						// It's faster to filter by class and be done with it
+						if ( m[1] == "." )
+							r = jQuery.classFilter( r, m[2] );
+
+						// Same with ID filtering
+						if ( m[1] == "#" ) {
+							var tmp = [];
+
+							// Try to find the element with the ID
+							for ( var i = 0; r[i]; i++ )
+								if ( r[i].getAttribute("id") == m[2] ) {
+									tmp = [ r[i] ];
+									break;
+								}
+
+							r = tmp;
+						}
+
+						ret = r;
+					}
+
+					t = t.replace( re2, "" );
+				}
+
+			}
+
+			// If a selector string still exists
+			if ( t ) {
+				// Attempt to filter it
+				var val = jQuery.filter(t,r);
+				ret = r = val.r;
+				t = jQuery.trim(val.t);
+			}
+		}
+
+		// An error occurred with the selector;
+		// just return an empty set instead
+		if ( t )
+			ret = [];
+
+		// Remove the root context
+		if ( ret && context == ret[0] )
+			ret.shift();
+
+		// And combine the results
+		done = jQuery.merge( done, ret );
+
+		return done;
+	},
+
+	classFilter: function(r,m,not){
+		m = " " + m + " ";
+		var tmp = [];
+		for ( var i = 0; r[i]; i++ ) {
+			var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
+			if ( !not && pass || not && !pass )
+				tmp.push( r[i] );
+		}
+		return tmp;
+	},
+
+	filter: function(t,r,not) {
+		var last;
+
+		// Look for common filter expressions
+		while ( t  && t != last ) {
+			last = t;
+
+			var p = jQuery.parse, m;
+
+			for ( var i = 0; p[i]; i++ ) {
+				m = p[i].exec( t );
+
+				if ( m ) {
+					// Remove what we just matched
+					t = t.substring( m[0].length );
+
+					m[2] = m[2].replace(/\\/g, "");
+					break;
+				}
+			}
+
+			if ( !m )
+				break;
+
+			// :not() is a special case that can be optimized by
+			// keeping it out of the expression list
+			if ( m[1] == ":" && m[2] == "not" )
+				r = jQuery.filter(m[3], r, true).r;
+
+			// We can get a big speed boost by filtering by class here
+			else if ( m[1] == "." )
+				r = jQuery.classFilter(r, m[2], not);
+
+			else if ( m[1] == "[" ) {
+				var tmp = [], type = m[3];
+				
+				for ( var i = 0, rl = r.length; i < rl; i++ ) {
+					var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
+					
+					if ( z == null || /href|src|selected/.test(m[2]) )
+						z = jQuery.attr(a,m[2]) || '';
+
+					if ( (type == "" && !!z ||
+						 type == "=" && z == m[5] ||
+						 type == "!=" && z != m[5] ||
+						 type == "^=" && z && !z.indexOf(m[5]) ||
+						 type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
+						 (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
+							tmp.push( a );
+				}
+				
+				r = tmp;
+
+			// We can get a speed boost by handling nth-child here
+			} else if ( m[1] == ":" && m[2] == "nth-child" ) {
+				var merge = {}, tmp = [],
+					test = /(\d*)n\+?(\d*)/.exec(
+						m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
+						!/\D/.test(m[3]) && "n+" + m[3] || m[3]),
+					first = (test[1] || 1) - 0, last = test[2] - 0;
+
+				for ( var i = 0, rl = r.length; i < rl; i++ ) {
+					var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);
+
+					if ( !merge[id] ) {
+						var c = 1;
+
+						for ( var n = parentNode.firstChild; n; n = n.nextSibling )
+							if ( n.nodeType == 1 )
+								n.nodeIndex = c++;
+
+						merge[id] = true;
+					}
+
+					var add = false;
+
+					if ( first == 1 ) {
+						if ( last == 0 || node.nodeIndex == last )
+							add = true;
+					} else if ( (node.nodeIndex + last) % first == 0 )
+						add = true;
+
+					if ( add ^ not )
+						tmp.push( node );
+				}
+
+				r = tmp;
+
+			// Otherwise, find the expression to execute
+			} else {
+				var f = jQuery.expr[m[1]];
+				if ( typeof f != "string" )
+					f = jQuery.expr[m[1]][m[2]];
+
+				// Build a custom macro to enclose it
+				f = eval("false||function(a,i){return " + f + "}");
+
+				// Execute it against the current filter
+				r = jQuery.grep( r, f, not );
+			}
+		}
+
+		// Return an array of filtered elements (r)
+		// and the modified expression string (t)
+		return { r: r, t: t };
+	},
+
+	dir: function( elem, dir ){
+		var matched = [];
+		var cur = elem[dir];
+		while ( cur && cur != document ) {
+			if ( cur.nodeType == 1 )
+				matched.push( cur );
+			cur = cur[dir];
+		}
+		return matched;
+	},
+	
+	nth: function(cur,result,dir,elem){
+		result = result || 1;
+		var num = 0;
+
+		for ( ; cur; cur = cur[dir] )
+			if ( cur.nodeType == 1 && ++num == result )
+				break;
+
+		return cur;
+	},
+	
+	sibling: function( n, elem ) {
+		var r = [];
+
+		for ( ; n; n = n.nextSibling ) {
+			if ( n.nodeType == 1 && (!elem || n != elem) )
+				r.push( n );
+		}
+
+		return r;
+	}
+});
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code orignated from 
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+	// Bind an event to an element
+	// Original by Dean Edwards
+	add: function(element, type, handler, data) {
+		// For whatever reason, IE has trouble passing the window object
+		// around, causing it to be cloned in the process
+		if ( jQuery.browser.msie && element.setInterval != undefined )
+			element = window;
+
+		// Make sure that the function being executed has a unique ID
+		if ( !handler.guid )
+			handler.guid = this.guid++;
+			
+		// if data is passed, bind to handler 
+		if( data != undefined ) { 
+        		// Create temporary function pointer to original handler 
+			var fn = handler; 
+
+			// Create unique handler function, wrapped around original handler 
+			handler = function() { 
+				// Pass arguments and context to original handler 
+				return fn.apply(this, arguments); 
+			};
+
+			// Store data in unique handler 
+			handler.data = data;
+
+			// Set the guid of unique handler to the same of original handler, so it can be removed 
+			handler.guid = fn.guid;
+		}
+
+		// Namespaced event handlers
+		var parts = type.split(".");
+		type = parts[0];
+		handler.type = parts[1];
+
+		// Init the element's event structure
+		var events = jQuery.data(element, "events") || jQuery.data(element, "events", {});
+		
+		var handle = jQuery.data(element, "handle", function(){
+			// returned undefined or false
+			var val;
+
+			// Handle the second event of a trigger and when
+			// an event is called after a page has unloaded
+			if ( typeof jQuery == "undefined" || jQuery.event.triggered )
+				return val;
+			
+			val = jQuery.event.handle.apply(element, arguments);
+			
+			return val;
+		});
+
+		// Get the current list of functions bound to this event
+		var handlers = events[type];
+
+		// Init the event handler queue
+		if (!handlers) {
+			handlers = events[type] = {};	
+			
+			// And bind the global event handler to the element
+			if (element.addEventListener)
+				element.addEventListener(type, handle, false);
+			else
+				element.attachEvent("on" + type, handle);
+		}
+
+		// Add the function to the element's handler list
+		handlers[handler.guid] = handler;
+
+		// Keep track of which events have been used, for global triggering
+		this.global[type] = true;
+	},
+
+	guid: 1,
+	global: {},
+
+	// Detach an event or set of events from an element
+	remove: function(element, type, handler) {
+		var events = jQuery.data(element, "events"), ret, index;
+
+		// Namespaced event handlers
+		if ( typeof type == "string" ) {
+			var parts = type.split(".");
+			type = parts[0];
+		}
+
+		if ( events ) {
+			// type is actually an event object here
+			if ( type && type.type ) {
+				handler = type.handler;
+				type = type.type;
+			}
+			
+			if ( !type ) {
+				for ( type in events )
+					this.remove( element, type );
+
+			} else if ( events[type] ) {
+				// remove the given handler for the given type
+				if ( handler )
+					delete events[type][handler.guid];
+				
+				// remove all handlers for the given type
+				else
+					for ( handler in events[type] )
+						// Handle the removal of namespaced events
+						if ( !parts[1] || events[type][handler].type == parts[1] )
+							delete events[type][handler];
+
+				// remove generic event handler if no more handlers exist
+				for ( ret in events[type] ) break;
+				if ( !ret ) {
+					if (element.removeEventListener)
+						element.removeEventListener(type, jQuery.data(element, "handle"), false);
+					else
+						element.detachEvent("on" + type, jQuery.data(element, "handle"));
+					ret = null;
+					delete events[type];
+				}
+			}
+
+			// Remove the expando if it's no longer used
+			for ( ret in events ) break;
+			if ( !ret ) {
+				jQuery.removeData( element, "events" );
+				jQuery.removeData( element, "handle" );
+			}
+		}
+	},
+
+	trigger: function(type, data, element, donative, extra) {
+		// Clone the incoming data, if any
+		data = jQuery.makeArray(data || []);
+
+		// Handle a global trigger
+		if ( !element ) {
+			// Only trigger if we've ever bound an event for it
+			if ( this.global[type] )
+				jQuery("*").add([window, document]).trigger(type, data);
+
+		// Handle triggering a single element
+		} else {
+			var val, ret, fn = jQuery.isFunction( element[ type ] || null ),
+				// Check to see if we need to provide a fake event, or not
+				evt = !data[0] || !data[0].preventDefault;
+			
+			// Pass along a fake event
+			if ( evt )
+				data.unshift( this.fix({ type: type, target: element }) );
+
+			// Enforce the right trigger type
+			data[0].type = type;
+
+			// Trigger the event
+			if ( jQuery.isFunction( jQuery.data(element, "handle") ) )
+				val = jQuery.data(element, "handle").apply( element, data );
+
+			// Handle triggering native .onfoo handlers
+			if ( !fn && element["on"+type] && element["on"+type].apply( element, data ) === false )
+				val = false;
+
+			// Extra functions don't get the custom event object
+			if ( evt )
+				data.shift();
+
+			// Handle triggering of extra function
+			if ( extra && extra.apply( element, data ) === false )
+				val = false;
+
+			// Trigger the native events (except for clicks on links)
+			if ( fn && donative !== false && val !== false && !(jQuery.nodeName(element, 'a') && type == "click") ) {
+				this.triggered = true;
+				element[ type ]();
+			}
+
+			this.triggered = false;
+		}
+
+		return val;
+	},
+
+	handle: function(event) {
+		// returned undefined or false
+		var val;
+
+		// Empty object is for triggered events with no data
+		event = jQuery.event.fix( event || window.event || {} ); 
+
+		// Namespaced event handlers
+		var parts = event.type.split(".");
+		event.type = parts[0];
+
+		var c = jQuery.data(this, "events") && jQuery.data(this, "events")[event.type], args = Array.prototype.slice.call( arguments, 1 );
+		args.unshift( event );
+
+		for ( var j in c ) {
+			// Pass in a reference to the handler function itself
+			// So that we can later remove it
+			args[0].handler = c[j];
+			args[0].data = c[j].data;
+
+			// Filter the functions by class
+			if ( !parts[1] || c[j].type == parts[1] ) {
+				var tmp = c[j].apply( this, args );
+
+				if ( val !== false )
+					val = tmp;
+
+				if ( tmp === false ) {
+					event.preventDefault();
+					event.stopPropagation();
+				}
+			}
+		}
+
+		// Clean up added properties in IE to prevent memory leak
+		if (jQuery.browser.msie)
+			event.target = event.preventDefault = event.stopPropagation =
+				event.handler = event.data = null;
+
+		return val;
+	},
+
+	fix: function(event) {
+		// store a copy of the original event object 
+		// and clone to set read-only properties
+		var originalEvent = event;
+		event = jQuery.extend({}, originalEvent);
+		
+		// add preventDefault and stopPropagation since 
+		// they will not work on the clone
+		event.preventDefault = function() {
+			// if preventDefault exists run it on the original event
+			if (originalEvent.preventDefault)
+				originalEvent.preventDefault();
+			// otherwise set the returnValue property of the original event to false (IE)
+			originalEvent.returnValue = false;
+		};
+		event.stopPropagation = function() {
+			// if stopPropagation exists run it on the original event
+			if (originalEvent.stopPropagation)
+				originalEvent.stopPropagation();
+			// otherwise set the cancelBubble property of the original event to true (IE)
+			originalEvent.cancelBubble = true;
+		};
+		
+		// Fix target property, if necessary
+		if ( !event.target && event.srcElement )
+			event.target = event.srcElement;
+				
+		// check if target is a textnode (safari)
+		if (jQuery.browser.safari && event.target.nodeType == 3)
+			event.target = originalEvent.target.parentNode;
+
+		// Add relatedTarget, if necessary
+		if ( !event.relatedTarget && event.fromElement )
+			event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
+
+		// Calculate pageX/Y if missing and clientX/Y available
+		if ( event.pageX == null && event.clientX != null ) {
+			var e = document.documentElement, b = document.body;
+			event.pageX = event.clientX + (e && e.scrollLeft || b.scrollLeft || 0);
+			event.pageY = event.clientY + (e && e.scrollTop || b.scrollTop || 0);
+		}
+			
+		// Add which for key events
+		if ( !event.which && (event.charCode || event.keyCode) )
+			event.which = event.charCode || event.keyCode;
+		
+		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+		if ( !event.metaKey && event.ctrlKey )
+			event.metaKey = event.ctrlKey;
+
+		// Add which for click: 1 == left; 2 == middle; 3 == right
+		// Note: button is not normalized, so don't use it
+		if ( !event.which && event.button )
+			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+			
+		return event;
+	}
+};
+
+jQuery.fn.extend({
+	bind: function( type, data, fn ) {
+		return type == "unload" ? this.one(type, data, fn) : this.each(function(){
+			jQuery.event.add( this, type, fn || data, fn && data );
+		});
+	},
+	
+	one: function( type, data, fn ) {
+		return this.each(function(){
+			jQuery.event.add( this, type, function(event) {
+				jQuery(this).unbind(event);
+				return (fn || data).apply( this, arguments);
+			}, fn && data);
+		});
+	},
+
+	unbind: function( type, fn ) {
+		return this.each(function(){
+			jQuery.event.remove( this, type, fn );
+		});
+	},
+
+	trigger: function( type, data, fn ) {
+		return this.each(function(){
+			jQuery.event.trigger( type, data, this, true, fn );
+		});
+	},
+
+	triggerHandler: function( type, data, fn ) {
+		if ( this[0] )
+			return jQuery.event.trigger( type, data, this[0], false, fn );
+	},
+
+	toggle: function() {
+		// Save reference to arguments for access in closure
+		var a = arguments;
+
+		return this.click(function(e) {
+			// Figure out which function to execute
+			this.lastToggle = 0 == this.lastToggle ? 1 : 0;
+			
+			// Make sure that clicks stop
+			e.preventDefault();
+			
+			// and execute the function
+			return a[this.lastToggle].apply( this, [e] ) || false;
+		});
+	},
+
+	hover: function(f,g) {
+		
+		// A private function for handling mouse 'hovering'
+		function handleHover(e) {
+			// Check if mouse(over|out) are still within the same parent element
+			var p = e.relatedTarget;
+	
+			// Traverse up the tree
+			while ( p && p != this ) try { p = p.parentNode; } catch(e) { p = this; };
+			
+			// If we actually just moused on to a sub-element, ignore it
+			if ( p == this ) return false;
+			
+			// Execute the right function
+			return (e.type == "mouseover" ? f : g).apply(this, [e]);
+		}
+		
+		// Bind the function to the two event listeners
+		return this.mouseover(handleHover).mouseout(handleHover);
+	},
+	
+	ready: function(f) {
+		// Attach the listeners
+		bindReady();
+
+		// If the DOM is already ready
+		if ( jQuery.isReady )
+			// Execute the function immediately
+			f.apply( document, [jQuery] );
+			
+		// Otherwise, remember the function for later
+		else
+			// Add the function to the wait list
+			jQuery.readyList.push( function() { return f.apply(this, [jQuery]); } );
+	
+		return this;
+	}
+});
+
+jQuery.extend({
+	/*
+	 * All the code that makes DOM Ready work nicely.
+	 */
+	isReady: false,
+	readyList: [],
+	
+	// Handle when the DOM is ready
+	ready: function() {
+		// Make sure that the DOM is not already loaded
+		if ( !jQuery.isReady ) {
+			// Remember that the DOM is ready
+			jQuery.isReady = true;
+			
+			// If there are functions bound, to execute
+			if ( jQuery.readyList ) {
+				// Execute all of them
+				jQuery.each( jQuery.readyList, function(){
+					this.apply( document );
+				});
+				
+				// Reset the list of functions
+				jQuery.readyList = null;
+			}
+			// Remove event listener to avoid memory leak
+			if ( jQuery.browser.mozilla || jQuery.browser.opera )
+				document.removeEventListener( "DOMContentLoaded", jQuery.ready, false );
+			
+			// Remove script element used by IE hack
+			if( !window.frames.length ) // don't remove if frames are present (#1187)
+				jQuery(window).load(function(){ jQuery("#__ie_init").remove(); });
+		}
+	}
+});
+
+jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
+	"mousedown,mouseup,mousemove,mouseover,mouseout,change,select," + 
+	"submit,keydown,keypress,keyup,error").split(","), function(i,o){
+	
+	// Handle event binding
+	jQuery.fn[o] = function(f){
+		return f ? this.bind(o, f) : this.trigger(o);
+	};
+});
+
+var readyBound = false;
+
+function bindReady(){
+	if ( readyBound ) return;
+	readyBound = true;
+
+	// If Mozilla is used
+	if ( jQuery.browser.mozilla || jQuery.browser.opera )
+		// Use the handy event callback
+		document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
+	
+	// If IE is used, use the excellent hack by Matthias Miller
+	// http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited
+	else if ( jQuery.browser.msie ) {
+	
+		// Only works if you document.write() it
+		document.write("<scr" + "ipt id=__ie_init defer=true " + 
+			"src=//:><\/script>");
+	
+		// Use the defer script hack
+		var script = document.getElementById("__ie_init");
+		
+		// script does not exist if jQuery is loaded dynamically
+		if ( script ) 
+			script.onreadystatechange = function() {
+				if ( this.readyState != "complete" ) return;
+				jQuery.ready();
+			};
+	
+		// Clear from memory
+		script = null;
+	
+	// If Safari  is used
+	} else if ( jQuery.browser.safari )
+		// Continually check to see if the document.readyState is valid
+		jQuery.safariTimer = setInterval(function(){
+			// loaded and complete are both valid states
+			if ( document.readyState == "loaded" || 
+				document.readyState == "complete" ) {
+	
+				// If either one are found, remove the timer
+				clearInterval( jQuery.safariTimer );
+				jQuery.safariTimer = null;
+	
+				// and execute any waiting functions
+				jQuery.ready();
+			}
+		}, 10); 
+
+	// A fallback to window.onload, that will always work
+	jQuery.event.add( window, "load", jQuery.ready );
+}
+jQuery.fn.extend({
+	load: function( url, params, callback ) {
+		if ( jQuery.isFunction( url ) )
+			return this.bind("load", url);
+
+		var off = url.indexOf(" ");
+		if ( off >= 0 ) {
+			var selector = url.slice(off, url.length);
+			url = url.slice(0, off);
+		}
+
+		callback = callback || function(){};
+
+		// Default to a GET request
+		var type = "GET";
+
+		// If the second parameter was provided
+		if ( params )
+			// If it's a function
+			if ( jQuery.isFunction( params ) ) {
+				// We assume that it's the callback
+				callback = params;
+				params = null;
+
+			// Otherwise, build a param string
+			} else {
+				params = jQuery.param( params );
+				type = "POST";
+			}
+
+		var self = this;
+
+		// Request the remote document
+		jQuery.ajax({
+			url: url,
+			type: type,
+			data: params,
+			complete: function(res, status){
+				// If successful, inject the HTML into all the matched elements
+				if ( status == "success" || status == "notmodified" )
+					// See if a selector was specified
+					self.html( selector ?
+						// Create a dummy div to hold the results
+						jQuery("<div/>")
+							// inject the contents of the document in, removing the scripts
+							// to avoid any 'Permission Denied' errors in IE
+							.append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
+
+							// Locate the specified elements
+							.find(selector) :
+
+						// If not, just inject the full result
+						res.responseText );
+
+				// Add delay to account for Safari's delay in globalEval
+				setTimeout(function(){
+					self.each( callback, [res.responseText, status, res] );
+				}, 13);
+			}
+		});
+		return this;
+	},
+
+	serialize: function() {
+		return jQuery.param(this.serializeArray());
+	},
+	serializeArray: function() {
+		return this.map(function(){
+			return jQuery.nodeName(this, "form") ?
+				jQuery.makeArray(this.elements) : this;
+		})
+		.filter(function(){
+			return this.name && !this.disabled && 
+				(this.checked || /select|textarea/i.test(this.nodeName) || 
+					/text|hidden|password/i.test(this.type));
+		})
+		.map(function(i, elem){
+			var val = jQuery(this).val();
+			return val == null ? null :
+				val.constructor == Array ?
+					jQuery.map( val, function(val, i){
+						return {name: elem.name, value: val};
+					}) :
+					{name: elem.name, value: val};
+		}).get();
+	}
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
+	jQuery.fn[o] = function(f){
+		return this.bind(o, f);
+	};
+});
+
+var jsc = (new Date).getTime();
+
+jQuery.extend({
+	get: function( url, data, callback, type ) {
+		// shift arguments if data argument was ommited
+		if ( jQuery.isFunction( data ) ) {
+			callback = data;
+			data = null;
+		}
+		
+		return jQuery.ajax({
+			type: "GET",
+			url: url,
+			data: data,
+			success: callback,
+			dataType: type
+		});
+	},
+
+	getScript: function( url, callback ) {
+		return jQuery.get(url, null, callback, "script");
+	},
+
+	getJSON: function( url, data, callback ) {
+		return jQuery.get(url, data, callback, "json");
+	},
+
+	post: function( url, data, callback, type ) {
+		if ( jQuery.isFunction( data ) ) {
+			callback = data;
+			data = {};
+		}
+
+		return jQuery.ajax({
+			type: "POST",
+			url: url,
+			data: data,
+			success: callback,
+			dataType: type
+		});
+	},
+
+	ajaxSetup: function( settings ) {
+		jQuery.extend( jQuery.ajaxSettings, settings );
+	},
+
+	ajaxSettings: {
+		global: true,
+		type: "GET",
+		timeout: 0,
+		contentType: "application/x-www-form-urlencoded",
+		processData: true,
+		async: true,
+		data: null
+	},
+	
+	// Last-Modified header cache for next request
+	lastModified: {},
+
+	ajax: function( s ) {
+		var jsonp, jsre = /=(\?|%3F)/g, status, data;
+
+		// Extend the settings, but re-extend 's' so that it can be
+		// checked again later (in the test suite, specifically)
+		s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
+
+		// convert data if not already a string
+		if ( s.data && s.processData && typeof s.data != "string" )
+			s.data = jQuery.param(s.data);
+
+		// Handle JSONP Parameter Callbacks
+		if ( s.dataType == "jsonp" ) {
+			if ( s.type.toLowerCase() == "get" ) {
+				if ( !s.url.match(jsre) )
+					s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
+			} else if ( !s.data || !s.data.match(jsre) )
+				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
+			s.dataType = "json";
+		}
+
+		// Build temporary JSONP function
+		if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
+			jsonp = "jsonp" + jsc++;
+
+			// Replace the =? sequence both in the query string and the data
+			if ( s.data )
+				s.data = s.data.replace(jsre, "=" + jsonp);
+			s.url = s.url.replace(jsre, "=" + jsonp);
+
+			// We need to make sure
+			// that a JSONP style response is executed properly
+			s.dataType = "script";
+
+			// Handle JSONP-style loading
+			window[ jsonp ] = function(tmp){
+				data = tmp;
+				success();
+				complete();
+				// Garbage collect
+				window[ jsonp ] = undefined;
+				try{ delete window[ jsonp ]; } catch(e){}
+			};
+		}
+
+		if ( s.dataType == "script" && s.cache == null )
+			s.cache = false;
+
+		if ( s.cache === false && s.type.toLowerCase() == "get" )
+			s.url += (s.url.match(/\?/) ? "&" : "?") + "_=" + (new Date()).getTime();
+
+		// If data is available, append data to url for get requests
+		if ( s.data && s.type.toLowerCase() == "get" ) {
+			s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
+
+			// IE likes to send both get and post data, prevent this
+			s.data = null;
+		}
+
+		// Watch for a new set of requests
+		if ( s.global && ! jQuery.active++ )
+			jQuery.event.trigger( "ajaxStart" );
+
+		// If we're requesting a remote document
+		// and trying to load JSON or Script
+		if ( !s.url.indexOf("http") && s.dataType == "script" ) {
+			var head = document.getElementsByTagName("head")[0];
+			var script = document.createElement("script");
+			script.src = s.url;
+
+			// Handle Script loading
+			if ( !jsonp && (s.success || s.complete) ) {
+				var done = false;
+
+				// Attach handlers for all browsers
+				script.onload = script.onreadystatechange = function(){
+					if ( !done && (!this.readyState || 
+							this.readyState == "loaded" || this.readyState == "complete") ) {
+						done = true;
+						success();
+						complete();
+						head.removeChild( script );
+					}
+				};
+			}
+
+			head.appendChild(script);
+
+			// We handle everything using the script element injection
+			return;
+		}
+
+		var requestDone = false;
+
+		// Create the request object; Microsoft failed to properly
+		// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
+		var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
+
+		// Open the socket
+		xml.open(s.type, s.url, s.async);
+
+		// Set the correct header, if data is being sent
+		if ( s.data )
+			xml.setRequestHeader("Content-Type", s.contentType);
+
+		// Set the If-Modified-Since header, if ifModified mode.
+		if ( s.ifModified )
+			xml.setRequestHeader("If-Modified-Since",
+				jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
+
+		// Set header so the called script knows that it's an XMLHttpRequest
+		xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+
+		// Allow custom headers/mimetypes
+		if ( s.beforeSend )
+			s.beforeSend(xml);
+			
+		if ( s.global )
+		    jQuery.event.trigger("ajaxSend", [xml, s]);
+
+		// Wait for a response to come back
+		var onreadystatechange = function(isTimeout){
+			// The transfer is complete and the data is available, or the request timed out
+			if ( !requestDone && xml && (xml.readyState == 4 || isTimeout == "timeout") ) {
+				requestDone = true;
+				
+				// clear poll interval
+				if (ival) {
+					clearInterval(ival);
+					ival = null;
+				}
+				
+				status = isTimeout == "timeout" && "timeout" ||
+					!jQuery.httpSuccess( xml ) && "error" ||
+					s.ifModified && jQuery.httpNotModified( xml, s.url ) && "notmodified" ||
+					"success";
+
+				if ( status == "success" ) {
+					// Watch for, and catch, XML document parse errors
+					try {
+						// process the data (runs the xml through httpData regardless of callback)
+						data = jQuery.httpData( xml, s.dataType );
+					} catch(e) {
+						status = "parsererror";
+					}
+				}
+
+				// Make sure that the request was successful or notmodified
+				if ( status == "success" ) {
+					// Cache Last-Modified header, if ifModified mode.
+					var modRes;
+					try {
+						modRes = xml.getResponseHeader("Last-Modified");
+					} catch(e) {} // swallow exception thrown by FF if header is not available
+	
+					if ( s.ifModified && modRes )
+						jQuery.lastModified[s.url] = modRes;
+
+					// JSONP handles its own success callback
+					if ( !jsonp )
+						success();	
+				} else
+					jQuery.handleError(s, xml, status);
+
+				// Fire the complete handlers
+				complete();
+
+				// Stop memory leaks
+				if ( s.async )
+					xml = null;
+			}
+		};
+		
+		if ( s.async ) {
+			// don't attach the handler to the request, just poll it instead
+			var ival = setInterval(onreadystatechange, 13); 
+
+			// Timeout checker
+			if ( s.timeout > 0 )
+				setTimeout(function(){
+					// Check to see if the request is still happening
+					if ( xml ) {
+						// Cancel the request
+						xml.abort();
+	
+						if( !requestDone )
+							onreadystatechange( "timeout" );
+					}
+				}, s.timeout);
+		}
+			
+		// Send the data
+		try {
+			xml.send(s.data);
+		} catch(e) {
+			jQuery.handleError(s, xml, null, e);
+		}
+		
+		// firefox 1.5 doesn't fire statechange for sync requests
+		if ( !s.async )
+			onreadystatechange();
+		
+		// return XMLHttpRequest to allow aborting the request etc.
+		return xml;
+
+		function success(){
+			// If a local callback was specified, fire it and pass it the data
+			if ( s.success )
+				s.success( data, status );
+
+			// Fire the global callback
+			if ( s.global )
+				jQuery.event.trigger( "ajaxSuccess", [xml, s] );
+		}
+
+		function complete(){
+			// Process result
+			if ( s.complete )
+				s.complete(xml, status);
+
+			// The request was completed
+			if ( s.global )
+				jQuery.event.trigger( "ajaxComplete", [xml, s] );
+
+			// Handle the global AJAX counter
+			if ( s.global && ! --jQuery.active )
+				jQuery.event.trigger( "ajaxStop" );
+		}
+	},
+
+	handleError: function( s, xml, status, e ) {
+		// If a local callback was specified, fire it
+		if ( s.error ) s.error( xml, status, e );
+
+		// Fire the global callback
+		if ( s.global )
+			jQuery.event.trigger( "ajaxError", [xml, s, e] );
+	},
+
+	// Counter for holding the number of active queries
+	active: 0,
+
+	// Determines if an XMLHttpRequest was successful or not
+	httpSuccess: function( r ) {
+		try {
+			return !r.status && location.protocol == "file:" ||
+				( r.status >= 200 && r.status < 300 ) || r.status == 304 ||
+				jQuery.browser.safari && r.status == undefined;
+		} catch(e){}
+		return false;
+	},
+
+	// Determines if an XMLHttpRequest returns NotModified
+	httpNotModified: function( xml, url ) {
+		try {
+			var xmlRes = xml.getResponseHeader("Last-Modified");
+
+			// Firefox always returns 200. check Last-Modified date
+			return xml.status == 304 || xmlRes == jQuery.lastModified[url] ||
+				jQuery.browser.safari && xml.status == undefined;
+		} catch(e){}
+		return false;
+	},
+
+	httpData: function( r, type ) {
+		var ct = r.getResponseHeader("content-type");
+		var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0;
+		var data = xml ? r.responseXML : r.responseText;
+
+		if ( xml && data.documentElement.tagName == "parsererror" )
+			throw "parsererror";
+
+		// If the type is "script", eval it in global context
+		if ( type == "script" )
+			jQuery.globalEval( data );
+
+		// Get the JavaScript object, if JSON is used.
+		if ( type == "json" )
+			data = eval("(" + data + ")");
+
+		return data;
+	},
+
+	// Serialize an array of form elements or a set of
+	// key/values into a query string
+	param: function( a ) {
+		var s = [];
+
+		// If an array was passed in, assume that it is an array
+		// of form elements
+		if ( a.constructor == Array || a.jquery )
+			// Serialize the form elements
+			jQuery.each( a, function(){
+				s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) );
+			});
+
+		// Otherwise, assume that it's an object of key/value pairs
+		else
+			// Serialize the key/values
+			for ( var j in a )
+				// If the value is an array then the key names need to be repeated
+				if ( a[j] && a[j].constructor == Array )
+					jQuery.each( a[j], function(){
+						s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) );
+					});
+				else
+					s.push( encodeURIComponent(j) + "=" + encodeURIComponent( a[j] ) );
+
+		// Return the resulting serialization
+		return s.join("&").replace(/%20/g, "+");
+	}
+
+});
+jQuery.fn.extend({
+	show: function(speed,callback){
+		return speed ?
+			this.animate({
+				height: "show", width: "show", opacity: "show"
+			}, speed, callback) :
+			
+			this.filter(":hidden").each(function(){
+				this.style.display = this.oldblock ? this.oldblock : "";
+				if ( jQuery.css(this,"display") == "none" )
+					this.style.display = "block";
+			}).end();
+	},
+	
+	hide: function(speed,callback){
+		return speed ?
+			this.animate({
+				height: "hide", width: "hide", opacity: "hide"
+			}, speed, callback) :
+			
+			this.filter(":visible").each(function(){
+				this.oldblock = this.oldblock || jQuery.css(this,"display");
+				if ( this.oldblock == "none" )
+					this.oldblock = "block";
+				this.style.display = "none";
+			}).end();
+	},
+
+	// Save the old toggle function
+	_toggle: jQuery.fn.toggle,
+	
+	toggle: function( fn, fn2 ){
+		return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
+			this._toggle( fn, fn2 ) :
+			fn ?
+				this.animate({
+					height: "toggle", width: "toggle", opacity: "toggle"
+				}, fn, fn2) :
+				this.each(function(){
+					jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
+				});
+	},
+	
+	slideDown: function(speed,callback){
+		return this.animate({height: "show"}, speed, callback);
+	},
+	
+	slideUp: function(speed,callback){
+		return this.animate({height: "hide"}, speed, callback);
+	},
+
+	slideToggle: function(speed, callback){
+		return this.animate({height: "toggle"}, speed, callback);
+	},
+	
+	fadeIn: function(speed, callback){
+		return this.animate({opacity: "show"}, speed, callback);
+	},
+	
+	fadeOut: function(speed, callback){
+		return this.animate({opacity: "hide"}, speed, callback);
+	},
+	
+	fadeTo: function(speed,to,callback){
+		return this.animate({opacity: to}, speed, callback);
+	},
+	
+	animate: function( prop, speed, easing, callback ) {
+		var opt = jQuery.speed(speed, easing, callback);
+
+		return this[ opt.queue === false ? "each" : "queue" ](function(){
+			opt = jQuery.extend({}, opt);
+			var hidden = jQuery(this).is(":hidden"), self = this;
+			
+			for ( var p in prop ) {
+				if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
+					return jQuery.isFunction(opt.complete) && opt.complete.apply(this);
+
+				if ( p == "height" || p == "width" ) {
+					// Store display property
+					opt.display = jQuery.css(this, "display");
+
+					// Make sure that nothing sneaks out
+					opt.overflow = this.style.overflow;
+				}
+			}
+
+			if ( opt.overflow != null )
+				this.style.overflow = "hidden";
+
+			opt.curAnim = jQuery.extend({}, prop);
+			
+			jQuery.each( prop, function(name, val){
+				var e = new jQuery.fx( self, opt, name );
+
+				if ( /toggle|show|hide/.test(val) )
+					e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
+				else {
+					var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
+						start = e.cur(true) || 0;
+
+					if ( parts ) {
+						var end = parseFloat(parts[2]),
+							unit = parts[3] || "px";
+
+						// We need to compute starting value
+						if ( unit != "px" ) {
+							self.style[ name ] = (end || 1) + unit;
+							start = ((end || 1) / e.cur(true)) * start;
+							self.style[ name ] = start + unit;
+						}
+
+						// If a +=/-= token was provided, we're doing a relative animation
+						if ( parts[1] )
+							end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
+
+						e.custom( start, end, unit );
+					} else
+						e.custom( start, val, "" );
+				}
+			});
+
+			// For JS strict compliance
+			return true;
+		});
+	},
+	
+	queue: function(type, fn){
+		if ( jQuery.isFunction(type) ) {
+			fn = type;
+			type = "fx";
+		}
+
+		if ( !type || (typeof type == "string" && !fn) )
+			return queue( this[0], type );
+
+		return this.each(function(){
+			if ( fn.constructor == Array )
+				queue(this, type, fn);
+			else {
+				queue(this, type).push( fn );
+			
+				if ( queue(this, type).length == 1 )
+					fn.apply(this);
+			}
+		});
+	},
+
+	stop: function(){
+		var timers = jQuery.timers;
+
+		return this.each(function(){
+			for ( var i = 0; i < timers.length; i++ )
+				if ( timers[i].elem == this )
+					timers.splice(i--, 1);
+		}).dequeue();
+	}
+
+});
+
+var queue = function( elem, type, array ) {
+	if ( !elem )
+		return;
+
+	var q = jQuery.data( elem, type + "queue" );
+
+	if ( !q || array )
+		q = jQuery.data( elem, type + "queue", 
+			array ? jQuery.makeArray(array) : [] );
+
+	return q;
+};
+
+jQuery.fn.dequeue = function(type){
+	type = type || "fx";
+
+	return this.each(function(){
+		var q = queue(this, type);
+
+		q.shift();
+
+		if ( q.length )
+			q[0].apply( this );
+	});
+};
+
+jQuery.extend({
+	
+	speed: function(speed, easing, fn) {
+		var opt = speed && speed.constructor == Object ? speed : {
+			complete: fn || !fn && easing || 
+				jQuery.isFunction( speed ) && speed,
+			duration: speed,
+			easing: fn && easing || easing && easing.constructor != Function && easing
+		};
+
+		opt.duration = (opt.duration && opt.duration.constructor == Number ? 
+			opt.duration : 
+			{ slow: 600, fast: 200 }[opt.duration]) || 400;
+	
+		// Queueing
+		opt.old = opt.complete;
+		opt.complete = function(){
+			jQuery(this).dequeue();
+			if ( jQuery.isFunction( opt.old ) )
+				opt.old.apply( this );
+		};
+	
+		return opt;
+	},
+	
+	easing: {
+		linear: function( p, n, firstNum, diff ) {
+			return firstNum + diff * p;
+		},
+		swing: function( p, n, firstNum, diff ) {
+			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+		}
+	},
+	
+	timers: [],
+
+	fx: function( elem, options, prop ){
+		this.options = options;
+		this.elem = elem;
+		this.prop = prop;
+
+		if ( !options.orig )
+			options.orig = {};
+	}
+
+});
+
+jQuery.fx.prototype = {
+
+	// Simple function for setting a style value
+	update: function(){
+		if ( this.options.step )
+			this.options.step.apply( this.elem, [ this.now, this ] );
+
+		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+
+		// Set display property to block for height/width animations
+		if ( this.prop == "height" || this.prop == "width" )
+			this.elem.style.display = "block";
+	},
+
+	// Get the current size
+	cur: function(force){
+		if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null )
+			return this.elem[ this.prop ];
+
+		var r = parseFloat(jQuery.curCSS(this.elem, this.prop, force));
+		return r && r > -10000 ? r : parseFloat(jQuery.css(this.elem, this.prop)) || 0;
+	},
+
+	// Start an animation from one number to another
+	custom: function(from, to, unit){
+		this.startTime = (new Date()).getTime();
+		this.start = from;
+		this.end = to;
+		this.unit = unit || this.unit || "px";
+		this.now = this.start;
+		this.pos = this.state = 0;
+		this.update();
+
+		var self = this;
+		function t(){
+			return self.step();
+		}
+
+		t.elem = this.elem;
+
+		jQuery.timers.push(t);
+
+		if ( jQuery.timers.length == 1 ) {
+			var timer = setInterval(function(){
+				var timers = jQuery.timers;
+				
+				for ( var i = 0; i < timers.length; i++ )
+					if ( !timers[i]() )
+						timers.splice(i--, 1);
+
+				if ( !timers.length )
+					clearInterval( timer );
+			}, 13);
+		}
+	},
+
+	// Simple 'show' function
+	show: function(){
+		// Remember where we started, so that we can go back to it later
+		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
+		this.options.show = true;
+
+		// Begin the animation
+		this.custom(0, this.cur());
+
+		// Make sure that we start at a small width/height to avoid any
+		// flash of content
+		if ( this.prop == "width" || this.prop == "height" )
+			this.elem.style[this.prop] = "1px";
+		
+		// Start by showing the element
+		jQuery(this.elem).show();
+	},
+
+	// Simple 'hide' function
+	hide: function(){
+		// Remember where we started, so that we can go back to it later
+		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
+		this.options.hide = true;
+
+		// Begin the animation
+		this.custom(this.cur(), 0);
+	},
+
+	// Each step of an animation
+	step: function(){
+		var t = (new Date()).getTime();
+
+		if ( t > this.options.duration + this.startTime ) {
+			this.now = this.end;
+			this.pos = this.state = 1;
+			this.update();
+
+			this.options.curAnim[ this.prop ] = true;
+
+			var done = true;
+			for ( var i in this.options.curAnim )
+				if ( this.options.curAnim[i] !== true )
+					done = false;
+
+			if ( done ) {
+				if ( this.options.display != null ) {
+					// Reset the overflow
+					this.elem.style.overflow = this.options.overflow;
+				
+					// Reset the display
+					this.elem.style.display = this.options.display;
+					if ( jQuery.css(this.elem, "display") == "none" )
+						this.elem.style.display = "block";
+				}
+
+				// Hide the element if the "hide" operation was done
+				if ( this.options.hide )
+					this.elem.style.display = "none";
+
+				// Reset the properties, if the item has been hidden or shown
+				if ( this.options.hide || this.options.show )
+					for ( var p in this.options.curAnim )
+						jQuery.attr(this.elem.style, p, this.options.orig[p]);
+			}
+
+			// If a callback was provided, execute it
+			if ( done && jQuery.isFunction( this.options.complete ) )
+				// Execute the complete function
+				this.options.complete.apply( this.elem );
+
+			return false;
+		} else {
+			var n = t - this.startTime;
+			this.state = n / this.options.duration;
+
+			// Perform the easing function, defaults to swing
+			this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
+			this.now = this.start + ((this.end - this.start) * this.pos);
+
+			// Perform the next step of the animation
+			this.update();
+		}
+
+		return true;
+	}
+
+};
+
+jQuery.fx.step = {
+	scrollLeft: function(fx){
+		fx.elem.scrollLeft = fx.now;
+	},
+
+	scrollTop: function(fx){
+		fx.elem.scrollTop = fx.now;
+	},
+
+	opacity: function(fx){
+		jQuery.attr(fx.elem.style, "opacity", fx.now);
+	},
+
+	_default: function(fx){
+		fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+	}
+};
+// The Offset Method
+// Originally By Brandon Aaron, part of the Dimension Plugin
+// http://jquery.com/plugins/project/dimensions
+jQuery.fn.offset = function() {
+	var left = 0, top = 0, elem = this[0], results;
+	
+	if ( elem ) with ( jQuery.browser ) {
+		var	absolute     = jQuery.css(elem, "position") == "absolute", 
+		    parent       = elem.parentNode, 
+		    offsetParent = elem.offsetParent, 
+		    doc          = elem.ownerDocument,
+		    safari2      = safari && parseInt(version) < 522;
+	
+		// Use getBoundingClientRect if available
+		if ( elem.getBoundingClientRect ) {
+			box = elem.getBoundingClientRect();
+		
+			// Add the document scroll offsets
+			add(
+				box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
+				box.top  + Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop)
+			);
+		
+			// IE adds the HTML element's border, by default it is medium which is 2px
+			// IE 6 and IE 7 quirks mode the border width is overwritable by the following css html { border: 0; }
+			// IE 7 standards mode, the border is always 2px
+			if ( msie ) {
+				var border = jQuery("html").css("borderWidth");
+				border = (border == "medium" || jQuery.boxModel && parseInt(version) >= 7) && 2 || border;
+				add( -border, -border );
+			}
+	
+		// Otherwise loop through the offsetParents and parentNodes
+		} else {
+		
+			// Initial element offsets
+			add( elem.offsetLeft, elem.offsetTop );
+		
+			// Get parent offsets
+			while ( offsetParent ) {
+				// Add offsetParent offsets
+				add( offsetParent.offsetLeft, offsetParent.offsetTop );
+			
+				// Mozilla and Safari > 2 does not include the border on offset parents
+				// However Mozilla adds the border for table cells
+				if ( mozilla && /^t[d|h]$/i.test(parent.tagName) || !safari2 )
+					border( offsetParent );
+				
+				// Safari <= 2 doubles body offsets with an absolutely positioned element or parent
+				if ( safari2 && !absolute && jQuery.css(offsetParent, "position") == "absolute" )
+					absolute = true;
+			
+				// Get next offsetParent
+				offsetParent = offsetParent.offsetParent;
+			}
+		
+			// Get parent scroll offsets
+			while ( parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
+				// Work around opera inline/table scrollLeft/Top bug
+				if ( !/^inline|table-row.*$/i.test(jQuery.css(parent, "display")) )
+					// Subtract parent scroll offsets
+					add( -parent.scrollLeft, -parent.scrollTop );
+			
+				// Mozilla does not add the border for a parent that has overflow != visible
+				if ( mozilla && jQuery.css(parent, "overflow") != "visible" )
+					border( parent );
+			
+				// Get next parent
+				parent = parent.parentNode;
+			}
+		
+			// Safari doubles body offsets with an absolutely positioned element or parent
+			if ( safari2 && absolute )
+				add( -doc.body.offsetLeft, -doc.body.offsetTop );
+		}
+
+		// Return an object with top and left properties
+		results = { top: top, left: left };
+	}
+
+	return results;
+
+	function border(elem) {
+		add( jQuery.css(elem, "borderLeftWidth"), jQuery.css(elem, "borderTopWidth") );
+	}
+
+	function add(l, t) {
+		left += parseInt(l) || 0;
+		top += parseInt(t) || 0;
+	}
+};
+})();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/support/styles.css	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,293 @@
+body {
+  background: #F2F1F0;
+  font-family: verdana,sans-serif;
+}
+
+.navheader, .book, .preface, .chapter, .appendix, .bibliography, .navfooter, .basetemplate {
+  width: 50em;
+  margin-left: auto;
+  margin-right: auto;
+}
+
+a.commenttoggle:hover, a.commenttoggle:active {
+  opacity: 0.7;
+}
+
+.book, .preface, .chapter, .appendix, .bibliography, .basetemplate {
+  background: white;
+  padding: 2em;
+}
+
+h1 {
+  margin-top: 1.5em;
+}
+
+span.beta {
+  font-size: 80%;
+  font-style: italic;
+  opacity: 0.4;
+}
+
+h2, h3 {
+  margin-top: 2em;
+}
+
+h1, h2, h3 {
+  font-family: georgia,serif;
+  font-weight: normal;
+  margin-bottom: 0.5em;
+}
+
+h1.booktitle {
+  margin-bottom: 0px;
+}
+
+h2.booktitle {
+  text-align: center;
+}
+
+h2.booktitle > a {
+  color: black;
+}
+
+.authors {
+  font-size: 80%;
+  opacity: 0.55;
+  padding-left: 0.5em;
+}
+
+div.note th, div.tip th, div.warning th {
+  font-family: georgia,serif;
+  font-weight: normal;
+  font-size: 110%;
+}
+
+div.navheader th, div.navfooter td {
+  font-family: georgia,serif;
+}
+
+div.navheader th {
+  opacity: 0;
+  font-size: 0;
+}
+
+pre.screen {
+  background-image: url(/support/icons/shell.png);
+}
+
+pre.programlisting {
+  background-image: url(/support/icons/source.png);
+}
+
+pre.programlisting, pre.screen, p.remark {
+  border-style: solid;
+  border-width: 1px;
+  font-size: medium;
+  padding: 1em;
+  background-repeat: no-repeat;
+  background-position: 10px 10px;
+  padding-left: 70px;
+}
+
+strong.command, code, pre, span.type {
+  font-family: monospace;
+  font-weight: normal;
+}
+
+strong.userinput > code {
+  font-weight: bolder;
+  color: #303030;
+}
+
+div.toc > p {
+  opacity: 0.35;
+  font-family: georgia,serif;
+  cursor: pointer;
+}
+
+div.toc b {
+  font-weight: normal;
+  font-size: large;
+}
+
+ul.booktoc {
+  padding-left: 0px;
+  list-style-type: none;
+}
+
+.booktoc > li {
+  padding: 0.5em;
+}
+
+.chapinfo {
+  float: right;
+  color: #a0a0a0;
+}
+
+.unpublished {
+  color: #a0a0a0;
+}
+
+.chapinfo img {
+  vertical-align: -35%;
+  border: 0px;
+}
+
+.zebra_b {
+  background: #f4f4f4;
+}
+
+.book .titlepage {
+  display: none;
+}
+
+.chapter div.toc > dl {
+  display: none;
+}
+
+pre.programlisting, pre.screen, p.remark {
+  overflow: hidden;
+}
+
+p.remark {
+  background-image: url(/support/icons/remark.png);
+}
+
+div.warning, p.remark {
+  background-color: #FFEFE8;
+  border-color: #e0a8a0;
+}
+
+span.remark {
+  font-style: normal;
+  color: #707070;
+}
+
+.screen {
+  background: #e7ffc7 none repeat scroll 0% 50%;
+  border-color: #94DA3A;
+}
+
+.programlisting {
+  background: #F0F4FF none repeat scroll 0% 50%;
+  border-color: #B4BAEA;
+}
+
+.prompt {
+  color: #448844;
+}
+
+div.note, div.tip {
+  background: #ffffc9;
+  border-color: #B4BAEA;
+}
+
+div.note, div.warning, div.tip {
+  border-style: solid;
+  border-width: 1px;
+  padding: 1em;
+}
+
+.note .title {
+  font-size: 90%;
+}
+
+.comment {
+  font-size: 80%;
+}
+
+div.comment, div.new_comment {
+  padding: 0.5em;
+  margin: 0.5em;
+  margin-left: 2em;
+  border-style: solid;
+  border-width: 1px;
+  border-color: #aaaaff;
+}
+
+div.comment {
+  background: #eeeeff;
+}
+
+div.new_comment {
+  background: #d0d0ff;
+}
+
+.commenttoggle {
+  opacity: 0.35;
+}
+
+.comment_help {
+  font-size: 80%;
+}
+
+.comment_header {
+  opacity: 0.75;
+}
+
+.comment_id {
+  float: right;
+  opacity: 0.3;
+  font-size: 60%;
+}
+
+.comment_name {
+  font-weight: bolder;
+}
+
+.comment_reviewed {
+  color: darkgreen;
+  margin-left: 1em;
+  font-style: italic;
+}
+
+.comment_date {
+  opacity: 0.75;
+}
+
+.comment_thanks {
+  color: darkblue;
+  margin-left: 1em;
+  font-style: italic;
+  font-weight: bolder;
+}
+
+.comment_error {
+  padding-left: 1em;
+  font-weight: bolder;
+  font-size: 80%;
+  color: darkred;
+}
+
+.hgbookfooter {
+  width: 60em;
+  margin-left: auto;
+  margin-right: auto;
+  margin-top: 2em;
+  padding: 2em;
+  margin-bottom: 2em;
+  font-size: 80%;
+  color: #727272;
+  border-top: 1px solid grey;
+}
+
+.hgbookfooter a {
+  color: #5555ff;
+}
+
+.hgbookfooter a:visited {
+  opacity: 0.7;
+}
+
+.hgbookfooter img {
+  vertical-align: -45%;
+}
+
+table.equation a.commenttoggle {
+  text-align: right;
+  display: block;
+}
+
+div.comment, div.new_comment, form.comment {
+  text-align: left;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/support/styles/styles.css	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,293 @@
+body {
+  background: #F2F1F0;
+  font-family: verdana,sans-serif;
+}
+
+.navheader, .book, .preface, .chapter, .appendix, .bibliography, .navfooter, .basetemplate {
+  width: 50em;
+  margin-left: auto;
+  margin-right: auto;
+}
+
+a.commenttoggle:hover, a.commenttoggle:active {
+  opacity: 0.7;
+}
+
+.book, .preface, .chapter, .appendix, .bibliography, .basetemplate {
+  background: white;
+  padding: 2em;
+}
+
+h1 {
+  margin-top: 1.5em;
+}
+
+span.beta {
+  font-size: 80%;
+  font-style: italic;
+  opacity: 0.4;
+}
+
+h2, h3 {
+  margin-top: 2em;
+}
+
+h1, h2, h3 {
+  font-family: georgia,serif;
+  font-weight: normal;
+  margin-bottom: 0.5em;
+}
+
+h1.booktitle {
+  margin-bottom: 0px;
+}
+
+h2.booktitle {
+  text-align: center;
+}
+
+h2.booktitle > a {
+  color: black;
+}
+
+.authors {
+  font-size: 80%;
+  opacity: 0.55;
+  padding-left: 0.5em;
+}
+
+div.note th, div.tip th, div.warning th {
+  font-family: georgia,serif;
+  font-weight: normal;
+  font-size: 110%;
+}
+
+div.navheader th, div.navfooter td {
+  font-family: georgia,serif;
+}
+
+div.navheader th {
+  opacity: 0;
+  font-size: 0;
+}
+
+pre.screen {
+  background-image: url(/support/icons/shell.png);
+}
+
+pre.programlisting {
+  background-image: url(/support/icons/source.png);
+}
+
+pre.programlisting, pre.screen, p.remark {
+  border-style: solid;
+  border-width: 1px;
+  font-size: medium;
+  padding: 1em;
+  background-repeat: no-repeat;
+  background-position: 10px 10px;
+  padding-left: 70px;
+}
+
+strong.command, code, pre, span.type {
+  font-family: monospace;
+  font-weight: normal;
+}
+
+strong.userinput > code {
+  font-weight: bolder;
+  color: #303030;
+}
+
+div.toc > p {
+  opacity: 0.35;
+  font-family: georgia,serif;
+  cursor: pointer;
+}
+
+div.toc b {
+  font-weight: normal;
+  font-size: large;
+}
+
+ul.booktoc {
+  padding-left: 0px;
+  list-style-type: none;
+}
+
+.booktoc > li {
+  padding: 0.5em;
+}
+
+.chapinfo {
+  float: right;
+  color: #a0a0a0;
+}
+
+.unpublished {
+  color: #a0a0a0;
+}
+
+.chapinfo img {
+  vertical-align: -35%;
+  border: 0px;
+}
+
+.zebra_b {
+  background: #f4f4f4;
+}
+
+.book .titlepage {
+  display: none;
+}
+
+.chapter div.toc > dl {
+  display: none;
+}
+
+pre.programlisting, pre.screen, p.remark {
+  overflow: hidden;
+}
+
+p.remark {
+  background-image: url(/support/icons/remark.png);
+}
+
+div.warning, p.remark {
+  background-color: #FFEFE8;
+  border-color: #e0a8a0;
+}
+
+span.remark {
+  font-style: normal;
+  color: #707070;
+}
+
+.screen {
+  background: #e7ffc7 none repeat scroll 0% 50%;
+  border-color: #94DA3A;
+}
+
+.programlisting {
+  background: #F0F4FF none repeat scroll 0% 50%;
+  border-color: #B4BAEA;
+}
+
+.prompt {
+  color: #448844;
+}
+
+div.note, div.tip {
+  background: #ffffc9;
+  border-color: #B4BAEA;
+}
+
+div.note, div.warning, div.tip {
+  border-style: solid;
+  border-width: 1px;
+  padding: 1em;
+}
+
+.note .title {
+  font-size: 90%;
+}
+
+.comment {
+  font-size: 80%;
+}
+
+div.comment, div.new_comment {
+  padding: 0.5em;
+  margin: 0.5em;
+  margin-left: 2em;
+  border-style: solid;
+  border-width: 1px;
+  border-color: #aaaaff;
+}
+
+div.comment {
+  background: #eeeeff;
+}
+
+div.new_comment {
+  background: #d0d0ff;
+}
+
+.commenttoggle {
+  opacity: 0.35;
+}
+
+.comment_help {
+  font-size: 80%;
+}
+
+.comment_header {
+  opacity: 0.75;
+}
+
+.comment_id {
+  float: right;
+  opacity: 0.3;
+  font-size: 60%;
+}
+
+.comment_name {
+  font-weight: bolder;
+}
+
+.comment_reviewed {
+  color: darkgreen;
+  margin-left: 1em;
+  font-style: italic;
+}
+
+.comment_date {
+  opacity: 0.75;
+}
+
+.comment_thanks {
+  color: darkblue;
+  margin-left: 1em;
+  font-style: italic;
+  font-weight: bolder;
+}
+
+.comment_error {
+  padding-left: 1em;
+  font-weight: bolder;
+  font-size: 80%;
+  color: darkred;
+}
+
+.hgbookfooter {
+  width: 60em;
+  margin-left: auto;
+  margin-right: auto;
+  margin-top: 2em;
+  padding: 2em;
+  margin-bottom: 2em;
+  font-size: 80%;
+  color: #727272;
+  border-top: 1px solid grey;
+}
+
+.hgbookfooter a {
+  color: #5555ff;
+}
+
+.hgbookfooter a:visited {
+  opacity: 0.7;
+}
+
+.hgbookfooter img {
+  vertical-align: -45%;
+}
+
+table.equation a.commenttoggle {
+  text-align: right;
+  display: block;
+}
+
+div.comment, div.new_comment, form.comment {
+  text-align: left;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/texpand.py	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+#
+# Use Django's template machinery to expand static web pages.  First
+# tries the default template path for a particular installation, then
+# looks for templates in the filesystem.
+
+import sys
+sys.path.append('/home/amit/hgbook-alqua/web/hgbook')
+import hgbook
+from django.template import Context, TemplateDoesNotExist
+from django.template.loader import get_template, get_template_from_string
+from django.core.management import setup_environ
+import hgbook.settings as settings
+
+
+setup_environ(settings)
+c = Context()
+
+if len(sys.argv) == 2:
+    in_name = sys.argv[1]
+    out_name = 'stdout'
+    out_fp = sys.stdout
+elif len(sys.argv) == 3:
+    in_name = sys.argv[1]
+    out_name = sys.argv[2]
+    out_fp = None
+else:
+    print >> sys.stderr, 'Usage: %s template-file [output-file]'
+    sys.exit(1)
+    
+try:
+    t = get_template(in_name)
+except TemplateDoesNotExist:
+    t = get_template_from_string(open(in_name).read(), name=in_name)
+if out_fp is None:
+    out_fp = open(out_name, 'w')
+out_fp.write(t.render(c))
+out_fp.close()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SEESenv/web/texpand.py~	Fri Feb 12 01:11:21 2010 +0530
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+#
+# Use Django's template machinery to expand static web pages.  First
+# tries the default template path for a particular installation, then
+# looks for templates in the filesystem.
+
+import sys
+sys.path.append('/home/amit/hgbook-alqua/web/hgbook')
+from django.template import Context, TemplateDoesNotExist
+from django.template.loader import get_template, get_template_from_string
+from django.core.management import setup_environ
+import hgbook.settings as settings
+
+
+setup_environ(settings)
+c = Context()
+
+if len(sys.argv) == 2:
+    in_name = sys.argv[1]
+    out_name = 'stdout'
+    out_fp = sys.stdout
+elif len(sys.argv) == 3:
+    in_name = sys.argv[1]
+    out_name = sys.argv[2]
+    out_fp = None
+else:
+    print >> sys.stderr, 'Usage: %s template-file [output-file]'
+    sys.exit(1)
+    
+try:
+    t = get_template(in_name)
+except TemplateDoesNotExist:
+    t = get_template_from_string(open(in_name).read(), name=in_name)
+if out_fp is None:
+    out_fp = open(out_name, 'w')
+out_fp.write(t.render(c))
+out_fp.close()
--- a/scripts/autoid.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-#!/usr/bin/env python
-#
-# Add unique ID attributes to para tags.  This script should only be
-# run by one person, since otherwise it introduces the possibility of
-# chaotic conflicts among tags.
-
-import glob, os, re, sys
-
-tagged = re.compile('<para[^>]* id="x_([0-9a-f]+)"[^>]*>', re.M)
-untagged = re.compile('<para>')
-
-names = glob.glob('ch*.docbook') 
-# First pass: find the highest-numbered paragraph ID.
-
-
-chapter=None
-seen = set()
-errs = 0
-beginning="p_list= "
-
-id_file=open('p_list.py','w')
-dictionary={}
-id_list=[]
-for name in names:
-    for m in tagged.finditer(open(name).read()):
-        i = int(m.group(1),16)
-        if i in seen:
-            print >> sys.stderr, '%s: duplication of ID %s' % (name, i)
-            errs += 1
-        seen.add(i)
-        if i > biggest_id:
-            biggest_id = i
-
-
-def retag(s):
-    global biggest_id
-    global chapter   
-    biggest_id += 1
-     
-    id_name="%s_%x" % (chapter,biggest_id)   
-    id_list.append(id_name)    
-    
-    return '<para id="%s">' %id_name
-
-# Second pass: add IDs to paragraphs that currently lack them.
-
-for name in names:
-    biggest_id=0 
-    chapter=name.split('.')[0]    
-    id_list=[]    
-    f = open(name).read()
-    f1 = untagged.sub(retag, f )
-    dictionary[chapter]=id_list       
-    if f1 != f:
-        tmpname = name + '.tmp'
-        fp = open(tmpname, 'w')
-        fp.write(f1)
-        fp.close()
-        os.rename(tmpname, name)
-p_lists_string=beginning+str(dictionary)
-id_file.write(p_lists_string)
-sys.exit(errs)
--- a/scripts/docbook2html.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-import glob, os, re, sys
-import subprocess
-import time
-names = glob.glob('ch*.docbook')
-for name in names:
-	command="xsltproc html-single.xsl %s > %s.html" %(name ,name.split('.')[0])
-	print command	
-	subprocess.Popen(command,shell=True)
-	time.sleep(10)
--- a/scripts/html-single.xsl	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
-
-  <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
-
-  <xsl:param name="draft.mode" select="no"/>
-
-  <!-- xsltproc can't support these extensions
-  <xsl:param name="use.extensions">1</xsl:param>
-  <xsl:param name="callouts.extension">1</xsl:param>
-  <xsl:param name="linenumbering.extension">1</xsl:param>
-  <xsl:param name="tablecolumns.extension">1</xsl:param>
-  <xsl:param name="textinsert.extension">1</xsl:param>
-  -->
-
-  <xsl:param name="admon.graphics" select="1" />
-  <xsl:param name="admon.graphics.extension">.png</xsl:param>
-  <xsl:param name="admon.graphics.path">figs/</xsl:param>
-  <xsl:param name="callout.graphics" select="1" />
-  <xsl:param name="callout.graphics.extension">.png</xsl:param>
-  <xsl:param name="callout.graphics.path">images/callouts/</xsl:param>
-
-  <xsl:param name="section.autolabel" select="1" />
-  <xsl:param name="section.label.includes.component.label">1</xsl:param>
-
-  <xsl:output method="html" encoding="utf-8" indent="yes"/>     <!-- html only -->
-  <xsl:param name="use.id.as.filename">0</xsl:param>            <!-- html only -->
-  <xsl:param name="chunk.section.depth">0</xsl:param>           <!-- html only -->
-  <xsl:param name="chunker.output.indent">yes</xsl:param>       <!-- html only -->
-  <xsl:param name="html.stylesheet">hgbook.css</xsl:param>      <!-- html only -->
-
-</xsl:stylesheet>
--- a/scripts/index.config	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-Introduction/Introduction.rst
-basic_python/intro.rst	
-basic_python/list_tuples.rst
-basic_python/strings_dicts.rst
-basic_python/func.rst
-basic_python/oop.rst
-basic_python/interim_assessment.rst
-ult/ult_module_plan.rst
-ult/Using_Linux_Tools.rst
-ult/session4.rst
-ult/Section_5.rst
-versionControl/index.rst
-versionControl/versionControl.rst
-versionControl/handOut.rst
--- a/scripts/myrst2xml.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-#!/usr/bin/python
-"""
-Just a hack to convert rst to xml and then docbook . 
-May not containt all the required elements of a docbook .
-Just done to make it run for the specific rst for our 
-sees documentation.
-"""
-import xml.etree.ElementTree as ET
-import os 
-import re
-import subprocess
-import os
-import pkg_resources
-import time
-from docutils.core import publish_file 
-chapterno=0
-
-
-
-
-
-
-
-
-
-def convert2xml(file):
-#    print folder,subfolder,file
-    file=file.split("\n")[0]
-    file= file.split("\t")[0]  
-    global chapterno
-    name=file.split('/')[-1]
-    name='ch'+str(chapterno)+name.split('.')[0]
-#    full_file=os.path.join(folder,file)    
-#    if file.endswith('.rst'):    
-    print file	    
-    xml_file=name+'.xml'        
-    a=open(xml_file,'w')
-#    a.close()
-#    command="rst2xml.py %s > %s" %(file , xml_file)
-          
-#    a=subprocess.Popen(command , shell=True)
-#    time.sleep(10) 	   	
-#    a.kill()
-    publish_file(source_path=file, destination_path=xml_file,parser_name='restructuredtext', writer_name='xml') 
-def walk(repo):
-    global chapterno
-    mainfolder='/home/amit/sttp_latest/'    
-    for readline in open('index.config','r').readlines():
-        chapterno+=1		
-        filename=mainfolder+readline
-        convert2xml(filename)
-
-
-
-
-
-if __name__=='__main__':
-    repo='/home/amit/sphinxvirt/review/'
-    walk(repo)
-#    convert(1,2,3)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--- a/scripts/p_list.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-p_list= {'ch12index': [], 'ch6oop': ['ch6oop_1', 'ch6oop_2', 'ch6oop_3', 'ch6oop_4', 'ch6oop_5', 'ch6oop_6'], 'ch9Using_Linux_Tools': ['ch9Using_Linux_Tools_1', 'ch9Using_Linux_Tools_2', 'ch9Using_Linux_Tools_3', 'ch9Using_Linux_Tools_4', 'ch9Using_Linux_Tools_5', 'ch9Using_Linux_Tools_6', 'ch9Using_Linux_Tools_7', 'ch9Using_Linux_Tools_8', 'ch9Using_Linux_Tools_9', 'ch9Using_Linux_Tools_a', 'ch9Using_Linux_Tools_b', 'ch9Using_Linux_Tools_c', 'ch9Using_Linux_Tools_d', 'ch9Using_Linux_Tools_e', 'ch9Using_Linux_Tools_f', 'ch9Using_Linux_Tools_10', 'ch9Using_Linux_Tools_11', 'ch9Using_Linux_Tools_12', 'ch9Using_Linux_Tools_13', 'ch9Using_Linux_Tools_14', 'ch9Using_Linux_Tools_15', 'ch9Using_Linux_Tools_16', 'ch9Using_Linux_Tools_17', 'ch9Using_Linux_Tools_18', 'ch9Using_Linux_Tools_19', 'ch9Using_Linux_Tools_1a', 'ch9Using_Linux_Tools_1b', 'ch9Using_Linux_Tools_1c', 'ch9Using_Linux_Tools_1d', 'ch9Using_Linux_Tools_1e', 'ch9Using_Linux_Tools_1f', 'ch9Using_Linux_Tools_20', 'ch9Using_Linux_Tools_21', 'ch9Using_Linux_Tools_22', 'ch9Using_Linux_Tools_23', 'ch9Using_Linux_Tools_24', 'ch9Using_Linux_Tools_25', 'ch9Using_Linux_Tools_26', 'ch9Using_Linux_Tools_27', 'ch9Using_Linux_Tools_28', 'ch9Using_Linux_Tools_29', 'ch9Using_Linux_Tools_2a', 'ch9Using_Linux_Tools_2b', 'ch9Using_Linux_Tools_2c', 'ch9Using_Linux_Tools_2d', 'ch9Using_Linux_Tools_2e', 'ch9Using_Linux_Tools_2f', 'ch9Using_Linux_Tools_30', 'ch9Using_Linux_Tools_31', 'ch9Using_Linux_Tools_32', 'ch9Using_Linux_Tools_33', 'ch9Using_Linux_Tools_34', 'ch9Using_Linux_Tools_35', 'ch9Using_Linux_Tools_36', 'ch9Using_Linux_Tools_37', 'ch9Using_Linux_Tools_38', 'ch9Using_Linux_Tools_39', 'ch9Using_Linux_Tools_3a', 'ch9Using_Linux_Tools_3b', 'ch9Using_Linux_Tools_3c', 'ch9Using_Linux_Tools_3d', 'ch9Using_Linux_Tools_3e', 'ch9Using_Linux_Tools_3f', 'ch9Using_Linux_Tools_40', 'ch9Using_Linux_Tools_41', 'ch9Using_Linux_Tools_42', 'ch9Using_Linux_Tools_43', 'ch9Using_Linux_Tools_44', 'ch9Using_Linux_Tools_45', 'ch9Using_Linux_Tools_46', 'ch9Using_Linux_Tools_47', 'ch9Using_Linux_Tools_48', 'ch9Using_Linux_Tools_49', 'ch9Using_Linux_Tools_4a', 'ch9Using_Linux_Tools_4b', 'ch9Using_Linux_Tools_4c', 'ch9Using_Linux_Tools_4d', 'ch9Using_Linux_Tools_4e', 'ch9Using_Linux_Tools_4f', 'ch9Using_Linux_Tools_50', 'ch9Using_Linux_Tools_51', 'ch9Using_Linux_Tools_52', 'ch9Using_Linux_Tools_53', 'ch9Using_Linux_Tools_54', 'ch9Using_Linux_Tools_55', 'ch9Using_Linux_Tools_56', 'ch9Using_Linux_Tools_57', 'ch9Using_Linux_Tools_58', 'ch9Using_Linux_Tools_59', 'ch9Using_Linux_Tools_5a', 'ch9Using_Linux_Tools_5b', 'ch9Using_Linux_Tools_5c', 'ch9Using_Linux_Tools_5d', 'ch9Using_Linux_Tools_5e', 'ch9Using_Linux_Tools_5f', 'ch9Using_Linux_Tools_60', 'ch9Using_Linux_Tools_61', 'ch9Using_Linux_Tools_62', 'ch9Using_Linux_Tools_63', 'ch9Using_Linux_Tools_64', 'ch9Using_Linux_Tools_65', 'ch9Using_Linux_Tools_66', 'ch9Using_Linux_Tools_67', 'ch9Using_Linux_Tools_68', 'ch9Using_Linux_Tools_69', 'ch9Using_Linux_Tools_6a', 'ch9Using_Linux_Tools_6b', 'ch9Using_Linux_Tools_6c', 'ch9Using_Linux_Tools_6d', 'ch9Using_Linux_Tools_6e', 'ch9Using_Linux_Tools_6f', 'ch9Using_Linux_Tools_70', 'ch9Using_Linux_Tools_71', 'ch9Using_Linux_Tools_72', 'ch9Using_Linux_Tools_73', 'ch9Using_Linux_Tools_74', 'ch9Using_Linux_Tools_75', 'ch9Using_Linux_Tools_76', 'ch9Using_Linux_Tools_77', 'ch9Using_Linux_Tools_78', 'ch9Using_Linux_Tools_79', 'ch9Using_Linux_Tools_7a', 'ch9Using_Linux_Tools_7b', 'ch9Using_Linux_Tools_7c', 'ch9Using_Linux_Tools_7d', 'ch9Using_Linux_Tools_7e', 'ch9Using_Linux_Tools_7f', 'ch9Using_Linux_Tools_80', 'ch9Using_Linux_Tools_81', 'ch9Using_Linux_Tools_82', 'ch9Using_Linux_Tools_83', 'ch9Using_Linux_Tools_84', 'ch9Using_Linux_Tools_85', 'ch9Using_Linux_Tools_86', 'ch9Using_Linux_Tools_87', 'ch9Using_Linux_Tools_88', 'ch9Using_Linux_Tools_89', 'ch9Using_Linux_Tools_8a', 'ch9Using_Linux_Tools_8b', 'ch9Using_Linux_Tools_8c', 'ch9Using_Linux_Tools_8d', 'ch9Using_Linux_Tools_8e', 'ch9Using_Linux_Tools_8f', 'ch9Using_Linux_Tools_90', 'ch9Using_Linux_Tools_91', 'ch9Using_Linux_Tools_92', 'ch9Using_Linux_Tools_93', 'ch9Using_Linux_Tools_94', 'ch9Using_Linux_Tools_95', 'ch9Using_Linux_Tools_96', 'ch9Using_Linux_Tools_97', 'ch9Using_Linux_Tools_98', 'ch9Using_Linux_Tools_99', 'ch9Using_Linux_Tools_9a', 'ch9Using_Linux_Tools_9b', 'ch9Using_Linux_Tools_9c', 'ch9Using_Linux_Tools_9d', 'ch9Using_Linux_Tools_9e', 'ch9Using_Linux_Tools_9f', 'ch9Using_Linux_Tools_a0', 'ch9Using_Linux_Tools_a1', 'ch9Using_Linux_Tools_a2', 'ch9Using_Linux_Tools_a3', 'ch9Using_Linux_Tools_a4', 'ch9Using_Linux_Tools_a5', 'ch9Using_Linux_Tools_a6', 'ch9Using_Linux_Tools_a7', 'ch9Using_Linux_Tools_a8', 'ch9Using_Linux_Tools_a9', 'ch9Using_Linux_Tools_aa', 'ch9Using_Linux_Tools_ab', 'ch9Using_Linux_Tools_ac', 'ch9Using_Linux_Tools_ad', 'ch9Using_Linux_Tools_ae', 'ch9Using_Linux_Tools_af', 'ch9Using_Linux_Tools_b0', 'ch9Using_Linux_Tools_b1', 'ch9Using_Linux_Tools_b2', 'ch9Using_Linux_Tools_b3', 'ch9Using_Linux_Tools_b4', 'ch9Using_Linux_Tools_b5', 'ch9Using_Linux_Tools_b6', 'ch9Using_Linux_Tools_b7', 'ch9Using_Linux_Tools_b8', 'ch9Using_Linux_Tools_b9', 'ch9Using_Linux_Tools_ba', 'ch9Using_Linux_Tools_bb', 'ch9Using_Linux_Tools_bc', 'ch9Using_Linux_Tools_bd', 'ch9Using_Linux_Tools_be', 'ch9Using_Linux_Tools_bf', 'ch9Using_Linux_Tools_c0', 'ch9Using_Linux_Tools_c1', 'ch9Using_Linux_Tools_c2', 'ch9Using_Linux_Tools_c3', 'ch9Using_Linux_Tools_c4', 'ch9Using_Linux_Tools_c5', 'ch9Using_Linux_Tools_c6', 'ch9Using_Linux_Tools_c7', 'ch9Using_Linux_Tools_c8', 'ch9Using_Linux_Tools_c9', 'ch9Using_Linux_Tools_ca', 'ch9Using_Linux_Tools_cb', 'ch9Using_Linux_Tools_cc', 'ch9Using_Linux_Tools_cd', 'ch9Using_Linux_Tools_ce', 'ch9Using_Linux_Tools_cf', 'ch9Using_Linux_Tools_d0', 'ch9Using_Linux_Tools_d1', 'ch9Using_Linux_Tools_d2', 'ch9Using_Linux_Tools_d3', 'ch9Using_Linux_Tools_d4', 'ch9Using_Linux_Tools_d5', 'ch9Using_Linux_Tools_d6', 'ch9Using_Linux_Tools_d7', 'ch9Using_Linux_Tools_d8', 'ch9Using_Linux_Tools_d9', 'ch9Using_Linux_Tools_da', 'ch9Using_Linux_Tools_db', 'ch9Using_Linux_Tools_dc', 'ch9Using_Linux_Tools_dd', 'ch9Using_Linux_Tools_de', 'ch9Using_Linux_Tools_df', 'ch9Using_Linux_Tools_e0', 'ch9Using_Linux_Tools_e1', 'ch9Using_Linux_Tools_e2', 'ch9Using_Linux_Tools_e3', 'ch9Using_Linux_Tools_e4', 'ch9Using_Linux_Tools_e5', 'ch9Using_Linux_Tools_e6', 'ch9Using_Linux_Tools_e7', 'ch9Using_Linux_Tools_e8', 'ch9Using_Linux_Tools_e9', 'ch9Using_Linux_Tools_ea', 'ch9Using_Linux_Tools_eb', 'ch9Using_Linux_Tools_ec', 'ch9Using_Linux_Tools_ed', 'ch9Using_Linux_Tools_ee', 'ch9Using_Linux_Tools_ef', 'ch9Using_Linux_Tools_f0', 'ch9Using_Linux_Tools_f1', 'ch9Using_Linux_Tools_f2', 'ch9Using_Linux_Tools_f3', 'ch9Using_Linux_Tools_f4', 'ch9Using_Linux_Tools_f5', 'ch9Using_Linux_Tools_f6', 'ch9Using_Linux_Tools_f7', 'ch9Using_Linux_Tools_f8', 'ch9Using_Linux_Tools_f9', 'ch9Using_Linux_Tools_fa', 'ch9Using_Linux_Tools_fb', 'ch9Using_Linux_Tools_fc', 'ch9Using_Linux_Tools_fd', 'ch9Using_Linux_Tools_fe', 'ch9Using_Linux_Tools_ff', 'ch9Using_Linux_Tools_100', 'ch9Using_Linux_Tools_101', 'ch9Using_Linux_Tools_102', 'ch9Using_Linux_Tools_103', 'ch9Using_Linux_Tools_104', 'ch9Using_Linux_Tools_105', 'ch9Using_Linux_Tools_106', 'ch9Using_Linux_Tools_107', 'ch9Using_Linux_Tools_108', 'ch9Using_Linux_Tools_109', 'ch9Using_Linux_Tools_10a', 'ch9Using_Linux_Tools_10b', 'ch9Using_Linux_Tools_10c', 'ch9Using_Linux_Tools_10d', 'ch9Using_Linux_Tools_10e', 'ch9Using_Linux_Tools_10f', 'ch9Using_Linux_Tools_110', 'ch9Using_Linux_Tools_111', 'ch9Using_Linux_Tools_112', 'ch9Using_Linux_Tools_113', 'ch9Using_Linux_Tools_114', 'ch9Using_Linux_Tools_115', 'ch9Using_Linux_Tools_116', 'ch9Using_Linux_Tools_117', 'ch9Using_Linux_Tools_118', 'ch9Using_Linux_Tools_119', 'ch9Using_Linux_Tools_11a', 'ch9Using_Linux_Tools_11b', 'ch9Using_Linux_Tools_11c', 'ch9Using_Linux_Tools_11d', 'ch9Using_Linux_Tools_11e', 'ch9Using_Linux_Tools_11f', 'ch9Using_Linux_Tools_120', 'ch9Using_Linux_Tools_121', 'ch9Using_Linux_Tools_122', 'ch9Using_Linux_Tools_123', 'ch9Using_Linux_Tools_124', 'ch9Using_Linux_Tools_125', 'ch9Using_Linux_Tools_126', 'ch9Using_Linux_Tools_127', 'ch9Using_Linux_Tools_128', 'ch9Using_Linux_Tools_129', 'ch9Using_Linux_Tools_12a', 'ch9Using_Linux_Tools_12b', 'ch9Using_Linux_Tools_12c', 'ch9Using_Linux_Tools_12d', 'ch9Using_Linux_Tools_12e', 'ch9Using_Linux_Tools_12f', 'ch9Using_Linux_Tools_130', 'ch9Using_Linux_Tools_131', 'ch9Using_Linux_Tools_132', 'ch9Using_Linux_Tools_133', 'ch9Using_Linux_Tools_134', 'ch9Using_Linux_Tools_135', 'ch9Using_Linux_Tools_136', 'ch9Using_Linux_Tools_137', 'ch9Using_Linux_Tools_138', 'ch9Using_Linux_Tools_139', 'ch9Using_Linux_Tools_13a', 'ch9Using_Linux_Tools_13b', 'ch9Using_Linux_Tools_13c', 'ch9Using_Linux_Tools_13d', 'ch9Using_Linux_Tools_13e', 'ch9Using_Linux_Tools_13f', 'ch9Using_Linux_Tools_140', 'ch9Using_Linux_Tools_141', 'ch9Using_Linux_Tools_142', 'ch9Using_Linux_Tools_143', 'ch9Using_Linux_Tools_144', 'ch9Using_Linux_Tools_145', 'ch9Using_Linux_Tools_146', 'ch9Using_Linux_Tools_147', 'ch9Using_Linux_Tools_148', 'ch9Using_Linux_Tools_149', 'ch9Using_Linux_Tools_14a', 'ch9Using_Linux_Tools_14b', 'ch9Using_Linux_Tools_14c', 'ch9Using_Linux_Tools_14d', 'ch9Using_Linux_Tools_14e', 'ch9Using_Linux_Tools_14f', 'ch9Using_Linux_Tools_150', 'ch9Using_Linux_Tools_151', 'ch9Using_Linux_Tools_152', 'ch9Using_Linux_Tools_153', 'ch9Using_Linux_Tools_154', 'ch9Using_Linux_Tools_155', 'ch9Using_Linux_Tools_156', 'ch9Using_Linux_Tools_157', 'ch9Using_Linux_Tools_158', 'ch9Using_Linux_Tools_159', 'ch9Using_Linux_Tools_15a', 'ch9Using_Linux_Tools_15b', 'ch9Using_Linux_Tools_15c', 'ch9Using_Linux_Tools_15d', 'ch9Using_Linux_Tools_15e', 'ch9Using_Linux_Tools_15f', 'ch9Using_Linux_Tools_160', 'ch9Using_Linux_Tools_161', 'ch9Using_Linux_Tools_162', 'ch9Using_Linux_Tools_163', 'ch9Using_Linux_Tools_164', 'ch9Using_Linux_Tools_165', 'ch9Using_Linux_Tools_166', 'ch9Using_Linux_Tools_167', 'ch9Using_Linux_Tools_168', 'ch9Using_Linux_Tools_169', 'ch9Using_Linux_Tools_16a', 'ch9Using_Linux_Tools_16b', 'ch9Using_Linux_Tools_16c', 'ch9Using_Linux_Tools_16d', 'ch9Using_Linux_Tools_16e', 'ch9Using_Linux_Tools_16f', 'ch9Using_Linux_Tools_170', 'ch9Using_Linux_Tools_171', 'ch9Using_Linux_Tools_172', 'ch9Using_Linux_Tools_173', 'ch9Using_Linux_Tools_174', 'ch9Using_Linux_Tools_175', 'ch9Using_Linux_Tools_176', 'ch9Using_Linux_Tools_177', 'ch9Using_Linux_Tools_178', 'ch9Using_Linux_Tools_179', 'ch9Using_Linux_Tools_17a', 'ch9Using_Linux_Tools_17b', 'ch9Using_Linux_Tools_17c', 'ch9Using_Linux_Tools_17d', 'ch9Using_Linux_Tools_17e', 'ch9Using_Linux_Tools_17f', 'ch9Using_Linux_Tools_180', 'ch9Using_Linux_Tools_181', 'ch9Using_Linux_Tools_182', 'ch9Using_Linux_Tools_183', 'ch9Using_Linux_Tools_184', 'ch9Using_Linux_Tools_185', 'ch9Using_Linux_Tools_186', 'ch9Using_Linux_Tools_187', 'ch9Using_Linux_Tools_188', 'ch9Using_Linux_Tools_189', 'ch9Using_Linux_Tools_18a', 'ch9Using_Linux_Tools_18b', 'ch9Using_Linux_Tools_18c', 'ch9Using_Linux_Tools_18d', 'ch9Using_Linux_Tools_18e', 'ch9Using_Linux_Tools_18f', 'ch9Using_Linux_Tools_190', 'ch9Using_Linux_Tools_191', 'ch9Using_Linux_Tools_192', 'ch9Using_Linux_Tools_193', 'ch9Using_Linux_Tools_194', 'ch9Using_Linux_Tools_195', 'ch9Using_Linux_Tools_196', 'ch9Using_Linux_Tools_197', 'ch9Using_Linux_Tools_198', 'ch9Using_Linux_Tools_199', 'ch9Using_Linux_Tools_19a', 'ch9Using_Linux_Tools_19b', 'ch9Using_Linux_Tools_19c', 'ch9Using_Linux_Tools_19d', 'ch9Using_Linux_Tools_19e', 'ch9Using_Linux_Tools_19f', 'ch9Using_Linux_Tools_1a0', 'ch9Using_Linux_Tools_1a1', 'ch9Using_Linux_Tools_1a2', 'ch9Using_Linux_Tools_1a3', 'ch9Using_Linux_Tools_1a4', 'ch9Using_Linux_Tools_1a5', 'ch9Using_Linux_Tools_1a6', 'ch9Using_Linux_Tools_1a7', 'ch9Using_Linux_Tools_1a8', 'ch9Using_Linux_Tools_1a9', 'ch9Using_Linux_Tools_1aa', 'ch9Using_Linux_Tools_1ab', 'ch9Using_Linux_Tools_1ac', 'ch9Using_Linux_Tools_1ad', 'ch9Using_Linux_Tools_1ae', 'ch9Using_Linux_Tools_1af', 'ch9Using_Linux_Tools_1b0', 'ch9Using_Linux_Tools_1b1', 'ch9Using_Linux_Tools_1b2', 'ch9Using_Linux_Tools_1b3', 'ch9Using_Linux_Tools_1b4', 'ch9Using_Linux_Tools_1b5', 'ch9Using_Linux_Tools_1b6', 'ch9Using_Linux_Tools_1b7', 'ch9Using_Linux_Tools_1b8', 'ch9Using_Linux_Tools_1b9', 'ch9Using_Linux_Tools_1ba', 'ch9Using_Linux_Tools_1bb', 'ch9Using_Linux_Tools_1bc', 'ch9Using_Linux_Tools_1bd', 'ch9Using_Linux_Tools_1be', 'ch9Using_Linux_Tools_1bf', 'ch9Using_Linux_Tools_1c0', 'ch9Using_Linux_Tools_1c1', 'ch9Using_Linux_Tools_1c2', 'ch9Using_Linux_Tools_1c3', 'ch9Using_Linux_Tools_1c4', 'ch9Using_Linux_Tools_1c5', 'ch9Using_Linux_Tools_1c6', 'ch9Using_Linux_Tools_1c7', 'ch9Using_Linux_Tools_1c8', 'ch9Using_Linux_Tools_1c9', 'ch9Using_Linux_Tools_1ca', 'ch9Using_Linux_Tools_1cb', 'ch9Using_Linux_Tools_1cc', 'ch9Using_Linux_Tools_1cd', 'ch9Using_Linux_Tools_1ce', 'ch9Using_Linux_Tools_1cf', 'ch9Using_Linux_Tools_1d0', 'ch9Using_Linux_Tools_1d1', 'ch9Using_Linux_Tools_1d2', 'ch9Using_Linux_Tools_1d3', 'ch9Using_Linux_Tools_1d4', 'ch9Using_Linux_Tools_1d5', 'ch9Using_Linux_Tools_1d6', 'ch9Using_Linux_Tools_1d7', 'ch9Using_Linux_Tools_1d8', 'ch9Using_Linux_Tools_1d9', 'ch9Using_Linux_Tools_1da', 'ch9Using_Linux_Tools_1db', 'ch9Using_Linux_Tools_1dc', 'ch9Using_Linux_Tools_1dd', 'ch9Using_Linux_Tools_1de', 'ch9Using_Linux_Tools_1df', 'ch9Using_Linux_Tools_1e0', 'ch9Using_Linux_Tools_1e1'], 'ch1Introduction': ['ch1Introduction_1', 'ch1Introduction_2', 'ch1Introduction_3', 'ch1Introduction_4', 'ch1Introduction_5', 'ch1Introduction_6', 'ch1Introduction_7', 'ch1Introduction_8', 'ch1Introduction_9', 'ch1Introduction_a', 'ch1Introduction_b', 'ch1Introduction_c', 'ch1Introduction_d'], 'ch5func': ['ch5func_1', 'ch5func_2', 'ch5func_3', 'ch5func_4', 'ch5func_5', 'ch5func_6', 'ch5func_7', 'ch5func_8', 'ch5func_9', 'ch5func_a', 'ch5func_b', 'ch5func_c', 'ch5func_d', 'ch5func_e', 'ch5func_f', 'ch5func_10', 'ch5func_11', 'ch5func_12', 'ch5func_13', 'ch5func_14', 'ch5func_15', 'ch5func_16', 'ch5func_17', 'ch5func_18', 'ch5func_19', 'ch5func_1a', 'ch5func_1b', 'ch5func_1c', 'ch5func_1d', 'ch5func_1e', 'ch5func_1f'], 'ch3list_tuples': ['ch3list_tuples_1', 'ch3list_tuples_2', 'ch3list_tuples_3', 'ch3list_tuples_4', 'ch3list_tuples_5', 'ch3list_tuples_6', 'ch3list_tuples_7', 'ch3list_tuples_8', 'ch3list_tuples_9', 'ch3list_tuples_a', 'ch3list_tuples_b', 'ch3list_tuples_c', 'ch3list_tuples_d', 'ch3list_tuples_e', 'ch3list_tuples_f', 'ch3list_tuples_10', 'ch3list_tuples_11', 'ch3list_tuples_12', 'ch3list_tuples_13', 'ch3list_tuples_14', 'ch3list_tuples_15', 'ch3list_tuples_16', 'ch3list_tuples_17', 'ch3list_tuples_18', 'ch3list_tuples_19', 'ch3list_tuples_1a', 'ch3list_tuples_1b', 'ch3list_tuples_1c', 'ch3list_tuples_1d', 'ch3list_tuples_1e', 'ch3list_tuples_1f', 'ch3list_tuples_20', 'ch3list_tuples_21', 'ch3list_tuples_22', 'ch3list_tuples_23', 'ch3list_tuples_24', 'ch3list_tuples_25', 'ch3list_tuples_26', 'ch3list_tuples_27', 'ch3list_tuples_28', 'ch3list_tuples_29', 'ch3list_tuples_2a', 'ch3list_tuples_2b', 'ch3list_tuples_2c', 'ch3list_tuples_2d', 'ch3list_tuples_2e', 'ch3list_tuples_2f', 'ch3list_tuples_30', 'ch3list_tuples_31', 'ch3list_tuples_32', 'ch3list_tuples_33', 'ch3list_tuples_34', 'ch3list_tuples_35', 'ch3list_tuples_36', 'ch3list_tuples_37'], 'ch2intro': ['ch2intro_1', 'ch2intro_2', 'ch2intro_3', 'ch2intro_4', 'ch2intro_5', 'ch2intro_6', 'ch2intro_7', 'ch2intro_8', 'ch2intro_9', 'ch2intro_a', 'ch2intro_b', 'ch2intro_c', 'ch2intro_d', 'ch2intro_e', 'ch2intro_f', 'ch2intro_10', 'ch2intro_11', 'ch2intro_12', 'ch2intro_13', 'ch2intro_14', 'ch2intro_15', 'ch2intro_16', 'ch2intro_17', 'ch2intro_18', 'ch2intro_19', 'ch2intro_1a', 'ch2intro_1b', 'ch2intro_1c', 'ch2intro_1d', 'ch2intro_1e', 'ch2intro_1f', 'ch2intro_20', 'ch2intro_21', 'ch2intro_22', 'ch2intro_23', 'ch2intro_24', 'ch2intro_25', 'ch2intro_26', 'ch2intro_27', 'ch2intro_28', 'ch2intro_29', 'ch2intro_2a', 'ch2intro_2b', 'ch2intro_2c', 'ch2intro_2d', 'ch2intro_2e', 'ch2intro_2f', 'ch2intro_30', 'ch2intro_31', 'ch2intro_32', 'ch2intro_33', 'ch2intro_34', 'ch2intro_35', 'ch2intro_36', 'ch2intro_37', 'ch2intro_38', 'ch2intro_39', 'ch2intro_3a', 'ch2intro_3b', 'ch2intro_3c', 'ch2intro_3d', 'ch2intro_3e', 'ch2intro_3f', 'ch2intro_40', 'ch2intro_41', 'ch2intro_42', 'ch2intro_43', 'ch2intro_44', 'ch2intro_45', 'ch2intro_46', 'ch2intro_47', 'ch2intro_48', 'ch2intro_49', 'ch2intro_4a', 'ch2intro_4b', 'ch2intro_4c', 'ch2intro_4d', 'ch2intro_4e', 'ch2intro_4f', 'ch2intro_50', 'ch2intro_51', 'ch2intro_52', 'ch2intro_53', 'ch2intro_54', 'ch2intro_55', 'ch2intro_56', 'ch2intro_57', 'ch2intro_58', 'ch2intro_59', 'ch2intro_5a', 'ch2intro_5b', 'ch2intro_5c', 'ch2intro_5d', 'ch2intro_5e', 'ch2intro_5f', 'ch2intro_60', 'ch2intro_61', 'ch2intro_62', 'ch2intro_63', 'ch2intro_64', 'ch2intro_65', 'ch2intro_66', 'ch2intro_67'], 'ch4strings_dicts': ['ch4strings_dicts_1', 'ch4strings_dicts_2', 'ch4strings_dicts_3', 'ch4strings_dicts_4', 'ch4strings_dicts_5', 'ch4strings_dicts_6', 'ch4strings_dicts_7', 'ch4strings_dicts_8', 'ch4strings_dicts_9', 'ch4strings_dicts_a', 'ch4strings_dicts_b', 'ch4strings_dicts_c', 'ch4strings_dicts_d', 'ch4strings_dicts_e', 'ch4strings_dicts_f', 'ch4strings_dicts_10', 'ch4strings_dicts_11', 'ch4strings_dicts_12', 'ch4strings_dicts_13', 'ch4strings_dicts_14', 'ch4strings_dicts_15', 'ch4strings_dicts_16', 'ch4strings_dicts_17', 'ch4strings_dicts_18', 'ch4strings_dicts_19', 'ch4strings_dicts_1a', 'ch4strings_dicts_1b', 'ch4strings_dicts_1c', 'ch4strings_dicts_1d', 'ch4strings_dicts_1e', 'ch4strings_dicts_1f', 'ch4strings_dicts_20', 'ch4strings_dicts_21', 'ch4strings_dicts_22', 'ch4strings_dicts_23', 'ch4strings_dicts_24', 'ch4strings_dicts_25', 'ch4strings_dicts_26', 'ch4strings_dicts_27', 'ch4strings_dicts_28', 'ch4strings_dicts_29', 'ch4strings_dicts_2a', 'ch4strings_dicts_2b', 'ch4strings_dicts_2c', 'ch4strings_dicts_2d', 'ch4strings_dicts_2e', 'ch4strings_dicts_2f', 'ch4strings_dicts_30'], 'ch11Section_5': ['ch11Section_5_1', 'ch11Section_5_2', 'ch11Section_5_3', 'ch11Section_5_4', 'ch11Section_5_5', 'ch11Section_5_6', 'ch11Section_5_7', 'ch11Section_5_8', 'ch11Section_5_9', 'ch11Section_5_a', 'ch11Section_5_b', 'ch11Section_5_c', 'ch11Section_5_d', 'ch11Section_5_e', 'ch11Section_5_f', 'ch11Section_5_10', 'ch11Section_5_11', 'ch11Section_5_12', 'ch11Section_5_13', 'ch11Section_5_14', 'ch11Section_5_15', 'ch11Section_5_16', 'ch11Section_5_17', 'ch11Section_5_18', 'ch11Section_5_19', 'ch11Section_5_1a', 'ch11Section_5_1b', 'ch11Section_5_1c', 'ch11Section_5_1d', 'ch11Section_5_1e', 'ch11Section_5_1f', 'ch11Section_5_20', 'ch11Section_5_21', 'ch11Section_5_22', 'ch11Section_5_23', 'ch11Section_5_24', 'ch11Section_5_25', 'ch11Section_5_26', 'ch11Section_5_27', 'ch11Section_5_28', 'ch11Section_5_29', 'ch11Section_5_2a', 'ch11Section_5_2b', 'ch11Section_5_2c', 'ch11Section_5_2d', 'ch11Section_5_2e', 'ch11Section_5_2f', 'ch11Section_5_30', 'ch11Section_5_31', 'ch11Section_5_32', 'ch11Section_5_33', 'ch11Section_5_34', 'ch11Section_5_35', 'ch11Section_5_36', 'ch11Section_5_37', 'ch11Section_5_38', 'ch11Section_5_39', 'ch11Section_5_3a', 'ch11Section_5_3b', 'ch11Section_5_3c', 'ch11Section_5_3d', 'ch11Section_5_3e', 'ch11Section_5_3f', 'ch11Section_5_40', 'ch11Section_5_41', 'ch11Section_5_42', 'ch11Section_5_43', 'ch11Section_5_44', 'ch11Section_5_45', 'ch11Section_5_46', 'ch11Section_5_47', 'ch11Section_5_48', 'ch11Section_5_49', 'ch11Section_5_4a', 'ch11Section_5_4b', 'ch11Section_5_4c', 'ch11Section_5_4d', 'ch11Section_5_4e', 'ch11Section_5_4f', 'ch11Section_5_50', 'ch11Section_5_51', 'ch11Section_5_52', 'ch11Section_5_53', 'ch11Section_5_54', 'ch11Section_5_55', 'ch11Section_5_56', 'ch11Section_5_57', 'ch11Section_5_58', 'ch11Section_5_59', 'ch11Section_5_5a', 'ch11Section_5_5b', 'ch11Section_5_5c', 'ch11Section_5_5d', 'ch11Section_5_5e', 'ch11Section_5_5f', 'ch11Section_5_60', 'ch11Section_5_61', 'ch11Section_5_62', 'ch11Section_5_63', 'ch11Section_5_64', 'ch11Section_5_65', 'ch11Section_5_66', 'ch11Section_5_67', 'ch11Section_5_68', 'ch11Section_5_69', 'ch11Section_5_6a', 'ch11Section_5_6b', 'ch11Section_5_6c', 'ch11Section_5_6d', 'ch11Section_5_6e'], 'ch7interim_assessment': [], 'ch8ult_module_plan': ['ch8ult_module_plan_1', 'ch8ult_module_plan_2', 'ch8ult_module_plan_3', 'ch8ult_module_plan_4', 'ch8ult_module_plan_5', 'ch8ult_module_plan_6', 'ch8ult_module_plan_7', 'ch8ult_module_plan_8', 'ch8ult_module_plan_9', 'ch8ult_module_plan_a', 'ch8ult_module_plan_b', 'ch8ult_module_plan_c', 'ch8ult_module_plan_d', 'ch8ult_module_plan_e', 'ch8ult_module_plan_f', 'ch8ult_module_plan_10', 'ch8ult_module_plan_11', 'ch8ult_module_plan_12', 'ch8ult_module_plan_13', 'ch8ult_module_plan_14', 'ch8ult_module_plan_15', 'ch8ult_module_plan_16', 'ch8ult_module_plan_17', 'ch8ult_module_plan_18', 'ch8ult_module_plan_19', 'ch8ult_module_plan_1a', 'ch8ult_module_plan_1b', 'ch8ult_module_plan_1c', 'ch8ult_module_plan_1d', 'ch8ult_module_plan_1e', 'ch8ult_module_plan_1f', 'ch8ult_module_plan_20', 'ch8ult_module_plan_21', 'ch8ult_module_plan_22', 'ch8ult_module_plan_23', 'ch8ult_module_plan_24', 'ch8ult_module_plan_25', 'ch8ult_module_plan_26', 'ch8ult_module_plan_27', 'ch8ult_module_plan_28', 'ch8ult_module_plan_29', 'ch8ult_module_plan_2a', 'ch8ult_module_plan_2b', 'ch8ult_module_plan_2c', 'ch8ult_module_plan_2d', 'ch8ult_module_plan_2e', 'ch8ult_module_plan_2f', 'ch8ult_module_plan_30', 'ch8ult_module_plan_31', 'ch8ult_module_plan_32', 'ch8ult_module_plan_33', 'ch8ult_module_plan_34', 'ch8ult_module_plan_35', 'ch8ult_module_plan_36', 'ch8ult_module_plan_37', 'ch8ult_module_plan_38', 'ch8ult_module_plan_39', 'ch8ult_module_plan_3a', 'ch8ult_module_plan_3b', 'ch8ult_module_plan_3c', 'ch8ult_module_plan_3d', 'ch8ult_module_plan_3e', 'ch8ult_module_plan_3f', 'ch8ult_module_plan_40', 'ch8ult_module_plan_41', 'ch8ult_module_plan_42', 'ch8ult_module_plan_43', 'ch8ult_module_plan_44'], 'ch10session4': ['ch10session4_1', 'ch10session4_2', 'ch10session4_3', 'ch10session4_4', 'ch10session4_5', 'ch10session4_6', 'ch10session4_7', 'ch10session4_8', 'ch10session4_9', 'ch10session4_a', 'ch10session4_b', 'ch10session4_c', 'ch10session4_d', 'ch10session4_e', 'ch10session4_f', 'ch10session4_10', 'ch10session4_11', 'ch10session4_12', 'ch10session4_13', 'ch10session4_14', 'ch10session4_15', 'ch10session4_16', 'ch10session4_17', 'ch10session4_18', 'ch10session4_19', 'ch10session4_1a', 'ch10session4_1b', 'ch10session4_1c', 'ch10session4_1d', 'ch10session4_1e', 'ch10session4_1f', 'ch10session4_20', 'ch10session4_21', 'ch10session4_22', 'ch10session4_23', 'ch10session4_24', 'ch10session4_25', 'ch10session4_26', 'ch10session4_27', 'ch10session4_28', 'ch10session4_29', 'ch10session4_2a', 'ch10session4_2b', 'ch10session4_2c', 'ch10session4_2d', 'ch10session4_2e', 'ch10session4_2f', 'ch10session4_30', 'ch10session4_31', 'ch10session4_32', 'ch10session4_33', 'ch10session4_34', 'ch10session4_35', 'ch10session4_36', 'ch10session4_37', 'ch10session4_38', 'ch10session4_39', 'ch10session4_3a', 'ch10session4_3b', 'ch10session4_3c', 'ch10session4_3d', 'ch10session4_3e', 'ch10session4_3f', 'ch10session4_40', 'ch10session4_41', 'ch10session4_42', 'ch10session4_43', 'ch10session4_44', 'ch10session4_45', 'ch10session4_46', 'ch10session4_47', 'ch10session4_48', 'ch10session4_49', 'ch10session4_4a', 'ch10session4_4b', 'ch10session4_4c', 'ch10session4_4d', 'ch10session4_4e', 'ch10session4_4f', 'ch10session4_50', 'ch10session4_51', 'ch10session4_52', 'ch10session4_53', 'ch10session4_54', 'ch10session4_55', 'ch10session4_56', 'ch10session4_57', 'ch10session4_58', 'ch10session4_59', 'ch10session4_5a', 'ch10session4_5b', 'ch10session4_5c', 'ch10session4_5d', 'ch10session4_5e', 'ch10session4_5f', 'ch10session4_60', 'ch10session4_61', 'ch10session4_62', 'ch10session4_63', 'ch10session4_64', 'ch10session4_65', 'ch10session4_66', 'ch10session4_67', 'ch10session4_68', 'ch10session4_69', 'ch10session4_6a', 'ch10session4_6b', 'ch10session4_6c', 'ch10session4_6d', 'ch10session4_6e', 'ch10session4_6f', 'ch10session4_70', 'ch10session4_71', 'ch10session4_72', 'ch10session4_73', 'ch10session4_74', 'ch10session4_75', 'ch10session4_76', 'ch10session4_77', 'ch10session4_78', 'ch10session4_79', 'ch10session4_7a', 'ch10session4_7b', 'ch10session4_7c', 'ch10session4_7d', 'ch10session4_7e', 'ch10session4_7f', 'ch10session4_80', 'ch10session4_81', 'ch10session4_82', 'ch10session4_83', 'ch10session4_84', 'ch10session4_85', 'ch10session4_86', 'ch10session4_87', 'ch10session4_88', 'ch10session4_89', 'ch10session4_8a', 'ch10session4_8b', 'ch10session4_8c', 'ch10session4_8d', 'ch10session4_8e', 'ch10session4_8f', 'ch10session4_90', 'ch10session4_91', 'ch10session4_92', 'ch10session4_93', 'ch10session4_94', 'ch10session4_95', 'ch10session4_96', 'ch10session4_97', 'ch10session4_98', 'ch10session4_99', 'ch10session4_9a', 'ch10session4_9b', 'ch10session4_9c', 'ch10session4_9d', 'ch10session4_9e', 'ch10session4_9f', 'ch10session4_a0', 'ch10session4_a1', 'ch10session4_a2', 'ch10session4_a3', 'ch10session4_a4', 'ch10session4_a5', 'ch10session4_a6', 'ch10session4_a7', 'ch10session4_a8', 'ch10session4_a9', 'ch10session4_aa', 'ch10session4_ab', 'ch10session4_ac', 'ch10session4_ad', 'ch10session4_ae', 'ch10session4_af', 'ch10session4_b0', 'ch10session4_b1', 'ch10session4_b2', 'ch10session4_b3', 'ch10session4_b4', 'ch10session4_b5', 'ch10session4_b6']}
\ No newline at end of file
--- a/scripts/rst2docbook.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-#!/usr/bin/python
-"""
-Just a hack to convert rst to xml and then docbook . 
-May not containt all the required elements of a docbook .
-Just done to make it run for the specific rst for our 
-sees documentation.
-"""
-import xml.etree.ElementTree as ET
-import os 
-import re
-import subprocess
-import os
-import pkg_resources
-import glob, os, re, sys
-names = glob.glob('ch*.xml')
-"""
-chapterno=0
-
-def convert2xml(file):
-#    print folder,subfolder,file
-    global chapterno
-    name=file.split('/')[-1]
-    name=str(chapterno)+name.split('.')[0]
-#    full_file=os.path.join(folder,file)    
-#    if file.endswith('.rst'):    
-    print file	    
-    xml_file=name+'.xml'        
-    command="rst2xml.py %s > %s" %(file , xml_file)
-    print command        
-    a=subprocess.Popen(command , shell=True)
-	   	
-
-
-def walk(repo):
-    global chapterno
-    mainfolder='/home/amit/sttp_latest/'    
-    for readline in open('index.config','r').readlines():
-        chapterno+=1		
-        filename=mainfolder+readline
-        convert2xml(filename)
-
-
-"""
-def convert2docbook(xml_string):
-#    xml_file_obj=open(file,'r')
-#    xml_string=xml_file_obj.read() 
-#    xml_file_obj.close()       
-    try:
-        xml_string=re.sub('<strong>','<emphasis role="strong">', xml_string)   
-        xml_string=re.sub('<literal_block','<programlisting>',xml_string)
-        xml_string=re.sub('</literal_block>','</programlisting>',xml_string)
-        xml_string=re.sub('xml:space="preserve">','',xml_string)
-        xml_string=re.sub('<paragraph>' ,'<para>',xml_string)
-        xml_string=re.sub('</paragraph>' ,'</para>',xml_string)  
-        xml_string=re.sub('</strong>' ,'</emphasis>',xml_string)
-        chapter= ET.Element("chapter")
-        article=ET.SubElement(chapter,"article")
-        articleinfo=ET.SubElement(article,"articleinfo")
-        tree = ET.fromstring(xml_string)
-        title= ET.SubElement(articleinfo,"title")   
-        try:    
-            title.text=tree.items()[1][1]
-        except:
-                pass    
-        article.insert(1,tree)
-        xml_string=ET.tostring(chapter)
-        xml_string=re.sub('<document ids=.*">' ,'',xml_string)
-        xml_string=re.sub('</document>' ,'',xml_string)
-        return xml_string
-#    docbook_file=file.split('.')[0]+'.docbook'
-#    f=open(docbook_file,'w')
-#    f.write(xml_string)
-#    xml_string=None
-    except :
-        pass
-
-
-
-
-if __name__=='__main__':
-#    repo='/home/amit/sphinxvirt/review/'
-#    walk(repo)
-#    convert(1,2,3)
-    for name in names:
-        print name        
-        xml_string=open(name,'r').read()
-         
-        xml_string=convert2docbook(xml_string)
-        docbook_file=name.split('.')[0]+'.docbook'
-        f=open(docbook_file,'w')
-        try:        
-            f.write(xml_string)
-        except:
-                pass
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--- a/web/README	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-This directory contains web-related files.  Surprise!
-
-javascript - files used by the comment system, based on jQuery
-hgbook     - Django app that acts as the comment back end
-styles.css - style file
--- a/web/genindex.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#!/usr/bin/env python
-
-import glob, os, re
-
-chapter_re = re.compile(r'<(chapter|appendix|preface)\s+id="([^"]+)">')
-filename_re = re.compile(r'<\?dbhtml filename="([^"]+)"\?>')
-title_re = re.compile(r'<title>(.*)</title>')
-
-chapters = (sorted(glob.glob('../en/ch*.xml')) +
-            sorted(glob.glob('../en/app*.xml')))
-
-fp = open('index-read.html.in', 'w')
-
-print >> fp, '''<!-- -*- html -*- -->
-{% extends "boilerplate.html" %}
-{% block bodycontent %}
-<div class="navheader"><h1 class="booktitle">Mercurial: The Definitive Guide<div class="authors">by Bryan O'Sullivan</div></h1></div>
-<div class="book"><ul class="booktoc">'''
-
-ch = 0
-app = 0
-ab = 0
-for c in chapters:
-    filename = None
-    title = None
-    chapid = None
-    chaptype = None
-    for line in open(c):
-        m = chapter_re.search(line)
-        if m:
-            chaptype, chapid = m.groups()
-        m = filename_re.search(line)
-        if m:
-            filename = m.group(1)
-        m = title_re.search(line)
-        if m:
-            title = m.group(1)
-        if filename and title and chapid:
-            if chaptype == 'appendix':
-                num = chr(ord('A') + app)
-                app += 1
-            else:
-                num = ch
-                ch += 1
-            ab += 1
-            date = os.popen('hg log -l1 --template "{date|isodate}" ' + c).read().split(None, 1)[0]
-            args = {
-                'ab': "ab"[ab % 2],
-                'date': date,
-                'chapid': chapid,
-                'num': num,
-                'filename': filename,
-                'title': title,
-                }
-            print >> fp, '<li class="zebra_%(ab)s"><span class="chapinfo">%(date)s<a href="/feeds/comments/%(chapid)s/"><img src="/support/figs/rss.png"/></a></span>%(num)s. <a href="%(filename)s">%(title)s</a></li>' % args
-            break
-
-print >> fp, '''</ul></div>
-{% endblock %}'''
-
-fp.close()
--- a/web/hgbook.conf	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-# -*- apache -*-
-
-<VirtualHost *:80>
-#    ServerName hgbook.red-bean.com
-#    ServerAdmin bos@serpentine.com
-    ServerAdmin webmaster@localhost
-    ErrorLog /var/log/apache2/error.log
-#    ErrorLog logs/hgbook-error_log
-    # Debian:
-    # CustomLog logs/hgbook-access_log full
-    # Fedora:
-#    CustomLog logs/hgbook-access_log combined
-	CustomLog /var/log/apache2/access.log combined
-#    Options +MultiViews
-#    DirectoryIndex index.html.var index.html
-    DocumentRoot "/home/amit/hgbook-alqua/web/html"
-
-
-#    Redirect permanent /hgbook.html /index.html
-#    Redirect permanent /hgbookch1.html /read/preface.html
-#    Redirect permanent /hgbookch2.html /read/a-tour-of-mercurial-the-basics.html
-#    Redirect permanent /hgbookch3.html /read/a-tour-of-mercurial-merging-work.html
-#    Redirect permanent /hgbookch4.html /read/behind-the-scenes.html
-#    Redirect permanent /hgbookch5.html /read/mercurial-in-daily-use.html
-#    Redirect permanent /hgbookch6.html /read/file-names-and-pattern-matching.html
-#    Redirect permanent /hgbookch6.html /read/managing-releases-and-branchy-development.html
-#    Redirect permanent /hgbookch7.html /read/finding-and-fixing-mistakes.html
-#    Redirect permanent /hgbookch8.html /read/handling-repository-events-with-hooks.html
-#    Redirect permanent /hgbookch9.html /read/customizing-the-output-of-mercurial.html
-#    Redirect permanent /hgbookch10.html /read/managing-change-with-mercurial-queues.html
-#    Redirect permanent /hgbookch11.html /read/advanced-uses-of-mercurial-queues.html
-#    Redirect permanent /hgbookch12.html /read/adding-functionality-with-extensions.html
-#    Redirect permanent /hgbookap1.html /read/command-reference.html
-#    Redirect permanent /hgbookap2.html /read/mercurial-queues-reference.html
-#    Redirect permanent /hgbookap3.html /read/installing-mercurial-from-source.html
-#    Redirect permanent /hgbookap4.html /read/open-publication-license.html
-#    Redirect permanent /hgbookli1.html /read/index.html
-#    Redirect permanent /hgbookli2.html /read/index.html
-#    Redirect permanent /hgbookli3.html /read/index.html
-#    Redirect permanent /hgbookli4.html /read/index.html
-
-	WSGIScriptAlias /review /home/amit/hgbook-alqua/web/hgbook/run.wsgi
-
-
-
-    # Actively redirect requests via a ServerAlias to the canonical hostname.
-    RewriteEngine On
-#    RewriteCond %{HTTP_HOST} !=hgbook.red-bean.com
-#    RewriteRule ^(.*) http://hgbook.red-bean.com$1 [R]
-
-#    <Location "/">
-#        SetHandler python-program
-	# hg clone http://bitbucket.org/mirror/django-trunk/
-#        PythonPath "['/home/amit/hgbook-alqua/web/hgbook'] + sys.path"
-#        PythonHandler django.core.handlers.modpython
-#       PythonAutoReload Off
-#        SetEnv DJANGO_SETTINGS_MODULE hgbook.settings
-#        PythonDebug Off
-#    </Location>
-
-
-	
-    <Location ~ "^/$">
-        SetHandler None
-        DirectoryIndex index.html
-    </Location>
-
-    <Location ~ "^/index.html">
-        SetHandler None
-    </Location>
-
-    <Location ~ "^/robots.txt">
-        SetHandler None
-    </Location>
-
-    <Location "/read">
-        SetHandler None
-    </Location>
-
-    <Location "/support">
-        SetHandler None
-    </Location>
-
-    <Location "/media">
-        SetHandler None
-    </Location>
-
-#    Alias /media /home/bos/hg/django-trunk/django/contrib/admin/media
-
-    <Directory "/home/amit/hgbook-alqua/en/html">
-        Options Indexes FollowSymlinks
-        AllowOverride None
-        Order allow,deny
-        Allow from all
-    </Directory>
-
-    <Directory "/home/amit/hgbook-alqua/en/html">
-        AllowOverride AuthConfig
-    </Directory>
-
-    <Directory "/home/amit/hgbook-alqua/web/support">
-        Options None
-    </Directory>
-</VirtualHost>
-
-#<Directory "/home/bos/hg/django-trunk/django/contrib/admin/media">
-#    Options None
-#    AllowOverride None
-#    Order allow,deny
-#    Allow from all
-#</Directory>
--- a/web/hgbook.conf~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-# -*- apache -*-
-
-<VirtualHost *:80>
-#    ServerName hgbook.red-bean.com
-#    ServerAdmin bos@serpentine.com
-    ServerAdmin webmaster@localhost
-    ErrorLog /var/log/apache2/error.log
-#    ErrorLog logs/hgbook-error_log
-    # Debian:
-    # CustomLog logs/hgbook-access_log full
-    # Fedora:
-#    CustomLog logs/hgbook-access_log combined
-	CustomLog /var/log/apache2/access.log combined
-#    Options +MultiViews
-#    DirectoryIndex index.html.var index.html
-#    DocumentRoot "/home/amit/hgbook-alqua/web/html"
-
-
-#    Redirect permanent /hgbook.html /index.html
-#    Redirect permanent /hgbookch1.html /read/preface.html
-#    Redirect permanent /hgbookch2.html /read/a-tour-of-mercurial-the-basics.html
-#    Redirect permanent /hgbookch3.html /read/a-tour-of-mercurial-merging-work.html
-#    Redirect permanent /hgbookch4.html /read/behind-the-scenes.html
-#    Redirect permanent /hgbookch5.html /read/mercurial-in-daily-use.html
-#    Redirect permanent /hgbookch6.html /read/file-names-and-pattern-matching.html
-#    Redirect permanent /hgbookch6.html /read/managing-releases-and-branchy-development.html
-#    Redirect permanent /hgbookch7.html /read/finding-and-fixing-mistakes.html
-#    Redirect permanent /hgbookch8.html /read/handling-repository-events-with-hooks.html
-#    Redirect permanent /hgbookch9.html /read/customizing-the-output-of-mercurial.html
-#    Redirect permanent /hgbookch10.html /read/managing-change-with-mercurial-queues.html
-#    Redirect permanent /hgbookch11.html /read/advanced-uses-of-mercurial-queues.html
-#    Redirect permanent /hgbookch12.html /read/adding-functionality-with-extensions.html
-#    Redirect permanent /hgbookap1.html /read/command-reference.html
-#    Redirect permanent /hgbookap2.html /read/mercurial-queues-reference.html
-#    Redirect permanent /hgbookap3.html /read/installing-mercurial-from-source.html
-#    Redirect permanent /hgbookap4.html /read/open-publication-license.html
-#    Redirect permanent /hgbookli1.html /read/index.html
-#    Redirect permanent /hgbookli2.html /read/index.html
-#    Redirect permanent /hgbookli3.html /read/index.html
-#    Redirect permanent /hgbookli4.html /read/index.html
-
-	WSGIScriptAlias /review /home/amit/hgbook-alqua/web/hgbook/run.wsgi
-
-
-
-    # Actively redirect requests via a ServerAlias to the canonical hostname.
-    RewriteEngine On
-#    RewriteCond %{HTTP_HOST} !=hgbook.red-bean.com
-#    RewriteRule ^(.*) http://hgbook.red-bean.com$1 [R]
-
-#    <Location "/">
-#        SetHandler python-program
-	# hg clone http://bitbucket.org/mirror/django-trunk/
-#        PythonPath "['/home/amit/hgbook-alqua/web/hgbook'] + sys.path"
-#        PythonHandler django.core.handlers.modpython
-#       PythonAutoReload Off
-#        SetEnv DJANGO_SETTINGS_MODULE hgbook.settings
-#        PythonDebug Off
-#    </Location>
-
-
-	
-    <Location ~ "^/$">
-        SetHandler None
-        DirectoryIndex index.html
-    </Location>
-
-    <Location ~ "^/index.html">
-        SetHandler None
-    </Location>
-
-    <Location ~ "^/robots.txt">
-        SetHandler None
-    </Location>
-
-    <Location "/read">
-        SetHandler None
-    </Location>
-
-    <Location "/support">
-        SetHandler None
-    </Location>
-
-    <Location "/media">
-        SetHandler None
-    </Location>
-
-#    Alias /media /home/bos/hg/django-trunk/django/contrib/admin/media
-
-    <Directory "/home/amit/hgbook-alqua/en/html">
-        Options Indexes FollowSymlinks
-        AllowOverride None
-        Order allow,deny
-        Allow from all
-    </Directory>
-
-    <Directory "/home/amit/hgbook-alqua/en/html">
-        AllowOverride AuthConfig
-    </Directory>
-
-    <Directory "/home/amit/hgbook-alqua/web/support">
-        Options None
-    </Directory>
-</VirtualHost>
-
-#<Directory "/home/bos/hg/django-trunk/django/contrib/admin/media">
-#    Options None
-#    AllowOverride None
-#    Order allow,deny
-#    Allow from all
-#</Directory>
Binary file web/hgbook/.database.sqlite3 has changed
--- a/web/hgbook/__init__.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-import admin
Binary file web/hgbook/__init__.pyc has changed
--- a/web/hgbook/admin.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-from django.contrib import admin
-from hgbook.comments.models import Comment, Element
-
-class CommentAdmin(admin.ModelAdmin):
-    list_display = ['element', 'submitter_name', 'comment', 'reviewed',
-                    'hidden', 'date']
-    search_fields = ['comment']
-    date_hierarchy = 'date'
-    list_filter = ['date', 'submitter_name']
-    search_fields = ['title', 'submitter_name', 'submitter_url']
-    fieldsets = (
-        (None, {'fields': ('submitter_name', 'element', 'comment')}),
-        ('Review and presentation state', {'fields': ('reviewed', 'hidden')}),
-        ('Other info', {'fields': ('submitter_url', 'ip')}),
-        )
-    # XXX: adding 'date' to the 'Other info' fieldset results in a
-    # ImproperlyConfigured error. :S
-
-class ElementAdmin(admin.ModelAdmin):
-    search_fields = ['id', 'chapter']
-    list_filter = ['chapter', 'title']
-#    search_fields = ['id'
-admin.site.register(Comment, CommentAdmin)
-admin.site.register(Element, ElementAdmin)
Binary file web/hgbook/admin.pyc has changed
--- a/web/hgbook/admin.py~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-from django.contrib import admin
-from hgbook.comments.models import Comment, Element
-
-class CommentAdmin(admin.ModelAdmin):
-    list_display = ['element', 'submitter_name', 'comment', 'reviewed',
-                    'hidden', 'date']
-    search_fields = ['comment']
-    date_hierarchy = 'date'
-    list_filter = ['date', 'submitter_name']
-    search_fields = ['title', 'submitter_name', 'submitter_url']
-    fieldsets = (
-        (None, {'fields': ('submitter_name', 'element', 'comment')}),
-        ('Review and presentation state', {'fields': ('reviewed', 'hidden')}),
-        ('Other info', {'fields': ('submitter_url', 'ip')}),
-        )
-    # XXX: adding 'date' to the 'Other info' fieldset results in a
-    # ImproperlyConfigured error. :S
-
-class ElementAdmin(admin.ModelAdmin):
-    search_fields = ['id']
-#    list_filter = ['chapter', 'title']
-
-admin.site.register(Comment, CommentAdmin)
-admin.site.register(Element, ElementAdmin)
Binary file web/hgbook/comments/__init__.pyc has changed
--- a/web/hgbook/comments/feeds.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-from django.core.exceptions import ObjectDoesNotExist
-from django.utils.feedgenerator import Atom1Feed
-from django.contrib.syndication.feeds import Feed
-from hgbook.comments.models import Comment, Element
-
-class MyAtomFeed(Atom1Feed):
-    title_type = u'html'
-    
-class Comments(Feed):
-    feed_type = MyAtomFeed
-    title = 'Mercurial - The Definitive Guide: recent comments'
-    subtitle = ('Recent comments on the text of &#8220;Mercurial: The '
-                'Definitive Guide&#8221;, from our readers')
-    link = '/feeds/comments/'
-    author_name = 'Our readers'
-
-    def feedfilter(self, queryset):
-        return queryset.order_by('-date')[:20]
-
-    def items(self):
-        return self.feedfilter(Comment.objects)
-
-    def item_author_name(self, obj):
-        return obj.submitter_name
-
-    def item_pubdate(self, obj):
-        return obj.date
-
-    def get_object(self, bits):
-        if len(bits) == 0:
-            return self.items()
-        elif len(bits) > 1:
-            raise ObjectDoesNotExist
-        return self.feedfilter(Comment.objects.filter(element__chapter=bits[0],
-                                                      hidden=False))
Binary file web/hgbook/comments/feeds.pyc has changed
--- a/web/hgbook/comments/models.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-from django.db import models
-import hashlib
-from django.conf import settings
-from django.contrib.flatpages.models import FlatPage
-import os
-from BeautifulSoup import BeautifulSoup
-import django
-from django.utils.html import strip_tags
-import djapian
-from djapian.indexer import CompositeIndexer ,Indexer
-mutable = True
-#standard_url='localhost/review/html/'
-
-
-
-class Element(models.Model):
-    id = models.CharField('ID attribute', max_length=64, editable=False,
-                          primary_key=True)
-    	
-    chapter = models.CharField('Chapter ID', max_length=100, editable=False,
-                               db_index=True)
-    title = models.CharField('Section title', max_length=256, editable=False)
-
-    def __unicode__(self):
-        return self.id
-    
-class Comment(models.Model):
-    element = models.ForeignKey(Element,
-        help_text='ID of paragraph that was commented on')
-    comment = models.TextField(editable=mutable,
-        help_text='Text of submitted comment (please do not modify)')
-    submitter_name = models.CharField('Submitter', max_length=64,
-        help_text='Self-reported name of submitter (may be bogus)')
-    submitter_url = models.URLField('URL', blank=True, editable=mutable,
-        help_text='Self-reported URL of submitter (may be empty or bogus)')
-    ip = models.IPAddressField('IP address', editable=mutable,
-        help_text='IP address from which comment was submitted')
-    date = models.DateTimeField('date submitted', auto_now=True,
-                                auto_now_add=True)
-    reviewed = models.BooleanField(default=False, db_index=True,
-        help_text='Has this comment been reviewed by an author?')
-    hidden = models.BooleanField(default=False, db_index=True,
-        help_text='Has this comment been hidden from public display?')
-
-    def __unicode__(self):
-        return self.comment[:32]
-
-#    def get_absolute_url(self):
-#        s = hashlib.new()
-#        s.update(repr(self.comment))
-#        s.update(repr(self.submitter_name))
-#        s.update(str(self.date))
-#	print '/read/%s.html#%s?comment=%s&uuid=%s' % (
-#            self.element.chapter, self.element.id, self.id, s.hexdigest()[:20]
-#            )        
-#	return '/read/%s.html#%s?comment=%s&uuid=%s' % (
-#            self.element.chapter, self.element.id, self.id, s.hexdigest()[:20]
-#            )
-
-
-"""
-for directory,lists,files in os.walk('../html'):
-	if directory=='../html':
-		for file in files:
-			if file.endswith('.html'):
-				filename=os.path.join('../html/'+file)			
-				f=open(filename,'r')			
-				soup = BeautifulSoup(''.join(f.read()))
-				titletag=soup.html.head.title
-				body=strip_tags(soup.html.body)				
-				c=FlatPage(url=standard_url+file,title=titletag.string,content=body)
-				c.save()		
-	
-class FlatPageIndexer( djapian.Indexer ):
-    fields = [ 'title', 'content' ]
-    
-
-djapian.space.add_index(FlatPage, FlatPageIndexer, attach_as="indexer")
-FlatPage.indexer.update()
-result = FlatPage.indexer.search('lists')
-for row in result :
-	print row.instance.url
-print result.count()
-
-"""	
-
Binary file web/hgbook/comments/models.pyc has changed
--- a/web/hgbook/comments/models.py~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-from django.db import models
-import hashlib
-from django.conf import settings
-from django.contrib.flatpages.models import FlatPage
-import os
-from BeautifulSoup import BeautifulSoup
-import django
-from django.utils.html import strip_tags
-import djapian
-from djapian.indexer import CompositeIndexer ,Indexer
-mutable = True
-standard_url='localhost/review/html/'
-
-
-
-class Element(models.Model):
-    id = models.CharField('ID attribute', max_length=64, editable=False,
-                          primary_key=True)
-    	
-    chapter = models.CharField('Chapter ID', max_length=100, editable=False,
-                               db_index=True)
-    title = models.CharField('Section title', max_length=256, editable=False)
-
-    def __unicode__(self):
-        return self.id
-    
-class Comment(models.Model):
-    element = models.ForeignKey(Element,
-        help_text='ID of paragraph that was commented on')
-    comment = models.TextField(editable=mutable,
-        help_text='Text of submitted comment (please do not modify)')
-    submitter_name = models.CharField('Submitter', max_length=64,
-        help_text='Self-reported name of submitter (may be bogus)')
-    submitter_url = models.URLField('URL', blank=True, editable=mutable,
-        help_text='Self-reported URL of submitter (may be empty or bogus)')
-    ip = models.IPAddressField('IP address', editable=mutable,
-        help_text='IP address from which comment was submitted')
-    date = models.DateTimeField('date submitted', auto_now=True,
-                                auto_now_add=True)
-    reviewed = models.BooleanField(default=False, db_index=True,
-        help_text='Has this comment been reviewed by an author?')
-    hidden = models.BooleanField(default=False, db_index=True,
-        help_text='Has this comment been hidden from public display?')
-
-    def __unicode__(self):
-        return self.comment[:32]
-
-#    def get_absolute_url(self):
-#        s = hashlib.new()
-#        s.update(repr(self.comment))
-#        s.update(repr(self.submitter_name))
-#        s.update(str(self.date))
-#	print '/read/%s.html#%s?comment=%s&uuid=%s' % (
-#            self.element.chapter, self.element.id, self.id, s.hexdigest()[:20]
-#            )        
-#	return '/read/%s.html#%s?comment=%s&uuid=%s' % (
-#            self.element.chapter, self.element.id, self.id, s.hexdigest()[:20]
-#            )
-
-
-"""
-for directory,lists,files in os.walk('../html'):
-	if directory=='../html':
-		for file in files:
-			if file.endswith('.html'):
-				filename=os.path.join('../html/'+file)			
-				f=open(filename,'r')			
-				soup = BeautifulSoup(''.join(f.read()))
-				titletag=soup.html.head.title
-				body=strip_tags(soup.html.body)				
-				c=FlatPage(url=standard_url+file,title=titletag.string,content=body)
-				c.save()		
-	
-class FlatPageIndexer( djapian.Indexer ):
-    fields = [ 'title', 'content' ]
-    
-
-djapian.space.add_index(FlatPage, FlatPageIndexer, attach_as="indexer")
-FlatPage.indexer.update()
-result = FlatPage.indexer.search('lists')
-for row in result :
-	print row.instance.url
-print result.count()
-
-"""	
-
--- a/web/hgbook/comments/p_list.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-p_list= {'ch6oop': ['ch6oop_1', 'ch6oop_2', 'ch6oop_3', 'ch6oop_4', 'ch6oop_5', 'ch6oop_6', 'ch6oop_7', 'ch6oop_8', 'ch6oop_9', 'ch6oop_a', 'ch6oop_b', 'ch6oop_c', 'ch6oop_d', 'ch6oop_e', 'ch6oop_f', 'ch6oop_10', 'ch6oop_11', 'ch6oop_12', 'ch6oop_13', 'ch6oop_14', 'ch6oop_15', 'ch6oop_16', 'ch6oop_17', 'ch6oop_18', 'ch6oop_19', 'ch6oop_1a', 'ch6oop_1b', 'ch6oop_1c', 'ch6oop_1d', 'ch6oop_1e', 'ch6oop_1f', 'ch6oop_20', 'ch6oop_21', 'ch6oop_22', 'ch6oop_23', 'ch6oop_24', 'ch6oop_25', 'ch6oop_26', 'ch6oop_27', 'ch6oop_28', 'ch6oop_29', 'ch6oop_2a', 'ch6oop_2b', 'ch6oop_2c', 'ch6oop_2d', 'ch6oop_2e', 'ch6oop_2f', 'ch6oop_30', 'ch6oop_31', 'ch6oop_32', 'ch6oop_33', 'ch6oop_34', 'ch6oop_35', 'ch6oop_36', 'ch6oop_37', 'ch6oop_38', 'ch6oop_39', 'ch6oop_3a', 'ch6oop_3b', 'ch6oop_3c', 'ch6oop_3d', 'ch6oop_3e', 'ch6oop_3f', 'ch6oop_40', 'ch6oop_41', 'ch6oop_42', 'ch6oop_43', 'ch6oop_44', 'ch6oop_45', 'ch6oop_46', 'ch6oop_47', 'ch6oop_48', 'ch6oop_49', 'ch6oop_4a', 'ch6oop_4b', 'ch6oop_4c', 'ch6oop_4d', 'ch6oop_4e', 'ch6oop_4f', 'ch6oop_50', 'ch6oop_51', 'ch6oop_52', 'ch6oop_53', 'ch6oop_54', 'ch6oop_55', 'ch6oop_56', 'ch6oop_57', 'ch6oop_58', 'ch6oop_59', 'ch6oop_5a', 'ch6oop_5b', 'ch6oop_5c', 'ch6oop_5d', 'ch6oop_5e', 'ch6oop_5f', 'ch6oop_60', 'ch6oop_61', 'ch6oop_62', 'ch6oop_63', 'ch6oop_64', 'ch6oop_65', 'ch6oop_66', 'ch6oop_67', 'ch6oop_68', 'ch6oop_69', 'ch6oop_6a', 'ch6oop_6b', 'ch6oop_6c', 'ch6oop_6d', 'ch6oop_6e', 'ch6oop_6f', 'ch6oop_70', 'ch6oop_71', 'ch6oop_72', 'ch6oop_73', 'ch6oop_74', 'ch6oop_75', 'ch6oop_76', 'ch6oop_77', 'ch6oop_78', 'ch6oop_79', 'ch6oop_7a', 'ch6oop_7b', 'ch6oop_7c', 'ch6oop_7d', 'ch6oop_7e', 'ch6oop_7f', 'ch6oop_80', 'ch6oop_81', 'ch6oop_82', 'ch6oop_83', 'ch6oop_84', 'ch6oop_85', 'ch6oop_86', 'ch6oop_87', 'ch6oop_88', 'ch6oop_89', 'ch6oop_8a', 'ch6oop_8b', 'ch6oop_8c', 'ch6oop_8d', 'ch6oop_8e', 'ch6oop_8f', 'ch6oop_90', 'ch6oop_91', 'ch6oop_92', 'ch6oop_93', 'ch6oop_94', 'ch6oop_95', 'ch6oop_96', 'ch6oop_97', 'ch6oop_98', 'ch6oop_99', 'ch6oop_9a', 'ch6oop_9b', 'ch6oop_9c', 'ch6oop_9d', 'ch6oop_9e', 'ch6oop_9f', 'ch6oop_a0', 'ch6oop_a1', 'ch6oop_a2', 'ch6oop_a3', 'ch6oop_a4', 'ch6oop_a5', 'ch6oop_a6', 'ch6oop_a7', 'ch6oop_a8', 'ch6oop_a9', 'ch6oop_aa', 'ch6oop_ab', 'ch6oop_ac', 'ch6oop_ad', 'ch6oop_ae', 'ch6oop_af', 'ch6oop_b0', 'ch6oop_b1', 'ch6oop_b2', 'ch6oop_b3', 'ch6oop_b4', 'ch6oop_b5', 'ch6oop_b6', 'ch6oop_b7', 'ch6oop_b8', 'ch6oop_b9', 'ch6oop_ba', 'ch6oop_bb', 'ch6oop_bc', 'ch6oop_bd', 'ch6oop_be', 'ch6oop_bf', 'ch6oop_c0', 'ch6oop_c1', 'ch6oop_c2', 'ch6oop_c3', 'ch6oop_c4', 'ch6oop_c5', 'ch6oop_c6', 'ch6oop_c7', 'ch6oop_c8', 'ch6oop_c9', 'ch6oop_ca', 'ch6oop_cb', 'ch6oop_cc', 'ch6oop_cd', 'ch6oop_ce', 'ch6oop_cf', 'ch6oop_d0', 'ch6oop_d1', 'ch6oop_d2', 'ch6oop_d3', 'ch6oop_d4', 'ch6oop_d5', 'ch6oop_d6', 'ch6oop_d7', 'ch6oop_d8', 'ch6oop_d9', 'ch6oop_da', 'ch6oop_db', 'ch6oop_dc', 'ch6oop_dd', 'ch6oop_de', 'ch6oop_df', 'ch6oop_e0', 'ch6oop_e1', 'ch6oop_e2', 'ch6oop_e3', 'ch6oop_e4', 'ch6oop_e5', 'ch6oop_e6', 'ch6oop_e7', 'ch6oop_e8', 'ch6oop_e9', 'ch6oop_ea', 'ch6oop_eb', 'ch6oop_ec', 'ch6oop_ed', 'ch6oop_ee', 'ch6oop_ef', 'ch6oop_f0', 'ch6oop_f1', 'ch6oop_f2', 'ch6oop_f3', 'ch6oop_f4', 'ch6oop_f5', 'ch6oop_f6', 'ch6oop_f7', 'ch6oop_f8', 'ch6oop_f9', 'ch6oop_fa', 'ch6oop_fb', 'ch6oop_fc', 'ch6oop_fd', 'ch6oop_fe', 'ch6oop_ff', 'ch6oop_100', 'ch6oop_101', 'ch6oop_102', 'ch6oop_103', 'ch6oop_104', 'ch6oop_105', 'ch6oop_106', 'ch6oop_107', 'ch6oop_108', 'ch6oop_109', 'ch6oop_10a', 'ch6oop_10b', 'ch6oop_10c', 'ch6oop_10d', 'ch6oop_10e', 'ch6oop_10f', 'ch6oop_110', 'ch6oop_111', 'ch6oop_112', 'ch6oop_113', 'ch6oop_114', 'ch6oop_115', 'ch6oop_116', 'ch6oop_117', 'ch6oop_118', 'ch6oop_119', 'ch6oop_11a', 'ch6oop_11b', 'ch6oop_11c', 'ch6oop_11d', 'ch6oop_11e', 'ch6oop_11f', 'ch6oop_120', 'ch6oop_121', 'ch6oop_122', 'ch6oop_123', 'ch6oop_124', 'ch6oop_125', 'ch6oop_126', 'ch6oop_127', 'ch6oop_128', 'ch6oop_129', 'ch6oop_12a', 'ch6oop_12b', 'ch6oop_12c', 'ch6oop_12d', 'ch6oop_12e', 'ch6oop_12f', 'ch6oop_130', 'ch6oop_131', 'ch6oop_132', 'ch6oop_133', 'ch6oop_134', 'ch6oop_135', 'ch6oop_136', 'ch6oop_137', 'ch6oop_138', 'ch6oop_139', 'ch6oop_13a', 'ch6oop_13b', 'ch6oop_13c', 'ch6oop_13d', 'ch6oop_13e', 'ch6oop_13f', 'ch6oop_140', 'ch6oop_141', 'ch6oop_142', 'ch6oop_143', 'ch6oop_144', 'ch6oop_145', 'ch6oop_146', 'ch6oop_147', 'ch6oop_148', 'ch6oop_149', 'ch6oop_14a', 'ch6oop_14b', 'ch6oop_14c', 'ch6oop_14d', 'ch6oop_14e', 'ch6oop_14f', 'ch6oop_150', 'ch6oop_151', 'ch6oop_152', 'ch6oop_153', 'ch6oop_154', 'ch6oop_155', 'ch6oop_156', 'ch6oop_157', 'ch6oop_158', 'ch6oop_159', 'ch6oop_15a', 'ch6oop_15b', 'ch6oop_15c', 'ch6oop_15d', 'ch6oop_15e', 'ch6oop_15f', 'ch6oop_160', 'ch6oop_161', 'ch6oop_162', 'ch6oop_163', 'ch6oop_164', 'ch6oop_165', 'ch6oop_166', 'ch6oop_167', 'ch6oop_168', 'ch6oop_169', 'ch6oop_16a', 'ch6oop_16b', 'ch6oop_16c', 'ch6oop_16d', 'ch6oop_16e', 'ch6oop_16f', 'ch6oop_170', 'ch6oop_171', 'ch6oop_172', 'ch6oop_173', 'ch6oop_174', 'ch6oop_175', 'ch6oop_176', 'ch6oop_177', 'ch6oop_178', 'ch6oop_179', 'ch6oop_17a', 'ch6oop_17b', 'ch6oop_17c', 'ch6oop_17d', 'ch6oop_17e', 'ch6oop_17f', 'ch6oop_180', 'ch6oop_181', 'ch6oop_182', 'ch6oop_183', 'ch6oop_184', 'ch6oop_185', 'ch6oop_186', 'ch6oop_187', 'ch6oop_188', 'ch6oop_189', 'ch6oop_18a', 'ch6oop_18b', 'ch6oop_18c', 'ch6oop_18d', 'ch6oop_18e', 'ch6oop_18f', 'ch6oop_190', 'ch6oop_191', 'ch6oop_192', 'ch6oop_193', 'ch6oop_194', 'ch6oop_195', 'ch6oop_196', 'ch6oop_197', 'ch6oop_198', 'ch6oop_199', 'ch6oop_19a', 'ch6oop_19b', 'ch6oop_19c', 'ch6oop_19d', 'ch6oop_19e', 'ch6oop_19f', 'ch6oop_1a0', 'ch6oop_1a1', 'ch6oop_1a2', 'ch6oop_1a3', 'ch6oop_1a4', 'ch6oop_1a5', 'ch6oop_1a6', 'ch6oop_1a7', 'ch6oop_1a8', 'ch6oop_1a9', 'ch6oop_1aa', 'ch6oop_1ab', 'ch6oop_1ac', 'ch6oop_1ad', 'ch6oop_1ae', 'ch6oop_1af', 'ch6oop_1b0', 'ch6oop_1b1', 'ch6oop_1b2', 'ch6oop_1b3', 'ch6oop_1b4', 'ch6oop_1b5', 'ch6oop_1b6', 'ch6oop_1b7', 'ch6oop_1b8', 'ch6oop_1b9', 'ch6oop_1ba', 'ch6oop_1bb', 'ch6oop_1bc', 'ch6oop_1bd', 'ch6oop_1be', 'ch6oop_1bf', 'ch6oop_1c0', 'ch6oop_1c1', 'ch6oop_1c2', 'ch6oop_1c3', 'ch6oop_1c4', 'ch6oop_1c5', 'ch6oop_1c6', 'ch6oop_1c7', 'ch6oop_1c8', 'ch6oop_1c9', 'ch6oop_1ca', 'ch6oop_1cb', 'ch6oop_1cc', 'ch6oop_1cd', 'ch6oop_1ce', 'ch6oop_1cf', 'ch6oop_1d0', 'ch6oop_1d1', 'ch6oop_1d2', 'ch6oop_1d3', 'ch6oop_1d4', 'ch6oop_1d5', 'ch6oop_1d6', 'ch6oop_1d7', 'ch6oop_1d8', 'ch6oop_1d9', 'ch6oop_1da', 'ch6oop_1db', 'ch6oop_1dc', 'ch6oop_1dd', 'ch6oop_1de', 'ch6oop_1df', 'ch6oop_1e0', 'ch6oop_1e1'], 'ch9Using_Linux_Tools': ['ch9Using_Linux_Tools_1', 'ch9Using_Linux_Tools_2', 'ch9Using_Linux_Tools_3', 'ch9Using_Linux_Tools_4', 'ch9Using_Linux_Tools_5', 'ch9Using_Linux_Tools_6', 'ch9Using_Linux_Tools_7', 'ch9Using_Linux_Tools_8', 'ch9Using_Linux_Tools_9', 'ch9Using_Linux_Tools_a', 'ch9Using_Linux_Tools_b', 'ch9Using_Linux_Tools_c', 'ch9Using_Linux_Tools_d', 'ch9Using_Linux_Tools_e', 'ch9Using_Linux_Tools_f', 'ch9Using_Linux_Tools_10', 'ch9Using_Linux_Tools_11', 'ch9Using_Linux_Tools_12', 'ch9Using_Linux_Tools_13', 'ch9Using_Linux_Tools_14', 'ch9Using_Linux_Tools_15', 'ch9Using_Linux_Tools_16', 'ch9Using_Linux_Tools_17', 'ch9Using_Linux_Tools_18', 'ch9Using_Linux_Tools_19', 'ch9Using_Linux_Tools_1a', 'ch9Using_Linux_Tools_1b', 'ch9Using_Linux_Tools_1c', 'ch9Using_Linux_Tools_1d', 'ch9Using_Linux_Tools_1e', 'ch9Using_Linux_Tools_1f', 'ch9Using_Linux_Tools_20', 'ch9Using_Linux_Tools_21', 'ch9Using_Linux_Tools_22', 'ch9Using_Linux_Tools_23', 'ch9Using_Linux_Tools_24', 'ch9Using_Linux_Tools_25', 'ch9Using_Linux_Tools_26', 'ch9Using_Linux_Tools_27', 'ch9Using_Linux_Tools_28', 'ch9Using_Linux_Tools_29', 'ch9Using_Linux_Tools_2a', 'ch9Using_Linux_Tools_2b', 'ch9Using_Linux_Tools_2c', 'ch9Using_Linux_Tools_2d', 'ch9Using_Linux_Tools_2e', 'ch9Using_Linux_Tools_2f', 'ch9Using_Linux_Tools_30', 'ch9Using_Linux_Tools_31', 'ch9Using_Linux_Tools_32', 'ch9Using_Linux_Tools_33', 'ch9Using_Linux_Tools_34', 'ch9Using_Linux_Tools_35', 'ch9Using_Linux_Tools_36', 'ch9Using_Linux_Tools_37', 'ch9Using_Linux_Tools_38', 'ch9Using_Linux_Tools_39', 'ch9Using_Linux_Tools_3a', 'ch9Using_Linux_Tools_3b', 'ch9Using_Linux_Tools_3c', 'ch9Using_Linux_Tools_3d', 'ch9Using_Linux_Tools_3e', 'ch9Using_Linux_Tools_3f', 'ch9Using_Linux_Tools_40', 'ch9Using_Linux_Tools_41', 'ch9Using_Linux_Tools_42', 'ch9Using_Linux_Tools_43', 'ch9Using_Linux_Tools_44', 'ch9Using_Linux_Tools_45', 'ch9Using_Linux_Tools_46', 'ch9Using_Linux_Tools_47', 'ch9Using_Linux_Tools_48', 'ch9Using_Linux_Tools_49', 'ch9Using_Linux_Tools_4a', 'ch9Using_Linux_Tools_4b', 'ch9Using_Linux_Tools_4c', 'ch9Using_Linux_Tools_4d', 'ch9Using_Linux_Tools_4e', 'ch9Using_Linux_Tools_4f', 'ch9Using_Linux_Tools_50', 'ch9Using_Linux_Tools_51', 'ch9Using_Linux_Tools_52', 'ch9Using_Linux_Tools_53', 'ch9Using_Linux_Tools_54', 'ch9Using_Linux_Tools_55', 'ch9Using_Linux_Tools_56', 'ch9Using_Linux_Tools_57', 'ch9Using_Linux_Tools_58', 'ch9Using_Linux_Tools_59', 'ch9Using_Linux_Tools_5a', 'ch9Using_Linux_Tools_5b', 'ch9Using_Linux_Tools_5c', 'ch9Using_Linux_Tools_5d', 'ch9Using_Linux_Tools_5e', 'ch9Using_Linux_Tools_5f', 'ch9Using_Linux_Tools_60', 'ch9Using_Linux_Tools_61', 'ch9Using_Linux_Tools_62', 'ch9Using_Linux_Tools_63', 'ch9Using_Linux_Tools_64', 'ch9Using_Linux_Tools_65', 'ch9Using_Linux_Tools_66', 'ch9Using_Linux_Tools_67', 'ch9Using_Linux_Tools_68', 'ch9Using_Linux_Tools_69', 'ch9Using_Linux_Tools_6a', 'ch9Using_Linux_Tools_6b', 'ch9Using_Linux_Tools_6c', 'ch9Using_Linux_Tools_6d', 'ch9Using_Linux_Tools_6e', 'ch9Using_Linux_Tools_6f', 'ch9Using_Linux_Tools_70', 'ch9Using_Linux_Tools_71', 'ch9Using_Linux_Tools_72', 'ch9Using_Linux_Tools_73', 'ch9Using_Linux_Tools_74', 'ch9Using_Linux_Tools_75', 'ch9Using_Linux_Tools_76', 'ch9Using_Linux_Tools_77', 'ch9Using_Linux_Tools_78', 'ch9Using_Linux_Tools_79', 'ch9Using_Linux_Tools_7a', 'ch9Using_Linux_Tools_7b', 'ch9Using_Linux_Tools_7c', 'ch9Using_Linux_Tools_7d', 'ch9Using_Linux_Tools_7e', 'ch9Using_Linux_Tools_7f', 'ch9Using_Linux_Tools_80', 'ch9Using_Linux_Tools_81', 'ch9Using_Linux_Tools_82', 'ch9Using_Linux_Tools_83', 'ch9Using_Linux_Tools_84', 'ch9Using_Linux_Tools_85', 'ch9Using_Linux_Tools_86', 'ch9Using_Linux_Tools_87', 'ch9Using_Linux_Tools_88', 'ch9Using_Linux_Tools_89', 'ch9Using_Linux_Tools_8a', 'ch9Using_Linux_Tools_8b', 'ch9Using_Linux_Tools_8c', 'ch9Using_Linux_Tools_8d', 'ch9Using_Linux_Tools_8e', 'ch9Using_Linux_Tools_8f', 'ch9Using_Linux_Tools_90', 'ch9Using_Linux_Tools_91', 'ch9Using_Linux_Tools_92', 'ch9Using_Linux_Tools_93', 'ch9Using_Linux_Tools_94', 'ch9Using_Linux_Tools_95', 'ch9Using_Linux_Tools_96', 'ch9Using_Linux_Tools_97', 'ch9Using_Linux_Tools_98', 'ch9Using_Linux_Tools_99', 'ch9Using_Linux_Tools_9a', 'ch9Using_Linux_Tools_9b', 'ch9Using_Linux_Tools_9c', 'ch9Using_Linux_Tools_9d', 'ch9Using_Linux_Tools_9e', 'ch9Using_Linux_Tools_9f', 'ch9Using_Linux_Tools_a0', 'ch9Using_Linux_Tools_a1', 'ch9Using_Linux_Tools_a2', 'ch9Using_Linux_Tools_a3', 'ch9Using_Linux_Tools_a4', 'ch9Using_Linux_Tools_a5', 'ch9Using_Linux_Tools_a6', 'ch9Using_Linux_Tools_a7', 'ch9Using_Linux_Tools_a8', 'ch9Using_Linux_Tools_a9', 'ch9Using_Linux_Tools_aa', 'ch9Using_Linux_Tools_ab', 'ch9Using_Linux_Tools_ac', 'ch9Using_Linux_Tools_ad', 'ch9Using_Linux_Tools_ae', 'ch9Using_Linux_Tools_af', 'ch9Using_Linux_Tools_b0', 'ch9Using_Linux_Tools_b1', 'ch9Using_Linux_Tools_b2', 'ch9Using_Linux_Tools_b3', 'ch9Using_Linux_Tools_b4', 'ch9Using_Linux_Tools_b5', 'ch9Using_Linux_Tools_b6', 'ch9Using_Linux_Tools_b7', 'ch9Using_Linux_Tools_b8', 'ch9Using_Linux_Tools_b9', 'ch9Using_Linux_Tools_ba', 'ch9Using_Linux_Tools_bb', 'ch9Using_Linux_Tools_bc', 'ch9Using_Linux_Tools_bd', 'ch9Using_Linux_Tools_be', 'ch9Using_Linux_Tools_bf', 'ch9Using_Linux_Tools_c0', 'ch9Using_Linux_Tools_c1', 'ch9Using_Linux_Tools_c2', 'ch9Using_Linux_Tools_c3', 'ch9Using_Linux_Tools_c4', 'ch9Using_Linux_Tools_c5', 'ch9Using_Linux_Tools_c6', 'ch9Using_Linux_Tools_c7', 'ch9Using_Linux_Tools_c8', 'ch9Using_Linux_Tools_c9', 'ch9Using_Linux_Tools_ca', 'ch9Using_Linux_Tools_cb', 'ch9Using_Linux_Tools_cc', 'ch9Using_Linux_Tools_cd', 'ch9Using_Linux_Tools_ce', 'ch9Using_Linux_Tools_cf', 'ch9Using_Linux_Tools_d0', 'ch9Using_Linux_Tools_d1', 'ch9Using_Linux_Tools_d2', 'ch9Using_Linux_Tools_d3', 'ch9Using_Linux_Tools_d4', 'ch9Using_Linux_Tools_d5', 'ch9Using_Linux_Tools_d6', 'ch9Using_Linux_Tools_d7', 'ch9Using_Linux_Tools_d8', 'ch9Using_Linux_Tools_d9', 'ch9Using_Linux_Tools_da', 'ch9Using_Linux_Tools_db', 'ch9Using_Linux_Tools_dc', 'ch9Using_Linux_Tools_dd', 'ch9Using_Linux_Tools_de', 'ch9Using_Linux_Tools_df', 'ch9Using_Linux_Tools_e0', 'ch9Using_Linux_Tools_e1', 'ch9Using_Linux_Tools_e2', 'ch9Using_Linux_Tools_e3', 'ch9Using_Linux_Tools_e4', 'ch9Using_Linux_Tools_e5', 'ch9Using_Linux_Tools_e6', 'ch9Using_Linux_Tools_e7', 'ch9Using_Linux_Tools_e8', 'ch9Using_Linux_Tools_e9', 'ch9Using_Linux_Tools_ea', 'ch9Using_Linux_Tools_eb', 'ch9Using_Linux_Tools_ec', 'ch9Using_Linux_Tools_ed', 'ch9Using_Linux_Tools_ee', 'ch9Using_Linux_Tools_ef', 'ch9Using_Linux_Tools_f0', 'ch9Using_Linux_Tools_f1', 'ch9Using_Linux_Tools_f2', 'ch9Using_Linux_Tools_f3', 'ch9Using_Linux_Tools_f4', 'ch9Using_Linux_Tools_f5', 'ch9Using_Linux_Tools_f6', 'ch9Using_Linux_Tools_f7', 'ch9Using_Linux_Tools_f8', 'ch9Using_Linux_Tools_f9', 'ch9Using_Linux_Tools_fa', 'ch9Using_Linux_Tools_fb', 'ch9Using_Linux_Tools_fc', 'ch9Using_Linux_Tools_fd', 'ch9Using_Linux_Tools_fe', 'ch9Using_Linux_Tools_ff', 'ch9Using_Linux_Tools_100', 'ch9Using_Linux_Tools_101', 'ch9Using_Linux_Tools_102', 'ch9Using_Linux_Tools_103', 'ch9Using_Linux_Tools_104', 'ch9Using_Linux_Tools_105', 'ch9Using_Linux_Tools_106', 'ch9Using_Linux_Tools_107', 'ch9Using_Linux_Tools_108', 'ch9Using_Linux_Tools_109', 'ch9Using_Linux_Tools_10a', 'ch9Using_Linux_Tools_10b', 'ch9Using_Linux_Tools_10c', 'ch9Using_Linux_Tools_10d', 'ch9Using_Linux_Tools_10e', 'ch9Using_Linux_Tools_10f', 'ch9Using_Linux_Tools_110', 'ch9Using_Linux_Tools_111', 'ch9Using_Linux_Tools_112', 'ch9Using_Linux_Tools_113', 'ch9Using_Linux_Tools_114', 'ch9Using_Linux_Tools_115', 'ch9Using_Linux_Tools_116', 'ch9Using_Linux_Tools_117', 'ch9Using_Linux_Tools_118', 'ch9Using_Linux_Tools_119', 'ch9Using_Linux_Tools_11a', 'ch9Using_Linux_Tools_11b', 'ch9Using_Linux_Tools_11c', 'ch9Using_Linux_Tools_11d', 'ch9Using_Linux_Tools_11e', 'ch9Using_Linux_Tools_11f', 'ch9Using_Linux_Tools_120', 'ch9Using_Linux_Tools_121', 'ch9Using_Linux_Tools_122', 'ch9Using_Linux_Tools_123', 'ch9Using_Linux_Tools_124', 'ch9Using_Linux_Tools_125', 'ch9Using_Linux_Tools_126', 'ch9Using_Linux_Tools_127', 'ch9Using_Linux_Tools_128', 'ch9Using_Linux_Tools_129', 'ch9Using_Linux_Tools_12a', 'ch9Using_Linux_Tools_12b', 'ch9Using_Linux_Tools_12c', 'ch9Using_Linux_Tools_12d', 'ch9Using_Linux_Tools_12e', 'ch9Using_Linux_Tools_12f', 'ch9Using_Linux_Tools_130', 'ch9Using_Linux_Tools_131', 'ch9Using_Linux_Tools_132', 'ch9Using_Linux_Tools_133', 'ch9Using_Linux_Tools_134', 'ch9Using_Linux_Tools_135', 'ch9Using_Linux_Tools_136', 'ch9Using_Linux_Tools_137', 'ch9Using_Linux_Tools_138', 'ch9Using_Linux_Tools_139', 'ch9Using_Linux_Tools_13a', 'ch9Using_Linux_Tools_13b', 'ch9Using_Linux_Tools_13c', 'ch9Using_Linux_Tools_13d', 'ch9Using_Linux_Tools_13e', 'ch9Using_Linux_Tools_13f', 'ch9Using_Linux_Tools_140', 'ch9Using_Linux_Tools_141', 'ch9Using_Linux_Tools_142', 'ch9Using_Linux_Tools_143', 'ch9Using_Linux_Tools_144', 'ch9Using_Linux_Tools_145', 'ch9Using_Linux_Tools_146', 'ch9Using_Linux_Tools_147', 'ch9Using_Linux_Tools_148', 'ch9Using_Linux_Tools_149', 'ch9Using_Linux_Tools_14a', 'ch9Using_Linux_Tools_14b', 'ch9Using_Linux_Tools_14c', 'ch9Using_Linux_Tools_14d', 'ch9Using_Linux_Tools_14e', 'ch9Using_Linux_Tools_14f', 'ch9Using_Linux_Tools_150', 'ch9Using_Linux_Tools_151', 'ch9Using_Linux_Tools_152', 'ch9Using_Linux_Tools_153', 'ch9Using_Linux_Tools_154', 'ch9Using_Linux_Tools_155', 'ch9Using_Linux_Tools_156', 'ch9Using_Linux_Tools_157', 'ch9Using_Linux_Tools_158', 'ch9Using_Linux_Tools_159', 'ch9Using_Linux_Tools_15a', 'ch9Using_Linux_Tools_15b', 'ch9Using_Linux_Tools_15c', 'ch9Using_Linux_Tools_15d', 'ch9Using_Linux_Tools_15e', 'ch9Using_Linux_Tools_15f', 'ch9Using_Linux_Tools_160', 'ch9Using_Linux_Tools_161', 'ch9Using_Linux_Tools_162', 'ch9Using_Linux_Tools_163', 'ch9Using_Linux_Tools_164', 'ch9Using_Linux_Tools_165', 'ch9Using_Linux_Tools_166', 'ch9Using_Linux_Tools_167', 'ch9Using_Linux_Tools_168', 'ch9Using_Linux_Tools_169', 'ch9Using_Linux_Tools_16a', 'ch9Using_Linux_Tools_16b', 'ch9Using_Linux_Tools_16c', 'ch9Using_Linux_Tools_16d', 'ch9Using_Linux_Tools_16e', 'ch9Using_Linux_Tools_16f', 'ch9Using_Linux_Tools_170', 'ch9Using_Linux_Tools_171', 'ch9Using_Linux_Tools_172', 'ch9Using_Linux_Tools_173', 'ch9Using_Linux_Tools_174', 'ch9Using_Linux_Tools_175', 'ch9Using_Linux_Tools_176', 'ch9Using_Linux_Tools_177', 'ch9Using_Linux_Tools_178', 'ch9Using_Linux_Tools_179', 'ch9Using_Linux_Tools_17a', 'ch9Using_Linux_Tools_17b', 'ch9Using_Linux_Tools_17c', 'ch9Using_Linux_Tools_17d', 'ch9Using_Linux_Tools_17e', 'ch9Using_Linux_Tools_17f', 'ch9Using_Linux_Tools_180', 'ch9Using_Linux_Tools_181', 'ch9Using_Linux_Tools_182', 'ch9Using_Linux_Tools_183', 'ch9Using_Linux_Tools_184', 'ch9Using_Linux_Tools_185', 'ch9Using_Linux_Tools_186', 'ch9Using_Linux_Tools_187', 'ch9Using_Linux_Tools_188', 'ch9Using_Linux_Tools_189', 'ch9Using_Linux_Tools_18a', 'ch9Using_Linux_Tools_18b', 'ch9Using_Linux_Tools_18c', 'ch9Using_Linux_Tools_18d', 'ch9Using_Linux_Tools_18e', 'ch9Using_Linux_Tools_18f', 'ch9Using_Linux_Tools_190', 'ch9Using_Linux_Tools_191', 'ch9Using_Linux_Tools_192', 'ch9Using_Linux_Tools_193', 'ch9Using_Linux_Tools_194', 'ch9Using_Linux_Tools_195', 'ch9Using_Linux_Tools_196', 'ch9Using_Linux_Tools_197', 'ch9Using_Linux_Tools_198', 'ch9Using_Linux_Tools_199', 'ch9Using_Linux_Tools_19a', 'ch9Using_Linux_Tools_19b', 'ch9Using_Linux_Tools_19c', 'ch9Using_Linux_Tools_19d', 'ch9Using_Linux_Tools_19e', 'ch9Using_Linux_Tools_19f', 'ch9Using_Linux_Tools_1a0', 'ch9Using_Linux_Tools_1a1', 'ch9Using_Linux_Tools_1a2', 'ch9Using_Linux_Tools_1a3', 'ch9Using_Linux_Tools_1a4', 'ch9Using_Linux_Tools_1a5', 'ch9Using_Linux_Tools_1a6', 'ch9Using_Linux_Tools_1a7', 'ch9Using_Linux_Tools_1a8', 'ch9Using_Linux_Tools_1a9', 'ch9Using_Linux_Tools_1aa', 'ch9Using_Linux_Tools_1ab', 'ch9Using_Linux_Tools_1ac', 'ch9Using_Linux_Tools_1ad', 'ch9Using_Linux_Tools_1ae', 'ch9Using_Linux_Tools_1af', 'ch9Using_Linux_Tools_1b0', 'ch9Using_Linux_Tools_1b1', 'ch9Using_Linux_Tools_1b2', 'ch9Using_Linux_Tools_1b3', 'ch9Using_Linux_Tools_1b4', 'ch9Using_Linux_Tools_1b5', 'ch9Using_Linux_Tools_1b6', 'ch9Using_Linux_Tools_1b7', 'ch9Using_Linux_Tools_1b8', 'ch9Using_Linux_Tools_1b9', 'ch9Using_Linux_Tools_1ba', 'ch9Using_Linux_Tools_1bb', 'ch9Using_Linux_Tools_1bc', 'ch9Using_Linux_Tools_1bd', 'ch9Using_Linux_Tools_1be', 'ch9Using_Linux_Tools_1bf', 'ch9Using_Linux_Tools_1c0', 'ch9Using_Linux_Tools_1c1', 'ch9Using_Linux_Tools_1c2', 'ch9Using_Linux_Tools_1c3', 'ch9Using_Linux_Tools_1c4', 'ch9Using_Linux_Tools_1c5', 'ch9Using_Linux_Tools_1c6', 'ch9Using_Linux_Tools_1c7', 'ch9Using_Linux_Tools_1c8', 'ch9Using_Linux_Tools_1c9', 'ch9Using_Linux_Tools_1ca', 'ch9Using_Linux_Tools_1cb', 'ch9Using_Linux_Tools_1cc', 'ch9Using_Linux_Tools_1cd', 'ch9Using_Linux_Tools_1ce', 'ch9Using_Linux_Tools_1cf', 'ch9Using_Linux_Tools_1d0', 'ch9Using_Linux_Tools_1d1', 'ch9Using_Linux_Tools_1d2', 'ch9Using_Linux_Tools_1d3', 'ch9Using_Linux_Tools_1d4', 'ch9Using_Linux_Tools_1d5', 'ch9Using_Linux_Tools_1d6', 'ch9Using_Linux_Tools_1d7', 'ch9Using_Linux_Tools_1d8', 'ch9Using_Linux_Tools_1d9', 'ch9Using_Linux_Tools_1da', 'ch9Using_Linux_Tools_1db', 'ch9Using_Linux_Tools_1dc', 'ch9Using_Linux_Tools_1dd', 'ch9Using_Linux_Tools_1de', 'ch9Using_Linux_Tools_1df', 'ch9Using_Linux_Tools_1e0', 'ch9Using_Linux_Tools_1e1'], 'ch1Introduction': ['ch1Introduction_1', 'ch1Introduction_2', 'ch1Introduction_3', 'ch1Introduction_4', 'ch1Introduction_5', 'ch1Introduction_6', 'ch1Introduction_7', 'ch1Introduction_8', 'ch1Introduction_9', 'ch1Introduction_a', 'ch1Introduction_b', 'ch1Introduction_c', 'ch1Introduction_d', 'ch1Introduction_e', 'ch1Introduction_f', 'ch1Introduction_10', 'ch1Introduction_11', 'ch1Introduction_12', 'ch1Introduction_13', 'ch1Introduction_14', 'ch1Introduction_15', 'ch1Introduction_16', 'ch1Introduction_17', 'ch1Introduction_18', 'ch1Introduction_19', 'ch1Introduction_1a', 'ch1Introduction_1b', 'ch1Introduction_1c', 'ch1Introduction_1d', 'ch1Introduction_1e', 'ch1Introduction_1f', 'ch1Introduction_20', 'ch1Introduction_21', 'ch1Introduction_22', 'ch1Introduction_23', 'ch1Introduction_24', 'ch1Introduction_25', 'ch1Introduction_26', 'ch1Introduction_27', 'ch1Introduction_28', 'ch1Introduction_29', 'ch1Introduction_2a', 'ch1Introduction_2b', 'ch1Introduction_2c', 'ch1Introduction_2d', 'ch1Introduction_2e', 'ch1Introduction_2f', 'ch1Introduction_30', 'ch1Introduction_31', 'ch1Introduction_32', 'ch1Introduction_33', 'ch1Introduction_34', 'ch1Introduction_35', 'ch1Introduction_36', 'ch1Introduction_37', 'ch1Introduction_38', 'ch1Introduction_39', 'ch1Introduction_3a', 'ch1Introduction_3b', 'ch1Introduction_3c', 'ch1Introduction_3d', 'ch1Introduction_3e', 'ch1Introduction_3f', 'ch1Introduction_40', 'ch1Introduction_41', 'ch1Introduction_42', 'ch1Introduction_43', 'ch1Introduction_44', 'ch1Introduction_45', 'ch1Introduction_46', 'ch1Introduction_47', 'ch1Introduction_48', 'ch1Introduction_49', 'ch1Introduction_4a', 'ch1Introduction_4b', 'ch1Introduction_4c', 'ch1Introduction_4d', 'ch1Introduction_4e', 'ch1Introduction_4f', 'ch1Introduction_50', 'ch1Introduction_51', 'ch1Introduction_52', 'ch1Introduction_53', 'ch1Introduction_54', 'ch1Introduction_55', 'ch1Introduction_56', 'ch1Introduction_57', 'ch1Introduction_58', 'ch1Introduction_59', 'ch1Introduction_5a', 'ch1Introduction_5b', 'ch1Introduction_5c', 'ch1Introduction_5d', 'ch1Introduction_5e', 'ch1Introduction_5f', 'ch1Introduction_60', 'ch1Introduction_61', 'ch1Introduction_62', 'ch1Introduction_63', 'ch1Introduction_64', 'ch1Introduction_65', 'ch1Introduction_66', 'ch1Introduction_67', 'ch1Introduction_68', 'ch1Introduction_69', 'ch1Introduction_6a', 'ch1Introduction_6b', 'ch1Introduction_6c', 'ch1Introduction_6d', 'ch1Introduction_6e', 'ch1Introduction_6f', 'ch1Introduction_70', 'ch1Introduction_71', 'ch1Introduction_72', 'ch1Introduction_73', 'ch1Introduction_74', 'ch1Introduction_75', 'ch1Introduction_76', 'ch1Introduction_77', 'ch1Introduction_78', 'ch1Introduction_79', 'ch1Introduction_7a', 'ch1Introduction_7b', 'ch1Introduction_7c', 'ch1Introduction_7d', 'ch1Introduction_7e', 'ch1Introduction_7f', 'ch1Introduction_80', 'ch1Introduction_81', 'ch1Introduction_82', 'ch1Introduction_83', 'ch1Introduction_84', 'ch1Introduction_85', 'ch1Introduction_86', 'ch1Introduction_87', 'ch1Introduction_88', 'ch1Introduction_89', 'ch1Introduction_8a', 'ch1Introduction_8b', 'ch1Introduction_8c', 'ch1Introduction_8d', 'ch1Introduction_8e', 'ch1Introduction_8f', 'ch1Introduction_90', 'ch1Introduction_91', 'ch1Introduction_92', 'ch1Introduction_93', 'ch1Introduction_94', 'ch1Introduction_95', 'ch1Introduction_96', 'ch1Introduction_97', 'ch1Introduction_98', 'ch1Introduction_99', 'ch1Introduction_9a', 'ch1Introduction_9b', 'ch1Introduction_9c', 'ch1Introduction_9d', 'ch1Introduction_9e', 'ch1Introduction_9f', 'ch1Introduction_a0', 'ch1Introduction_a1', 'ch1Introduction_a2', 'ch1Introduction_a3', 'ch1Introduction_a4', 'ch1Introduction_a5', 'ch1Introduction_a6', 'ch1Introduction_a7', 'ch1Introduction_a8', 'ch1Introduction_a9', 'ch1Introduction_aa', 'ch1Introduction_ab', 'ch1Introduction_ac', 'ch1Introduction_ad', 'ch1Introduction_ae', 'ch1Introduction_af', 'ch1Introduction_b0', 'ch1Introduction_b1', 'ch1Introduction_b2', 'ch1Introduction_b3', 'ch1Introduction_b4', 'ch1Introduction_b5', 'ch1Introduction_b6', 'ch1Introduction_b7', 'ch1Introduction_b8', 'ch1Introduction_b9', 'ch1Introduction_ba', 'ch1Introduction_bb', 'ch1Introduction_bc', 'ch1Introduction_bd', 'ch1Introduction_be', 'ch1Introduction_bf', 'ch1Introduction_c0', 'ch1Introduction_c1', 'ch1Introduction_c2', 'ch1Introduction_c3', 'ch1Introduction_c4', 'ch1Introduction_c5', 'ch1Introduction_c6', 'ch1Introduction_c7', 'ch1Introduction_c8', 'ch1Introduction_c9', 'ch1Introduction_ca', 'ch1Introduction_cb', 'ch1Introduction_cc', 'ch1Introduction_cd', 'ch1Introduction_ce', 'ch1Introduction_cf', 'ch1Introduction_d0', 'ch1Introduction_d1', 'ch1Introduction_d2', 'ch1Introduction_d3', 'ch1Introduction_d4', 'ch1Introduction_d5', 'ch1Introduction_d6', 'ch1Introduction_d7', 'ch1Introduction_d8', 'ch1Introduction_d9', 'ch1Introduction_da', 'ch1Introduction_db', 'ch1Introduction_dc', 'ch1Introduction_dd', 'ch1Introduction_de', 'ch1Introduction_df', 'ch1Introduction_e0', 'ch1Introduction_e1', 'ch1Introduction_e2', 'ch1Introduction_e3', 'ch1Introduction_e4', 'ch1Introduction_e5', 'ch1Introduction_e6', 'ch1Introduction_e7', 'ch1Introduction_e8', 'ch1Introduction_e9', 'ch1Introduction_ea', 'ch1Introduction_eb', 'ch1Introduction_ec', 'ch1Introduction_ed', 'ch1Introduction_ee', 'ch1Introduction_ef', 'ch1Introduction_f0', 'ch1Introduction_f1', 'ch1Introduction_f2', 'ch1Introduction_f3', 'ch1Introduction_f4', 'ch1Introduction_f5', 'ch1Introduction_f6', 'ch1Introduction_f7', 'ch1Introduction_f8', 'ch1Introduction_f9', 'ch1Introduction_fa', 'ch1Introduction_fb', 'ch1Introduction_fc', 'ch1Introduction_fd', 'ch1Introduction_fe', 'ch1Introduction_ff', 'ch1Introduction_100', 'ch1Introduction_101', 'ch1Introduction_102', 'ch1Introduction_103', 'ch1Introduction_104', 'ch1Introduction_105', 'ch1Introduction_106', 'ch1Introduction_107', 'ch1Introduction_108', 'ch1Introduction_109', 'ch1Introduction_10a', 'ch1Introduction_10b', 'ch1Introduction_10c', 'ch1Introduction_10d', 'ch1Introduction_10e', 'ch1Introduction_10f', 'ch1Introduction_110', 'ch1Introduction_111', 'ch1Introduction_112', 'ch1Introduction_113', 'ch1Introduction_114', 'ch1Introduction_115', 'ch1Introduction_116', 'ch1Introduction_117', 'ch1Introduction_118', 'ch1Introduction_119', 'ch1Introduction_11a', 'ch1Introduction_11b', 'ch1Introduction_11c', 'ch1Introduction_11d', 'ch1Introduction_11e', 'ch1Introduction_11f', 'ch1Introduction_120', 'ch1Introduction_121', 'ch1Introduction_122', 'ch1Introduction_123', 'ch1Introduction_124', 'ch1Introduction_125', 'ch1Introduction_126', 'ch1Introduction_127', 'ch1Introduction_128', 'ch1Introduction_129', 'ch1Introduction_12a', 'ch1Introduction_12b', 'ch1Introduction_12c', 'ch1Introduction_12d', 'ch1Introduction_12e', 'ch1Introduction_12f', 'ch1Introduction_130', 'ch1Introduction_131', 'ch1Introduction_132', 'ch1Introduction_133', 'ch1Introduction_134', 'ch1Introduction_135', 'ch1Introduction_136', 'ch1Introduction_137', 'ch1Introduction_138', 'ch1Introduction_139', 'ch1Introduction_13a', 'ch1Introduction_13b', 'ch1Introduction_13c', 'ch1Introduction_13d', 'ch1Introduction_13e', 'ch1Introduction_13f', 'ch1Introduction_140', 'ch1Introduction_141', 'ch1Introduction_142', 'ch1Introduction_143', 'ch1Introduction_144', 'ch1Introduction_145', 'ch1Introduction_146', 'ch1Introduction_147', 'ch1Introduction_148', 'ch1Introduction_149', 'ch1Introduction_14a', 'ch1Introduction_14b', 'ch1Introduction_14c', 'ch1Introduction_14d', 'ch1Introduction_14e', 'ch1Introduction_14f', 'ch1Introduction_150', 'ch1Introduction_151', 'ch1Introduction_152', 'ch1Introduction_153', 'ch1Introduction_154', 'ch1Introduction_155', 'ch1Introduction_156', 'ch1Introduction_157', 'ch1Introduction_158', 'ch1Introduction_159', 'ch1Introduction_15a', 'ch1Introduction_15b', 'ch1Introduction_15c', 'ch1Introduction_15d', 'ch1Introduction_15e', 'ch1Introduction_15f', 'ch1Introduction_160', 'ch1Introduction_161', 'ch1Introduction_162', 'ch1Introduction_163', 'ch1Introduction_164', 'ch1Introduction_165', 'ch1Introduction_166', 'ch1Introduction_167', 'ch1Introduction_168', 'ch1Introduction_169', 'ch1Introduction_16a', 'ch1Introduction_16b', 'ch1Introduction_16c', 'ch1Introduction_16d', 'ch1Introduction_16e', 'ch1Introduction_16f', 'ch1Introduction_170', 'ch1Introduction_171', 'ch1Introduction_172', 'ch1Introduction_173', 'ch1Introduction_174', 'ch1Introduction_175', 'ch1Introduction_176', 'ch1Introduction_177', 'ch1Introduction_178', 'ch1Introduction_179', 'ch1Introduction_17a', 'ch1Introduction_17b', 'ch1Introduction_17c', 'ch1Introduction_17d', 'ch1Introduction_17e', 'ch1Introduction_17f', 'ch1Introduction_180', 'ch1Introduction_181', 'ch1Introduction_182', 'ch1Introduction_183', 'ch1Introduction_184', 'ch1Introduction_185', 'ch1Introduction_186', 'ch1Introduction_187', 'ch1Introduction_188', 'ch1Introduction_189', 'ch1Introduction_18a', 'ch1Introduction_18b', 'ch1Introduction_18c', 'ch1Introduction_18d', 'ch1Introduction_18e', 'ch1Introduction_18f', 'ch1Introduction_190', 'ch1Introduction_191', 'ch1Introduction_192', 'ch1Introduction_193', 'ch1Introduction_194', 'ch1Introduction_195', 'ch1Introduction_196', 'ch1Introduction_197', 'ch1Introduction_198', 'ch1Introduction_199', 'ch1Introduction_19a', 'ch1Introduction_19b', 'ch1Introduction_19c', 'ch1Introduction_19d', 'ch1Introduction_19e', 'ch1Introduction_19f', 'ch1Introduction_1a0', 'ch1Introduction_1a1', 'ch1Introduction_1a2', 'ch1Introduction_1a3', 'ch1Introduction_1a4', 'ch1Introduction_1a5', 'ch1Introduction_1a6', 'ch1Introduction_1a7', 'ch1Introduction_1a8', 'ch1Introduction_1a9', 'ch1Introduction_1aa', 'ch1Introduction_1ab', 'ch1Introduction_1ac', 'ch1Introduction_1ad', 'ch1Introduction_1ae', 'ch1Introduction_1af', 'ch1Introduction_1b0', 'ch1Introduction_1b1', 'ch1Introduction_1b2', 'ch1Introduction_1b3', 'ch1Introduction_1b4', 'ch1Introduction_1b5', 'ch1Introduction_1b6', 'ch1Introduction_1b7', 'ch1Introduction_1b8', 'ch1Introduction_1b9', 'ch1Introduction_1ba', 'ch1Introduction_1bb', 'ch1Introduction_1bc', 'ch1Introduction_1bd', 'ch1Introduction_1be', 'ch1Introduction_1bf', 'ch1Introduction_1c0', 'ch1Introduction_1c1', 'ch1Introduction_1c2', 'ch1Introduction_1c3', 'ch1Introduction_1c4', 'ch1Introduction_1c5', 'ch1Introduction_1c6', 'ch1Introduction_1c7', 'ch1Introduction_1c8', 'ch1Introduction_1c9', 'ch1Introduction_1ca', 'ch1Introduction_1cb', 'ch1Introduction_1cc', 'ch1Introduction_1cd', 'ch1Introduction_1ce', 'ch1Introduction_1cf', 'ch1Introduction_1d0', 'ch1Introduction_1d1', 'ch1Introduction_1d2', 'ch1Introduction_1d3', 'ch1Introduction_1d4', 'ch1Introduction_1d5', 'ch1Introduction_1d6', 'ch1Introduction_1d7', 'ch1Introduction_1d8', 'ch1Introduction_1d9', 'ch1Introduction_1da', 'ch1Introduction_1db', 'ch1Introduction_1dc', 'ch1Introduction_1dd', 'ch1Introduction_1de', 'ch1Introduction_1df', 'ch1Introduction_1e0', 'ch1Introduction_1e1'], 'ch5func': ['ch5func_1', 'ch5func_2', 'ch5func_3', 'ch5func_4', 'ch5func_5', 'ch5func_6', 'ch5func_7', 'ch5func_8', 'ch5func_9', 'ch5func_a', 'ch5func_b', 'ch5func_c', 'ch5func_d', 'ch5func_e', 'ch5func_f', 'ch5func_10', 'ch5func_11', 'ch5func_12', 'ch5func_13', 'ch5func_14', 'ch5func_15', 'ch5func_16', 'ch5func_17', 'ch5func_18', 'ch5func_19', 'ch5func_1a', 'ch5func_1b', 'ch5func_1c', 'ch5func_1d', 'ch5func_1e', 'ch5func_1f', 'ch5func_20', 'ch5func_21', 'ch5func_22', 'ch5func_23', 'ch5func_24', 'ch5func_25', 'ch5func_26', 'ch5func_27', 'ch5func_28', 'ch5func_29', 'ch5func_2a', 'ch5func_2b', 'ch5func_2c', 'ch5func_2d', 'ch5func_2e', 'ch5func_2f', 'ch5func_30', 'ch5func_31', 'ch5func_32', 'ch5func_33', 'ch5func_34', 'ch5func_35', 'ch5func_36', 'ch5func_37', 'ch5func_38', 'ch5func_39', 'ch5func_3a', 'ch5func_3b', 'ch5func_3c', 'ch5func_3d', 'ch5func_3e', 'ch5func_3f', 'ch5func_40', 'ch5func_41', 'ch5func_42', 'ch5func_43', 'ch5func_44', 'ch5func_45', 'ch5func_46', 'ch5func_47', 'ch5func_48', 'ch5func_49', 'ch5func_4a', 'ch5func_4b', 'ch5func_4c', 'ch5func_4d', 'ch5func_4e', 'ch5func_4f', 'ch5func_50', 'ch5func_51', 'ch5func_52', 'ch5func_53', 'ch5func_54', 'ch5func_55', 'ch5func_56', 'ch5func_57', 'ch5func_58', 'ch5func_59', 'ch5func_5a', 'ch5func_5b', 'ch5func_5c', 'ch5func_5d', 'ch5func_5e', 'ch5func_5f', 'ch5func_60', 'ch5func_61', 'ch5func_62', 'ch5func_63', 'ch5func_64', 'ch5func_65', 'ch5func_66', 'ch5func_67', 'ch5func_68', 'ch5func_69', 'ch5func_6a', 'ch5func_6b', 'ch5func_6c', 'ch5func_6d', 'ch5func_6e', 'ch5func_6f', 'ch5func_70', 'ch5func_71', 'ch5func_72', 'ch5func_73', 'ch5func_74', 'ch5func_75', 'ch5func_76', 'ch5func_77', 'ch5func_78', 'ch5func_79', 'ch5func_7a', 'ch5func_7b', 'ch5func_7c', 'ch5func_7d', 'ch5func_7e', 'ch5func_7f', 'ch5func_80', 'ch5func_81', 'ch5func_82', 'ch5func_83', 'ch5func_84', 'ch5func_85', 'ch5func_86', 'ch5func_87', 'ch5func_88', 'ch5func_89', 'ch5func_8a', 'ch5func_8b', 'ch5func_8c', 'ch5func_8d', 'ch5func_8e', 'ch5func_8f', 'ch5func_90', 'ch5func_91', 'ch5func_92', 'ch5func_93', 'ch5func_94', 'ch5func_95', 'ch5func_96', 'ch5func_97', 'ch5func_98', 'ch5func_99', 'ch5func_9a', 'ch5func_9b', 'ch5func_9c', 'ch5func_9d', 'ch5func_9e', 'ch5func_9f', 'ch5func_a0', 'ch5func_a1', 'ch5func_a2', 'ch5func_a3', 'ch5func_a4', 'ch5func_a5', 'ch5func_a6', 'ch5func_a7', 'ch5func_a8', 'ch5func_a9', 'ch5func_aa', 'ch5func_ab', 'ch5func_ac', 'ch5func_ad', 'ch5func_ae', 'ch5func_af', 'ch5func_b0', 'ch5func_b1', 'ch5func_b2', 'ch5func_b3', 'ch5func_b4', 'ch5func_b5', 'ch5func_b6', 'ch5func_b7', 'ch5func_b8', 'ch5func_b9', 'ch5func_ba', 'ch5func_bb', 'ch5func_bc', 'ch5func_bd', 'ch5func_be', 'ch5func_bf', 'ch5func_c0', 'ch5func_c1', 'ch5func_c2', 'ch5func_c3', 'ch5func_c4', 'ch5func_c5', 'ch5func_c6', 'ch5func_c7', 'ch5func_c8', 'ch5func_c9', 'ch5func_ca', 'ch5func_cb', 'ch5func_cc', 'ch5func_cd', 'ch5func_ce', 'ch5func_cf', 'ch5func_d0', 'ch5func_d1', 'ch5func_d2', 'ch5func_d3', 'ch5func_d4', 'ch5func_d5', 'ch5func_d6', 'ch5func_d7', 'ch5func_d8', 'ch5func_d9', 'ch5func_da', 'ch5func_db', 'ch5func_dc', 'ch5func_dd', 'ch5func_de', 'ch5func_df', 'ch5func_e0', 'ch5func_e1', 'ch5func_e2', 'ch5func_e3', 'ch5func_e4', 'ch5func_e5', 'ch5func_e6', 'ch5func_e7', 'ch5func_e8', 'ch5func_e9', 'ch5func_ea', 'ch5func_eb', 'ch5func_ec', 'ch5func_ed', 'ch5func_ee', 'ch5func_ef', 'ch5func_f0', 'ch5func_f1', 'ch5func_f2', 'ch5func_f3', 'ch5func_f4', 'ch5func_f5', 'ch5func_f6', 'ch5func_f7', 'ch5func_f8', 'ch5func_f9', 'ch5func_fa', 'ch5func_fb', 'ch5func_fc', 'ch5func_fd', 'ch5func_fe', 'ch5func_ff', 'ch5func_100', 'ch5func_101', 'ch5func_102', 'ch5func_103', 'ch5func_104', 'ch5func_105', 'ch5func_106', 'ch5func_107', 'ch5func_108', 'ch5func_109', 'ch5func_10a', 'ch5func_10b', 'ch5func_10c', 'ch5func_10d', 'ch5func_10e', 'ch5func_10f', 'ch5func_110', 'ch5func_111', 'ch5func_112', 'ch5func_113', 'ch5func_114', 'ch5func_115', 'ch5func_116', 'ch5func_117', 'ch5func_118', 'ch5func_119', 'ch5func_11a', 'ch5func_11b', 'ch5func_11c', 'ch5func_11d', 'ch5func_11e', 'ch5func_11f', 'ch5func_120', 'ch5func_121', 'ch5func_122', 'ch5func_123', 'ch5func_124', 'ch5func_125', 'ch5func_126', 'ch5func_127', 'ch5func_128', 'ch5func_129', 'ch5func_12a', 'ch5func_12b', 'ch5func_12c', 'ch5func_12d', 'ch5func_12e', 'ch5func_12f', 'ch5func_130', 'ch5func_131', 'ch5func_132', 'ch5func_133', 'ch5func_134', 'ch5func_135', 'ch5func_136', 'ch5func_137', 'ch5func_138', 'ch5func_139', 'ch5func_13a', 'ch5func_13b', 'ch5func_13c', 'ch5func_13d', 'ch5func_13e', 'ch5func_13f', 'ch5func_140', 'ch5func_141', 'ch5func_142', 'ch5func_143', 'ch5func_144', 'ch5func_145', 'ch5func_146', 'ch5func_147', 'ch5func_148', 'ch5func_149', 'ch5func_14a', 'ch5func_14b', 'ch5func_14c', 'ch5func_14d', 'ch5func_14e', 'ch5func_14f', 'ch5func_150', 'ch5func_151', 'ch5func_152', 'ch5func_153', 'ch5func_154', 'ch5func_155', 'ch5func_156', 'ch5func_157', 'ch5func_158', 'ch5func_159', 'ch5func_15a', 'ch5func_15b', 'ch5func_15c', 'ch5func_15d', 'ch5func_15e', 'ch5func_15f', 'ch5func_160', 'ch5func_161', 'ch5func_162', 'ch5func_163', 'ch5func_164', 'ch5func_165', 'ch5func_166', 'ch5func_167', 'ch5func_168', 'ch5func_169', 'ch5func_16a', 'ch5func_16b', 'ch5func_16c', 'ch5func_16d', 'ch5func_16e', 'ch5func_16f', 'ch5func_170', 'ch5func_171', 'ch5func_172', 'ch5func_173', 'ch5func_174', 'ch5func_175', 'ch5func_176', 'ch5func_177', 'ch5func_178', 'ch5func_179', 'ch5func_17a', 'ch5func_17b', 'ch5func_17c', 'ch5func_17d', 'ch5func_17e', 'ch5func_17f', 'ch5func_180', 'ch5func_181', 'ch5func_182', 'ch5func_183', 'ch5func_184', 'ch5func_185', 'ch5func_186', 'ch5func_187', 'ch5func_188', 'ch5func_189', 'ch5func_18a', 'ch5func_18b', 'ch5func_18c', 'ch5func_18d', 'ch5func_18e', 'ch5func_18f', 'ch5func_190', 'ch5func_191', 'ch5func_192', 'ch5func_193', 'ch5func_194', 'ch5func_195', 'ch5func_196', 'ch5func_197', 'ch5func_198', 'ch5func_199', 'ch5func_19a', 'ch5func_19b', 'ch5func_19c', 'ch5func_19d', 'ch5func_19e', 'ch5func_19f', 'ch5func_1a0', 'ch5func_1a1', 'ch5func_1a2', 'ch5func_1a3', 'ch5func_1a4', 'ch5func_1a5', 'ch5func_1a6', 'ch5func_1a7', 'ch5func_1a8', 'ch5func_1a9', 'ch5func_1aa', 'ch5func_1ab', 'ch5func_1ac', 'ch5func_1ad', 'ch5func_1ae', 'ch5func_1af', 'ch5func_1b0', 'ch5func_1b1', 'ch5func_1b2', 'ch5func_1b3', 'ch5func_1b4', 'ch5func_1b5', 'ch5func_1b6', 'ch5func_1b7', 'ch5func_1b8', 'ch5func_1b9', 'ch5func_1ba', 'ch5func_1bb', 'ch5func_1bc', 'ch5func_1bd', 'ch5func_1be', 'ch5func_1bf', 'ch5func_1c0', 'ch5func_1c1', 'ch5func_1c2', 'ch5func_1c3', 'ch5func_1c4', 'ch5func_1c5', 'ch5func_1c6', 'ch5func_1c7', 'ch5func_1c8', 'ch5func_1c9', 'ch5func_1ca', 'ch5func_1cb', 'ch5func_1cc', 'ch5func_1cd', 'ch5func_1ce', 'ch5func_1cf', 'ch5func_1d0', 'ch5func_1d1', 'ch5func_1d2', 'ch5func_1d3', 'ch5func_1d4', 'ch5func_1d5', 'ch5func_1d6', 'ch5func_1d7', 'ch5func_1d8', 'ch5func_1d9', 'ch5func_1da', 'ch5func_1db', 'ch5func_1dc', 'ch5func_1dd', 'ch5func_1de', 'ch5func_1df', 'ch5func_1e0', 'ch5func_1e1'], 'ch3list_tuples': ['ch3list_tuples_1', 'ch3list_tuples_2', 'ch3list_tuples_3', 'ch3list_tuples_4', 'ch3list_tuples_5', 'ch3list_tuples_6', 'ch3list_tuples_7', 'ch3list_tuples_8', 'ch3list_tuples_9', 'ch3list_tuples_a', 'ch3list_tuples_b', 'ch3list_tuples_c', 'ch3list_tuples_d', 'ch3list_tuples_e', 'ch3list_tuples_f', 'ch3list_tuples_10', 'ch3list_tuples_11', 'ch3list_tuples_12', 'ch3list_tuples_13', 'ch3list_tuples_14', 'ch3list_tuples_15', 'ch3list_tuples_16', 'ch3list_tuples_17', 'ch3list_tuples_18', 'ch3list_tuples_19', 'ch3list_tuples_1a', 'ch3list_tuples_1b', 'ch3list_tuples_1c', 'ch3list_tuples_1d', 'ch3list_tuples_1e', 'ch3list_tuples_1f', 'ch3list_tuples_20', 'ch3list_tuples_21', 'ch3list_tuples_22', 'ch3list_tuples_23', 'ch3list_tuples_24', 'ch3list_tuples_25', 'ch3list_tuples_26', 'ch3list_tuples_27', 'ch3list_tuples_28', 'ch3list_tuples_29', 'ch3list_tuples_2a', 'ch3list_tuples_2b', 'ch3list_tuples_2c', 'ch3list_tuples_2d', 'ch3list_tuples_2e', 'ch3list_tuples_2f', 'ch3list_tuples_30', 'ch3list_tuples_31', 'ch3list_tuples_32', 'ch3list_tuples_33', 'ch3list_tuples_34', 'ch3list_tuples_35', 'ch3list_tuples_36', 'ch3list_tuples_37', 'ch3list_tuples_38', 'ch3list_tuples_39', 'ch3list_tuples_3a', 'ch3list_tuples_3b', 'ch3list_tuples_3c', 'ch3list_tuples_3d', 'ch3list_tuples_3e', 'ch3list_tuples_3f', 'ch3list_tuples_40', 'ch3list_tuples_41', 'ch3list_tuples_42', 'ch3list_tuples_43', 'ch3list_tuples_44', 'ch3list_tuples_45', 'ch3list_tuples_46', 'ch3list_tuples_47', 'ch3list_tuples_48', 'ch3list_tuples_49', 'ch3list_tuples_4a', 'ch3list_tuples_4b', 'ch3list_tuples_4c', 'ch3list_tuples_4d', 'ch3list_tuples_4e', 'ch3list_tuples_4f', 'ch3list_tuples_50', 'ch3list_tuples_51', 'ch3list_tuples_52', 'ch3list_tuples_53', 'ch3list_tuples_54', 'ch3list_tuples_55', 'ch3list_tuples_56', 'ch3list_tuples_57', 'ch3list_tuples_58', 'ch3list_tuples_59', 'ch3list_tuples_5a', 'ch3list_tuples_5b', 'ch3list_tuples_5c', 'ch3list_tuples_5d', 'ch3list_tuples_5e', 'ch3list_tuples_5f', 'ch3list_tuples_60', 'ch3list_tuples_61', 'ch3list_tuples_62', 'ch3list_tuples_63', 'ch3list_tuples_64', 'ch3list_tuples_65', 'ch3list_tuples_66', 'ch3list_tuples_67', 'ch3list_tuples_68', 'ch3list_tuples_69', 'ch3list_tuples_6a', 'ch3list_tuples_6b', 'ch3list_tuples_6c', 'ch3list_tuples_6d', 'ch3list_tuples_6e', 'ch3list_tuples_6f', 'ch3list_tuples_70', 'ch3list_tuples_71', 'ch3list_tuples_72', 'ch3list_tuples_73', 'ch3list_tuples_74', 'ch3list_tuples_75', 'ch3list_tuples_76', 'ch3list_tuples_77', 'ch3list_tuples_78', 'ch3list_tuples_79', 'ch3list_tuples_7a', 'ch3list_tuples_7b', 'ch3list_tuples_7c', 'ch3list_tuples_7d', 'ch3list_tuples_7e', 'ch3list_tuples_7f', 'ch3list_tuples_80', 'ch3list_tuples_81', 'ch3list_tuples_82', 'ch3list_tuples_83', 'ch3list_tuples_84', 'ch3list_tuples_85', 'ch3list_tuples_86', 'ch3list_tuples_87', 'ch3list_tuples_88', 'ch3list_tuples_89', 'ch3list_tuples_8a', 'ch3list_tuples_8b', 'ch3list_tuples_8c', 'ch3list_tuples_8d', 'ch3list_tuples_8e', 'ch3list_tuples_8f', 'ch3list_tuples_90', 'ch3list_tuples_91', 'ch3list_tuples_92', 'ch3list_tuples_93', 'ch3list_tuples_94', 'ch3list_tuples_95', 'ch3list_tuples_96', 'ch3list_tuples_97', 'ch3list_tuples_98', 'ch3list_tuples_99', 'ch3list_tuples_9a', 'ch3list_tuples_9b', 'ch3list_tuples_9c', 'ch3list_tuples_9d', 'ch3list_tuples_9e', 'ch3list_tuples_9f', 'ch3list_tuples_a0', 'ch3list_tuples_a1', 'ch3list_tuples_a2', 'ch3list_tuples_a3', 'ch3list_tuples_a4', 'ch3list_tuples_a5', 'ch3list_tuples_a6', 'ch3list_tuples_a7', 'ch3list_tuples_a8', 'ch3list_tuples_a9', 'ch3list_tuples_aa', 'ch3list_tuples_ab', 'ch3list_tuples_ac', 'ch3list_tuples_ad', 'ch3list_tuples_ae', 'ch3list_tuples_af', 'ch3list_tuples_b0', 'ch3list_tuples_b1', 'ch3list_tuples_b2', 'ch3list_tuples_b3', 'ch3list_tuples_b4', 'ch3list_tuples_b5', 'ch3list_tuples_b6', 'ch3list_tuples_b7', 'ch3list_tuples_b8', 'ch3list_tuples_b9', 'ch3list_tuples_ba', 'ch3list_tuples_bb', 'ch3list_tuples_bc', 'ch3list_tuples_bd', 'ch3list_tuples_be', 'ch3list_tuples_bf', 'ch3list_tuples_c0', 'ch3list_tuples_c1', 'ch3list_tuples_c2', 'ch3list_tuples_c3', 'ch3list_tuples_c4', 'ch3list_tuples_c5', 'ch3list_tuples_c6', 'ch3list_tuples_c7', 'ch3list_tuples_c8', 'ch3list_tuples_c9', 'ch3list_tuples_ca', 'ch3list_tuples_cb', 'ch3list_tuples_cc', 'ch3list_tuples_cd', 'ch3list_tuples_ce', 'ch3list_tuples_cf', 'ch3list_tuples_d0', 'ch3list_tuples_d1', 'ch3list_tuples_d2', 'ch3list_tuples_d3', 'ch3list_tuples_d4', 'ch3list_tuples_d5', 'ch3list_tuples_d6', 'ch3list_tuples_d7', 'ch3list_tuples_d8', 'ch3list_tuples_d9', 'ch3list_tuples_da', 'ch3list_tuples_db', 'ch3list_tuples_dc', 'ch3list_tuples_dd', 'ch3list_tuples_de', 'ch3list_tuples_df', 'ch3list_tuples_e0', 'ch3list_tuples_e1', 'ch3list_tuples_e2', 'ch3list_tuples_e3', 'ch3list_tuples_e4', 'ch3list_tuples_e5', 'ch3list_tuples_e6', 'ch3list_tuples_e7', 'ch3list_tuples_e8', 'ch3list_tuples_e9', 'ch3list_tuples_ea', 'ch3list_tuples_eb', 'ch3list_tuples_ec', 'ch3list_tuples_ed', 'ch3list_tuples_ee', 'ch3list_tuples_ef', 'ch3list_tuples_f0', 'ch3list_tuples_f1', 'ch3list_tuples_f2', 'ch3list_tuples_f3', 'ch3list_tuples_f4', 'ch3list_tuples_f5', 'ch3list_tuples_f6', 'ch3list_tuples_f7', 'ch3list_tuples_f8', 'ch3list_tuples_f9', 'ch3list_tuples_fa', 'ch3list_tuples_fb', 'ch3list_tuples_fc', 'ch3list_tuples_fd', 'ch3list_tuples_fe', 'ch3list_tuples_ff', 'ch3list_tuples_100', 'ch3list_tuples_101', 'ch3list_tuples_102', 'ch3list_tuples_103', 'ch3list_tuples_104', 'ch3list_tuples_105', 'ch3list_tuples_106', 'ch3list_tuples_107', 'ch3list_tuples_108', 'ch3list_tuples_109', 'ch3list_tuples_10a', 'ch3list_tuples_10b', 'ch3list_tuples_10c', 'ch3list_tuples_10d', 'ch3list_tuples_10e', 'ch3list_tuples_10f', 'ch3list_tuples_110', 'ch3list_tuples_111', 'ch3list_tuples_112', 'ch3list_tuples_113', 'ch3list_tuples_114', 'ch3list_tuples_115', 'ch3list_tuples_116', 'ch3list_tuples_117', 'ch3list_tuples_118', 'ch3list_tuples_119', 'ch3list_tuples_11a', 'ch3list_tuples_11b', 'ch3list_tuples_11c', 'ch3list_tuples_11d', 'ch3list_tuples_11e', 'ch3list_tuples_11f', 'ch3list_tuples_120', 'ch3list_tuples_121', 'ch3list_tuples_122', 'ch3list_tuples_123', 'ch3list_tuples_124', 'ch3list_tuples_125', 'ch3list_tuples_126', 'ch3list_tuples_127', 'ch3list_tuples_128', 'ch3list_tuples_129', 'ch3list_tuples_12a', 'ch3list_tuples_12b', 'ch3list_tuples_12c', 'ch3list_tuples_12d', 'ch3list_tuples_12e', 'ch3list_tuples_12f', 'ch3list_tuples_130', 'ch3list_tuples_131', 'ch3list_tuples_132', 'ch3list_tuples_133', 'ch3list_tuples_134', 'ch3list_tuples_135', 'ch3list_tuples_136', 'ch3list_tuples_137', 'ch3list_tuples_138', 'ch3list_tuples_139', 'ch3list_tuples_13a', 'ch3list_tuples_13b', 'ch3list_tuples_13c', 'ch3list_tuples_13d', 'ch3list_tuples_13e', 'ch3list_tuples_13f', 'ch3list_tuples_140', 'ch3list_tuples_141', 'ch3list_tuples_142', 'ch3list_tuples_143', 'ch3list_tuples_144', 'ch3list_tuples_145', 'ch3list_tuples_146', 'ch3list_tuples_147', 'ch3list_tuples_148', 'ch3list_tuples_149', 'ch3list_tuples_14a', 'ch3list_tuples_14b', 'ch3list_tuples_14c', 'ch3list_tuples_14d', 'ch3list_tuples_14e', 'ch3list_tuples_14f', 'ch3list_tuples_150', 'ch3list_tuples_151', 'ch3list_tuples_152', 'ch3list_tuples_153', 'ch3list_tuples_154', 'ch3list_tuples_155', 'ch3list_tuples_156', 'ch3list_tuples_157', 'ch3list_tuples_158', 'ch3list_tuples_159', 'ch3list_tuples_15a', 'ch3list_tuples_15b', 'ch3list_tuples_15c', 'ch3list_tuples_15d', 'ch3list_tuples_15e', 'ch3list_tuples_15f', 'ch3list_tuples_160', 'ch3list_tuples_161', 'ch3list_tuples_162', 'ch3list_tuples_163', 'ch3list_tuples_164', 'ch3list_tuples_165', 'ch3list_tuples_166', 'ch3list_tuples_167', 'ch3list_tuples_168', 'ch3list_tuples_169', 'ch3list_tuples_16a', 'ch3list_tuples_16b', 'ch3list_tuples_16c', 'ch3list_tuples_16d', 'ch3list_tuples_16e', 'ch3list_tuples_16f', 'ch3list_tuples_170', 'ch3list_tuples_171', 'ch3list_tuples_172', 'ch3list_tuples_173', 'ch3list_tuples_174', 'ch3list_tuples_175', 'ch3list_tuples_176', 'ch3list_tuples_177', 'ch3list_tuples_178', 'ch3list_tuples_179', 'ch3list_tuples_17a', 'ch3list_tuples_17b', 'ch3list_tuples_17c', 'ch3list_tuples_17d', 'ch3list_tuples_17e', 'ch3list_tuples_17f', 'ch3list_tuples_180', 'ch3list_tuples_181', 'ch3list_tuples_182', 'ch3list_tuples_183', 'ch3list_tuples_184', 'ch3list_tuples_185', 'ch3list_tuples_186', 'ch3list_tuples_187', 'ch3list_tuples_188', 'ch3list_tuples_189', 'ch3list_tuples_18a', 'ch3list_tuples_18b', 'ch3list_tuples_18c', 'ch3list_tuples_18d', 'ch3list_tuples_18e', 'ch3list_tuples_18f', 'ch3list_tuples_190', 'ch3list_tuples_191', 'ch3list_tuples_192', 'ch3list_tuples_193', 'ch3list_tuples_194', 'ch3list_tuples_195', 'ch3list_tuples_196', 'ch3list_tuples_197', 'ch3list_tuples_198', 'ch3list_tuples_199', 'ch3list_tuples_19a', 'ch3list_tuples_19b', 'ch3list_tuples_19c', 'ch3list_tuples_19d', 'ch3list_tuples_19e', 'ch3list_tuples_19f', 'ch3list_tuples_1a0', 'ch3list_tuples_1a1', 'ch3list_tuples_1a2', 'ch3list_tuples_1a3', 'ch3list_tuples_1a4', 'ch3list_tuples_1a5', 'ch3list_tuples_1a6', 'ch3list_tuples_1a7', 'ch3list_tuples_1a8', 'ch3list_tuples_1a9', 'ch3list_tuples_1aa', 'ch3list_tuples_1ab', 'ch3list_tuples_1ac', 'ch3list_tuples_1ad', 'ch3list_tuples_1ae', 'ch3list_tuples_1af', 'ch3list_tuples_1b0', 'ch3list_tuples_1b1', 'ch3list_tuples_1b2', 'ch3list_tuples_1b3', 'ch3list_tuples_1b4', 'ch3list_tuples_1b5', 'ch3list_tuples_1b6', 'ch3list_tuples_1b7', 'ch3list_tuples_1b8', 'ch3list_tuples_1b9', 'ch3list_tuples_1ba', 'ch3list_tuples_1bb', 'ch3list_tuples_1bc', 'ch3list_tuples_1bd', 'ch3list_tuples_1be', 'ch3list_tuples_1bf', 'ch3list_tuples_1c0', 'ch3list_tuples_1c1', 'ch3list_tuples_1c2', 'ch3list_tuples_1c3', 'ch3list_tuples_1c4', 'ch3list_tuples_1c5', 'ch3list_tuples_1c6', 'ch3list_tuples_1c7', 'ch3list_tuples_1c8', 'ch3list_tuples_1c9', 'ch3list_tuples_1ca', 'ch3list_tuples_1cb', 'ch3list_tuples_1cc', 'ch3list_tuples_1cd', 'ch3list_tuples_1ce', 'ch3list_tuples_1cf', 'ch3list_tuples_1d0', 'ch3list_tuples_1d1', 'ch3list_tuples_1d2', 'ch3list_tuples_1d3', 'ch3list_tuples_1d4', 'ch3list_tuples_1d5', 'ch3list_tuples_1d6', 'ch3list_tuples_1d7', 'ch3list_tuples_1d8', 'ch3list_tuples_1d9', 'ch3list_tuples_1da', 'ch3list_tuples_1db', 'ch3list_tuples_1dc', 'ch3list_tuples_1dd', 'ch3list_tuples_1de', 'ch3list_tuples_1df', 'ch3list_tuples_1e0', 'ch3list_tuples_1e1'], 'ch2intro': ['ch2intro_1', 'ch2intro_2', 'ch2intro_3', 'ch2intro_4', 'ch2intro_5', 'ch2intro_6', 'ch2intro_7', 'ch2intro_8', 'ch2intro_9', 'ch2intro_a', 'ch2intro_b', 'ch2intro_c', 'ch2intro_d', 'ch2intro_e', 'ch2intro_f', 'ch2intro_10', 'ch2intro_11', 'ch2intro_12', 'ch2intro_13', 'ch2intro_14', 'ch2intro_15', 'ch2intro_16', 'ch2intro_17', 'ch2intro_18', 'ch2intro_19', 'ch2intro_1a', 'ch2intro_1b', 'ch2intro_1c', 'ch2intro_1d', 'ch2intro_1e', 'ch2intro_1f', 'ch2intro_20', 'ch2intro_21', 'ch2intro_22', 'ch2intro_23', 'ch2intro_24', 'ch2intro_25', 'ch2intro_26', 'ch2intro_27', 'ch2intro_28', 'ch2intro_29', 'ch2intro_2a', 'ch2intro_2b', 'ch2intro_2c', 'ch2intro_2d', 'ch2intro_2e', 'ch2intro_2f', 'ch2intro_30', 'ch2intro_31', 'ch2intro_32', 'ch2intro_33', 'ch2intro_34', 'ch2intro_35', 'ch2intro_36', 'ch2intro_37', 'ch2intro_38', 'ch2intro_39', 'ch2intro_3a', 'ch2intro_3b', 'ch2intro_3c', 'ch2intro_3d', 'ch2intro_3e', 'ch2intro_3f', 'ch2intro_40', 'ch2intro_41', 'ch2intro_42', 'ch2intro_43', 'ch2intro_44', 'ch2intro_45', 'ch2intro_46', 'ch2intro_47', 'ch2intro_48', 'ch2intro_49', 'ch2intro_4a', 'ch2intro_4b', 'ch2intro_4c', 'ch2intro_4d', 'ch2intro_4e', 'ch2intro_4f', 'ch2intro_50', 'ch2intro_51', 'ch2intro_52', 'ch2intro_53', 'ch2intro_54', 'ch2intro_55', 'ch2intro_56', 'ch2intro_57', 'ch2intro_58', 'ch2intro_59', 'ch2intro_5a', 'ch2intro_5b', 'ch2intro_5c', 'ch2intro_5d', 'ch2intro_5e', 'ch2intro_5f', 'ch2intro_60', 'ch2intro_61', 'ch2intro_62', 'ch2intro_63', 'ch2intro_64', 'ch2intro_65', 'ch2intro_66', 'ch2intro_67', 'ch2intro_68', 'ch2intro_69', 'ch2intro_6a', 'ch2intro_6b', 'ch2intro_6c', 'ch2intro_6d', 'ch2intro_6e', 'ch2intro_6f', 'ch2intro_70', 'ch2intro_71', 'ch2intro_72', 'ch2intro_73', 'ch2intro_74', 'ch2intro_75', 'ch2intro_76', 'ch2intro_77', 'ch2intro_78', 'ch2intro_79', 'ch2intro_7a', 'ch2intro_7b', 'ch2intro_7c', 'ch2intro_7d', 'ch2intro_7e', 'ch2intro_7f', 'ch2intro_80', 'ch2intro_81', 'ch2intro_82', 'ch2intro_83', 'ch2intro_84', 'ch2intro_85', 'ch2intro_86', 'ch2intro_87', 'ch2intro_88', 'ch2intro_89', 'ch2intro_8a', 'ch2intro_8b', 'ch2intro_8c', 'ch2intro_8d', 'ch2intro_8e', 'ch2intro_8f', 'ch2intro_90', 'ch2intro_91', 'ch2intro_92', 'ch2intro_93', 'ch2intro_94', 'ch2intro_95', 'ch2intro_96', 'ch2intro_97', 'ch2intro_98', 'ch2intro_99', 'ch2intro_9a', 'ch2intro_9b', 'ch2intro_9c', 'ch2intro_9d', 'ch2intro_9e', 'ch2intro_9f', 'ch2intro_a0', 'ch2intro_a1', 'ch2intro_a2', 'ch2intro_a3', 'ch2intro_a4', 'ch2intro_a5', 'ch2intro_a6', 'ch2intro_a7', 'ch2intro_a8', 'ch2intro_a9', 'ch2intro_aa', 'ch2intro_ab', 'ch2intro_ac', 'ch2intro_ad', 'ch2intro_ae', 'ch2intro_af', 'ch2intro_b0', 'ch2intro_b1', 'ch2intro_b2', 'ch2intro_b3', 'ch2intro_b4', 'ch2intro_b5', 'ch2intro_b6', 'ch2intro_b7', 'ch2intro_b8', 'ch2intro_b9', 'ch2intro_ba', 'ch2intro_bb', 'ch2intro_bc', 'ch2intro_bd', 'ch2intro_be', 'ch2intro_bf', 'ch2intro_c0', 'ch2intro_c1', 'ch2intro_c2', 'ch2intro_c3', 'ch2intro_c4', 'ch2intro_c5', 'ch2intro_c6', 'ch2intro_c7', 'ch2intro_c8', 'ch2intro_c9', 'ch2intro_ca', 'ch2intro_cb', 'ch2intro_cc', 'ch2intro_cd', 'ch2intro_ce', 'ch2intro_cf', 'ch2intro_d0', 'ch2intro_d1', 'ch2intro_d2', 'ch2intro_d3', 'ch2intro_d4', 'ch2intro_d5', 'ch2intro_d6', 'ch2intro_d7', 'ch2intro_d8', 'ch2intro_d9', 'ch2intro_da', 'ch2intro_db', 'ch2intro_dc', 'ch2intro_dd', 'ch2intro_de', 'ch2intro_df', 'ch2intro_e0', 'ch2intro_e1', 'ch2intro_e2', 'ch2intro_e3', 'ch2intro_e4', 'ch2intro_e5', 'ch2intro_e6', 'ch2intro_e7', 'ch2intro_e8', 'ch2intro_e9', 'ch2intro_ea', 'ch2intro_eb', 'ch2intro_ec', 'ch2intro_ed', 'ch2intro_ee', 'ch2intro_ef', 'ch2intro_f0', 'ch2intro_f1', 'ch2intro_f2', 'ch2intro_f3', 'ch2intro_f4', 'ch2intro_f5', 'ch2intro_f6', 'ch2intro_f7', 'ch2intro_f8', 'ch2intro_f9', 'ch2intro_fa', 'ch2intro_fb', 'ch2intro_fc', 'ch2intro_fd', 'ch2intro_fe', 'ch2intro_ff', 'ch2intro_100', 'ch2intro_101', 'ch2intro_102', 'ch2intro_103', 'ch2intro_104', 'ch2intro_105', 'ch2intro_106', 'ch2intro_107', 'ch2intro_108', 'ch2intro_109', 'ch2intro_10a', 'ch2intro_10b', 'ch2intro_10c', 'ch2intro_10d', 'ch2intro_10e', 'ch2intro_10f', 'ch2intro_110', 'ch2intro_111', 'ch2intro_112', 'ch2intro_113', 'ch2intro_114', 'ch2intro_115', 'ch2intro_116', 'ch2intro_117', 'ch2intro_118', 'ch2intro_119', 'ch2intro_11a', 'ch2intro_11b', 'ch2intro_11c', 'ch2intro_11d', 'ch2intro_11e', 'ch2intro_11f', 'ch2intro_120', 'ch2intro_121', 'ch2intro_122', 'ch2intro_123', 'ch2intro_124', 'ch2intro_125', 'ch2intro_126', 'ch2intro_127', 'ch2intro_128', 'ch2intro_129', 'ch2intro_12a', 'ch2intro_12b', 'ch2intro_12c', 'ch2intro_12d', 'ch2intro_12e', 'ch2intro_12f', 'ch2intro_130', 'ch2intro_131', 'ch2intro_132', 'ch2intro_133', 'ch2intro_134', 'ch2intro_135', 'ch2intro_136', 'ch2intro_137', 'ch2intro_138', 'ch2intro_139', 'ch2intro_13a', 'ch2intro_13b', 'ch2intro_13c', 'ch2intro_13d', 'ch2intro_13e', 'ch2intro_13f', 'ch2intro_140', 'ch2intro_141', 'ch2intro_142', 'ch2intro_143', 'ch2intro_144', 'ch2intro_145', 'ch2intro_146', 'ch2intro_147', 'ch2intro_148', 'ch2intro_149', 'ch2intro_14a', 'ch2intro_14b', 'ch2intro_14c', 'ch2intro_14d', 'ch2intro_14e', 'ch2intro_14f', 'ch2intro_150', 'ch2intro_151', 'ch2intro_152', 'ch2intro_153', 'ch2intro_154', 'ch2intro_155', 'ch2intro_156', 'ch2intro_157', 'ch2intro_158', 'ch2intro_159', 'ch2intro_15a', 'ch2intro_15b', 'ch2intro_15c', 'ch2intro_15d', 'ch2intro_15e', 'ch2intro_15f', 'ch2intro_160', 'ch2intro_161', 'ch2intro_162', 'ch2intro_163', 'ch2intro_164', 'ch2intro_165', 'ch2intro_166', 'ch2intro_167', 'ch2intro_168', 'ch2intro_169', 'ch2intro_16a', 'ch2intro_16b', 'ch2intro_16c', 'ch2intro_16d', 'ch2intro_16e', 'ch2intro_16f', 'ch2intro_170', 'ch2intro_171', 'ch2intro_172', 'ch2intro_173', 'ch2intro_174', 'ch2intro_175', 'ch2intro_176', 'ch2intro_177', 'ch2intro_178', 'ch2intro_179', 'ch2intro_17a', 'ch2intro_17b', 'ch2intro_17c', 'ch2intro_17d', 'ch2intro_17e', 'ch2intro_17f', 'ch2intro_180', 'ch2intro_181', 'ch2intro_182', 'ch2intro_183', 'ch2intro_184', 'ch2intro_185', 'ch2intro_186', 'ch2intro_187', 'ch2intro_188', 'ch2intro_189', 'ch2intro_18a', 'ch2intro_18b', 'ch2intro_18c', 'ch2intro_18d', 'ch2intro_18e', 'ch2intro_18f', 'ch2intro_190', 'ch2intro_191', 'ch2intro_192', 'ch2intro_193', 'ch2intro_194', 'ch2intro_195', 'ch2intro_196', 'ch2intro_197', 'ch2intro_198', 'ch2intro_199', 'ch2intro_19a', 'ch2intro_19b', 'ch2intro_19c', 'ch2intro_19d', 'ch2intro_19e', 'ch2intro_19f', 'ch2intro_1a0', 'ch2intro_1a1', 'ch2intro_1a2', 'ch2intro_1a3', 'ch2intro_1a4', 'ch2intro_1a5', 'ch2intro_1a6', 'ch2intro_1a7', 'ch2intro_1a8', 'ch2intro_1a9', 'ch2intro_1aa', 'ch2intro_1ab', 'ch2intro_1ac', 'ch2intro_1ad', 'ch2intro_1ae', 'ch2intro_1af', 'ch2intro_1b0', 'ch2intro_1b1', 'ch2intro_1b2', 'ch2intro_1b3', 'ch2intro_1b4', 'ch2intro_1b5', 'ch2intro_1b6', 'ch2intro_1b7', 'ch2intro_1b8', 'ch2intro_1b9', 'ch2intro_1ba', 'ch2intro_1bb', 'ch2intro_1bc', 'ch2intro_1bd', 'ch2intro_1be', 'ch2intro_1bf', 'ch2intro_1c0', 'ch2intro_1c1', 'ch2intro_1c2', 'ch2intro_1c3', 'ch2intro_1c4', 'ch2intro_1c5', 'ch2intro_1c6', 'ch2intro_1c7', 'ch2intro_1c8', 'ch2intro_1c9', 'ch2intro_1ca', 'ch2intro_1cb', 'ch2intro_1cc', 'ch2intro_1cd', 'ch2intro_1ce', 'ch2intro_1cf', 'ch2intro_1d0', 'ch2intro_1d1', 'ch2intro_1d2', 'ch2intro_1d3', 'ch2intro_1d4', 'ch2intro_1d5', 'ch2intro_1d6', 'ch2intro_1d7', 'ch2intro_1d8', 'ch2intro_1d9', 'ch2intro_1da', 'ch2intro_1db', 'ch2intro_1dc', 'ch2intro_1dd', 'ch2intro_1de', 'ch2intro_1df', 'ch2intro_1e0', 'ch2intro_1e1'], 'ch4strings_dicts': ['ch4strings_dicts_1', 'ch4strings_dicts_2', 'ch4strings_dicts_3', 'ch4strings_dicts_4', 'ch4strings_dicts_5', 'ch4strings_dicts_6', 'ch4strings_dicts_7', 'ch4strings_dicts_8', 'ch4strings_dicts_9', 'ch4strings_dicts_a', 'ch4strings_dicts_b', 'ch4strings_dicts_c', 'ch4strings_dicts_d', 'ch4strings_dicts_e', 'ch4strings_dicts_f', 'ch4strings_dicts_10', 'ch4strings_dicts_11', 'ch4strings_dicts_12', 'ch4strings_dicts_13', 'ch4strings_dicts_14', 'ch4strings_dicts_15', 'ch4strings_dicts_16', 'ch4strings_dicts_17', 'ch4strings_dicts_18', 'ch4strings_dicts_19', 'ch4strings_dicts_1a', 'ch4strings_dicts_1b', 'ch4strings_dicts_1c', 'ch4strings_dicts_1d', 'ch4strings_dicts_1e', 'ch4strings_dicts_1f', 'ch4strings_dicts_20', 'ch4strings_dicts_21', 'ch4strings_dicts_22', 'ch4strings_dicts_23', 'ch4strings_dicts_24', 'ch4strings_dicts_25', 'ch4strings_dicts_26', 'ch4strings_dicts_27', 'ch4strings_dicts_28', 'ch4strings_dicts_29', 'ch4strings_dicts_2a', 'ch4strings_dicts_2b', 'ch4strings_dicts_2c', 'ch4strings_dicts_2d', 'ch4strings_dicts_2e', 'ch4strings_dicts_2f', 'ch4strings_dicts_30', 'ch4strings_dicts_31', 'ch4strings_dicts_32', 'ch4strings_dicts_33', 'ch4strings_dicts_34', 'ch4strings_dicts_35', 'ch4strings_dicts_36', 'ch4strings_dicts_37', 'ch4strings_dicts_38', 'ch4strings_dicts_39', 'ch4strings_dicts_3a', 'ch4strings_dicts_3b', 'ch4strings_dicts_3c', 'ch4strings_dicts_3d', 'ch4strings_dicts_3e', 'ch4strings_dicts_3f', 'ch4strings_dicts_40', 'ch4strings_dicts_41', 'ch4strings_dicts_42', 'ch4strings_dicts_43', 'ch4strings_dicts_44', 'ch4strings_dicts_45', 'ch4strings_dicts_46', 'ch4strings_dicts_47', 'ch4strings_dicts_48', 'ch4strings_dicts_49', 'ch4strings_dicts_4a', 'ch4strings_dicts_4b', 'ch4strings_dicts_4c', 'ch4strings_dicts_4d', 'ch4strings_dicts_4e', 'ch4strings_dicts_4f', 'ch4strings_dicts_50', 'ch4strings_dicts_51', 'ch4strings_dicts_52', 'ch4strings_dicts_53', 'ch4strings_dicts_54', 'ch4strings_dicts_55', 'ch4strings_dicts_56', 'ch4strings_dicts_57', 'ch4strings_dicts_58', 'ch4strings_dicts_59', 'ch4strings_dicts_5a', 'ch4strings_dicts_5b', 'ch4strings_dicts_5c', 'ch4strings_dicts_5d', 'ch4strings_dicts_5e', 'ch4strings_dicts_5f', 'ch4strings_dicts_60', 'ch4strings_dicts_61', 'ch4strings_dicts_62', 'ch4strings_dicts_63', 'ch4strings_dicts_64', 'ch4strings_dicts_65', 'ch4strings_dicts_66', 'ch4strings_dicts_67', 'ch4strings_dicts_68', 'ch4strings_dicts_69', 'ch4strings_dicts_6a', 'ch4strings_dicts_6b', 'ch4strings_dicts_6c', 'ch4strings_dicts_6d', 'ch4strings_dicts_6e', 'ch4strings_dicts_6f', 'ch4strings_dicts_70', 'ch4strings_dicts_71', 'ch4strings_dicts_72', 'ch4strings_dicts_73', 'ch4strings_dicts_74', 'ch4strings_dicts_75', 'ch4strings_dicts_76', 'ch4strings_dicts_77', 'ch4strings_dicts_78', 'ch4strings_dicts_79', 'ch4strings_dicts_7a', 'ch4strings_dicts_7b', 'ch4strings_dicts_7c', 'ch4strings_dicts_7d', 'ch4strings_dicts_7e', 'ch4strings_dicts_7f', 'ch4strings_dicts_80', 'ch4strings_dicts_81', 'ch4strings_dicts_82', 'ch4strings_dicts_83', 'ch4strings_dicts_84', 'ch4strings_dicts_85', 'ch4strings_dicts_86', 'ch4strings_dicts_87', 'ch4strings_dicts_88', 'ch4strings_dicts_89', 'ch4strings_dicts_8a', 'ch4strings_dicts_8b', 'ch4strings_dicts_8c', 'ch4strings_dicts_8d', 'ch4strings_dicts_8e', 'ch4strings_dicts_8f', 'ch4strings_dicts_90', 'ch4strings_dicts_91', 'ch4strings_dicts_92', 'ch4strings_dicts_93', 'ch4strings_dicts_94', 'ch4strings_dicts_95', 'ch4strings_dicts_96', 'ch4strings_dicts_97', 'ch4strings_dicts_98', 'ch4strings_dicts_99', 'ch4strings_dicts_9a', 'ch4strings_dicts_9b', 'ch4strings_dicts_9c', 'ch4strings_dicts_9d', 'ch4strings_dicts_9e', 'ch4strings_dicts_9f', 'ch4strings_dicts_a0', 'ch4strings_dicts_a1', 'ch4strings_dicts_a2', 'ch4strings_dicts_a3', 'ch4strings_dicts_a4', 'ch4strings_dicts_a5', 'ch4strings_dicts_a6', 'ch4strings_dicts_a7', 'ch4strings_dicts_a8', 'ch4strings_dicts_a9', 'ch4strings_dicts_aa', 'ch4strings_dicts_ab', 'ch4strings_dicts_ac', 'ch4strings_dicts_ad', 'ch4strings_dicts_ae', 'ch4strings_dicts_af', 'ch4strings_dicts_b0', 'ch4strings_dicts_b1', 'ch4strings_dicts_b2', 'ch4strings_dicts_b3', 'ch4strings_dicts_b4', 'ch4strings_dicts_b5', 'ch4strings_dicts_b6', 'ch4strings_dicts_b7', 'ch4strings_dicts_b8', 'ch4strings_dicts_b9', 'ch4strings_dicts_ba', 'ch4strings_dicts_bb', 'ch4strings_dicts_bc', 'ch4strings_dicts_bd', 'ch4strings_dicts_be', 'ch4strings_dicts_bf', 'ch4strings_dicts_c0', 'ch4strings_dicts_c1', 'ch4strings_dicts_c2', 'ch4strings_dicts_c3', 'ch4strings_dicts_c4', 'ch4strings_dicts_c5', 'ch4strings_dicts_c6', 'ch4strings_dicts_c7', 'ch4strings_dicts_c8', 'ch4strings_dicts_c9', 'ch4strings_dicts_ca', 'ch4strings_dicts_cb', 'ch4strings_dicts_cc', 'ch4strings_dicts_cd', 'ch4strings_dicts_ce', 'ch4strings_dicts_cf', 'ch4strings_dicts_d0', 'ch4strings_dicts_d1', 'ch4strings_dicts_d2', 'ch4strings_dicts_d3', 'ch4strings_dicts_d4', 'ch4strings_dicts_d5', 'ch4strings_dicts_d6', 'ch4strings_dicts_d7', 'ch4strings_dicts_d8', 'ch4strings_dicts_d9', 'ch4strings_dicts_da', 'ch4strings_dicts_db', 'ch4strings_dicts_dc', 'ch4strings_dicts_dd', 'ch4strings_dicts_de', 'ch4strings_dicts_df', 'ch4strings_dicts_e0', 'ch4strings_dicts_e1', 'ch4strings_dicts_e2', 'ch4strings_dicts_e3', 'ch4strings_dicts_e4', 'ch4strings_dicts_e5', 'ch4strings_dicts_e6', 'ch4strings_dicts_e7', 'ch4strings_dicts_e8', 'ch4strings_dicts_e9', 'ch4strings_dicts_ea', 'ch4strings_dicts_eb', 'ch4strings_dicts_ec', 'ch4strings_dicts_ed', 'ch4strings_dicts_ee', 'ch4strings_dicts_ef', 'ch4strings_dicts_f0', 'ch4strings_dicts_f1', 'ch4strings_dicts_f2', 'ch4strings_dicts_f3', 'ch4strings_dicts_f4', 'ch4strings_dicts_f5', 'ch4strings_dicts_f6', 'ch4strings_dicts_f7', 'ch4strings_dicts_f8', 'ch4strings_dicts_f9', 'ch4strings_dicts_fa', 'ch4strings_dicts_fb', 'ch4strings_dicts_fc', 'ch4strings_dicts_fd', 'ch4strings_dicts_fe', 'ch4strings_dicts_ff', 'ch4strings_dicts_100', 'ch4strings_dicts_101', 'ch4strings_dicts_102', 'ch4strings_dicts_103', 'ch4strings_dicts_104', 'ch4strings_dicts_105', 'ch4strings_dicts_106', 'ch4strings_dicts_107', 'ch4strings_dicts_108', 'ch4strings_dicts_109', 'ch4strings_dicts_10a', 'ch4strings_dicts_10b', 'ch4strings_dicts_10c', 'ch4strings_dicts_10d', 'ch4strings_dicts_10e', 'ch4strings_dicts_10f', 'ch4strings_dicts_110', 'ch4strings_dicts_111', 'ch4strings_dicts_112', 'ch4strings_dicts_113', 'ch4strings_dicts_114', 'ch4strings_dicts_115', 'ch4strings_dicts_116', 'ch4strings_dicts_117', 'ch4strings_dicts_118', 'ch4strings_dicts_119', 'ch4strings_dicts_11a', 'ch4strings_dicts_11b', 'ch4strings_dicts_11c', 'ch4strings_dicts_11d', 'ch4strings_dicts_11e', 'ch4strings_dicts_11f', 'ch4strings_dicts_120', 'ch4strings_dicts_121', 'ch4strings_dicts_122', 'ch4strings_dicts_123', 'ch4strings_dicts_124', 'ch4strings_dicts_125', 'ch4strings_dicts_126', 'ch4strings_dicts_127', 'ch4strings_dicts_128', 'ch4strings_dicts_129', 'ch4strings_dicts_12a', 'ch4strings_dicts_12b', 'ch4strings_dicts_12c', 'ch4strings_dicts_12d', 'ch4strings_dicts_12e', 'ch4strings_dicts_12f', 'ch4strings_dicts_130', 'ch4strings_dicts_131', 'ch4strings_dicts_132', 'ch4strings_dicts_133', 'ch4strings_dicts_134', 'ch4strings_dicts_135', 'ch4strings_dicts_136', 'ch4strings_dicts_137', 'ch4strings_dicts_138', 'ch4strings_dicts_139', 'ch4strings_dicts_13a', 'ch4strings_dicts_13b', 'ch4strings_dicts_13c', 'ch4strings_dicts_13d', 'ch4strings_dicts_13e', 'ch4strings_dicts_13f', 'ch4strings_dicts_140', 'ch4strings_dicts_141', 'ch4strings_dicts_142', 'ch4strings_dicts_143', 'ch4strings_dicts_144', 'ch4strings_dicts_145', 'ch4strings_dicts_146', 'ch4strings_dicts_147', 'ch4strings_dicts_148', 'ch4strings_dicts_149', 'ch4strings_dicts_14a', 'ch4strings_dicts_14b', 'ch4strings_dicts_14c', 'ch4strings_dicts_14d', 'ch4strings_dicts_14e', 'ch4strings_dicts_14f', 'ch4strings_dicts_150', 'ch4strings_dicts_151', 'ch4strings_dicts_152', 'ch4strings_dicts_153', 'ch4strings_dicts_154', 'ch4strings_dicts_155', 'ch4strings_dicts_156', 'ch4strings_dicts_157', 'ch4strings_dicts_158', 'ch4strings_dicts_159', 'ch4strings_dicts_15a', 'ch4strings_dicts_15b', 'ch4strings_dicts_15c', 'ch4strings_dicts_15d', 'ch4strings_dicts_15e', 'ch4strings_dicts_15f', 'ch4strings_dicts_160', 'ch4strings_dicts_161', 'ch4strings_dicts_162', 'ch4strings_dicts_163', 'ch4strings_dicts_164', 'ch4strings_dicts_165', 'ch4strings_dicts_166', 'ch4strings_dicts_167', 'ch4strings_dicts_168', 'ch4strings_dicts_169', 'ch4strings_dicts_16a', 'ch4strings_dicts_16b', 'ch4strings_dicts_16c', 'ch4strings_dicts_16d', 'ch4strings_dicts_16e', 'ch4strings_dicts_16f', 'ch4strings_dicts_170', 'ch4strings_dicts_171', 'ch4strings_dicts_172', 'ch4strings_dicts_173', 'ch4strings_dicts_174', 'ch4strings_dicts_175', 'ch4strings_dicts_176', 'ch4strings_dicts_177', 'ch4strings_dicts_178', 'ch4strings_dicts_179', 'ch4strings_dicts_17a', 'ch4strings_dicts_17b', 'ch4strings_dicts_17c', 'ch4strings_dicts_17d', 'ch4strings_dicts_17e', 'ch4strings_dicts_17f', 'ch4strings_dicts_180', 'ch4strings_dicts_181', 'ch4strings_dicts_182', 'ch4strings_dicts_183', 'ch4strings_dicts_184', 'ch4strings_dicts_185', 'ch4strings_dicts_186', 'ch4strings_dicts_187', 'ch4strings_dicts_188', 'ch4strings_dicts_189', 'ch4strings_dicts_18a', 'ch4strings_dicts_18b', 'ch4strings_dicts_18c', 'ch4strings_dicts_18d', 'ch4strings_dicts_18e', 'ch4strings_dicts_18f', 'ch4strings_dicts_190', 'ch4strings_dicts_191', 'ch4strings_dicts_192', 'ch4strings_dicts_193', 'ch4strings_dicts_194', 'ch4strings_dicts_195', 'ch4strings_dicts_196', 'ch4strings_dicts_197', 'ch4strings_dicts_198', 'ch4strings_dicts_199', 'ch4strings_dicts_19a', 'ch4strings_dicts_19b', 'ch4strings_dicts_19c', 'ch4strings_dicts_19d', 'ch4strings_dicts_19e', 'ch4strings_dicts_19f', 'ch4strings_dicts_1a0', 'ch4strings_dicts_1a1', 'ch4strings_dicts_1a2', 'ch4strings_dicts_1a3', 'ch4strings_dicts_1a4', 'ch4strings_dicts_1a5', 'ch4strings_dicts_1a6', 'ch4strings_dicts_1a7', 'ch4strings_dicts_1a8', 'ch4strings_dicts_1a9', 'ch4strings_dicts_1aa', 'ch4strings_dicts_1ab', 'ch4strings_dicts_1ac', 'ch4strings_dicts_1ad', 'ch4strings_dicts_1ae', 'ch4strings_dicts_1af', 'ch4strings_dicts_1b0', 'ch4strings_dicts_1b1', 'ch4strings_dicts_1b2', 'ch4strings_dicts_1b3', 'ch4strings_dicts_1b4', 'ch4strings_dicts_1b5', 'ch4strings_dicts_1b6', 'ch4strings_dicts_1b7', 'ch4strings_dicts_1b8', 'ch4strings_dicts_1b9', 'ch4strings_dicts_1ba', 'ch4strings_dicts_1bb', 'ch4strings_dicts_1bc', 'ch4strings_dicts_1bd', 'ch4strings_dicts_1be', 'ch4strings_dicts_1bf', 'ch4strings_dicts_1c0', 'ch4strings_dicts_1c1', 'ch4strings_dicts_1c2', 'ch4strings_dicts_1c3', 'ch4strings_dicts_1c4', 'ch4strings_dicts_1c5', 'ch4strings_dicts_1c6', 'ch4strings_dicts_1c7', 'ch4strings_dicts_1c8', 'ch4strings_dicts_1c9', 'ch4strings_dicts_1ca', 'ch4strings_dicts_1cb', 'ch4strings_dicts_1cc', 'ch4strings_dicts_1cd', 'ch4strings_dicts_1ce', 'ch4strings_dicts_1cf', 'ch4strings_dicts_1d0', 'ch4strings_dicts_1d1', 'ch4strings_dicts_1d2', 'ch4strings_dicts_1d3', 'ch4strings_dicts_1d4', 'ch4strings_dicts_1d5', 'ch4strings_dicts_1d6', 'ch4strings_dicts_1d7', 'ch4strings_dicts_1d8', 'ch4strings_dicts_1d9', 'ch4strings_dicts_1da', 'ch4strings_dicts_1db', 'ch4strings_dicts_1dc', 'ch4strings_dicts_1dd', 'ch4strings_dicts_1de', 'ch4strings_dicts_1df', 'ch4strings_dicts_1e0', 'ch4strings_dicts_1e1'], 'ch11Section_5': ['ch11Section_5_1', 'ch11Section_5_2', 'ch11Section_5_3', 'ch11Section_5_4', 'ch11Section_5_5', 'ch11Section_5_6', 'ch11Section_5_7', 'ch11Section_5_8', 'ch11Section_5_9', 'ch11Section_5_a', 'ch11Section_5_b', 'ch11Section_5_c', 'ch11Section_5_d', 'ch11Section_5_e', 'ch11Section_5_f', 'ch11Section_5_10', 'ch11Section_5_11', 'ch11Section_5_12', 'ch11Section_5_13', 'ch11Section_5_14', 'ch11Section_5_15', 'ch11Section_5_16', 'ch11Section_5_17', 'ch11Section_5_18', 'ch11Section_5_19', 'ch11Section_5_1a', 'ch11Section_5_1b', 'ch11Section_5_1c', 'ch11Section_5_1d', 'ch11Section_5_1e', 'ch11Section_5_1f', 'ch11Section_5_20', 'ch11Section_5_21', 'ch11Section_5_22', 'ch11Section_5_23', 'ch11Section_5_24', 'ch11Section_5_25', 'ch11Section_5_26', 'ch11Section_5_27', 'ch11Section_5_28', 'ch11Section_5_29', 'ch11Section_5_2a', 'ch11Section_5_2b', 'ch11Section_5_2c', 'ch11Section_5_2d', 'ch11Section_5_2e', 'ch11Section_5_2f', 'ch11Section_5_30', 'ch11Section_5_31', 'ch11Section_5_32', 'ch11Section_5_33', 'ch11Section_5_34', 'ch11Section_5_35', 'ch11Section_5_36', 'ch11Section_5_37', 'ch11Section_5_38', 'ch11Section_5_39', 'ch11Section_5_3a', 'ch11Section_5_3b', 'ch11Section_5_3c', 'ch11Section_5_3d', 'ch11Section_5_3e', 'ch11Section_5_3f', 'ch11Section_5_40', 'ch11Section_5_41', 'ch11Section_5_42', 'ch11Section_5_43', 'ch11Section_5_44', 'ch11Section_5_45', 'ch11Section_5_46', 'ch11Section_5_47', 'ch11Section_5_48', 'ch11Section_5_49', 'ch11Section_5_4a', 'ch11Section_5_4b', 'ch11Section_5_4c', 'ch11Section_5_4d', 'ch11Section_5_4e', 'ch11Section_5_4f', 'ch11Section_5_50', 'ch11Section_5_51', 'ch11Section_5_52', 'ch11Section_5_53', 'ch11Section_5_54', 'ch11Section_5_55', 'ch11Section_5_56', 'ch11Section_5_57', 'ch11Section_5_58', 'ch11Section_5_59', 'ch11Section_5_5a', 'ch11Section_5_5b', 'ch11Section_5_5c', 'ch11Section_5_5d', 'ch11Section_5_5e', 'ch11Section_5_5f', 'ch11Section_5_60', 'ch11Section_5_61', 'ch11Section_5_62', 'ch11Section_5_63', 'ch11Section_5_64', 'ch11Section_5_65', 'ch11Section_5_66', 'ch11Section_5_67', 'ch11Section_5_68', 'ch11Section_5_69', 'ch11Section_5_6a', 'ch11Section_5_6b', 'ch11Section_5_6c', 'ch11Section_5_6d', 'ch11Section_5_6e', 'ch11Section_5_6f', 'ch11Section_5_70', 'ch11Section_5_71', 'ch11Section_5_72', 'ch11Section_5_73', 'ch11Section_5_74', 'ch11Section_5_75', 'ch11Section_5_76', 'ch11Section_5_77', 'ch11Section_5_78', 'ch11Section_5_79', 'ch11Section_5_7a', 'ch11Section_5_7b', 'ch11Section_5_7c', 'ch11Section_5_7d', 'ch11Section_5_7e', 'ch11Section_5_7f', 'ch11Section_5_80', 'ch11Section_5_81', 'ch11Section_5_82', 'ch11Section_5_83', 'ch11Section_5_84', 'ch11Section_5_85', 'ch11Section_5_86', 'ch11Section_5_87', 'ch11Section_5_88', 'ch11Section_5_89', 'ch11Section_5_8a', 'ch11Section_5_8b', 'ch11Section_5_8c', 'ch11Section_5_8d', 'ch11Section_5_8e', 'ch11Section_5_8f', 'ch11Section_5_90', 'ch11Section_5_91', 'ch11Section_5_92', 'ch11Section_5_93', 'ch11Section_5_94', 'ch11Section_5_95', 'ch11Section_5_96', 'ch11Section_5_97', 'ch11Section_5_98', 'ch11Section_5_99', 'ch11Section_5_9a', 'ch11Section_5_9b', 'ch11Section_5_9c', 'ch11Section_5_9d', 'ch11Section_5_9e', 'ch11Section_5_9f', 'ch11Section_5_a0', 'ch11Section_5_a1', 'ch11Section_5_a2', 'ch11Section_5_a3', 'ch11Section_5_a4', 'ch11Section_5_a5', 'ch11Section_5_a6', 'ch11Section_5_a7', 'ch11Section_5_a8', 'ch11Section_5_a9', 'ch11Section_5_aa', 'ch11Section_5_ab', 'ch11Section_5_ac', 'ch11Section_5_ad', 'ch11Section_5_ae', 'ch11Section_5_af', 'ch11Section_5_b0', 'ch11Section_5_b1', 'ch11Section_5_b2', 'ch11Section_5_b3', 'ch11Section_5_b4', 'ch11Section_5_b5', 'ch11Section_5_b6', 'ch11Section_5_b7', 'ch11Section_5_b8', 'ch11Section_5_b9', 'ch11Section_5_ba', 'ch11Section_5_bb', 'ch11Section_5_bc', 'ch11Section_5_bd', 'ch11Section_5_be', 'ch11Section_5_bf', 'ch11Section_5_c0', 'ch11Section_5_c1', 'ch11Section_5_c2', 'ch11Section_5_c3', 'ch11Section_5_c4', 'ch11Section_5_c5', 'ch11Section_5_c6', 'ch11Section_5_c7', 'ch11Section_5_c8', 'ch11Section_5_c9', 'ch11Section_5_ca', 'ch11Section_5_cb', 'ch11Section_5_cc', 'ch11Section_5_cd', 'ch11Section_5_ce', 'ch11Section_5_cf', 'ch11Section_5_d0', 'ch11Section_5_d1', 'ch11Section_5_d2', 'ch11Section_5_d3', 'ch11Section_5_d4', 'ch11Section_5_d5', 'ch11Section_5_d6', 'ch11Section_5_d7', 'ch11Section_5_d8', 'ch11Section_5_d9', 'ch11Section_5_da', 'ch11Section_5_db', 'ch11Section_5_dc', 'ch11Section_5_dd', 'ch11Section_5_de', 'ch11Section_5_df', 'ch11Section_5_e0', 'ch11Section_5_e1', 'ch11Section_5_e2', 'ch11Section_5_e3', 'ch11Section_5_e4', 'ch11Section_5_e5', 'ch11Section_5_e6', 'ch11Section_5_e7', 'ch11Section_5_e8', 'ch11Section_5_e9', 'ch11Section_5_ea', 'ch11Section_5_eb', 'ch11Section_5_ec', 'ch11Section_5_ed', 'ch11Section_5_ee', 'ch11Section_5_ef', 'ch11Section_5_f0', 'ch11Section_5_f1', 'ch11Section_5_f2', 'ch11Section_5_f3', 'ch11Section_5_f4', 'ch11Section_5_f5', 'ch11Section_5_f6', 'ch11Section_5_f7', 'ch11Section_5_f8', 'ch11Section_5_f9', 'ch11Section_5_fa', 'ch11Section_5_fb', 'ch11Section_5_fc', 'ch11Section_5_fd', 'ch11Section_5_fe', 'ch11Section_5_ff', 'ch11Section_5_100', 'ch11Section_5_101', 'ch11Section_5_102', 'ch11Section_5_103', 'ch11Section_5_104', 'ch11Section_5_105', 'ch11Section_5_106', 'ch11Section_5_107', 'ch11Section_5_108', 'ch11Section_5_109', 'ch11Section_5_10a', 'ch11Section_5_10b', 'ch11Section_5_10c', 'ch11Section_5_10d', 'ch11Section_5_10e', 'ch11Section_5_10f', 'ch11Section_5_110', 'ch11Section_5_111', 'ch11Section_5_112', 'ch11Section_5_113', 'ch11Section_5_114', 'ch11Section_5_115', 'ch11Section_5_116', 'ch11Section_5_117', 'ch11Section_5_118', 'ch11Section_5_119', 'ch11Section_5_11a', 'ch11Section_5_11b', 'ch11Section_5_11c', 'ch11Section_5_11d', 'ch11Section_5_11e', 'ch11Section_5_11f', 'ch11Section_5_120', 'ch11Section_5_121', 'ch11Section_5_122', 'ch11Section_5_123', 'ch11Section_5_124', 'ch11Section_5_125', 'ch11Section_5_126', 'ch11Section_5_127', 'ch11Section_5_128', 'ch11Section_5_129', 'ch11Section_5_12a', 'ch11Section_5_12b', 'ch11Section_5_12c', 'ch11Section_5_12d', 'ch11Section_5_12e', 'ch11Section_5_12f', 'ch11Section_5_130', 'ch11Section_5_131', 'ch11Section_5_132', 'ch11Section_5_133', 'ch11Section_5_134', 'ch11Section_5_135', 'ch11Section_5_136', 'ch11Section_5_137', 'ch11Section_5_138', 'ch11Section_5_139', 'ch11Section_5_13a', 'ch11Section_5_13b', 'ch11Section_5_13c', 'ch11Section_5_13d', 'ch11Section_5_13e', 'ch11Section_5_13f', 'ch11Section_5_140', 'ch11Section_5_141', 'ch11Section_5_142', 'ch11Section_5_143', 'ch11Section_5_144', 'ch11Section_5_145', 'ch11Section_5_146', 'ch11Section_5_147', 'ch11Section_5_148', 'ch11Section_5_149', 'ch11Section_5_14a', 'ch11Section_5_14b', 'ch11Section_5_14c', 'ch11Section_5_14d', 'ch11Section_5_14e', 'ch11Section_5_14f', 'ch11Section_5_150', 'ch11Section_5_151', 'ch11Section_5_152', 'ch11Section_5_153', 'ch11Section_5_154', 'ch11Section_5_155', 'ch11Section_5_156', 'ch11Section_5_157', 'ch11Section_5_158', 'ch11Section_5_159', 'ch11Section_5_15a', 'ch11Section_5_15b', 'ch11Section_5_15c', 'ch11Section_5_15d', 'ch11Section_5_15e', 'ch11Section_5_15f', 'ch11Section_5_160', 'ch11Section_5_161', 'ch11Section_5_162', 'ch11Section_5_163', 'ch11Section_5_164', 'ch11Section_5_165', 'ch11Section_5_166', 'ch11Section_5_167', 'ch11Section_5_168', 'ch11Section_5_169', 'ch11Section_5_16a', 'ch11Section_5_16b', 'ch11Section_5_16c', 'ch11Section_5_16d', 'ch11Section_5_16e', 'ch11Section_5_16f', 'ch11Section_5_170', 'ch11Section_5_171', 'ch11Section_5_172', 'ch11Section_5_173', 'ch11Section_5_174', 'ch11Section_5_175', 'ch11Section_5_176', 'ch11Section_5_177', 'ch11Section_5_178', 'ch11Section_5_179', 'ch11Section_5_17a', 'ch11Section_5_17b', 'ch11Section_5_17c', 'ch11Section_5_17d', 'ch11Section_5_17e', 'ch11Section_5_17f', 'ch11Section_5_180', 'ch11Section_5_181', 'ch11Section_5_182', 'ch11Section_5_183', 'ch11Section_5_184', 'ch11Section_5_185', 'ch11Section_5_186', 'ch11Section_5_187', 'ch11Section_5_188', 'ch11Section_5_189', 'ch11Section_5_18a', 'ch11Section_5_18b', 'ch11Section_5_18c', 'ch11Section_5_18d', 'ch11Section_5_18e', 'ch11Section_5_18f', 'ch11Section_5_190', 'ch11Section_5_191', 'ch11Section_5_192', 'ch11Section_5_193', 'ch11Section_5_194', 'ch11Section_5_195', 'ch11Section_5_196', 'ch11Section_5_197', 'ch11Section_5_198', 'ch11Section_5_199', 'ch11Section_5_19a', 'ch11Section_5_19b', 'ch11Section_5_19c', 'ch11Section_5_19d', 'ch11Section_5_19e', 'ch11Section_5_19f', 'ch11Section_5_1a0', 'ch11Section_5_1a1', 'ch11Section_5_1a2', 'ch11Section_5_1a3', 'ch11Section_5_1a4', 'ch11Section_5_1a5', 'ch11Section_5_1a6', 'ch11Section_5_1a7', 'ch11Section_5_1a8', 'ch11Section_5_1a9', 'ch11Section_5_1aa', 'ch11Section_5_1ab', 'ch11Section_5_1ac', 'ch11Section_5_1ad', 'ch11Section_5_1ae', 'ch11Section_5_1af', 'ch11Section_5_1b0', 'ch11Section_5_1b1', 'ch11Section_5_1b2', 'ch11Section_5_1b3', 'ch11Section_5_1b4', 'ch11Section_5_1b5', 'ch11Section_5_1b6', 'ch11Section_5_1b7', 'ch11Section_5_1b8', 'ch11Section_5_1b9', 'ch11Section_5_1ba', 'ch11Section_5_1bb', 'ch11Section_5_1bc', 'ch11Section_5_1bd', 'ch11Section_5_1be', 'ch11Section_5_1bf', 'ch11Section_5_1c0', 'ch11Section_5_1c1', 'ch11Section_5_1c2', 'ch11Section_5_1c3', 'ch11Section_5_1c4', 'ch11Section_5_1c5', 'ch11Section_5_1c6', 'ch11Section_5_1c7', 'ch11Section_5_1c8', 'ch11Section_5_1c9', 'ch11Section_5_1ca', 'ch11Section_5_1cb', 'ch11Section_5_1cc', 'ch11Section_5_1cd', 'ch11Section_5_1ce', 'ch11Section_5_1cf', 'ch11Section_5_1d0', 'ch11Section_5_1d1', 'ch11Section_5_1d2', 'ch11Section_5_1d3', 'ch11Section_5_1d4', 'ch11Section_5_1d5', 'ch11Section_5_1d6', 'ch11Section_5_1d7', 'ch11Section_5_1d8', 'ch11Section_5_1d9', 'ch11Section_5_1da', 'ch11Section_5_1db', 'ch11Section_5_1dc', 'ch11Section_5_1dd', 'ch11Section_5_1de', 'ch11Section_5_1df', 'ch11Section_5_1e0', 'ch11Section_5_1e1'], 'ch7interim_assessment': ['ch7interim_assessment_1', 'ch7interim_assessment_2', 'ch7interim_assessment_3', 'ch7interim_assessment_4', 'ch7interim_assessment_5', 'ch7interim_assessment_6', 'ch7interim_assessment_7', 'ch7interim_assessment_8', 'ch7interim_assessment_9', 'ch7interim_assessment_a', 'ch7interim_assessment_b', 'ch7interim_assessment_c', 'ch7interim_assessment_d', 'ch7interim_assessment_e', 'ch7interim_assessment_f', 'ch7interim_assessment_10', 'ch7interim_assessment_11', 'ch7interim_assessment_12', 'ch7interim_assessment_13', 'ch7interim_assessment_14', 'ch7interim_assessment_15', 'ch7interim_assessment_16', 'ch7interim_assessment_17', 'ch7interim_assessment_18', 'ch7interim_assessment_19', 'ch7interim_assessment_1a', 'ch7interim_assessment_1b', 'ch7interim_assessment_1c', 'ch7interim_assessment_1d', 'ch7interim_assessment_1e', 'ch7interim_assessment_1f', 'ch7interim_assessment_20', 'ch7interim_assessment_21', 'ch7interim_assessment_22', 'ch7interim_assessment_23', 'ch7interim_assessment_24', 'ch7interim_assessment_25', 'ch7interim_assessment_26', 'ch7interim_assessment_27', 'ch7interim_assessment_28', 'ch7interim_assessment_29', 'ch7interim_assessment_2a', 'ch7interim_assessment_2b', 'ch7interim_assessment_2c', 'ch7interim_assessment_2d', 'ch7interim_assessment_2e', 'ch7interim_assessment_2f', 'ch7interim_assessment_30', 'ch7interim_assessment_31', 'ch7interim_assessment_32', 'ch7interim_assessment_33', 'ch7interim_assessment_34', 'ch7interim_assessment_35', 'ch7interim_assessment_36', 'ch7interim_assessment_37', 'ch7interim_assessment_38', 'ch7interim_assessment_39', 'ch7interim_assessment_3a', 'ch7interim_assessment_3b', 'ch7interim_assessment_3c', 'ch7interim_assessment_3d', 'ch7interim_assessment_3e', 'ch7interim_assessment_3f', 'ch7interim_assessment_40', 'ch7interim_assessment_41', 'ch7interim_assessment_42', 'ch7interim_assessment_43', 'ch7interim_assessment_44', 'ch7interim_assessment_45', 'ch7interim_assessment_46', 'ch7interim_assessment_47', 'ch7interim_assessment_48', 'ch7interim_assessment_49', 'ch7interim_assessment_4a', 'ch7interim_assessment_4b', 'ch7interim_assessment_4c', 'ch7interim_assessment_4d', 'ch7interim_assessment_4e', 'ch7interim_assessment_4f', 'ch7interim_assessment_50', 'ch7interim_assessment_51', 'ch7interim_assessment_52', 'ch7interim_assessment_53', 'ch7interim_assessment_54', 'ch7interim_assessment_55', 'ch7interim_assessment_56', 'ch7interim_assessment_57', 'ch7interim_assessment_58', 'ch7interim_assessment_59', 'ch7interim_assessment_5a', 'ch7interim_assessment_5b', 'ch7interim_assessment_5c', 'ch7interim_assessment_5d', 'ch7interim_assessment_5e', 'ch7interim_assessment_5f', 'ch7interim_assessment_60', 'ch7interim_assessment_61', 'ch7interim_assessment_62', 'ch7interim_assessment_63', 'ch7interim_assessment_64', 'ch7interim_assessment_65', 'ch7interim_assessment_66', 'ch7interim_assessment_67', 'ch7interim_assessment_68', 'ch7interim_assessment_69', 'ch7interim_assessment_6a', 'ch7interim_assessment_6b', 'ch7interim_assessment_6c', 'ch7interim_assessment_6d', 'ch7interim_assessment_6e', 'ch7interim_assessment_6f', 'ch7interim_assessment_70', 'ch7interim_assessment_71', 'ch7interim_assessment_72', 'ch7interim_assessment_73', 'ch7interim_assessment_74', 'ch7interim_assessment_75', 'ch7interim_assessment_76', 'ch7interim_assessment_77', 'ch7interim_assessment_78', 'ch7interim_assessment_79', 'ch7interim_assessment_7a', 'ch7interim_assessment_7b', 'ch7interim_assessment_7c', 'ch7interim_assessment_7d', 'ch7interim_assessment_7e', 'ch7interim_assessment_7f', 'ch7interim_assessment_80', 'ch7interim_assessment_81', 'ch7interim_assessment_82', 'ch7interim_assessment_83', 'ch7interim_assessment_84', 'ch7interim_assessment_85', 'ch7interim_assessment_86', 'ch7interim_assessment_87', 'ch7interim_assessment_88', 'ch7interim_assessment_89', 'ch7interim_assessment_8a', 'ch7interim_assessment_8b', 'ch7interim_assessment_8c', 'ch7interim_assessment_8d', 'ch7interim_assessment_8e', 'ch7interim_assessment_8f', 'ch7interim_assessment_90', 'ch7interim_assessment_91', 'ch7interim_assessment_92', 'ch7interim_assessment_93', 'ch7interim_assessment_94', 'ch7interim_assessment_95', 'ch7interim_assessment_96', 'ch7interim_assessment_97', 'ch7interim_assessment_98', 'ch7interim_assessment_99', 'ch7interim_assessment_9a', 'ch7interim_assessment_9b', 'ch7interim_assessment_9c', 'ch7interim_assessment_9d', 'ch7interim_assessment_9e', 'ch7interim_assessment_9f', 'ch7interim_assessment_a0', 'ch7interim_assessment_a1', 'ch7interim_assessment_a2', 'ch7interim_assessment_a3', 'ch7interim_assessment_a4', 'ch7interim_assessment_a5', 'ch7interim_assessment_a6', 'ch7interim_assessment_a7', 'ch7interim_assessment_a8', 'ch7interim_assessment_a9', 'ch7interim_assessment_aa', 'ch7interim_assessment_ab', 'ch7interim_assessment_ac', 'ch7interim_assessment_ad', 'ch7interim_assessment_ae', 'ch7interim_assessment_af', 'ch7interim_assessment_b0', 'ch7interim_assessment_b1', 'ch7interim_assessment_b2', 'ch7interim_assessment_b3', 'ch7interim_assessment_b4', 'ch7interim_assessment_b5', 'ch7interim_assessment_b6', 'ch7interim_assessment_b7', 'ch7interim_assessment_b8', 'ch7interim_assessment_b9', 'ch7interim_assessment_ba', 'ch7interim_assessment_bb', 'ch7interim_assessment_bc', 'ch7interim_assessment_bd', 'ch7interim_assessment_be', 'ch7interim_assessment_bf', 'ch7interim_assessment_c0', 'ch7interim_assessment_c1', 'ch7interim_assessment_c2', 'ch7interim_assessment_c3', 'ch7interim_assessment_c4', 'ch7interim_assessment_c5', 'ch7interim_assessment_c6', 'ch7interim_assessment_c7', 'ch7interim_assessment_c8', 'ch7interim_assessment_c9', 'ch7interim_assessment_ca', 'ch7interim_assessment_cb', 'ch7interim_assessment_cc', 'ch7interim_assessment_cd', 'ch7interim_assessment_ce', 'ch7interim_assessment_cf', 'ch7interim_assessment_d0', 'ch7interim_assessment_d1', 'ch7interim_assessment_d2', 'ch7interim_assessment_d3', 'ch7interim_assessment_d4', 'ch7interim_assessment_d5', 'ch7interim_assessment_d6', 'ch7interim_assessment_d7', 'ch7interim_assessment_d8', 'ch7interim_assessment_d9', 'ch7interim_assessment_da', 'ch7interim_assessment_db', 'ch7interim_assessment_dc', 'ch7interim_assessment_dd', 'ch7interim_assessment_de', 'ch7interim_assessment_df', 'ch7interim_assessment_e0', 'ch7interim_assessment_e1', 'ch7interim_assessment_e2', 'ch7interim_assessment_e3', 'ch7interim_assessment_e4', 'ch7interim_assessment_e5', 'ch7interim_assessment_e6', 'ch7interim_assessment_e7', 'ch7interim_assessment_e8', 'ch7interim_assessment_e9', 'ch7interim_assessment_ea', 'ch7interim_assessment_eb', 'ch7interim_assessment_ec', 'ch7interim_assessment_ed', 'ch7interim_assessment_ee', 'ch7interim_assessment_ef', 'ch7interim_assessment_f0', 'ch7interim_assessment_f1', 'ch7interim_assessment_f2', 'ch7interim_assessment_f3', 'ch7interim_assessment_f4', 'ch7interim_assessment_f5', 'ch7interim_assessment_f6', 'ch7interim_assessment_f7', 'ch7interim_assessment_f8', 'ch7interim_assessment_f9', 'ch7interim_assessment_fa', 'ch7interim_assessment_fb', 'ch7interim_assessment_fc', 'ch7interim_assessment_fd', 'ch7interim_assessment_fe', 'ch7interim_assessment_ff', 'ch7interim_assessment_100', 'ch7interim_assessment_101', 'ch7interim_assessment_102', 'ch7interim_assessment_103', 'ch7interim_assessment_104', 'ch7interim_assessment_105', 'ch7interim_assessment_106', 'ch7interim_assessment_107', 'ch7interim_assessment_108', 'ch7interim_assessment_109', 'ch7interim_assessment_10a', 'ch7interim_assessment_10b', 'ch7interim_assessment_10c', 'ch7interim_assessment_10d', 'ch7interim_assessment_10e', 'ch7interim_assessment_10f', 'ch7interim_assessment_110', 'ch7interim_assessment_111', 'ch7interim_assessment_112', 'ch7interim_assessment_113', 'ch7interim_assessment_114', 'ch7interim_assessment_115', 'ch7interim_assessment_116', 'ch7interim_assessment_117', 'ch7interim_assessment_118', 'ch7interim_assessment_119', 'ch7interim_assessment_11a', 'ch7interim_assessment_11b', 'ch7interim_assessment_11c', 'ch7interim_assessment_11d', 'ch7interim_assessment_11e', 'ch7interim_assessment_11f', 'ch7interim_assessment_120', 'ch7interim_assessment_121', 'ch7interim_assessment_122', 'ch7interim_assessment_123', 'ch7interim_assessment_124', 'ch7interim_assessment_125', 'ch7interim_assessment_126', 'ch7interim_assessment_127', 'ch7interim_assessment_128', 'ch7interim_assessment_129', 'ch7interim_assessment_12a', 'ch7interim_assessment_12b', 'ch7interim_assessment_12c', 'ch7interim_assessment_12d', 'ch7interim_assessment_12e', 'ch7interim_assessment_12f', 'ch7interim_assessment_130', 'ch7interim_assessment_131', 'ch7interim_assessment_132', 'ch7interim_assessment_133', 'ch7interim_assessment_134', 'ch7interim_assessment_135', 'ch7interim_assessment_136', 'ch7interim_assessment_137', 'ch7interim_assessment_138', 'ch7interim_assessment_139', 'ch7interim_assessment_13a', 'ch7interim_assessment_13b', 'ch7interim_assessment_13c', 'ch7interim_assessment_13d', 'ch7interim_assessment_13e', 'ch7interim_assessment_13f', 'ch7interim_assessment_140', 'ch7interim_assessment_141', 'ch7interim_assessment_142', 'ch7interim_assessment_143', 'ch7interim_assessment_144', 'ch7interim_assessment_145', 'ch7interim_assessment_146', 'ch7interim_assessment_147', 'ch7interim_assessment_148', 'ch7interim_assessment_149', 'ch7interim_assessment_14a', 'ch7interim_assessment_14b', 'ch7interim_assessment_14c', 'ch7interim_assessment_14d', 'ch7interim_assessment_14e', 'ch7interim_assessment_14f', 'ch7interim_assessment_150', 'ch7interim_assessment_151', 'ch7interim_assessment_152', 'ch7interim_assessment_153', 'ch7interim_assessment_154', 'ch7interim_assessment_155', 'ch7interim_assessment_156', 'ch7interim_assessment_157', 'ch7interim_assessment_158', 'ch7interim_assessment_159', 'ch7interim_assessment_15a', 'ch7interim_assessment_15b', 'ch7interim_assessment_15c', 'ch7interim_assessment_15d', 'ch7interim_assessment_15e', 'ch7interim_assessment_15f', 'ch7interim_assessment_160', 'ch7interim_assessment_161', 'ch7interim_assessment_162', 'ch7interim_assessment_163', 'ch7interim_assessment_164', 'ch7interim_assessment_165', 'ch7interim_assessment_166', 'ch7interim_assessment_167', 'ch7interim_assessment_168', 'ch7interim_assessment_169', 'ch7interim_assessment_16a', 'ch7interim_assessment_16b', 'ch7interim_assessment_16c', 'ch7interim_assessment_16d', 'ch7interim_assessment_16e', 'ch7interim_assessment_16f', 'ch7interim_assessment_170', 'ch7interim_assessment_171', 'ch7interim_assessment_172', 'ch7interim_assessment_173', 'ch7interim_assessment_174', 'ch7interim_assessment_175', 'ch7interim_assessment_176', 'ch7interim_assessment_177', 'ch7interim_assessment_178', 'ch7interim_assessment_179', 'ch7interim_assessment_17a', 'ch7interim_assessment_17b', 'ch7interim_assessment_17c', 'ch7interim_assessment_17d', 'ch7interim_assessment_17e', 'ch7interim_assessment_17f', 'ch7interim_assessment_180', 'ch7interim_assessment_181', 'ch7interim_assessment_182', 'ch7interim_assessment_183', 'ch7interim_assessment_184', 'ch7interim_assessment_185', 'ch7interim_assessment_186', 'ch7interim_assessment_187', 'ch7interim_assessment_188', 'ch7interim_assessment_189', 'ch7interim_assessment_18a', 'ch7interim_assessment_18b', 'ch7interim_assessment_18c', 'ch7interim_assessment_18d', 'ch7interim_assessment_18e', 'ch7interim_assessment_18f', 'ch7interim_assessment_190', 'ch7interim_assessment_191', 'ch7interim_assessment_192', 'ch7interim_assessment_193', 'ch7interim_assessment_194', 'ch7interim_assessment_195', 'ch7interim_assessment_196', 'ch7interim_assessment_197', 'ch7interim_assessment_198', 'ch7interim_assessment_199', 'ch7interim_assessment_19a', 'ch7interim_assessment_19b', 'ch7interim_assessment_19c', 'ch7interim_assessment_19d', 'ch7interim_assessment_19e', 'ch7interim_assessment_19f', 'ch7interim_assessment_1a0', 'ch7interim_assessment_1a1', 'ch7interim_assessment_1a2', 'ch7interim_assessment_1a3', 'ch7interim_assessment_1a4', 'ch7interim_assessment_1a5', 'ch7interim_assessment_1a6', 'ch7interim_assessment_1a7', 'ch7interim_assessment_1a8', 'ch7interim_assessment_1a9', 'ch7interim_assessment_1aa', 'ch7interim_assessment_1ab', 'ch7interim_assessment_1ac', 'ch7interim_assessment_1ad', 'ch7interim_assessment_1ae', 'ch7interim_assessment_1af', 'ch7interim_assessment_1b0', 'ch7interim_assessment_1b1', 'ch7interim_assessment_1b2', 'ch7interim_assessment_1b3', 'ch7interim_assessment_1b4', 'ch7interim_assessment_1b5', 'ch7interim_assessment_1b6', 'ch7interim_assessment_1b7', 'ch7interim_assessment_1b8', 'ch7interim_assessment_1b9', 'ch7interim_assessment_1ba', 'ch7interim_assessment_1bb', 'ch7interim_assessment_1bc', 'ch7interim_assessment_1bd', 'ch7interim_assessment_1be', 'ch7interim_assessment_1bf', 'ch7interim_assessment_1c0', 'ch7interim_assessment_1c1', 'ch7interim_assessment_1c2', 'ch7interim_assessment_1c3', 'ch7interim_assessment_1c4', 'ch7interim_assessment_1c5', 'ch7interim_assessment_1c6', 'ch7interim_assessment_1c7', 'ch7interim_assessment_1c8', 'ch7interim_assessment_1c9', 'ch7interim_assessment_1ca', 'ch7interim_assessment_1cb', 'ch7interim_assessment_1cc', 'ch7interim_assessment_1cd', 'ch7interim_assessment_1ce', 'ch7interim_assessment_1cf', 'ch7interim_assessment_1d0', 'ch7interim_assessment_1d1', 'ch7interim_assessment_1d2', 'ch7interim_assessment_1d3', 'ch7interim_assessment_1d4', 'ch7interim_assessment_1d5', 'ch7interim_assessment_1d6', 'ch7interim_assessment_1d7', 'ch7interim_assessment_1d8', 'ch7interim_assessment_1d9', 'ch7interim_assessment_1da', 'ch7interim_assessment_1db', 'ch7interim_assessment_1dc', 'ch7interim_assessment_1dd', 'ch7interim_assessment_1de', 'ch7interim_assessment_1df', 'ch7interim_assessment_1e0', 'ch7interim_assessment_1e1'], 'ch8ult_module_plan': ['ch8ult_module_plan_1', 'ch8ult_module_plan_2', 'ch8ult_module_plan_3', 'ch8ult_module_plan_4', 'ch8ult_module_plan_5', 'ch8ult_module_plan_6', 'ch8ult_module_plan_7', 'ch8ult_module_plan_8', 'ch8ult_module_plan_9', 'ch8ult_module_plan_a', 'ch8ult_module_plan_b', 'ch8ult_module_plan_c', 'ch8ult_module_plan_d', 'ch8ult_module_plan_e', 'ch8ult_module_plan_f', 'ch8ult_module_plan_10', 'ch8ult_module_plan_11', 'ch8ult_module_plan_12', 'ch8ult_module_plan_13', 'ch8ult_module_plan_14', 'ch8ult_module_plan_15', 'ch8ult_module_plan_16', 'ch8ult_module_plan_17', 'ch8ult_module_plan_18', 'ch8ult_module_plan_19', 'ch8ult_module_plan_1a', 'ch8ult_module_plan_1b', 'ch8ult_module_plan_1c', 'ch8ult_module_plan_1d', 'ch8ult_module_plan_1e', 'ch8ult_module_plan_1f', 'ch8ult_module_plan_20', 'ch8ult_module_plan_21', 'ch8ult_module_plan_22', 'ch8ult_module_plan_23', 'ch8ult_module_plan_24', 'ch8ult_module_plan_25', 'ch8ult_module_plan_26', 'ch8ult_module_plan_27', 'ch8ult_module_plan_28', 'ch8ult_module_plan_29', 'ch8ult_module_plan_2a', 'ch8ult_module_plan_2b', 'ch8ult_module_plan_2c', 'ch8ult_module_plan_2d', 'ch8ult_module_plan_2e', 'ch8ult_module_plan_2f', 'ch8ult_module_plan_30', 'ch8ult_module_plan_31', 'ch8ult_module_plan_32', 'ch8ult_module_plan_33', 'ch8ult_module_plan_34', 'ch8ult_module_plan_35', 'ch8ult_module_plan_36', 'ch8ult_module_plan_37', 'ch8ult_module_plan_38', 'ch8ult_module_plan_39', 'ch8ult_module_plan_3a', 'ch8ult_module_plan_3b', 'ch8ult_module_plan_3c', 'ch8ult_module_plan_3d', 'ch8ult_module_plan_3e', 'ch8ult_module_plan_3f', 'ch8ult_module_plan_40', 'ch8ult_module_plan_41', 'ch8ult_module_plan_42', 'ch8ult_module_plan_43', 'ch8ult_module_plan_44', 'ch8ult_module_plan_45', 'ch8ult_module_plan_46', 'ch8ult_module_plan_47', 'ch8ult_module_plan_48', 'ch8ult_module_plan_49', 'ch8ult_module_plan_4a', 'ch8ult_module_plan_4b', 'ch8ult_module_plan_4c', 'ch8ult_module_plan_4d', 'ch8ult_module_plan_4e', 'ch8ult_module_plan_4f', 'ch8ult_module_plan_50', 'ch8ult_module_plan_51', 'ch8ult_module_plan_52', 'ch8ult_module_plan_53', 'ch8ult_module_plan_54', 'ch8ult_module_plan_55', 'ch8ult_module_plan_56', 'ch8ult_module_plan_57', 'ch8ult_module_plan_58', 'ch8ult_module_plan_59', 'ch8ult_module_plan_5a', 'ch8ult_module_plan_5b', 'ch8ult_module_plan_5c', 'ch8ult_module_plan_5d', 'ch8ult_module_plan_5e', 'ch8ult_module_plan_5f', 'ch8ult_module_plan_60', 'ch8ult_module_plan_61', 'ch8ult_module_plan_62', 'ch8ult_module_plan_63', 'ch8ult_module_plan_64', 'ch8ult_module_plan_65', 'ch8ult_module_plan_66', 'ch8ult_module_plan_67', 'ch8ult_module_plan_68', 'ch8ult_module_plan_69', 'ch8ult_module_plan_6a', 'ch8ult_module_plan_6b', 'ch8ult_module_plan_6c', 'ch8ult_module_plan_6d', 'ch8ult_module_plan_6e', 'ch8ult_module_plan_6f', 'ch8ult_module_plan_70', 'ch8ult_module_plan_71', 'ch8ult_module_plan_72', 'ch8ult_module_plan_73', 'ch8ult_module_plan_74', 'ch8ult_module_plan_75', 'ch8ult_module_plan_76', 'ch8ult_module_plan_77', 'ch8ult_module_plan_78', 'ch8ult_module_plan_79', 'ch8ult_module_plan_7a', 'ch8ult_module_plan_7b', 'ch8ult_module_plan_7c', 'ch8ult_module_plan_7d', 'ch8ult_module_plan_7e', 'ch8ult_module_plan_7f', 'ch8ult_module_plan_80', 'ch8ult_module_plan_81', 'ch8ult_module_plan_82', 'ch8ult_module_plan_83', 'ch8ult_module_plan_84', 'ch8ult_module_plan_85', 'ch8ult_module_plan_86', 'ch8ult_module_plan_87', 'ch8ult_module_plan_88', 'ch8ult_module_plan_89', 'ch8ult_module_plan_8a', 'ch8ult_module_plan_8b', 'ch8ult_module_plan_8c', 'ch8ult_module_plan_8d', 'ch8ult_module_plan_8e', 'ch8ult_module_plan_8f', 'ch8ult_module_plan_90', 'ch8ult_module_plan_91', 'ch8ult_module_plan_92', 'ch8ult_module_plan_93', 'ch8ult_module_plan_94', 'ch8ult_module_plan_95', 'ch8ult_module_plan_96', 'ch8ult_module_plan_97', 'ch8ult_module_plan_98', 'ch8ult_module_plan_99', 'ch8ult_module_plan_9a', 'ch8ult_module_plan_9b', 'ch8ult_module_plan_9c', 'ch8ult_module_plan_9d', 'ch8ult_module_plan_9e', 'ch8ult_module_plan_9f', 'ch8ult_module_plan_a0', 'ch8ult_module_plan_a1', 'ch8ult_module_plan_a2', 'ch8ult_module_plan_a3', 'ch8ult_module_plan_a4', 'ch8ult_module_plan_a5', 'ch8ult_module_plan_a6', 'ch8ult_module_plan_a7', 'ch8ult_module_plan_a8', 'ch8ult_module_plan_a9', 'ch8ult_module_plan_aa', 'ch8ult_module_plan_ab', 'ch8ult_module_plan_ac', 'ch8ult_module_plan_ad', 'ch8ult_module_plan_ae', 'ch8ult_module_plan_af', 'ch8ult_module_plan_b0', 'ch8ult_module_plan_b1', 'ch8ult_module_plan_b2', 'ch8ult_module_plan_b3', 'ch8ult_module_plan_b4', 'ch8ult_module_plan_b5', 'ch8ult_module_plan_b6', 'ch8ult_module_plan_b7', 'ch8ult_module_plan_b8', 'ch8ult_module_plan_b9', 'ch8ult_module_plan_ba', 'ch8ult_module_plan_bb', 'ch8ult_module_plan_bc', 'ch8ult_module_plan_bd', 'ch8ult_module_plan_be', 'ch8ult_module_plan_bf', 'ch8ult_module_plan_c0', 'ch8ult_module_plan_c1', 'ch8ult_module_plan_c2', 'ch8ult_module_plan_c3', 'ch8ult_module_plan_c4', 'ch8ult_module_plan_c5', 'ch8ult_module_plan_c6', 'ch8ult_module_plan_c7', 'ch8ult_module_plan_c8', 'ch8ult_module_plan_c9', 'ch8ult_module_plan_ca', 'ch8ult_module_plan_cb', 'ch8ult_module_plan_cc', 'ch8ult_module_plan_cd', 'ch8ult_module_plan_ce', 'ch8ult_module_plan_cf', 'ch8ult_module_plan_d0', 'ch8ult_module_plan_d1', 'ch8ult_module_plan_d2', 'ch8ult_module_plan_d3', 'ch8ult_module_plan_d4', 'ch8ult_module_plan_d5', 'ch8ult_module_plan_d6', 'ch8ult_module_plan_d7', 'ch8ult_module_plan_d8', 'ch8ult_module_plan_d9', 'ch8ult_module_plan_da', 'ch8ult_module_plan_db', 'ch8ult_module_plan_dc', 'ch8ult_module_plan_dd', 'ch8ult_module_plan_de', 'ch8ult_module_plan_df', 'ch8ult_module_plan_e0', 'ch8ult_module_plan_e1', 'ch8ult_module_plan_e2', 'ch8ult_module_plan_e3', 'ch8ult_module_plan_e4', 'ch8ult_module_plan_e5', 'ch8ult_module_plan_e6', 'ch8ult_module_plan_e7', 'ch8ult_module_plan_e8', 'ch8ult_module_plan_e9', 'ch8ult_module_plan_ea', 'ch8ult_module_plan_eb', 'ch8ult_module_plan_ec', 'ch8ult_module_plan_ed', 'ch8ult_module_plan_ee', 'ch8ult_module_plan_ef', 'ch8ult_module_plan_f0', 'ch8ult_module_plan_f1', 'ch8ult_module_plan_f2', 'ch8ult_module_plan_f3', 'ch8ult_module_plan_f4', 'ch8ult_module_plan_f5', 'ch8ult_module_plan_f6', 'ch8ult_module_plan_f7', 'ch8ult_module_plan_f8', 'ch8ult_module_plan_f9', 'ch8ult_module_plan_fa', 'ch8ult_module_plan_fb', 'ch8ult_module_plan_fc', 'ch8ult_module_plan_fd', 'ch8ult_module_plan_fe', 'ch8ult_module_plan_ff', 'ch8ult_module_plan_100', 'ch8ult_module_plan_101', 'ch8ult_module_plan_102', 'ch8ult_module_plan_103', 'ch8ult_module_plan_104', 'ch8ult_module_plan_105', 'ch8ult_module_plan_106', 'ch8ult_module_plan_107', 'ch8ult_module_plan_108', 'ch8ult_module_plan_109', 'ch8ult_module_plan_10a', 'ch8ult_module_plan_10b', 'ch8ult_module_plan_10c', 'ch8ult_module_plan_10d', 'ch8ult_module_plan_10e', 'ch8ult_module_plan_10f', 'ch8ult_module_plan_110', 'ch8ult_module_plan_111', 'ch8ult_module_plan_112', 'ch8ult_module_plan_113', 'ch8ult_module_plan_114', 'ch8ult_module_plan_115', 'ch8ult_module_plan_116', 'ch8ult_module_plan_117', 'ch8ult_module_plan_118', 'ch8ult_module_plan_119', 'ch8ult_module_plan_11a', 'ch8ult_module_plan_11b', 'ch8ult_module_plan_11c', 'ch8ult_module_plan_11d', 'ch8ult_module_plan_11e', 'ch8ult_module_plan_11f', 'ch8ult_module_plan_120', 'ch8ult_module_plan_121', 'ch8ult_module_plan_122', 'ch8ult_module_plan_123', 'ch8ult_module_plan_124', 'ch8ult_module_plan_125', 'ch8ult_module_plan_126', 'ch8ult_module_plan_127', 'ch8ult_module_plan_128', 'ch8ult_module_plan_129', 'ch8ult_module_plan_12a', 'ch8ult_module_plan_12b', 'ch8ult_module_plan_12c', 'ch8ult_module_plan_12d', 'ch8ult_module_plan_12e', 'ch8ult_module_plan_12f', 'ch8ult_module_plan_130', 'ch8ult_module_plan_131', 'ch8ult_module_plan_132', 'ch8ult_module_plan_133', 'ch8ult_module_plan_134', 'ch8ult_module_plan_135', 'ch8ult_module_plan_136', 'ch8ult_module_plan_137', 'ch8ult_module_plan_138', 'ch8ult_module_plan_139', 'ch8ult_module_plan_13a', 'ch8ult_module_plan_13b', 'ch8ult_module_plan_13c', 'ch8ult_module_plan_13d', 'ch8ult_module_plan_13e', 'ch8ult_module_plan_13f', 'ch8ult_module_plan_140', 'ch8ult_module_plan_141', 'ch8ult_module_plan_142', 'ch8ult_module_plan_143', 'ch8ult_module_plan_144', 'ch8ult_module_plan_145', 'ch8ult_module_plan_146', 'ch8ult_module_plan_147', 'ch8ult_module_plan_148', 'ch8ult_module_plan_149', 'ch8ult_module_plan_14a', 'ch8ult_module_plan_14b', 'ch8ult_module_plan_14c', 'ch8ult_module_plan_14d', 'ch8ult_module_plan_14e', 'ch8ult_module_plan_14f', 'ch8ult_module_plan_150', 'ch8ult_module_plan_151', 'ch8ult_module_plan_152', 'ch8ult_module_plan_153', 'ch8ult_module_plan_154', 'ch8ult_module_plan_155', 'ch8ult_module_plan_156', 'ch8ult_module_plan_157', 'ch8ult_module_plan_158', 'ch8ult_module_plan_159', 'ch8ult_module_plan_15a', 'ch8ult_module_plan_15b', 'ch8ult_module_plan_15c', 'ch8ult_module_plan_15d', 'ch8ult_module_plan_15e', 'ch8ult_module_plan_15f', 'ch8ult_module_plan_160', 'ch8ult_module_plan_161', 'ch8ult_module_plan_162', 'ch8ult_module_plan_163', 'ch8ult_module_plan_164', 'ch8ult_module_plan_165', 'ch8ult_module_plan_166', 'ch8ult_module_plan_167', 'ch8ult_module_plan_168', 'ch8ult_module_plan_169', 'ch8ult_module_plan_16a', 'ch8ult_module_plan_16b', 'ch8ult_module_plan_16c', 'ch8ult_module_plan_16d', 'ch8ult_module_plan_16e', 'ch8ult_module_plan_16f', 'ch8ult_module_plan_170', 'ch8ult_module_plan_171', 'ch8ult_module_plan_172', 'ch8ult_module_plan_173', 'ch8ult_module_plan_174', 'ch8ult_module_plan_175', 'ch8ult_module_plan_176', 'ch8ult_module_plan_177', 'ch8ult_module_plan_178', 'ch8ult_module_plan_179', 'ch8ult_module_plan_17a', 'ch8ult_module_plan_17b', 'ch8ult_module_plan_17c', 'ch8ult_module_plan_17d', 'ch8ult_module_plan_17e', 'ch8ult_module_plan_17f', 'ch8ult_module_plan_180', 'ch8ult_module_plan_181', 'ch8ult_module_plan_182', 'ch8ult_module_plan_183', 'ch8ult_module_plan_184', 'ch8ult_module_plan_185', 'ch8ult_module_plan_186', 'ch8ult_module_plan_187', 'ch8ult_module_plan_188', 'ch8ult_module_plan_189', 'ch8ult_module_plan_18a', 'ch8ult_module_plan_18b', 'ch8ult_module_plan_18c', 'ch8ult_module_plan_18d', 'ch8ult_module_plan_18e', 'ch8ult_module_plan_18f', 'ch8ult_module_plan_190', 'ch8ult_module_plan_191', 'ch8ult_module_plan_192', 'ch8ult_module_plan_193', 'ch8ult_module_plan_194', 'ch8ult_module_plan_195', 'ch8ult_module_plan_196', 'ch8ult_module_plan_197', 'ch8ult_module_plan_198', 'ch8ult_module_plan_199', 'ch8ult_module_plan_19a', 'ch8ult_module_plan_19b', 'ch8ult_module_plan_19c', 'ch8ult_module_plan_19d', 'ch8ult_module_plan_19e', 'ch8ult_module_plan_19f', 'ch8ult_module_plan_1a0', 'ch8ult_module_plan_1a1', 'ch8ult_module_plan_1a2', 'ch8ult_module_plan_1a3', 'ch8ult_module_plan_1a4', 'ch8ult_module_plan_1a5', 'ch8ult_module_plan_1a6', 'ch8ult_module_plan_1a7', 'ch8ult_module_plan_1a8', 'ch8ult_module_plan_1a9', 'ch8ult_module_plan_1aa', 'ch8ult_module_plan_1ab', 'ch8ult_module_plan_1ac', 'ch8ult_module_plan_1ad', 'ch8ult_module_plan_1ae', 'ch8ult_module_plan_1af', 'ch8ult_module_plan_1b0', 'ch8ult_module_plan_1b1', 'ch8ult_module_plan_1b2', 'ch8ult_module_plan_1b3', 'ch8ult_module_plan_1b4', 'ch8ult_module_plan_1b5', 'ch8ult_module_plan_1b6', 'ch8ult_module_plan_1b7', 'ch8ult_module_plan_1b8', 'ch8ult_module_plan_1b9', 'ch8ult_module_plan_1ba', 'ch8ult_module_plan_1bb', 'ch8ult_module_plan_1bc', 'ch8ult_module_plan_1bd', 'ch8ult_module_plan_1be', 'ch8ult_module_plan_1bf', 'ch8ult_module_plan_1c0', 'ch8ult_module_plan_1c1', 'ch8ult_module_plan_1c2', 'ch8ult_module_plan_1c3', 'ch8ult_module_plan_1c4', 'ch8ult_module_plan_1c5', 'ch8ult_module_plan_1c6', 'ch8ult_module_plan_1c7', 'ch8ult_module_plan_1c8', 'ch8ult_module_plan_1c9', 'ch8ult_module_plan_1ca', 'ch8ult_module_plan_1cb', 'ch8ult_module_plan_1cc', 'ch8ult_module_plan_1cd', 'ch8ult_module_plan_1ce', 'ch8ult_module_plan_1cf', 'ch8ult_module_plan_1d0', 'ch8ult_module_plan_1d1', 'ch8ult_module_plan_1d2', 'ch8ult_module_plan_1d3', 'ch8ult_module_plan_1d4', 'ch8ult_module_plan_1d5', 'ch8ult_module_plan_1d6', 'ch8ult_module_plan_1d7', 'ch8ult_module_plan_1d8', 'ch8ult_module_plan_1d9', 'ch8ult_module_plan_1da', 'ch8ult_module_plan_1db', 'ch8ult_module_plan_1dc', 'ch8ult_module_plan_1dd', 'ch8ult_module_plan_1de', 'ch8ult_module_plan_1df', 'ch8ult_module_plan_1e0', 'ch8ult_module_plan_1e1'], 'ch10session4': ['ch10session4_1', 'ch10session4_2', 'ch10session4_3', 'ch10session4_4', 'ch10session4_5', 'ch10session4_6', 'ch10session4_7', 'ch10session4_8', 'ch10session4_9', 'ch10session4_a', 'ch10session4_b', 'ch10session4_c', 'ch10session4_d', 'ch10session4_e', 'ch10session4_f', 'ch10session4_10', 'ch10session4_11', 'ch10session4_12', 'ch10session4_13', 'ch10session4_14', 'ch10session4_15', 'ch10session4_16', 'ch10session4_17', 'ch10session4_18', 'ch10session4_19', 'ch10session4_1a', 'ch10session4_1b', 'ch10session4_1c', 'ch10session4_1d', 'ch10session4_1e', 'ch10session4_1f', 'ch10session4_20', 'ch10session4_21', 'ch10session4_22', 'ch10session4_23', 'ch10session4_24', 'ch10session4_25', 'ch10session4_26', 'ch10session4_27', 'ch10session4_28', 'ch10session4_29', 'ch10session4_2a', 'ch10session4_2b', 'ch10session4_2c', 'ch10session4_2d', 'ch10session4_2e', 'ch10session4_2f', 'ch10session4_30', 'ch10session4_31', 'ch10session4_32', 'ch10session4_33', 'ch10session4_34', 'ch10session4_35', 'ch10session4_36', 'ch10session4_37', 'ch10session4_38', 'ch10session4_39', 'ch10session4_3a', 'ch10session4_3b', 'ch10session4_3c', 'ch10session4_3d', 'ch10session4_3e', 'ch10session4_3f', 'ch10session4_40', 'ch10session4_41', 'ch10session4_42', 'ch10session4_43', 'ch10session4_44', 'ch10session4_45', 'ch10session4_46', 'ch10session4_47', 'ch10session4_48', 'ch10session4_49', 'ch10session4_4a', 'ch10session4_4b', 'ch10session4_4c', 'ch10session4_4d', 'ch10session4_4e', 'ch10session4_4f', 'ch10session4_50', 'ch10session4_51', 'ch10session4_52', 'ch10session4_53', 'ch10session4_54', 'ch10session4_55', 'ch10session4_56', 'ch10session4_57', 'ch10session4_58', 'ch10session4_59', 'ch10session4_5a', 'ch10session4_5b', 'ch10session4_5c', 'ch10session4_5d', 'ch10session4_5e', 'ch10session4_5f', 'ch10session4_60', 'ch10session4_61', 'ch10session4_62', 'ch10session4_63', 'ch10session4_64', 'ch10session4_65', 'ch10session4_66', 'ch10session4_67', 'ch10session4_68', 'ch10session4_69', 'ch10session4_6a', 'ch10session4_6b', 'ch10session4_6c', 'ch10session4_6d', 'ch10session4_6e', 'ch10session4_6f', 'ch10session4_70', 'ch10session4_71', 'ch10session4_72', 'ch10session4_73', 'ch10session4_74', 'ch10session4_75', 'ch10session4_76', 'ch10session4_77', 'ch10session4_78', 'ch10session4_79', 'ch10session4_7a', 'ch10session4_7b', 'ch10session4_7c', 'ch10session4_7d', 'ch10session4_7e', 'ch10session4_7f', 'ch10session4_80', 'ch10session4_81', 'ch10session4_82', 'ch10session4_83', 'ch10session4_84', 'ch10session4_85', 'ch10session4_86', 'ch10session4_87', 'ch10session4_88', 'ch10session4_89', 'ch10session4_8a', 'ch10session4_8b', 'ch10session4_8c', 'ch10session4_8d', 'ch10session4_8e', 'ch10session4_8f', 'ch10session4_90', 'ch10session4_91', 'ch10session4_92', 'ch10session4_93', 'ch10session4_94', 'ch10session4_95', 'ch10session4_96', 'ch10session4_97', 'ch10session4_98', 'ch10session4_99', 'ch10session4_9a', 'ch10session4_9b', 'ch10session4_9c', 'ch10session4_9d', 'ch10session4_9e', 'ch10session4_9f', 'ch10session4_a0', 'ch10session4_a1', 'ch10session4_a2', 'ch10session4_a3', 'ch10session4_a4', 'ch10session4_a5', 'ch10session4_a6', 'ch10session4_a7', 'ch10session4_a8', 'ch10session4_a9', 'ch10session4_aa', 'ch10session4_ab', 'ch10session4_ac', 'ch10session4_ad', 'ch10session4_ae', 'ch10session4_af', 'ch10session4_b0', 'ch10session4_b1', 'ch10session4_b2', 'ch10session4_b3', 'ch10session4_b4', 'ch10session4_b5', 'ch10session4_b6', 'ch10session4_b7', 'ch10session4_b8', 'ch10session4_b9', 'ch10session4_ba', 'ch10session4_bb', 'ch10session4_bc', 'ch10session4_bd', 'ch10session4_be', 'ch10session4_bf', 'ch10session4_c0', 'ch10session4_c1', 'ch10session4_c2', 'ch10session4_c3', 'ch10session4_c4', 'ch10session4_c5', 'ch10session4_c6', 'ch10session4_c7', 'ch10session4_c8', 'ch10session4_c9', 'ch10session4_ca', 'ch10session4_cb', 'ch10session4_cc', 'ch10session4_cd', 'ch10session4_ce', 'ch10session4_cf', 'ch10session4_d0', 'ch10session4_d1', 'ch10session4_d2', 'ch10session4_d3', 'ch10session4_d4', 'ch10session4_d5', 'ch10session4_d6', 'ch10session4_d7', 'ch10session4_d8', 'ch10session4_d9', 'ch10session4_da', 'ch10session4_db', 'ch10session4_dc', 'ch10session4_dd', 'ch10session4_de', 'ch10session4_df', 'ch10session4_e0', 'ch10session4_e1', 'ch10session4_e2', 'ch10session4_e3', 'ch10session4_e4', 'ch10session4_e5', 'ch10session4_e6', 'ch10session4_e7', 'ch10session4_e8', 'ch10session4_e9', 'ch10session4_ea', 'ch10session4_eb', 'ch10session4_ec', 'ch10session4_ed', 'ch10session4_ee', 'ch10session4_ef', 'ch10session4_f0', 'ch10session4_f1', 'ch10session4_f2', 'ch10session4_f3', 'ch10session4_f4', 'ch10session4_f5', 'ch10session4_f6', 'ch10session4_f7', 'ch10session4_f8', 'ch10session4_f9', 'ch10session4_fa', 'ch10session4_fb', 'ch10session4_fc', 'ch10session4_fd', 'ch10session4_fe', 'ch10session4_ff', 'ch10session4_100', 'ch10session4_101', 'ch10session4_102', 'ch10session4_103', 'ch10session4_104', 'ch10session4_105', 'ch10session4_106', 'ch10session4_107', 'ch10session4_108', 'ch10session4_109', 'ch10session4_10a', 'ch10session4_10b', 'ch10session4_10c', 'ch10session4_10d', 'ch10session4_10e', 'ch10session4_10f', 'ch10session4_110', 'ch10session4_111', 'ch10session4_112', 'ch10session4_113', 'ch10session4_114', 'ch10session4_115', 'ch10session4_116', 'ch10session4_117', 'ch10session4_118', 'ch10session4_119', 'ch10session4_11a', 'ch10session4_11b', 'ch10session4_11c', 'ch10session4_11d', 'ch10session4_11e', 'ch10session4_11f', 'ch10session4_120', 'ch10session4_121', 'ch10session4_122', 'ch10session4_123', 'ch10session4_124', 'ch10session4_125', 'ch10session4_126', 'ch10session4_127', 'ch10session4_128', 'ch10session4_129', 'ch10session4_12a', 'ch10session4_12b', 'ch10session4_12c', 'ch10session4_12d', 'ch10session4_12e', 'ch10session4_12f', 'ch10session4_130', 'ch10session4_131', 'ch10session4_132', 'ch10session4_133', 'ch10session4_134', 'ch10session4_135', 'ch10session4_136', 'ch10session4_137', 'ch10session4_138', 'ch10session4_139', 'ch10session4_13a', 'ch10session4_13b', 'ch10session4_13c', 'ch10session4_13d', 'ch10session4_13e', 'ch10session4_13f', 'ch10session4_140', 'ch10session4_141', 'ch10session4_142', 'ch10session4_143', 'ch10session4_144', 'ch10session4_145', 'ch10session4_146', 'ch10session4_147', 'ch10session4_148', 'ch10session4_149', 'ch10session4_14a', 'ch10session4_14b', 'ch10session4_14c', 'ch10session4_14d', 'ch10session4_14e', 'ch10session4_14f', 'ch10session4_150', 'ch10session4_151', 'ch10session4_152', 'ch10session4_153', 'ch10session4_154', 'ch10session4_155', 'ch10session4_156', 'ch10session4_157', 'ch10session4_158', 'ch10session4_159', 'ch10session4_15a', 'ch10session4_15b', 'ch10session4_15c', 'ch10session4_15d', 'ch10session4_15e', 'ch10session4_15f', 'ch10session4_160', 'ch10session4_161', 'ch10session4_162', 'ch10session4_163', 'ch10session4_164', 'ch10session4_165', 'ch10session4_166', 'ch10session4_167', 'ch10session4_168', 'ch10session4_169', 'ch10session4_16a', 'ch10session4_16b', 'ch10session4_16c', 'ch10session4_16d', 'ch10session4_16e', 'ch10session4_16f', 'ch10session4_170', 'ch10session4_171', 'ch10session4_172', 'ch10session4_173', 'ch10session4_174', 'ch10session4_175', 'ch10session4_176', 'ch10session4_177', 'ch10session4_178', 'ch10session4_179', 'ch10session4_17a', 'ch10session4_17b', 'ch10session4_17c', 'ch10session4_17d', 'ch10session4_17e', 'ch10session4_17f', 'ch10session4_180', 'ch10session4_181', 'ch10session4_182', 'ch10session4_183', 'ch10session4_184', 'ch10session4_185', 'ch10session4_186', 'ch10session4_187', 'ch10session4_188', 'ch10session4_189', 'ch10session4_18a', 'ch10session4_18b', 'ch10session4_18c', 'ch10session4_18d', 'ch10session4_18e', 'ch10session4_18f', 'ch10session4_190', 'ch10session4_191', 'ch10session4_192', 'ch10session4_193', 'ch10session4_194', 'ch10session4_195', 'ch10session4_196', 'ch10session4_197', 'ch10session4_198', 'ch10session4_199', 'ch10session4_19a', 'ch10session4_19b', 'ch10session4_19c', 'ch10session4_19d', 'ch10session4_19e', 'ch10session4_19f', 'ch10session4_1a0', 'ch10session4_1a1', 'ch10session4_1a2', 'ch10session4_1a3', 'ch10session4_1a4', 'ch10session4_1a5', 'ch10session4_1a6', 'ch10session4_1a7', 'ch10session4_1a8', 'ch10session4_1a9', 'ch10session4_1aa', 'ch10session4_1ab', 'ch10session4_1ac', 'ch10session4_1ad', 'ch10session4_1ae', 'ch10session4_1af', 'ch10session4_1b0', 'ch10session4_1b1', 'ch10session4_1b2', 'ch10session4_1b3', 'ch10session4_1b4', 'ch10session4_1b5', 'ch10session4_1b6', 'ch10session4_1b7', 'ch10session4_1b8', 'ch10session4_1b9', 'ch10session4_1ba', 'ch10session4_1bb', 'ch10session4_1bc', 'ch10session4_1bd', 'ch10session4_1be', 'ch10session4_1bf', 'ch10session4_1c0', 'ch10session4_1c1', 'ch10session4_1c2', 'ch10session4_1c3', 'ch10session4_1c4', 'ch10session4_1c5', 'ch10session4_1c6', 'ch10session4_1c7', 'ch10session4_1c8', 'ch10session4_1c9', 'ch10session4_1ca', 'ch10session4_1cb', 'ch10session4_1cc', 'ch10session4_1cd', 'ch10session4_1ce', 'ch10session4_1cf', 'ch10session4_1d0', 'ch10session4_1d1', 'ch10session4_1d2', 'ch10session4_1d3', 'ch10session4_1d4', 'ch10session4_1d5', 'ch10session4_1d6', 'ch10session4_1d7', 'ch10session4_1d8', 'ch10session4_1d9', 'ch10session4_1da', 'ch10session4_1db', 'ch10session4_1dc', 'ch10session4_1dd', 'ch10session4_1de', 'ch10session4_1df', 'ch10session4_1e0', 'ch10session4_1e1']}
\ No newline at end of file
Binary file web/hgbook/comments/p_list.pyc has changed
--- a/web/hgbook/comments/p_list.py~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-p_list={'chap_intro':['x_38', 'x_39', 'x_3d', 'x_3e', 'x_3f', 'x_40', 'x_41', 'x_42', 'x_46', 'x_4c', 'x_4d', 'x_4e', 'x_4f', 'x_50', 'x_51', 'x_52', 'x_53', 'x_54', 'x_55', 'x_56', 'x_57', 'x_58', 'x_59', 'x_5a', 'x_5b', 'x_5c', 'x_5d', 'x_5e', 'x_5f', 'x_60', 'x_61', 'x_62', 'x_63', 'x_64', 'x_65', 'x_66', 'x_67', 'x_68', 'x_69', 'x_6d', 'x_6e', 'x_6f', 'x_70', 'x_71', 'x_72', 'x_73', 'x_74', 'x_75', 'x_79', 'x_7a', 'x_7b', 'x_7c', 'x_7d', 'x_7e', 'x_7f', 'x_80', 'x_81', 'x_82', 'x_83', 'x_84', 'x_85', 'x_86', 'x_87', 'x_88', 'x_89', 'x_8a', 'x_8b', 'x_8c', 'x_8d', 'x_8e', 'x_8f', 'x_90', 'x_91', 'x_92', 'x_93', 'x_94', 'x_95', 'x_96', 'x_97', 'x_98', 'x_99', 'x_9a', 'x_9b', 'x_9c', 'x_9d'],'chap01_intro':['x_1', 'x_2'],'chap02_basic':['x_197', 'x_198', 'x_19c', 'x_19d', 'x_19e', 'x_19f', 'x_1a0', 'x_1a1', 'x_1a5', 'x_1ab', 'x_1ac', 'x_1ad', 'x_1ae', 'x_1af', 'x_1b0', 'x_1b1', 'x_1b2', 'x_1b3', 'x_1b4', 'x_1b5', 'x_1b6', 'x_1b7', 'x_1b8', 'x_1b9', 'x_1ba', 'x_1bb', 'x_1bc', 'x_1bd', 'x_1be', 'x_1bf', 'x_1c0', 'x_1c1', 'x_1c2', 'x_1c3', 'x_1c4', 'x_1c5', 'x_1c6', 'x_1c7', 'x_1c8', 'x_1cc', 'x_1cd', 'x_1ce', 'x_1cf', 'x_1d0', 'x_1d1', 'x_1d2', 'x_1d3', 'x_1d4', 'x_1d8', 'x_1d9', 'x_1da', 'x_1db', 'x_1dc', 'x_1dd', 'x_1de', 'x_1df', 'x_1e0', 'x_1e1', 'x_1e2', 'x_1e3', 'x_1e4', 'x_1e5', 'x_1e6', 'x_1e7', 'x_1e8', 'x_1e9', 'x_1ea', 'x_1eb', 'x_1ec', 'x_1ed', 'x_1ee', 'x_1ef', 'x_1f0', 'x_1f1', 'x_1f2', 'x_1f3', 'x_1f4', 'x_1f5', 'x_1f6', 'x_1f7', 'x_1f8', 'x_1f9', 'x_1fa', 'x_1fb','x_1fc'],'chap02_basicoop':['x_c2', 'x_c3', 'x_c4', 'x_c5', 'x_c6', 'x_c7'],'chap03-session4':['x_f', 'x_10', 'x_11', 'x_12', 'x_13', 'x_14', 'x_15', 'x_16', 'x_17', 'x_18', 'x_19', 'x_1a', 'x_1b', 'x_1c', 'x_1d', 'x_1e', 'x_1f', 'x_23', 'x_24', 'x_25', 'x_26', 'x_27', 'x_28', 'x_29', 'x_2a', 'x_2b', 'x_2c', 'x_2d', 'x_2e', 'x_2f', 'x_30', 'x_31', 'x_32', 'x_33', 'x_34', 'x_35', 'x_66', 'x_67', 'x_68', 'x_71', 'x_72', 'x_7c', 'x_7d', 'x_7e', 'x_9b', 'x_9c', 'x_9d', 'x_9e', 'x_9f', 'x_a0', 'x_a1', 'x_a2', 'x_a3', 'x_a4', 'x_a5', 'x_a6', 'x_b8', 'x_b9', 'x_ba', 'x_bb', 'x_bc', 'x_c0', 'x_c1','chap04_handout':['x_204']}
--- a/web/hgbook/comments/sql/comment.mysql.sql	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-alter table comments_comment convert to character set utf8 collate utf8_bin;
-alter table comments_comment default character set utf8 collate utf8_bin;
--- a/web/hgbook/comments/sql/element.mysql.sql	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-alter table comments_element convert to character set utf8 collate utf8_bin;
-alter table comments_element default character set utf8 collate utf8_bin;
--- a/web/hgbook/comments/test	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 9. Finding and fixing mistakes</title><link rel="stylesheet" href="/support/styles.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.3"><link rel="home" href="index.html" title="Mercurial: The Definitive Guide"><link rel="up" href="index.html" title="Mercurial: The Definitive Guide"><link rel="prev" href="managing-releases-and-branchy-development.html" title="Chapter 8. Managing releases and branchy development"><link rel="next" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks"><link rel="alternate" type="application/atom+xml" title="Comments" href="/feeds/comments/"><link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png"><script type="text/javascript" src="/support/jquery-min.js"></script><script type="text/javascript" src="/support/form.js"></script><script type="text/javascript" src="/support/hsbook.js"></script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><h2 class="booktitle"><a href="/">Mercurial: The Definitive Guide</a><span class="authors">by Bryan O'Sullivan</span></h2></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. Finding and fixing mistakes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="managing-releases-and-branchy-development.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="handling-repository-events-with-hooks.html">Next</a></td></tr></table></div><div class="chapter" lang="en" id="chap:undo"><div class="titlepage"><div><div><h2 class="title">Chapter 9. Finding and fixing mistakes</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id390081">Erasing local history</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id390087">The accidental commit</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:rollback">Rolling back a transaction</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id390858">The erroneous pull</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:rollback-after-push">Rolling back is useless once you've pushed</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id391000">You can only roll back once</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id391367">Reverting the mistaken change</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:mgmt">File management errors</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id392218">Dealing with committed changes</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392287">Backing out a changeset</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392424">Backing out the tip changeset</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392766">Backing out a non-tip change</a></span></dt><dd><dl><dt><span class="sect3"><a href="finding-and-fixing-mistakes.html#id392990">Always use the --merge option</a></span></dt></dl></dd><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id393181">Gaining more control of the backout process</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id393814">Why hg backout works as
-	it does</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#sec:undo:aaaiiieee">Changes that should never have been</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394303">Backing out a merge</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394612">Protect yourself from escaped
-	changes</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394667">What to do about sensitive changes that escape</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#sec:undo:bisect">Finding the source of a bug</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394992">Using the hg bisect
-	command</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396541">Cleaning up after your search</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id396622">Tips for finding bugs effectively</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396628">Give consistent input</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396884">Automate as much as possible</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396713">Check your results</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396770">Beware interference between bugs</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396856">Bracket your search lazily</a></span></dt></dl></dd></dl></div>
-
--- a/web/hgbook/comments/test~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 9. Finding and fixing mistakes</title><link rel="stylesheet" href="/support/styles.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.3"><link rel="home" href="index.html" title="Mercurial: The Definitive Guide"><link rel="up" href="index.html" title="Mercurial: The Definitive Guide"><link rel="prev" href="managing-releases-and-branchy-development.html" title="Chapter 8. Managing releases and branchy development"><link rel="next" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks"><link rel="alternate" type="application/atom+xml" title="Comments" href="/feeds/comments/"><link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png"><script type="text/javascript" src="/support/jquery-min.js"></script><script type="text/javascript" src="/support/form.js"></script><script type="text/javascript" src="/support/hsbook.js"></script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><h2 class="booktitle"><a href="/">Mercurial: The Definitive Guide</a><span class="authors">by Bryan O'Sullivan</span></h2></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. Finding and fixing mistakes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="managing-releases-and-branchy-development.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="handling-repository-events-with-hooks.html">Next</a></td></tr></table></div><div class="chapter" lang="en" id="chap:undo"><div class="titlepage"><div><div><h2 class="title">Chapter 9. Finding and fixing mistakes</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id390081">Erasing local history</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id390087">The accidental commit</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:rollback">Rolling back a transaction</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id390858">The erroneous pull</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:rollback-after-push">Rolling back is useless once you've pushed</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id391000">You can only roll back once</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id391367">Reverting the mistaken change</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:mgmt">File management errors</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id392218">Dealing with committed changes</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392287">Backing out a changeset</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392424">Backing out the tip changeset</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392766">Backing out a non-tip change</a></span></dt><dd><dl><dt><span class="sect3"><a href="finding-and-fixing-mistakes.html#id392990">Always use the --merge option</a></span></dt></dl></dd><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id393181">Gaining more control of the backout process</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id393814">Why hg backout works as
-	it does</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#sec:undo:aaaiiieee">Changes that should never have been</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394303">Backing out a merge</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394612">Protect yourself from escaped
-	changes</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394667">What to do about sensitive changes that escape</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#sec:undo:bisect">Finding the source of a bug</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394992">Using the hg bisect
-	command</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396541">Cleaning up after your search</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id396622">Tips for finding bugs effectively</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396628">Give consistent input</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396884">Automate as much as possible</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396713">Check your results</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396770">Beware interference between bugs</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396856">Bracket your search lazily</a></span></dt></dl></dd></dl></div>
-
--- a/web/hgbook/comments/urls.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-from django.conf.urls.defaults import *
-
-urlpatterns = patterns('',
-    (r'chapter/(?P<id>[^/]+)/?$', 'hgbook.comments.views.chapter'),
-    (r'chapter/(?P<id>[^/]+)/count/?$', 'hgbook.comments.views.single_com'),
-    (r'single/(?P<id>[^/]+)/?$', 'hgbook.comments.views.single'),
-    (r'submit/(?P<id>[^/]+)/?$', 'hgbook.comments.views.submit')
-)	
Binary file web/hgbook/comments/urls.pyc has changed
--- a/web/hgbook/comments/urls.py~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-from django.conf.urls.defaults import *
-
-urlpatterns = patterns('',
-    (r'chapter/(?P<id>[^/]+)/?$', 'hgbook.comments.views.chapter'),
-    (r'chapter/(?P<id>[^/]+)/count/?$', 'hgbook.comments.views.single_com'),
-    (r'single/(?P<id>[^/]+)/?$', 'hgbook.comments.views.single'),
-    (r'submit/(?P<id>[^/]+)/?$', 'hgbook.comments.views.submit')
-)
--- a/web/hgbook/comments/views.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +0,0 @@
-import sys
-import django.forms as forms
-from django.db import connection
-from django.http import HttpResponse
-from hgbook.comments.models import Comment, Element
-from django.shortcuts import get_object_or_404, render_to_response
-from django.template import Context ,RequestContext
-from django.template.loader import get_template
-from django.utils.simplejson import dumps 
-from p_list import *
-from BeautifulSoup import BeautifulSoup
-import glob
-html_folder='/home/amit/SEES-hacks/web/html/'
-
-def sort_dict(dict):
-	new_dict = {}
-	sorted_keys = dict.keys()
-	sorted_keys.sort()
-	print >> sys.stderr , sorted_keys
-	for key in sorted_keys:
-		new_dict[key] = dict[key]
-
-	return new_dict
-
-def dump_queries():
-    # requires settings.DEBUG to be set to True in order to work
-    if len(connection.queries) == 1:
-        print connection.queries
-    else:
-        qs = {}
-        for q in connection.queries:
-            qs[q['sql']] = qs.setdefault(q['sql'], 0) + 1
-        for q in sorted(qs.items(), key=lambda x: x[1], reverse=True):
-            print q
-        print len(connection.queries)
-
-class CommentForm(forms.Form):
-    id = forms.CharField(widget=forms.HiddenInput)
-    name = forms.CharField(max_length=64)
-    url = forms.URLField(max_length=128, required=False)
-    comment = forms.CharField(widget=forms.Textarea(attrs={
-        'rows': 8, 'cols': 60
-        }))
-    remember = forms.BooleanField(initial=True, required=False)
-
-def search(request):
-	print request
-
-
-def index(request):
-	html_files = glob.glob(html_folder+'ch*.html')
-	print >> sys.stderr ,html_files	
-	print >> sys.stderr ,"just checking whether i got here"	
-	print >> sys.stderr , html_files	
-	html_files.sort()
-	link_list=['/review/html/'+a.split('/')[-1] for a in html_files]
-#	print >> sys.stderr , html_files        
-	title_list=[]
-	for html_file in html_files:
-		file_str=open(html_file,'r').read()			
-		soup_obj=BeautifulSoup(''.join(file_str))
-		title_str=soup_obj.html.head.title.string		
-		title_str=unicode(title_str)		
-		title_str.encode('ascii','ignore')              
-		title_list.append(title_str)
-	
-	resp_dict=zip(link_list,title_list)
-	print >>sys.stderr ,resp_dict
-	return render_to_response('index.html', {'resp_dict': resp_dict })
-
-
-
-
-
-
-
-def comments_by_chapter(id):
-    objs = {}
-    for c in Comment.objects.filter(element=id, hidden=False).order_by('date'):
-        objs.setdefault(c.element_id, []).append(c)
-    return objs
-
-def chapter(request, id):
-    template = get_template('comment.html')
-    resp = {}
-    for elt, comments in comments_by_chapter(id).iteritems():
-            
-        form = CommentForm(initial={
-            'id': elt,
-            'name': request.session.get('name', ''),
-            })
-            
-
-
-    resp[elt] = template.render(RequestContext({
-            'id': elt,
-            'form': form,
-            'length': len(comments),
-            'query': comments,
-            }))
-    return HttpResponse(dumps(resp), mimetype='application/json')
-
-#    queryset = Comment.objects.filter(element=id, hidden=False).order_by('date')
-#    if form is None:
-#        form = CommentForm(initial={
-#            'id': id,
-#            'name': request.session.get('name', ''),
-#            })
-#    try:
-#        error = form.errors[0]
-#    except:
-#        error = ''
-#    return render_to_response('comment.html', {
-#        'id': id,
-#        'form': form,
-#        'length': len(queryset),
-#        'query': queryset,
-#        'newid': newid or True,
-#        'error': error,
-#        })
-
-
-
-
-
-def single_com(request,id):
-     
-#    template = get_template('comment.html')
-    resp = {}
-    print >> sys.stderr ,id   
-    for i in p_list[id]:	
-#        form=None
-        queryset = Comment.objects.filter(element=i, hidden=False).order_by('date')
-                
-#        if form is None:
-#		form = CommentForm(initial={
-#		    'id': id,
-#		    'name': request.session.get('name', ''),
-#        })
-        if len(queryset)==0:
-            resp[i] = "No"
-        elif len(queryset)==1:
-            resp[i]="One"
-        else:
-            resp[i] = len(queryset)
-#            'id': i,
-#           'form': form,
-#            'length': len(queryset),
-#            'query': queryset,
-            
-    return HttpResponse(dumps(resp), mimetype='application/json')
-#    template = get_template('comment.html')    
-#    for i in p_list[id]:	
-#        form=None
-#        queryset = Comment.objects.filter(element=i, hidden=False).order_by('date')
-#        print queryset        
-#        if form is None:
-#		form = CommentForm(initial={
-#		    'id': id,
-#		    'name': request.session.get('name', ''),
-#		    })
-#       try:
-#		    error = form.errors[0]
-#        except:
-#            error = ''
-	    
-#    return HttpResponse(response_list)
-
-
-
-
-
-
-def chapter_count(request, id):
-      
-    resp = comments_by_chapter(id)
-    
-    for elt, comments in resp.iteritems():
-              
-        resp[elt] = len(comments)
-     
-    return HttpResponse(dumps(resp), mimetype='application/json')
-    
-def single(request, id, form=None, newid=None ):
-    queryset = Comment.objects.filter(element=id, hidden=False).order_by('date')
-    if form is None:
-        form = CommentForm(initial={
-            'id': id,
-            'name': request.session.get('name', ''),
-            })
-    try:
-        error = form.errors[0]
-    except:
-        error = ''
-    return render_to_response('comment.html', {
-        'id': id,
-        'form': form,
-        'length': len(queryset),
-        'query': queryset,
-        'newid': newid or True,
-        'error': error,
-        })
-
-def submit(request, id):
-#    print request
-#    print id    
-    try :    
-        element=Element.objects.get(id=id,chapter='chap_intro')
-    except Element.DoesNotExist:
-        element=Element(id=id)    
-	element.save()    
-    
-   
-    if request.method == 'POST':
-       
-	form = CommentForm(request.POST)
-	   
-	if form.is_valid():
-            data = form.cleaned_data
-            
-	    if data.get('remember'):
-		               
-		request.session['name'] = data['name']
-                request.session['url'] = data['url']
-            else:
-                request.session.pop('name', None)
-                request.session.pop('url', None)
-            c = Comment(element=element,
-                        comment=data['comment'],
-                        submitter_name=data['name'],
-                        submitter_url=data['url'],
-                        ip=request.META.get('REMOTE_ADDR'))
-          
-			
-	c.save()
-        newid=c.id        
-        form = None
-    return single(request, id, form, newid)
-
Binary file web/hgbook/comments/views.pyc has changed
--- a/web/hgbook/comments/views.py~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +0,0 @@
-import sys
-import django.forms as forms
-from django.db import connection
-from django.http import HttpResponse
-from hgbook.comments.models import Comment, Element
-from django.shortcuts import get_object_or_404, render_to_response
-from django.template import Context ,RequestContext
-from django.template.loader import get_template
-from django.utils.simplejson import dumps 
-from p_list import *
-from BeautifulSoup import BeautifulSoup
-import glob
-html_folder='/home/amit/SEES-hacks/web/html'
-
-def sort_dict(dict):
-	new_dict = {}
-	sorted_keys = dict.keys()
-	sorted_keys.sort()
-	print >> sys.stderr , sorted_keys
-	for key in sorted_keys:
-		new_dict[key] = dict[key]
-
-	return new_dict
-
-def dump_queries():
-    # requires settings.DEBUG to be set to True in order to work
-    if len(connection.queries) == 1:
-        print connection.queries
-    else:
-        qs = {}
-        for q in connection.queries:
-            qs[q['sql']] = qs.setdefault(q['sql'], 0) + 1
-        for q in sorted(qs.items(), key=lambda x: x[1], reverse=True):
-            print q
-        print len(connection.queries)
-
-class CommentForm(forms.Form):
-    id = forms.CharField(widget=forms.HiddenInput)
-    name = forms.CharField(max_length=64)
-    url = forms.URLField(max_length=128, required=False)
-    comment = forms.CharField(widget=forms.Textarea(attrs={
-        'rows': 8, 'cols': 60
-        }))
-    remember = forms.BooleanField(initial=True, required=False)
-
-def search(request):
-	print request
-
-
-def index(request):
-	html_files = glob.glob(html_folder+'ch*.html')
-	print >> sys.stderr ,html_files	
-	print >> sys.stderr ,"just checking whether i got here"	
-	print >> sys.stderr , html_files	
-	html_files.sort()
-	link_list=['/review/html/'+a.split('/')[-1] for a in html_files]
-#	print >> sys.stderr , html_files        
-	title_list=[]
-	for html_file in html_files:
-		file_str=open(html_file,'r').read()			
-		soup_obj=BeautifulSoup(''.join(file_str))
-		title_str=soup_obj.html.head.title.string		
-		title_str=unicode(title_str)		
-		title_str.encode('ascii','ignore')              
-		title_list.append(title_str)
-	
-	resp_dict=zip(link_list,title_list)
-	print >>sys.stderr ,resp_dict
-	return render_to_response('index.html', {'resp_dict': resp_dict })
-
-
-
-
-
-
-
-def comments_by_chapter(id):
-    objs = {}
-    for c in Comment.objects.filter(element=id, hidden=False).order_by('date'):
-        objs.setdefault(c.element_id, []).append(c)
-    return objs
-
-def chapter(request, id):
-    template = get_template('comment.html')
-    resp = {}
-    for elt, comments in comments_by_chapter(id).iteritems():
-            
-        form = CommentForm(initial={
-            'id': elt,
-            'name': request.session.get('name', ''),
-            })
-            
-
-
-    resp[elt] = template.render(RequestContext({
-            'id': elt,
-            'form': form,
-            'length': len(comments),
-            'query': comments,
-            }))
-    return HttpResponse(dumps(resp), mimetype='application/json')
-
-#    queryset = Comment.objects.filter(element=id, hidden=False).order_by('date')
-#    if form is None:
-#        form = CommentForm(initial={
-#            'id': id,
-#            'name': request.session.get('name', ''),
-#            })
-#    try:
-#        error = form.errors[0]
-#    except:
-#        error = ''
-#    return render_to_response('comment.html', {
-#        'id': id,
-#        'form': form,
-#        'length': len(queryset),
-#        'query': queryset,
-#        'newid': newid or True,
-#        'error': error,
-#        })
-
-
-
-
-
-def single_com(request,id):
-     
-#    template = get_template('comment.html')
-    resp = {}
-    print >> sys.stderr ,id   
-    for i in p_list[id]:	
-#        form=None
-        queryset = Comment.objects.filter(element=i, hidden=False).order_by('date')
-                
-#        if form is None:
-#		form = CommentForm(initial={
-#		    'id': id,
-#		    'name': request.session.get('name', ''),
-#        })
-        if len(queryset)==0:
-            resp[i] = "No"
-        elif len(queryset)==1:
-            resp[i]="One"
-        else:
-            resp[i] = len(queryset)
-#            'id': i,
-#           'form': form,
-#            'length': len(queryset),
-#            'query': queryset,
-            
-    return HttpResponse(dumps(resp), mimetype='application/json')
-#    template = get_template('comment.html')    
-#    for i in p_list[id]:	
-#        form=None
-#        queryset = Comment.objects.filter(element=i, hidden=False).order_by('date')
-#        print queryset        
-#        if form is None:
-#		form = CommentForm(initial={
-#		    'id': id,
-#		    'name': request.session.get('name', ''),
-#		    })
-#       try:
-#		    error = form.errors[0]
-#        except:
-#            error = ''
-	    
-#    return HttpResponse(response_list)
-
-
-
-
-
-
-def chapter_count(request, id):
-      
-    resp = comments_by_chapter(id)
-    
-    for elt, comments in resp.iteritems():
-              
-        resp[elt] = len(comments)
-     
-    return HttpResponse(dumps(resp), mimetype='application/json')
-    
-def single(request, id, form=None, newid=None ):
-    queryset = Comment.objects.filter(element=id, hidden=False).order_by('date')
-    if form is None:
-        form = CommentForm(initial={
-            'id': id,
-            'name': request.session.get('name', ''),
-            })
-    try:
-        error = form.errors[0]
-    except:
-        error = ''
-    return render_to_response('comment.html', {
-        'id': id,
-        'form': form,
-        'length': len(queryset),
-        'query': queryset,
-        'newid': newid or True,
-        'error': error,
-        })
-
-def submit(request, id):
-#    print request
-#    print id    
-    try :    
-        element=Element.objects.get(id=id,chapter='chap_intro')
-    except Element.DoesNotExist:
-        element=Element(id=id)    
-	element.save()    
-    
-   
-    if request.method == 'POST':
-       
-	form = CommentForm(request.POST)
-	   
-	if form.is_valid():
-            data = form.cleaned_data
-            
-	    if data.get('remember'):
-		               
-		request.session['name'] = data['name']
-                request.session['url'] = data['url']
-            else:
-                request.session.pop('name', None)
-                request.session.pop('url', None)
-            c = Comment(element=element,
-                        comment=data['comment'],
-                        submitter_name=data['name'],
-                        submitter_url=data['url'],
-                        ip=request.META.get('REMOTE_ADDR'))
-          
-			
-	c.save()
-        newid=c.id        
-        form = None
-    return single(request, id, form, newid)
-
--- a/web/hgbook/converter.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-from lxml import etree
-from lxml import html
-from lxml.cssselect import CSSSelector
-import md5
-import sys
-
-
-args = sys.argv[1:]
-
-# django stuff
-from django.core.management import setup_environ
-import settings # Assumed to be in the same directory.
-setup_environ(settings)       # ugly django collateral effects :(
-from comments.models import Element
-
-doc_id = 'MMSC'
-sel = CSSSelector('div.chapter p, pre, h1, table.equation')
-chapter_sel = CSSSelector('div.chapter')
-
-try:
-    filename = args[0]
-except IndexError:
-    raise IndexError("Usage: %s <path-to-html-file>" % __file__)
-
-tree = etree.parse(filename, html.HTMLParser(remove_blank_text=True))
-root = tree.getroot()
-
-chapter = chapter_sel(root)[0]
-chapter_title = chapter.get('id').split(':')[1]
-chapter_hash = md5.new(chapter.get('id').encode('utf8')).hexdigest()
-
-chapter.set('id', chapter_hash)
-
-for element in sel(root):
-    hsh_source = element.text or element.get('alt') or etree.tostring(element)
-
-    if hsh_source:
-        hsh_source_encoded = hsh_source.encode('utf8')
-        hsh = md5.new(hsh_source_encoded).hexdigest()
-        element.set('id', '%s-%s' % (chapter_hash, hsh))
-    
-        # create the commentable element in the DB
-        e = Element()
-        e.id = '%s-%s' % (chapter_hash, hsh)
-        e.chapter = chapter_hash
-        e.title = chapter_title
-        e.save()
-
-
-
-print etree.tostring(root)      # pipe to a file if you wish
-
--- a/web/hgbook/dbutil.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-import MySQLdb as mysql
-import sys
-
-def connect():
-    try:
-        import secrets
-    except ImportError:
-        print >> sys.stderr, 'Decrypt secrets.py.gpg or create a new copy!'
-        sys.exit(1)
-
-    if secrets.DATABASE_ENGINE != 'mysql':
-        print >> sys.stderr, ('You are using a %s database' %
-                              secrets.DATABASE_ENGINE)
-        sys.exit(1)
-
-    kwargs = {
-        'charset': 'utf8',
-        'use_unicode': True,
-        }
-    if secrets.DATABASE_USER:
-        kwargs['user'] = secrets.DATABASE_USER
-    if secrets.DATABASE_NAME:
-        kwargs['db'] = secrets.DATABASE_NAME
-    if secrets.DATABASE_PASSWORD:
-        kwargs['passwd'] = secrets.DATABASE_PASSWORD
-    if secrets.DATABASE_HOST.startswith('/'):
-        kwargs['unix_socket'] = secrets.DATABASE_HOST
-    elif secrets.DATABASE_HOST:
-        kwargs['host'] = secrets.DATABASE_HOST
-    if secrets.DATABASE_PORT:
-        kwargs['port'] = int(secrets.DATABASE_PORT)
-    return mysql.connect(**kwargs)
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/iamflint has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/position.DB has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/position.baseA has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/position.baseB has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/postlist.DB has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/postlist.baseA has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/postlist.baseB has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/record.DB has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/record.baseA has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/record.baseB has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/spelling.DB has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/spelling.baseA has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/spelling.baseB has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/termlist.DB has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/termlist.baseA has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/termlist.baseB has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/value.DB has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/value.baseA has changed
Binary file web/hgbook/flatpages/flatpage/hgbook.comments.models.flatpageindexer/value.baseB has changed
--- a/web/hgbook/load_elements.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-#!/usr/bin/env python
-#
-# This script updates the contents of the comments_element table.
-# It's fugly, but a lot less painful than trying to use Django's
-# fixtures system.
-
-import os, sys
-sys.path.append(os.path.dirname(__file__))
-import dbutil
-
-os.system('make -C ../../en all-ids.dat')
-
-conn = dbutil.connect()
-c = conn.cursor()
-c.execute('''load data local infile "../../en/all-ids.dat" replace
-             into table comments_element
-             fields terminated by "|"''')
-print 'Database updated'
--- a/web/hgbook/manage.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#!/usr/bin/env python
-from django.core.management import execute_manager
-try:
-    import settings # Assumed to be in the same directory.
-except ImportError:
-    import sys
-    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
-    sys.exit(1)
-
-if __name__ == "__main__":
-    execute_manager(settings)
--- a/web/hgbook/reviewers.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import os, sys
-sys.path.append(os.path.dirname(__file__))
-import dbutil
-
-conn = dbutil.connect()
-c = conn.cursor()
-
-c.execute('''select submitter_name from comments_comment''')
-
-reviewers = {}
-
-mappings = {
-    u'alejandro "tab-lover" dubrovsky': u'Alejandro Dubrovsky',
-    u'alex hirzel <ahirzel@mtu.edu>': u'Alex Hirzel',
-    u'anonymous coward': u'Anonymous',
-    u'arthur van leeuwen': u'Arthur van Leeuwen',
-    u'augustss': u'Lennart Augustsson',
-    u'ed t': u'Anonymous',
-    u'geogre moschovitis': u'George Moschovitis',
-    u'george m': u'George Moschovitis',
-    u'haskell newb': u'Anonymous',
-    u'j. pablo fernandez': u'J. Pablo Fernández',
-    u'kamal al-marhoobi': u'Kamal Al-Marhubi',
-    u'kevin w.': u'Kevin Watters',
-    u'max cantor (#haskell - mxc)': u'Max Cantor',
-    u'michael campbell': u'Michael Campbell',
-    u'mike btauwerman': u'Mike Brauwerman',
-    u'no credit necessary': u'Anonymous',
-    u'nykänen, matti': u'Matti Nykänen',
-    u'omar antolin camarena': u'Omar Antolín Camarena',
-    u'ryan t mulligan': u'Ryan T. Mulligan',
-    u'sengan baring-gould': u'Sengan Baring-Gould',
-    u'some guy': u'Anonymous',
-    u'tomas janousek': u'Tomáš Janoušek',
-    u'william halchin': u'William N. Halchin',
-    }
-
-def fixup(s):
-    try:
-        return s.encode('ascii')
-    except UnicodeEncodeError:
-        def f(c):
-            o = ord(c)
-            if o < 128:
-                return c
-            return '&#%d;' % o
-        return ''.join(map(f, s))
-
-total = 0
-for r in c.fetchall():
-    r = r[0].decode('utf-8')
-    if r in ("Bryan O'Sullivan",):
-        continue
-    total += 1
-    m = mappings.get(r.lower())
-    if m:
-        r = m
-    elif len(r) < 2 or ' ' not in r:
-        r = 'Anonymous'
-    reviewers.setdefault(r, 0)
-    reviewers[r] += 1
-
-reviewers = sorted(reviewers.iteritems(), key=lambda x: x[0])
-
-cohorts = [(.01,1),(.002,.01)]
-
-for (lo,hi) in cohorts:
-    lo = total * lo
-    hi = total * hi
-    for r in [n for n in reviewers if lo <= n[1] < hi]:
-        if r[1] > 3:
-            print '%s,' % fixup(r[0])
-    print
-
-lo = total * .002
-for n in reviewers:
-    if n[1] < lo:
-        print '%s,' % fixup(n[0])
--- a/web/hgbook/run.wsgi	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-import os
-import sys
-import django
-sys.path.append('/home/amit/SEES-hacks/web')
-sys.path.append('/home/amit/SEES-hacks/web/hgbook/comments')
-os.environ['DJANGO_SETTINGS_MODULE'] = 'hgbook.settings'
-import django.core.handlers.wsgi
-application = django.core.handlers.wsgi.WSGIHandler()
-
-
-
-
--- a/web/hgbook/run.wsgi~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-import os
-import sys
-import django
-sys.path.append('/home/amit/hgbook-alqua/web')
-sys.path.append('/home/amit/hgbook-alqua/web/hgbook/comments')
-os.environ['DJANGO_SETTINGS_MODULE'] = 'hgbook.settings'
-import django.core.handlers.wsgi
-application = django.core.handlers.wsgi.WSGIHandler()
-
-
-
-
Binary file web/hgbook/secrets.py.gpg has changed
--- a/web/hgbook/settings.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-# Django settings for hgbook project.
-
-import os, sys
-
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
-
-ADMINS = (
-    ("Bryan O'Sullivan", 'bos@serpentine.com'),
-)
-
-MANAGERS = ADMINS
-
-ROOT = os.path.dirname(sys.modules[__name__].__file__)
-
-DJAPIAN_DATABASE_PATH = '/home/amit/hgbook-alqua/web/hgbook'
-DJAPIAN_STEMMING_LANG = 'en'
-
-
-try:
-    from secrets import DATABASE_ENGINE, DATABASE_NAME, DATABASE_USER, \
-         DATABASE_PASSWORD, DATABASE_HOST, DATABASE_PORT, SECRET_KEY
-except ImportError:
-    print >> sys.stderr, 'Faking up some database configuration for you'
-    DATABASE_ENGINE = 'sqlite3'
-    DATABASE_NAME = os.path.join(ROOT, '.database.sqlite3')
-    DATABASE_USER = ''
-    DATABASE_PASSWORD = ''
-    DATABASE_HOST = ''
-    DATABASE_PORT = ''
-    SECRET_KEY = ''
-
-# Local time zone for this installation. Choices can be found here:
-# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
-# although not all choices may be avilable on all operating systems.
-# If running in a Windows environment this must be set to the same as your
-# system time zone.
-TIME_ZONE = 'America/Los_Angeles'
-
-# Language code for this installation. All choices can be found here:
-# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
-LANGUAGE_CODE = 'en-us'
-
-SITE_ID = 1
-
-# If you set this to False, Django will make some optimizations so as not
-# to load the internationalization machinery.
-USE_I18N = True
-
-# Absolute path to the directory that holds media.
-# Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT = ''
-
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash if there is a path component (optional in other cases).
-# Examples: "http://media.lawrence.com", "http://example.com/media/"
-MEDIA_URL = ''
-
-# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
-# trailing slash.
-# Examples: "http://foo.com/media/", "/media/".
-ADMIN_MEDIA_PREFIX = '/media/'
-
-
-#Index Directories for searching static html files
-DD_SEARCH_INDEX_DIR = '../html/'
-
-
-
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.load_template_source',
-    'django.template.loaders.app_directories.load_template_source',
-#     'django.template.loaders.eggs.load_template_source',
-)
-
-MIDDLEWARE_CLASSES = (
-    'django.middleware.common.CommonMiddleware',
-    'django.contrib.sessions.middleware.SessionMiddleware',
-    'django.contrib.auth.middleware.AuthenticationMiddleware',
-    'django.middleware.doc.XViewMiddleware',
-    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware'
-)
-
-ROOT_URLCONF = 'hgbook.urls'
-
-TEMPLATE_DIRS = (
-    os.path.join(ROOT, 'templates')
-)
-
-INSTALLED_APPS = (
-    'django.contrib.admin',
-    'django.contrib.auth',
-    'django.contrib.contenttypes',
-    'django.contrib.sessions',
-    'django.contrib.sites',
-    'django.contrib.flatpages',
-    'hgbook.comments',
-)
Binary file web/hgbook/settings.pyc has changed
--- a/web/hgbook/settings.py~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-# Django settings for hgbook project.
-
-import os, sys
-
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
-
-ADMINS = (
-    ("Bryan O'Sullivan", 'bos@serpentine.com'),
-)
-
-MANAGERS = ADMINS
-
-ROOT = os.path.dirname(sys.modules[__name__].__file__)
-
-DJAPIAN_DATABASE_PATH = '/path/to/my/project/data/djapian/'
-DJAPIAN_STEMMING_LANG = 'en'
-
-
-try:
-    from secrets import DATABASE_ENGINE, DATABASE_NAME, DATABASE_USER, \
-         DATABASE_PASSWORD, DATABASE_HOST, DATABASE_PORT, SECRET_KEY
-except ImportError:
-    print >> sys.stderr, 'Faking up some database configuration for you'
-    DATABASE_ENGINE = 'sqlite3'
-    DATABASE_NAME = os.path.join(ROOT, '.database.sqlite3')
-    DATABASE_USER = ''
-    DATABASE_PASSWORD = ''
-    DATABASE_HOST = ''
-    DATABASE_PORT = ''
-    SECRET_KEY = ''
-
-# Local time zone for this installation. Choices can be found here:
-# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
-# although not all choices may be avilable on all operating systems.
-# If running in a Windows environment this must be set to the same as your
-# system time zone.
-TIME_ZONE = 'America/Los_Angeles'
-
-# Language code for this installation. All choices can be found here:
-# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
-LANGUAGE_CODE = 'en-us'
-
-SITE_ID = 1
-
-# If you set this to False, Django will make some optimizations so as not
-# to load the internationalization machinery.
-USE_I18N = True
-
-# Absolute path to the directory that holds media.
-# Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT = ''
-
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash if there is a path component (optional in other cases).
-# Examples: "http://media.lawrence.com", "http://example.com/media/"
-MEDIA_URL = ''
-
-# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
-# trailing slash.
-# Examples: "http://foo.com/media/", "/media/".
-ADMIN_MEDIA_PREFIX = '/media/'
-
-
-#Index Directories for searching static html files
-DD_SEARCH_INDEX_DIR = '../html/'
-
-
-
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.load_template_source',
-    'django.template.loaders.app_directories.load_template_source',
-#     'django.template.loaders.eggs.load_template_source',
-)
-
-MIDDLEWARE_CLASSES = (
-    'django.middleware.common.CommonMiddleware',
-    'django.contrib.sessions.middleware.SessionMiddleware',
-    'django.contrib.auth.middleware.AuthenticationMiddleware',
-    'django.middleware.doc.XViewMiddleware',
-    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware'
-)
-
-ROOT_URLCONF = 'hgbook.urls'
-
-TEMPLATE_DIRS = (
-    os.path.join(ROOT, 'templates')
-)
-
-INSTALLED_APPS = (
-    'django.contrib.admin',
-    'django.contrib.auth',
-    'django.contrib.contenttypes',
-    'django.contrib.sessions',
-    'django.contrib.sites',
-    'django.contrib.flatpages',
-    'hgbook.comments',
-)
--- a/web/hgbook/templates/404.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-{% extends "simple.html" %}
-
-{% block title %}Page Not Found{% endblock %}
-
-{% block body %}
-<p>Sorry, we hit <a href="http://www.haskell.org/haskellwiki/Bottom">&perp;</a> when trying to find the
-page you requested.</p>
-{% endblock %}
--- a/web/hgbook/templates/500.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-{% extends "simple.html" %}
-
-{% block title %}Internal Server Error{% endblock %}
-
-{% block body %}
-<p>Sorry, we hit <a
-href="http://www.haskell.org/haskellwiki/Bottom">&perp;</a> when
-trying to process your request.  If possible, please let <a
-href="mailto:bos@serpentine.com">Bryan</a> know that this problem happened,
-and what you were doing when it occurred.</p>
-{% endblock %}
--- a/web/hgbook/templates/boilerplate.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-  <head>
-    <title>{% block pagetitle %}Mercurial: The Definitive Guide{% endblock %}</title>
-    <link rel="stylesheet" href="/support/styles.css" type="text/css"/>
-    <link rel="alternate" type="application/atom+xml" title="Comments"
-      href="/feeds/comments/"/>
-    <link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png"/>
-    <script type="text/javascript" src="/support/jquery.js"></script>
-      <script type="text/javascript" src="/support/form.js"></script>
-    <script type="text/javascript" src="/support/hsbook.js"></script>
-  </head>
-
-  <body>
-    {% block bodycontent %}{% endblock %}
-
-    <div class="hgbookfooter"> <p><img src="/support/figs/rss.png"> Want to stay
-	up to date? Subscribe to comment feeds for any chapter, or
-	the <a class="feed"
-	  href="/feeds/comments/">entire book</a>.</p> <p>Copyright
-	2006, 2007, 2008, 2009 Bryan O'Sullivan.
-	  Icons by
-	  <a href="mailto:mattahan@gmail.com">Paul Davey</a> aka <a
-	  href="http://mattahan.deviantart.com/">Mattahan</a>.</p>
-    </div>
-
-    <script type="text/javascript">
-    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
-    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
-    </script>
-    <script type="text/javascript">
-    try {
-    var pageTracker = _gat._getTracker("UA-1805907-5");
-    pageTracker._trackPageview();
-    } catch(err) {}</script>
-  </body>
-</html>
--- a/web/hgbook/templates/comment.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-{% ifequal length 1 %}
-  <a class="commenttoggle" id="toggle_{{ id }}"
-      onclick="return toggleComment('{{ id }}')"
-      href="comments: show / hide">One comment</a>
-{% else %}
-  {% if length %}
-    <a class="commenttoggle" id="toggle_{{ id }}"
-      onclick="return toggleComment('{{ id }}')"
-      href="comments: show / hide">{{ length }} comments</a>
-  {% else %}
-    <a class="commenttoggle" id="toggle_{{ id }}"
-      onclick="return toggleComment('{{ id }}')"
-      href="comments: show / hide">No comments</a>
-    <div class="comment" {% if not newid %} style="display: none;" {% endif %}>
-      <div class="comment_body">Be the first to comment on this paragraph!</div>
-    </div>
-  {% endif %}
-{% endifequal %}
-{% for c in query %}
-  <div class="{% ifequal c.id newid %}new_{% endifequal %}comment"
-      {% if not newid %} style="display: none;" {% endif %}
-    id="comment{{ c.id }}">
-    <a name="comment{{ c.id }}"/>
-    <div class="comment_header">
-	<span class="comment_id"><a href="/review/admin/comments/comment/{{ c.id }}/">{{ c.id }}</a></span>
-      {% if c.submitter_url %}
-	<span class="comment_name"><a rel="nofollow"
-	  href="{{ c.submitter_url }}">{{ c.submitter_name|escape }}</a></span>
-      {% else %}
-	<span class="comment_name">{{ c.submitter_name|escape }}</span>
-      {% endif %}
-      <span class="comment_date">{{ c.date|date:"Y-m-d" }}</span>
-      {% if c.reviewed %}
-	<span class="comment_reviewed">(reviewed)</span>
-      {% endif %}
-      {% ifequal c.id newid %}
-	<span class="comment_thanks">thank you for your comment!</span>
-      {% endifequal %}
-    </div>
-    <div class="comment_body">{{ c.comment|escape|linebreaks }}</div>
-  </div>
-{% endfor %}
-<form class="comment" id="form_{{ id }}" action="/review/comments/submit/{{ id }}/"
-    method="post" {% if not newid %} style="display: none;" {% endif %}>
-  {{ form.id }}
-  <table>
-    <tbody>
-      <tr><td align="right" valign="top">Comment<br><a class="comment_help"
-		href="web.html#web.comment">[ help ]</a></td>
-	  <td>{{ form.comment }}</td></tr>
-      <tr><td align="right">Your name</td><td>{{ form.name }}
-	    <span class="comment_help"><b>Required</b> so we can <a
-		href="web.html#web.comment.name">give you credit</a></span></td></tr>
-      <tr><td align="right">Your URL</td><td>{{ form.url }}
-	    <span class="comment_help"><b>Optional</b> link to blog, home page,
-	      <i>etc</i>.</span></td></tr>
-      <tr><td align="right">Remember you?</td><td>{{ form.remember }}</td></tr>
-      <tr><td/><td><input name="submit" type="submit"
-	      value="Submit Comment"/><span class="comment_error">{{ error }}</span></td></tr>
-    </tbody>
-  </table>
-</form>
--- a/web/hgbook/templates/comment.html~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-{% ifequal length 1 %}
-  <a class="commenttoggle" id="toggle_{{ id }}"
-      onclick="return toggleComment('{{ id }}')"
-      href="comments: show / hide">One comment</a>
-{% else %}
-  {% if length %}
-    <a class="commenttoggle" id="toggle_{{ id }}"
-      onclick="return toggleComment('{{ id }}')"
-      href="comments: show / hide">{{ length }} comments</a>
-  {% else %}
-    <a class="commenttoggle" id="toggle_{{ id }}"
-      onclick="return toggleComment('{{ id }}')"
-      href="comments: show / hide">No comments</a>
-    <div class="comment" {% if not newid %} style="display: none;" {% endif %}>
-      <div class="comment_body">Be the first to comment on this paragraph!</div>
-    </div>
-  {% endif %}
-{% endifequal %}
-{% for c in query %}
-  <div class="{% ifequal c.id newid %}new_{% endifequal %}comment"
-      {% if not newid %} style="display: none;" {% endif %}
-    id="comment{{ c.id }}">
-    <a name="comment{{ c.id }}"/>
-    <div class="comment_header">
-	<span class="comment_id"><a href="/admin/comments/comment/{{ c.id }}/">{{ c.id }}</a></span>
-      {% if c.submitter_url %}
-	<span class="comment_name"><a rel="nofollow"
-	  href="{{ c.submitter_url }}">{{ c.submitter_name|escape }}</a></span>
-      {% else %}
-	<span class="comment_name">{{ c.submitter_name|escape }}</span>
-      {% endif %}
-      <span class="comment_date">{{ c.date|date:"Y-m-d" }}</span>
-      {% if c.reviewed %}
-	<span class="comment_reviewed">(reviewed)</span>
-      {% endif %}
-      {% ifequal c.id newid %}
-	<span class="comment_thanks">thank you for your comment!</span>
-      {% endifequal %}
-    </div>
-    <div class="comment_body">{{ c.comment|escape|linebreaks }}</div>
-  </div>
-{% endfor %}
-<form class="comment" id="form_{{ id }}" action="/review/comments/submit/{{ id }}/"
-    method="post" {% if not newid %} style="display: none;" {% endif %}>
-  {{ form.id }}
-  <table>
-    <tbody>
-      <tr><td align="right" valign="top">Comment<br><a class="comment_help"
-		href="web.html#web.comment">[ help ]</a></td>
-	  <td>{{ form.comment }}</td></tr>
-      <tr><td align="right">Your name</td><td>{{ form.name }}
-	    <span class="comment_help"><b>Required</b> so we can <a
-		href="web.html#web.comment.name">give you credit</a></span></td></tr>
-      <tr><td align="right">Your URL</td><td>{{ form.url }}
-	    <span class="comment_help"><b>Optional</b> link to blog, home page,
-	      <i>etc</i>.</span></td></tr>
-      <tr><td align="right">Remember you?</td><td>{{ form.remember }}</td></tr>
-      <tr><td/><td><input name="submit" type="submit"
-	      value="Submit Comment"/><span class="comment_error">{{ error }}</span></td></tr>
-    </tbody>
-  </table>
-</form>
--- a/web/hgbook/templates/feeds/comments_description.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<p>On {{ obj.date|date:"Y-m-d" }},
-      {% if obj.submitter_url %}
-	<a rel="nofollow" href="{{ obj.submitter_url }}">{{ obj.submitter_name|escape }}</a>
-      {% else %}
-	{{ obj.submitter_name|escape }}
-      {% endif %}
-commented on &#8220;{{ obj.element.title|escape }}&#8221;:</p>
-<blockquote>
-{{ obj.comment|escape|linebreaks }}
-</blockquote>
-<p>To see this comment in context or to respond, visit <a
-	href="http://{{ site.domain }}{{ obj.get_absolute_url }}">{{ site.domain }}</a></p>
--- a/web/hgbook/templates/feeds/comments_title.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-Comment on &#8220;{{ obj.element.title|escape }}&#8221;
--- a/web/hgbook/templates/index.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-<html>
-  <head>
-    <title>Software Engineering for Engineers and Scientists</title>
-    <link rel="stylesheet" href="/review/support/styles.css" type="text/css"/>
-
-    <link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png"/>
-    <script type="text/javascript" src="/review/support/jquery.js"></script>
-
-      <script type="text/javascript" src="/review/support/form.js"></script>
-    <script type="text/javascript" src="/review/support/hsbook.js"></script>
-  </head>
-
-<body>
-    
-<div class="navheader"><h1 class="booktitle">SEES Documentation<div class="authors">by The FOSSEE TEAM</div></h1></div>
-<div class="book"> 
-{% if resp_dict %}
-{% for key,value in resp_dict %}
-<li>
-<a href={{ key }}>{{ value }}</a>
-</li>
-{% endfor %}
-{% endif %}
-
-
-
-<!-- <ul> 
-{% if resp_dict %}
-{% for key, value in resp_dict.items %}
-<li>   <a href={{ key }}>{{ val }}</a></li>
-{% endfor %} {% endif %}
-
-</ul>
--->
-</div>
-
-
-
-    
-</body>
-</html>
-
--- a/web/hgbook/templates/index.html~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-<html>
-  <head>
-    <title>Software Engineering for Engineers and Scientists</title>
-    <link rel="stylesheet" href="/review/support/styles.css" type="text/css"/>
-
-    <link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png"/>
-    <script type="text/javascript" src="/review/support/jquery.js"></script>
-
-      <script type="text/javascript" src="/review/support/form.js"></script>
-    <script type="text/javascript" src="/review/support/hsbook.js"></script>
-  </head>
-
-<body>
-    
-<div class="navheader"><h1 class="booktitle">SEES Documentation<div class="authors">by The FOSSEE TEAM</div></h1></div>
-<div class="book"> 
-{% if resp_dict %}
-{% for item in resp_dict %}
-<li>
-<a href={{ item(0) }}>{{ item(1) }}</a>
-</li>
-{% endfor %}
-{% endif %}
-
-
-
-<!-- <ul> 
-{% if resp_dict %}
-{% for key, value in resp_dict.items %}
-<li>   <a href={{ key }}>{{ val }}</a></li>
-{% endfor %} {% endif %}
-
-</ul>
--->
-</div>
-
-
-
-    
-</body>
-</html>
-
--- a/web/hgbook/templates/simple.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-{% extends "boilerplate.html" %}
-
-{% block bodycontent %}
-<div class="navheader"><h1>{% block title %}{% endblock %}</h1></div>
-
-<div class="basetemplate">{% block body %}{% endblock %}</div>
-{% endblock %}
--- a/web/hgbook/templates/single_com.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-{% ifequal length 1 %}
-  <a class="commenttoggle" id="toggle_{{ id }}"
-      onclick="return toggleComment('{{ id }}')"
-      href="comments: show / hide">One comment</a>
-{% else %}
-  {% if length %}
-    <a class="commenttoggle" id="toggle_{{ id }}"
-      onclick="return toggleComment('{{ id }}')"
-      href="comments: show / hide">{{ length }} comments</a>
-  {% else %}
-    <a class="commenttoggle" id="toggle_{{ id }}"
-      onclick="return toggleComment('{{ id }}')"
-      href="comments: show / hide">No comments</a>
-    <div class="comment" {% if not newid %} style="display: none;" {% endif %}>
-      <div class="comment_body">Be the first to comment on this paragraph!</div>
-    </div>
-  {% endif %}
-{% endifequal %}
-
--- a/web/hgbook/templates/single_com.html~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-{% ifequal length 1 %}
-  <a class="commenttoggle" id="toggle_{{ id }}"
-      onclick="return toggleComment('{{ id }}')"
-      href="comments: show / hide">One comment</a>
-{% else %}
-  {% if length %}
-    <a class="commenttoggle" id="toggle_{{ id }}"
-      onclick="return toggleComment('{{ id }}')"
-      href="comments: show / hide">{{ length }} comments</a>
-  {% else %}
-    <a class="commenttoggle" id="toggle_{{ id }}"
-      onclick="return toggleComment('{{ id }}')"
-      href="comments: show / hide">No comments</a>
-    <div class="comment" {% if not newid %} style="display: none;" {% endif %}>
-      <div class="comment_body">Be the first to comment on this paragraph!</div>
-    </div>
-  {% endif %}
-{% endifequal %}
-{% for c in query %}
--- a/web/hgbook/urls.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-import os, sys
-from django.conf.urls.defaults import *
-import hgbook.comments.feeds as feeds
-from django.contrib import admin
-
-admin.autodiscover()
-
-feeds = {
-    'comments': feeds.Comments,
-    }
-
-urlpatterns = patterns('',
-    (r'^comments/', include('hgbook.comments.urls')),
-
-    (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed',
-     {'feed_dict': feeds}),          
-    (r'^$', 'hgbook.comments.views.index'), 
-
-    (r'^search/', 'hgbook.comments.views.search'), 
-
-    # Only uncomment this for local testing without Apache.
-     (r'^html/(?P<path>.*)$', 'django.views.static.serve',
-     {'document_root': os.path.realpath(os.path.dirname(
-        sys.modules[__name__].__file__) + '/../html/')}),
-     (r'^support/(?P<path>.*)$', 'django.views.static.serve',
-     {'document_root': os.path.realpath(os.path.dirname(
-        sys.modules[__name__].__file__) + '/../support/')}),
-
-    # Uncomment this for admin:
-    (r'^admin/(.*)', admin.site.root),
-)
Binary file web/hgbook/urls.pyc has changed
--- a/web/hgbook/urls.py~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-import os, sys
-from django.conf.urls.defaults import *
-import hgbook.comments.feeds as feeds
-from django.contrib import admin
-
-admin.autodiscover()
-
-feeds = {
-    'comments': feeds.Comments,
-    }
-
-urlpatterns = patterns('',
-    (r'^comments/', include('hgbook.comments.urls')),
-
-    (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed',
-     {'feed_dict': feeds}),          
-    (r'^/$', 'hgbook.comments.views.index'), 
-
-    (r'^search/', 'hgbook.comments.views.search'), 
-
-    # Only uncomment this for local testing without Apache.
-     (r'^html/(?P<path>.*)$', 'django.views.static.serve',
-     {'document_root': os.path.realpath(os.path.dirname(
-        sys.modules[__name__].__file__) + '/../html/')}),
-     (r'^support/(?P<path>.*)$', 'django.views.static.serve',
-     {'document_root': os.path.realpath(os.path.dirname(
-        sys.modules[__name__].__file__) + '/../support/')}),
-
-    # Uncomment this for admin:
-    (r'^admin/(.*)', admin.site.root),
-)
--- a/web/html/backup/abc.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,530 +0,0 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>Chapter 9. Finding and fixing mistakes</title>
-<link rel="stylesheet" href="/support/styles.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.74.3"><link rel="home" href="index.html" title="Mercurial: The Definitive Guide">
-<link rel="up" href="index.html" title="Mercurial: The Definitive Guide">
-<link rel="prev" href="managing-releases-and-branchy-development.html" title="Chapter 8. Managing releases and branchy development">
-<link rel="next" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks"><link rel="alternate" type="application/atom+xml" title="Comments" href="/feeds/comments/">
-<link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png">
-<script type="text/javascript" src="/support/jquery-min.js"></script>
-<script type="text/javascript" src="/support/form.js"></script>
-<script type="text/javascript" src="/support/hsbook.js"></script></head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<div class="navheader">
-<table width="100%" summary="Navigation header">
-<tr><th colspan="3" align="center">Chapter 14. Adding functionality with extensions</th></tr>
-<tr>
-<td width="20%" align="left">
-<a accesskey="p" href="advanced-uses-of-mercurial-queues.html">Prev</a> </td>
-<th width="60%" align="center"> </th>
-<td width="20%" align="right"> <a accesskey="n" href="migrating-to-mercurial.html">Next</a>
-</td>
-</tr>
-</table>
-<hr>
-</div>
-<div class="chapter" title="Chapter 14. Adding functionality with extensions">
-<div class="titlepage"><div><div><h2 class="title">
-<a name="chap:hgext"></a>Chapter 14. Adding functionality with extensions</h2></div></div></div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:inotify">14.1. Improve performance with the <code class="literal">inotify</code> extension</a></span></dt>
-<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:extdiff">14.2. Flexible diff support with the <code class="literal">extdiff</code> extension</a></span></dt>
-<dd><dl><dt><span class="sect2"><a href="adding-functionality-with-extensions.html#id3071699">14.2.1. Defining command aliases</a></span></dt></dl></dd>
-<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:transplant">14.3. Cherrypicking changes with the <code class="literal">transplant</code> extension</a></span></dt>
-<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:patchbomb">14.4. Send changes via email with the <code class="literal">patchbomb</code> extension</a></span></dt>
-<dd><dl><dt><span class="sect2"><a href="adding-functionality-with-extensions.html#id3072184">14.4.1. Changing the behavior of patchbombs</a></span></dt></dl></dd>
-</dl>
-</div>
-<p id="x_4fe"></a>While the core of Mercurial is quite complete from a
-    functionality standpoint, it's deliberately shorn of fancy
-    features.  This approach of preserving simplicity keeps the
-    software easy to deal with for both maintainers and users.</p>
-<p id="x_4ff"></a>However, Mercurial doesn't box you in with an inflexible
-    command set: you can add features to it as
-    <span class="emphasis"><em>extensions</em></span> (sometimes known as
-    <span class="emphasis"><em>plugins</em></span>).  We've already discussed a few of
-    these extensions in earlier chapters.</p>
-<p id="x_546" id="x_546"></a>When you provide a directory name, Mercurial will interpret
-      this as “<span class="quote">operate on every file in this directory and its
-	subdirectories</span>”. Mercurial traverses the files and
-      subdirectories in a directory in alphabetical order.  When it
-      encounters a subdirectory, it will traverse that subdirectory
-      before continuing with the current directory.</p>
-
-
-
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
-<li class="listitem"><p id="x_500"></a><a class="xref" href="a-tour-of-mercurial-merging-work.html#sec:tour-merge:fetch" title="3.3. Simplifying the pull-merge-commit sequence">Section 3.3, “Simplifying the pull-merge-commit sequence”</a>
-	covers the <code class="literal">fetch</code> extension;
-	this combines pulling new changes and merging them with local
-	changes into a single command, <span class="command"><strong>fetch</strong></span>.</p></li>
-<li class="listitem"><p id="x_501"></a>In <a class="xref" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks">Chapter 10, <i>Handling repository events with hooks</i></a>, we covered
-	several extensions that are useful for hook-related
-	functionality: <code class="literal">acl</code> adds
-	access control lists; <code class="literal">bugzilla</code> adds integration with the
-	Bugzilla bug tracking system; and <code class="literal">notify</code> sends notification emails on
-	new changes.</p></li>
-<li class="listitem"><p id="x_502"></a>The Mercurial Queues patch management extension is
-	so invaluable that it merits two chapters and an appendix all
-	to itself. <a class="xref" href="managing-change-with-mercurial-queues.html" title="Chapter 12. Managing change with Mercurial Queues">Chapter 12, <i>Managing change with Mercurial Queues</i></a> covers the
-	basics; <a class="xref" href="advanced-uses-of-mercurial-queues.html" title="Chapter 13. Advanced uses of Mercurial Queues">Chapter 13, <i>Advanced uses of Mercurial Queues</i></a> discusses advanced topics;
-	and <a class="xref" href="mercurial-queues-reference.html" title="Appendix B. Mercurial Queues reference">Appendix B, <i>Mercurial Queues reference</i></a> goes into detail on
-	each
-	command.</p></li>
-</ul></div>
-<p id="x_503"></a>In this chapter, we'll cover some of the other extensions that
-    are available for Mercurial, and briefly touch on some of the
-    machinery you'll need to know about if you want to write an
-    extension of your own.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p id="x_504"></a>In <a class="xref" href="adding-functionality-with-extensions.html#sec:hgext:inotify" title="14.1. Improve performance with the inotify extension">Section 14.1, “Improve performance with the <code class="literal">inotify</code> extension”</a>,
-	we'll discuss the possibility of <span class="emphasis"><em>huge</em></span>
-	performance improvements using the <code class="literal">inotify</code> extension.</p></li></ul></div>
-<div class="sect1" title="14.1. Improve performance with the inotify extension">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="sec:hgext:inotify"></a>14.1. Improve performance with the <code class="literal">inotify</code> extension</h2></div></div></div>
-<p id="x_505"></a>Are you interested in having some of the most common
-      Mercurial operations run as much as a hundred times faster?
-      Read on!</p>
-<p id="x_506"></a>Mercurial has great performance under normal circumstances.
-      For example, when you run the <span class="command"><strong>hg
-	status</strong></span> command, Mercurial has to scan almost every
-      directory and file in your repository so that it can display
-      file status.  Many other Mercurial commands need to do the same
-      work behind the scenes; for example, the <span class="command"><strong>hg diff</strong></span> command uses the status
-      machinery to avoid doing an expensive comparison operation on
-      files that obviously haven't changed.</p>
-<p id="x_507"></a>Because obtaining file status is crucial to good
-      performance, the authors of Mercurial have optimised this code
-      to within an inch of its life.  However, there's no avoiding the
-      fact that when you run <span class="command"><strong>hg
-	status</strong></span>, Mercurial is going to have to perform at
-      least one expensive system call for each managed file to
-      determine whether it's changed since the last time Mercurial
-      checked.  For a sufficiently large repository, this can take a
-      long time.</p>
-<p id="x_508"></a>To put a number on the magnitude of this effect, I created a
-      repository containing 150,000 managed files.  I timed <span class="command"><strong>hg status</strong></span> as taking ten seconds to
-      run, even when <span class="emphasis"><em>none</em></span> of those files had been
-      modified.</p>
-<p id="x_509"></a>Many modern operating systems contain a file notification
-      facility. If a program signs up to an appropriate service, the
-      operating system will notify it every time a file of interest is
-      created, modified, or deleted.  On Linux systems, the kernel
-      component that does this is called
-      <code class="literal">inotify</code>.</p>
-<p id="x_50a"></a>Mercurial's <code class="literal">inotify</code>
-      extension talks to the kernel's <code class="literal">inotify</code>
-      component to optimise <span class="command"><strong>hg status</strong></span>
-      commands.  The extension has two components.  A daemon sits in
-      the background and receives notifications from the
-      <code class="literal">inotify</code> subsystem.  It also listens for
-      connections from a regular Mercurial command.  The extension
-      modifies Mercurial's behavior so that instead of scanning the
-      filesystem, it queries the daemon.  Since the daemon has perfect
-      information about the state of the repository, it can respond
-      with a result instantaneously, avoiding the need to scan every
-      directory and file in the repository.</p>
-<p id="x_50b"></a>Recall the ten seconds that I measured plain Mercurial as
-      taking to run <span class="command"><strong>hg status</strong></span> on a
-      150,000 file repository.  With the <code class="literal">inotify</code> extension enabled, the time
-      dropped to 0.1 seconds, a factor of <span class="emphasis"><em>one
-	hundred</em></span> faster.</p>
-<p id="x_50c"></a>Before we continue, please pay attention to some
-      caveats.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
-<li class="listitem"><p id="x_50d"></a>The <code class="literal">inotify</code>
-	  extension is Linux-specific.  Because it interfaces directly
-	  to the Linux kernel's <code class="literal">inotify</code> subsystem,
-	  it does not work on other operating systems.</p></li>
-<li class="listitem"><p id="x_50e"></a>It should work on any Linux distribution that
-	  was released after early 2005.  Older distributions are
-	  likely to have a kernel that lacks
-	  <code class="literal">inotify</code>, or a version of
-	  <code class="literal">glibc</code> that does not have the necessary
-	  interfacing support.</p></li>
-<li class="listitem"><p id="x_50f"></a>Not all filesystems are suitable for use with
-	  the <code class="literal">inotify</code> extension.
-	  Network filesystems such as NFS are a non-starter, for
-	  example, particularly if you're running Mercurial on several
-	  systems, all mounting the same network filesystem.  The
-	  kernel's <code class="literal">inotify</code> system has no way of
-	  knowing about changes made on another system.  Most local
-	  filesystems (e.g. ext3, XFS, ReiserFS) should work
-	  fine.</p></li>
-</ul></div>
-<p id="x_510"></a>The <code class="literal">inotify</code> extension is
-      not yet shipped with Mercurial as of May 2007, so it's a little
-      more involved to set up than other extensions.  But the
-      performance improvement is worth it!</p>
-<p id="x_511"></a>The extension currently comes in two parts: a set of patches
-      to the Mercurial source code, and a library of Python bindings
-      to the <code class="literal">inotify</code> subsystem.</p>
-<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
-<tr>
-<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="figs/note.png"></td>
-<th align="left">Note</th>
-</tr>
-<tr><td align="left" valign="top"><p id="x_512"></a>  There are <span class="emphasis"><em>two</em></span> Python
-	<code class="literal">inotify</code> binding libraries.  One of them is
-	called <code class="literal">pyinotify</code>, and is packaged by some
-	Linux distributions as <code class="literal">python-inotify</code>.
-	This is <span class="emphasis"><em>not</em></span> the one you'll need, as it is
-	too buggy and inefficient to be practical.</p></td></tr>
-</table></div>
-<p id="x_513"></a>To get going, it's best to already have a functioning copy
-      of Mercurial installed.</p>
-<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
-<tr>
-<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="figs/note.png"></td>
-<th align="left">Note</th>
-</tr>
-<tr><td align="left" valign="top"><p id="x_514"></a>  If you follow the instructions below, you'll be
-	<span class="emphasis"><em>replacing</em></span> and overwriting any existing
-	installation of Mercurial that you might already have, using
-	the latest <span class="quote">“<span class="quote">bleeding edge</span>”</span> Mercurial code. Don't
-	say you weren't warned!</p></td></tr>
-</table></div>
-<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem">
-<p id="x_515"></a>Clone the Python <code class="literal">inotify</code>
-	  binding repository.  Build and install it.</p>
-<pre class="programlisting">hg clone http://hg.kublai.com/python/inotify
-cd inotify
-python setup.py build --force
-sudo python setup.py install --skip-build</pre>
-</li>
-<li class="listitem">
-<p id="x_516"></a>Clone the <code class="filename">crew</code> Mercurial repository.
-	  Clone the <code class="literal">inotify</code> patch
-	  repository so that Mercurial Queues will be able to apply
-	  patches to your cope of the <code class="filename">crew</code> repository.</p>
-<pre class="programlisting">hg clone http://hg.intevation.org/mercurial/crew
-hg clone crew inotify
-hg clone http://hg.kublai.com/mercurial/patches/inotify inotify/.hg/patches</pre>
-</li>
-<li class="listitem"><p id="x_517"></a>Make sure that you have the Mercurial Queues
-	  extension, <code class="literal">mq</code>, enabled.  If
-	  you've never used MQ, read <a class="xref" href="managing-change-with-mercurial-queues.html#sec:mq:start" title="12.5. Getting started with Mercurial Queues">Section 12.5, “Getting started with Mercurial Queues”</a> to get started
-	  quickly.</p></li>
-<li class="listitem">
-<p id="x_518"></a>Go into the <code class="filename">inotify</code> repo, and apply all
-	  of the <code class="literal">inotify</code> patches
-	  using the <code class="option">hg
-	    -a</code> option to the <span class="command"><strong>qpush</strong></span> command.</p>
-<pre class="programlisting">cd inotify
-hg qpush -a</pre>
-</li>
-<li class="listitem"><p id="x_519"></a>  If you get an error message from <span class="command"><strong>qpush</strong></span>, you should not continue.
-	  Instead, ask for help.</p></li>
-<li class="listitem">
-<p id="x_51a"></a>Build and install the patched version of
-	  Mercurial.</p>
-<pre class="programlisting">python setup.py build --force
-sudo python setup.py install --skip-build</pre>
-</li>
-</ol></div>
-<p id="x_51b"></a>Once you've build a suitably patched version of Mercurial,
-      all you need to do to enable the <code class="literal">inotify</code> extension is add an entry to
-      your <code class="filename">~/.hgrc</code>.</p>
-<pre class="programlisting">[extensions] inotify =</pre>
-<p id="x_51c"></a>When the <code class="literal">inotify</code> extension
-      is enabled, Mercurial will automatically and transparently start
-      the status daemon the first time you run a command that needs
-      status in a repository.  It runs one status daemon per
-      repository.</p>
-<p id="x_51d"></a>The status daemon is started silently, and runs in the
-      background.  If you look at a list of running processes after
-      you've enabled the <code class="literal">inotify</code>
-      extension and run a few commands in different repositories,
-      you'll thus see a few <code class="literal">hg</code> processes sitting
-      around, waiting for updates from the kernel and queries from
-      Mercurial.</p>
-<p id="x_51e"></a>The first time you run a Mercurial command in a repository
-      when you have the <code class="literal">inotify</code>
-      extension enabled, it will run with about the same performance
-      as a normal Mercurial command.  This is because the status
-      daemon needs to perform a normal status scan so that it has a
-      baseline against which to apply later updates from the kernel.
-      However, <span class="emphasis"><em>every</em></span> subsequent command that does
-      any kind of status check should be noticeably faster on
-      repositories of even fairly modest size.  Better yet, the bigger
-      your repository is, the greater a performance advantage you'll
-      see.  The <code class="literal">inotify</code> daemon makes
-      status operations almost instantaneous on repositories of all
-      sizes!</p>
-<p id="x_51f"></a>If you like, you can manually start a status daemon using
-      the <span class="command"><strong>inserve</strong></span> command.
-      This gives you slightly finer control over how the daemon ought
-      to run.  This command will of course only be available when the
-      <code class="literal">inotify</code> extension is
-      enabled.</p>
-<p id="x_520"></a>When you're using the <code class="literal">inotify</code> extension, you should notice
-      <span class="emphasis"><em>no difference at all</em></span> in Mercurial's
-      behavior, with the sole exception of status-related commands
-      running a whole lot faster than they used to.  You should
-      specifically expect that commands will not print different
-      output; neither should they give different results. If either of
-      these situations occurs, please report a bug.</p>
-</div>
-<div class="sect1" title="14.2. Flexible diff support with the extdiff extension">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="sec:hgext:extdiff"></a>14.2. Flexible diff support with the <code class="literal">extdiff</code> extension</h2></div></div></div>
-<p id="x_521"></a>Mercurial's built-in <span class="command"><strong>hg
-	diff</strong></span> command outputs plaintext unified diffs.</p>
-<pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg diff</code></strong>
-diff -r 80997726a0ea myfile
---- a/myfile	Wed Jan 06 06:50:18 2010 +0000
-+++ b/myfile	Wed Jan 06 06:50:18 2010 +0000
-@@ -1,1 +1,2 @@
- The first line.
-+The second line.
-</pre>
-<p id="x_522"></a>If you would like to use an external tool to display
-      modifications, you'll want to use the <code class="literal">extdiff</code> extension.  This will let you
-      use, for example, a graphical diff tool.</p>
-<p id="x_523"></a>The <code class="literal">extdiff</code> extension is
-      bundled with Mercurial, so it's easy to set up.  In the <code class="literal">extensions</code> section of your
-      <code class="filename">~/.hgrc</code>, simply add a
-      one-line entry to enable the extension.</p>
-<pre class="programlisting">[extensions]
-extdiff =</pre>
-<p id="x_524"></a>This introduces a command named <span class="command"><strong>extdiff</strong></span>, which by default uses
-      your system's <span class="command"><strong>diff</strong></span> command to generate a
-      unified diff in the same form as the built-in <span class="command"><strong>hg diff</strong></span> command.</p>
-<pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg extdiff</code></strong>
---- a.80997726a0ea/myfile	2010-01-06 06:50:18.613674526 +0000
-+++ /tmp/extdiffNErQlu/a/myfile	2010-01-06 06:50:18.437687076 +0000
-@@ -1 +1,2 @@
- The first line.
-+The second line.
-</pre>
-<p id="x_525"></a>The result won't be exactly the same as with the built-in
-      <span class="command"><strong>hg diff</strong></span> variations, because the
-      output of <span class="command"><strong>diff</strong></span> varies from one system to
-      another, even when passed the same options.</p>
-<p id="x_526"></a>As the <span class="quote">“<span class="quote"><code class="literal">making snapshot</code></span>”</span>
-      lines of output above imply, the <span class="command"><strong>extdiff</strong></span> command works by
-      creating two snapshots of your source tree.  The first snapshot
-      is of the source revision; the second, of the target revision or
-      working directory.  The <span class="command"><strong>extdiff</strong></span> command generates
-      these snapshots in a temporary directory, passes the name of
-      each directory to an external diff viewer, then deletes the
-      temporary directory.  For efficiency, it only snapshots the
-      directories and files that have changed between the two
-      revisions.</p>
-<p id="x_527"></a>Snapshot directory names have the same base name as your
-      repository. If your repository path is <code class="filename">/quux/bar/foo</code>, then <code class="filename">foo</code> will be the name of each
-      snapshot directory.  Each snapshot directory name has its
-      changeset ID appended, if appropriate.  If a snapshot is of
-      revision <code class="literal">a631aca1083f</code>, the directory will be
-      named <code class="filename">foo.a631aca1083f</code>.
-      A snapshot of the working directory won't have a changeset ID
-      appended, so it would just be <code class="filename">foo</code> in this example.  To see what
-      this looks like in practice, look again at the <span class="command"><strong>extdiff</strong></span> example above.  Notice
-      that the diff has the snapshot directory names embedded in its
-      header.</p>
-<p id="x_528"></a>The <span class="command"><strong>extdiff</strong></span> command
-      accepts two important options. The <code class="option">hg -p</code> option
-      lets you choose a program to view differences with, instead of
-      <span class="command"><strong>diff</strong></span>.  With the <code class="option">hg -o</code> option,
-      you can change the options that <span class="command"><strong>extdiff</strong></span> passes to the program
-      (by default, these options are
-      <span class="quote">“<span class="quote"><code class="literal">-Npru</code></span>”</span>, which only make sense
-      if you're running <span class="command"><strong>diff</strong></span>).  In other respects,
-      the <span class="command"><strong>extdiff</strong></span> command
-      acts similarly to the built-in <span class="command"><strong>hg
-	diff</strong></span> command: you use the same option names, syntax,
-      and arguments to specify the revisions you want, the files you
-      want, and so on.</p>
-<p id="x_529"></a>As an example, here's how to run the normal system
-      <span class="command"><strong>diff</strong></span> command, getting it to generate context
-      diffs (using the <code class="option">-c</code> option)
-      instead of unified diffs, and five lines of context instead of
-      the default three (passing <code class="literal">5</code> as the argument
-      to the <code class="option">-C</code> option).</p>
-<pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg extdiff -o -NprcC5</code></strong>
-*** a.80997726a0ea/myfile	Wed Jan  6 06:50:18 2010
---- /tmp/extdiffNErQlu/a/myfile	Wed Jan  6 06:50:18 2010
-***************
-*** 1 ****
---- 1,2 ----
-  The first line.
-+ The second line.
-</pre>
-<p id="x_52a"></a>Launching a visual diff tool is just as easy.  Here's how to
-      launch the <span class="command"><strong>kdiff3</strong></span> viewer.</p>
-<pre class="programlisting">hg extdiff -p kdiff3 -o</pre>
-<p id="x_52b"></a>If your diff viewing command can't deal with directories,
-      you can easily work around this with a little scripting.  For an
-      example of such scripting in action with the <code class="literal">mq</code> extension and the
-      <span class="command"><strong>interdiff</strong></span> command, see <a class="xref" href="advanced-uses-of-mercurial-queues.html#mq-collab:tips:interdiff" title="13.9.2. Viewing the history of a patch">Section 13.9.2, “Viewing the history of a patch”</a>.</p>
-<div class="sect2" title="14.2.1. Defining command aliases">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id3071699"></a>14.2.1. Defining command aliases</h3></div></div></div>
-<p id="x_52c"></a>It can be cumbersome to remember the options to both the
-	<span class="command"><strong>extdiff</strong></span> command and
-	the diff viewer you want to use, so the <code class="literal">extdiff</code> extension lets you define
-	<span class="emphasis"><em>new</em></span> commands that will invoke your diff
-	viewer with exactly the right options.</p>
-<p id="x_52d"></a>All you need to do is edit your <code class="filename">~/.hgrc</code>, and add a section named
-	<code class="literal">extdiff</code>.  Inside this
-	section, you can define multiple commands.  Here's how to add
-	a <code class="literal">kdiff3</code> command.  Once you've defined
-	this, you can type <span class="quote">“<span class="quote"><code class="literal">hg kdiff3</code></span>”</span>
-	and the <code class="literal">extdiff</code> extension
-	will run <span class="command"><strong>kdiff3</strong></span> for you.</p>
-<pre class="programlisting">[extdiff]
-cmd.kdiff3 =</pre>
-<p id="x_52e"></a>If you leave the right hand side of the definition empty,
-	as above, the <code class="literal">extdiff</code>
-	extension uses the name of the command you defined as the name
-	of the external program to run.  But these names don't have to
-	be the same.  Here, we define a command named
-	<span class="quote">“<span class="quote"><code class="literal">hg wibble</code></span>”</span>, which runs
-	<span class="command"><strong>kdiff3</strong></span>.</p>
-<pre class="programlisting">[extdiff]
- cmd.wibble = kdiff3</pre>
-<p id="x_52f"></a>You can also specify the default options that you want to
-	invoke your diff viewing program with.  The prefix to use is
-	<span class="quote">“<span class="quote"><code class="literal">opts.</code></span>”</span>, followed by the name
-	of the command to which the options apply.  This example
-	defines a <span class="quote">“<span class="quote"><code class="literal">hg vimdiff</code></span>”</span> command
-	that runs the <span class="command"><strong>vim</strong></span> editor's
-	<code class="literal">DirDiff</code> extension.</p>
-<pre class="programlisting">[extdiff]
- cmd.vimdiff = vim
-opts.vimdiff = -f '+next' '+execute "DirDiff" argv(0) argv(1)'</pre>
-</div>
-</div>
-<div class="sect1" title="14.3. Cherrypicking changes with the transplant extension">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="sec:hgext:transplant"></a>14.3. Cherrypicking changes with the <code class="literal">transplant</code> extension</h2></div></div></div>
-<p id="x_530"></a>Need to have a long chat with Brendan about this.</p>
-</div>
-<div class="sect1" title="14.4. Send changes via email with the patchbomb extension">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="sec:hgext:patchbomb"></a>14.4. Send changes via email with the <code class="literal">patchbomb</code> extension</h2></div></div></div>
-<p id="x_531"></a>Many projects have a culture of <span class="quote">“<span class="quote">change
-	review</span>”</span>, in which people send their modifications to a
-      mailing list for others to read and comment on before they
-      commit the final version to a shared repository.  Some projects
-      have people who act as gatekeepers; they apply changes from
-      other people to a repository to which those others don't have
-      access.</p>
-<p id="x_532"></a>Mercurial makes it easy to send changes over email for
-      review or application, via its <code class="literal">patchbomb</code> extension.  The extension is
-      so named because changes are formatted as patches, and it's usual
-      to send one changeset per email message.  Sending a long series
-      of changes by email is thus much like <span class="quote">“<span class="quote">bombing</span>”</span> the
-      recipient's inbox, hence <span class="quote">“<span class="quote">patchbomb</span>”</span>.</p>
-<p id="x_533"></a>As usual, the basic configuration of the <code class="literal">patchbomb</code> extension takes just one or
-      two lines in your <code class="filename">
-	/.hgrc</code>.</p>
-<pre class="programlisting">[extensions]
-patchbomb =</pre>
-<p id="x_534"></a>Once you've enabled the extension, you will have a new
-      command available, named <span class="command"><strong>email</strong></span>.</p>
-<p id="x_535"></a>The safest and best way to invoke the <span class="command"><strong>email</strong></span> command is to
-      <span class="emphasis"><em>always</em></span> run it first with the <code class="option">hg -n</code> option.
-      This will show you what the command <span class="emphasis"><em>would</em></span>
-      send, without actually sending anything.  Once you've had a
-      quick glance over the changes and verified that you are sending
-      the right ones, you can rerun the same command, with the <code class="option">hg -n</code> option
-      removed.</p>
-<p id="x_536"></a>The <span class="command"><strong>email</strong></span> command
-      accepts the same kind of revision syntax as every other
-      Mercurial command.  For example, this command will send every
-      revision between 7 and <code class="literal">tip</code>, inclusive.</p>
-<pre class="programlisting">hg email -n 7:tip</pre>
-<p id="x_537"></a>You can also specify a <span class="emphasis"><em>repository</em></span> to
-      compare with.  If you provide a repository but no revisions, the
-      <span class="command"><strong>email</strong></span> command will
-      send all revisions in the local repository that are not present
-      in the remote repository.  If you additionally specify revisions
-      or a branch name (the latter using the <code class="option">hg -b</code> option),
-      this will constrain the revisions sent.</p>
-<p id="x_538"></a>It's perfectly safe to run the <span class="command"><strong>email</strong></span> command without the
-      names of the people you want to send to: if you do this, it will
-      just prompt you for those values interactively.  (If you're
-      using a Linux or Unix-like system, you should have enhanced
-      <code class="literal">readline</code>-style editing capabilities when
-      entering those headers, too, which is useful.)</p>
-<p id="x_539"></a>When you are sending just one revision, the <span class="command"><strong>email</strong></span> command will by
-      default use the first line of the changeset description as the
-      subject of the single email message it sends.</p>
-<p id="x_53a"></a>If you send multiple revisions, the <span class="command"><strong>email</strong></span> command will usually
-      send one message per changeset.  It will preface the series with
-      an introductory message, in which you should describe the
-      purpose of the series of changes you're sending.</p>
-<div class="sect2" title="14.4.1. Changing the behavior of patchbombs">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id3072184"></a>14.4.1. Changing the behavior of patchbombs</h3></div></div></div>
-<p id="x_53b"></a>Not every project has exactly the same conventions for
-	sending changes in email; the <code class="literal">patchbomb</code> extension tries to
-	accommodate a number of variations through command line
-	options.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
-<li class="listitem"><p id="x_53c"></a>You can write a subject for the introductory
-	    message on the command line using the <code class="option">hg -s</code>
-	    option.  This takes one argument, the text of the subject
-	    to use.</p></li>
-<li class="listitem"><p id="x_53d"></a>To change the email address from which the
-	    messages originate, use the <code class="option">hg -f</code>
-	    option.  This takes one argument, the email address to
-	    use.</p></li>
-<li class="listitem"><p id="x_53e"></a>The default behavior is to send unified diffs
-	    (see <a class="xref" href="managing-change-with-mercurial-queues.html#sec:mq:patch" title="12.4. Understanding patches">Section 12.4, “Understanding patches”</a> for a
-	    description of the
-	    format), one per message.  You can send a binary bundle
-	    instead with the <code class="option">hg -b</code>
-	    option.</p></li>
-<li class="listitem"><p id="x_53f"></a>Unified diffs are normally prefaced with a
-	    metadata header.  You can omit this, and send unadorned
-	    diffs, with the <code class="option">hg
-	      --plain</code> option.</p></li>
-<li class="listitem"><p id="x_540"></a>Diffs are normally sent <span class="quote">“<span class="quote">inline</span>”</span>,
-	    in the same body part as the description of a patch.  This
-	    makes it easiest for the largest number of readers to
-	    quote and respond to parts of a diff, as some mail clients
-	    will only quote the first MIME body part in a message. If
-	    you'd prefer to send the description and the diff in
-	    separate body parts, use the <code class="option">hg -a</code>
-	    option.</p></li>
-<li class="listitem"><p id="x_541"></a>Instead of sending mail messages, you can
-	    write them to an <code class="literal">mbox</code>-format mail
-	    folder using the <code class="option">hg -m</code>
-	    option.  That option takes one argument, the name of the
-	    file to write to.</p></li>
-<li class="listitem"><p id="x_542"></a>If you would like to add a
-	    <span class="command"><strong>diffstat</strong></span>-format summary to each patch,
-	    and one to the introductory message, use the <code class="option">hg -d</code>
-	    option.  The <span class="command"><strong>diffstat</strong></span> command displays
-	    a table containing the name of each file patched, the
-	    number of lines affected, and a histogram showing how much
-	    each file is modified.  This gives readers a qualitative
-	    glance at how complex a patch is.</p></li>
-</ul></div>
-</div>
-</div>
-</div>
-<div class="navfooter">
-<hr>
-<table width="100%" summary="Navigation footer">
-<tr>
-<td width="40%" align="left">
-<a accesskey="p" href="advanced-uses-of-mercurial-queues.html">Prev</a> </td>
-<td width="20%" align="center"> </td>
-<td width="40%" align="right"> <a accesskey="n" href="migrating-to-mercurial.html">Next</a>
-</td>
-</tr>
-<tr>
-<td width="40%" align="left" valign="top">Chapter 13. Advanced uses of Mercurial Queues </td>
-<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
-<td width="40%" align="right" valign="top"> Appendix A. Migrating to Mercurial</td>
-</tr>
-</table>
-</div>
-</body>
-</html>
--- a/web/html/backup/abc.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-pid_list=['x_4fe', 'x_4ff', 'x_546', 'x_503', 'x_505', 'x_506', 'x_507', 'x_508', 'x_509', 'x_50a', 'x_50b', 'x_50c', 'x_510', 'x_511', 'x_513', 'x_515', 'x_516', 'x_518', 'x_51a', 'x_51b', 'x_51c', 'x_51d', 'x_51e', 'x_51f', 'x_520', 'x_521', 'x_522', 'x_523', 'x_524', 'x_525', 'x_526', 'x_527', 'x_528', 'x_529', 'x_52a', 'x_52b', 'x_52c', 'x_52d', 'x_52e', 'x_52f', 'x_530', 'x_531', 'x_532', 'x_533', 'x_534', 'x_535', 'x_536', 'x_537', 'x_538', 'x_539', 'x_53a', 'x_53b']
-
--- a/web/html/backup/abcd.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,929 +0,0 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 9. Finding and fixing mistakes</title><link rel="stylesheet" href="/support/styles.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.3"><link rel="home" href="index.html" title="Mercurial: The Definitive Guide"><link rel="up" href="index.html" title="Mercurial: The Definitive Guide"><link rel="prev" href="managing-releases-and-branchy-development.html" title="Chapter 8. Managing releases and branchy development"><link rel="next" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks"><link rel="alternate" type="application/atom+xml" title="Comments" href="/feeds/comments/"><link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png"><script type="text/javascript" src="/support/jquery-min.js"></script><script type="text/javascript" src="/support/form.js"></script><script type="text/javascript" src="/support/hsbook.js"></script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><h2 class="booktitle"><a href="/">Mercurial: The Definitive Guide</a><span class="authors">by Bryan O'Sullivan</span></h2></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. Finding and fixing mistakes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="managing-releases-and-branchy-development.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="handling-repository-events-with-hooks.html">Next</a></td></tr></table></div><div class="chapter" lang="en" id="chap:undo"><div class="titlepage"><div><div><h2 class="title">Chapter 9. Finding and fixing mistakes</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id390081">Erasing local history</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id390087">The accidental commit</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:rollback">Rolling back a transaction</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id390858">The erroneous pull</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:rollback-after-push">Rolling back is useless once you've pushed</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id391000">You can only roll back once</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id391367">Reverting the mistaken change</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#sec:undo:mgmt">File management errors</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id392218">Dealing with committed changes</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392287">Backing out a changeset</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392424">Backing out the tip changeset</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id392766">Backing out a non-tip change</a></span></dt><dd><dl><dt><span class="sect3"><a href="finding-and-fixing-mistakes.html#id392990">Always use the --merge option</a></span></dt></dl></dd><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id393181">Gaining more control of the backout process</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id393814">Why hg backout works as
-	it does</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#sec:undo:aaaiiieee">Changes that should never have been</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394303">Backing out a merge</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394612">Protect yourself from escaped
-	changes</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394667">What to do about sensitive changes that escape</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#sec:undo:bisect">Finding the source of a bug</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id394992">Using the hg bisect
-	command</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396541">Cleaning up after your search</a></span></dt></dl></dd><dt><span class="sect1"><a href="finding-and-fixing-mistakes.html#id396622">Tips for finding bugs effectively</a></span></dt><dd><dl><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396628">Give consistent input</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396884">Automate as much as possible</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396713">Check your results</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396770">Beware interference between bugs</a></span></dt><dt><span class="sect2"><a href="finding-and-fixing-mistakes.html#id396856">Bracket your search lazily</a></span></dt></dl></dd></dl></div><p id="x_d2"><a name="x_d2"></a>To err might be human, but to really handle the consequences
-    well takes a top-notch revision control system.  In this chapter,
-    we'll discuss some of the techniques you can use when you find
-    that a problem has crept into your project.  Mercurial has some
-    highly capable features that will help you to isolate the sources
-    of problems, and to handle them appropriately.</p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="id390081">Erasing local history</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id390087">The accidental commit</h3></div></div></div><p id="x_d3"><a name="x_d3"></a>I have the occasional but persistent problem of typing
-	rather more quickly than I can think, which sometimes results
-	in me committing a changeset that is either incomplete or
-	plain wrong.  In my case, the usual kind of incomplete
-	changeset is one in which I've created a new source file, but
-	forgotten to <span class="command"><strong>hg add</strong></span> it.  A
-	“<span class="quote">plain wrong</span>” changeset is not as common, but no
-	less annoying.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="sec:undo:rollback">Rolling back a transaction</h3></div></div></div><p id="x_d4"><a name="x_d4"></a>In <a class="xref" href="behind-the-scenes.html#sec:concepts:txn" title="Safe operation">the section called “Safe operation”</a>, I
-	mentioned that Mercurial treats each modification of a
-	repository as a <span class="emphasis"><em>transaction</em></span>.  Every time
-	you commit a changeset or pull changes from another
-	repository, Mercurial remembers what you did.  You can undo,
-	or <span class="emphasis"><em>roll back</em></span>, exactly one of these
-	actions using the <span class="command"><strong>hg rollback</strong></span>
-
-	command.  (See <a class="xref" href="finding-and-fixing-mistakes.html#sec:undo:rollback-after-push" title="Rolling back is useless once you've pushed">the section called “Rolling back is useless once you've pushed”</a>
-	for an important caveat about the use of this command.)</p><p id="x_d5"><a name="x_d5"></a>Here's a mistake that I often find myself making:
-	committing a change in which I've created a new file, but
-	forgotten to <span class="command"><strong>hg add</strong></span>
-	it.</p><pre id="id390839" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
-M a
-<code class="prompt">$</code> <strong class="userinput"><code>echo b &gt; b</code></strong>
-
-<code class="prompt">$</code> <strong class="userinput"><code>hg commit -m 'Add file b'</code></strong>
-</pre><p id="x_d6"><a name="x_d6"></a>Looking at the output of <span class="command"><strong>hg
-	  status</strong></span> after the commit immediately confirms the
-	error.</p><pre id="id390541" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
-? b
-<code class="prompt">$</code> <strong class="userinput"><code>hg tip</code></strong>
-
-changeset:   1:f2db1de2ba4f
-tag:         tip
-user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
-date:        Tue May 05 06:55:44 2009 +0000
-summary:     Add file b
-
-</pre><p id="x_d7"><a name="x_d7"></a>The commit captured the changes to the file
-	<code class="filename">a</code>, but not the new file
-	<code class="filename">b</code>.  If I were to push this changeset to a
-	repository that I shared with a colleague, the chances are
-	high that something in <code class="filename">a</code> would refer to
-	<code class="filename">b</code>, which would not be present in their
-	repository when they pulled my changes.  I would thus become
-	the object of some indignation.</p><p id="x_d8"><a name="x_d8"></a>However, luck is with me—I've caught my error
-	before I pushed the changeset.  I use the <span class="command"><strong>hg rollback</strong></span> command, and Mercurial
-	makes that last changeset vanish.</p><pre id="id391066" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg rollback</code></strong>
-
-rolling back last transaction
-<code class="prompt">$</code> <strong class="userinput"><code>hg tip</code></strong>
-changeset:   0:cde70bc943e1
-tag:         tip
-user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
-date:        Tue May 05 06:55:44 2009 +0000
-summary:     First commit
-
-<code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
-M a
-? b
-</pre><p id="x_d9"><a name="x_d9"></a>Notice that the changeset is no longer present in the
-	repository's history, and the working directory once again
-	thinks that the file <code class="filename">a</code> is modified.  The
-	commit and rollback have left the working directory exactly as
-	it was prior to the commit; the changeset has been completely
-	erased.  I can now safely <span class="command"><strong>hg
-	  add</strong></span> the file <code class="filename">b</code>, and rerun my
-	commit.</p><pre id="id391024" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg add b</code></strong>
-
-<code class="prompt">$</code> <strong class="userinput"><code>hg commit -m 'Add file b, this time for real'</code></strong>
-</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id390858">The erroneous pull</h3></div></div></div><p id="x_da"><a name="x_da"></a>It's common practice with Mercurial to maintain separate
-	development branches of a project in different repositories.
-	Your development team might have one shared repository for
-	your project's “<span class="quote">0.9</span>” release, and another,
-	containing different changes, for the “<span class="quote">1.0</span>”
-	release.</p><p id="x_db"><a name="x_db"></a>Given this, you can imagine that the consequences could be
-	messy if you had a local “<span class="quote">0.9</span>” repository, and
-	accidentally pulled changes from the shared “<span class="quote">1.0</span>”
-	repository into it.  At worst, you could be paying
-	insufficient attention, and push those changes into the shared
-	“<span class="quote">0.9</span>” tree, confusing your entire team (but don't
-	worry, we'll return to this horror scenario later).  However,
-	it's more likely that you'll notice immediately, because
-	Mercurial will display the URL it's pulling from, or you will
-	see it pull a suspiciously large number of changes into the
-	repository.</p><p id="x_dc"><a name="x_dc"></a>The <span class="command"><strong>hg rollback</strong></span> command
-	will work nicely to expunge all of the changesets that you
-	just pulled.  Mercurial groups all changes from one <span class="command"><strong>hg pull</strong></span> into a single transaction,
-	so one <span class="command"><strong>hg rollback</strong></span> is all you
-	need to undo this mistake.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="sec:undo:rollback-after-push">Rolling back is useless once you've pushed</h3></div></div></div><p id="x_dd"><a name="x_dd"></a>The value of the <span class="command"><strong>hg
-	  rollback</strong></span> command drops to zero once you've pushed
-	your changes to another repository.  Rolling back a change
-	makes it disappear entirely, but <span class="emphasis"><em>only</em></span> in
-	the repository in which you perform the <span class="command"><strong>hg rollback</strong></span>.  Because a rollback
-	eliminates history, there's no way for the disappearance of a
-	change to propagate between repositories.</p><p id="x_de"><a name="x_de"></a>If you've pushed a change to another
-	repository—particularly if it's a shared
-	repository—it has essentially “<span class="quote">escaped into the
-	  wild,</span>” and you'll have to recover from your mistake
-	in a different way.  If you push a changeset somewhere, then
-	roll it back, then pull from the repository you pushed to, the
-	changeset you thought you'd gotten rid of will simply reappear
-	in your repository.</p><p id="x_df"><a name="x_df"></a>(If you absolutely know for sure that the change
-	you want to roll back is the most recent change in the
-	repository that you pushed to, <span class="emphasis"><em>and</em></span> you
-	know that nobody else could have pulled it from that
-	repository, you can roll back the changeset there, too, but
-	you really should not expect this to work reliably.  Sooner or
-	later a change really will make it into a repository that you
-	don't directly control (or have forgotten about), and come
-	back to bite you.)</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id391000">You can only roll back once</h3></div></div></div><p id="x_e0"><a name="x_e0"></a>Mercurial stores exactly one transaction in its
-	transaction log; that transaction is the most recent one that
-	occurred in the repository. This means that you can only roll
-	back one transaction.  If you expect to be able to roll back
-	one transaction, then its predecessor, this is not the
-	behavior you will get.</p><pre id="id391424" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg rollback</code></strong>
-
-rolling back last transaction
-<code class="prompt">$</code> <strong class="userinput"><code>hg rollback</code></strong>
-no rollback information available
-</pre><p id="x_e1"><a name="x_e1"></a>Once you've rolled back one transaction in a repository,
-	you can't roll back again in that repository until you perform
-	another commit or pull.</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="id391367">Reverting the mistaken change</h2></div></div></div><p id="x_e2"><a name="x_e2"></a>If you make a modification to a file, and decide that you
-      really didn't want to change the file at all, and you haven't
-      yet committed your changes, the <span class="command"><strong>hg
-	revert</strong></span> command is the one you'll need.  It looks at
-      the changeset that's the parent of the working directory, and
-      restores the contents of the file to their state as of that
-      changeset. (That's a long-winded way of saying that, in the
-      normal case, it undoes your modifications.)</p><p id="x_e3"><a name="x_e3"></a>Let's illustrate how the <span class="command"><strong>hg
-	revert</strong></span> command works with yet another small example.
-      We'll begin by modifying a file that Mercurial is already
-      tracking.</p><pre id="id391316" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cat file</code></strong>
-
-original content
-<code class="prompt">$</code> <strong class="userinput"><code>echo unwanted change &gt;&gt; file</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>hg diff file</code></strong>
-diff -r b52afd4afc59 file
---- a/file	Tue May 05 06:55:32 2009 +0000
-+++ b/file	Tue May 05 06:55:32 2009 +0000
-@@ -1,1 +1,2 @@
- original content
-+unwanted change
-</pre><p id="x_e4"><a name="x_e4"></a>If we don't
-      want that change, we can simply <span class="command"><strong>hg
-	revert</strong></span> the file.</p><pre id="id391251" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
-
-M file
-<code class="prompt">$</code> <strong class="userinput"><code>hg revert file</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>cat file</code></strong>
-original content
-</pre><p id="x_e5"><a name="x_e5"></a>The <span class="command"><strong>hg revert</strong></span> command
-      provides us with an extra degree of safety by saving our
-      modified file with a <code class="filename">.orig</code>
-      extension.</p><pre id="id391767" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
-
-? file.orig
-<code class="prompt">$</code> <strong class="userinput"><code>cat file.orig</code></strong>
-original content
-unwanted change
-</pre><div class="tip"><table border="0" summary="Tip: Be careful with .orig files"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="/support/figs/tip.png"></td><th align="left">Be careful with .orig files</th></tr><tr><td align="left" valign="top"><p id="x_6b8"><a name="x_6b8"></a>It's extremely unlikely that you are either using
-	Mercurial to manage files with <code class="filename">.orig</code>
-	extensions or that you even care about the contents of such
-	files.  Just in case, though, it's useful to remember that
-	<span class="command"><strong>hg revert</strong></span> will
-	unconditionally overwrite an existing file with a
-	<code class="filename">.orig</code> extension. For instance, if you
-	already have a file named <code class="filename">foo.orig</code> when
-	you revert <code class="filename">foo</code>, the contents of
-	<code class="filename">foo.orig</code> will be clobbered.</p></td></tr></table></div><p id="x_e6"><a name="x_e6"></a>Here is a summary of the cases that the <span class="command"><strong>hg revert</strong></span> command can deal with.  We
-      will describe each of these in more detail in the section that
-      follows.</p><div class="itemizedlist"><ul type="disc"><li><p id="x_e7"><a name="x_e7"></a>If you modify a file, it will restore the file
-	  to its unmodified state.</p></li><li><p id="x_e8"><a name="x_e8"></a>If you <span class="command"><strong>hg add</strong></span> a
-	  file, it will undo the “<span class="quote">added</span>” state of the
-	  file, but leave the file itself untouched.</p></li><li><p id="x_e9"><a name="x_e9"></a>If you delete a file without telling Mercurial,
-	  it will restore the file to its unmodified contents.</p></li><li><p id="x_ea"><a name="x_ea"></a>If you use the <span class="command"><strong>hg
-	    remove</strong></span> command to remove a file, it will undo
-	  the “<span class="quote">removed</span>” state of the file, and restore
-	  the file to its unmodified contents.</p></li></ul></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="sec:undo:mgmt">File management errors</h3></div></div></div><p id="x_eb"><a name="x_eb"></a>The <span class="command"><strong>hg revert</strong></span> command is
-	useful for more than just modified files.  It lets you reverse
-	the results of all of Mercurial's file management
-	commands—<span class="command"><strong>hg add</strong></span>,
-	<span class="command"><strong>hg remove</strong></span>, and so on.</p><p id="x_ec"><a name="x_ec"></a>If you <span class="command"><strong>hg add</strong></span> a file,
-	then decide that in fact you don't want Mercurial to track it,
-	use <span class="command"><strong>hg revert</strong></span> to undo the
-	add.  Don't worry; Mercurial will not modify the file in any
-	way.  It will just “<span class="quote">unmark</span>” the file.</p><pre id="id391756" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>echo oops &gt; oops</code></strong>
-
-<code class="prompt">$</code> <strong class="userinput"><code>hg add oops</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>hg status oops</code></strong>
-A oops
-<code class="prompt">$</code> <strong class="userinput"><code>hg revert oops</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
-
-? oops
-</pre><p id="x_ed"><a name="x_ed"></a>Similarly, if you ask Mercurial to <span class="command"><strong>hg remove</strong></span> a file, you can use
-	<span class="command"><strong>hg revert</strong></span> to restore it to
-	the contents it had as of the parent of the working directory.
-	
-</p><pre id="id392036" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg remove file</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
-R file
-
-<code class="prompt">$</code> <strong class="userinput"><code>hg revert file</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>ls file</code></strong>
-file
-</pre><p>
-
- This works just as
-	well for a file that you deleted by hand, without telling
-	Mercurial (recall that in Mercurial terminology, this kind of
-	file is called “<span class="quote">missing</span>”).</p><pre id="id391954" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>rm file</code></strong>
-
-<code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
-! file
-<code class="prompt">$</code> <strong class="userinput"><code>hg revert file</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>ls file</code></strong>
-file
-</pre><p id="x_ee"><a name="x_ee"></a>If you revert a <span class="command"><strong>hg copy</strong></span>,
-	the copied-to file remains in your working directory
-	afterwards, untracked.  Since a copy doesn't affect the
-	copied-from file in any way, Mercurial doesn't do anything
-	with the copied-from file.</p><pre id="id392181" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg copy file new-file</code></strong>
-
-<code class="prompt">$</code> <strong class="userinput"><code>hg revert new-file</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>hg status</code></strong>
-? new-file
-</pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="id392218">Dealing with committed changes</h2></div></div></div><p id="x_f5"><a name="x_f5"></a>Consider a case where you have committed a change
-      <span class="emphasis"><em>a</em></span>, and another change
-      <span class="emphasis"><em>b</em></span> on top of it; you then realise that
-      change <span class="emphasis"><em>a</em></span> was incorrect.  Mercurial lets you
-      “<span class="quote">back out</span>” an entire changeset automatically, and
-      building blocks that let you reverse part of a changeset by
-      hand.</p><p id="x_f6"><a name="x_f6"></a>Before you read this section, here's something to
-      keep in mind: the <span class="command"><strong>hg backout</strong></span>
-
-      command undoes the effect of a change by
-      <span class="emphasis"><em>adding</em></span> to your repository's history, not by
-      modifying or erasing it.  It's the right tool to use if you're
-      fixing bugs, but not if you're trying to undo some change that
-      has catastrophic consequences.  To deal with those, see
-      <a class="xref" href="finding-and-fixing-mistakes.html#sec:undo:aaaiiieee" title="Changes that should never have been">the section called “Changes that should never have been”</a>.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id392287">Backing out a changeset</h3></div></div></div><p id="x_f7"><a name="x_f7"></a>The <span class="command"><strong>hg backout</strong></span> command
-	lets you “<span class="quote">undo</span>” the effects of an entire
-	changeset in an automated fashion.  Because Mercurial's
-	history is immutable, this command <span class="emphasis"><em>does
-	  not</em></span> get rid of the changeset you want to undo.
-	Instead, it creates a new changeset that
-	<span class="emphasis"><em>reverses</em></span> the effect of the to-be-undone
-	changeset.</p><p id="x_f8"><a name="x_f8"></a>The operation of the <span class="command"><strong>hg
-	  backout</strong></span> command is a little intricate, so let's
-	illustrate it with some examples.  First, we'll create a
-	repository with some simple changes.</p><pre id="id392685" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg init myrepo</code></strong>
-
-<code class="prompt">$</code> <strong class="userinput"><code>cd myrepo</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>echo first change &gt;&gt; myfile</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>hg add myfile</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>hg commit -m 'first change'</code></strong>
-
-<code class="prompt">$</code> <strong class="userinput"><code>echo second change &gt;&gt; myfile</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>hg commit -m 'second change'</code></strong>
-</pre><p id="x_f9"><a name="x_f9"></a>The <span class="command"><strong>hg backout</strong></span> command
-	takes a single changeset ID as its argument; this is the
-	changeset to back out.  Normally, <span class="command"><strong>hg
-	  backout</strong></span> will drop you into a text editor to write
-	a commit message, so you can record why you're backing the
-	change out.  In this example, we provide a commit message on
-	the command line using the <code class="option">-m</code> option.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id392424">Backing out the tip changeset</h3></div></div></div><p id="x_fa"><a name="x_fa"></a>We're going to start by backing out the last changeset we
-	committed.</p><pre id="id392577" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg backout -m 'back out second change' tip</code></strong>
-
-reverting myfile
-changeset 2:01adc4672142 backs out changeset 1:7e341ee3be7a
-<code class="prompt">$</code> <strong class="userinput"><code>cat myfile</code></strong>
-first change
-</pre><p id="x_fb"><a name="x_fb"></a>You can see that the second line from
-	<code class="filename">myfile</code> is no longer present.  Taking a
-	look at the output of <span class="command"><strong>hg log</strong></span>
-	gives us an idea of what the <span class="command"><strong>hg
-	  backout</strong></span> command has done.
-	
-
-</p><pre id="id392554" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg log --style compact</code></strong>
-2[tip]   01adc4672142   2009-05-05 06:55 +0000   bos
-  back out second change
-
-1   7e341ee3be7a   2009-05-05 06:55 +0000   bos
-  second change
-
-0   56b97fc928f2   2009-05-05 06:55 +0000   bos
-  first change
-
-</pre><p>
-
- Notice that the new changeset
-	that <span class="command"><strong>hg backout</strong></span> has created
-	is a child of the changeset we backed out.  It's easier to see
-	this in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:backout" title="Figure 9.1. Backing out a change using the hg backout command">Figure 9.1, “Backing out a change using the hg backout command”</a>, which presents a
-	graphical view of the change history.  As you can see, the
-	history is nice and linear.</p><div class="figure"><a name="fig:undo:backout"></a><p class="title"><b>Figure 9.1. Backing out a change using the <span class="command">hg backout</span> command</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/undo-simple.png" alt="XXX add text"></div></div></div><br class="figure-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id392766">Backing out a non-tip change</h3></div></div></div><p id="x_fd"><a name="x_fd"></a>If you want to back out a change other than the last one
-	you committed, pass the <code class="option">--merge</code> option to the
-	<span class="command"><strong>hg backout</strong></span> command.</p><pre id="id393141" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd ..</code></strong>
-
-<code class="prompt">$</code> <strong class="userinput"><code>hg clone -r1 myrepo non-tip-repo</code></strong>
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-updating working directory
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-<code class="prompt">$</code> <strong class="userinput"><code>cd non-tip-repo</code></strong>
-</pre><p id="x_fe"><a name="x_fe"></a>This makes backing out any changeset a
-	“<span class="quote">one-shot</span>” operation that's usually simple and
-	fast.</p><pre id="id392845" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>echo third change &gt;&gt; myfile</code></strong>
-
-<code class="prompt">$</code> <strong class="userinput"><code>hg commit -m 'third change'</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>hg backout --merge -m 'back out second change' 1</code></strong>
-reverting myfile
-created new head
-changeset 3:abc7fd860049 backs out changeset 1:7e341ee3be7a
-merging with changeset 3:abc7fd860049
-merging myfile
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-</pre><p id="x_ff"><a name="x_ff"></a>If you take a look at the contents of
-	<code class="filename">myfile</code> after the backout finishes, you'll
-	see that the first and third changes are present, but not the
-	second.</p><pre id="id392886" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cat myfile</code></strong>
-
-first change
-third change
-</pre><p id="x_100"><a name="x_100"></a>As the graphical history in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:backout-non-tip" title="Figure 9.2. Automated backout of a non-tip change using the hg backout command">Figure 9.2, “Automated backout of a non-tip change using the
-	  hg backout command”</a> illustrates, Mercurial
-	still commits one change in this kind of situation (the
-	box-shaped node is the ones that Mercurial commits
-	automatically), but the revision graph now looks different.
-	Before Mercurial begins the backout process, it first
-	remembers what the current parent of the working directory is.
-	It then backs out the target changeset, and commits that as a
-	changeset.  Finally, it merges back to the previous parent of
-	the working directory, but notice that it <span class="emphasis"><em>does not
-	  commit</em></span> the result of the merge.  The repository
-	now contains two heads, and the working directory is in a
-	merge state.</p><div class="figure"><a name="fig:undo:backout-non-tip"></a><p class="title"><b>Figure 9.2. Automated backout of a non-tip change using the
-	  <span class="command">hg backout</span> command</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/undo-non-tip.png" alt="XXX add text"></div></div></div><br class="figure-break"><p id="x_103"><a name="x_103"></a>The result is that you end up “<span class="quote">back where you
-	  were</span>”, only with some extra history that undoes the
-	effect of the changeset you wanted to back out.</p><p id="x_6b9"><a name="x_6b9"></a>You might wonder why Mercurial does not commit the result
-	of the merge that it performed.  The reason lies in Mercurial
-	behaving conservatively: a merge naturally has more scope for
-	error than simply undoing the effect of the tip changeset,
-	so your work will be safest if you first inspect (and test!)
-	the result of the merge, <span class="emphasis"><em>then</em></span> commit
-	it.</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title" id="id392990">Always use the <code class="option">--merge</code> option</h4></div></div></div><p id="x_104"><a name="x_104"></a>In fact, since the <code class="option">--merge</code> option will do the
-	  “<span class="quote">right thing</span>” whether or not the changeset
-	  you're backing out is the tip (i.e. it won't try to merge if
-	  it's backing out the tip, since there's no need), you should
-	  <span class="emphasis"><em>always</em></span> use this option when you run the
-	  <span class="command"><strong>hg backout</strong></span> command.</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id393181">Gaining more control of the backout process</h3></div></div></div><p id="x_105"><a name="x_105"></a>While I've recommended that you always use the <code class="option">--merge</code> option when backing
-	out a change, the <span class="command"><strong>hg backout</strong></span>
-
-	command lets you decide how to merge a backout changeset.
-	Taking control of the backout process by hand is something you
-	will rarely need to do, but it can be useful to understand
-	what the <span class="command"><strong>hg backout</strong></span> command
-	is doing for you automatically.  To illustrate this, let's
-	clone our first repository, but omit the backout change that
-	it contains.</p><pre id="id393568" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cd ..</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>hg clone -r1 myrepo newrepo</code></strong>
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-updating working directory
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-<code class="prompt">$</code> <strong class="userinput"><code>cd newrepo</code></strong>
-
-</pre><p id="x_106"><a name="x_106"></a>As with our
-	earlier example, We'll commit a third changeset, then back out
-	its parent, and see what happens.</p><pre id="id393553" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>echo third change &gt;&gt; myfile</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>hg commit -m 'third change'</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>hg backout -m 'back out second change' 1</code></strong>
-reverting myfile
-created new head
-changeset 3:abc7fd860049 backs out changeset 1:7e341ee3be7a
-the backout changeset is a new head - do not forget to merge
-(use "backout --merge" if you want to auto-merge)
-</pre><p id="x_107"><a name="x_107"></a>Our new changeset is again a descendant of the changeset
-	we backout out; it's thus a new head, <span class="emphasis"><em>not</em></span>
-
-	a descendant of the changeset that was the tip.  The <span class="command"><strong>hg backout</strong></span> command was quite
-	explicit in telling us this.</p><pre id="id393314" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg log --style compact</code></strong>
-3[tip]:1   abc7fd860049   2009-05-05 06:55 +0000   bos
-  back out second change
-
-2   bae4005ddac4   2009-05-05 06:55 +0000   bos
-  third change
-
-1   7e341ee3be7a   2009-05-05 06:55 +0000   bos
-  second change
-
-0   56b97fc928f2   2009-05-05 06:55 +0000   bos
-  first change
-
-</pre><p id="x_108"><a name="x_108"></a>Again, it's easier to see what has happened by looking at
-	a graph of the revision history, in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:backout-manual" title="Figure 9.3. Backing out a change using the hg backout command">Figure 9.3, “Backing out a change using the hg backout command”</a>.  This makes it clear
-	that when we use <span class="command"><strong>hg backout</strong></span>
-	to back out a change other than the tip, Mercurial adds a new
-	head to the repository (the change it committed is
-	box-shaped).</p><div class="figure"><a name="fig:undo:backout-manual"></a><p class="title"><b>Figure 9.3. Backing out a change using the <span class="command">hg backout</span> command</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/undo-manual.png" alt="XXX add text"></div></div></div><br class="figure-break"><p id="x_10a"><a name="x_10a"></a>After the <span class="command"><strong>hg backout</strong></span>
-
-	command has completed, it leaves the new
-	“<span class="quote">backout</span>” changeset as the parent of the working
-	directory.</p><pre id="id393912" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg parents</code></strong>
-changeset:   2:bae4005ddac4
-user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
-date:        Tue May 05 06:55:12 2009 +0000
-summary:     third change
-
-</pre><p id="x_10b"><a name="x_10b"></a>Now we have two isolated sets of changes.</p><pre id="id393905" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg heads</code></strong>
-
-changeset:   3:abc7fd860049
-tag:         tip
-parent:      1:7e341ee3be7a
-user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
-date:        Tue May 05 06:55:12 2009 +0000
-summary:     back out second change
-
-changeset:   2:bae4005ddac4
-user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
-date:        Tue May 05 06:55:12 2009 +0000
-summary:     third change
-
-</pre><p id="x_10c"><a name="x_10c"></a>Let's think about what we expect to see as the contents of
-	<code class="filename">myfile</code> now.  The first change should be
-	present, because we've never backed it out.  The second change
-	should be missing, as that's the change we backed out.  Since
-	the history graph shows the third change as a separate head,
-	we <span class="emphasis"><em>don't</em></span> expect to see the third change
-	present in <code class="filename">myfile</code>.</p><pre id="id393884" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>cat myfile</code></strong>
-
-first change
-</pre><p id="x_10d"><a name="x_10d"></a>To get the third change back into the file, we just do a
-	normal merge of our two heads.</p><pre id="id393845" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg merge</code></strong>
-abort: outstanding uncommitted changes
-<code class="prompt">$</code> <strong class="userinput"><code>hg commit -m 'merged backout with previous tip'</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>cat myfile</code></strong>
-first change
-</pre><p id="x_10e"><a name="x_10e"></a>Afterwards, the graphical history of our
-	repository looks like
-	<a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:backout-manual-merge" title="Figure 9.4. Manually merging a backout change">Figure 9.4, “Manually merging a backout change”</a>.</p><div class="figure"><a name="fig:undo:backout-manual-merge"></a><p class="title"><b>Figure 9.4. Manually merging a backout change</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/undo-manual-merge.png" alt="XXX add text"></div></div></div><br class="figure-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id393814">Why <span class="command"><strong>hg backout</strong></span> works as
-	it does</h3></div></div></div><p id="x_110"><a name="x_110"></a>Here's a brief description of how the <span class="command"><strong>hg backout</strong></span> command works.</p><div class="orderedlist"><ol type="1"><li><p id="x_111"><a name="x_111"></a>It ensures that the working directory is
-	    “<span class="quote">clean</span>”, i.e. that the output of <span class="command"><strong>hg status</strong></span> would be empty.</p></li><li><p id="x_112"><a name="x_112"></a>It remembers the current parent of the working
-	    directory.  Let's call this changeset
-	    <code class="literal">orig</code>.</p></li><li><p id="x_113"><a name="x_113"></a>It does the equivalent of a <span class="command"><strong>hg update</strong></span> to sync the working
-	    directory to the changeset you want to back out.  Let's
-	    call this changeset <code class="literal">backout</code>.</p></li><li><p id="x_114"><a name="x_114"></a>It finds the parent of that changeset.  Let's
-	    call that changeset <code class="literal">parent</code>.</p></li><li><p id="x_115"><a name="x_115"></a>For each file that the
-	    <code class="literal">backout</code> changeset affected, it does the
-	    equivalent of a <span class="command"><strong>hg revert -r
-	      parent</strong></span> on that file, to restore it to the
-	    contents it had before that changeset was
-	    committed.</p></li><li><p id="x_116"><a name="x_116"></a>It commits the result as a new changeset.
-	    This changeset has <code class="literal">backout</code> as its
-	    parent.</p></li><li><p id="x_117"><a name="x_117"></a>If you specify <code class="option">--merge</code> on the command
-	    line, it merges with <code class="literal">orig</code>, and commits
-	    the result of the merge.</p></li></ol></div><p id="x_118"><a name="x_118"></a>An alternative way to implement the <span class="command"><strong>hg backout</strong></span> command would be to
-	<span class="command"><strong>hg export</strong></span> the
-	to-be-backed-out changeset as a diff, then use the <code class="option">--reverse</code> option to the
-	<span class="command"><strong>patch</strong></span> command to reverse the effect of the
-	change without fiddling with the working directory.  This
-	sounds much simpler, but it would not work nearly as
-	well.</p><p id="x_119"><a name="x_119"></a>The reason that <span class="command"><strong>hg
-	  backout</strong></span> does an update, a commit, a merge, and
-	another commit is to give the merge machinery the best chance
-	to do a good job when dealing with all the changes
-	<span class="emphasis"><em>between</em></span> the change you're backing out and
-	the current tip.</p><p id="x_11a"><a name="x_11a"></a>If you're backing out a changeset that's 100 revisions
-	back in your project's history, the chances that the
-	<span class="command"><strong>patch</strong></span> command will be able to apply a
-	reverse diff cleanly are not good, because intervening changes
-	are likely to have “<span class="quote">broken the context</span>” that
-	<span class="command"><strong>patch</strong></span> uses to determine whether it can
-	apply a patch (if this sounds like gibberish, see <a class="xref" href="managing-change-with-mercurial-queues.html#sec:mq:patch" title="Understanding patches">the section called “Understanding patches”</a> for a
-	discussion of the <span class="command"><strong>patch</strong></span> command).  Also,
-	Mercurial's merge machinery will handle files and directories
-	being renamed, permission changes, and modifications to binary
-	files, none of which <span class="command"><strong>patch</strong></span> can deal
-	with.</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="sec:undo:aaaiiieee">Changes that should never have been</h2></div></div></div><p id="x_11b"><a name="x_11b"></a>Most of the time, the <span class="command"><strong>hg
-	backout</strong></span> command is exactly what you need if you want
-      to undo the effects of a change.  It leaves a permanent record
-      of exactly what you did, both when committing the original
-      changeset and when you cleaned up after it.</p><p id="x_11c"><a name="x_11c"></a>On rare occasions, though, you may find that you've
-      committed a change that really should not be present in the
-      repository at all.  For example, it would be very unusual, and
-      usually considered a mistake, to commit a software project's
-      object files as well as its source files.  Object files have
-      almost no intrinsic value, and they're <span class="emphasis"><em>big</em></span>,
-      so they increase the size of the repository and the amount of
-      time it takes to clone or pull changes.</p><p id="x_11d"><a name="x_11d"></a>Before I discuss the options that you have if you commit a
-      “<span class="quote">brown paper bag</span>” change (the kind that's so bad
-      that you want to pull a brown paper bag over your head), let me
-      first discuss some approaches that probably won't work.</p><p id="x_11e"><a name="x_11e"></a>Since Mercurial treats history as
-      accumulative—every change builds on top of all changes
-      that preceded it—you generally can't just make disastrous
-      changes disappear.  The one exception is when you've just
-      committed a change, and it hasn't been pushed or pulled into
-      another repository.  That's when you can safely use the <span class="command"><strong>hg rollback</strong></span> command, as I detailed in
-      <a class="xref" href="finding-and-fixing-mistakes.html#sec:undo:rollback" title="Rolling back a transaction">the section called “Rolling back a transaction”</a>.</p><p id="x_11f"><a name="x_11f"></a>After you've pushed a bad change to another repository, you
-      <span class="emphasis"><em>could</em></span> still use <span class="command"><strong>hg
-	rollback</strong></span> to make your local copy of the change
-      disappear, but it won't have the consequences you want.  The
-      change will still be present in the remote repository, so it
-      will reappear in your local repository the next time you
-      pull.</p><p id="x_120"><a name="x_120"></a>If a situation like this arises, and you know which
-      repositories your bad change has propagated into, you can
-      <span class="emphasis"><em>try</em></span> to get rid of the change from
-      <span class="emphasis"><em>every</em></span> one of those repositories.  This is,
-      of course, not a satisfactory solution: if you miss even a
-      single repository while you're expunging, the change is still
-      “<span class="quote">in the wild</span>”, and could propagate further.</p><p id="x_121"><a name="x_121"></a>If you've committed one or more changes
-      <span class="emphasis"><em>after</em></span> the change that you'd like to see
-      disappear, your options are further reduced. Mercurial doesn't
-      provide a way to “<span class="quote">punch a hole</span>” in history, leaving
-      changesets intact.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id394303">Backing out a merge</h3></div></div></div><p id="x_6ba"><a name="x_6ba"></a>Since merges are often complicated, it is not unheard of
-	for a merge to be mangled badly, but committed erroneously.
-	Mercurial provides an important safeguard against bad merges
-	by refusing to commit unresolved files, but human ingenuity
-	guarantees that it is still possible to mess a merge up and
-	commit it.</p><p id="x_6bb"><a name="x_6bb"></a>Given a bad merge that has been committed, usually the
-	best way to approach it is to simply try to repair the damage
-	by hand.  A complete disaster that cannot be easily fixed up
-	by hand ought to be very rare, but the <span class="command"><strong>hg backout</strong></span> command may help in
-	making the cleanup easier. It offers a <code class="option">--parent</code> option, which lets
-	you specify which parent to revert to when backing out a
-	merge.</p><div class="figure"><a name="fig:undo:bad-merge-1"></a><p class="title"><b>Figure 9.5. A bad merge</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/bad-merge-1.png" alt="XXX add text"></div></div></div><br class="figure-break"><p id="x_6bc"><a name="x_6bc"></a>Suppose we have a revision graph like that in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:bad-merge-1" title="Figure 9.5. A bad merge">Figure 9.5, “A bad merge”</a>.  What we'd like is to
-	<span class="emphasis"><em>redo</em></span> the merge of revisions 2 and
-	3.</p><p id="x_6bd"><a name="x_6bd"></a>One way to do so would be as follows.</p><div class="orderedlist"><ol type="1"><li><p id="x_6be"><a name="x_6be"></a>Call <span class="command"><strong>hg backout --rev=4
-	      --parent=2</strong></span>.  This tells <span class="command"><strong>hg backout</strong></span> to back out revision
-	    4, which is the bad merge, and to when deciding which
-	    revision to prefer, to choose parent 2, one of the parents
-	    of the merge.  The effect can be seen in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:bad-merge-2" title="Figure 9.6. Backing out the merge, favoring one parent">Figure 9.6, “Backing out the merge, favoring one parent”</a>.</p><div class="figure"><a name="fig:undo:bad-merge-2"></a><p class="title"><b>Figure 9.6. Backing out the merge, favoring one parent</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/bad-merge-2.png" alt="XXX add text"></div></div></div><br class="figure-break"></li><li><p id="x_6bf"><a name="x_6bf"></a>Call <span class="command"><strong>hg backout --rev=4
-	      --parent=3</strong></span>.  This tells <span class="command"><strong>hg backout</strong></span> to back out revision
-	    4 again, but this time to choose parent 3, the other
-	    parent of the merge.  The result is visible in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:bad-merge-3" title="Figure 9.7. Backing out the merge, favoring the other parent">Figure 9.7, “Backing out the merge, favoring the other
-	      parent”</a>, in which the repository
-	    now contains three heads.</p><div class="figure"><a name="fig:undo:bad-merge-3"></a><p class="title"><b>Figure 9.7. Backing out the merge, favoring the other
-	      parent</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/bad-merge-3.png" alt="XXX add text"></div></div></div><br class="figure-break"></li><li><p id="x_6c0"><a name="x_6c0"></a>Redo the bad merge by merging the two backout heads,
-	    which reduces the number of heads in the repository to
-	    two, as can be seen in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:bad-merge-4" title="Figure 9.8. Merging the backouts">Figure 9.8, “Merging the backouts”</a>.</p><div class="figure"><a name="fig:undo:bad-merge-4"></a><p class="title"><b>Figure 9.8. Merging the backouts</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/bad-merge-4.png" alt="XXX add text"></div></div></div><br class="figure-break"></li><li><p id="x_6c1"><a name="x_6c1"></a>Merge with the commit that was made after the bad
-	    merge, as shown in <a class="xref" href="finding-and-fixing-mistakes.html#fig:undo:bad-merge-5" title="Figure 9.9. Merging the backouts">Figure 9.9, “Merging the backouts”</a>.</p><div class="figure"><a name="fig:undo:bad-merge-5"></a><p class="title"><b>Figure 9.9. Merging the backouts</b></p><div class="figure-contents"><div class="mediaobject"><img src="figs/bad-merge-5.png" alt="XXX add text"></div></div></div><br class="figure-break"></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id394612">Protect yourself from “<span class="quote">escaped</span>”
-	changes</h3></div></div></div><p id="x_123"><a name="x_123"></a>If you've committed some changes to your local repository
-	and they've been pushed or pulled somewhere else, this isn't
-	necessarily a disaster.  You can protect yourself ahead of
-	time against some classes of bad changeset.  This is
-	particularly easy if your team usually pulls changes from a
-	central repository.</p><p id="x_124"><a name="x_124"></a>By configuring some hooks on that repository to validate
-	incoming changesets (see chapter <a class="xref" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks">Chapter 10, <i>Handling repository events with hooks</i></a>),
-	you can
-	automatically prevent some kinds of bad changeset from being
-	pushed to the central repository at all.  With such a
-	configuration in place, some kinds of bad changeset will
-	naturally tend to “<span class="quote">die out</span>” because they can't
-	propagate into the central repository.  Better yet, this
-	happens without any need for explicit intervention.</p><p id="x_125"><a name="x_125"></a>For instance, an incoming change hook that
-	verifies that a changeset will actually compile can prevent
-	people from inadvertently “<span class="quote">breaking the
-	  build</span>”.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id394667">What to do about sensitive changes that escape</h3></div></div></div><p id="x_6c2"><a name="x_6c2"></a>Even a carefully run project can suffer an unfortunate
-	event such as the committing and uncontrolled propagation of a
-	file that contains important passwords.</p><p id="x_6c3"><a name="x_6c3"></a>If something like this happens to you, and the information
-	that gets accidentally propagated is truly sensitive, your
-	first step should be to mitigate the effect of the leak
-	without trying to control the leak itself. If you are not 100%
-	certain that you know exactly who could have seen the changes,
-	you should immediately change passwords, cancel credit cards,
-	or find some other way to make sure that the information that
-	has leaked is no longer useful.  In other words, assume that
-	the change has propagated far and wide, and that there's
-	nothing more you can do.</p><p id="x_6c4"><a name="x_6c4"></a>You might hope that there would be mechanisms you could
-	use to either figure out who has seen a change or to erase the
-	change permanently everywhere, but there are good reasons why
-	these are not possible.</p><p id="x_6c5"><a name="x_6c5"></a>Mercurial does not provide an audit trail of who has
-	pulled changes from a repository, because it is usually either
-	impossible to record such information or trivial to spoof it.
-	In a multi-user or networked environment, you should thus be
-	extremely skeptical of yourself if you think that you have
-	identified every place that a sensitive changeset has
-	propagated to.  Don't forget that people can and will send
-	bundles by email, have their backup software save data
-	offsite, carry repositories on USB sticks, and find other
-	completely innocent ways to confound your attempts to track
-	down every copy of a problematic change.</p><p id="x_6c6"><a name="x_6c6"></a>Mercurial also does not provide a way to make a file or
-	changeset completely disappear from history, because there is
-	no way to enforce its disappearance; someone could easily
-	modify their copy of Mercurial to ignore such directives. In
-	addition, even if Mercurial provided such a capability,
-	someone who simply hadn't pulled a “<span class="quote">make this file
-	  disappear</span>” changeset wouldn't be affected by it, nor
-	would web crawlers visiting at the wrong time, disk backups,
-	or other mechanisms.  Indeed, no distributed revision control
-	system can make data reliably vanish. Providing the illusion
-	of such control could easily give a false sense of security,
-	and be worse than not providing it at all.</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="sec:undo:bisect">Finding the source of a bug</h2></div></div></div><p id="x_126"><a name="x_126"></a>While it's all very well to be able to back out a changeset
-      that introduced a bug, this requires that you know which
-      changeset to back out.  Mercurial provides an invaluable
-      command, called <span class="command"><strong>hg bisect</strong></span>, that
-      helps you to automate this process and accomplish it very
-      efficiently.</p><p id="x_127"><a name="x_127"></a>The idea behind the <span class="command"><strong>hg
-	bisect</strong></span> command is that a changeset has introduced
-      some change of behavior that you can identify with a simple
-      pass/fail test.  You don't know which piece of code introduced the
-      change, but you know how to test for the presence of the bug.
-      The <span class="command"><strong>hg bisect</strong></span> command uses your
-      test to direct its search for the changeset that introduced the
-      code that caused the bug.</p><p id="x_128"><a name="x_128"></a>Here are a few scenarios to help you understand how you
-      might apply this command.</p><div class="itemizedlist"><ul type="disc"><li><p id="x_129"><a name="x_129"></a>The most recent version of your software has a
-	  bug that you remember wasn't present a few weeks ago, but
-	  you don't know when it was introduced.  Here, your binary
-	  test checks for the presence of that bug.</p></li><li><p id="x_12a"><a name="x_12a"></a>You fixed a bug in a rush, and now it's time to
-	  close the entry in your team's bug database.  The bug
-	  database requires a changeset ID when you close an entry,
-	  but you don't remember which changeset you fixed the bug in.
-	  Once again, your binary test checks for the presence of the
-	  bug.</p></li><li><p id="x_12b"><a name="x_12b"></a>Your software works correctly, but runs 15%
-	  slower than the last time you measured it.  You want to know
-	  which changeset introduced the performance regression.  In
-	  this case, your binary test measures the performance of your
-	  software, to see whether it's “<span class="quote">fast</span>” or
-	  “<span class="quote">slow</span>”.</p></li><li><p id="x_12c"><a name="x_12c"></a>The sizes of the components of your project that
-	  you ship exploded recently, and you suspect that something
-	  changed in the way you build your project.</p></li></ul></div><p id="x_12d"><a name="x_12d"></a>From these examples, it should be clear that the <span class="command"><strong>hg bisect</strong></span> command is not useful only
-      for finding the sources of bugs.  You can use it to find any
-      “<span class="quote">emergent property</span>” of a repository (anything that
-      you can't find from a simple text search of the files in the
-      tree) for which you can write a binary test.</p><p id="x_12e"><a name="x_12e"></a>We'll introduce a little bit of terminology here, just to
-      make it clear which parts of the search process are your
-      responsibility, and which are Mercurial's.  A
-      <span class="emphasis"><em>test</em></span> is something that
-      <span class="emphasis"><em>you</em></span> run when <span class="command"><strong>hg
-	bisect</strong></span> chooses a changeset.  A
-      <span class="emphasis"><em>probe</em></span> is what <span class="command"><strong>hg
-	bisect</strong></span> runs to tell whether a revision is good.
-      Finally, we'll use the word “<span class="quote">bisect</span>”, as both a
-      noun and a verb, to stand in for the phrase “<span class="quote">search using
-	the <span class="command"><strong>hg bisect</strong></span>
-
-	command</span>”.</p><p id="x_12f"><a name="x_12f"></a>One simple way to automate the searching process would be
-      simply to probe every changeset.  However, this scales poorly.
-      If it took ten minutes to test a single changeset, and you had
-      10,000 changesets in your repository, the exhaustive approach
-      would take on average 35 <span class="emphasis"><em>days</em></span> to find the
-      changeset that introduced a bug.  Even if you knew that the bug
-      was introduced by one of the last 500 changesets, and limited
-      your search to those, you'd still be looking at over 40 hours to
-      find the changeset that introduced your bug.</p><p id="x_130"><a name="x_130"></a>What the <span class="command"><strong>hg bisect</strong></span> command
-      does is use its knowledge of the “<span class="quote">shape</span>” of your
-      project's revision history to perform a search in time
-      proportional to the <span class="emphasis"><em>logarithm</em></span> of the number
-      of changesets to check (the kind of search it performs is called
-      a dichotomic search).  With this approach, searching through
-      10,000 changesets will take less than three hours, even at ten
-      minutes per test (the search will require about 14 tests).
-      Limit your search to the last hundred changesets, and it will
-      take only about an hour (roughly seven tests).</p><p id="x_131"><a name="x_131"></a>The <span class="command"><strong>hg bisect</strong></span> command is
-      aware of the “<span class="quote">branchy</span>” nature of a Mercurial
-      project's revision history, so it has no problems dealing with
-      branches, merges, or multiple heads in a repository.  It can
-      prune entire branches of history with a single probe, which is
-      how it operates so efficiently.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id394992">Using the <span class="command"><strong>hg bisect</strong></span>
-
-	command</h3></div></div></div><p id="x_132"><a name="x_132"></a>Here's an example of <span class="command"><strong>hg
-	  bisect</strong></span> in action.</p><div class="note"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="/support/figs/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p id="x_133"><a name="x_133"></a>  In versions 0.9.5 and earlier of Mercurial, <span class="command"><strong>hg bisect</strong></span> was not a core command:
-	  it was distributed with Mercurial as an extension. This
-	  section describes the built-in command, not the old
-	  extension.</p></td></tr></table></div><p id="x_134"><a name="x_134"></a>Now let's create a repository, so that we can try out the
-	<span class="command"><strong>hg bisect</strong></span> command in
-	isolation.</p><pre id="id395406" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg init mybug</code></strong>
-
-<code class="prompt">$</code> <strong class="userinput"><code>cd mybug</code></strong>
-</pre><p id="x_135"><a name="x_135"></a>We'll simulate a project that has a bug in it in a
-	simple-minded way: create trivial changes in a loop, and
-	nominate one specific change that will have the
-	“<span class="quote">bug</span>”.  This loop creates 35 changesets, each
-	adding a single file to the repository. We'll represent our
-	“<span class="quote">bug</span>” with a file that contains the text “<span class="quote">i
-	  have a gub</span>”.</p><pre id="id395397" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>buggy_change=22</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>for (( i = 0; i &lt; 35; i++ )); do</code></strong>
-
-<code class="prompt">&gt;</code> <strong class="userinput"><code>  if [[ $i = $buggy_change ]]; then</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>    echo 'i have a gub' &gt; myfile$i</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>    hg commit -q -A -m 'buggy changeset'</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>  else</code></strong>
-
-<code class="prompt">&gt;</code> <strong class="userinput"><code>    echo 'nothing to see here, move along' &gt; myfile$i</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>    hg commit -q -A -m 'normal changeset'</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>  fi</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>done</code></strong>
-
-</pre><p id="x_136"><a name="x_136"></a>The next thing that we'd like to do is figure out how to
-	use the <span class="command"><strong>hg bisect</strong></span> command.
-	We can use Mercurial's normal built-in help mechanism for
-	this.</p><pre id="id395535" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg help bisect</code></strong>
-hg bisect [-gbsr] [-c CMD] [REV]
-
-subdivision search of changesets
-
-    This command helps to find changesets which introduce problems.
-    To use, mark the earliest changeset you know exhibits the problem
-    as bad, then mark the latest changeset which is free from the
-    problem as good. Bisect will update your working directory to a
-    revision for testing (unless the --noupdate option is specified).
-    Once you have performed tests, mark the working directory as bad
-    or good and bisect will either update to another candidate changeset
-    or announce that it has found the bad revision.
-
-    As a shortcut, you can also use the revision argument to mark a
-    revision as good or bad without checking it out first.
-
-    If you supply a command it will be used for automatic bisection. Its exit
-    status will be used as flag to mark revision as bad or good. In case exit
-    status is 0 the revision is marked as good, 125 - skipped, 127 (command not
-    found) - bisection will be aborted; any other status bigger than 0 will
-    mark revision as bad.
-
-options:
-
- -r --reset     reset bisect state
- -g --good      mark changeset good
- -b --bad       mark changeset bad
- -s --skip      skip testing changeset
- -c --command   use command to check changeset state
- -U --noupdate  do not update to target
-
-use "hg -v help bisect" to show global options
-</pre><p id="x_137"><a name="x_137"></a>The <span class="command"><strong>hg bisect</strong></span> command
-	works in steps.  Each step proceeds as follows.</p><div class="orderedlist"><ol type="1"><li><p id="x_138"><a name="x_138"></a>You run your binary test.</p><div class="itemizedlist"><ul type="disc"><li><p id="x_139"><a name="x_139"></a>If the test succeeded, you tell <span class="command"><strong>hg bisect</strong></span> by running the
-		<span class="command"><strong>hg bisect --good</strong></span>
-
-		command.</p></li><li><p id="x_13a"><a name="x_13a"></a>If it failed, run the <span class="command"><strong>hg bisect --bad</strong></span>
-		command.</p></li></ul></div></li><li><p id="x_13b"><a name="x_13b"></a>The command uses your information to decide
-	    which changeset to test next.</p></li><li><p id="x_13c"><a name="x_13c"></a>It updates the working directory to that
-	    changeset, and the process begins again.</p></li></ol></div><p id="x_13d"><a name="x_13d"></a>The process ends when <span class="command"><strong>hg
-	  bisect</strong></span> identifies a unique changeset that marks
-	the point where your test transitioned from
-	“<span class="quote">succeeding</span>” to “<span class="quote">failing</span>”.</p><p id="x_13e"><a name="x_13e"></a>To start the search, we must run the <span class="command"><strong>hg bisect --reset</strong></span> command.</p><pre id="id395968" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg bisect --reset</code></strong>
-
-</pre><p id="x_13f"><a name="x_13f"></a>In our case, the binary test we use is simple: we check to
-	see if any file in the repository contains the string “<span class="quote">i
-	  have a gub</span>”.  If it does, this changeset contains the
-	change that “<span class="quote">caused the bug</span>”.  By convention, a
-	changeset that has the property we're searching for is
-	“<span class="quote">bad</span>”, while one that doesn't is
-	“<span class="quote">good</span>”.</p><p id="x_140"><a name="x_140"></a>Most of the time, the revision to which the working
-	directory is synced (usually the tip) already exhibits the
-	problem introduced by the buggy change, so we'll mark it as
-	“<span class="quote">bad</span>”.</p><pre id="id396047" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg bisect --bad</code></strong>
-</pre><p id="x_141"><a name="x_141"></a>Our next task is to nominate a changeset that we know
-	<span class="emphasis"><em>doesn't</em></span> have the bug; the <span class="command"><strong>hg bisect</strong></span> command will
-	“<span class="quote">bracket</span>” its search between the first pair of
-	good and bad changesets.  In our case, we know that revision
-	10 didn't have the bug.  (I'll have more words about choosing
-	the first “<span class="quote">good</span>” changeset later.)</p><pre id="id396032" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg bisect --good 10</code></strong>
-
-Testing changeset 22:b8789808fc48 (24 changesets remaining, ~4 tests)
-0 files updated, 0 files merged, 12 files removed, 0 files unresolved
-</pre><p id="x_142"><a name="x_142"></a>Notice that this command printed some output.</p><div class="itemizedlist"><ul type="disc"><li><p id="x_143"><a name="x_143"></a>It told us how many changesets it must
-	    consider before it can identify the one that introduced
-	    the bug, and how many tests that will require.</p></li><li><p id="x_144"><a name="x_144"></a>It updated the working directory to the next
-	    changeset to test, and told us which changeset it's
-	    testing.</p></li></ul></div><p id="x_145"><a name="x_145"></a>We now run our test in the working directory.  We use the
-	<span class="command"><strong>grep</strong></span> command to see if our
-	“<span class="quote">bad</span>” file is present in the working directory.
-	If it is, this revision is bad; if not, this revision is good.
-	
-</p><pre id="id395911" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>if grep -q 'i have a gub' *</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>then</code></strong>
-
-<code class="prompt">&gt;</code> <strong class="userinput"><code>  result=bad</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>else</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>  result=good</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>fi</code></strong>
-<code class="prompt">$</code> <strong class="userinput"><code>echo this revision is $result</code></strong>
-
-this revision is bad
-<code class="prompt">$</code> <strong class="userinput"><code>hg bisect --$result</code></strong>
-Testing changeset 16:e61fdddff53e (12 changesets remaining, ~3 tests)
-0 files updated, 0 files merged, 6 files removed, 0 files unresolved
-</pre><p>
-
-</p><p id="x_146"><a name="x_146"></a>This test looks like a perfect candidate for automation,
-	so let's turn it into a shell function.</p><pre id="id396435" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>mytest() {</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>  if grep -q 'i have a gub' *</code></strong>
-
-<code class="prompt">&gt;</code> <strong class="userinput"><code>  then</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>    result=bad</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>  else</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>    result=good</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>  fi</code></strong>
-
-<code class="prompt">&gt;</code> <strong class="userinput"><code>  echo this revision is $result</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>  hg bisect --$result</code></strong>
-<code class="prompt">&gt;</code> <strong class="userinput"><code>}</code></strong>
-</pre><p id="x_147"><a name="x_147"></a>We can now run an entire test step with a single command,
-	<code class="literal">mytest</code>.</p><pre id="id396403" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>mytest</code></strong>
-
-this revision is good
-Testing changeset 19:706df39b003b (6 changesets remaining, ~2 tests)
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-</pre><p id="x_148"><a name="x_148"></a>A few more invocations of our canned test step command,
-	and we're done.</p><pre id="id396344" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>mytest</code></strong>
-this revision is good
-Testing changeset 20:bf7ea9a054e6 (3 changesets remaining, ~1 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-<code class="prompt">$</code> <strong class="userinput"><code>mytest</code></strong>
-this revision is good
-Testing changeset 21:921391dd45c1 (2 changesets remaining, ~1 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-<code class="prompt">$</code> <strong class="userinput"><code>mytest</code></strong>
-this revision is good
-The first bad revision is:
-changeset:   22:b8789808fc48
-user:        Bryan O'Sullivan &lt;bos@serpentine.com&gt;
-
-date:        Tue May 05 06:55:14 2009 +0000
-summary:     buggy changeset
-
-</pre><p id="x_149"><a name="x_149"></a>Even though we had 40 changesets to search through, the
-	<span class="command"><strong>hg bisect</strong></span> command let us find
-	the changeset that introduced our “<span class="quote">bug</span>” with only
-	five tests.  Because the number of tests that the <span class="command"><strong>hg bisect</strong></span> command performs grows
-	logarithmically with the number of changesets to search, the
-	advantage that it has over the “<span class="quote">brute force</span>”
-	search approach increases with every changeset you add.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id396541">Cleaning up after your search</h3></div></div></div><p id="x_14a"><a name="x_14a"></a>When you're finished using the <span class="command"><strong>hg
-	  bisect</strong></span> command in a repository, you can use the
-	<span class="command"><strong>hg bisect --reset</strong></span> command to
-	drop the information it was using to drive your search.  The
-	command doesn't use much space, so it doesn't matter if you
-	forget to run this command.  However, <span class="command"><strong>hg bisect</strong></span> won't let you start a new
-	search in that repository until you do a <span class="command"><strong>hg bisect --reset</strong></span>.</p><pre id="id396936" class="screen"><code class="prompt">$</code> <strong class="userinput"><code>hg bisect --reset</code></strong>
-
-</pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="id396622">Tips for finding bugs effectively</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id396628">Give consistent input</h3></div></div></div><p id="x_14b"><a name="x_14b"></a>The <span class="command"><strong>hg bisect</strong></span> command
-	requires that you correctly report the result of every test
-	you perform.  If you tell it that a test failed when it really
-	succeeded, it <span class="emphasis"><em>might</em></span> be able to detect the
-	inconsistency.  If it can identify an inconsistency in your
-	reports, it will tell you that a particular changeset is both
-	good and bad. However, it can't do this perfectly; it's about
-	as likely to report the wrong changeset as the source of the
-	bug.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id396884">Automate as much as possible</h3></div></div></div><p id="x_14c"><a name="x_14c"></a>When I started using the <span class="command"><strong>hg
-	  bisect</strong></span> command, I tried a few times to run my
-	tests by hand, on the command line.  This is an approach that
-	I, at least, am not suited to.  After a few tries, I found
-	that I was making enough mistakes that I was having to restart
-	my searches several times before finally getting correct
-	results.</p><p id="x_14d"><a name="x_14d"></a>My initial problems with driving the <span class="command"><strong>hg bisect</strong></span> command by hand occurred
-	even with simple searches on small repositories; if the
-	problem you're looking for is more subtle, or the number of
-	tests that <span class="command"><strong>hg bisect</strong></span> must
-	perform increases, the likelihood of operator error ruining
-	the search is much higher.  Once I started automating my
-	tests, I had much better results.</p><p id="x_14e"><a name="x_14e"></a>The key to automated testing is twofold:</p><div class="itemizedlist"><ul type="disc"><li><p id="x_14f"><a name="x_14f"></a>always test for the same symptom, and</p></li><li><p id="x_150"><a name="x_150"></a>always feed consistent input to the <span class="command"><strong>hg bisect</strong></span> command.</p></li></ul></div><p id="x_151"><a name="x_151"></a>In my tutorial example above, the <span class="command"><strong>grep</strong></span>
-
-	command tests for the symptom, and the <code class="literal">if</code>
-	statement takes the result of this check and ensures that we
-	always feed the same input to the <span class="command"><strong>hg
-	  bisect</strong></span> command.  The <code class="literal">mytest</code>
-	function marries these together in a reproducible way, so that
-	every test is uniform and consistent.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id396713">Check your results</h3></div></div></div><p id="x_152"><a name="x_152"></a>Because the output of a <span class="command"><strong>hg
-	  bisect</strong></span> search is only as good as the input you
-	give it, don't take the changeset it reports as the absolute
-	truth.  A simple way to cross-check its report is to manually
-	run your test at each of the following changesets:</p><div class="itemizedlist"><ul type="disc"><li><p id="x_153"><a name="x_153"></a>The changeset that it reports as the first bad
-	    revision.  Your test should still report this as
-	    bad.</p></li><li><p id="x_154"><a name="x_154"></a>The parent of that changeset (either parent,
-	    if it's a merge). Your test should report this changeset
-	    as good.</p></li><li><p id="x_155"><a name="x_155"></a>A child of that changeset.  Your test should
-	    report this changeset as bad.</p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id396770">Beware interference between bugs</h3></div></div></div><p id="x_156"><a name="x_156"></a>It's possible that your search for one bug could be
-	disrupted by the presence of another.  For example, let's say
-	your software crashes at revision 100, and worked correctly at
-	revision 50.  Unknown to you, someone else introduced a
-	different crashing bug at revision 60, and fixed it at
-	revision 80.  This could distort your results in one of
-	several ways.</p><p id="x_157"><a name="x_157"></a>It is possible that this other bug completely
-	“<span class="quote">masks</span>” yours, which is to say that it occurs
-	before your bug has a chance to manifest itself.  If you can't
-	avoid that other bug (for example, it prevents your project
-	from building), and so can't tell whether your bug is present
-	in a particular changeset, the <span class="command"><strong>hg
-	  bisect</strong></span> command cannot help you directly.  Instead,
-	you can mark a changeset as untested by running <span class="command"><strong>hg bisect --skip</strong></span>.</p><p id="x_158"><a name="x_158"></a>A different problem could arise if your test for a bug's
-	presence is not specific enough.  If you check for “<span class="quote">my
-	  program crashes</span>”, then both your crashing bug and an
-	unrelated crashing bug that masks it will look like the same
-	thing, and mislead <span class="command"><strong>hg
-	  bisect</strong></span>.</p><p id="x_159"><a name="x_159"></a>Another useful situation in which to use <span class="command"><strong>hg bisect --skip</strong></span> is if you can't
-	test a revision because your project was in a broken and hence
-	untestable state at that revision, perhaps because someone
-	checked in a change that prevented the project from
-	building.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title" id="id396856">Bracket your search lazily</h3></div></div></div><p id="x_15a"><a name="x_15a"></a>Choosing the first “<span class="quote">good</span>” and
-	“<span class="quote">bad</span>” changesets that will mark the end points of
-	your search is often easy, but it bears a little discussion
-	nevertheless.  From the perspective of <span class="command"><strong>hg bisect</strong></span>, the “<span class="quote">newest</span>”
-	changeset is conventionally “<span class="quote">bad</span>”, and the older
-	changeset is “<span class="quote">good</span>”.</p><p id="x_15b"><a name="x_15b"></a>If you're having trouble remembering when a suitable
-	“<span class="quote">good</span>” change was, so that you can tell <span class="command"><strong>hg bisect</strong></span>, you could do worse than
-	testing changesets at random.  Just remember to eliminate
-	contenders that can't possibly exhibit the bug (perhaps
-	because the feature with the bug isn't present yet) and those
-	where another problem masks the bug (as I discussed
-	above).</p><p id="x_15c"><a name="x_15c"></a>Even if you end up “<span class="quote">early</span>” by thousands of
-	changesets or months of history, you will only add a handful
-	of tests to the total number that <span class="command"><strong>hg
-	  bisect</strong></span> must perform, thanks to its logarithmic
-	behavior.</p></div></div></div><div class="hgfooter"><p><img src="/support/figs/rss.png"> Want to stay up to date? Subscribe to the comment feed for <a id="chapterfeed" class="feed" href="/feeds/comments/">this chapter</a>, or the <a class="feed" href="/feeds/comments/">entire book</a>.</p><p>Copyright 2006, 2007, 2008, 2009 Bryan O'Sullivan.
-      Icons by <a href="mailto:mattahan@gmail.com">Paul Davey</a> aka <a href="http://mattahan.deviantart.com/">Mattahan</a>.</p></div><div class="navfooter"><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="managing-releases-and-branchy-development.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="handling-repository-events-with-hooks.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 8. Managing releases and branchy development </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 10. Handling repository events with hooks</td></tr></table></div><script type="text/javascript">
-    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
-    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
-    </script><script type="text/javascript">
-    try {
-    var pageTracker = _gat._getTracker("UA-1805907-5");
-    pageTracker._trackPageview();
-    } catch(err) {}</script></body></html>
-
--- a/web/html/backup/ar01.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,387 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Functional Approach</title>
-<link rel="stylesheet" href="/support/styles.css" type="text/css">
-<meta id="generator" content="DocBook XSL Stylesheets V1.74.3"><link rel="home" href="index.html" title="Mercurial: The Definitive Guide">
-<link rel="up" href="index.html" title="Mercurial: The Definitive Guide">
-<link rel="prev" href="managing-releases-and-branchy-development.html" title="Chapter 8. Managing releases and branchy development">
-<link rel="next" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks"><link rel="alternate" type="application/atom+xml" title="Comments" href="/feeds/comments/">
-<link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png">
-<script type="text/javascript" src="/support/jquery-min.js"></script>
-<script type="text/javascript" src="/support/form.js"></script>
-<script type="text/javascript" src="/support/hsbook.js"></script></head>
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<div class="navheader">
-<table width="100%" summary="Navigation header">
-<tr><th colspan="3" align="center">Functional Approach</th></tr>
-<tr>
-<td width="20%" align="left">
-<a accesskey="p" href="index.html">Prev</a> </td>
-<th width="60%" align="center"> </th>
-<td width="20%" align="right"> </td>
-</tr>
-</table>
-<hr>
-</div>
-<div class="article" title="Functional Approach">
-<div class="titlepage">
-<div><div><h2 class="title">
-<a name="id2496165"></a>Functional Approach</h2></div></div>
-<hr>
-</div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="section"><a href="ar01.html#default-arguments">1. Default Arguments</a></span></dt>
-<dt><span class="section"><a href="ar01.html#keyword-arguments">2. Keyword Arguments</a></span></dt>
-<dt><span class="section"><a href="ar01.html#parameter-packing-and-unpacking">3. Parameter Packing and Unpacking</a></span></dt>
-<dt><span class="section"><a href="ar01.html#nested-functions-and-scopes">4. Nested Functions and Scopes</a></span></dt>
-<dt><span class="section"><a href="ar01.html#map-reduce-and-filter-functions">5. map, reduce and filter functions</a></span></dt>
-<dd><dl><dt><span class="section"><a href="ar01.html#list-comprehensions">5.1. List Comprehensions</a></span></dt></dl></dd>
-</dl>
-</div>
-<p id="x_74b"><a name="x_74b"></a>
-    <span class="emphasis"><em>Functions</em></span> allow us to enclose a set of statements and call the function again and again instead of repeating the group of statements everytime. Functions also allow us to isolate a piece of code from all the other code and provides the convenience of not polluting the global variables.
-  </p>
-<p id="x_74c"><a name="x_74c"></a>
-    <span class="emphasis"><em>Function</em></span> in python is defined with the keyword 
-    <span class="strong"><strong>def</strong></span> followed by the name of the function, in turn followed by a pair of parenthesis which encloses the list of parameters to the function. The definition line ends with a ':'. The definition line is followed by the body of the function intended by one block. The 
-    <span class="emphasis"><em>Function</em></span> must return a value:
-  </p>
-<pre class="programlisting">def factorial(n):
-  fact = 1
-  for i in range(2, n):
-    fact *= i
-
-  return fact
-
-</pre>
-<p id="x_74d"><a name="x_74d"></a>The code snippet above defines a function with the name factorial, takes the number for which the factorial must be computed, computes the factorial and returns the value.</p>
-<p><a name="x_74e"></a>A 
-    <span class="emphasis"><em>Function</em></span> once defined can be used or called anywhere else in the program. We call a fucntion with its name followed by a pair of parenthesis which encloses the arguments to the function.
-  </p>
-<p><a name="x_74f"></a>The value that function returns can be assigned to a variable. Let's call the above function and store the factorial in a variable:</p>
-<pre class="programlisting">fact5 = factorial(5)
-
-</pre>
-<p><a name="x_750"></a>The value of fact5 will now be 120, which is the factorial of 5. Note that we passed 5 as the argument to the function.</p>
-<p><a name="x_751"></a>It may be necessary to document what the function does, for each of the function to help the person who reads our code to understand it better. In order to do this Python allows the first line of the function body to be a string. This string is called as 
-    <span class="emphasis"><em>Documentation String</em></span> or 
-    <span class="emphasis"><em>docstring</em></span>. 
-    <span class="emphasis"><em>docstrings</em></span> prove to be very handy since there are number of tools which can pull out all the docstrings from Python functions and generate the documentation automatically from it. 
-    <span class="emphasis"><em>docstrings</em></span> for functions can be written as follows:
-  </p>
-<pre class="programlisting">def factorial(n):
-  'Returns the factorial for the number n.'
-  fact = 1
-  for i in range(2, n):
-    fact *= i
-
-  return fact
-
-</pre>
-<p><a name="x_752"></a>An important point to note at this point is that, a function can return any Python value or a Python object, which also includes a 
-    <span class="emphasis"><em>Tuple</em></span>. A 
-    <span class="emphasis"><em>Tuple</em></span> is just a collection of values and those values themselves can be of any other valid Python datatypes, including 
-    <span class="emphasis"><em>Lists</em></span>, 
-    <span class="emphasis"><em>Tuples</em></span>, 
-    <span class="emphasis"><em>Dictionaries</em></span> among other things. So effectively, if a function can return a tuple, it can return any number of values through a tuple
-  </p>
-<p><a name="x_753"></a>Let us write a small function to swap two values:</p>
-<pre class="programlisting">def swap(a, b):
-  return b, a
-
-c, d = swap(a, b)
-
-</pre>
-<p><a name="x_754"></a>Function scope --------------- The variables used inside the function are confined to the function's scope and doesn't pollute the variables of the same name outside the scope of the function. Also the arguments passed to the function are passed by-value if it is of basic Python data type:</p>
-<pre class="programlisting">def cant_change(n):
-  n = 10
-
-n = 5
-cant_change(n)
-
-</pre>
-<p><a name="x_755"></a>Upon running this code, what do you think would have happened to value of n which was assigned 5 before the function call? If you have already tried out that snippet on the interpreter you already know that the value of n is not changed. This is true of any immutable types of Python like 
-    <span class="emphasis"><em>Numbers</em></span>, 
-    <span class="emphasis"><em>Strings</em></span> and 
-    <span class="emphasis"><em>Tuples</em></span>. But when you pass mutable objects like 
-    <span class="emphasis"><em>Lists</em></span> and 
-    <span class="emphasis"><em>Dictionaries</em></span> the values are manipulated even outside the function:
-  </p>
-<pre class="programlisting">&gt;&gt;&gt; def can_change(n):
-...   n[1] = James
-...
-
-&gt;&gt;&gt; name = ['Mr.', 'Steve', 'Gosling']
-&gt;&gt;&gt; can_change(name)
-&gt;&gt;&gt; name
-['Mr.', 'James', 'Gosling']
-
-</pre>
-<p><a name="x_756"></a>If nothing is returned by the function explicitly, Python takes care to return None when the funnction is called.</p>
-<div class="section" title="1. Default Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="default-arguments"></a>1. Default Arguments</h2></div></div></div>
-<p><a name="x_757"></a>There may be situations where we need to allow the functions to take the arguments optionally. Python allows us to define function this way by providing a facility called 
-      <span class="emphasis"><em>Default Arguments</em></span>. For example, we need to write a function that returns a list of fibonacci numbers. Since our function cannot generate an infinite list of fibonacci numbers, we need to specify the number of elements that the fibonacci sequence must contain. Suppose, additionally, we want to the function to return 10 numbers in the sequence if no option is specified we can define the function as follows:
-    </p>
-<pre class="programlisting">def fib(n=10):
-  fib_list = [0, 1]
-  for i in range(n - 2):
-    next = fib_list[-2] + fib_list[-1]
-    fib_list.append(next)
-  return fib_list
-
-</pre>
-<p><a name="x_758"></a>When we call this function, we can optionally specify the value for the parameter n, during the call as an argument. Calling with no argument and argument with n=5 returns the following fibonacci sequences:</p>
-<pre class="programlisting">fib()
-[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
-fib(5)
-[0, 1, 1, 2, 3]
-
-</pre>
-</div>
-<div class="section" title="2. Keyword Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="keyword-arguments"></a>2. Keyword Arguments</h2></div></div></div>
-<p><a name="x_759"></a>When a function takes a large number of arguments, it may be difficult to remember the order of the parameters in the function definition or it may be necessary to pass values to only certain parameters since others take the default value. In either of these cases, Python provides the facility of passing arguments by specifying the name of the parameter as defined in the function definition. This is known as 
-      <span class="emphasis"><em>Keyword Arguments</em></span>.
-    </p>
-<p><a name="x_75a"></a>In a function call, 
-      <span class="emphasis"><em>Keyword arguments</em></span> can be used for each argument, in the following fashion:
-    </p>
-<pre class="programlisting">argument_name=argument_value
-Also denoted as: keyword=argument
-
-def wish(name='World', greetings='Hello'):
-  print "%s, %s!" % (greetings, name)
-
-</pre>
-<p><a name="x_75b"></a>This function can be called in one of the following ways. It is important to note that no restriction is imposed in the order in which 
-      <span class="emphasis"><em>Keyword arguments</em></span> can be specified. Also note, that we have combined 
-      <span class="emphasis"><em>Keyword arguments</em></span> with 
-      <span class="emphasis"><em>Default arguments</em></span> in this example, however it is not necessary:
-    </p>
-<pre class="programlisting">wish(name='Guido', greetings='Hey')
-wish(greetings='Hey', name='Guido')
-
-</pre>
-<p><a name="x_75c"></a>Calling functions by specifying arguments in the order of parameters specified in the function definition is called as 
-      <span class="emphasis"><em>Positional arguments</em></span>, as opposed to 
-      <span class="emphasis"><em>Keyword arguments</em></span>. It is possible to use both 
-      <span class="emphasis"><em>Positional arguments</em></span> and 
-      <span class="emphasis"><em>Keyword arguments</em></span> in a single function call. But Python doesn't allow us to bungle up both of them. The arguments to the function, in the call, must always start with 
-      <span class="emphasis"><em>Positional arguments</em></span> which is in turn followed by 
-      <span class="emphasis"><em>Keyword arguments</em></span>:
-    </p>
-<pre class="programlisting">def my_func(x, y, z, u, v, w):
-  # initialize variables.
-  ...
-  # do some stuff 
-  ...
-  # return the value
-
-</pre>
-<p><a name="x_75d"></a>It is valid to call the above functions in the following ways:</p>
-<pre class="programlisting">my_func(10, 20, 30, u=1.0, v=2.0, w=3.0)
-my_func(10, 20, 30, 1.0, 2.0, w=3.0)
-my_func(10, 20, z=30, u=1.0, v=2.0, w=3.0)
-my_func(x=10, y=20, z=30, u=1.0, v=2.0, w=3.0)
-
-</pre>
-<p><a name="x_75e"></a>Following lists some of the invalid calls:</p>
-<pre class="programlisting">my_func(10, 20, z=30, 1.0, 2.0, 3.0)
-my_func(x=10, 20, z=30, 1.0, 2.0, 3.0)
-my_func(x=10, y=20, z=30, u=1.0, v=2.0, 3.0)
-
-</pre>
-</div>
-<div class="section" title="3. Parameter Packing and Unpacking">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="parameter-packing-and-unpacking"></a>3. Parameter Packing and Unpacking</h2></div></div></div>
-<p><a name="x_75f"></a>The positional arguments passed to a function can be collected in a tuple parameter and keyword arguments can be collected in a dictionary. Since keyword arguments must always be the last set of arguments passed to a function, the keyword dictionary parameter must be the last parameter. The function definition must include a list explicit parameters, followed by tuple paramter collecting parameter, whose name is preceded by a *****, for collecting positional parameters, in turn followed by the dictionary collecting parameter, whose name is preceded by a ****** :</p>
-<pre class="programlisting">def print_report(title, *args, **name):
-  """Structure of *args*
-  (age, email-id)
-  Structure of *name*
-  {
-      'first': First Name
-      'middle': Middle Name
-      'last': Last Name
-  }
-  """
-
-  print "Title: %s" % (title)
-  print "Full name: %(first)s %(middle)s %(last)s" % name
-  print "Age: %d\nEmail-ID: %s" % args
-
-</pre>
-<p><a name="x_760"></a>The above function can be called as. Note, the order of keyword parameters can be interchanged:</p>
-<pre class="programlisting">&gt;&gt;&gt; print_report('Employee Report', 29, 'johny@example.com', first='Johny',
-                 last='Charles', middle='Douglas')
-Title: Employee Report
-Full name: Johny Douglas Charles
-Age: 29
-Email-ID: johny@example.com
-
-</pre>
-<p><a name="x_761"></a>The reverse of this can also be achieved by using a very identical syntax while calling the function. A tuple or a dictionary can be passed as arguments in place of a list of *Positional arguments* or *Keyword arguments* respectively using ***** or ****** :</p>
-<pre class="programlisting">def print_report(title, age, email, first, middle, last):
-  print "Title: %s" % (title)
-  print "Full name: %s %s %s" % (first, middle, last)
-  print "Age: %d\nEmail-ID: %s" % (age, email)
-
-&gt;&gt;&gt; args = (29, 'johny@example.com')
-&gt;&gt;&gt; name = {
-        'first': 'Johny',
-        'middle': 'Charles',
-        'last': 'Douglas'
-        }
-&gt;&gt;&gt; print_report('Employee Report', *args, **name)
-Title: Employee Report
-Full name: Johny Charles Douglas
-Age: 29
-Email-ID: johny@example.com
-
-</pre>
-</div>
-<div class="section" title="4. Nested Functions and Scopes">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="nested-functions-and-scopes"></a>4. Nested Functions and Scopes</h2></div></div></div>
-<p><a name="x_762"></a>Python allows nesting one function inside another. This style of programming turns out to be extremely flexible and powerful features when we use 
-      <span class="emphasis"><em>Python decorators</em></span>. We will not talk about decorators is beyond the scope of this course. If you are interested in knowing more about 
-      <span class="emphasis"><em>decorator programming</em></span> in Python you are suggested to read:
-    </p>
-<div class="literallayout"><p><br>
-      <a class="ulink" href="http://avinashv.net/2008/04/python-decorators-syntactic-sugar" target="_top">http://avinashv.net/2008/04/python-decorators-syntactic-sugar</a>/<br>
-      <a class="ulink" href="http://personalpages.tds.net" target="_top">http://personalpages.tds.net</a>/~kent37/kk/00001.html<br>
-    </p></div>
-<p><a name="x_763"></a>However, the following is an example for nested functions in Python:</p>
-<pre class="programlisting">def outer():
-  print "Outer..."
-  def inner():
-    print "Inner..."
-  print "Outer..."
-  inner()
-
-&gt;&gt;&gt; outer()
-
-</pre>
-</div>
-<div class="section" title="5. map, reduce and filter functions">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="map-reduce-and-filter-functions"></a>5. map, reduce and filter functions</h2></div></div></div>
-<p><a name="x_764"></a>Python provides several built-in functions for convenience. The 
-      <span class="strong"><strong>map()</strong></span>, 
-      <span class="strong"><strong>reduce()</strong></span> and 
-      <span class="strong"><strong>filter()</strong></span> functions prove to be very useful with sequences like 
-      <span class="emphasis"><em>Lists</em></span>.
-    </p>
-<p><a name="x_765"></a>The 
-      <span class="strong"><strong>map</strong></span> (
-      <span class="emphasis"><em>function</em></span>, 
-      <span class="emphasis"><em>sequence</em></span>) function takes two arguments: 
-      <span class="emphasis"><em>function</em></span> and a 
-      <span class="emphasis"><em>sequence</em></span> argument. The 
-      <span class="emphasis"><em>function</em></span> argument must be the name of the function which in turn takes a single argument, the individual element of the 
-      <span class="emphasis"><em>sequence</em></span>. The 
-      <span class="strong"><strong>map</strong></span> function calls 
-      <span class="emphasis"><em>function(item)</em></span>, for each item in the sequence and returns a list of values, where each value is the value returned by each call to 
-      <span class="emphasis"><em>function(item)</em></span>. 
-      <span class="strong"><strong>map()</strong></span> function allows to pass more than one sequence. In this case, the first argument, 
-      <span class="emphasis"><em>function</em></span> must take as many arguments as the number of sequences passed. This function is called with each corresponding element in the each of the sequences, or 
-      <span class="strong"><strong>None</strong></span> if one of the sequence is exhausted:
-    </p>
-<pre class="programlisting">def square(x):
-  return x*x
-
-&gt;&gt;&gt; map(square, [1, 2, 3, 4])
-[1, 4, 9, 16]
-
-def mul(x, y):
-  return x*y
-
-&gt;&gt;&gt; map(mul, [1, 2, 3, 4], [6, 7, 8, 9])
-
-</pre>
-<p><a name="x_766"></a>The 
-      <span class="strong"><strong>filter</strong></span> (
-      <span class="emphasis"><em>function</em></span>, 
-      <span class="emphasis"><em>sequence</em></span>) function takes two arguments, similar to the 
-      <span class="strong"><strong>map()</strong></span> function. The 
-      <span class="strong"><strong>filter</strong></span> function calls 
-      <span class="emphasis"><em>function(item)</em></span>, for each item in the sequence and returns all the elements in the sequence for which 
-      <span class="emphasis"><em>function(item)</em></span> returned True:
-    </p>
-<pre class="programlisting">def even(x):
-  if x % 2:
-    return True
-  else:
-    return False
-
-&gt;&gt;&gt; filter(even, range(1, 10))
-[1, 3, 5, 7, 9]
-
-</pre>
-<p><a name="x_767"></a>The 
-      <span class="strong"><strong>reduce</strong></span> (
-      <span class="emphasis"><em>function</em></span>, 
-      <span class="emphasis"><em>sequence</em></span>) function takes two arguments, similar to 
-      <span class="strong"><strong>map</strong></span> function, however multiple sequences are not allowed. The 
-      <span class="strong"><strong>reduce</strong></span> function calls 
-      <span class="emphasis"><em>function</em></span> with first two consecutive elements in the sequence, obtains the result, calls 
-      <span class="emphasis"><em>function</em></span> with the result and the subsequent element in the sequence and so on until the end of the list and returns the final result:
-    </p>
-<pre class="programlisting">def mul(x, y):
-  return x*y
-
-&gt;&gt;&gt; reduce(mul, [1, 2, 3, 4])
-24
-
-</pre>
-<div class="section" title="5.1. List Comprehensions">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="list-comprehensions"></a>5.1. List Comprehensions</h3></div></div></div>
-<p><a name="x_768"></a>List Comprehension is a convenvience utility provided by Python. It is a syntatic sugar to create 
-        <span class="emphasis"><em>Lists</em></span>. Using 
-        <span class="emphasis"><em>List Comprehensions</em></span> one can create 
-        <span class="emphasis"><em>Lists</em></span> from other type of sequential data structures or other 
-        <span class="emphasis"><em>Lists</em></span> itself. The syntax of 
-        <span class="emphasis"><em>List Comprehensions</em></span> consists of a square brackets to indicate the result is a 
-        <span class="emphasis"><em>List</em></span> within which we include at least one 
-        <span class="strong"><strong>for</strong></span> clause and multiple 
-        <span class="strong"><strong>if</strong></span> clauses. It will be more clear with an example:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; num = [1, 2, 3]
-&gt;&gt;&gt; sq = [x*x for x in num]
-&gt;&gt;&gt; sq
-[1, 4, 9]
-&gt;&gt;&gt; all_num = [1, 2, 3, 4, 5, 6, 7, 8, 9]
-&gt;&gt;&gt; even = [x for x in all_num if x%2 == 0]
-
-</pre>
-<p><a name="x_769"></a>The syntax used here is very clear from the way it is written. It can be translated into english as, "for each element x in the list all_num, if remainder of x divided by 2 is 0, add x to the list."</p>
-</div>
-</div>
-</div>
-<div class="navfooter">
-<hr>
-<table width="100%" summary="Navigation footer">
-<tr>
-<td width="40%" align="left">
-<a accesskey="p" href="index.html">Prev</a> </td>
-<td width="20%" align="center"> </td>
-<td width="40%" align="right"> </td>
-</tr>
-<tr>
-<td width="40%" align="left" valign="top">Chapter 1.  </td>
-<td width="20%" align="center"> </td>
-<td width="40%" align="right" valign="top"> </td>
-</tr>
-</table>
-</div>
-</body>
-</html>
--- a/web/html/backup/autoid.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-#!/usr/bin/env python
-#
-# Add unique ID attributes to para tags.  This script should only be
-# run by one person, since otherwise it introduces the possibility of
-# chaotic conflicts among tags.
-
-import glob, os, re, sys
-
-tagged = re.compile('<para[^>]* id="x_([0-9a-f]+)"[^>]*>', re.M)
-untagged = re.compile('<para>')
-
-names = glob.glob('ch*.xml') + glob.glob('app*.xml')
-
-# First pass: find the highest-numbered paragraph ID.
-
-biggest_id = 0
-seen = set()
-errs = 0
-
-for name in names:
-    for m in tagged.finditer(open(name).read()):
-        i = int(m.group(1),16)
-        if i in seen:
-            print >> sys.stderr, '%s: duplication of ID %s' % (name, i)
-            errs += 1
-        seen.add(i)
-        if i > biggest_id:
-            biggest_id = i
-
-def retag(s):
-    global biggest_id
-    biggest_id += 1
-    return '<para id="x_%x">' % biggest_id
-
-# Second pass: add IDs to paragraphs that currently lack them.
-
-for name in names:
-    f = open(name).read()
-    f1 = untagged.sub(retag, f)
-    if f1 != f:
-        tmpname = name + '.tmp'
-        fp = open(tmpname, 'w')
-        fp.write(f1)
-        fp.close()
-        os.rename(tmpname, name)
-
-sys.exit(errs)
--- a/web/html/backup/ch01-intro.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,686 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Basic Python</title>
-<link rel="stylesheet" href="/review/support/styles.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.74.3">
-<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
-<script type="text/javascript" src="/review/support/jquery-min.js"></script>
-<script type="text/javascript" src="/review/support/form.js"></script>
-<script type="text/javascript" src="/review/support/hsbook.js"></script>
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<!--<div class="navheader">
-<table width="100%" summary="Navigation header">
-<tr><th colspan="3" align="center">Basic Python</th></tr>
-<tr>
-<td width="20%" align="left">
-
-<th width="60%" align="center"> </th>
-<td width="20%" align="right"> </td>
-</tr>
-</table>
-<hr>
-</div>  -->
-
-<div class="chapter" lang="en" id="chap_intro">
-<div class="article" title="Basic Python">
-<div class="titlepage">
-<div><div><h2 class="title">
-<a name="id2988867"></a>Basic Python</h2></div></div>
-<hr>
-</div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="section"><a href="#introduction">1. Introduction</a></span></dt>
-<dt><span class="section"><a href="#the-python-interpreter">2. The Python Interpreter</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#the-interactive-interpreter">2.1. The Interactive Interpreter</a></span></dt>
-<dt><span class="section"><a href="#ipython-an-enhanced-interactive-python-interpreter">2.2. 
-        <span class="emphasis"><em>ipython</em></span> - An enhanced interactive Python interpreter
-      </a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#editing-and-running-a-python-file">3. Editing and running a python file</a></span></dt>
-<dt><span class="section"><a href="#basic-datatypes-and-operators-in-python">4. Basic Datatypes and operators in Python</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#numbers">4.1. Numbers</a></span></dt>
-<dt><span class="section"><a href="#variables">4.2. Variables</a></span></dt>
-<dt><span class="section"><a href="#strings">4.3. Strings</a></span></dt>
-<dt><span class="section"><a href="#boolean">4.4. Boolean</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#the-while-loop">5. The 
-      <span class="strong"><strong>while</strong></span> loop
-    </a></span></dt>
-<dt><span class="section"><a href="#the-if-conditional">6. The 
-      <span class="strong"><strong>if</strong></span> conditional
-    </a></span></dt>
-<dt><span class="section"><a href="#raw_input">7.       <span class="strong"><strong>raw_input()</strong></span>
-    </a></span></dt>
-<dt><span class="section"><a href="#int-method">8. 
-      <span class="strong"><strong>int()</strong></span> method
-    </a></span></dt>
-</dl>
-</div>
-<p id="x_38"></a>This document is intended to be handed out at the end of the workshop. It has been designed for Engineering students who are Python beginners and have basic programming skills. The focus is on basic numerics and plotting using Python.</p>
-<p id="x_39"></a>The system requirements:</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="x_3a"></a>Python - version 2.5.x or newer.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="x_3b"></a>IPython</p></li>
-<li class="listitem" style="list-style-type: *"><p id="x_3c"></a>Text editor - scite, vim, emacs or whatever you are comfortable with.</p></li>
-</ul></div>
-<div class="section" title="1. Introduction">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="introduction"></a>1. Introduction</h2></div></div></div>
-<p id="x_3d"></a>The Python programming language was created by a dutch named Guido van Rossum. The idea of Python was conceived in December 1989. The name Python has nothing to do with the reptilian, but its been named after the 70s comedy series "Monty Python's Flying Circus", since it happens to be Guido's favourite TV series.</p>
-<p id="x_3e"></a>Current stable version of Python is 2.6.x, although Python 3.0 is also the stable version, it is not backwards compatible with the previous versions and is hence not entirely popular at the moment. This material will focus on the 2.6.x series.</p>
-<p id="x_3f"></a>Python is licensed under the Python Software Foundation License (PSF License) which is GPL compatible Free Software license (excepting license version 1.6 and 2.0) It is a no strings attached license, which means the source code is free to modify and redistribute.</p>
-<p id="x_40"></a>The Python docs define Python as "Python is an interpreted, object-oriented, high-level programming language with dynamic semantics." A more detailed summary can be found at 
-      <a class="ulink" href="http://www.python.org/doc/essays/blurb.html" target="_top">http://www.python.org/doc/essays/blurb.html</a>. Python is a language that has been designed to help the programmer concentrate on solving the problem at hand and not worry about the programming language idiosyncrasies.
-    </p>
-<p id="x_41"></a>Python is a highly cross platform compatible language on account of it being an interpreted language. It is highly scalable and hence has been adapted to run on the Nokia 60 series phones. Python has been designed to be readable and easy to use</p>
-<p id="x_42"></a>
-      <span class="strong"><strong>Resources available for reference</strong></span>
-    </p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="x_43"></a>Web: 
-          <a class="ulink" href="http://www.python.org" target="_top">http://www.python.org</a>
-        </p></li>
-<li class="listitem" style="list-style-type: *"><p id="x_44"></a>Doc: 
-          <a class="ulink" href="http://www.python.org/doc" target="_top">http://www.python.org/doc</a>
-        </p></li>
-<li class="listitem" style="list-style-type: *"><p id="x_45"></a>Free Tutorials: 
-          <span class="emphasis"><em> Official Python Tutorial: 
-            <a class="ulink" href="http://docs.python.org/tut/tut.html" target="_top">http://docs.python.org/tut/tut.html</a> 
-          </em></span> Byte of Python: 
-          <a class="ulink" href="http://www.byteofpython.info" target="_top">http://www.byteofpython.info</a>/ * Dive into Python: 
-          <a class="ulink" href="http://diveintopython.org" target="_top">http://diveintopython.org</a>/
-        </p></li>
-</ul></div>
-<p id="x_46"></a>
-      <span class="strong"><strong>Advantages of Python - Why Python??</strong></span>
-    </p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="x_47"></a>Python has been designed for readability and ease of use. Its been designed in  such a fashion that it imposes readability on the programmer. Python does away with the braces and the semicolons and instead implements code blocks based on indentation, thus enhancing readability.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="x_48"></a>Python is a high level, interpreted, modular and object oriented language. Python performs memory management on its own, thus the programmer need not bother about allocating and deallocating memory to variables. Python provides extensibility by providing modules which can be easily imported similar to headers in C and packages in Java. Python is object oriented and hence provides all the object oriented characteristics such as inheritance, encapsulation and polymorphism.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="x_49"></a>Python offers a highly powerful interactive programming interface in the form of the 'Interactive Interpreter' which will be discussed in more detail in the following sections.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="x_4a"></a>Python provides a rich standard library and an extensive set of modules. The  power of Python modules can be seen in this slightly exaggerated cartoon 
-          <a class="ulink" href="http://xkcd.com/353" target="_top">http://xkcd.com/353</a>/
-        </p></li>
-<li class="listitem" style="list-style-type: *"><p id="x_4b"></a>Python interfaces well with most other programming languages such as C, C++  and FORTRAN.</p></li>
-</ul></div>
-<p id="x_4c"></a>Although, Python has one setback. Python is not fast as some of the compiled languages like C or C++. Yet, the amount of flexibility and power more than make up for this setback.</p>
-</div>
-<div class="section" title="2. The Python Interpreter">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="the-python-interpreter"></a>2. The Python Interpreter</h2></div></div></div>
-<div class="section" title="2.1. The Interactive Interpreter">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="the-interactive-interpreter"></a>2.1. The Interactive Interpreter</h3></div></div></div>
-<p id="x_4d"></a>Typing 
-        <span class="emphasis"><em>python</em></span> at the shell prompt on any standard Unix/Gnu-Linux system and hitting the enter key fires up the Python 'Interactive Interpreter'. The Python interpreter is one of the most integral features of Python. The prompt obtained when the interactive interpreter is similar to what is shown below. The exact appearance might differ based on the version of Python being used. The 
-        <code class="literal">&gt;&gt;&gt;</code> thing shown is the python prompt. When something is typed at the prompt and the enter key is hit, the python interpreter interprets the command entered and performs the appropriate action. All the examples presented in this document are to be tried hands on, on the interactive interpreter.
-      </p>
-<pre class="programlisting">Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) 
-[GCC 4.3.2] on linux2
-Type "help", "copyright", "credits" or "license" for more information.
-&gt;&gt;&gt; 
-
-</pre>
-<p id="x_4e"></a>Lets try with an example, type 
-        <code class="literal">print 'Hello, World!'</code> at the prompt and hit the enter key.
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; print 'Hello, World!'
-Hello, World!
-
-</pre>
-<p id="x_4f"></a>This example was quite straight forward, and thus we have written our first line of Python code. Now let us try typing something arbitrary at the prompt. For example:</p>
-<pre class="programlisting">&gt;&gt;&gt; arbit word
-  File "&lt;stdin&gt;", line 1
-    arbit word
-            ^
-SyntaxError: invalid syntax
-&gt;&gt;&gt;
-
-</pre>
-<p id="x_50"></a>The interpreter gave an error message saying that 'arbit word' was invalid syntax which is valid. The interpreter is an amazing tool when learning to program in Python. The interpreter provides a help function that provides the necessary documentation regarding all Python syntax, constructs, modules and objects. Typing 
-        <span class="emphasis"><em>help()</em></span> at the prompt gives the following output:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; help()
-
-Welcome to Python 2.5!  This is the online help utility.
-
-If this is your first time using Python, you should definitely check out
-the tutorial on the Internet at http://www.python.org/doc/tut/.
-
-Enter the name of any module, keyword, or topic to get help on writing
-Python programs and using Python modules.  To quit this help utility and
-return to the interpreter, just type "quit".
-
-To get a list of available modules, keywords, or topics, type "modules",
-"keywords", or "topics".  Each module also comes with a one-line summary
-of what it does; to list the modules whose summaries contain a given word
-such as "spam", type "modules spam".
-
-help&gt; 
-
-
-</pre>
-<p id="x_51"></a>As mentioned in the output, entering the name of any module, keyword or topic will provide the documentation and help regarding the same through the online help utility. Pressing 
-        <span class="emphasis"><em>Ctrl+d</em></span> exits the help prompt and returns to the python prompt.
-      </p>
-<p id="x_52"></a>Let us now try a few examples at the python interpreter.</p>
-<p id="x_53"></a>Eg 1:</p>
-<pre class="programlisting">&gt;&gt;&gt; print 'Hello, python!'
-Hello, python!
-&gt;&gt;&gt;
-
-</pre>
-<p id="x_54"></a>Eg 2:</p>
-<pre class="programlisting">&gt;&gt;&gt; print 4321*567890
-2453852690
-&gt;&gt;&gt; 
-
-</pre>
-<p id="x_55"></a>Eg 3:</p>
-<pre class="programlisting">&gt;&gt;&gt; 4321*567890
-2453852690L
-&gt;&gt;&gt;
-
-</pre>
-<pre class="programlisting">Note: Notice the 'L' at the end of the output. The 'L' signifies that the
-output of the operation is of type *long*. It was absent in the previous
-example because we used the print statement. This is because *print* formats
-the output before displaying.
-
-</pre>
-<p id="x_56"></a>Eg 4:</p>
-<pre class="programlisting">&gt;&gt;&gt; big = 12345678901234567890 ** 3
-&gt;&gt;&gt; print big
-1881676372353657772490265749424677022198701224860897069000
-&gt;&gt;&gt; 
-
-</pre>
-<pre class="programlisting">This example is to show that unlike in C or C++ there is no limit on the
-value of an integer.
-
-</pre>
-<p id="x_57"></a>Try this on the interactive interpreter: 
-        <code class="literal">import this</code>
-      </p>
-<p id="x_58"></a>
-        <span class="emphasis"><em>Hint: The output gives an idea of Power of Python</em></span>
-      </p>
-</div>
-<div class="section" title="2.2.  ipython - An enhanced interactive Python interpreter">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="ipython-an-enhanced-interactive-python-interpreter"></a>2.2. 
-        <span class="emphasis"><em>ipython</em></span> - An enhanced interactive Python interpreter
-      </h3></div></div></div>
-<p id="x_59"></a>The power and the importance of the interactive interpreter was the highlight of the previous section. This section provides insight into the enhanced interpreter with more advanced set of features called 
-        <span class="strong"><strong>ipython</strong></span>. Entering 
-        <span class="emphasis"><em>ipython</em></span> at the shell prompt fires up the interactive interpreter.
-      </p>
-<pre class="programlisting">$ ipython
-Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) 
-Type "copyright", "credits" or "license" for more information.
-
-IPython 0.8.4 -- An enhanced Interactive Python.
-?         -&gt; Introduction and overview of IPython's features.
-%quickref -&gt; Quick reference.
-help      -&gt; Python's own help system.
-object?   -&gt; Details about 'object'. ?object also works, ?? prints more.
-
-In [1]: 
-
-</pre>
-<p id="x_5a"></a>This is the output obtained upon firing ipython. The exact appearance may change based on the Python version installed. The following are some of the various features provided by 
-        <span class="strong"><strong>ipython</strong></span>:
-      </p>
-<div class="variablelist"><dl>
-<dt><span class="term"></span></dt>
-<dd>
-<p></p>
-<p id="x_5b"></a>Suggestions - ipython provides suggestions of the possible methods and operations available for the given python object.</p>
-</dd>
-</dl></div>
-<p id="x_5c"></a>Eg 5:</p>
-<pre class="programlisting">In [4]: a = 6
-
-In [5]: a.
-a.__abs__           a.__divmod__        a.__index__         a.__neg__          a.__rand__          a.__rmod__          a.__rxor__
-a.__add__           a.__doc__           a.__init__          a.__new__          a.__rdiv__          a.__rmul__          a.__setattr__
-a.__and__           a.__float__         a.__int__           a.__nonzero__      a.__rdivmod__       a.__ror__           a.__str__
-a.__class__         a.__floordiv__      a.__invert__        a.__oct__          a.__reduce__        a.__rpow__          a.__sub__
-a.__cmp__           a.__getattribute__  a.__long__          a.__or__           a.__reduce_ex__     a.__rrshift__       a.__truediv__
-a.__coerce__        a.__getnewargs__    a.__lshift__        a.__pos__          a.__repr__          a.__rshift__        a.__xor__
-a.__delattr__       a.__hash__          a.__mod__           a.__pow__          a.__rfloordiv__     a.__rsub__          
-a.__div__           a.__hex__           a.__mul__           a.__radd__         a.__rlshift__       a.__rtruediv__      
-
-</pre>
-<p id="x_5d"></a>In this example, we initialized 'a' (a variable - a concept that will be discussed in the subsequent sections.) to 6. In the next line when the 
-        <span class="emphasis"><em>tab</em></span> key is pressed after typing '
-        <span class="emphasis"><em>a.</em></span>' ipython displays the set of all possible methods that are applicable on the object 'a' (an integer in this context). Ipython provides many such datatype specific features which will be presented in the further sections as and when the datatypes are introduced.
-      </p>
-</div>
-</div>
-<div class="section" title="3. Editing and running a python file">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="editing-and-running-a-python-file"></a>3. Editing and running a python file</h2></div></div></div>
-<p id="x_5e"></a>The previous sections focused on the use of the interpreter to run python code. While the interpeter is an excellent tool to test simple solutions and experiment with small code snippets, its main disadvantage is that everything written in the interpreter is lost once its quit. Most of the times a program is used by people other than the author. So the programs have to be available in some form suitable for distribution, and hence they are written in files. This section will focus on editing and running python files. Start by opening a text editor ( it is recommended you choose one from the list at the top of this page ). In the editor type down python code and save the file with an extension 
-      <span class="strong"><strong>.py</strong></span> (python files have an extension of .py). Once done with the editing, save the file and exit the editor.
-    </p>
-<p id="x_5f"></a>Let us look at a simple example of calculating the gcd of 2 numbers using Python:</p>
-<p id="x_60"></a>
-      <span class="strong"><strong>Creating the first python script(file)</strong></span> :
-    </p>
-<pre class="programlisting">$ emacs gcd.py
-  def gcd(x,y):
-    if x % y == 0:
-      return y
-    return gcd(y, x%y)
-
-  print gcd(72, 92)
-
-</pre>
-<p id="x_61"></a>To run the script, open the shell prompt, navigate to the directory that contains the python file and run 
-      <code class="literal">python &lt;filename.py&gt;</code> at the prompt ( in this case filename is gcd.py )
-    </p>
-<p id="x_62"></a>
-      <span class="strong"><strong>Running the python script</strong></span> :
-    </p>
-<pre class="programlisting">$ python gcd.py
-4
-$ 
-
-</pre>
-<p id="x_63"></a>Another method to run a python script would be to include the line</p>
-<p id="x_64"></a>
-      <code class="literal">#! /usr/bin/python</code>
-    </p>
-<p id="x_65"></a>at the beginning of the python file and then make the file executable by</p>
-<p id="x_66"></a>$ chmod a+x 
-      <span class="emphasis"><em>filename.py</em></span>
-    </p>
-<p id="x_67"></a>Once this is done, the script can be run as a standalone program as follows:</p>
-<p id="x_68"></a>$ ./
-      <span class="emphasis"><em>filename.py</em></span>
-    </p>
-</div>
-<div class="section" title="4. Basic Datatypes and operators in Python">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="basic-datatypes-and-operators-in-python"></a>4. Basic Datatypes and operators in Python</h2></div></div></div>
-<p id="x_69"></a>Python provides the following set of basic datatypes.</p>
-<div class="blockquote"><blockquote class="blockquote"><div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="x_6a"></a>Numbers: int, float, long, complex</p></li>
-<li class="listitem" style="list-style-type: *"><p id="x_6b"></a>Strings</p></li>
-<li class="listitem" style="list-style-type: *"><p id="x_6c"></a>Boolean</p></li>
-</ul></div></blockquote></div>
-<div class="section" title="4.1. Numbers">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="numbers"></a>4.1. Numbers</h3></div></div></div>
-<p id="x_6d"></a>Numbers were introduced in the examples presented in the interactive interpreter section. Numbers include types as mentioned earlier viz., int (integers), float (floating point numbers), long (large integers), complex (complex numbers with real and imaginary parts). Python is not a strongly typed language, which means the type of a variable need not mentioned during its initialization. Let us look at a few examples.</p>
-<p id="x_6e"></a>Eg 6:</p>
-<pre class="programlisting">&gt;&gt;&gt; a = 1 #here a is an integer variable
-
-</pre>
-<p id="x_6f"></a>Eg 7:</p>
-<pre class="programlisting">&gt;&gt;&gt; lng = 122333444455555666666777777788888888999999999 #here lng is a variable of type long
-&gt;&gt;&gt; lng
-122333444455555666666777777788888888999999999L #notice the trailing 'L'
-&gt;&gt;&gt; print lng
-122333444455555666666777777788888888999999999 #notice the absence of the trailing 'L'
-&gt;&gt;&gt; lng+1
-122333444455555666666777777788888889000000000L
-
-
-</pre>
-<p id="x_70"></a>Long numbers are the same as integers in almost all aspects. They can be used in operations just like integers and along with integers without any distinction. The only distinction comes during type checking (which is not a healthy practice). Long numbers are tucked with a trailing 'L' just to signify that they are long. Notice that in the example just lng at the prompt displays the value of the variable with the 'L' whereas 
-        <code class="literal">print lng</code> displays without the 'L'. This is because print formats the output before printing. Also in the example, notice that adding an integer to a long does not give any errors and the result is as expected. So for all practical purposes longs can be treated as ints.
-      </p>
-<p id="x_71"></a>Eg 8:</p>
-<pre class="programlisting">&gt;&gt;&gt; fl = 3.14159 #fl is a float variable
-&gt;&gt;&gt; e = 1.234e-4 #e is also a float variable, specified in the exponential form
-&gt;&gt;&gt; a = 1
-&gt;&gt;&gt; b = 2
-&gt;&gt;&gt; a/b #integer division
-0
-&gt;&gt;&gt; a/fl #floating point division
-0.31831015504887655
-&gt;&gt;&gt; e/fl
-3.9279473133031364e-05
-
-
-</pre>
-<p id="x_72"></a>Floating point numbers, simply called floats are real numbers with a decimal point. The example above shows the initialization of a float variable. Shown also in this example is the difference between integer division and floating point division. 'a' and 'b' here are integer variables and hence the division gives 0 as the quotient. When either of the operands is a float, the operation is a floating point division, and the result is also a float as illustrated.</p>
-<p id="x_73"></a>Eg 9:</p>
-<pre class="programlisting">&gt;&gt;&gt; cplx = 3 + 4j #cplx is a complex variable
-&gt;&gt;&gt; cplx
-(3+4j)
-&gt;&gt;&gt; print cplx.real #prints the real part of the complex number
-3.0
-&gt;&gt;&gt; print cplx.imag #prints the imaginary part of the complex number
-4.0
-&gt;&gt;&gt; print cplx*fl  #multiplies the real and imag parts of the complex number with the multiplier
-(9.42477+12.56636j)
-&gt;&gt;&gt; abs(cplx) #returns the absolute value of the complex number
-5.0
-
-</pre>
-<p id="x_74"></a>Python provides a datatype for complex numbers. Complex numbers are initialized as shown in the example above. The 
-        <span class="emphasis"><em>real</em></span> and 
-        <span class="emphasis"><em>imag</em></span> operators return the real and imaginary parts of the complex number as shown. The 
-        <span class="emphasis"><em>abs()</em></span> returns the absolute value of the complex number.
-      </p>
-</div>
-<div class="section" title="4.2. Variables">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="variables"></a>4.2. Variables</h3></div></div></div>
-<p id="x_75"></a>Variables are just names that represent a value. Variables have already been introduced in the various examples from the previous sections. Certain rules about using variables:</p>
-<div class="blockquote"><blockquote class="blockquote"><div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="x_76"></a>Variables have to be initialized or assigned a value before being used.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="x_77"></a>Variable names can consist of letters, digits and 
-              <a class="link" href="">underscores</a> .
-            </p></li>
-<li class="listitem" style="list-style-type: *"><p id="x_78"></a>Variable names cannot begin with digits, but can contain digits in them.</p></li>
-</ul></div></blockquote></div>
-<p id="x_79"></a>In reference to the previous section examples, 'a', 'b', 'lng', 'fl', 'e' and 'cplx' are all variables of various datatypes.</p>
-<pre class="programlisting">Note: Python is not a strongly typed language and hence an integer variable can at a
-later stage be used as a float variable as well.
-
-</pre>
-</div>
-<div class="section" title="4.3. Strings">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="strings"></a>4.3. Strings</h3></div></div></div>
-<p id="x_7a"></a>Strings are one of the essential data structures of any programming language. The 
-        <code class="literal">print "Hello, World!"</code> program was introduced in the earlier section, and the 
-        <span class="emphasis"><em>"Hello, World!"</em></span> in the print statement is a string. A string is basically a set of characters. Strings can be represented in various ways shown below:
-      </p>
-<pre class="programlisting">s = 'this is a string'              # a string variable can be represented using single quotes
-s = 'This one has "quotes" inside!' # The string can have quotes inside it as shown
-s = "I have 'single-quotes' inside!"
-l = "A string spanning many lines\
-one more line\
-yet another"                        # a string can span more than a single line.
-t = """A triple quoted string does  # another way of representing multiline strings.
-not need to be escaped at the end and
-"can have nested quotes" etc."""
-
-</pre>
-<p id="x_7b"></a>Try the following on the interpreter: 
-        <code class="literal">s = 'this is a string with 'quotes' of similar kind'</code>
-      </p>
-<p id="x_7c"></a>
-        <span class="strong"><strong>Exercise: How to use single quotes within single quotes in a string as shown in the above example without getting an error?</strong></span>
-      </p>
-<div class="section" title="4.3.1. String operations">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="string-operations"></a>4.3.1. String operations</h4></div></div></div>
-<p id="x_7d"></a>A few basic string operations are presented here.</p>
-<p id="x_7e"></a>
-          <span class="strong"><strong>String concatenation</strong></span> String concatenation is done by simple addition of two strings.
-        </p>
-<pre class="programlisting">&gt;&gt;&gt; x = 'Hello'
-&gt;&gt;&gt; y = ' Python'
-&gt;&gt;&gt; print x+y
-Hello Python
-
-</pre>
-<p id="x_7f"></a>          <span class="emphasis"><em>Try this yourself:</em></span>
-        </p>
-<pre class="programlisting">&gt;&gt;&gt; somenum = 13
-&gt;&gt;&gt; print x+somenum
-
-</pre>
-<p id="x_80"></a>The problem with the above example is that here a string variable and an integer variable are trying to be concantenated. To obtain the desired result from the above example the str(), repr() and the `` can be used.</p>
-<p id="x_81"></a>
-          <span class="strong"><strong>str()</strong></span> simply converts a value to a string in a reasonable form. 
-          <span class="strong"><strong>repr()</strong></span> creates a string that is a representation of the value.
-        </p>
-<p id="x_82"></a>The difference can be seen in the example shown below:</p>
-<pre class="programlisting">&gt;&gt;&gt; str(1000000000000000000000000000000000000000000000000L)
-'1000000000000000000000000000000000000000000000000'
-&gt;&gt;&gt; repr(1000000000000000000000000000000000000000000000000L)
-'1000000000000000000000000000000000000000000000000L'
-
-</pre>
-<p id="x_83"></a>It can be observed that the 'L' in the long value shown was omitted by str(), whereas repr() converted that into a string too. An alternative way of using repr(value) is `
-          <code class="literal">value</code>`.
-        </p>
-<p id="x_84"></a>A few more examples:</p>
-<pre class="programlisting">&gt;&gt;&gt; x = "Let's go \nto Pycon"
-&gt;&gt;&gt; print x
-Let's go 
-to Pycon
-
-</pre>
-<p id="x_85"></a>In the above example, notice that the '\n'(newline) character is formatted and the string is printed on two lines. The strings discussed until now were normal strings. Other than these there are two other types of strings namely, raw strings and unicode strings.</p>
-<p id="x_86"></a>
-          <span class="strong"><strong>Raw strings</strong></span> are strings which are unformatted, that is the backslashes(\) are not parsed and are left as it is in the string. Raw strings are represented with an 'r' at the start of a string. Let us look at an example
-        </p>
-<pre class="programlisting">&gt;&gt;&gt; x = r"Let's go \nto Pycon"
-&gt;&gt;&gt; print x
-Let's go \nto Pycon
-
-</pre>
-<p id="x_87"></a>Note: The '\n' is not being parsed into a new line and is left as it is.</p>
-<p id="x_88"></a>
-          <span class="emphasis"><em>Try this yourself:</em></span>
-        </p>
-<pre class="programlisting">&gt;&gt;&gt; x = r"Let's go to Pycon\"
-
-</pre>
-<p id="x_89"></a>          <span class="strong"><strong>Unicode strings</strong></span> are strings where the characters are Unicode characters as opposed to ASCII characters. Unicode strings are represented with a 'u' at the start of the string. Let us look at an example:
-        </p>
-<pre class="programlisting">&gt;&gt;&gt; x = u"Let's go to Pycon!"
-&gt;&gt;&gt; print x
-Let's go to Pycon!
-
-</pre>
-</div>
-</div>
-<div class="section" title="4.4. Boolean">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="boolean"></a>4.4. Boolean</h3></div></div></div>
-<p id="x_8a"></a>Python also provides special Boolean datatype. A boolean variable can assume a value of either 
-        <span class="emphasis"><em>True</em></span> or 
-        <span class="emphasis"><em>False</em></span> (Note the capitalizations).
-      </p>
-<p id="x_8b"></a>Let us look at examples:</p>
-<pre class="programlisting">&gt;&gt;&gt; t = True
-&gt;&gt;&gt; f = not t
-&gt;&gt;&gt; print f
-False
-&gt;&gt;&gt; f or t
-True
-&gt;&gt;&gt; f and t
-False
-
-</pre>
-</div>
-</div>
-<div class="section" title="5. The while loop">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="the-while-loop"></a>5. The 
-      <span class="strong"><strong>while</strong></span> loop
-    </h2></div></div></div>
-<p id="x_8c"></a>The Python 
-      <span class="strong"><strong>while</strong></span> loop is similar to the C/C++ while loop. The syntax is as follows:
-    </p>
-<pre class="programlisting">statement 0
-while condition:
-  statement 1 #while block
-  statement 2 #while block
-statement 3 #outside the while block.
-
-</pre>
-<p id="x_8d"></a>Let us look at an example:</p>
-<pre class="programlisting">&gt;&gt;&gt; x = 1  
-&gt;&gt;&gt; while x &lt;= 5:
-...   print x
-...   x += 1
-... 
-1
-2
-3
-4
-5
-
-</pre>
-</div>
-<div class="section" title="6. The if conditional">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="the-if-conditional"></a>6. The 
-      <span class="strong"><strong>if</strong></span> conditional
-    </h2></div></div></div>
-<p id="x_8e"></a>The Python 
-      <span class="strong"><strong>if</strong></span> block provides the conditional execution of statements. If the condition evaluates as true the block of statements defined under the if block are executed.
-    </p>
-<p id="x_8f"></a>If the first block is not executed on account of the condition not being satisfied, the set of statements in the 
-      <span class="strong"><strong>else</strong></span> block are executed.
-    </p>
-<p id="x_90"></a>The 
-      <span class="strong"><strong>elif</strong></span> block provides the functionality of evaluation of multiple conditions as shown in the example.
-    </p>
-<p id="x_91"></a>The syntax is as follows:</p>
-<pre class="programlisting">if condition :
-    statement_1
-    statement_2
-
-elif condition:
-    statement_3
-    statement_4
-else:
-    statement_5
-    statement_6
-
-</pre>
-<p id="x_92"></a>Let us look at an example:</p>
-<pre class="programlisting">&gt;&gt;&gt; n = raw_input("Input a number:")
-&gt;&gt;&gt; if n &lt; 0:
-      print n," is negative"
-      elif n &gt; 0:
-      print n," is positive"
-      else:
-      print n, " is 0"
-
-</pre>
-</div>
-<div class="section" title="7.  raw_input()">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="raw_input"></a>7.       <span class="strong"><strong>raw_input()</strong></span>
-    </h2></div></div></div>
-<p id="x_93"></a>In the previous example we saw the call to the raw_input() subroutine. The 
-      <span class="strong"><strong>raw_input()</strong></span> method is used to take user inputs through the console. Unlike 
-      <span class="strong"><strong>input()</strong></span> which assumes the data entered by the user as a standard python expression, 
-      <span class="strong"><strong>raw_input()</strong></span> treats all the input data as raw data and converts everything into a string. To illustrate this let us look at an example.
-    </p>
-<pre class="programlisting">&gt;&gt;&gt; input("Enter a number thats a palindrome:")
-Enter a number thats a palindrome:121
-121
-
-&gt;&gt;&gt; input("Enter your name:")
-Enter your name:PythonFreak
-Traceback (most recent call last):
-  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
-  File "&lt;string&gt;", line 1, in &lt;module&gt;
-NameError: name 'PythonFreak' is not defined
-
-</pre>
-<p id="x_94"></a>As shown above the 
-      <span class="strong"><strong>input()</strong></span> assumes that the data entered is a valid Python expression. In the first call it prompts for an integer input and when entered it accepts the integer as an integer, whereas in the second call, when the string is entered without the quotes, 
-      <span class="strong"><strong>input()</strong></span> assumes that the entered data is a valid Python expression and hence it raises and exception saying PythonFreak is not defined.
-    </p>
-<pre class="programlisting">&gt;&gt;&gt; input("Enter your name:")
-Enter your name:'PythonFreak'
-'PythonFreak'
-&gt;&gt;&gt; 
-
-</pre>
-<p id="x_95"></a>Here the name is accepted because its entered as a string (within quotes). But its unreasonable to go on using quotes each time a string is entered. Hence the alternative is to use 
-      <span class="strong"><strong>raw_input()</strong></span>.
-    </p>
-<p id="x_96"></a>Let us now look at how 
-      <span class="strong"><strong>raw_input()</strong></span> operates with an example.
-    </p>
-<pre class="programlisting">&gt;&gt;&gt; raw_input("Enter your name:")
-Enter your name:PythonFreak
-'PythonFreak'
-
-</pre>
-<p id="x_97"></a>Observe that the 
-      <span class="strong"><strong>raw_input()</strong></span> is converting it into a string all by itself.
-    </p>
-<pre class="programlisting">&gt;&gt;&gt; pal = raw_input("Enter a number thats a palindrome:")
-Enter a number thats a palindrome:121
-'121'
-
-</pre>
-<p id="x_98"></a>Observe that 
-      <span class="strong"><strong>raw_input()</strong></span> is converting the integer 121 also to a string as '121'. Let us look at another example:
-    </p>
-<pre class="programlisting">&gt;&gt;&gt; pal = raw_input("Enter a number thats a palindrome:")
-Enter a number thats a palindrome:121
-&gt;&gt;&gt; pal + 2
-Traceback (most recent call last):
-  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
-TypeError: cannot concatenate 'str' and 'int' objects
-&gt;&gt;&gt; pal
-'121'
-
-</pre>
-<p id="x_99"></a>Observe here that the variable 
-      <span class="emphasis"><em>pal</em></span> is a string and hence integer operations cannot be performed on it. Hence the exception is raised.
-    </p>
-</div>
-<div class="section" title="8.  int() method">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="int-method"></a>8. 
-      <span class="strong"><strong>int()</strong></span> method
-    </h2></div></div></div>
-<p id="x_9a"></a>Generally for computing purposes, the data used is not strings or raw data but on integers, floats and similar mathematical data structures. The data obtained from 
-      <span class="strong"><strong>raw_input()</strong></span> is raw data in the form of strings. In order to obtain integers from strings we use the method 
-      <span class="strong"><strong>int()</strong></span>.
-    </p>
-<p id="x_9b"></a>Let us look at an example.</p>
-<pre class="programlisting">&gt;&gt;&gt; intpal = int(pal)
-&gt;&gt;&gt; intpal
-121
-
-</pre>
-<p id="x_9c"></a>In the previous example it was observed that 
-      <span class="emphasis"><em>pal</em></span> was a string variable. Here using the 
-      <span class="strong"><strong>int()</strong></span> method the string 
-      <span class="emphasis"><em>pal</em></span> was converted to an integer variable.
-    </p>
-<p id="x_9d"></a>
-      <span class="emphasis"><em>Try This Yourself:</em></span>
-    </p>
-<pre class="programlisting">&gt;&gt;&gt; stringvar = raw_input("Enter a name:")
-Enter a name:Guido Van Rossum
-&gt;&gt;&gt; stringvar
-'Guido Van Rossum'
-&gt;&gt;&gt; numvar = int(stringvar)
-
-</pre>
-</div>
-</div>
-<div class="navfooter">
-<hr>
-<table width="100%" summary="Navigation footer">
-<tr>
-<td width="40%" align="left">
-<a accesskey="p" href="index.html">Prev</a> </td>
-<td width="20%" align="center"> </td>
-<td width="40%" align="right"> </td>
-</tr>
-<tr>
-<td width="40%" align="left" valign="top">Chapter 1. Introduction </td>
-<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
-<td width="40%" align="right" valign="top"> </td>
-</tr>
-</table>
-</div>
-</body>
-</html>
--- a/web/html/backup/ch02-list_tuples.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,652 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Lists and Tuples</title>
-<link rel="stylesheet" href="hgbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
-<link rel="home" href="index.html" title="Chapter 1. List and Tuples">
-<link rel="up" href="index.html" title="Chapter 1. List and Tuples">
-<link rel="prev" href="index.html" title="Chapter 1. List and Tuples">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<div class="navheader">
-<table width="100%" summary="Navigation header">
-<tr><th colspan="3" align="center">Lists and Tuples</th></tr>
-<tr>
-<td width="20%" align="left">
-<a accesskey="p" href="index.html">Prev</a> </td>
-<th width="60%" align="center"> </th>
-<td width="20%" align="right"> </td>
-</tr>
-</table>
-<hr>
-</div>
-<div class="article" title="Lists and Tuples">
-<div class="titlepage">
-<div><div><h2 class="title">
-<a name="id2609714"></a>Lists and Tuples</h2></div></div>
-<hr>
-</div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="section"><a href="ar01.html#common-list-operations">1. Common List Operations</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="ar01.html#indexing">1.1. Indexing</a></span></dt>
-<dt><span class="section"><a href="ar01.html#concatenating">1.2. Concatenating</a></span></dt>
-<dt><span class="section"><a href="ar01.html#slicing">1.3. Slicing</a></span></dt>
-<dt><span class="section"><a href="ar01.html#multiplication">1.4. Multiplication</a></span></dt>
-<dt><span class="section"><a href="ar01.html#membership">1.5. Membership</a></span></dt>
-<dt><span class="section"><a href="ar01.html#length-maximum-and-minimum">1.6. Length, Maximum and Minimum</a></span></dt>
-<dt><span class="section"><a href="ar01.html#changing-elements">1.7. Changing Elements</a></span></dt>
-<dt><span class="section"><a href="ar01.html#deleting-elements">1.8. Deleting Elements</a></span></dt>
-<dt><span class="section"><a href="ar01.html#assign-to-slices">1.9. Assign to Slices</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="ar01.html#none-empty-lists-and-initialization">2. None, Empty Lists, and Initialization</a></span></dt>
-<dt><span class="section"><a href="ar01.html#nested-lists">3. Nested Lists</a></span></dt>
-<dt><span class="section"><a href="ar01.html#list-methods">4. List Methods</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="ar01.html#append">4.1. append</a></span></dt>
-<dt><span class="section"><a href="ar01.html#count">4.2. count</a></span></dt>
-<dt><span class="section"><a href="ar01.html#extend">4.3. extend</a></span></dt>
-<dt><span class="section"><a href="ar01.html#index">4.4. index</a></span></dt>
-<dt><span class="section"><a href="ar01.html#insert">4.5. insert</a></span></dt>
-<dt><span class="section"><a href="ar01.html#pop">4.6. pop</a></span></dt>
-<dt><span class="section"><a href="ar01.html#remove">4.7. remove</a></span></dt>
-<dt><span class="section"><a href="ar01.html#reverse">4.8. reverse</a></span></dt>
-<dt><span class="section"><a href="ar01.html#sort">4.9. sort</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="ar01.html#tuples">5. Tuples</a></span></dt>
-<dd><dl><dt><span class="section"><a href="ar01.html#common-tuple-operations">5.1. Common Tuple Operations</a></span></dt></dl></dd>
-<dt><span class="section"><a href="ar01.html#additional-syntax">6. Additional Syntax</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="ar01.html#range">6.1. range()</a></span></dt>
-<dt><span class="section"><a href="ar01.html#for">6.2. for</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="ar01.html#conclusion">7. Conclusion</a></span></dt>
-</dl>
-</div>Lists
-  <p><a name="x_1"></a>Python provides an intuitive way to represent a group items, called 
-    <span class="emphasis"><em>Lists</em></span>. The items of a 
-    <span class="emphasis"><em>List</em></span> are called its elements. Unlike C/C++, elements can be of any type. A 
-    <span class="emphasis"><em>List</em></span> is represented as a list of comma-sepated elements with square brackets around them:
-  </p>
-<pre class="programlisting">&gt;&gt;&gt; a = [10, 'Python programming', 20.3523, 23, 3534534L]
-&gt;&gt;&gt; a
-[10, 'Python programming', 20.3523, 23, 3534534L]
-
-
-</pre>
-<div class="section" title="1. Common List Operations">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="common-list-operations"></a>1. Common List Operations</h2></div></div></div>
-<p><a name="x_2"></a>The following are some of the most commonly used operations on 
-      <span class="emphasis"><em>Lists</em></span>.
-    </p>
-<div class="section" title="1.1. Indexing">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="indexing"></a>1.1. Indexing</h3></div></div></div>
-<p><a name="x_3"></a>Individual elements of a 
-        <span class="emphasis"><em>List</em></span> can be accessed using an index to the element. The indices start at 0. One can also access the elements of the 
-        <span class="emphasis"><em>List</em></span> in reverse using negative indices.:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; a[1]
-'Python programming'
-&gt;&gt;&gt; a[-1]
-3534534L
-
-</pre>
-<p><a name="x_4"></a>It is important to note here that the last element of the 
-        <span class="emphasis"><em>List</em></span> has an index of -1.
-      </p>
-</div>
-<div class="section" title="1.2. Concatenating">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="concatenating"></a>1.2. Concatenating</h3></div></div></div>
-<p><a name="x_5"></a>Two or more 
-        <span class="emphasis"><em>Lists</em></span> can be concatenated using the + operator:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; a + ['foo', 12, 23.3432, 54]
-[10, 'Python programming', 20.3523, 'foo', 12, 23.3432, 54]
-&gt;&gt;&gt; [54, 75, 23] + ['write', 67, 'read']
-[54, 75, 23, 'write', 67, 'read']
-
-
-</pre>
-</div>
-<div class="section" title="1.3. Slicing">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="slicing"></a>1.3. Slicing</h3></div></div></div>
-<p><a name="x_6"></a>A 
-        <span class="emphasis"><em>List</em></span> can be sliced off to contain a subset of elements of the 
-        <span class="emphasis"><em>List</em></span>. Slicing can be done by using two indices separated by a colon, where the first index is inclusive and the second index is exclusive. The resulting slice is also a 
-        <span class="emphasis"><em>List</em></span>.:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; num = [1, 2, 3, 4, 5, 6, 7, 8, 9]
-&gt;&gt;&gt; num[3:6]
-[4, 5, 6]
-&gt;&gt;&gt; num[0:1]
-[1]
-&gt;&gt;&gt; num[7:10]
-[7, 8, 9]
-
-</pre>
-<p><a name="x_7"></a>The last example showed how to access last 3 elements of the 
-        <span class="emphasis"><em>List</em></span>. There is a small catch here. The second index 10 actually refers to the 11th element of the 
-        <span class="emphasis"><em>List</em></span> which is still valid, even though it doesn't exist because the second index is exclusive and tells the Python interpreter to get the last element of the 
-        <span class="emphasis"><em>List</em></span>. But this can also be done in a much easier way using negative indices:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; num[-3:-1]
-[7, 8, 9]
-
-</pre>
-<p><a name="x_8"></a>Excluding the first index implies that the slice must start at the beginning of the 
-        <span class="emphasis"><em>List</em></span>, while excluding the second index includes all the elements till the end of the 
-        <span class="emphasis"><em>List</em></span>. A third parameter to a slice, which is implicitly taken as 1 is the step of the slice. It is specified as a value which follows a colon after the second index:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; num[:4]
-[1, 2, 3, 4]
-&gt;&gt;&gt; num[7:]
-[8, 9]
-&gt;&gt;&gt; num[-3:]
-[7, 8, 9]
-&gt;&gt;&gt; num[:]
-[1, 2, 3, 4, 5, 6, 7, 8, 9]
-&gt;&gt;&gt; num[4:9:3]
-[5, 8]
-&gt;&gt;&gt; num[3::2]
-[4, 6, 8]
-&gt;&gt;&gt; num[::4]
-[1, 5, 9]
-
-
-</pre>
-</div>
-<div class="section" title="1.4. Multiplication">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="multiplication"></a>1.4. Multiplication</h3></div></div></div>
-<p><a name="x_9"></a>A 
-        <span class="emphasis"><em>List</em></span> can be multiplied with an integer to repeat itself:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; [20] * 5
-[20, 20, 20, 20, 20]
-&gt;&gt;&gt; [42, 'Python', 54] * 3
-[42, 'Python', 54, 42, 'Python', 54, 42, 'Python', 54]
-
-
-</pre>
-</div>
-<div class="section" title="1.5. Membership">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="membership"></a>1.5. Membership</h3></div></div></div>
-<p><a name="x_a"></a>
-        <span class="strong"><strong>in</strong></span> operator is used to find whether an element is part of the 
-        <span class="emphasis"><em>List</em></span>. It returns 
-        <span class="strong"><strong>True</strong></span> if the element is present in the 
-        <span class="emphasis"><em>List</em></span> or 
-        <span class="strong"><strong>False</strong></span> if it is not present. Since this operator returns a Boolean value it is called a Boolean operator:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; names = ['Guido', 'Alex', 'Tim']
-&gt;&gt;&gt; 'Tim' in names
-True
-&gt;&gt;&gt; 'Adam' in names
-False
-
-
-</pre>
-</div>
-<div class="section" title="1.6. Length, Maximum and Minimum">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="length-maximum-and-minimum"></a>1.6. Length, Maximum and Minimum</h3></div></div></div>
-<p><a name="x_b"></a>Length of a 
-        <span class="emphasis"><em>List</em></span> can be found out using the len function. The max function returns the element with the largest value and the min function returns the element with the smallest value:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; num = [4, 1, 32, 12, 67, 34, 65]
-&gt;&gt;&gt; len(num)
-7
-&gt;&gt;&gt; max(num)
-67
-&gt;&gt;&gt; min(num)
-1
-
-
-</pre>
-</div>
-<div class="section" title="1.7. Changing Elements">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="changing-elements"></a>1.7. Changing Elements</h3></div></div></div>
-<p><a name="x_c"></a>Unlike Strings 
-        <span class="emphasis"><em>Lists</em></span> are mutable, i.e. elements of a 
-        <span class="emphasis"><em>List</em></span> can be manipulated:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; a = [1, 3, 5, 7]
-&gt;&gt;&gt; a[2] = 9
-&gt;&gt;&gt; a
-[1, 3, 9, 7]
-
-
-</pre>
-</div>
-<div class="section" title="1.8. Deleting Elements">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="deleting-elements"></a>1.8. Deleting Elements</h3></div></div></div>
-<p><a name="x_d"></a>An element or a slice of a 
-        <span class="emphasis"><em>List</em></span> can be deleted by using the 
-        <span class="strong"><strong>del</strong></span> statement:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; a = [1, 3, 5, 7, 9, 11]
-&gt;&gt;&gt; del a[-2:]
-&gt;&gt;&gt; a
-[1, 3, 5, 7]
-&gt;&gt;&gt; del a[1]
-&gt;&gt;&gt; a
-[1, 5, 7]
-
-
-</pre>
-</div>
-<div class="section" title="1.9. Assign to Slices">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="assign-to-slices"></a>1.9. Assign to Slices</h3></div></div></div>
-<p><a name="x_e"></a>In the same way, values can be assigned to individual elements of the 
-        <span class="emphasis"><em>List</em></span>, a 
-        <span class="emphasis"><em>List</em></span> of elements can be assigned to a slice:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; a = [2, 3, 4, 5]
-&gt;&gt;&gt; a[:2] = [0, 1]
-[0, 1, 4, 5]
-&gt;&gt;&gt; a[2:2] = [2, 3]
-&gt;&gt;&gt; a
-[0, 1, 2, 3, 4, 5]
-&gt;&gt;&gt; a[2:4] = []
-&gt;&gt;&gt; a
-[0, 1, 4, 5]
-
-</pre>
-<p><a name="x_f"></a>The last two examples should be particularly noted carefully. The last but one example insert elements or a list of elements into a 
-        <span class="emphasis"><em>List</em></span> and the last example deletes a list of elements from the 
-        <span class="emphasis"><em>List</em></span>.
-      </p>
-</div>
-</div>
-<div class="section" title="2. None, Empty Lists, and Initialization">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="none-empty-lists-and-initialization"></a>2. None, Empty Lists, and Initialization</h2></div></div></div>
-<p><a name="x_10"></a>An 
-      <span class="emphasis"><em>Empty List</em></span> is a 
-      <span class="emphasis"><em>List</em></span> with no elements and is simply represented as []. A 
-      <span class="emphasis"><em>None List</em></span> is one with all elements in it being 
-      <span class="strong"><strong>None</strong></span>. It serves the purpose having a container list of some fixed number of elements with no value:
-    </p>
-<pre class="programlisting">&gt;&gt;&gt; a = []
-&gt;&gt;&gt; a
-[]
-&gt;&gt;&gt; n = [None] * 10
-&gt;&gt;&gt; n
-[None, None, None, None, None, None, None, None, None, None]
-
-
-</pre>
-</div>
-<div class="section" title="3. Nested Lists">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="nested-lists"></a>3. Nested Lists</h2></div></div></div>
-<p><a name="x_11"></a>As mentioned earlier, a List can contain elements of any data type. This also implies a 
-      <span class="emphasis"><em>List</em></span> can have a 
-      <span class="emphasis"><em>Lists</em></span> themselves as its elements. These are called as 
-      <span class="emphasis"><em>Nested Lists</em></span>. There is no limit on the depth of the 
-      <span class="emphasis"><em>Nested Lists</em></span>:
-    </p>
-<pre class="programlisting">&gt;&gt;&gt; a = [1, [1, 2, 3], 3, [1, [1, 2, 3]], 7]
-
-
-</pre>
-</div>
-<div class="section" title="4. List Methods">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="list-methods"></a>4. List Methods</h2></div></div></div>
-<p><a name="x_12"></a>A method is a function that is coupled to an object. More about objects and its methods are discussed in Advanced Python module. In general, a method is called like:</p>
-<pre class="programlisting">object.method(arguments)
-
-</pre>
-<p><a name="x_13"></a>For now, it is enough to know that a list of elements is an object and so 
-      <span class="emphasis"><em>List</em></span> methods can be called upon them. Also some of the methods change the 
-      <span class="emphasis"><em>List</em></span> in-place, meaning it modifies the existing list instead of creating a new one, while other methods don't. It must be noted as we run through the 
-      <span class="emphasis"><em>List</em></span> methods.
-    </p>
-<p><a name="x_14"></a>Some of the most commonly used 
-      <span class="emphasis"><em>List</em></span> methods are as follows:
-    </p>
-<div class="section" title="4.1. append">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="append"></a>4.1. append</h3></div></div></div>
-<p><a name="x_15"></a>The 
-        <span class="emphasis"><em>append</em></span> method is used to append an object at the end of the list:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; prime = [2, 3, 5]
-&gt;&gt;&gt; prime.append(7)
-&gt;&gt;&gt; prime
-[2, 3, 5, 7]
-
-</pre>
-<p><a name="x_16"></a>It is important to note that append changes the 
-        <span class="emphasis"><em>List</em></span> in-place.
-      </p>
-</div>
-<div class="section" title="4.2. count">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="count"></a>4.2. count</h3></div></div></div>
-<p><a name="x_17"></a>The 
-        <span class="emphasis"><em>count</em></span> method returns the number of occurences of a particular element in a list:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; [1, 4, 4, 9, 9, 9].count(9)
-3
-&gt;&gt;&gt; tlst = ['Python', 'is', 'a', 'beautiful', 'language']
-&gt;&gt;&gt; tlst.count('Python')
-1
-
-
-</pre>
-</div>
-<div class="section" title="4.3. extend">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="extend"></a>4.3. extend</h3></div></div></div>
-<p><a name="x_18"></a>The 
-        <span class="emphasis"><em>extend</em></span> method extends the list on which it is called by the list supplied as argument to it:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; a = [1, 2, 3]
-&gt;&gt;&gt; b = [4, 5, 6]
-&gt;&gt;&gt; a.extend(b)
-[1, 2, 3, 4, 5, 6]
-
-</pre>
-<p><a name="x_19"></a>This is an in-place method. This method is equivalent to using the + operator, but using the + operator returns a new list.</p>
-</div>
-<div class="section" title="4.4. index">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="index"></a>4.4. index</h3></div></div></div>
-<p><a name="x_1a"></a>The 
-        <span class="emphasis"><em>index</em></span> method returns the index position of the element in the list specified as argument:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; a = [1, 2, 3, ,4, 5]
-&gt;&gt;&gt; a.index(4)
-3
-
-
-</pre>
-</div>
-<div class="section" title="4.5. insert">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="insert"></a>4.5. insert</h3></div></div></div>
-<p><a name="x_1b"></a>The 
-        <span class="emphasis"><em>insert</em></span> method is used to insert an element specified as the second argument to the list at the position specified by the first argument:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; a = ['Python', 'is', 'cool']
-&gt;&gt;&gt; a.insert(2, 'so')
-&gt;&gt;&gt; a
-['Python', 'is', 'so', 'cool']
-
-</pre>
-<p><a name="x_1c"></a>The 
-        <span class="emphasis"><em>insert</em></span> method changes the 
-        <span class="emphasis"><em>List</em></span> in-place.
-      </p>
-</div>
-<div class="section" title="4.6. pop">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="pop"></a>4.6. pop</h3></div></div></div>
-<p><a name="x_1d"></a>The 
-        <span class="emphasis"><em>pop</em></span> method removes an element from the list. The index position of the element to be removed can be specified as an argument to the 
-        <span class="emphasis"><em>pop</em></span> method, if not it removes the last element by default:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; a = [1, 2, 3, 4, 5]
-&gt;&gt;&gt; a.pop()
-&gt;&gt;&gt; a
-5
-&gt;&gt;&gt; a.pop(2)
-&gt;&gt;&gt; a
-3
-
-</pre>
-<p><a name="x_1e"></a>The 
-        <span class="emphasis"><em>pop</em></span> method changes the 
-        <span class="emphasis"><em>List</em></span> in-place.
-      </p>
-</div>
-<div class="section" title="4.7. remove">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="remove"></a>4.7. remove</h3></div></div></div>
-<p><a name="x_1f"></a>The 
-        <span class="emphasis"><em>remove</em></span> method removes the first occurence of an element supplied as a parameter:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; a = [1, 2, 3, 4, 2, 5, 2]
-&gt;&gt;&gt; a.remove(2)
-&gt;&gt;&gt; a
-[1, 3, 4, 2, 5, 2]
-
-
-</pre>
-</div>
-<div class="section" title="4.8. reverse">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="reverse"></a>4.8. reverse</h3></div></div></div>
-<p><a name="x_20"></a>The 
-        <span class="emphasis"><em>reverse</em></span> method reverses elements in the list. It is important to note here that 
-        <span class="emphasis"><em>reverse</em></span> method changes the list in-place and doesn't return any thing:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; a = ['guido', 'alex', 'tim']
-&gt;&gt;&gt; a.reverse()
-&gt;&gt;&gt; a
-['tim', 'alex', 'guido']
-
-
-</pre>
-</div>
-<div class="section" title="4.9. sort">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="sort"></a>4.9. sort</h3></div></div></div>
-<p><a name="x_21"></a>The 
-        <span class="emphasis"><em>sort</em></span> method is used to sort the elements of the list. The 
-        <span class="emphasis"><em>sort</em></span> method also sorts in-place and does not return anything:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; a = [5, 1, 3, 7, 4]
-&gt;&gt;&gt; a.sort()
-&gt;&gt;&gt; a
-[1, 3, 4, 5, 7]
-
-</pre>
-<p><a name="x_22"></a>In addition to the sort method on a 
-        <span class="emphasis"><em>List</em></span> object we can also use the built-in 
-        <span class="strong"><strong>sorted</strong></span> function. This function takes the 
-        <span class="emphasis"><em>List</em></span> as a parameter and returns a sorted copy of the list. However the original list is left intact:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; a = [5, 1, 3, 7, 4]
-&gt;&gt;&gt; b = sorted(a)
-&gt;&gt;&gt; b
-[1, 3, 4, 5, 7]
-&gt;&gt;&gt; a
-[5, 1, 3, 7, 4]
-
-
-</pre>
-</div>
-</div>
-<div class="section" title="5. Tuples">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="tuples"></a>5. Tuples</h2></div></div></div>
-<p><a name="x_23"></a>
-      <span class="emphasis"><em>Tuples</em></span> are sequences just like 
-      <span class="emphasis"><em>Lists</em></span>, but they are immutable. In other words 
-      <span class="emphasis"><em>Tuples</em></span> provides a way to represent a group of items, where the group of items cannot be changed in any way. The syntax of a 
-      <span class="emphasis"><em>Tuple</em></span> is also very similar to 
-      <span class="emphasis"><em>List</em></span>. A 
-      <span class="emphasis"><em>Tuple</em></span> is represented with the list of items, called elements of the 
-      <span class="emphasis"><em>Tuple</em></span> separated by comma, with the entire list being enclosed in parenthesis. It is not compulsory to use parenthesis around a 
-      <span class="emphasis"><em>Tuple</em></span> but it may be necessary in some of the cases:
-    </p>
-<pre class="programlisting">&gt;&gt;&gt; a = 1, 2, 3
-&gt;&gt;&gt; a
-(1, 2, 3)
-&gt;&gt;&gt; b = 1,
-&gt;&gt;&gt; b
-(1,)
-
-</pre>
-<p><a name="x_24"></a>It is interesting to note the second example. Just a value followed by a comma automatically makes that an element of a 
-      <span class="emphasis"><em>Tuple</em></span> with only one element. It is also important to note that, irrespective of input having a parenthesis, the output always has a parenthesis.
-    </p>
-<p><a name="x_25"></a>The first example is also known as 
-      <span class="emphasis"><em>Tuple packing</em></span>, because values are being packed into a tuple. It is also possible to do 
-      <span class="emphasis"><em>Tuple unpacking</em></span> which is more interesting. It is better to understand that by example. Say we have a co-ordinate pair from which we need to separate x and y co-ordinates:
-    </p>
-<pre class="programlisting">&gt;&gt;&gt; a = (1, 2)
-&gt;&gt;&gt; x, y = a
-&gt;&gt;&gt; x
-1
-&gt;&gt;&gt; y
-2
-
-</pre>
-<p><a name="x_26"></a>      <span class="emphasis"><em>Tuple unpacking</em></span> also has several other use-cases of which the most interesting one is to swap the values of two variables. Using programming languages like C would require anywhere around 10 lines of code and an extra temporary variable to do this (including all the #include stuff). Python does it in the most intuitive way in just one line. Say we want to swap the co-ordinates in the above example:
-    </p>
-<pre class="programlisting">&gt;&gt;&gt; x, y = y, x
-&gt;&gt;&gt; x
-2
-&gt;&gt;&gt; y
-1
-
-</pre>
-<div class="section" title="5.1. Common Tuple Operations">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="common-tuple-operations"></a>5.1. Common Tuple Operations</h3></div></div></div>
-<p><a name="x_27"></a>There is no need to introduce all the 
-        <span class="emphasis"><em>Tuple</em></span> operations again, since 
-        <span class="emphasis"><em>Tuples</em></span> support the following operations that 
-        <span class="emphasis"><em>List</em></span> supports in exactly the same way:
-      </p>
-<div class="blockquote"><blockquote class="blockquote"><div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p><a name="x_28"></a>Indexing</p></li>
-<li class="listitem" style="list-style-type: *"><p><a name="x_29"></a>Concatenating</p></li>
-<li class="listitem" style="list-style-type: *"><p><a name="x_2a"></a>Slicing</p></li>
-<li class="listitem" style="list-style-type: *"><p><a name="x_2b"></a>Membership</p></li>
-<li class="listitem" style="list-style-type: *"><p><a name="x_2c"></a>Multiplication</p></li>
-<li class="listitem" style="list-style-type: *"><p><a name="x_2d"></a>Length, Maximum, Minimum</p></li>
-</ul></div></blockquote></div>
-<p><a name="x_2e"></a>The following examples illustrate the above operations:</p>
-<pre class="programlisting">&gt;&gt;&gt; a = (1, 2, 3, 4, 5, 6)
-&gt;&gt;&gt; a[5]
-6
-&gt;&gt;&gt; b = (7, 8, 9)
-&gt;&gt;&gt; a + b
-(1, 2, 3, 4, 5, 6, 7, 8, 9)
-&gt;&gt;&gt; a[3:5]
-(4, 5)
-&gt;&gt;&gt; 5 in a
-True
-&gt;&gt;&gt; c = (1,)
-&gt;&gt;&gt; c * 5
-(1, 1, 1, 1, 1)
-&gt;&gt;&gt; len(a)
-6
-&gt;&gt;&gt; max(a)
-6
-&gt;&gt;&gt; min(a)
-1
-
-</pre>
-<p><a name="x_2f"></a>However the following 
-        <span class="emphasis"><em>List</em></span> operations are not supported by 
-        <span class="emphasis"><em>Tuples</em></span> because 
-        <span class="emphasis"><em>Tuples</em></span> cannot be changed once they are created:
-      </p>
-<div class="blockquote"><blockquote class="blockquote"><div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p><a name="x_30"></a>Changing elements</p></li>
-<li class="listitem" style="list-style-type: *"><p><a name="x_31"></a>Deleting elements</p></li>
-<li class="listitem" style="list-style-type: *"><p><a name="x_32"></a>Assigning to slices</p></li>
-</ul></div></blockquote></div>
-<p><a name="x_33"></a>Similarity to 
-        <span class="emphasis"><em>Lists</em></span> leads to the questions like, why not 
-        <span class="emphasis"><em>Lists</em></span> only? Why do we even want 
-        <span class="emphasis"><em>Tuples</em></span>? Can we do the same with 
-        <span class="emphasis"><em>Lists</em></span>? And the answer is 
-        <span class="strong"><strong>Yes</strong></span> we can do it, but 
-        <span class="emphasis"><em>Tuples</em></span> are helpful at times, like we can return Tuples from functions. They are also returned by some built-in functions and methods. And also there are some use cases like co-ordinate among other things. So 
-        <span class="emphasis"><em>Tuples</em></span> are helpful.
-      </p>
-</div>
-</div>
-<div class="section" title="6. Additional Syntax">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="additional-syntax"></a>6. Additional Syntax</h2></div></div></div>
-<p><a name="x_34"></a>The following additional syntax are introduced to make it easier to operate on 
-      <span class="emphasis"><em>Lists</em></span>.
-    </p>
-<div class="section" title="6.1. range()">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="range"></a>6.1. range()</h3></div></div></div>
-<p><a name="x_35"></a>The 
-        <span class="emphasis"><em>range</em></span> function takes at least one argument and 2 additional optional arguments. If two or more arguments are specified, the range function returns a list of natural numbers starting from the first argument passed to it to the second argument. The third argument, if specified is used as a step. Suppose only one argument is specified, then 
-        <span class="emphasis"><em>range</em></span> function returns a list of natural numbers starting from 0 upto the argument specified:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; range(5, 10, 2)
-[5, 7, 9]
-&gt;&gt;&gt; range(2, 15)
-[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
-&gt;&gt;&gt; range(12)
-[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
-
-</pre>
-</div>
-<div class="section" title="6.2. for">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="for"></a>6.2. for</h3></div></div></div>
-<p><a name="x_36"></a>The 
-        <span class="strong"><strong>for</strong></span> keyword is used as a part of the looping construct. Unlike for loops in other languages, Python's for is used to iterate through the elements of sequences like 
-        <span class="emphasis"><em>Lists</em></span>, 
-        <span class="emphasis"><em>Tuples</em></span>, 
-        <span class="emphasis"><em>Dictionaries</em></span>, etc. The syntax of the for loop consists of 
-        <span class="strong"><strong>for</strong></span>, followed by a variable to hold the individual or the current element of the list during iteration and 
-        <span class="strong"><strong>in</strong></span>, followed by the sequence and a semicolon(':') The next line which is part of the 
-        <span class="strong"><strong>for</strong></span> loop, i.e the statements that are part of the loop should start with a new intend:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; names = ['Guido', 'Alex', 'Tim']
-&gt;&gt;&gt; for name in names:
-...   print "Name =", name
-... 
-Name = Guido
-Name = Alex
-Name = Tim
-
-
-</pre>
-</div>
-</div>
-<div class="section" title="7. Conclusion">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="conclusion"></a>7. Conclusion</h2></div></div></div>
-<p><a name="x_37"></a>This section on 
-      <span class="emphasis"><em>Lists</em></span> and 
-      <span class="emphasis"><em>Tuples</em></span> introduces almost all the necessary machinary required to work on 
-      <span class="emphasis"><em>Lists</em></span> and 
-      <span class="emphasis"><em>Tuples</em></span>. Topics like how to use these data structures in bigger more useful programs will be introduced in the subsequent chapters.
-    </p>
-</div>
-</div>
-<div class="navfooter">
-<hr>
-<table width="100%" summary="Navigation footer">
-<tr>
-<td width="40%" align="left">
-<a accesskey="p" href="index.html">Prev</a> </td>
-<td width="20%" align="center"> </td>
-<td width="40%" align="right"> </td>
-</tr>
-<tr>
-<td width="40%" align="left" valign="top">Chapter 1. List and Tuples </td>
-<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
-<td width="40%" align="right" valign="top"> </td>
-</tr>
-</table>
-</div>
-</body>
-</html>
--- a/web/html/backup/ch03-oop.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Classes and Objects</title>
-<link rel="stylesheet" href="hgbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
-<link rel="home" href="index.html" title="Chapter 1. Classes and Object">
-<link rel="up" href="index.html" title="Chapter 1. Classes and Object">
-<link rel="prev" href="index.html" title="Chapter 1. Classes and Object">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<div class="navheader">
-<table width="100%" summary="Navigation header">
-<tr><th colspan="3" align="center">Classes and Objects</th></tr>
-<tr>
-<td width="20%" align="left">
-<a accesskey="p" href="index.html">Prev</a> </td>
-<th width="60%" align="center"> </th>
-<td width="20%" align="right"> </td>
-</tr>
-</table>
-<hr>
-</div>
-<div class="article" title="Classes and Objects">
-<div class="titlepage">
-<div><div><h2 class="title">
-<a name="id2898687"></a>Classes and Objects</h2></div></div>
-<hr>
-</div>
-<p><a name="x_9e"></a>In the previous sections we learnt about functions which provide certain level of abstraction to our code by holding the code which performs one or more specific functionalities. We were able to use this function as many times as we wanted. In addition to functions, Python also higher level of abstractions through 
-    <span class="emphasis"><em>Classes</em></span> and 
-    <span class="emphasis"><em>Objects</em></span>. 
-    <span class="emphasis"><em>Objects</em></span> can be loosely defined as a collection of a set of data items and a set of methods. The data items can be any valid Python variable or any Python object. Functions enclosed within a class are called as 
-    <span class="emphasis"><em>methods</em></span>. If you are thinking if methods are functions why is there a distinction between the two? The answer to this will be given as we walk through the concepts of 
-    <span class="emphasis"><em>Classes</em></span> and 
-    <span class="emphasis"><em>Objects</em></span>. 
-    <span class="emphasis"><em>Classes</em></span> contain the definition for the 
-    <span class="emphasis"><em>Objects</em></span>. 
-    <span class="emphasis"><em>Objects</em></span> are instances of 
-    <span class="emphasis"><em>Classes</em></span>.
-  </p>
-<p><a name="x_9f"></a>A class is defined using the keyword 
-    <span class="strong"><strong>class</strong></span> followed by the class name, in turn followed by a semicolon. The statements that a 
-    <span class="emphasis"><em>Class</em></span> encloses are written in a new block, i.e on the next indentation level:
-  </p>
-<pre class="programlisting">class Employee:
-  def setName(self, name):
-    self.name = name
-
-  def getName(self):
-    return self.name
-
-</pre>
-<p><a name="x_a0"></a>In the above example, we defined a class with the name Employee. We also defined two methods, setName and getName for this class. It is important to note the differences between the normal Python functions and class methods defined above. Each method of the class must take the same instance of the class(object) from which it was called as the first argument. It is conventionally given the name, 
-    <span class="emphasis"><em>self</em></span>. Note that 
-    <span class="emphasis"><em>self</em></span> is only a convention. You can use any other name, but the first argument to the method will always be the same object of the class from which the method was called. The data memebers that belong to the class are called as 
-    <span class="emphasis"><em>class attributes</em></span>. 
-    <span class="emphasis"><em>Class attributes</em></span> are preceded by the object of the class and a dot. In the above example, 
-    <span class="emphasis"><em>name</em></span> is a class attribute since it is preceded by the 
-    <span class="emphasis"><em>self</em></span> object. 
-    <span class="emphasis"><em>Class attributes</em></span> can be accessed from anywhere within the class.
-  </p>
-<p><a name="x_a1"></a>We can create objects of a class outside the class definition by using the same syntax we use to call a function with no parameters. We can assign this object to a variable:</p>
-<pre class="programlisting">emp = Employee()
-
-</pre>
-<p><a name="x_a2"></a>In the above example, we create an object named 
-    <span class="emphasis"><em>emp</em></span> of the class 
-    <span class="emphasis"><em>Employee</em></span>. All the attributes and methods of the class can be accessed by the object of the class using the standard notation 
-    <span class="emphasis"><em>object.attribute</em></span> or 
-    <span class="emphasis"><em>object.method()</em></span>. Although the first parameter of a class method is the self object, it must not be passed as an argument when calling the method. The 
-    <span class="emphasis"><em>self</em></span> object is implicitly passed to the method by the Python interpreter. All other arguments passing rules like default arguments, keyword arguments, argument packing and unpacking follow the same rules as those for ordinary Python functions:
-  </p>
-<pre class="programlisting">&gt;&gt;&gt; emp.setName('John')
-&gt;&gt;&gt; name = emp.getName()
-&gt;&gt;&gt; print name
-John
-&gt;&gt;&gt; print emp.name
-John
-
-</pre>
-<p><a name="x_a3"></a>If we at all try to access a class attribute before assigning a value to it, i.e before creating it, Python raises the same error as it would raise for the accessing undefined variable:</p>
-<pre class="programlisting">&gt;&gt;&gt; emp = Employee()
-&gt;&gt;&gt; emp.name
-Traceback (most recent call last):
-  File "class.py", line 10, in &lt;module&gt;
-    print e.name
-AttributeError: Employee instance has no attribute 'name'
-
-</pre>
-</div>
-<div class="navfooter">
-<hr>
-<table width="100%" summary="Navigation footer">
-<tr>
-<td width="40%" align="left">
-<a accesskey="p" href="index.html">Prev</a> </td>
-<td width="20%" align="center"> </td>
-<td width="40%" align="right"> </td>
-</tr>
-<tr>
-<td width="40%" align="left" valign="top">Chapter 1. Classes and Object </td>
-<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
-<td width="40%" align="right" valign="top"> </td>
-</tr>
-</table>
-</div>
-</body>
-</html>
--- a/web/html/backup/chap_intro.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-p_list={'chap_intro':['x_38', 'x_39', 'x_3d', 'x_3e', 'x_3f', 'x_40', 'x_41', 'x_42', 'x_46', 'x_4c', 'x_4d', 'x_4e', 'x_4f', 'x_50', 'x_51', 'x_52', 'x_53', 'x_54', 'x_55', 'x_56', 'x_57', 'x_58', 'x_59', 'x_5a', 'x_5b', 'x_5c', 'x_5d', 'x_5e', 'x_5f', 'x_60', 'x_61', 'x_62', 'x_63', 'x_64', 'x_65', 'x_66', 'x_67', 'x_68', 'x_69', 'x_6d', 'x_6e', 'x_6f', 'x_70', 'x_71', 'x_72', 'x_73', 'x_74', 'x_75', 'x_79', 'x_7a', 'x_7b', 'x_7c', 'x_7d', 'x_7e', 'x_7f', 'x_80', 'x_81', 'x_82', 'x_83', 'x_84', 'x_85', 'x_86', 'x_87', 'x_88', 'x_89', 'x_8a', 'x_8b', 'x_8c', 'x_8d', 'x_8e', 'x_8f', 'x_90', 'x_91', 'x_92', 'x_93', 'x_94', 'x_95', 'x_96', 'x_97', 'x_98', 'x_99', 'x_9a', 'x_9b', 'x_9c', 'x_9d']}
-
--- a/web/html/backup/func.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,726 +0,0 @@
-<html>
-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>Chapter 9. Finding and fixing mistakes</title>
-<link rel="stylesheet" href="/support/styles.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.74.3"><link rel="home" href="index.html" title="Mercurial: The Definitive Guide">
-<link rel="up" href="index.html" title="Mercurial: The Definitive Guide">
-<link rel="prev" href="managing-releases-and-branchy-development.html" title="Chapter 8. Managing releases and branchy development">
-<link rel="next" href="handling-repository-events-with-hooks.html" title="Chapter 10. Handling repository events with hooks"><link rel="alternate" type="application/atom+xml" title="Comments" href="/feeds/comments/">
-<link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png">
-<script type="text/javascript" src="/support/jquery-min.js"></script>
-<script type="text/javascript" src="/support/form.js"></script>
-<script type="text/javascript" src="/support/hsbook.js"></script></head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<!--<div class="navheader">
-<table width="100%" summary="Navigation header">
-<tr><th colspan="3" align="center">Chapter 14. Adding functionality with extensions</th></tr>
-<tr>
-<td width="20%" align="left">
-<a accesskey="p" href="advanced-uses-of-mercurial-queues.html">Prev</a> </td>
-<th width="60%" align="center"> </th>
-<td width="20%" align="right"> <a accesskey="n" href="migrating-to-mercurial.html">Next</a>
-</td>
-</tr>
-</table>
-<hr>
-</div> -->
-<div class="chapter" title="Chapter 14. Adding functionality with extensions">
-<div class="titlepage"><div><div><h2 class="title">
-<a name="chap:hgext"></a>Chapter 14. Adding functionality with extensions</h2></div></div></div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:inotify">14.1. Improve performance with the <code class="literal">inotify</code> extension</a></span></dt>
-<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:extdiff">14.2. Flexible diff support with the <code class="literal">extdiff</code> extension</a></span></dt>
-<dd><dl><dt><span class="sect2"><a href="adding-functionality-with-extensions.html#id3071699">14.2.1. Defining command aliases</a></span></dt></dl></dd>
-<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:transplant">14.3. Cherrypicking changes with the <code class="literal">transplant</code> extension</a></span></dt>
-<dt><span class="sect1"><a href="adding-functionality-with-extensions.html#sec:hgext:patchbomb">14.4. Send changes via email with the <code class="literal">patchbomb</code> extension</a></span></dt>
-<dd><dl><dt><span class="sect2"><a href="adding-functionality-with-extensions.html#id3072184">14.4.1. Changing the behavior of patchbombs</a></span></dt></dl></dd>
-</dl>
-</div>
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="section"><a href="#default-arguments">1. Default Arguments</a></span></dt>
-<dt><span class="section"><a href="#keyword-arguments">2. Keyword Arguments</a></span></dt>
-<dt><span class="section"><a href="#parameter-packing-and-unpacking">3. Parameter Packing and Unpacking</a></span></dt>
-<dt><span class="section"><a href="#nested-functions-and-scopes">4. Nested Functions and Scopes</a></span></dt>
-<dt><span class="section"><a href="#map-reduce-and-filter-functions">5. map, reduce and filter functions</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#list-comprehensions">5.1. List Comprehensions</a></span></dt></dl></dd>
-</dl>
-
-<p id="x_74b">
-    <span class="emphasis"><em>Functions</em></span> allow us to enclose a set of statements and call the function again and again instead of repeating the group of statements everytime. Functions also allow us to isolate a piece of code from all the other code and provides the convenience of not polluting the global variables.
-  </p>
-<p id="x_74c"<a name="x_74c"></a>
-    <span class="emphasis"><em>Function</em></span> in python is defined with the keyword 
-    <span class="strong"><strong>def</strong></span> followed by the name of the function, in turn followed by a pair of parenthesis which encloses the list of parameters to the function. The definition line ends with a ':'. The definition line is followed by the body of the function intended by one block. The 
-    <span class="emphasis"><em>Function</em></span> must return a value:
-  </p>
-<pre class="programlisting">def factorial(n):
-  fact = 1
-  for i in range(2, n):
-    fact *= i
-
-  return fact
-
-</pre>
-<p><a name="x_74d"></a>The code snippet above defines a function with the name factorial, takes the number for which the factorial must be computed, computes the factorial and returns the value.</p>
-<p><a name="x_74e"></a>A 
-    <span class="emphasis"><em>Function</em></span> once defined can be used or called anywhere else in the program. We call a fucntion with its name followed by a pair of parenthesis which encloses the arguments to the function.
-  </p>
-<p><a name="x_74f"></a>The value that function returns can be assigned to a variable. Let's call the above function and store the factorial in a variable:</p>
-<pre class="programlisting">fact5 = factorial(5)
-
-</pre>
-<p><a name="x_750"></a>The value of fact5 will now be 120, which is the factorial of 5. Note that we passed 5 as the argument to the function.</p>
-<p><a name="x_751"></a>It may be necessary to document what the function does, for each of the function to help the person who reads our code to understand it better. In order to do this Python allows the first line of the function body to be a string. This string is called as 
-    <span class="emphasis"><em>Documentation String</em></span> or 
-    <span class="emphasis"><em>docstring</em></span>. 
-    <span class="emphasis"><em>docstrings</em></span> prove to be very handy since there are number of tools which can pull out all the docstrings from Python functions and generate the documentation automatically from it. 
-    <span class="emphasis"><em>docstrings</em></span> for functions can be written as follows:
-  </p>
-<pre class="programlisting">def factorial(n):
-  'Returns the factorial for the number n.'
-  fact = 1
-  for i in range(2, n):
-    fact *= i
-
-  return fact
-
-</pre>
-<p><a name="x_752"></a>An important point to note at this point is that, a function can return any Python value or a Python object, which also includes a 
-    <span class="emphasis"><em>Tuple</em></span>. A 
-    <span class="emphasis"><em>Tuple</em></span> is just a collection of values and those values themselves can be of any other valid Python datatypes, including 
-    <span class="emphasis"><em>Lists</em></span>, 
-    <span class="emphasis"><em>Tuples</em></span>, 
-    <span class="emphasis"><em>Dictionaries</em></span> among other things. So effectively, if a function can return a tuple, it can return any number of values through a tuple
-  </p>
-<p><a name="x_753"></a>Let us write a small function to swap two values:</p>
-<pre class="programlisting">def swap(a, b):
-  return b, a
-
-c, d = swap(a, b)
-
-</pre>
-<p><a name="x_754"></a>Function scope --------------- The variables used inside the function are confined to the function's scope and doesn't pollute the variables of the same name outside the scope of the function. Also the arguments passed to the function are passed by-value if it is of basic Python data type:</p>
-<pre class="programlisting">def cant_change(n):
-  n = 10
-
-n = 5
-cant_change(n)
-
-</pre>
-<p><a name="x_755"></a>Upon running this code, what do you think would have happened to value of n which was assigned 5 before the function call? If you have already tried out that snippet on the interpreter you already know that the value of n is not changed. This is true of any immutable types of Python like 
-    <span class="emphasis"><em>Numbers</em></span>, 
-    <span class="emphasis"><em>Strings</em></span> and 
-    <span class="emphasis"><em>Tuples</em></span>. But when you pass mutable objects like 
-    <span class="emphasis"><em>Lists</em></span> and 
-    <span class="emphasis"><em>Dictionaries</em></span> the values are manipulated even outside the function:
-  </p>
-<pre class="programlisting">&gt;&gt;&gt; def can_change(n):
-...   n[1] = James
-...
-
-&gt;&gt;&gt; name = ['Mr.', 'Steve', 'Gosling']
-&gt;&gt;&gt; can_change(name)
-&gt;&gt;&gt; name
-['Mr.', 'James', 'Gosling']
-
-</pre>
-<p><a name="x_756"></a>If nothing is returned by the function explicitly, Python takes care to return None when the funnction is called.</p>
-<div class="section" title="1. Default Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="default-arguments"></a>1. Default Arguments</h2></div></div></div>
-<p><a name="x_757"></a>There may be situations where we need to allow the functions to take the arguments optionally. Python allows us to define function this way by providing a facility called 
-      <span class="emphasis"><em>Default Arguments</em></span>. For example, we need to write a function that returns a list of fibonacci numbers. Since our function cannot generate an infinite list of fibonacci numbers, we need to specify the number of elements that the fibonacci sequence must contain. Suppose, additionally, we want to the function to return 10 numbers in the sequence if no option is specified we can define the function as follows:
-    </p>
-<pre class="programlisting">def fib(n=10):
-  fib_list = [0, 1]
-  for i in range(n - 2):
-    next = fib_list[-2] + fib_list[-1]
-    fib_list.append(next)
-  return fib_list
-
-</pre>
-<p><a name="x_758"></a>When we call this function, we can optionally specify the value for the parameter n, during the call as an argument. Calling with no argument and argument with n=5 returns the following fibonacci sequences:</p>
-<pre class="programlisting">fib()
-[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
-fib(5)
-[0, 1, 1, 2, 3]
-
-</pre>
-</div>
-<div class="section" title="2. Keyword Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="keyword-arguments"></a>2. Keyword Arguments</h2></div></div></div>
-<p><a name="x_759"></a>When a function takes a large number of arguments, it may be difficult to remember the order of the parameters in the function definition or it may be necessary to pass values to only certain parameters since others take the default value. In either of these cases, Python provides the facility of passing arguments by specifying the name of the parameter as defined in the function definition. This is known as 
-      <span class="emphasis"><em>Keyword Arguments</em></span>.
-    </p>
-<p><a name="x_75a"></a>In a function call, 
-      <span class="emphasis"><em>Keyword arguments</em></span> can be used for each argument, in the following fashion:
-    </p>
-<pre class="programlisting">argument_name=argument_value
-Also denoted as: keyword=argument
-
-def wish(name='World', greetings='Hello'):
-  print "%s, %s!" % (greetings, name)
-
-</pre>
-<p><a name="x_75b"></a>This function can be called in one of the following ways. It is important to note that no restriction is imposed in the order in which 
-      <span class="emphasis"><em>Keyword arguments</em></span> can be specified. Also note, that we have combined 
-      <span class="emphasis"><em>Keyword arguments</em></span> with 
-      <span class="emphasis"><em>Default arguments</em></span> in this example, however it is not necessary:
-    </p>
-<pre class="programlisting">wish(name='Guido', greetings='Hey')
-wish(greetings='Hey', name='Guido')
-
-</pre>
-<p><a name="x_75c"></a>Calling functions by specifying arguments in the order of parameters specified in the function definition is called as 
-      <span class="emphasis"><em>Positional arguments</em></span>, as opposed to 
-      <span class="emphasis"><em>Keyword arguments</em></span>. It is possible to use both 
-      <span class="emphasis"><em>Positional arguments</em></span> and 
-      <span class="emphasis"><em>Keyword arguments</em></span> in a single function call. But Python doesn't allow us to bungle up both of them. The arguments to the function, in the call, must always start with 
-      <span class="emphasis"><em>Positional arguments</em></span> which is in turn followed by 
-      <span class="emphasis"><em>Keyword arguments</em></span>:
-    </p>
-<pre class="programlisting">def my_func(x, y, z, u, v, w):
-  # initialize variables.
-  ...
-  # do some stuff 
-  ...
-  # return the value
-
-</pre>
-<p><a name="x_75d"></a>It is valid to call the above functions in the following ways:</p>
-<pre class="programlisting">my_func(10, 20, 30, u=1.0, v=2.0, w=3.0)
-my_func(10, 20, 30, 1.0, 2.0, w=3.0)
-my_func(10, 20, z=30, u=1.0, v=2.0, w=3.0)
-my_func(x=10, y=20, z=30, u=1.0, v=2.0, w=3.0)
-
-</pre>
-<p><a name="x_75e"></a>Following lists some of the invalid calls:</p>
-<pre class="programlisting">my_func(10, 20, z=30, 1.0, 2.0, 3.0)
-my_func(x=10, 20, z=30, 1.0, 2.0, 3.0)
-my_func(x=10, y=20, z=30, u=1.0, v=2.0, 3.0)
-
-</pre>
-</div>
-<div class="section" title="3. Parameter Packing and Unpacking">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="parameter-packing-and-unpacking"></a>3. Parameter Packing and Unpacking</h2></div></div></div>
-<p><a name="x_75f"></a>The positional arguments passed to a function can be collected in a tuple parameter and keyword arguments can be collected in a dictionary. Since keyword arguments must always be the last set of arguments passed to a function, the keyword dictionary parameter must be the last parameter. The function definition must include a list explicit parameters, followed by tuple paramter collecting parameter, whose name is preceded by a *****, for collecting positional parameters, in turn followed by the dictionary collecting parameter, whose name is preceded by a ****** :</p>
-<pre class="programlisting">def print_report(title, *args, **name):
-  """Structure of *args*
-  (age, email-id)
-  Structure of *name*
-  {
-      'first': First Name
-      'middle': Middle Name
-      'last': Last Name
-  }
-  """
-
-  print "Title: %s" % (title)
-  print "Full name: %(first)s %(middle)s %(last)s" % name
-  print "Age: %d\nEmail-ID: %s" % args
-
-</pre>
-<p><a name="x_760"></a>The above function can be called as. Note, the order of keyword parameters can be interchanged:</p>
-<pre class="programlisting">&gt;&gt;&gt; print_report('Employee Report', 29, 'johny@example.com', first='Johny',
-                 last='Charles', middle='Douglas')
-Title: Employee Report
-Full name: Johny Douglas Charles
-Age: 29
-Email-ID: johny@example.com
-
-</pre>
-<p><a name="x_761"></a>The reverse of this can also be achieved by using a very identical syntax while calling the function. A tuple or a dictionary can be passed as arguments in place of a list of *Positional arguments* or *Keyword arguments* respectively using ***** or ****** :</p>
-<pre class="programlisting">def print_report(title, age, email, first, middle, last):
-  print "Title: %s" % (title)
-  print "Full name: %s %s %s" % (first, middle, last)
-  print "Age: %d\nEmail-ID: %s" % (age, email)
-
-&gt;&gt;&gt; args = (29, 'johny@example.com')
-&gt;&gt;&gt; name = {
-        'first': 'Johny',
-        'middle': 'Charles',
-        'last': 'Douglas'
-        }
-&gt;&gt;&gt; print_report('Employee Report', *args, **name)
-Title: Employee Report
-Full name: Johny Charles Douglas
-Age: 29
-Email-ID: johny@example.com
-
-</pre>
-</div>
-<div class="section" title="4. Nested Functions and Scopes">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="nested-functions-and-scopes"></a>4. Nested Functions and Scopes</h2></div></div></div>
-<p><a name="x_762"></a>Python allows nesting one function inside another. This style of programming turns out to be extremely flexible and powerful features when we use 
-      <span class="emphasis"><em>Python decorators</em></span>. We will not talk about decorators is beyond the scope of this course. If you are interested in knowing more about 
-      <span class="emphasis"><em>decorator programming</em></span> in Python you are suggested to read:
-    </p>
-<div class="literallayout"><p><br>
-      <a class="ulink" href="http://avinashv.net/2008/04/python-decorators-syntactic-sugar" target="_top">http://avinashv.net/2008/04/python-decorators-syntactic-sugar</a>/<br>
-      <a class="ulink" href="http://personalpages.tds.net" target="_top">http://personalpages.tds.net</a>/~kent37/kk/00001.html<br>
-    </p></div>
-<p><a name="x_763"></a>However, the following is an example for nested functions in Python:</p>
-<pre class="programlisting">def outer():
-  print "Outer..."
-  def inner():
-    print "Inner..."
-  print "Outer..."
-  inner()
-
-&gt;&gt;&gt; outer()
-
-</pre>
-</div>
-<div class="section" title="5. map, reduce and filter functions">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="map-reduce-and-filter-functions"></a>5. map, reduce and filter functions</h2></div></div></div>
-<p><a name="x_764"></a>Python provides several built-in functions for convenience. The 
-      <span class="strong"><strong>map()</strong></span>, 
-      <span class="strong"><strong>reduce()</strong></span> and 
-      <span class="strong"><strong>filter()</strong></span> functions prove to be very useful with sequences like 
-      <span class="emphasis"><em>Lists</em></span>.
-    </p>
-<p><a name="x_765"></a>The 
-      <span class="strong"><strong>map</strong></span> (
-      <span class="emphasis"><em>function</em></span>, 
-      <span class="emphasis"><em>sequence</em></span>) function takes two arguments: 
-      <span class="emphasis"><em>function</em></span> and a 
-      <span class="emphasis"><em>sequence</em></span> argument. The 
-      <span class="emphasis"><em>function</em></span> argument must be the name of the function which in turn takes a single argument, the individual element of the 
-      <span class="emphasis"><em>sequence</em></span>. The 
-      <span class="strong"><strong>map</strong></span> function calls 
-      <span class="emphasis"><em>function(item)</em></span>, for each item in the sequence and returns a list of values, where each value is the value returned by each call to 
-      <span class="emphasis"><em>function(item)</em></span>. 
-      <span class="strong"><strong>map()</strong></span> function allows to pass more than one sequence. In this case, the first argument, 
-      <span class="emphasis"><em>function</em></span> must take as many arguments as the number of sequences passed. This function is called with each corresponding element in the each of the sequences, or 
-      <span class="strong"><strong>None</strong></span> if one of the sequence is exhausted:
-    </p>
-<pre class="programlisting">def square(x):
-  return x*x
-
-&gt;&gt;&gt; map(square, [1, 2, 3, 4])
-[1, 4, 9, 16]
-
-def mul(x, y):
-  return x*y
-
-&gt;&gt;&gt; map(mul, [1, 2, 3, 4], [6, 7, 8, 9])
-
-</pre>
-<p><a name="x_766"></a>The 
-      <span class="strong"><strong>filter</strong></span> (
-      <span class="emphasis"><em>function</em></span>, 
-      <span class="emphasis"><em>sequence</em></span>) function takes two arguments, similar to the 
-      <span class="strong"><strong>map()</strong></span> function. The 
-      <span class="strong"><strong>filter</strong></span> function calls 
-      <span class="emphasis"><em>function(item)</em></span>, for each item in the sequence and returns all the elements in the sequence for which 
-      <span class="emphasis"><em>function(item)</em></span> returned True:
-    </p>
-<pre class="programlisting">def even(x):
-  if x % 2:
-    return True
-  else:
-    return False
-
-&gt;&gt;&gt; filter(even, range(1, 10))
-[1, 3, 5, 7, 9]
-
-</pre>
-<p><a name="x_767"></a>The 
-      <span class="strong"><strong>reduce</strong></span> (
-      <span class="emphasis"><em>function</em></span>, 
-      <span class="emphasis"><em>sequence</em></span>) function takes two arguments, similar to 
-      <span class="strong"><strong>map</strong></span> function, however multiple sequences are not allowed. The 
-      <span class="strong"><strong>reduce</strong></span> function calls 
-      <span class="emphasis"><em>function</em></span> with first two consecutive elements in the sequence, obtains the result, calls 
-      <span class="emphasis"><em>function</em></span> with the result and the subsequent element in the sequence and so on until the end of the list and returns the final result:
-    </p>
-<pre class="programlisting">def mul(x, y):
-  return x*y
-
-&gt;&gt;&gt; reduce(mul, [1, 2, 3, 4])
-24
-
-</pre>
-<div class="section" title="5.1. List Comprehensions">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="list-comprehensions"></a>5.1. List Comprehensions</h3></div></div></div>
-<p><a name="x_768"></a>List Comprehension is a convenvience utility provided by Python. It is a syntatic sugar to create 
-        <span class="emphasis"><em>Lists</em></span>. Using 
-        <span class="emphasis"><em>List Comprehensions</em></span> one can create 
-        <span class="emphasis"><em>Lists</em></span> from other type of sequential data structures or other 
-        <span class="emphasis"><em>Lists</em></span> itself. The syntax of 
-        <span class="emphasis"><em>List Comprehensions</em></span> consists of a square brackets to indicate the result is a 
-        <span class="emphasis"><em>List</em></span> within which we include at least one 
-        <span class="strong"><strong>for</strong></span> clause and multiple 
-        <span class="strong"><strong>if</strong></span> clauses. It will be more clear with an example:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; num = [1, 2, 3]
-&gt;&gt;&gt; sq = [x*x for x in num]
-&gt;&gt;&gt; sq
-[1, 4, 9]
-&gt;&gt;&gt; all_num = [1, 2, 3, 4, 5, 6, 7, 8, 9]
-&gt;&gt;&gt; even = [x for x in all_num if x%2 == 0]
-
-</pre>
-<p><a name="x_769"></a>The syntax used here is very clear from the way it is written. It can be translated into english as, "for each element x in the list all_num, if remainder of x divided by 2 is 0, add x to the list."</p>
-</div>
-</div>
-</div></body>
-</html>
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Functional Approach</title>
-<link rel="stylesheet" href="hgbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" title="Functional Approach">
-<div class="titlepage">
-<div><div><h2 class="title">
-<a name="id2760558"></a>Functional Approach</h2></div></div>
-<hr>
-</div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="section"><a href="#default-arguments">1. Default Arguments</a></span></dt>
-<dt><span class="section"><a href="#keyword-arguments">2. Keyword Arguments</a></span></dt>
-<dt><span class="section"><a href="#parameter-packing-and-unpacking">3. Parameter Packing and Unpacking</a></span></dt>
-<dt><span class="section"><a href="#nested-functions-and-scopes">4. Nested Functions and Scopes</a></span></dt>
-<dt><span class="section"><a href="#map-reduce-and-filter-functions">5. map, reduce and filter functions</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#list-comprehensions">5.1. List Comprehensions</a></span></dt></dl></dd>
-</dl>
-</div>
-<p><a name="x_74b"></a>
-    <span class="emphasis"><em>Functions</em></span> allow us to enclose a set of statements and call the function again and again instead of repeating the group of statements everytime. Functions also allow us to isolate a piece of code from all the other code and provides the convenience of not polluting the global variables.
-  </p>
-<p><a name="x_74c"></a>
-    <span class="emphasis"><em>Function</em></span> in python is defined with the keyword 
-    <span class="strong"><strong>def</strong></span> followed by the name of the function, in turn followed by a pair of parenthesis which encloses the list of parameters to the function. The definition line ends with a ':'. The definition line is followed by the body of the function intended by one block. The 
-    <span class="emphasis"><em>Function</em></span> must return a value:
-  </p>
-<pre class="programlisting">def factorial(n):
-  fact = 1
-  for i in range(2, n):
-    fact *= i
-
-  return fact
-
-</pre>
-<p><a name="x_74d"></a>The code snippet above defines a function with the name factorial, takes the number for which the factorial must be computed, computes the factorial and returns the value.</p>
-<p><a name="x_74e"></a>A 
-    <span class="emphasis"><em>Function</em></span> once defined can be used or called anywhere else in the program. We call a fucntion with its name followed by a pair of parenthesis which encloses the arguments to the function.
-  </p>
-<p><a name="x_74f"></a>The value that function returns can be assigned to a variable. Let's call the above function and store the factorial in a variable:</p>
-<pre class="programlisting">fact5 = factorial(5)
-
-</pre>
-<p><a name="x_750"></a>The value of fact5 will now be 120, which is the factorial of 5. Note that we passed 5 as the argument to the function.</p>
-<p><a name="x_751"></a>It may be necessary to document what the function does, for each of the function to help the person who reads our code to understand it better. In order to do this Python allows the first line of the function body to be a string. This string is called as 
-    <span class="emphasis"><em>Documentation String</em></span> or 
-    <span class="emphasis"><em>docstring</em></span>. 
-    <span class="emphasis"><em>docstrings</em></span> prove to be very handy since there are number of tools which can pull out all the docstrings from Python functions and generate the documentation automatically from it. 
-    <span class="emphasis"><em>docstrings</em></span> for functions can be written as follows:
-  </p>
-<pre class="programlisting">def factorial(n):
-  'Returns the factorial for the number n.'
-  fact = 1
-  for i in range(2, n):
-    fact *= i
-
-  return fact
-
-</pre>
-<p><a name="x_752"></a>An important point to note at this point is that, a function can return any Python value or a Python object, which also includes a 
-    <span class="emphasis"><em>Tuple</em></span>. A 
-    <span class="emphasis"><em>Tuple</em></span> is just a collection of values and those values themselves can be of any other valid Python datatypes, including 
-    <span class="emphasis"><em>Lists</em></span>, 
-    <span class="emphasis"><em>Tuples</em></span>, 
-    <span class="emphasis"><em>Dictionaries</em></span> among other things. So effectively, if a function can return a tuple, it can return any number of values through a tuple
-  </p>
-<p><a name="x_753"></a>Let us write a small function to swap two values:</p>
-<pre class="programlisting">def swap(a, b):
-  return b, a
-
-c, d = swap(a, b)
-
-</pre>
-<p><a name="x_754"></a>Function scope --------------- The variables used inside the function are confined to the function's scope and doesn't pollute the variables of the same name outside the scope of the function. Also the arguments passed to the function are passed by-value if it is of basic Python data type:</p>
-<pre class="programlisting">def cant_change(n):
-  n = 10
-
-n = 5
-cant_change(n)
-
-</pre>
-<p><a name="x_755"></a>Upon running this code, what do you think would have happened to value of n which was assigned 5 before the function call? If you have already tried out that snippet on the interpreter you already know that the value of n is not changed. This is true of any immutable types of Python like 
-    <span class="emphasis"><em>Numbers</em></span>, 
-    <span class="emphasis"><em>Strings</em></span> and 
-    <span class="emphasis"><em>Tuples</em></span>. But when you pass mutable objects like 
-    <span class="emphasis"><em>Lists</em></span> and 
-    <span class="emphasis"><em>Dictionaries</em></span> the values are manipulated even outside the function:
-  </p>
-<pre class="programlisting">&gt;&gt;&gt; def can_change(n):
-...   n[1] = James
-...
-
-&gt;&gt;&gt; name = ['Mr.', 'Steve', 'Gosling']
-&gt;&gt;&gt; can_change(name)
-&gt;&gt;&gt; name
-['Mr.', 'James', 'Gosling']
-
-</pre>
-<p><a name="x_756"></a>If nothing is returned by the function explicitly, Python takes care to return None when the funnction is called.</p>
-<div class="section" title="1. Default Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="default-arguments"></a>1. Default Arguments</h2></div></div></div>
-<p><a name="x_757"></a>There may be situations where we need to allow the functions to take the arguments optionally. Python allows us to define function this way by providing a facility called 
-      <span class="emphasis"><em>Default Arguments</em></span>. For example, we need to write a function that returns a list of fibonacci numbers. Since our function cannot generate an infinite list of fibonacci numbers, we need to specify the number of elements that the fibonacci sequence must contain. Suppose, additionally, we want to the function to return 10 numbers in the sequence if no option is specified we can define the function as follows:
-    </p>
-<pre class="programlisting">def fib(n=10):
-  fib_list = [0, 1]
-  for i in range(n - 2):
-    next = fib_list[-2] + fib_list[-1]
-    fib_list.append(next)
-  return fib_list
-
-</pre>
-<p><a name="x_758"></a>When we call this function, we can optionally specify the value for the parameter n, during the call as an argument. Calling with no argument and argument with n=5 returns the following fibonacci sequences:</p>
-<pre class="programlisting">fib()
-[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
-fib(5)
-[0, 1, 1, 2, 3]
-
-</pre>
-</div>
-<div class="section" title="2. Keyword Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="keyword-arguments"></a>2. Keyword Arguments</h2></div></div></div>
-<p><a name="x_759"></a>When a function takes a large number of arguments, it may be difficult to remember the order of the parameters in the function definition or it may be necessary to pass values to only certain parameters since others take the default value. In either of these cases, Python provides the facility of passing arguments by specifying the name of the parameter as defined in the function definition. This is known as 
-      <span class="emphasis"><em>Keyword Arguments</em></span>.
-    </p>
-<p><a name="x_75a"></a>In a function call, 
-      <span class="emphasis"><em>Keyword arguments</em></span> can be used for each argument, in the following fashion:
-    </p>
-<pre class="programlisting">argument_name=argument_value
-Also denoted as: keyword=argument
-
-def wish(name='World', greetings='Hello'):
-  print "%s, %s!" % (greetings, name)
-
-</pre>
-<p><a name="x_75b"></a>This function can be called in one of the following ways. It is important to note that no restriction is imposed in the order in which 
-      <span class="emphasis"><em>Keyword arguments</em></span> can be specified. Also note, that we have combined 
-      <span class="emphasis"><em>Keyword arguments</em></span> with 
-      <span class="emphasis"><em>Default arguments</em></span> in this example, however it is not necessary:
-    </p>
-<pre class="programlisting">wish(name='Guido', greetings='Hey')
-wish(greetings='Hey', name='Guido')
-
-</pre>
-<p><a name="x_75c"></a>Calling functions by specifying arguments in the order of parameters specified in the function definition is called as 
-      <span class="emphasis"><em>Positional arguments</em></span>, as opposed to 
-      <span class="emphasis"><em>Keyword arguments</em></span>. It is possible to use both 
-      <span class="emphasis"><em>Positional arguments</em></span> and 
-      <span class="emphasis"><em>Keyword arguments</em></span> in a single function call. But Python doesn't allow us to bungle up both of them. The arguments to the function, in the call, must always start with 
-      <span class="emphasis"><em>Positional arguments</em></span> which is in turn followed by 
-      <span class="emphasis"><em>Keyword arguments</em></span>:
-    </p>
-<pre class="programlisting">def my_func(x, y, z, u, v, w):
-  # initialize variables.
-  ...
-  # do some stuff 
-  ...
-  # return the value
-
-</pre>
-<p><a name="x_75d"></a>It is valid to call the above functions in the following ways:</p>
-<pre class="programlisting">my_func(10, 20, 30, u=1.0, v=2.0, w=3.0)
-my_func(10, 20, 30, 1.0, 2.0, w=3.0)
-my_func(10, 20, z=30, u=1.0, v=2.0, w=3.0)
-my_func(x=10, y=20, z=30, u=1.0, v=2.0, w=3.0)
-
-</pre>
-<p><a name="x_75e"></a>Following lists some of the invalid calls:</p>
-<pre class="programlisting">my_func(10, 20, z=30, 1.0, 2.0, 3.0)
-my_func(x=10, 20, z=30, 1.0, 2.0, 3.0)
-my_func(x=10, y=20, z=30, u=1.0, v=2.0, 3.0)
-
-</pre>
-</div>
-<div class="section" title="3. Parameter Packing and Unpacking">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="parameter-packing-and-unpacking"></a>3. Parameter Packing and Unpacking</h2></div></div></div>
-<p><a name="x_75f"></a>The positional arguments passed to a function can be collected in a tuple parameter and keyword arguments can be collected in a dictionary. Since keyword arguments must always be the last set of arguments passed to a function, the keyword dictionary parameter must be the last parameter. The function definition must include a list explicit parameters, followed by tuple paramter collecting parameter, whose name is preceded by a *****, for collecting positional parameters, in turn followed by the dictionary collecting parameter, whose name is preceded by a ****** :</p>
-<pre class="programlisting">def print_report(title, *args, **name):
-  """Structure of *args*
-  (age, email-id)
-  Structure of *name*
-  {
-      'first': First Name
-      'middle': Middle Name
-      'last': Last Name
-  }
-  """
-
-  print "Title: %s" % (title)
-  print "Full name: %(first)s %(middle)s %(last)s" % name
-  print "Age: %d\nEmail-ID: %s" % args
-
-</pre>
-<p><a name="x_760"></a>The above function can be called as. Note, the order of keyword parameters can be interchanged:</p>
-<pre class="programlisting">&gt;&gt;&gt; print_report('Employee Report', 29, 'johny@example.com', first='Johny',
-                 last='Charles', middle='Douglas')
-Title: Employee Report
-Full name: Johny Douglas Charles
-Age: 29
-Email-ID: johny@example.com
-
-</pre>
-<p><a name="x_761"></a>The reverse of this can also be achieved by using a very identical syntax while calling the function. A tuple or a dictionary can be passed as arguments in place of a list of *Positional arguments* or *Keyword arguments* respectively using ***** or ****** :</p>
-<pre class="programlisting">def print_report(title, age, email, first, middle, last):
-  print "Title: %s" % (title)
-  print "Full name: %s %s %s" % (first, middle, last)
-  print "Age: %d\nEmail-ID: %s" % (age, email)
-
-&gt;&gt;&gt; args = (29, 'johny@example.com')
-&gt;&gt;&gt; name = {
-        'first': 'Johny',
-        'middle': 'Charles',
-        'last': 'Douglas'
-        }
-&gt;&gt;&gt; print_report('Employee Report', *args, **name)
-Title: Employee Report
-Full name: Johny Charles Douglas
-Age: 29
-Email-ID: johny@example.com
-
-</pre>
-</div>
-<div class="section" title="4. Nested Functions and Scopes">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="nested-functions-and-scopes"></a>4. Nested Functions and Scopes</h2></div></div></div>
-<p><a name="x_762"></a>Python allows nesting one function inside another. This style of programming turns out to be extremely flexible and powerful features when we use 
-      <span class="emphasis"><em>Python decorators</em></span>. We will not talk about decorators is beyond the scope of this course. If you are interested in knowing more about 
-      <span class="emphasis"><em>decorator programming</em></span> in Python you are suggested to read:
-    </p>
-<div class="literallayout"><p><br>
-      <a class="ulink" href="http://avinashv.net/2008/04/python-decorators-syntactic-sugar" target="_top">http://avinashv.net/2008/04/python-decorators-syntactic-sugar</a>/<br>
-      <a class="ulink" href="http://personalpages.tds.net" target="_top">http://personalpages.tds.net</a>/~kent37/kk/00001.html<br>
-    </p></div>
-<p><a name="x_763"></a>However, the following is an example for nested functions in Python:</p>
-<pre class="programlisting">def outer():
-  print "Outer..."
-  def inner():
-    print "Inner..."
-  print "Outer..."
-  inner()
-
-&gt;&gt;&gt; outer()
-
-</pre>
-</div>
-<div class="section" title="5. map, reduce and filter functions">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="map-reduce-and-filter-functions"></a>5. map, reduce and filter functions</h2></div></div></div>
-<p><a name="x_764"></a>Python provides several built-in functions for convenience. The 
-      <span class="strong"><strong>map()</strong></span>, 
-      <span class="strong"><strong>reduce()</strong></span> and 
-      <span class="strong"><strong>filter()</strong></span> functions prove to be very useful with sequences like 
-      <span class="emphasis"><em>Lists</em></span>.
-    </p>
-<p><a name="x_765"></a>The 
-      <span class="strong"><strong>map</strong></span> (
-      <span class="emphasis"><em>function</em></span>, 
-      <span class="emphasis"><em>sequence</em></span>) function takes two arguments: 
-      <span class="emphasis"><em>function</em></span> and a 
-      <span class="emphasis"><em>sequence</em></span> argument. The 
-      <span class="emphasis"><em>function</em></span> argument must be the name of the function which in turn takes a single argument, the individual element of the 
-      <span class="emphasis"><em>sequence</em></span>. The 
-      <span class="strong"><strong>map</strong></span> function calls 
-      <span class="emphasis"><em>function(item)</em></span>, for each item in the sequence and returns a list of values, where each value is the value returned by each call to 
-      <span class="emphasis"><em>function(item)</em></span>. 
-      <span class="strong"><strong>map()</strong></span> function allows to pass more than one sequence. In this case, the first argument, 
-      <span class="emphasis"><em>function</em></span> must take as many arguments as the number of sequences passed. This function is called with each corresponding element in the each of the sequences, or 
-      <span class="strong"><strong>None</strong></span> if one of the sequence is exhausted:
-    </p>
-<pre class="programlisting">def square(x):
-  return x*x
-
-&gt;&gt;&gt; map(square, [1, 2, 3, 4])
-[1, 4, 9, 16]
-
-def mul(x, y):
-  return x*y
-
-&gt;&gt;&gt; map(mul, [1, 2, 3, 4], [6, 7, 8, 9])
-
-</pre>
-<p><a name="x_766"></a>The 
-      <span class="strong"><strong>filter</strong></span> (
-      <span class="emphasis"><em>function</em></span>, 
-      <span class="emphasis"><em>sequence</em></span>) function takes two arguments, similar to the 
-      <span class="strong"><strong>map()</strong></span> function. The 
-      <span class="strong"><strong>filter</strong></span> function calls 
-      <span class="emphasis"><em>function(item)</em></span>, for each item in the sequence and returns all the elements in the sequence for which 
-      <span class="emphasis"><em>function(item)</em></span> returned True:
-    </p>
-<pre class="programlisting">def even(x):
-  if x % 2:
-    return True
-  else:
-    return False
-
-&gt;&gt;&gt; filter(even, range(1, 10))
-[1, 3, 5, 7, 9]
-
-</pre>
-<p><a name="x_767"></a>The 
-      <span class="strong"><strong>reduce</strong></span> (
-      <span class="emphasis"><em>function</em></span>, 
-      <span class="emphasis"><em>sequence</em></span>) function takes two arguments, similar to 
-      <span class="strong"><strong>map</strong></span> function, however multiple sequences are not allowed. The 
-      <span class="strong"><strong>reduce</strong></span> function calls 
-      <span class="emphasis"><em>function</em></span> with first two consecutive elements in the sequence, obtains the result, calls 
-      <span class="emphasis"><em>function</em></span> with the result and the subsequent element in the sequence and so on until the end of the list and returns the final result:
-    </p>
-<pre class="programlisting">def mul(x, y):
-  return x*y
-
-&gt;&gt;&gt; reduce(mul, [1, 2, 3, 4])
-24
-
-</pre>
-<div class="section" title="5.1. List Comprehensions">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="list-comprehensions"></a>5.1. List Comprehensions</h3></div></div></div>
-<p><a name="x_768"></a>List Comprehension is a convenvience utility provided by Python. It is a syntatic sugar to create 
-        <span class="emphasis"><em>Lists</em></span>. Using 
-        <span class="emphasis"><em>List Comprehensions</em></span> one can create 
-        <span class="emphasis"><em>Lists</em></span> from other type of sequential data structures or other 
-        <span class="emphasis"><em>Lists</em></span> itself. The syntax of 
-        <span class="emphasis"><em>List Comprehensions</em></span> consists of a square brackets to indicate the result is a 
-        <span class="emphasis"><em>List</em></span> within which we include at least one 
-        <span class="strong"><strong>for</strong></span> clause and multiple 
-        <span class="strong"><strong>if</strong></span> clauses. It will be more clear with an example:
-      </p>
-<pre class="programlisting">&gt;&gt;&gt; num = [1, 2, 3]
-&gt;&gt;&gt; sq = [x*x for x in num]
-&gt;&gt;&gt; sq
-[1, 4, 9]
-&gt;&gt;&gt; all_num = [1, 2, 3, 4, 5, 6, 7, 8, 9]
-&gt;&gt;&gt; even = [x for x in all_num if x%2 == 0]
-
-</pre>
-<p><a name="x_769"></a>The syntax used here is very clear from the way it is written. It can be translated into english as, "for each element x in the list all_num, if remainder of x divided by 2 is 0, add x to the list."</p>
-</div>
-</div>
-</div></body>
-</html>
--- a/web/html/backup/paragraphlist.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-import sys
-f=open(sys.argv[1],'r')
-pid_list=[]
-for i in f.readlines():
-    if i.startswith('<p id=') : 
-        list_tmp=i.split('"')[1]
-        pid_list.append(list_tmp)
-print pid_list
--- a/web/html/ch1Introduction.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1141 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Introduction</title>
-<link rel="stylesheet" href="/review/support/styles.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.74.3">
-
-<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
-<script type="text/javascript" src="/review/support/jquery-min.js"></script>
-<script type="text/javascript" src="/review/support/form.js"></script>
-<script type="text/javascript" src="/review/support/hsbook.js"></script>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch1Introduction">
-<div class="titlepage"></div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="article"><a href="#id2906013"></a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2716138">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2903833">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2957074">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2957346">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2957478">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2957486">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2957764">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2957772">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2957935">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2957995">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2958097">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2958179">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2958358">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2958366">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2958459">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2958668">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2958758">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2958811">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2958820">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2959131">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2959268">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2959439">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2959531">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2959540">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2959626">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2959752">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2959838">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2959970">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2960077">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2960086">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2960272">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2960383">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2960623">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2960892">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2960909">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2960932">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2960940">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2961705">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2961742">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2961811">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2961872">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2962076">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2962110">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2962141">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2962150">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2962338">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2962488">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2962701">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2956810">15. One Liners</a></span></dt>
-</dl></dd>
-</dl>
-</div>
-<div class="article">
-<div class="titlepage">
-<div><div><h2 class="title" id="id2906013"></a></h2></div></div>
-<hr>
-</div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="section"><a href="#id2716138">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2903833">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2957074">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2957346">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2957478">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2957486">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2957764">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2957772">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2957935">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2957995">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2958097">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2958179">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2958358">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2958366">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2958459">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2958668">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2958758">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2958811">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2958820">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2959131">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2959268">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2959439">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2959531">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2959540">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2959626">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2959752">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2959838">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2959970">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2960077">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2960086">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2960272">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2960383">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2960623">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2960892">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2960909">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2960932">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2960940">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2961705">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2961742">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2961811">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2961872">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2962076">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2962110">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2962141">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2962150">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2962338">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2962488">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2962701">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2956810">15. One Liners</a></span></dt>
-</dl>
-</div>
-<div class="section" title="1. Introducing Linux">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2716138"></a>1. Introducing Linux</h2></div></div></div>
-<p id="ch1Introduction_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
-<p id="ch1Introduction_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
-<p id="ch1Introduction_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
-<p id="ch1Introduction_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
-<div class="section" title="1.1. Historical Background">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2903833"></a>1.1. Historical Background</h3></div></div></div>
-<div class="section" title="1.1.1. Events leading to the creation">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2903799"></a>1.1.1. Events leading to the creation</h4></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
-</ul></div>
-</div>
-<div class="section" title="1.1.2. The Creation of Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2957029"></a>1.1.2. The Creation of Linux</h4></div></div></div>
-<p id="ch1Introduction_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
-<p id="ch1Introduction_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
-</div>
-</div>
-<div class="section" title="1.2. Design and Implications">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2957074"></a>1.2. Design and Implications</h3></div></div></div>
-<p id="ch1Introduction_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
-<div class="section" title="1.2.1. User Interface">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2957098"></a>1.2.1. User Interface</h4></div></div></div>
-<p id="ch1Introduction_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
-<p id="ch1Introduction_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
-</div>
-<div class="section" title="1.2.2. Development">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2957152"></a>1.2.2. Development</h4></div></div></div>
-<p id="ch1Introduction_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
-<p id="ch1Introduction_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
-<p id="ch1Introduction_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
-</div>
-<div class="section" title="1.2.3. Community">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2957208"></a>1.2.3. Community</h4></div></div></div>
-<p id="ch1Introduction_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
-<p id="ch1Introduction_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
-<p id="ch1Introduction_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
-</div>
-<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2957253"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
-<p id="ch1Introduction_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
-</div>
-<div class="section" title="1.2.5. Programming on Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2957299"></a>1.2.5. Programming on Linux</h4></div></div></div>
-<p id="ch1Introduction_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
-<p id="ch1Introduction_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
-<p id="ch1Introduction_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
-</div>
-</div>
-<div class="section" title="1.3. Reasons for Using Linux">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2957346"></a>1.3. Reasons for Using Linux</h3></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch1Introduction_16"></a>Linux is free:</p></li></ul></div>
-<p id="ch1Introduction_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
-Most of all, Linux is free as in "free speech":
-The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch1Introduction_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
-<p id="ch1Introduction_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch1Introduction_1a"></a>Linux was made to keep on running:</p></li></ul></div>
-<p id="ch1Introduction_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch1Introduction_1c"></a>Linux is secure and versatile:</p></li></ul></div>
-<p id="ch1Introduction_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch1Introduction_1e"></a>Linux is scalable:</p></li></ul></div>
-<p id="ch1Introduction_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch1Introduction_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
-<p id="ch1Introduction_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
-</div>
-</div>
-<div class="section" title="2. Getting Started">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2957478"></a>2. Getting Started</h2></div></div></div>
-<div class="section" title="2.1. Logging in, activating the user interface and logging out">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2957486"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
-<p id="ch1Introduction_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
-<div class="section" title="2.1.1. Graphical Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2957517"></a>2.1.1. Graphical Mode</h4></div></div></div>
-<p id="ch1Introduction_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
-<p id="ch1Introduction_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
-It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
-<p id="ch1Introduction_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
-<p id="ch1Introduction_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
-<p id="ch1Introduction_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
-<p id="ch1Introduction_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
-<p id="ch1Introduction_29"></a>Another common form for a prompt is this one:
-[</p>
-<div class="reference">
-<div class="titlepage"><hr></div>user@host</div>
-<p> dir]</p>
-<p id="ch1Introduction_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
-<p id="ch1Introduction_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
-</div>
-<div class="section" title="2.1.2. Text Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2957675"></a>2.1.2. Text Mode</h4></div></div></div>
-<p id="ch1Introduction_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
-<p id="ch1Introduction_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
-reasons.</p>
-<p id="ch1Introduction_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
-<p id="ch1Introduction_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
-<p id="ch1Introduction_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
-</div>
-</div>
-</div>
-<div class="section" title="3. Basic Commands">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2957764"></a>3. Basic Commands</h2></div></div></div>
-<div class="section" title="3.1. ls">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2957772"></a>3.1. ls</h3></div></div></div>
-<p id="ch1Introduction_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
-<p id="ch1Introduction_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
-<p id="ch1Introduction_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch1Introduction_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
-<pre class="programlisting">$ ls
-jeeves.rst psmith.html blandings.html
-$ ls -l
-drwxr--r--   1 plum  editors   4096  jeeves
--rw-r--r--   1 plum  editors  30405  psmith
--r-xr-xr-x   1 plum  plum      8460  blandings</pre>
-<p id="ch1Introduction_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
-</div>
-<div class="section" title="3.2. date">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2957935"></a>3.2. date</h3></div></div></div>
-<p id="ch1Introduction_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
-<p id="ch1Introduction_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
-<pre class="programlisting">$date
-Tue Sep  8 12:01:45 IST 2009</pre>
-<p id="ch1Introduction_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
-<pre class="programlisting">$date --set="20040908 01:22"</pre>
-<p id="ch1Introduction_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
-<pre class="programlisting">$man date</pre>
-<p id="ch1Introduction_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
-</div>
-<div class="section" title="3.3. cd">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2957995"></a>3.3. cd</h3></div></div></div>
-<p id="ch1Introduction_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
-<p id="ch1Introduction_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
-<p id="ch1Introduction_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
-<p id="ch1Introduction_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
-<p id="ch1Introduction_46"></a>Absolute paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch1Introduction_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch1Introduction_48"></a>For example to get to /boot/grub you would type:</p>
-<pre class="programlisting">$cd /boot/grub</pre>
-<p id="ch1Introduction_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
-<p id="ch1Introduction_4a"></a>Relative paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch1Introduction_4b"></a>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.</p>
-<p id="ch1Introduction_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
-<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch1Introduction_4d"></a>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.</p>
-</div>
-<div class="section" title="3.4. who">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2958097"></a>3.4. who</h3></div></div></div>
-<p id="ch1Introduction_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
-<p id="ch1Introduction_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
-<pre class="programlisting">$who
-beeblebrox tty7         2009-09-08 10:50 (:0)
-beeblebrox pts/0        2009-09-08 11:25 (:0.0)
-dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
-beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
-<p id="ch1Introduction_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
-<p id="ch1Introduction_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
-<pre class="programlisting">$man who</pre>
-<p id="ch1Introduction_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
-</div>
-<div class="section" title="3.5. mkdir">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2958179"></a>3.5. mkdir</h3></div></div></div>
-<p id="ch1Introduction_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
-<pre class="programlisting">$mkdir name_of_directory</pre>
-<p id="ch1Introduction_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
-<div class="section" title="3.5.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2958211"></a>3.5.1. Options</h4></div></div></div>
-<p id="ch1Introduction_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch1Introduction_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
-</div>
-<div class="section" title="3.5.2. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2958272"></a>3.5.2. Examples</h4></div></div></div>
-<p id="ch1Introduction_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
-<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
-<p id="ch1Introduction_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
-<p id="ch1Introduction_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
-<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
-<p id="ch1Introduction_5d"></a>This will create:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_5e"></a>tag</p></li>
-<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch1Introduction_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
-</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
-</div>
-</div>
-</div>
-<div class="section" title="4. Getting Help">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2958358"></a>4. Getting Help</h2></div></div></div>
-<div class="section" title="4.1. apropos and whatis">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2958366"></a>4.1. apropos and whatis</h3></div></div></div>
-<p id="ch1Introduction_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
-<pre class="programlisting">$ apropos grep
-egrep       egrep (1)       Search a file for a pattern using full regular expressions
-fgrep       fgrep (1)       Search a file for a fixed-character string
-fmlgrep     fmlgrep (1)     Search a file for a pattern
-grep        grep (1)        Search a file for a pattern
-gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
-nisgrep     nismatch (1)    Utilities for searching NIS+ tables
-pgrep       pgrep (1)       Find or signal a process by name or other attribute
-zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
-...</pre>
-<p id="ch1Introduction_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
-<p id="ch1Introduction_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
-<pre class="programlisting">$whatis ls
-ls (1)           - list directory contents</pre>
-<p id="ch1Introduction_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
-<p id="ch1Introduction_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
-<pre class="programlisting">$apropos browser
-gmusicbrowser (1)    - Jukebox for large collections of audio files
-infobrowser (1)      - read Info documents
-libsmbclient (7)     - An extension library for browsers and that               can be used...
-opera (1)            - a standards-compliant graphical Web browser
-sensible-browser (1) - sensible editing, paging, and web browsing
-smbtree (1)          - A text based smb network browser
-tvtk_doc (1)         - A GUI based TVTK documentation search browser.
-viewres (1)          - graphical class browser for Xt
-w3m (1)              - a text based Web browser and pager
-www-browser (1)      - a text based Web browser and pager
-...</pre>
-</div>
-<div class="section" title="4.2. man">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2958459"></a>4.2. man</h3></div></div></div>
-<p id="ch1Introduction_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
-<p id="ch1Introduction_66"></a>To read a manual page for a Unix command, one can use:</p>
-<pre class="programlisting">$ man &lt;command_name&gt;</pre>
-<p id="ch1Introduction_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
-<p id="ch1Introduction_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
-<pre class="programlisting">$man 3 printf</pre>
-<p id="ch1Introduction_69"></a>Another example:</p>
-<pre class="programlisting">$man man</pre>
-<p id="ch1Introduction_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
-<div class="section" title="4.2.1. Layout">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2958541"></a>4.2.1. Layout</h4></div></div></div>
-<p id="ch1Introduction_6b"></a>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:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch1Introduction_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch1Introduction_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch1Introduction_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch1Introduction_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch1Introduction_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch1Introduction_71"></a>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.</p>
-<p id="ch1Introduction_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
-<p id="ch1Introduction_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
-<p id="ch1Introduction_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
-<p id="ch1Introduction_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
-<p id="ch1Introduction_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
-</div>
-</div>
-<div class="section" title="4.3. info">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2958668"></a>4.3. info</h3></div></div></div>
-<p id="ch1Introduction_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
-<p id="ch1Introduction_78"></a>The syntax is</p>
-<pre class="programlisting">$ info &lt;command_name&gt;</pre>
-<p id="ch1Introduction_79"></a><span class="emphasis"><em>info</em></span> 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</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch1Introduction_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
-</div>
-<div class="section" title="4.4. --help">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2958758"></a>4.4. --help</h3></div></div></div>
-<p id="ch1Introduction_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
-<pre class="programlisting">$ userprompt@host: cat --help
-Usage: cat [OPTION] [FILE]...
-Concatenate FILE(s), or standard input, to standard output.
-
-  -A, --show-all           equivalent to -vET
-  -b, --number-nonblank    number nonempty output lines
-  -e                       equivalent to -vE
-  -E, --show-ends          display $ at end of each line
-  -n, --number             number all output lines
-  -s, --squeeze-blank      suppress repeated empty output lines
-  -t                       equivalent to -vT
-  -T, --show-tabs          display TAB characters as ^I
-  -u                       (ignored)
-  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
-  --help     display this help and exit
-  --version  output version information and exit
-
-With no FILE, or when FILE is -, read standard input.
-
-Examples:
-  cat f - g  Output f's contents, then standard input, then g's           contents.
-  cat        Copy standard input to standard output.
-
-Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
-</div>
-</div>
-<div class="section" title="5. Basic file handling">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2958811"></a>5. Basic file handling</h2></div></div></div>
-<div class="section" title="5.1. cp">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2958820"></a>5.1. cp</h3></div></div></div>
-<p id="ch1Introduction_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
-<div class="section" title="5.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2958837"></a>5.1.1. Usage</h4></div></div></div>
-<p id="ch1Introduction_82"></a>To copy a file to another file:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
-<p id="ch1Introduction_83"></a>To copy a file to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
-<p id="ch1Introduction_84"></a>To copy a directory to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
-SourceDirectory ... TargetDirectory</pre>
-</div>
-<div class="section" title="5.1.2. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2958871"></a>5.1.2. Flags</h4></div></div></div>
-<p id="ch1Introduction_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
-<p id="ch1Introduction_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
-<p id="ch1Introduction_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
-<p id="ch1Introduction_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_89"></a>The time of the last data modification and the time of the last access.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch1Introduction_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
-</div>
-<div class="section" title="5.1.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2958969"></a>5.1.3. Examples</h4></div></div></div>
-<p id="ch1Introduction_8d"></a>To make a copy of a file in the current directory, enter:</p>
-<pre class="programlisting">$ cp prog.c prog.bak</pre>
-<p id="ch1Introduction_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
-<p id="ch1Introduction_8f"></a>To copy a file in your current directory into another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
-<p id="ch1Introduction_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
-<p id="ch1Introduction_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
-<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
-<p id="ch1Introduction_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
-<p id="ch1Introduction_93"></a>To copy all the files in a directory to a new directory, enter:</p>
-<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
-<p id="ch1Introduction_94"></a>This copies only the files in the clients directory to the customers directory.</p>
-<p id="ch1Introduction_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch1Introduction_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch1Introduction_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
-<p id="ch1Introduction_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
-<p id="ch1Introduction_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
-<p id="ch1Introduction_9a"></a>To use pattern-matching characters to copy files, enter:</p>
-<pre class="programlisting">$ cp programs/*.py .</pre>
-<p id="ch1Introduction_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
-</div>
-</div>
-<div class="section" title="5.2. mv">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2959131"></a>5.2. mv</h3></div></div></div>
-<p id="ch1Introduction_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
-<div class="section" title="5.2.1. Conflicting existing file">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2959154"></a>5.2.1. Conflicting existing file</h4></div></div></div>
-<p id="ch1Introduction_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
-</div>
-<div class="section" title="5.2.2. Differences with copy and delete">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2959179"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
-<p id="ch1Introduction_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
-</div>
-<div class="section" title="5.2.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2959210"></a>5.2.3. Examples</h4></div></div></div>
-<pre class="programlisting">$ mv myfile mynewfilename    renames a file
-$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
-$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
-$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
-$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
-$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
-$ mv foo bar baz dir         moves multiple files to directory dir
-$ mv --help                  shows a very concise help about the                syntax of the command
-$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
-<p id="ch1Introduction_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
-<p id="ch1Introduction_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
-</div>
-</div>
-<div class="section" title="5.3. rm">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2959268"></a>5.3. rm</h3></div></div></div>
-<p id="ch1Introduction_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
-<p id="ch1Introduction_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
-<pre class="programlisting">$ rm -i foo
-remove foo? y</pre>
-<div class="section" title="5.3.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2959298"></a>5.3.1. Options</h4></div></div></div>
-<p id="ch1Introduction_a3"></a>Common options that rm accepts include:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch1Introduction_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
-<p id="ch1Introduction_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
-<p id="ch1Introduction_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
-<pre class="programlisting">xargs rm &lt; filelist</pre>
-<p id="ch1Introduction_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
-</div>
-<div class="section" title="5.3.2. Permissions">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2959399"></a>5.3.2. Permissions</h4></div></div></div>
-<p id="ch1Introduction_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
-<p id="ch1Introduction_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
-<p id="ch1Introduction_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
-</div>
-</div>
-</div>
-<div class="section" title="6. Command Line Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2959439"></a>6. Command Line Arguments</h2></div></div></div>
-<p id="ch1Introduction_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
-<p id="ch1Introduction_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
-<pre class="programlisting">rm file.s</pre>
-<p id="ch1Introduction_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
-<p id="ch1Introduction_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
-<p id="ch1Introduction_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
-<p id="ch1Introduction_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
-<p id="ch1Introduction_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
-</div>
-<div class="section" title="7. Basic Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2959531"></a>7. Basic Text Processing</h2></div></div></div>
-<div class="section" title="7.1. head">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2959540"></a>7.1. head</h3></div></div></div>
-<p id="ch1Introduction_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
-<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
-<p id="ch1Introduction_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
-<pre class="programlisting">$ head -n 20 filename</pre>
-<p id="ch1Introduction_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ head -n 5 foo*</pre>
-<p id="ch1Introduction_b9"></a>Some versions omit the n and just let you say -5.</p>
-<div class="section" title="7.1.1. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2959590"></a>7.1.1. Flags</h4></div></div></div>
-<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
-<p id="ch1Introduction_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
-<p id="ch1Introduction_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
-<pre class="programlisting">sed 5q foo</pre>
-<p id="ch1Introduction_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
-</div>
-</div>
-<div class="section" title="7.2. tail">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2959626"></a>7.2. tail</h3></div></div></div>
-<p id="ch1Introduction_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
-<p id="ch1Introduction_be"></a>The command-syntax is:</p>
-<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
-<p id="ch1Introduction_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
-<pre class="programlisting">$ tail -n 20 filename</pre>
-<p id="ch1Introduction_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ tail -c 15 foo*</pre>
-<p id="ch1Introduction_c1"></a>This example shows all lines of filename from the second line onwards:</p>
-<pre class="programlisting">$ tail -n +2 filename</pre>
-<p id="ch1Introduction_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
-<pre class="programlisting">$ tail -20 filename
-$ tail -50c filename</pre>
-<p id="ch1Introduction_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
-<div class="section" title="7.2.1. File monitoring">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2959704"></a>7.2.1. File monitoring</h4></div></div></div>
-<p id="ch1Introduction_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
-<pre class="programlisting">$ tail -f /var/adm/messages</pre>
-<p id="ch1Introduction_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
-<p id="ch1Introduction_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
-</div>
-</div>
-<div class="section" title="7.3. cut">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2959752"></a>7.3. cut</h3></div></div></div>
-<p id="ch1Introduction_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
-<p id="ch1Introduction_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
-<p id="ch1Introduction_c9"></a>Assuming a file named file containing the lines:</p>
-<pre class="programlisting">foo:bar:baz:qux:quux
-one:two:three:four:five:six:seven
-alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-<p id="ch1Introduction_ca"></a>To output the fourth through tenth characters of each line:</p>
-<pre class="programlisting">$ cut -c 4-10 file</pre>
-<p id="ch1Introduction_cb"></a>This gives the output:</p>
-<pre class="programlisting">:bar:ba
-:two:th
-ha:beta</pre>
-<p id="ch1Introduction_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
-<pre class="programlisting">$ cut -d : -f 5- file</pre>
-<p id="ch1Introduction_cd"></a>This gives the output:</p>
-<pre class="programlisting">quux
-five:six:seven
-epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-</div>
-<div class="section" title="7.4. paste">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2959838"></a>7.4. paste</h3></div></div></div>
-<p id="ch1Introduction_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
-<p id="ch1Introduction_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
-<pre class="programlisting">$ paste who where when &gt; www</pre>
-<p id="ch1Introduction_d0"></a>If the files contain:</p>
-<table summary="paste" border="1"><colgroup>
-<col width="11">
-<col width="12">
-<col width="12">
-</colgroup></table>
-<p id="ch1Introduction_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
-<pre class="programlisting">Batman            GothamCity       January 3
-Trillian          Andromeda        February 4
-Jeeves            London           March 19</pre>
-</div>
-</div>
-<div class="section" title="8. Shell Meta Characters">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2959970"></a>8. Shell Meta Characters</h2></div></div></div>
-<p id="ch1Introduction_de"></a>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.</p>
-<p id="ch1Introduction_df"></a>The shell meta characters include:</p>
-<p id="ch1Introduction_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
-<p id="ch1Introduction_e1"></a>Different shells may differ in the meta characters recognized.</p>
-<p id="ch1Introduction_e2"></a>As an example,</p>
-<pre class="programlisting">$ ls file.*</pre>
-<p id="ch1Introduction_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
-<pre class="programlisting">$ ls file.?</pre>
-<p id="ch1Introduction_e4"></a>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:</p>
-<pre class="programlisting">$ more c*</pre>
-<p id="ch1Introduction_e5"></a>because the c* matches that long file name.</p>
-<p id="ch1Introduction_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
-<pre class="programlisting">$ rm ??more</pre>
-<p id="ch1Introduction_e7"></a>or:</p>
-<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
-<p id="ch1Introduction_e8"></a>or:</p>
-<pre class="programlisting">$ rm ''*|more''</pre>
-</div>
-<div class="section" title="9. Looking At Files">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2960077"></a>9. Looking At Files</h2></div></div></div>
-<div class="section" title="9.1. cat">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2960086"></a>9.1. cat</h3></div></div></div>
-<p id="ch1Introduction_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
-<p id="ch1Introduction_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
-<p id="ch1Introduction_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
-<div class="section" title="9.1.1. Jargon File Definition">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2960129"></a>9.1.1. Jargon File Definition</h4></div></div></div>
-<p id="ch1Introduction_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
-<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
-     pause (syn. blast).
-
-2. By extension, to dump large amounts of data at an unprepared target or
-     with no intention of browsing it carefully. Usage: considered silly.
-     Rare outside Unix sites. See also dd, BLT.
-
-     Among Unix fans, *cat(1)* is considered an excellent example of
-     user-interface design, because it delivers the file contents without
-     such verbosity as spacing or headers between the files, and because
-     it does not require the files to consist of lines of text, but works
-     with any sort of data.
-
-     Among Unix critics, *cat(1)* is considered the canonical example of
-     bad user-interface design, because of its woefully unobvious name.
-     It is far more often used to blast a single file to standard output
-     than to concatenate two or more files. The name cat for the former
-     operation is just as unintuitive as, say, LISP's cdr.
-
-     Of such oppositions are holy wars made...</pre>
-</div>
-<div class="section" title="9.1.2. Useless Use of 'cat'">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2960168"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
-<p id="ch1Introduction_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
-<p id="ch1Introduction_ee"></a>Nevertheless one sees people doing:</p>
-<pre class="programlisting">$ cat file | some_command and its args ...</pre>
-<p id="ch1Introduction_ef"></a>instead of the equivalent and cheaper:</p>
-<pre class="programlisting">&lt;file some_command and its args ...</pre>
-<p id="ch1Introduction_f0"></a>or (equivalently and more classically):</p>
-<pre class="programlisting">some_command and its args ... &lt;file</pre>
-<p id="ch1Introduction_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
-<p id="ch1Introduction_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
-</div>
-<div class="section" title="9.1.3. zcat">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2960239"></a>9.1.3. zcat</h4></div></div></div>
-<p id="ch1Introduction_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
-</div>
-</div>
-<div class="section" title="9.2. more">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2960272"></a>9.2. more</h3></div></div></div>
-<p id="ch1Introduction_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
-<div class="section" title="9.2.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2960292"></a>9.2.1. Usage</h4></div></div></div>
-<p id="ch1Introduction_f5"></a>The command-syntax is:</p>
-<pre class="programlisting">$ more [options] [file_name]</pre>
-<p id="ch1Introduction_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
-<p id="ch1Introduction_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
-<p id="ch1Introduction_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
-<p id="ch1Introduction_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
-</div>
-</div>
-<div class="section" title="9.3. less">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2960383"></a>9.3. less</h3></div></div></div>
-<p id="ch1Introduction_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
-<div class="section" title="9.3.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2960411"></a>9.3.1. Usage</h4></div></div></div>
-<p id="ch1Introduction_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
-<p id="ch1Introduction_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
-<p id="ch1Introduction_fd"></a>The command-syntax is:</p>
-<pre class="programlisting">$ less [options] file_name</pre>
-</div>
-<div class="section" title="9.3.2. Frequently Used Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2960466"></a>9.3.2. Frequently Used Options</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_ff"></a>-I: Case-insensitive searches.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_103"></a>-?: Shows help.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.3. Frequently Used Commands">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2960518"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_105"></a>[Space bar]: Next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_106"></a>b: Previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_10a"></a>'^ or g: Go to start of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_10b"></a>'$ or G: Go to end of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_10d"></a>=: File information.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_10e"></a>h: Help.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_10f"></a>q: Quit.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.4. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2960608"></a>9.3.4. Examples</h4></div></div></div>
-<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
-$ less +F /var/log/mail.log              #Follow mode for log
-$ file * | less                          #Easier file analysis.
-$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
-</div>
-</div>
-</div>
-<div class="section" title="10. Directory Structure">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2960623"></a>10. Directory Structure</h2></div></div></div>
-<p id="ch1Introduction_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
-<p id="ch1Introduction_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
-<table summary="Directory Structure" border="1"><colgroup>
-<col width="15">
-<col width="48">
-</colgroup></table>
-<div class="section" title="10.1. man hier">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2960892"></a>10.1. man hier</h3></div></div></div>
-<p id="ch1Introduction_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
-<pre class="programlisting">$ man hier</pre>
-</div>
-<div class="section" title="10.2. ls -l">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2960909"></a>10.2. ls -l</h3></div></div></div>
-<p id="ch1Introduction_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
-<pre class="programlisting">$ ls -l</pre>
-<p id="ch1Introduction_138"></a>This can be done after entering the required directory.</p>
-</div>
-</div>
-<div class="section" title="11. Permissions and Ownership">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2960932"></a>11. Permissions and Ownership</h2></div></div></div>
-<div class="section" title="11.1. chmod">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2960940"></a>11.1. chmod</h3></div></div></div>
-<p id="ch1Introduction_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
-<div class="section" title="11.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2960966"></a>11.1.1. Usage</h4></div></div></div>
-<p id="ch1Introduction_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
-<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
-<p id="ch1Introduction_13b"></a>To view what the permissions currently are, type:</p>
-<pre class="programlisting">$ ls -l file</pre>
-</div>
-<div class="section" title="11.1.2. Command line options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2960994"></a>11.1.2. Command line options</h4></div></div></div>
-<p id="ch1Introduction_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch1Introduction_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
-</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2961030"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
-<p id="ch1Introduction_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
-<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
-<p id="ch1Introduction_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="8">
-<col width="45">
-</colgroup></table>
-<p id="ch1Introduction_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="54">
-</colgroup></table>
-<p id="ch1Introduction_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="5">
-<col width="14">
-<col width="48">
-</colgroup></table>
-<p id="ch1Introduction_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
-</div>
-<div class="section" title="11.1.2.2. Symbolic examples">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2961577"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
-<p id="ch1Introduction_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
-<pre class="programlisting">$ chmod ug+rw mydir
-$ ls -ld mydir
-drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
-<p id="ch1Introduction_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
-<pre class="programlisting">$ chmod a-w myfile
-$ ls -l myfile
--r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
-<p id="ch1Introduction_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
-<pre class="programlisting">$ chmod ug=rx mydir
-$ ls -ld mydir
-dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
-</div>
-<div class="section" title="11.1.2.3. Octal numbers">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2961618"></a>11.1.2.3. Octal numbers</h5></div></div></div>
-<p id="ch1Introduction_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
-<pre class="programlisting">$ chmod 664 myfile
-$ ls -l myfile
--rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
-<p id="ch1Introduction_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
-<pre class="programlisting">$ chmod 0664 myfile</pre>
-</div>
-<div class="section" title="11.1.2.4. Special modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2961657"></a>11.1.2.4. Special modes</h5></div></div></div>
-<p id="ch1Introduction_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
-<p id="ch1Introduction_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
-</div>
-</div>
-</div>
-</div>
-<div class="section" title="12. Redirection and Piping">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2961705"></a>12. Redirection and Piping</h2></div></div></div>
-<p id="ch1Introduction_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
-<p id="ch1Introduction_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
-<div class="section" title="12.1. Redirecting standard input and standard output">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2961742"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
-<p id="ch1Introduction_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
-<pre class="programlisting">$ command1 &gt; file1</pre>
-<p id="ch1Introduction_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
-<pre class="programlisting">$ command1 &lt; file1</pre>
-<p id="ch1Introduction_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
-<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
-<p id="ch1Introduction_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
-</div>
-<div class="section" title="12.2. Piping">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2961811"></a>12.2. Piping</h3></div></div></div>
-<p id="ch1Introduction_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
-A pipeline of three programs run on a text terminal:</p>
-<pre class="programlisting">$ command1 | command2</pre>
-<p id="ch1Introduction_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
-<p id="ch1Introduction_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
-<pre class="programlisting">$ command1 &gt; tempfile
-$ command2 &lt; tempfile
-$ rm tempfile</pre>
-<p id="ch1Introduction_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
-<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
-<p id="ch1Introduction_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
-</div>
-<div class="section" title="12.3. Redirecting to and from the standard file handles">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2961872"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
-<p id="ch1Introduction_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
-<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
-<col width="12">
-<col width="13">
-<col width="24">
-</colgroup></table>
-<p id="ch1Introduction_18d"></a>For example:</p>
-<pre class="programlisting">$ command1 2&gt; file1</pre>
-<p id="ch1Introduction_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
-<p id="ch1Introduction_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
-<p id="ch1Introduction_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
-<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
-<p id="ch1Introduction_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
-<p id="ch1Introduction_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
-<p id="ch1Introduction_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
-<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
-<p id="ch1Introduction_194"></a>A simplified form of the command:</p>
-<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
-<p id="ch1Introduction_195"></a>is:</p>
-<pre class="programlisting">$ command &amp;&gt;file</pre>
-<p id="ch1Introduction_196"></a>or:</p>
-<pre class="programlisting">$command &gt;&amp;file</pre>
-</div>
-<div class="section" title="12.4. Chained pipelines">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2962076"></a>12.4. Chained pipelines</h3></div></div></div>
-<p id="ch1Introduction_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
-<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
-<p id="ch1Introduction_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
-</div>
-<div class="section" title="12.5. Redirect to multiple outputs">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2962110"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
-<p id="ch1Introduction_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
-<pre class="programlisting">$ ls -lrt | tee xyz</pre>
-<p id="ch1Introduction_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
-</div>
-</div>
-<div class="section" title="13. More Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2962141"></a>13. More Text Processing</h2></div></div></div>
-<div class="section" title="13.1. grep">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2962150"></a>13.1. grep</h3></div></div></div>
-<p id="ch1Introduction_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
-<div class="section" title="13.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2962181"></a>13.1.1. Usage</h4></div></div></div>
-<p id="ch1Introduction_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
-<pre class="programlisting">$ grep apple fruitlist.txt</pre>
-<p id="ch1Introduction_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
-<p id="ch1Introduction_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
-<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
-<p id="ch1Introduction_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
-<p id="ch1Introduction_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
-<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
-<p id="ch1Introduction_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
-<div class="section" title="13.1.1.1. Variations">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2962259"></a>13.1.1.1. Variations</h5></div></div></div>
-<p id="ch1Introduction_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
-<p id="ch1Introduction_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
-<p id="ch1Introduction_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
-</div>
-</div>
-</div>
-<div class="section" title="13.2. tr">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2962338"></a>13.2. tr</h3></div></div></div>
-<p id="ch1Introduction_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
-<p id="ch1Introduction_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
-<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
-<p id="ch1Introduction_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
-<p id="ch1Introduction_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
-<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
-<p id="ch1Introduction_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
-<p id="ch1Introduction_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
-<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
-<p id="ch1Introduction_1ab"></a>therefore removes all non-alphanumeric characters.</p>
-<p id="ch1Introduction_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
-<pre class="programlisting">$ tr -s '\n' '\n'</pre>
-<p id="ch1Introduction_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
-<p id="ch1Introduction_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
-<pre class="programlisting">$ tr -d '\r'</pre>
-<p id="ch1Introduction_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
-<p id="ch1Introduction_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
-</div>
-</div>
-<div class="section" title="14. Elementary Regex">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2962488"></a>14. Elementary Regex</h2></div></div></div>
-<p id="ch1Introduction_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
-<p id="ch1Introduction_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
-<p id="ch1Introduction_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
-<p id="ch1Introduction_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
-<table summary="Elementary Regex" border="1"><colgroup>
-<col width="13">
-<col width="60">
-</colgroup></table>
-<div class="section" title="14.1. Lazy quantification">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2962701"></a>14.1. Lazy quantification</h3></div></div></div>
-<p id="ch1Introduction_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
-<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
-<p id="ch1Introduction_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
-<p id="ch1Introduction_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
-</div>
-</div>
-<div class="section" title="15. One Liners">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2956810"></a>15. One Liners</h2></div></div></div>
-<p id="ch1Introduction_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
-<p id="ch1Introduction_1cd"></a>The one liner can be</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem"><p id="ch1Introduction_1ce"></a>An expression written in the language of the shell.</p></li>
-<li class="listitem"><p id="ch1Introduction_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
-<li class="listitem"><p id="ch1Introduction_1d0"></a>The invocation of a compiler together with source to compile and
-instructions for executing the compiled program.</p></li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch1Introduction_1d1"></a>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.</p>
-<p id="ch1Introduction_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
-<p id="ch1Introduction_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
-<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
-<p id="ch1Introduction_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
-<p id="ch1Introduction_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
-<p id="ch1Introduction_1d6"></a>Here are the first few of them:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem">
-<p id="ch1Introduction_1d7"></a>Print the total number of input lines:</p>
-<p id="ch1Introduction_1d8"></a>END { print NR }</p>
-</li>
-<li class="listitem">
-<p id="ch1Introduction_1d9"></a>Print the tenth input line:</p>
-<p id="ch1Introduction_1da"></a>NR == 10</p>
-</li>
-<li class="listitem">
-<p id="ch1Introduction_1db"></a>Print the last field of every input line:</p>
-<p id="ch1Introduction_1dc"></a>{ print $NF }</p>
-</li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch1Introduction_1dd"></a>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.</p>
-<p id="ch1Introduction_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
-<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
-*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
-<p id="ch1Introduction_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
-<p id="ch1Introduction_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
-<pre class="programlisting">$ prog foo 'f??'; echo $?
-
-$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
-<p id="ch1Introduction_1e1"></a>Here is a one line shell script to show directories:</p>
-<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
-</div>
-</div>
-</div></body>
-</html>
--- a/web/html/ch2intro.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1138 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Intro</title>
-<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
-<script type="text/javascript" src="/review/support/jquery-min.js"></script>
-<script type="text/javascript" src="/review/support/form.js"></script>
-<script type="text/javascript" src="/review/support/hsbook.js"></script>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch2intro">
-<div class="titlepage"></div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="article"><a href="#id2931272"></a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2741397">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2929092">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2982331">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2982596">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2982723">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2982731">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2983003">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2983011">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2983169">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2983227">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2983324">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2983404">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2983578">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2983586">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2983667">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2983870">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2983961">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2984014">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2984023">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2984334">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2984483">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2984653">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2984746">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2984755">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2984842">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2984970">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2985055">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2985190">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2985297">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2985305">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2985493">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2985608">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2985848">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2986117">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2986133">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2986156">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2986165">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2986929">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2986966">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2987035">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2987096">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2987301">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2987335">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2987365">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2987374">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2987563">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2987713">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2988062">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2988138">15. One Liners</a></span></dt>
-</dl></dd>
-</dl>
-</div>
-<div class="article">
-<div class="titlepage">
-<div><div><h2 class="title" id="id2931272"></a></h2></div></div>
-<hr>
-</div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="section"><a href="#id2741397">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2929092">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2982331">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2982596">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2982723">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2982731">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2983003">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2983011">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2983169">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2983227">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2983324">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2983404">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2983578">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2983586">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2983667">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2983870">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2983961">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2984014">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2984023">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2984334">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2984483">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2984653">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2984746">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2984755">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2984842">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2984970">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2985055">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2985190">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2985297">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2985305">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2985493">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2985608">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2985848">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2986117">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2986133">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2986156">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2986165">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2986929">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2986966">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2987035">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2987096">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2987301">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2987335">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2987365">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2987374">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2987563">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2987713">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2988062">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2988138">15. One Liners</a></span></dt>
-</dl>
-</div>
-<div class="section" title="1. Introducing Linux">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2741397"></a>1. Introducing Linux</h2></div></div></div>
-<p id="ch2intro_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
-<p id="ch2intro_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
-<p id="ch2intro_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
-<p id="ch2intro_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
-<div class="section" title="1.1. Historical Background">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2929092"></a>1.1. Historical Background</h3></div></div></div>
-<div class="section" title="1.1.1. Events leading to the creation">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2928965"></a>1.1.1. Events leading to the creation</h4></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
-</ul></div>
-</div>
-<div class="section" title="1.1.2. The Creation of Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2982286"></a>1.1.2. The Creation of Linux</h4></div></div></div>
-<p id="ch2intro_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
-<p id="ch2intro_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
-</div>
-</div>
-<div class="section" title="1.2. Design and Implications">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2982331"></a>1.2. Design and Implications</h3></div></div></div>
-<p id="ch2intro_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
-<div class="section" title="1.2.1. User Interface">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2982356"></a>1.2.1. User Interface</h4></div></div></div>
-<p id="ch2intro_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
-<p id="ch2intro_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
-</div>
-<div class="section" title="1.2.2. Development">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2982408"></a>1.2.2. Development</h4></div></div></div>
-<p id="ch2intro_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
-<p id="ch2intro_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
-<p id="ch2intro_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
-</div>
-<div class="section" title="1.2.3. Community">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2982463"></a>1.2.3. Community</h4></div></div></div>
-<p id="ch2intro_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
-<p id="ch2intro_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
-<p id="ch2intro_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
-</div>
-<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2982506"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
-<p id="ch2intro_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
-</div>
-<div class="section" title="1.2.5. Programming on Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2982552"></a>1.2.5. Programming on Linux</h4></div></div></div>
-<p id="ch2intro_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
-<p id="ch2intro_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
-<p id="ch2intro_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
-</div>
-</div>
-<div class="section" title="1.3. Reasons for Using Linux">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2982596"></a>1.3. Reasons for Using Linux</h3></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch2intro_16"></a>Linux is free:</p></li></ul></div>
-<p id="ch2intro_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
-Most of all, Linux is free as in "free speech":
-The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch2intro_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
-<p id="ch2intro_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch2intro_1a"></a>Linux was made to keep on running:</p></li></ul></div>
-<p id="ch2intro_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch2intro_1c"></a>Linux is secure and versatile:</p></li></ul></div>
-<p id="ch2intro_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch2intro_1e"></a>Linux is scalable:</p></li></ul></div>
-<p id="ch2intro_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch2intro_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
-<p id="ch2intro_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
-</div>
-</div>
-<div class="section" title="2. Getting Started">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2982723"></a>2. Getting Started</h2></div></div></div>
-<div class="section" title="2.1. Logging in, activating the user interface and logging out">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2982731"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
-<p id="ch2intro_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
-<div class="section" title="2.1.1. Graphical Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2982761"></a>2.1.1. Graphical Mode</h4></div></div></div>
-<p id="ch2intro_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
-<p id="ch2intro_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
-It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
-<p id="ch2intro_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
-<p id="ch2intro_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
-<p id="ch2intro_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
-<p id="ch2intro_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
-<p id="ch2intro_29"></a>Another common form for a prompt is this one:
-[</p>
-<div class="reference">
-<div class="titlepage"><hr></div>user@host</div>
-<p> dir]</p>
-<p id="ch2intro_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
-<p id="ch2intro_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
-</div>
-<div class="section" title="2.1.2. Text Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2982916"></a>2.1.2. Text Mode</h4></div></div></div>
-<p id="ch2intro_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
-<p id="ch2intro_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
-reasons.</p>
-<p id="ch2intro_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
-<p id="ch2intro_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
-<p id="ch2intro_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
-</div>
-</div>
-</div>
-<div class="section" title="3. Basic Commands">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2983003"></a>3. Basic Commands</h2></div></div></div>
-<div class="section" title="3.1. ls">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2983011"></a>3.1. ls</h3></div></div></div>
-<p id="ch2intro_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
-<p id="ch2intro_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
-<p id="ch2intro_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch2intro_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
-<pre class="programlisting">$ ls
-jeeves.rst psmith.html blandings.html
-$ ls -l
-drwxr--r--   1 plum  editors   4096  jeeves
--rw-r--r--   1 plum  editors  30405  psmith
--r-xr-xr-x   1 plum  plum      8460  blandings</pre>
-<p id="ch2intro_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
-</div>
-<div class="section" title="3.2. date">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2983169"></a>3.2. date</h3></div></div></div>
-<p id="ch2intro_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
-<p id="ch2intro_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
-<pre class="programlisting">$date
-Tue Sep  8 12:01:45 IST 2009</pre>
-<p id="ch2intro_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
-<pre class="programlisting">$date --set="20040908 01:22"</pre>
-<p id="ch2intro_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
-<pre class="programlisting">$man date</pre>
-<p id="ch2intro_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
-</div>
-<div class="section" title="3.3. cd">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2983227"></a>3.3. cd</h3></div></div></div>
-<p id="ch2intro_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
-<p id="ch2intro_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
-<p id="ch2intro_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
-<p id="ch2intro_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
-<p id="ch2intro_46"></a>Absolute paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch2intro_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch2intro_48"></a>For example to get to /boot/grub you would type:</p>
-<pre class="programlisting">$cd /boot/grub</pre>
-<p id="ch2intro_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
-<p id="ch2intro_4a"></a>Relative paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch2intro_4b"></a>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.</p>
-<p id="ch2intro_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
-<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch2intro_4d"></a>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.</p>
-</div>
-<div class="section" title="3.4. who">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2983324"></a>3.4. who</h3></div></div></div>
-<p id="ch2intro_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
-<p id="ch2intro_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
-<pre class="programlisting">$who
-beeblebrox tty7         2009-09-08 10:50 (:0)
-beeblebrox pts/0        2009-09-08 11:25 (:0.0)
-dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
-beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
-<p id="ch2intro_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
-<p id="ch2intro_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
-<pre class="programlisting">$man who</pre>
-<p id="ch2intro_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
-</div>
-<div class="section" title="3.5. mkdir">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2983404"></a>3.5. mkdir</h3></div></div></div>
-<p id="ch2intro_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
-<pre class="programlisting">$mkdir name_of_directory</pre>
-<p id="ch2intro_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
-<div class="section" title="3.5.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2983435"></a>3.5.1. Options</h4></div></div></div>
-<p id="ch2intro_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch2intro_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
-</div>
-<div class="section" title="3.5.2. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2983494"></a>3.5.2. Examples</h4></div></div></div>
-<p id="ch2intro_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
-<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
-<p id="ch2intro_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
-<p id="ch2intro_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
-<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
-<p id="ch2intro_5d"></a>This will create:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_5e"></a>tag</p></li>
-<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch2intro_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
-</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
-</div>
-</div>
-</div>
-<div class="section" title="4. Getting Help">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2983578"></a>4. Getting Help</h2></div></div></div>
-<div class="section" title="4.1. apropos and whatis">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2983586"></a>4.1. apropos and whatis</h3></div></div></div>
-<p id="ch2intro_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
-<pre class="programlisting">$ apropos grep
-egrep       egrep (1)       Search a file for a pattern using full regular expressions
-fgrep       fgrep (1)       Search a file for a fixed-character string
-fmlgrep     fmlgrep (1)     Search a file for a pattern
-grep        grep (1)        Search a file for a pattern
-gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
-nisgrep     nismatch (1)    Utilities for searching NIS+ tables
-pgrep       pgrep (1)       Find or signal a process by name or other attribute
-zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
-...</pre>
-<p id="ch2intro_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
-<p id="ch2intro_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
-<pre class="programlisting">$whatis ls
-ls (1)           - list directory contents</pre>
-<p id="ch2intro_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
-<p id="ch2intro_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
-<pre class="programlisting">$apropos browser
-gmusicbrowser (1)    - Jukebox for large collections of audio files
-infobrowser (1)      - read Info documents
-libsmbclient (7)     - An extension library for browsers and that               can be used...
-opera (1)            - a standards-compliant graphical Web browser
-sensible-browser (1) - sensible editing, paging, and web browsing
-smbtree (1)          - A text based smb network browser
-tvtk_doc (1)         - A GUI based TVTK documentation search browser.
-viewres (1)          - graphical class browser for Xt
-w3m (1)              - a text based Web browser and pager
-www-browser (1)      - a text based Web browser and pager
-...</pre>
-</div>
-<div class="section" title="4.2. man">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2983667"></a>4.2. man</h3></div></div></div>
-<p id="ch2intro_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
-<p id="ch2intro_66"></a>To read a manual page for a Unix command, one can use:</p>
-<pre class="programlisting">$ man &lt;command_name&gt;</pre>
-<p id="ch2intro_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
-<p id="ch2intro_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
-<pre class="programlisting">$man 3 printf</pre>
-<p id="ch2intro_69"></a>Another example:</p>
-<pre class="programlisting">$man man</pre>
-<p id="ch2intro_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
-<div class="section" title="4.2.1. Layout">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2983747"></a>4.2.1. Layout</h4></div></div></div>
-<p id="ch2intro_6b"></a>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:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch2intro_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch2intro_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch2intro_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch2intro_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch2intro_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch2intro_71"></a>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.</p>
-<p id="ch2intro_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
-<p id="ch2intro_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
-<p id="ch2intro_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
-<p id="ch2intro_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
-<p id="ch2intro_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
-</div>
-</div>
-<div class="section" title="4.3. info">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2983870"></a>4.3. info</h3></div></div></div>
-<p id="ch2intro_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
-<p id="ch2intro_78"></a>The syntax is</p>
-<pre class="programlisting">$ info &lt;command_name&gt;</pre>
-<p id="ch2intro_79"></a><span class="emphasis"><em>info</em></span> 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</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch2intro_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
-</div>
-<div class="section" title="4.4. --help">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2983961"></a>4.4. --help</h3></div></div></div>
-<p id="ch2intro_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
-<pre class="programlisting">$ userprompt@host: cat --help
-Usage: cat [OPTION] [FILE]...
-Concatenate FILE(s), or standard input, to standard output.
-
-  -A, --show-all           equivalent to -vET
-  -b, --number-nonblank    number nonempty output lines
-  -e                       equivalent to -vE
-  -E, --show-ends          display $ at end of each line
-  -n, --number             number all output lines
-  -s, --squeeze-blank      suppress repeated empty output lines
-  -t                       equivalent to -vT
-  -T, --show-tabs          display TAB characters as ^I
-  -u                       (ignored)
-  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
-  --help     display this help and exit
-  --version  output version information and exit
-
-With no FILE, or when FILE is -, read standard input.
-
-Examples:
-  cat f - g  Output f's contents, then standard input, then g's           contents.
-  cat        Copy standard input to standard output.
-
-Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
-</div>
-</div>
-<div class="section" title="5. Basic file handling">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2984014"></a>5. Basic file handling</h2></div></div></div>
-<div class="section" title="5.1. cp">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2984023"></a>5.1. cp</h3></div></div></div>
-<p id="ch2intro_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
-<div class="section" title="5.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2984040"></a>5.1.1. Usage</h4></div></div></div>
-<p id="ch2intro_82"></a>To copy a file to another file:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
-<p id="ch2intro_83"></a>To copy a file to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
-<p id="ch2intro_84"></a>To copy a directory to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
-SourceDirectory ... TargetDirectory</pre>
-</div>
-<div class="section" title="5.1.2. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2984074"></a>5.1.2. Flags</h4></div></div></div>
-<p id="ch2intro_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
-<p id="ch2intro_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
-<p id="ch2intro_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
-<p id="ch2intro_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_89"></a>The time of the last data modification and the time of the last access.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch2intro_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
-</div>
-<div class="section" title="5.1.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2984172"></a>5.1.3. Examples</h4></div></div></div>
-<p id="ch2intro_8d"></a>To make a copy of a file in the current directory, enter:</p>
-<pre class="programlisting">$ cp prog.c prog.bak</pre>
-<p id="ch2intro_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
-<p id="ch2intro_8f"></a>To copy a file in your current directory into another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
-<p id="ch2intro_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
-<p id="ch2intro_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
-<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
-<p id="ch2intro_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
-<p id="ch2intro_93"></a>To copy all the files in a directory to a new directory, enter:</p>
-<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
-<p id="ch2intro_94"></a>This copies only the files in the clients directory to the customers directory.</p>
-<p id="ch2intro_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch2intro_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch2intro_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
-<p id="ch2intro_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
-<p id="ch2intro_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
-<p id="ch2intro_9a"></a>To use pattern-matching characters to copy files, enter:</p>
-<pre class="programlisting">$ cp programs/*.py .</pre>
-<p id="ch2intro_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
-</div>
-</div>
-<div class="section" title="5.2. mv">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2984334"></a>5.2. mv</h3></div></div></div>
-<p id="ch2intro_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
-<div class="section" title="5.2.1. Conflicting existing file">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2984358"></a>5.2.1. Conflicting existing file</h4></div></div></div>
-<p id="ch2intro_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
-</div>
-<div class="section" title="5.2.2. Differences with copy and delete">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2984377"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
-<p id="ch2intro_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
-</div>
-<div class="section" title="5.2.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2984423"></a>5.2.3. Examples</h4></div></div></div>
-<pre class="programlisting">$ mv myfile mynewfilename    renames a file
-$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
-$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
-$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
-$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
-$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
-$ mv foo bar baz dir         moves multiple files to directory dir
-$ mv --help                  shows a very concise help about the                syntax of the command
-$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
-<p id="ch2intro_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
-<p id="ch2intro_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
-</div>
-</div>
-<div class="section" title="5.3. rm">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2984483"></a>5.3. rm</h3></div></div></div>
-<p id="ch2intro_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
-<p id="ch2intro_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
-<pre class="programlisting">$ rm -i foo
-remove foo? y</pre>
-<div class="section" title="5.3.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2984512"></a>5.3.1. Options</h4></div></div></div>
-<p id="ch2intro_a3"></a>Common options that rm accepts include:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch2intro_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
-<p id="ch2intro_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
-<p id="ch2intro_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
-<pre class="programlisting">xargs rm &lt; filelist</pre>
-<p id="ch2intro_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
-</div>
-<div class="section" title="5.3.2. Permissions">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2984613"></a>5.3.2. Permissions</h4></div></div></div>
-<p id="ch2intro_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
-<p id="ch2intro_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
-<p id="ch2intro_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
-</div>
-</div>
-</div>
-<div class="section" title="6. Command Line Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2984653"></a>6. Command Line Arguments</h2></div></div></div>
-<p id="ch2intro_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
-<p id="ch2intro_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
-<pre class="programlisting">rm file.s</pre>
-<p id="ch2intro_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
-<p id="ch2intro_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
-<p id="ch2intro_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
-<p id="ch2intro_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
-<p id="ch2intro_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
-</div>
-<div class="section" title="7. Basic Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2984746"></a>7. Basic Text Processing</h2></div></div></div>
-<div class="section" title="7.1. head">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2984755"></a>7.1. head</h3></div></div></div>
-<p id="ch2intro_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
-<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
-<p id="ch2intro_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
-<pre class="programlisting">$ head -n 20 filename</pre>
-<p id="ch2intro_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ head -n 5 foo*</pre>
-<p id="ch2intro_b9"></a>Some versions omit the n and just let you say -5.</p>
-<div class="section" title="7.1.1. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2984806"></a>7.1.1. Flags</h4></div></div></div>
-<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
-<p id="ch2intro_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
-<p id="ch2intro_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
-<pre class="programlisting">sed 5q foo</pre>
-<p id="ch2intro_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
-</div>
-</div>
-<div class="section" title="7.2. tail">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2984842"></a>7.2. tail</h3></div></div></div>
-<p id="ch2intro_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
-<p id="ch2intro_be"></a>The command-syntax is:</p>
-<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
-<p id="ch2intro_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
-<pre class="programlisting">$ tail -n 20 filename</pre>
-<p id="ch2intro_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ tail -c 15 foo*</pre>
-<p id="ch2intro_c1"></a>This example shows all lines of filename from the second line onwards:</p>
-<pre class="programlisting">$ tail -n +2 filename</pre>
-<p id="ch2intro_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
-<pre class="programlisting">$ tail -20 filename
-$ tail -50c filename</pre>
-<p id="ch2intro_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
-<div class="section" title="7.2.1. File monitoring">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2984920"></a>7.2.1. File monitoring</h4></div></div></div>
-<p id="ch2intro_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
-<pre class="programlisting">$ tail -f /var/adm/messages</pre>
-<p id="ch2intro_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
-<p id="ch2intro_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
-</div>
-</div>
-<div class="section" title="7.3. cut">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2984970"></a>7.3. cut</h3></div></div></div>
-<p id="ch2intro_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
-<p id="ch2intro_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
-<p id="ch2intro_c9"></a>Assuming a file named file containing the lines:</p>
-<pre class="programlisting">foo:bar:baz:qux:quux
-one:two:three:four:five:six:seven
-alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-<p id="ch2intro_ca"></a>To output the fourth through tenth characters of each line:</p>
-<pre class="programlisting">$ cut -c 4-10 file</pre>
-<p id="ch2intro_cb"></a>This gives the output:</p>
-<pre class="programlisting">:bar:ba
-:two:th
-ha:beta</pre>
-<p id="ch2intro_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
-<pre class="programlisting">$ cut -d : -f 5- file</pre>
-<p id="ch2intro_cd"></a>This gives the output:</p>
-<pre class="programlisting">quux
-five:six:seven
-epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-</div>
-<div class="section" title="7.4. paste">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2985055"></a>7.4. paste</h3></div></div></div>
-<p id="ch2intro_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
-<p id="ch2intro_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
-<pre class="programlisting">$ paste who where when &gt; www</pre>
-<p id="ch2intro_d0"></a>If the files contain:</p>
-<table summary="paste" border="1"><colgroup>
-<col width="11">
-<col width="12">
-<col width="12">
-</colgroup></table>
-<p id="ch2intro_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
-<pre class="programlisting">Batman            GothamCity       January 3
-Trillian          Andromeda        February 4
-Jeeves            London           March 19</pre>
-</div>
-</div>
-<div class="section" title="8. Shell Meta Characters">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2985190"></a>8. Shell Meta Characters</h2></div></div></div>
-<p id="ch2intro_de"></a>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.</p>
-<p id="ch2intro_df"></a>The shell meta characters include:</p>
-<p id="ch2intro_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
-<p id="ch2intro_e1"></a>Different shells may differ in the meta characters recognized.</p>
-<p id="ch2intro_e2"></a>As an example,</p>
-<pre class="programlisting">$ ls file.*</pre>
-<p id="ch2intro_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
-<pre class="programlisting">$ ls file.?</pre>
-<p id="ch2intro_e4"></a>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:</p>
-<pre class="programlisting">$ more c*</pre>
-<p id="ch2intro_e5"></a>because the c* matches that long file name.</p>
-<p id="ch2intro_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
-<pre class="programlisting">$ rm ??more</pre>
-<p id="ch2intro_e7"></a>or:</p>
-<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
-<p id="ch2intro_e8"></a>or:</p>
-<pre class="programlisting">$ rm ''*|more''</pre>
-</div>
-<div class="section" title="9. Looking At Files">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2985297"></a>9. Looking At Files</h2></div></div></div>
-<div class="section" title="9.1. cat">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2985305"></a>9.1. cat</h3></div></div></div>
-<p id="ch2intro_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
-<p id="ch2intro_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
-<p id="ch2intro_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
-<div class="section" title="9.1.1. Jargon File Definition">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2985349"></a>9.1.1. Jargon File Definition</h4></div></div></div>
-<p id="ch2intro_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
-<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
-     pause (syn. blast).
-
-2. By extension, to dump large amounts of data at an unprepared target or
-     with no intention of browsing it carefully. Usage: considered silly.
-     Rare outside Unix sites. See also dd, BLT.
-
-     Among Unix fans, *cat(1)* is considered an excellent example of
-     user-interface design, because it delivers the file contents without
-     such verbosity as spacing or headers between the files, and because
-     it does not require the files to consist of lines of text, but works
-     with any sort of data.
-
-     Among Unix critics, *cat(1)* is considered the canonical example of
-     bad user-interface design, because of its woefully unobvious name.
-     It is far more often used to blast a single file to standard output
-     than to concatenate two or more files. The name cat for the former
-     operation is just as unintuitive as, say, LISP's cdr.
-
-     Of such oppositions are holy wars made...</pre>
-</div>
-<div class="section" title="9.1.2. Useless Use of 'cat'">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2985388"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
-<p id="ch2intro_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
-<p id="ch2intro_ee"></a>Nevertheless one sees people doing:</p>
-<pre class="programlisting">$ cat file | some_command and its args ...</pre>
-<p id="ch2intro_ef"></a>instead of the equivalent and cheaper:</p>
-<pre class="programlisting">&lt;file some_command and its args ...</pre>
-<p id="ch2intro_f0"></a>or (equivalently and more classically):</p>
-<pre class="programlisting">some_command and its args ... &lt;file</pre>
-<p id="ch2intro_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
-<p id="ch2intro_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
-</div>
-<div class="section" title="9.1.3. zcat">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2985457"></a>9.1.3. zcat</h4></div></div></div>
-<p id="ch2intro_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
-</div>
-</div>
-<div class="section" title="9.2. more">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2985493"></a>9.2. more</h3></div></div></div>
-<p id="ch2intro_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
-<div class="section" title="9.2.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2985513"></a>9.2.1. Usage</h4></div></div></div>
-<p id="ch2intro_f5"></a>The command-syntax is:</p>
-<pre class="programlisting">$ more [options] [file_name]</pre>
-<p id="ch2intro_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
-<p id="ch2intro_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
-<p id="ch2intro_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
-<p id="ch2intro_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
-</div>
-</div>
-<div class="section" title="9.3. less">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2985608"></a>9.3. less</h3></div></div></div>
-<p id="ch2intro_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
-<div class="section" title="9.3.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2985637"></a>9.3.1. Usage</h4></div></div></div>
-<p id="ch2intro_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
-<p id="ch2intro_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
-<p id="ch2intro_fd"></a>The command-syntax is:</p>
-<pre class="programlisting">$ less [options] file_name</pre>
-</div>
-<div class="section" title="9.3.2. Frequently Used Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2985691"></a>9.3.2. Frequently Used Options</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_ff"></a>-I: Case-insensitive searches.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_103"></a>-?: Shows help.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.3. Frequently Used Commands">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2985743"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_105"></a>[Space bar]: Next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_106"></a>b: Previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_10a"></a>'^ or g: Go to start of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_10b"></a>'$ or G: Go to end of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_10d"></a>=: File information.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_10e"></a>h: Help.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_10f"></a>q: Quit.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.4. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2985832"></a>9.3.4. Examples</h4></div></div></div>
-<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
-$ less +F /var/log/mail.log              #Follow mode for log
-$ file * | less                          #Easier file analysis.
-$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
-</div>
-</div>
-</div>
-<div class="section" title="10. Directory Structure">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2985848"></a>10. Directory Structure</h2></div></div></div>
-<p id="ch2intro_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
-<p id="ch2intro_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
-<table summary="Directory Structure" border="1"><colgroup>
-<col width="15">
-<col width="48">
-</colgroup></table>
-<div class="section" title="10.1. man hier">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2986117"></a>10.1. man hier</h3></div></div></div>
-<p id="ch2intro_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
-<pre class="programlisting">$ man hier</pre>
-</div>
-<div class="section" title="10.2. ls -l">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2986133"></a>10.2. ls -l</h3></div></div></div>
-<p id="ch2intro_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
-<pre class="programlisting">$ ls -l</pre>
-<p id="ch2intro_138"></a>This can be done after entering the required directory.</p>
-</div>
-</div>
-<div class="section" title="11. Permissions and Ownership">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2986156"></a>11. Permissions and Ownership</h2></div></div></div>
-<div class="section" title="11.1. chmod">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2986165"></a>11.1. chmod</h3></div></div></div>
-<p id="ch2intro_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
-<div class="section" title="11.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2986191"></a>11.1.1. Usage</h4></div></div></div>
-<p id="ch2intro_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
-<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
-<p id="ch2intro_13b"></a>To view what the permissions currently are, type:</p>
-<pre class="programlisting">$ ls -l file</pre>
-</div>
-<div class="section" title="11.1.2. Command line options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2986219"></a>11.1.2. Command line options</h4></div></div></div>
-<p id="ch2intro_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch2intro_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
-</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2986255"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
-<p id="ch2intro_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
-<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
-<p id="ch2intro_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="8">
-<col width="45">
-</colgroup></table>
-<p id="ch2intro_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="54">
-</colgroup></table>
-<p id="ch2intro_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="5">
-<col width="14">
-<col width="48">
-</colgroup></table>
-<p id="ch2intro_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
-</div>
-<div class="section" title="11.1.2.2. Symbolic examples">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2986802"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
-<p id="ch2intro_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
-<pre class="programlisting">$ chmod ug+rw mydir
-$ ls -ld mydir
-drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
-<p id="ch2intro_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
-<pre class="programlisting">$ chmod a-w myfile
-$ ls -l myfile
--r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
-<p id="ch2intro_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
-<pre class="programlisting">$ chmod ug=rx mydir
-$ ls -ld mydir
-dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
-</div>
-<div class="section" title="11.1.2.3. Octal numbers">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2986842"></a>11.1.2.3. Octal numbers</h5></div></div></div>
-<p id="ch2intro_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
-<pre class="programlisting">$ chmod 664 myfile
-$ ls -l myfile
--rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
-<p id="ch2intro_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
-<pre class="programlisting">$ chmod 0664 myfile</pre>
-</div>
-<div class="section" title="11.1.2.4. Special modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2986882"></a>11.1.2.4. Special modes</h5></div></div></div>
-<p id="ch2intro_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
-<p id="ch2intro_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
-</div>
-</div>
-</div>
-</div>
-<div class="section" title="12. Redirection and Piping">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2986929"></a>12. Redirection and Piping</h2></div></div></div>
-<p id="ch2intro_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
-<p id="ch2intro_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
-<div class="section" title="12.1. Redirecting standard input and standard output">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2986966"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
-<p id="ch2intro_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
-<pre class="programlisting">$ command1 &gt; file1</pre>
-<p id="ch2intro_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
-<pre class="programlisting">$ command1 &lt; file1</pre>
-<p id="ch2intro_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
-<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
-<p id="ch2intro_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
-</div>
-<div class="section" title="12.2. Piping">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2987035"></a>12.2. Piping</h3></div></div></div>
-<p id="ch2intro_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
-A pipeline of three programs run on a text terminal:</p>
-<pre class="programlisting">$ command1 | command2</pre>
-<p id="ch2intro_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
-<p id="ch2intro_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
-<pre class="programlisting">$ command1 &gt; tempfile
-$ command2 &lt; tempfile
-$ rm tempfile</pre>
-<p id="ch2intro_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
-<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
-<p id="ch2intro_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
-</div>
-<div class="section" title="12.3. Redirecting to and from the standard file handles">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2987096"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
-<p id="ch2intro_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
-<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
-<col width="12">
-<col width="13">
-<col width="24">
-</colgroup></table>
-<p id="ch2intro_18d"></a>For example:</p>
-<pre class="programlisting">$ command1 2&gt; file1</pre>
-<p id="ch2intro_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
-<p id="ch2intro_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
-<p id="ch2intro_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
-<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
-<p id="ch2intro_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
-<p id="ch2intro_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
-<p id="ch2intro_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
-<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
-<p id="ch2intro_194"></a>A simplified form of the command:</p>
-<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
-<p id="ch2intro_195"></a>is:</p>
-<pre class="programlisting">$ command &amp;&gt;file</pre>
-<p id="ch2intro_196"></a>or:</p>
-<pre class="programlisting">$command &gt;&amp;file</pre>
-</div>
-<div class="section" title="12.4. Chained pipelines">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2987301"></a>12.4. Chained pipelines</h3></div></div></div>
-<p id="ch2intro_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
-<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
-<p id="ch2intro_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
-</div>
-<div class="section" title="12.5. Redirect to multiple outputs">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2987335"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
-<p id="ch2intro_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
-<pre class="programlisting">$ ls -lrt | tee xyz</pre>
-<p id="ch2intro_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
-</div>
-</div>
-<div class="section" title="13. More Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2987365"></a>13. More Text Processing</h2></div></div></div>
-<div class="section" title="13.1. grep">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2987374"></a>13.1. grep</h3></div></div></div>
-<p id="ch2intro_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
-<div class="section" title="13.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2987405"></a>13.1.1. Usage</h4></div></div></div>
-<p id="ch2intro_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
-<pre class="programlisting">$ grep apple fruitlist.txt</pre>
-<p id="ch2intro_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
-<p id="ch2intro_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
-<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
-<p id="ch2intro_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
-<p id="ch2intro_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
-<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
-<p id="ch2intro_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
-<div class="section" title="13.1.1.1. Variations">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2987484"></a>13.1.1.1. Variations</h5></div></div></div>
-<p id="ch2intro_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
-<p id="ch2intro_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
-<p id="ch2intro_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
-</div>
-</div>
-</div>
-<div class="section" title="13.2. tr">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2987563"></a>13.2. tr</h3></div></div></div>
-<p id="ch2intro_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
-<p id="ch2intro_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
-<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
-<p id="ch2intro_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
-<p id="ch2intro_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
-<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
-<p id="ch2intro_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
-<p id="ch2intro_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
-<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
-<p id="ch2intro_1ab"></a>therefore removes all non-alphanumeric characters.</p>
-<p id="ch2intro_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
-<pre class="programlisting">$ tr -s '\n' '\n'</pre>
-<p id="ch2intro_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
-<p id="ch2intro_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
-<pre class="programlisting">$ tr -d '\r'</pre>
-<p id="ch2intro_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
-<p id="ch2intro_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
-</div>
-</div>
-<div class="section" title="14. Elementary Regex">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2987713"></a>14. Elementary Regex</h2></div></div></div>
-<p id="ch2intro_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
-<p id="ch2intro_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
-<p id="ch2intro_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
-<p id="ch2intro_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
-<table summary="Elementary Regex" border="1"><colgroup>
-<col width="13">
-<col width="60">
-</colgroup></table>
-<div class="section" title="14.1. Lazy quantification">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2988062"></a>14.1. Lazy quantification</h3></div></div></div>
-<p id="ch2intro_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
-<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
-<p id="ch2intro_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
-<p id="ch2intro_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
-</div>
-</div>
-<div class="section" title="15. One Liners">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2988138"></a>15. One Liners</h2></div></div></div>
-<p id="ch2intro_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
-<p id="ch2intro_1cd"></a>The one liner can be</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem"><p id="ch2intro_1ce"></a>An expression written in the language of the shell.</p></li>
-<li class="listitem"><p id="ch2intro_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
-<li class="listitem"><p id="ch2intro_1d0"></a>The invocation of a compiler together with source to compile and
-instructions for executing the compiled program.</p></li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch2intro_1d1"></a>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.</p>
-<p id="ch2intro_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
-<p id="ch2intro_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
-<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
-<p id="ch2intro_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
-<p id="ch2intro_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
-<p id="ch2intro_1d6"></a>Here are the first few of them:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem">
-<p id="ch2intro_1d7"></a>Print the total number of input lines:</p>
-<p id="ch2intro_1d8"></a>END { print NR }</p>
-</li>
-<li class="listitem">
-<p id="ch2intro_1d9"></a>Print the tenth input line:</p>
-<p id="ch2intro_1da"></a>NR == 10</p>
-</li>
-<li class="listitem">
-<p id="ch2intro_1db"></a>Print the last field of every input line:</p>
-<p id="ch2intro_1dc"></a>{ print $NF }</p>
-</li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch2intro_1dd"></a>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.</p>
-<p id="ch2intro_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
-<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
-*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
-<p id="ch2intro_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
-<p id="ch2intro_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
-<pre class="programlisting">$ prog foo 'f??'; echo $?
-
-$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
-<p id="ch2intro_1e1"></a>Here is a one line shell script to show directories:</p>
-<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
-</div>
-</div>
-</div></body>
-</html>
--- a/web/html/ch4strings_dicts.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1139 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Strings and Dicts </title>
-<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
-<script type="text/javascript" src="/review/support/jquery-min.js"></script>
-<script type="text/javascript" src="/review/support/form.js"></script>
-<script type="text/javascript" src="/review/support/hsbook.js"></script>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch4strings_dicts ">
-<div class="titlepage"></div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="article"><a href="#id2633629"></a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2443754">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2631449">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2684690">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2684962">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2685094">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2685102">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2684456">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2684464">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2685688">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2685748">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2685850">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2685932">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2686111">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2686119">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2686212">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2686421">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2686511">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2686564">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2686572">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2686884">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2687015">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2687186">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2687278">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2687287">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2687373">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2687499">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2687585">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2687717">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2687825">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2687833">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2688020">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2688130">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2688372">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2688647">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2688663">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2688686">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2688695">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2689472">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2689508">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2689576">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2689638">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2689846">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2689880">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2689911">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2689920">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2690110">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2690261">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2690477">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2690554">15. One Liners</a></span></dt>
-</dl></dd>
-</dl>
-</div>
-<div class="article">
-<div class="titlepage">
-<div><div><h2 class="title" id="id2633629"></a></h2></div></div>
-<hr>
-</div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="section"><a href="#id2443754">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2631449">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2684690">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2684962">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2685094">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2685102">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2684456">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2684464">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2685688">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2685748">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2685850">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2685932">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2686111">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2686119">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2686212">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2686421">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2686511">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2686564">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2686572">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2686884">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2687015">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2687186">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2687278">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2687287">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2687373">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2687499">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2687585">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2687717">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2687825">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2687833">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2688020">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2688130">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2688372">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2688647">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2688663">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2688686">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2688695">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2689472">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2689508">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2689576">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2689638">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2689846">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2689880">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2689911">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2689920">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2690110">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2690261">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2690477">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2690554">15. One Liners</a></span></dt>
-</dl>
-</div>
-<div class="section" title="1. Introducing Linux">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2443754"></a>1. Introducing Linux</h2></div></div></div>
-<p id="ch4strings_dicts_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
-<p id="ch4strings_dicts_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
-<p id="ch4strings_dicts_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
-<p id="ch4strings_dicts_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
-<div class="section" title="1.1. Historical Background">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2631449"></a>1.1. Historical Background</h3></div></div></div>
-<div class="section" title="1.1.1. Events leading to the creation">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2631415"></a>1.1.1. Events leading to the creation</h4></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
-</ul></div>
-</div>
-<div class="section" title="1.1.2. The Creation of Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2684645"></a>1.1.2. The Creation of Linux</h4></div></div></div>
-<p id="ch4strings_dicts_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
-<p id="ch4strings_dicts_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
-</div>
-</div>
-<div class="section" title="1.2. Design and Implications">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2684690"></a>1.2. Design and Implications</h3></div></div></div>
-<p id="ch4strings_dicts_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
-<div class="section" title="1.2.1. User Interface">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2684714"></a>1.2.1. User Interface</h4></div></div></div>
-<p id="ch4strings_dicts_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
-<p id="ch4strings_dicts_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
-</div>
-<div class="section" title="1.2.2. Development">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2684768"></a>1.2.2. Development</h4></div></div></div>
-<p id="ch4strings_dicts_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
-<p id="ch4strings_dicts_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
-<p id="ch4strings_dicts_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
-</div>
-<div class="section" title="1.2.3. Community">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2684824"></a>1.2.3. Community</h4></div></div></div>
-<p id="ch4strings_dicts_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
-<p id="ch4strings_dicts_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
-<p id="ch4strings_dicts_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
-</div>
-<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2684869"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
-<p id="ch4strings_dicts_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
-</div>
-<div class="section" title="1.2.5. Programming on Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2684915"></a>1.2.5. Programming on Linux</h4></div></div></div>
-<p id="ch4strings_dicts_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
-<p id="ch4strings_dicts_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
-<p id="ch4strings_dicts_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
-</div>
-</div>
-<div class="section" title="1.3. Reasons for Using Linux">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2684962"></a>1.3. Reasons for Using Linux</h3></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_16"></a>Linux is free:</p></li></ul></div>
-<p id="ch4strings_dicts_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
-Most of all, Linux is free as in "free speech":
-The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
-<p id="ch4strings_dicts_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_1a"></a>Linux was made to keep on running:</p></li></ul></div>
-<p id="ch4strings_dicts_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_1c"></a>Linux is secure and versatile:</p></li></ul></div>
-<p id="ch4strings_dicts_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_1e"></a>Linux is scalable:</p></li></ul></div>
-<p id="ch4strings_dicts_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
-<p id="ch4strings_dicts_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
-</div>
-</div>
-<div class="section" title="2. Getting Started">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2685094"></a>2. Getting Started</h2></div></div></div>
-<div class="section" title="2.1. Logging in, activating the user interface and logging out">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2685102"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
-<p id="ch4strings_dicts_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
-<div class="section" title="2.1.1. Graphical Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2685133"></a>2.1.1. Graphical Mode</h4></div></div></div>
-<p id="ch4strings_dicts_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
-<p id="ch4strings_dicts_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
-It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
-<p id="ch4strings_dicts_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
-<p id="ch4strings_dicts_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
-<p id="ch4strings_dicts_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
-<p id="ch4strings_dicts_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
-<p id="ch4strings_dicts_29"></a>Another common form for a prompt is this one:
-[</p>
-<div class="reference">
-<div class="titlepage"><hr></div>user@host</div>
-<p> dir]</p>
-<p id="ch4strings_dicts_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
-<p id="ch4strings_dicts_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
-</div>
-<div class="section" title="2.1.2. Text Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2685291"></a>2.1.2. Text Mode</h4></div></div></div>
-<p id="ch4strings_dicts_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
-<p id="ch4strings_dicts_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
-reasons.</p>
-<p id="ch4strings_dicts_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
-<p id="ch4strings_dicts_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
-<p id="ch4strings_dicts_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
-</div>
-</div>
-</div>
-<div class="section" title="3. Basic Commands">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2684456"></a>3. Basic Commands</h2></div></div></div>
-<div class="section" title="3.1. ls">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2684464"></a>3.1. ls</h3></div></div></div>
-<p id="ch4strings_dicts_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
-<p id="ch4strings_dicts_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
-<p id="ch4strings_dicts_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
-<pre class="programlisting">$ ls
-jeeves.rst psmith.html blandings.html
-$ ls -l
-drwxr--r--   1 plum  editors   4096  jeeves
--rw-r--r--   1 plum  editors  30405  psmith
--r-xr-xr-x   1 plum  plum      8460  blandings</pre>
-<p id="ch4strings_dicts_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
-</div>
-<div class="section" title="3.2. date">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2685688"></a>3.2. date</h3></div></div></div>
-<p id="ch4strings_dicts_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
-<p id="ch4strings_dicts_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
-<pre class="programlisting">$date
-Tue Sep  8 12:01:45 IST 2009</pre>
-<p id="ch4strings_dicts_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
-<pre class="programlisting">$date --set="20040908 01:22"</pre>
-<p id="ch4strings_dicts_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
-<pre class="programlisting">$man date</pre>
-<p id="ch4strings_dicts_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
-</div>
-<div class="section" title="3.3. cd">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2685748"></a>3.3. cd</h3></div></div></div>
-<p id="ch4strings_dicts_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
-<p id="ch4strings_dicts_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
-<p id="ch4strings_dicts_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
-<p id="ch4strings_dicts_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
-<p id="ch4strings_dicts_46"></a>Absolute paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch4strings_dicts_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_48"></a>For example to get to /boot/grub you would type:</p>
-<pre class="programlisting">$cd /boot/grub</pre>
-<p id="ch4strings_dicts_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
-<p id="ch4strings_dicts_4a"></a>Relative paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch4strings_dicts_4b"></a>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.</p>
-<p id="ch4strings_dicts_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
-<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_4d"></a>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.</p>
-</div>
-<div class="section" title="3.4. who">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2685850"></a>3.4. who</h3></div></div></div>
-<p id="ch4strings_dicts_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
-<p id="ch4strings_dicts_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
-<pre class="programlisting">$who
-beeblebrox tty7         2009-09-08 10:50 (:0)
-beeblebrox pts/0        2009-09-08 11:25 (:0.0)
-dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
-beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
-<p id="ch4strings_dicts_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
-<p id="ch4strings_dicts_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
-<pre class="programlisting">$man who</pre>
-<p id="ch4strings_dicts_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
-</div>
-<div class="section" title="3.5. mkdir">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2685932"></a>3.5. mkdir</h3></div></div></div>
-<p id="ch4strings_dicts_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
-<pre class="programlisting">$mkdir name_of_directory</pre>
-<p id="ch4strings_dicts_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
-<div class="section" title="3.5.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2685964"></a>3.5.1. Options</h4></div></div></div>
-<p id="ch4strings_dicts_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
-</div>
-<div class="section" title="3.5.2. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2686025"></a>3.5.2. Examples</h4></div></div></div>
-<p id="ch4strings_dicts_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
-<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
-<p id="ch4strings_dicts_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
-<p id="ch4strings_dicts_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
-<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
-<p id="ch4strings_dicts_5d"></a>This will create:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_5e"></a>tag</p></li>
-<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
-</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
-</div>
-</div>
-</div>
-<div class="section" title="4. Getting Help">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2686111"></a>4. Getting Help</h2></div></div></div>
-<div class="section" title="4.1. apropos and whatis">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2686119"></a>4.1. apropos and whatis</h3></div></div></div>
-<p id="ch4strings_dicts_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
-<pre class="programlisting">$ apropos grep
-egrep       egrep (1)       Search a file for a pattern using full regular expressions
-fgrep       fgrep (1)       Search a file for a fixed-character string
-fmlgrep     fmlgrep (1)     Search a file for a pattern
-grep        grep (1)        Search a file for a pattern
-gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
-nisgrep     nismatch (1)    Utilities for searching NIS+ tables
-pgrep       pgrep (1)       Find or signal a process by name or other attribute
-zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
-...</pre>
-<p id="ch4strings_dicts_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
-<p id="ch4strings_dicts_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
-<pre class="programlisting">$whatis ls
-ls (1)           - list directory contents</pre>
-<p id="ch4strings_dicts_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
-<p id="ch4strings_dicts_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
-<pre class="programlisting">$apropos browser
-gmusicbrowser (1)    - Jukebox for large collections of audio files
-infobrowser (1)      - read Info documents
-libsmbclient (7)     - An extension library for browsers and that               can be used...
-opera (1)            - a standards-compliant graphical Web browser
-sensible-browser (1) - sensible editing, paging, and web browsing
-smbtree (1)          - A text based smb network browser
-tvtk_doc (1)         - A GUI based TVTK documentation search browser.
-viewres (1)          - graphical class browser for Xt
-w3m (1)              - a text based Web browser and pager
-www-browser (1)      - a text based Web browser and pager
-...</pre>
-</div>
-<div class="section" title="4.2. man">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2686212"></a>4.2. man</h3></div></div></div>
-<p id="ch4strings_dicts_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
-<p id="ch4strings_dicts_66"></a>To read a manual page for a Unix command, one can use:</p>
-<pre class="programlisting">$ man &lt;command_name&gt;</pre>
-<p id="ch4strings_dicts_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
-<p id="ch4strings_dicts_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
-<pre class="programlisting">$man 3 printf</pre>
-<p id="ch4strings_dicts_69"></a>Another example:</p>
-<pre class="programlisting">$man man</pre>
-<p id="ch4strings_dicts_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
-<div class="section" title="4.2.1. Layout">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2686294"></a>4.2.1. Layout</h4></div></div></div>
-<p id="ch4strings_dicts_6b"></a>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:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch4strings_dicts_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch4strings_dicts_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch4strings_dicts_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch4strings_dicts_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch4strings_dicts_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch4strings_dicts_71"></a>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.</p>
-<p id="ch4strings_dicts_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
-<p id="ch4strings_dicts_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
-<p id="ch4strings_dicts_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
-<p id="ch4strings_dicts_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
-<p id="ch4strings_dicts_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
-</div>
-</div>
-<div class="section" title="4.3. info">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2686421"></a>4.3. info</h3></div></div></div>
-<p id="ch4strings_dicts_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
-<p id="ch4strings_dicts_78"></a>The syntax is</p>
-<pre class="programlisting">$ info &lt;command_name&gt;</pre>
-<p id="ch4strings_dicts_79"></a><span class="emphasis"><em>info</em></span> 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</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
-</div>
-<div class="section" title="4.4. --help">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2686511"></a>4.4. --help</h3></div></div></div>
-<p id="ch4strings_dicts_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
-<pre class="programlisting">$ userprompt@host: cat --help
-Usage: cat [OPTION] [FILE]...
-Concatenate FILE(s), or standard input, to standard output.
-
-  -A, --show-all           equivalent to -vET
-  -b, --number-nonblank    number nonempty output lines
-  -e                       equivalent to -vE
-  -E, --show-ends          display $ at end of each line
-  -n, --number             number all output lines
-  -s, --squeeze-blank      suppress repeated empty output lines
-  -t                       equivalent to -vT
-  -T, --show-tabs          display TAB characters as ^I
-  -u                       (ignored)
-  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
-  --help     display this help and exit
-  --version  output version information and exit
-
-With no FILE, or when FILE is -, read standard input.
-
-Examples:
-  cat f - g  Output f's contents, then standard input, then g's           contents.
-  cat        Copy standard input to standard output.
-
-Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
-</div>
-</div>
-<div class="section" title="5. Basic file handling">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2686564"></a>5. Basic file handling</h2></div></div></div>
-<div class="section" title="5.1. cp">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2686572"></a>5.1. cp</h3></div></div></div>
-<p id="ch4strings_dicts_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
-<div class="section" title="5.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2686590"></a>5.1.1. Usage</h4></div></div></div>
-<p id="ch4strings_dicts_82"></a>To copy a file to another file:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
-<p id="ch4strings_dicts_83"></a>To copy a file to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
-<p id="ch4strings_dicts_84"></a>To copy a directory to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
-SourceDirectory ... TargetDirectory</pre>
-</div>
-<div class="section" title="5.1.2. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2686624"></a>5.1.2. Flags</h4></div></div></div>
-<p id="ch4strings_dicts_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
-<p id="ch4strings_dicts_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
-<p id="ch4strings_dicts_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
-<p id="ch4strings_dicts_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_89"></a>The time of the last data modification and the time of the last access.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
-</div>
-<div class="section" title="5.1.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2686722"></a>5.1.3. Examples</h4></div></div></div>
-<p id="ch4strings_dicts_8d"></a>To make a copy of a file in the current directory, enter:</p>
-<pre class="programlisting">$ cp prog.c prog.bak</pre>
-<p id="ch4strings_dicts_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
-<p id="ch4strings_dicts_8f"></a>To copy a file in your current directory into another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
-<p id="ch4strings_dicts_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
-<p id="ch4strings_dicts_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
-<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
-<p id="ch4strings_dicts_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
-<p id="ch4strings_dicts_93"></a>To copy all the files in a directory to a new directory, enter:</p>
-<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
-<p id="ch4strings_dicts_94"></a>This copies only the files in the clients directory to the customers directory.</p>
-<p id="ch4strings_dicts_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch4strings_dicts_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
-<p id="ch4strings_dicts_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
-<p id="ch4strings_dicts_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
-<p id="ch4strings_dicts_9a"></a>To use pattern-matching characters to copy files, enter:</p>
-<pre class="programlisting">$ cp programs/*.py .</pre>
-<p id="ch4strings_dicts_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
-</div>
-</div>
-<div class="section" title="5.2. mv">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2686884"></a>5.2. mv</h3></div></div></div>
-<p id="ch4strings_dicts_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
-<div class="section" title="5.2.1. Conflicting existing file">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2686907"></a>5.2.1. Conflicting existing file</h4></div></div></div>
-<p id="ch4strings_dicts_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
-</div>
-<div class="section" title="5.2.2. Differences with copy and delete">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2686927"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
-<p id="ch4strings_dicts_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
-</div>
-<div class="section" title="5.2.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2686957"></a>5.2.3. Examples</h4></div></div></div>
-<pre class="programlisting">$ mv myfile mynewfilename    renames a file
-$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
-$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
-$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
-$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
-$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
-$ mv foo bar baz dir         moves multiple files to directory dir
-$ mv --help                  shows a very concise help about the                syntax of the command
-$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
-<p id="ch4strings_dicts_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
-<p id="ch4strings_dicts_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
-</div>
-</div>
-<div class="section" title="5.3. rm">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2687015"></a>5.3. rm</h3></div></div></div>
-<p id="ch4strings_dicts_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
-<p id="ch4strings_dicts_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
-<pre class="programlisting">$ rm -i foo
-remove foo? y</pre>
-<div class="section" title="5.3.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2687045"></a>5.3.1. Options</h4></div></div></div>
-<p id="ch4strings_dicts_a3"></a>Common options that rm accepts include:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
-<p id="ch4strings_dicts_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
-<p id="ch4strings_dicts_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
-<pre class="programlisting">xargs rm &lt; filelist</pre>
-<p id="ch4strings_dicts_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
-</div>
-<div class="section" title="5.3.2. Permissions">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2687147"></a>5.3.2. Permissions</h4></div></div></div>
-<p id="ch4strings_dicts_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
-<p id="ch4strings_dicts_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
-<p id="ch4strings_dicts_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
-</div>
-</div>
-</div>
-<div class="section" title="6. Command Line Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2687186"></a>6. Command Line Arguments</h2></div></div></div>
-<p id="ch4strings_dicts_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
-<p id="ch4strings_dicts_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
-<pre class="programlisting">rm file.s</pre>
-<p id="ch4strings_dicts_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
-<p id="ch4strings_dicts_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
-<p id="ch4strings_dicts_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
-<p id="ch4strings_dicts_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
-<p id="ch4strings_dicts_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
-</div>
-<div class="section" title="7. Basic Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2687278"></a>7. Basic Text Processing</h2></div></div></div>
-<div class="section" title="7.1. head">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2687287"></a>7.1. head</h3></div></div></div>
-<p id="ch4strings_dicts_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
-<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
-<p id="ch4strings_dicts_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
-<pre class="programlisting">$ head -n 20 filename</pre>
-<p id="ch4strings_dicts_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ head -n 5 foo*</pre>
-<p id="ch4strings_dicts_b9"></a>Some versions omit the n and just let you say -5.</p>
-<div class="section" title="7.1.1. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2687338"></a>7.1.1. Flags</h4></div></div></div>
-<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
-<p id="ch4strings_dicts_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
-<p id="ch4strings_dicts_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
-<pre class="programlisting">sed 5q foo</pre>
-<p id="ch4strings_dicts_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
-</div>
-</div>
-<div class="section" title="7.2. tail">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2687373"></a>7.2. tail</h3></div></div></div>
-<p id="ch4strings_dicts_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
-<p id="ch4strings_dicts_be"></a>The command-syntax is:</p>
-<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
-<p id="ch4strings_dicts_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
-<pre class="programlisting">$ tail -n 20 filename</pre>
-<p id="ch4strings_dicts_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ tail -c 15 foo*</pre>
-<p id="ch4strings_dicts_c1"></a>This example shows all lines of filename from the second line onwards:</p>
-<pre class="programlisting">$ tail -n +2 filename</pre>
-<p id="ch4strings_dicts_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
-<pre class="programlisting">$ tail -20 filename
-$ tail -50c filename</pre>
-<p id="ch4strings_dicts_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
-<div class="section" title="7.2.1. File monitoring">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2687451"></a>7.2.1. File monitoring</h4></div></div></div>
-<p id="ch4strings_dicts_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
-<pre class="programlisting">$ tail -f /var/adm/messages</pre>
-<p id="ch4strings_dicts_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
-<p id="ch4strings_dicts_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
-</div>
-</div>
-<div class="section" title="7.3. cut">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2687499"></a>7.3. cut</h3></div></div></div>
-<p id="ch4strings_dicts_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
-<p id="ch4strings_dicts_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
-<p id="ch4strings_dicts_c9"></a>Assuming a file named file containing the lines:</p>
-<pre class="programlisting">foo:bar:baz:qux:quux
-one:two:three:four:five:six:seven
-alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-<p id="ch4strings_dicts_ca"></a>To output the fourth through tenth characters of each line:</p>
-<pre class="programlisting">$ cut -c 4-10 file</pre>
-<p id="ch4strings_dicts_cb"></a>This gives the output:</p>
-<pre class="programlisting">:bar:ba
-:two:th
-ha:beta</pre>
-<p id="ch4strings_dicts_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
-<pre class="programlisting">$ cut -d : -f 5- file</pre>
-<p id="ch4strings_dicts_cd"></a>This gives the output:</p>
-<pre class="programlisting">quux
-five:six:seven
-epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-</div>
-<div class="section" title="7.4. paste">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2687585"></a>7.4. paste</h3></div></div></div>
-<p id="ch4strings_dicts_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
-<p id="ch4strings_dicts_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
-<pre class="programlisting">$ paste who where when &gt; www</pre>
-<p id="ch4strings_dicts_d0"></a>If the files contain:</p>
-<table summary="paste" border="1"><colgroup>
-<col width="11">
-<col width="12">
-<col width="12">
-</colgroup></table>
-<p id="ch4strings_dicts_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
-<pre class="programlisting">Batman            GothamCity       January 3
-Trillian          Andromeda        February 4
-Jeeves            London           March 19</pre>
-</div>
-</div>
-<div class="section" title="8. Shell Meta Characters">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2687717"></a>8. Shell Meta Characters</h2></div></div></div>
-<p id="ch4strings_dicts_de"></a>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.</p>
-<p id="ch4strings_dicts_df"></a>The shell meta characters include:</p>
-<p id="ch4strings_dicts_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
-<p id="ch4strings_dicts_e1"></a>Different shells may differ in the meta characters recognized.</p>
-<p id="ch4strings_dicts_e2"></a>As an example,</p>
-<pre class="programlisting">$ ls file.*</pre>
-<p id="ch4strings_dicts_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
-<pre class="programlisting">$ ls file.?</pre>
-<p id="ch4strings_dicts_e4"></a>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:</p>
-<pre class="programlisting">$ more c*</pre>
-<p id="ch4strings_dicts_e5"></a>because the c* matches that long file name.</p>
-<p id="ch4strings_dicts_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
-<pre class="programlisting">$ rm ??more</pre>
-<p id="ch4strings_dicts_e7"></a>or:</p>
-<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
-<p id="ch4strings_dicts_e8"></a>or:</p>
-<pre class="programlisting">$ rm ''*|more''</pre>
-</div>
-<div class="section" title="9. Looking At Files">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2687825"></a>9. Looking At Files</h2></div></div></div>
-<div class="section" title="9.1. cat">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2687833"></a>9.1. cat</h3></div></div></div>
-<p id="ch4strings_dicts_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
-<p id="ch4strings_dicts_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
-<p id="ch4strings_dicts_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
-<div class="section" title="9.1.1. Jargon File Definition">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2687876"></a>9.1.1. Jargon File Definition</h4></div></div></div>
-<p id="ch4strings_dicts_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
-<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
-     pause (syn. blast).
-
-2. By extension, to dump large amounts of data at an unprepared target or
-     with no intention of browsing it carefully. Usage: considered silly.
-     Rare outside Unix sites. See also dd, BLT.
-
-     Among Unix fans, *cat(1)* is considered an excellent example of
-     user-interface design, because it delivers the file contents without
-     such verbosity as spacing or headers between the files, and because
-     it does not require the files to consist of lines of text, but works
-     with any sort of data.
-
-     Among Unix critics, *cat(1)* is considered the canonical example of
-     bad user-interface design, because of its woefully unobvious name.
-     It is far more often used to blast a single file to standard output
-     than to concatenate two or more files. The name cat for the former
-     operation is just as unintuitive as, say, LISP's cdr.
-
-     Of such oppositions are holy wars made...</pre>
-</div>
-<div class="section" title="9.1.2. Useless Use of 'cat'">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2687915"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
-<p id="ch4strings_dicts_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
-<p id="ch4strings_dicts_ee"></a>Nevertheless one sees people doing:</p>
-<pre class="programlisting">$ cat file | some_command and its args ...</pre>
-<p id="ch4strings_dicts_ef"></a>instead of the equivalent and cheaper:</p>
-<pre class="programlisting">&lt;file some_command and its args ...</pre>
-<p id="ch4strings_dicts_f0"></a>or (equivalently and more classically):</p>
-<pre class="programlisting">some_command and its args ... &lt;file</pre>
-<p id="ch4strings_dicts_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
-<p id="ch4strings_dicts_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
-</div>
-<div class="section" title="9.1.3. zcat">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2687986"></a>9.1.3. zcat</h4></div></div></div>
-<p id="ch4strings_dicts_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
-</div>
-</div>
-<div class="section" title="9.2. more">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2688020"></a>9.2. more</h3></div></div></div>
-<p id="ch4strings_dicts_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
-<div class="section" title="9.2.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2688039"></a>9.2.1. Usage</h4></div></div></div>
-<p id="ch4strings_dicts_f5"></a>The command-syntax is:</p>
-<pre class="programlisting">$ more [options] [file_name]</pre>
-<p id="ch4strings_dicts_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
-<p id="ch4strings_dicts_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
-<p id="ch4strings_dicts_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
-<p id="ch4strings_dicts_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
-</div>
-</div>
-<div class="section" title="9.3. less">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2688130"></a>9.3. less</h3></div></div></div>
-<p id="ch4strings_dicts_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
-<div class="section" title="9.3.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2688158"></a>9.3.1. Usage</h4></div></div></div>
-<p id="ch4strings_dicts_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
-<p id="ch4strings_dicts_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
-<p id="ch4strings_dicts_fd"></a>The command-syntax is:</p>
-<pre class="programlisting">$ less [options] file_name</pre>
-</div>
-<div class="section" title="9.3.2. Frequently Used Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2688213"></a>9.3.2. Frequently Used Options</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_ff"></a>-I: Case-insensitive searches.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_103"></a>-?: Shows help.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.3. Frequently Used Commands">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2688266"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_105"></a>[Space bar]: Next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_106"></a>b: Previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_10a"></a>'^ or g: Go to start of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_10b"></a>'$ or G: Go to end of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_10d"></a>=: File information.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_10e"></a>h: Help.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_10f"></a>q: Quit.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.4. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2688357"></a>9.3.4. Examples</h4></div></div></div>
-<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
-$ less +F /var/log/mail.log              #Follow mode for log
-$ file * | less                          #Easier file analysis.
-$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
-</div>
-</div>
-</div>
-<div class="section" title="10. Directory Structure">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2688372"></a>10. Directory Structure</h2></div></div></div>
-<p id="ch4strings_dicts_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
-<p id="ch4strings_dicts_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
-<table summary="Directory Structure" border="1"><colgroup>
-<col width="15">
-<col width="48">
-</colgroup></table>
-<div class="section" title="10.1. man hier">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2688647"></a>10.1. man hier</h3></div></div></div>
-<p id="ch4strings_dicts_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
-<pre class="programlisting">$ man hier</pre>
-</div>
-<div class="section" title="10.2. ls -l">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2688663"></a>10.2. ls -l</h3></div></div></div>
-<p id="ch4strings_dicts_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
-<pre class="programlisting">$ ls -l</pre>
-<p id="ch4strings_dicts_138"></a>This can be done after entering the required directory.</p>
-</div>
-</div>
-<div class="section" title="11. Permissions and Ownership">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2688686"></a>11. Permissions and Ownership</h2></div></div></div>
-<div class="section" title="11.1. chmod">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2688695"></a>11.1. chmod</h3></div></div></div>
-<p id="ch4strings_dicts_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
-<div class="section" title="11.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2688721"></a>11.1.1. Usage</h4></div></div></div>
-<p id="ch4strings_dicts_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
-<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
-<p id="ch4strings_dicts_13b"></a>To view what the permissions currently are, type:</p>
-<pre class="programlisting">$ ls -l file</pre>
-</div>
-<div class="section" title="11.1.2. Command line options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2688749"></a>11.1.2. Command line options</h4></div></div></div>
-<p id="ch4strings_dicts_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch4strings_dicts_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
-</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2688786"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
-<p id="ch4strings_dicts_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
-<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
-<p id="ch4strings_dicts_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="8">
-<col width="45">
-</colgroup></table>
-<p id="ch4strings_dicts_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="54">
-</colgroup></table>
-<p id="ch4strings_dicts_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="5">
-<col width="14">
-<col width="48">
-</colgroup></table>
-<p id="ch4strings_dicts_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
-</div>
-<div class="section" title="11.1.2.2. Symbolic examples">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2689347"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
-<p id="ch4strings_dicts_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
-<pre class="programlisting">$ chmod ug+rw mydir
-$ ls -ld mydir
-drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
-<p id="ch4strings_dicts_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
-<pre class="programlisting">$ chmod a-w myfile
-$ ls -l myfile
--r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
-<p id="ch4strings_dicts_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
-<pre class="programlisting">$ chmod ug=rx mydir
-$ ls -ld mydir
-dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
-</div>
-<div class="section" title="11.1.2.3. Octal numbers">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2689390"></a>11.1.2.3. Octal numbers</h5></div></div></div>
-<p id="ch4strings_dicts_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
-<pre class="programlisting">$ chmod 664 myfile
-$ ls -l myfile
--rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
-<p id="ch4strings_dicts_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
-<pre class="programlisting">$ chmod 0664 myfile</pre>
-</div>
-<div class="section" title="11.1.2.4. Special modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2689428"></a>11.1.2.4. Special modes</h5></div></div></div>
-<p id="ch4strings_dicts_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
-<p id="ch4strings_dicts_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
-</div>
-</div>
-</div>
-</div>
-<div class="section" title="12. Redirection and Piping">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2689472"></a>12. Redirection and Piping</h2></div></div></div>
-<p id="ch4strings_dicts_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
-<p id="ch4strings_dicts_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
-<div class="section" title="12.1. Redirecting standard input and standard output">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2689508"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
-<p id="ch4strings_dicts_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
-<pre class="programlisting">$ command1 &gt; file1</pre>
-<p id="ch4strings_dicts_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
-<pre class="programlisting">$ command1 &lt; file1</pre>
-<p id="ch4strings_dicts_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
-<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
-<p id="ch4strings_dicts_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
-</div>
-<div class="section" title="12.2. Piping">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2689576"></a>12.2. Piping</h3></div></div></div>
-<p id="ch4strings_dicts_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
-A pipeline of three programs run on a text terminal:</p>
-<pre class="programlisting">$ command1 | command2</pre>
-<p id="ch4strings_dicts_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
-<p id="ch4strings_dicts_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
-<pre class="programlisting">$ command1 &gt; tempfile
-$ command2 &lt; tempfile
-$ rm tempfile</pre>
-<p id="ch4strings_dicts_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
-<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
-<p id="ch4strings_dicts_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
-</div>
-<div class="section" title="12.3. Redirecting to and from the standard file handles">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2689638"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
-<p id="ch4strings_dicts_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
-<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
-<col width="12">
-<col width="13">
-<col width="24">
-</colgroup></table>
-<p id="ch4strings_dicts_18d"></a>For example:</p>
-<pre class="programlisting">$ command1 2&gt; file1</pre>
-<p id="ch4strings_dicts_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
-<p id="ch4strings_dicts_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
-<p id="ch4strings_dicts_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
-<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
-<p id="ch4strings_dicts_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
-<p id="ch4strings_dicts_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
-<p id="ch4strings_dicts_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
-<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
-<p id="ch4strings_dicts_194"></a>A simplified form of the command:</p>
-<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
-<p id="ch4strings_dicts_195"></a>is:</p>
-<pre class="programlisting">$ command &amp;&gt;file</pre>
-<p id="ch4strings_dicts_196"></a>or:</p>
-<pre class="programlisting">$command &gt;&amp;file</pre>
-</div>
-<div class="section" title="12.4. Chained pipelines">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2689846"></a>12.4. Chained pipelines</h3></div></div></div>
-<p id="ch4strings_dicts_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
-<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
-<p id="ch4strings_dicts_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
-</div>
-<div class="section" title="12.5. Redirect to multiple outputs">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2689880"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
-<p id="ch4strings_dicts_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
-<pre class="programlisting">$ ls -lrt | tee xyz</pre>
-<p id="ch4strings_dicts_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
-</div>
-</div>
-<div class="section" title="13. More Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2689911"></a>13. More Text Processing</h2></div></div></div>
-<div class="section" title="13.1. grep">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2689920"></a>13.1. grep</h3></div></div></div>
-<p id="ch4strings_dicts_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
-<div class="section" title="13.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2689951"></a>13.1.1. Usage</h4></div></div></div>
-<p id="ch4strings_dicts_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
-<pre class="programlisting">$ grep apple fruitlist.txt</pre>
-<p id="ch4strings_dicts_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
-<p id="ch4strings_dicts_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
-<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
-<p id="ch4strings_dicts_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
-<p id="ch4strings_dicts_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
-<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
-<p id="ch4strings_dicts_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
-<div class="section" title="13.1.1.1. Variations">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2690030"></a>13.1.1.1. Variations</h5></div></div></div>
-<p id="ch4strings_dicts_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
-<p id="ch4strings_dicts_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
-<p id="ch4strings_dicts_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
-</div>
-</div>
-</div>
-<div class="section" title="13.2. tr">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2690110"></a>13.2. tr</h3></div></div></div>
-<p id="ch4strings_dicts_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
-<p id="ch4strings_dicts_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
-<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
-<p id="ch4strings_dicts_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
-<p id="ch4strings_dicts_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
-<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
-<p id="ch4strings_dicts_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
-<p id="ch4strings_dicts_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
-<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
-<p id="ch4strings_dicts_1ab"></a>therefore removes all non-alphanumeric characters.</p>
-<p id="ch4strings_dicts_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
-<pre class="programlisting">$ tr -s '\n' '\n'</pre>
-<p id="ch4strings_dicts_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
-<p id="ch4strings_dicts_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
-<pre class="programlisting">$ tr -d '\r'</pre>
-<p id="ch4strings_dicts_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
-<p id="ch4strings_dicts_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
-</div>
-</div>
-<div class="section" title="14. Elementary Regex">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2690261"></a>14. Elementary Regex</h2></div></div></div>
-<p id="ch4strings_dicts_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
-<p id="ch4strings_dicts_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
-<p id="ch4strings_dicts_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
-<p id="ch4strings_dicts_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
-<table summary="Elementary Regex" border="1"><colgroup>
-<col width="13">
-<col width="60">
-</colgroup></table>
-<div class="section" title="14.1. Lazy quantification">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2690477"></a>14.1. Lazy quantification</h3></div></div></div>
-<p id="ch4strings_dicts_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
-<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
-<p id="ch4strings_dicts_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
-<p id="ch4strings_dicts_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
-</div>
-</div>
-<div class="section" title="15. One Liners">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2690554"></a>15. One Liners</h2></div></div></div>
-<p id="ch4strings_dicts_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
-<p id="ch4strings_dicts_1cd"></a>The one liner can be</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem"><p id="ch4strings_dicts_1ce"></a>An expression written in the language of the shell.</p></li>
-<li class="listitem"><p id="ch4strings_dicts_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
-<li class="listitem"><p id="ch4strings_dicts_1d0"></a>The invocation of a compiler together with source to compile and
-instructions for executing the compiled program.</p></li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_1d1"></a>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.</p>
-<p id="ch4strings_dicts_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
-<p id="ch4strings_dicts_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
-<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
-<p id="ch4strings_dicts_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
-<p id="ch4strings_dicts_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
-<p id="ch4strings_dicts_1d6"></a>Here are the first few of them:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem">
-<p id="ch4strings_dicts_1d7"></a>Print the total number of input lines:</p>
-<p id="ch4strings_dicts_1d8"></a>END { print NR }</p>
-</li>
-<li class="listitem">
-<p id="ch4strings_dicts_1d9"></a>Print the tenth input line:</p>
-<p id="ch4strings_dicts_1da"></a>NR == 10</p>
-</li>
-<li class="listitem">
-<p id="ch4strings_dicts_1db"></a>Print the last field of every input line:</p>
-<p id="ch4strings_dicts_1dc"></a>{ print $NF }</p>
-</li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch4strings_dicts_1dd"></a>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.</p>
-<p id="ch4strings_dicts_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
-<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
-*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
-<p id="ch4strings_dicts_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
-<p id="ch4strings_dicts_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
-<pre class="programlisting">$ prog foo 'f??'; echo $?
-
-$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
-<p id="ch4strings_dicts_1e1"></a>Here is a one line shell script to show directories:</p>
-<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
-</div>
-</div>
-</div></body>
-</html>
--- a/web/html/ch5func.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1138 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Functions</title>
-<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
-<script type="text/javascript" src="/review/support/jquery-min.js"></script>
-<script type="text/javascript" src="/review/support/form.js"></script>
-<script type="text/javascript" src="/review/support/hsbook.js"></script>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch5func ">
-<div class="titlepage"></div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="article"><a href="#id2679232"></a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2489356">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2677051">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2730291">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2730555">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2730682">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2730690">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2730962">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2730971">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2731128">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2731186">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2731284">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2731364">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2731537">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2731546">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2731626">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2731830">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2731920">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2731974">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2731982">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2732293">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2730087">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2732733">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2732826">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2732834">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2732922">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2733049">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2733135">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2733270">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2733377">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2733385">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2733573">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2733687">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2733925">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2734190">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2734206">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2734228">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2734237">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2734996">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2735033">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2735102">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2735162">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2735363">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2735397">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2735427">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2735436">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2735624">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2735772">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2735981">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2736057">15. One Liners</a></span></dt>
-</dl></dd>
-</dl>
-</div>
-<div class="article">
-<div class="titlepage">
-<div><div><h2 class="title" id="id2679232"></a></h2></div></div>
-<hr>
-</div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="section"><a href="#id2489356">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2677051">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2730291">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2730555">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2730682">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2730690">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2730962">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2730971">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2731128">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2731186">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2731284">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2731364">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2731537">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2731546">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2731626">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2731830">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2731920">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2731974">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2731982">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2732293">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2730087">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2732733">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2732826">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2732834">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2732922">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2733049">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2733135">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2733270">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2733377">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2733385">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2733573">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2733687">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2733925">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2734190">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2734206">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2734228">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2734237">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2734996">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2735033">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2735102">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2735162">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2735363">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2735397">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2735427">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2735436">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2735624">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2735772">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2735981">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2736057">15. One Liners</a></span></dt>
-</dl>
-</div>
-<div class="section" title="1. Introducing Linux">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2489356"></a>1. Introducing Linux</h2></div></div></div>
-<p id="ch5func_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
-<p id="ch5func_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
-<p id="ch5func_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
-<p id="ch5func_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
-<div class="section" title="1.1. Historical Background">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2677051"></a>1.1. Historical Background</h3></div></div></div>
-<div class="section" title="1.1.1. Events leading to the creation">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2676925"></a>1.1.1. Events leading to the creation</h4></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch5func_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
-</ul></div>
-</div>
-<div class="section" title="1.1.2. The Creation of Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2730246"></a>1.1.2. The Creation of Linux</h4></div></div></div>
-<p id="ch5func_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
-<p id="ch5func_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
-</div>
-</div>
-<div class="section" title="1.2. Design and Implications">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2730291"></a>1.2. Design and Implications</h3></div></div></div>
-<p id="ch5func_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
-<div class="section" title="1.2.1. User Interface">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2730315"></a>1.2.1. User Interface</h4></div></div></div>
-<p id="ch5func_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
-<p id="ch5func_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
-</div>
-<div class="section" title="1.2.2. Development">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2730367"></a>1.2.2. Development</h4></div></div></div>
-<p id="ch5func_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
-<p id="ch5func_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
-<p id="ch5func_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
-</div>
-<div class="section" title="1.2.3. Community">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2730422"></a>1.2.3. Community</h4></div></div></div>
-<p id="ch5func_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
-<p id="ch5func_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
-<p id="ch5func_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
-</div>
-<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2730466"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
-<p id="ch5func_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
-</div>
-<div class="section" title="1.2.5. Programming on Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2730511"></a>1.2.5. Programming on Linux</h4></div></div></div>
-<p id="ch5func_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
-<p id="ch5func_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
-<p id="ch5func_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
-</div>
-</div>
-<div class="section" title="1.3. Reasons for Using Linux">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2730555"></a>1.3. Reasons for Using Linux</h3></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch5func_16"></a>Linux is free:</p></li></ul></div>
-<p id="ch5func_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
-Most of all, Linux is free as in "free speech":
-The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch5func_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
-<p id="ch5func_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch5func_1a"></a>Linux was made to keep on running:</p></li></ul></div>
-<p id="ch5func_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch5func_1c"></a>Linux is secure and versatile:</p></li></ul></div>
-<p id="ch5func_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch5func_1e"></a>Linux is scalable:</p></li></ul></div>
-<p id="ch5func_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch5func_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
-<p id="ch5func_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
-</div>
-</div>
-<div class="section" title="2. Getting Started">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2730682"></a>2. Getting Started</h2></div></div></div>
-<div class="section" title="2.1. Logging in, activating the user interface and logging out">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2730690"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
-<p id="ch5func_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
-<div class="section" title="2.1.1. Graphical Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2730720"></a>2.1.1. Graphical Mode</h4></div></div></div>
-<p id="ch5func_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
-<p id="ch5func_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
-It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
-<p id="ch5func_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
-<p id="ch5func_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
-<p id="ch5func_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
-<p id="ch5func_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
-<p id="ch5func_29"></a>Another common form for a prompt is this one:
-[</p>
-<div class="reference">
-<div class="titlepage"><hr></div>user@host</div>
-<p> dir]</p>
-<p id="ch5func_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
-<p id="ch5func_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
-</div>
-<div class="section" title="2.1.2. Text Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2730875"></a>2.1.2. Text Mode</h4></div></div></div>
-<p id="ch5func_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
-<p id="ch5func_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
-reasons.</p>
-<p id="ch5func_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
-<p id="ch5func_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
-<p id="ch5func_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
-</div>
-</div>
-</div>
-<div class="section" title="3. Basic Commands">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2730962"></a>3. Basic Commands</h2></div></div></div>
-<div class="section" title="3.1. ls">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2730971"></a>3.1. ls</h3></div></div></div>
-<p id="ch5func_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
-<p id="ch5func_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
-<p id="ch5func_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch5func_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch5func_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
-<pre class="programlisting">$ ls
-jeeves.rst psmith.html blandings.html
-$ ls -l
-drwxr--r--   1 plum  editors   4096  jeeves
--rw-r--r--   1 plum  editors  30405  psmith
--r-xr-xr-x   1 plum  plum      8460  blandings</pre>
-<p id="ch5func_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
-</div>
-<div class="section" title="3.2. date">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2731128"></a>3.2. date</h3></div></div></div>
-<p id="ch5func_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
-<p id="ch5func_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
-<pre class="programlisting">$date
-Tue Sep  8 12:01:45 IST 2009</pre>
-<p id="ch5func_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
-<pre class="programlisting">$date --set="20040908 01:22"</pre>
-<p id="ch5func_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
-<pre class="programlisting">$man date</pre>
-<p id="ch5func_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
-</div>
-<div class="section" title="3.3. cd">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2731186"></a>3.3. cd</h3></div></div></div>
-<p id="ch5func_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
-<p id="ch5func_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
-<p id="ch5func_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
-<p id="ch5func_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
-<p id="ch5func_46"></a>Absolute paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch5func_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch5func_48"></a>For example to get to /boot/grub you would type:</p>
-<pre class="programlisting">$cd /boot/grub</pre>
-<p id="ch5func_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
-<p id="ch5func_4a"></a>Relative paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch5func_4b"></a>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.</p>
-<p id="ch5func_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
-<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch5func_4d"></a>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.</p>
-</div>
-<div class="section" title="3.4. who">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2731284"></a>3.4. who</h3></div></div></div>
-<p id="ch5func_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
-<p id="ch5func_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
-<pre class="programlisting">$who
-beeblebrox tty7         2009-09-08 10:50 (:0)
-beeblebrox pts/0        2009-09-08 11:25 (:0.0)
-dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
-beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
-<p id="ch5func_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
-<p id="ch5func_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
-<pre class="programlisting">$man who</pre>
-<p id="ch5func_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
-</div>
-<div class="section" title="3.5. mkdir">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2731364"></a>3.5. mkdir</h3></div></div></div>
-<p id="ch5func_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
-<pre class="programlisting">$mkdir name_of_directory</pre>
-<p id="ch5func_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
-<div class="section" title="3.5.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2731395"></a>3.5.1. Options</h4></div></div></div>
-<p id="ch5func_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch5func_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch5func_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
-</div>
-<div class="section" title="3.5.2. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2731454"></a>3.5.2. Examples</h4></div></div></div>
-<p id="ch5func_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
-<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
-<p id="ch5func_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
-<p id="ch5func_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
-<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
-<p id="ch5func_5d"></a>This will create:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch5func_5e"></a>tag</p></li>
-<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch5func_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
-</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
-</div>
-</div>
-</div>
-<div class="section" title="4. Getting Help">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2731537"></a>4. Getting Help</h2></div></div></div>
-<div class="section" title="4.1. apropos and whatis">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2731546"></a>4.1. apropos and whatis</h3></div></div></div>
-<p id="ch5func_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
-<pre class="programlisting">$ apropos grep
-egrep       egrep (1)       Search a file for a pattern using full regular expressions
-fgrep       fgrep (1)       Search a file for a fixed-character string
-fmlgrep     fmlgrep (1)     Search a file for a pattern
-grep        grep (1)        Search a file for a pattern
-gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
-nisgrep     nismatch (1)    Utilities for searching NIS+ tables
-pgrep       pgrep (1)       Find or signal a process by name or other attribute
-zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
-...</pre>
-<p id="ch5func_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
-<p id="ch5func_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
-<pre class="programlisting">$whatis ls
-ls (1)           - list directory contents</pre>
-<p id="ch5func_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
-<p id="ch5func_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
-<pre class="programlisting">$apropos browser
-gmusicbrowser (1)    - Jukebox for large collections of audio files
-infobrowser (1)      - read Info documents
-libsmbclient (7)     - An extension library for browsers and that               can be used...
-opera (1)            - a standards-compliant graphical Web browser
-sensible-browser (1) - sensible editing, paging, and web browsing
-smbtree (1)          - A text based smb network browser
-tvtk_doc (1)         - A GUI based TVTK documentation search browser.
-viewres (1)          - graphical class browser for Xt
-w3m (1)              - a text based Web browser and pager
-www-browser (1)      - a text based Web browser and pager
-...</pre>
-</div>
-<div class="section" title="4.2. man">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2731626"></a>4.2. man</h3></div></div></div>
-<p id="ch5func_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
-<p id="ch5func_66"></a>To read a manual page for a Unix command, one can use:</p>
-<pre class="programlisting">$ man &lt;command_name&gt;</pre>
-<p id="ch5func_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
-<p id="ch5func_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
-<pre class="programlisting">$man 3 printf</pre>
-<p id="ch5func_69"></a>Another example:</p>
-<pre class="programlisting">$man man</pre>
-<p id="ch5func_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
-<div class="section" title="4.2.1. Layout">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2731706"></a>4.2.1. Layout</h4></div></div></div>
-<p id="ch5func_6b"></a>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:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch5func_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch5func_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch5func_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch5func_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch5func_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch5func_71"></a>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.</p>
-<p id="ch5func_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
-<p id="ch5func_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
-<p id="ch5func_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
-<p id="ch5func_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
-<p id="ch5func_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
-</div>
-</div>
-<div class="section" title="4.3. info">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2731830"></a>4.3. info</h3></div></div></div>
-<p id="ch5func_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
-<p id="ch5func_78"></a>The syntax is</p>
-<pre class="programlisting">$ info &lt;command_name&gt;</pre>
-<p id="ch5func_79"></a><span class="emphasis"><em>info</em></span> 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</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch5func_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch5func_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
-</div>
-<div class="section" title="4.4. --help">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2731920"></a>4.4. --help</h3></div></div></div>
-<p id="ch5func_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
-<pre class="programlisting">$ userprompt@host: cat --help
-Usage: cat [OPTION] [FILE]...
-Concatenate FILE(s), or standard input, to standard output.
-
-  -A, --show-all           equivalent to -vET
-  -b, --number-nonblank    number nonempty output lines
-  -e                       equivalent to -vE
-  -E, --show-ends          display $ at end of each line
-  -n, --number             number all output lines
-  -s, --squeeze-blank      suppress repeated empty output lines
-  -t                       equivalent to -vT
-  -T, --show-tabs          display TAB characters as ^I
-  -u                       (ignored)
-  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
-  --help     display this help and exit
-  --version  output version information and exit
-
-With no FILE, or when FILE is -, read standard input.
-
-Examples:
-  cat f - g  Output f's contents, then standard input, then g's           contents.
-  cat        Copy standard input to standard output.
-
-Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
-</div>
-</div>
-<div class="section" title="5. Basic file handling">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2731974"></a>5. Basic file handling</h2></div></div></div>
-<div class="section" title="5.1. cp">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2731982"></a>5.1. cp</h3></div></div></div>
-<p id="ch5func_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
-<div class="section" title="5.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2732000"></a>5.1.1. Usage</h4></div></div></div>
-<p id="ch5func_82"></a>To copy a file to another file:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
-<p id="ch5func_83"></a>To copy a file to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
-<p id="ch5func_84"></a>To copy a directory to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
-SourceDirectory ... TargetDirectory</pre>
-</div>
-<div class="section" title="5.1.2. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2732034"></a>5.1.2. Flags</h4></div></div></div>
-<p id="ch5func_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
-<p id="ch5func_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
-<p id="ch5func_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
-<p id="ch5func_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch5func_89"></a>The time of the last data modification and the time of the last access.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch5func_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
-</div>
-<div class="section" title="5.1.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2732132"></a>5.1.3. Examples</h4></div></div></div>
-<p id="ch5func_8d"></a>To make a copy of a file in the current directory, enter:</p>
-<pre class="programlisting">$ cp prog.c prog.bak</pre>
-<p id="ch5func_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
-<p id="ch5func_8f"></a>To copy a file in your current directory into another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
-<p id="ch5func_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
-<p id="ch5func_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
-<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
-<p id="ch5func_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
-<p id="ch5func_93"></a>To copy all the files in a directory to a new directory, enter:</p>
-<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
-<p id="ch5func_94"></a>This copies only the files in the clients directory to the customers directory.</p>
-<p id="ch5func_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch5func_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch5func_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
-<p id="ch5func_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
-<p id="ch5func_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
-<p id="ch5func_9a"></a>To use pattern-matching characters to copy files, enter:</p>
-<pre class="programlisting">$ cp programs/*.py .</pre>
-<p id="ch5func_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
-</div>
-</div>
-<div class="section" title="5.2. mv">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2732293"></a>5.2. mv</h3></div></div></div>
-<p id="ch5func_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
-<div class="section" title="5.2.1. Conflicting existing file">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2732317"></a>5.2.1. Conflicting existing file</h4></div></div></div>
-<p id="ch5func_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
-</div>
-<div class="section" title="5.2.2. Differences with copy and delete">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2732336"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
-<p id="ch5func_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
-</div>
-<div class="section" title="5.2.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2730028"></a>5.2.3. Examples</h4></div></div></div>
-<pre class="programlisting">$ mv myfile mynewfilename    renames a file
-$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
-$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
-$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
-$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
-$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
-$ mv foo bar baz dir         moves multiple files to directory dir
-$ mv --help                  shows a very concise help about the                syntax of the command
-$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
-<p id="ch5func_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
-<p id="ch5func_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
-</div>
-</div>
-<div class="section" title="5.3. rm">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2730087"></a>5.3. rm</h3></div></div></div>
-<p id="ch5func_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
-<p id="ch5func_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
-<pre class="programlisting">$ rm -i foo
-remove foo? y</pre>
-<div class="section" title="5.3.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2730116"></a>5.3.1. Options</h4></div></div></div>
-<p id="ch5func_a3"></a>Common options that rm accepts include:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch5func_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch5func_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
-<p id="ch5func_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
-<p id="ch5func_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
-<pre class="programlisting">xargs rm &lt; filelist</pre>
-<p id="ch5func_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
-</div>
-<div class="section" title="5.3.2. Permissions">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2732693"></a>5.3.2. Permissions</h4></div></div></div>
-<p id="ch5func_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
-<p id="ch5func_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
-<p id="ch5func_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
-</div>
-</div>
-</div>
-<div class="section" title="6. Command Line Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2732733"></a>6. Command Line Arguments</h2></div></div></div>
-<p id="ch5func_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
-<p id="ch5func_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
-<pre class="programlisting">rm file.s</pre>
-<p id="ch5func_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
-<p id="ch5func_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
-<p id="ch5func_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
-<p id="ch5func_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
-<p id="ch5func_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
-</div>
-<div class="section" title="7. Basic Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2732826"></a>7. Basic Text Processing</h2></div></div></div>
-<div class="section" title="7.1. head">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2732834"></a>7.1. head</h3></div></div></div>
-<p id="ch5func_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
-<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
-<p id="ch5func_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
-<pre class="programlisting">$ head -n 20 filename</pre>
-<p id="ch5func_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ head -n 5 foo*</pre>
-<p id="ch5func_b9"></a>Some versions omit the n and just let you say -5.</p>
-<div class="section" title="7.1.1. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2732886"></a>7.1.1. Flags</h4></div></div></div>
-<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
-<p id="ch5func_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
-<p id="ch5func_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
-<pre class="programlisting">sed 5q foo</pre>
-<p id="ch5func_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
-</div>
-</div>
-<div class="section" title="7.2. tail">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2732922"></a>7.2. tail</h3></div></div></div>
-<p id="ch5func_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
-<p id="ch5func_be"></a>The command-syntax is:</p>
-<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
-<p id="ch5func_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
-<pre class="programlisting">$ tail -n 20 filename</pre>
-<p id="ch5func_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ tail -c 15 foo*</pre>
-<p id="ch5func_c1"></a>This example shows all lines of filename from the second line onwards:</p>
-<pre class="programlisting">$ tail -n +2 filename</pre>
-<p id="ch5func_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
-<pre class="programlisting">$ tail -20 filename
-$ tail -50c filename</pre>
-<p id="ch5func_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
-<div class="section" title="7.2.1. File monitoring">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2733000"></a>7.2.1. File monitoring</h4></div></div></div>
-<p id="ch5func_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
-<pre class="programlisting">$ tail -f /var/adm/messages</pre>
-<p id="ch5func_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
-<p id="ch5func_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
-</div>
-</div>
-<div class="section" title="7.3. cut">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2733049"></a>7.3. cut</h3></div></div></div>
-<p id="ch5func_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
-<p id="ch5func_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
-<p id="ch5func_c9"></a>Assuming a file named file containing the lines:</p>
-<pre class="programlisting">foo:bar:baz:qux:quux
-one:two:three:four:five:six:seven
-alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-<p id="ch5func_ca"></a>To output the fourth through tenth characters of each line:</p>
-<pre class="programlisting">$ cut -c 4-10 file</pre>
-<p id="ch5func_cb"></a>This gives the output:</p>
-<pre class="programlisting">:bar:ba
-:two:th
-ha:beta</pre>
-<p id="ch5func_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
-<pre class="programlisting">$ cut -d : -f 5- file</pre>
-<p id="ch5func_cd"></a>This gives the output:</p>
-<pre class="programlisting">quux
-five:six:seven
-epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-</div>
-<div class="section" title="7.4. paste">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2733135"></a>7.4. paste</h3></div></div></div>
-<p id="ch5func_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
-<p id="ch5func_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
-<pre class="programlisting">$ paste who where when &gt; www</pre>
-<p id="ch5func_d0"></a>If the files contain:</p>
-<table summary="paste" border="1"><colgroup>
-<col width="11">
-<col width="12">
-<col width="12">
-</colgroup></table>
-<p id="ch5func_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
-<pre class="programlisting">Batman            GothamCity       January 3
-Trillian          Andromeda        February 4
-Jeeves            London           March 19</pre>
-</div>
-</div>
-<div class="section" title="8. Shell Meta Characters">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2733270"></a>8. Shell Meta Characters</h2></div></div></div>
-<p id="ch5func_de"></a>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.</p>
-<p id="ch5func_df"></a>The shell meta characters include:</p>
-<p id="ch5func_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
-<p id="ch5func_e1"></a>Different shells may differ in the meta characters recognized.</p>
-<p id="ch5func_e2"></a>As an example,</p>
-<pre class="programlisting">$ ls file.*</pre>
-<p id="ch5func_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
-<pre class="programlisting">$ ls file.?</pre>
-<p id="ch5func_e4"></a>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:</p>
-<pre class="programlisting">$ more c*</pre>
-<p id="ch5func_e5"></a>because the c* matches that long file name.</p>
-<p id="ch5func_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
-<pre class="programlisting">$ rm ??more</pre>
-<p id="ch5func_e7"></a>or:</p>
-<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
-<p id="ch5func_e8"></a>or:</p>
-<pre class="programlisting">$ rm ''*|more''</pre>
-</div>
-<div class="section" title="9. Looking At Files">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2733377"></a>9. Looking At Files</h2></div></div></div>
-<div class="section" title="9.1. cat">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2733385"></a>9.1. cat</h3></div></div></div>
-<p id="ch5func_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
-<p id="ch5func_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
-<p id="ch5func_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
-<div class="section" title="9.1.1. Jargon File Definition">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2733428"></a>9.1.1. Jargon File Definition</h4></div></div></div>
-<p id="ch5func_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
-<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
-     pause (syn. blast).
-
-2. By extension, to dump large amounts of data at an unprepared target or
-     with no intention of browsing it carefully. Usage: considered silly.
-     Rare outside Unix sites. See also dd, BLT.
-
-     Among Unix fans, *cat(1)* is considered an excellent example of
-     user-interface design, because it delivers the file contents without
-     such verbosity as spacing or headers between the files, and because
-     it does not require the files to consist of lines of text, but works
-     with any sort of data.
-
-     Among Unix critics, *cat(1)* is considered the canonical example of
-     bad user-interface design, because of its woefully unobvious name.
-     It is far more often used to blast a single file to standard output
-     than to concatenate two or more files. The name cat for the former
-     operation is just as unintuitive as, say, LISP's cdr.
-
-     Of such oppositions are holy wars made...</pre>
-</div>
-<div class="section" title="9.1.2. Useless Use of 'cat'">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2733467"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
-<p id="ch5func_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
-<p id="ch5func_ee"></a>Nevertheless one sees people doing:</p>
-<pre class="programlisting">$ cat file | some_command and its args ...</pre>
-<p id="ch5func_ef"></a>instead of the equivalent and cheaper:</p>
-<pre class="programlisting">&lt;file some_command and its args ...</pre>
-<p id="ch5func_f0"></a>or (equivalently and more classically):</p>
-<pre class="programlisting">some_command and its args ... &lt;file</pre>
-<p id="ch5func_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
-<p id="ch5func_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
-</div>
-<div class="section" title="9.1.3. zcat">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2733537"></a>9.1.3. zcat</h4></div></div></div>
-<p id="ch5func_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
-</div>
-</div>
-<div class="section" title="9.2. more">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2733573"></a>9.2. more</h3></div></div></div>
-<p id="ch5func_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
-<div class="section" title="9.2.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2733593"></a>9.2.1. Usage</h4></div></div></div>
-<p id="ch5func_f5"></a>The command-syntax is:</p>
-<pre class="programlisting">$ more [options] [file_name]</pre>
-<p id="ch5func_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
-<p id="ch5func_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
-<p id="ch5func_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
-<p id="ch5func_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
-</div>
-</div>
-<div class="section" title="9.3. less">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2733687"></a>9.3. less</h3></div></div></div>
-<p id="ch5func_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
-<div class="section" title="9.3.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2733716"></a>9.3.1. Usage</h4></div></div></div>
-<p id="ch5func_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
-<p id="ch5func_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
-<p id="ch5func_fd"></a>The command-syntax is:</p>
-<pre class="programlisting">$ less [options] file_name</pre>
-</div>
-<div class="section" title="9.3.2. Frequently Used Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2733770"></a>9.3.2. Frequently Used Options</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch5func_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_ff"></a>-I: Case-insensitive searches.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_103"></a>-?: Shows help.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.3. Frequently Used Commands">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2733822"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch5func_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_105"></a>[Space bar]: Next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_106"></a>b: Previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_10a"></a>'^ or g: Go to start of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_10b"></a>'$ or G: Go to end of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_10d"></a>=: File information.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_10e"></a>h: Help.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_10f"></a>q: Quit.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.4. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2733910"></a>9.3.4. Examples</h4></div></div></div>
-<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
-$ less +F /var/log/mail.log              #Follow mode for log
-$ file * | less                          #Easier file analysis.
-$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
-</div>
-</div>
-</div>
-<div class="section" title="10. Directory Structure">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2733925"></a>10. Directory Structure</h2></div></div></div>
-<p id="ch5func_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
-<p id="ch5func_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
-<table summary="Directory Structure" border="1"><colgroup>
-<col width="15">
-<col width="48">
-</colgroup></table>
-<div class="section" title="10.1. man hier">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2734190"></a>10.1. man hier</h3></div></div></div>
-<p id="ch5func_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
-<pre class="programlisting">$ man hier</pre>
-</div>
-<div class="section" title="10.2. ls -l">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2734206"></a>10.2. ls -l</h3></div></div></div>
-<p id="ch5func_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
-<pre class="programlisting">$ ls -l</pre>
-<p id="ch5func_138"></a>This can be done after entering the required directory.</p>
-</div>
-</div>
-<div class="section" title="11. Permissions and Ownership">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2734228"></a>11. Permissions and Ownership</h2></div></div></div>
-<div class="section" title="11.1. chmod">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2734237"></a>11.1. chmod</h3></div></div></div>
-<p id="ch5func_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
-<div class="section" title="11.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2734263"></a>11.1.1. Usage</h4></div></div></div>
-<p id="ch5func_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
-<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
-<p id="ch5func_13b"></a>To view what the permissions currently are, type:</p>
-<pre class="programlisting">$ ls -l file</pre>
-</div>
-<div class="section" title="11.1.2. Command line options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2734290"></a>11.1.2. Command line options</h4></div></div></div>
-<p id="ch5func_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch5func_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch5func_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
-</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2734326"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
-<p id="ch5func_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
-<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
-<p id="ch5func_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="8">
-<col width="45">
-</colgroup></table>
-<p id="ch5func_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="54">
-</colgroup></table>
-<p id="ch5func_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="5">
-<col width="14">
-<col width="48">
-</colgroup></table>
-<p id="ch5func_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
-</div>
-<div class="section" title="11.1.2.2. Symbolic examples">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2734874"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
-<p id="ch5func_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
-<pre class="programlisting">$ chmod ug+rw mydir
-$ ls -ld mydir
-drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
-<p id="ch5func_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
-<pre class="programlisting">$ chmod a-w myfile
-$ ls -l myfile
--r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
-<p id="ch5func_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
-<pre class="programlisting">$ chmod ug=rx mydir
-$ ls -ld mydir
-dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
-</div>
-<div class="section" title="11.1.2.3. Octal numbers">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2734915"></a>11.1.2.3. Octal numbers</h5></div></div></div>
-<p id="ch5func_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
-<pre class="programlisting">$ chmod 664 myfile
-$ ls -l myfile
--rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
-<p id="ch5func_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
-<pre class="programlisting">$ chmod 0664 myfile</pre>
-</div>
-<div class="section" title="11.1.2.4. Special modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2734953"></a>11.1.2.4. Special modes</h5></div></div></div>
-<p id="ch5func_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
-<p id="ch5func_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
-</div>
-</div>
-</div>
-</div>
-<div class="section" title="12. Redirection and Piping">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2734996"></a>12. Redirection and Piping</h2></div></div></div>
-<p id="ch5func_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
-<p id="ch5func_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
-<div class="section" title="12.1. Redirecting standard input and standard output">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2735033"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
-<p id="ch5func_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
-<pre class="programlisting">$ command1 &gt; file1</pre>
-<p id="ch5func_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
-<pre class="programlisting">$ command1 &lt; file1</pre>
-<p id="ch5func_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
-<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
-<p id="ch5func_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
-</div>
-<div class="section" title="12.2. Piping">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2735102"></a>12.2. Piping</h3></div></div></div>
-<p id="ch5func_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
-A pipeline of three programs run on a text terminal:</p>
-<pre class="programlisting">$ command1 | command2</pre>
-<p id="ch5func_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
-<p id="ch5func_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
-<pre class="programlisting">$ command1 &gt; tempfile
-$ command2 &lt; tempfile
-$ rm tempfile</pre>
-<p id="ch5func_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
-<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
-<p id="ch5func_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
-</div>
-<div class="section" title="12.3. Redirecting to and from the standard file handles">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2735162"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
-<p id="ch5func_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
-<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
-<col width="12">
-<col width="13">
-<col width="24">
-</colgroup></table>
-<p id="ch5func_18d"></a>For example:</p>
-<pre class="programlisting">$ command1 2&gt; file1</pre>
-<p id="ch5func_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
-<p id="ch5func_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
-<p id="ch5func_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
-<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
-<p id="ch5func_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
-<p id="ch5func_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
-<p id="ch5func_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
-<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
-<p id="ch5func_194"></a>A simplified form of the command:</p>
-<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
-<p id="ch5func_195"></a>is:</p>
-<pre class="programlisting">$ command &amp;&gt;file</pre>
-<p id="ch5func_196"></a>or:</p>
-<pre class="programlisting">$command &gt;&amp;file</pre>
-</div>
-<div class="section" title="12.4. Chained pipelines">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2735363"></a>12.4. Chained pipelines</h3></div></div></div>
-<p id="ch5func_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
-<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
-<p id="ch5func_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
-</div>
-<div class="section" title="12.5. Redirect to multiple outputs">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2735397"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
-<p id="ch5func_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
-<pre class="programlisting">$ ls -lrt | tee xyz</pre>
-<p id="ch5func_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
-</div>
-</div>
-<div class="section" title="13. More Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2735427"></a>13. More Text Processing</h2></div></div></div>
-<div class="section" title="13.1. grep">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2735436"></a>13.1. grep</h3></div></div></div>
-<p id="ch5func_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
-<div class="section" title="13.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2735467"></a>13.1.1. Usage</h4></div></div></div>
-<p id="ch5func_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
-<pre class="programlisting">$ grep apple fruitlist.txt</pre>
-<p id="ch5func_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
-<p id="ch5func_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
-<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
-<p id="ch5func_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
-<p id="ch5func_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
-<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
-<p id="ch5func_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
-<div class="section" title="13.1.1.1. Variations">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2735545"></a>13.1.1.1. Variations</h5></div></div></div>
-<p id="ch5func_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
-<p id="ch5func_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
-<p id="ch5func_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
-</div>
-</div>
-</div>
-<div class="section" title="13.2. tr">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2735624"></a>13.2. tr</h3></div></div></div>
-<p id="ch5func_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
-<p id="ch5func_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
-<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
-<p id="ch5func_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
-<p id="ch5func_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
-<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
-<p id="ch5func_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
-<p id="ch5func_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
-<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
-<p id="ch5func_1ab"></a>therefore removes all non-alphanumeric characters.</p>
-<p id="ch5func_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
-<pre class="programlisting">$ tr -s '\n' '\n'</pre>
-<p id="ch5func_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
-<p id="ch5func_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
-<pre class="programlisting">$ tr -d '\r'</pre>
-<p id="ch5func_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
-<p id="ch5func_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
-</div>
-</div>
-<div class="section" title="14. Elementary Regex">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2735772"></a>14. Elementary Regex</h2></div></div></div>
-<p id="ch5func_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
-<p id="ch5func_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
-<p id="ch5func_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
-<p id="ch5func_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
-<table summary="Elementary Regex" border="1"><colgroup>
-<col width="13">
-<col width="60">
-</colgroup></table>
-<div class="section" title="14.1. Lazy quantification">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2735981"></a>14.1. Lazy quantification</h3></div></div></div>
-<p id="ch5func_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
-<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
-<p id="ch5func_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
-<p id="ch5func_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
-</div>
-</div>
-<div class="section" title="15. One Liners">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2736057"></a>15. One Liners</h2></div></div></div>
-<p id="ch5func_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
-<p id="ch5func_1cd"></a>The one liner can be</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem"><p id="ch5func_1ce"></a>An expression written in the language of the shell.</p></li>
-<li class="listitem"><p id="ch5func_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
-<li class="listitem"><p id="ch5func_1d0"></a>The invocation of a compiler together with source to compile and
-instructions for executing the compiled program.</p></li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch5func_1d1"></a>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.</p>
-<p id="ch5func_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
-<p id="ch5func_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
-<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
-<p id="ch5func_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
-<p id="ch5func_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
-<p id="ch5func_1d6"></a>Here are the first few of them:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem">
-<p id="ch5func_1d7"></a>Print the total number of input lines:</p>
-<p id="ch5func_1d8"></a>END { print NR }</p>
-</li>
-<li class="listitem">
-<p id="ch5func_1d9"></a>Print the tenth input line:</p>
-<p id="ch5func_1da"></a>NR == 10</p>
-</li>
-<li class="listitem">
-<p id="ch5func_1db"></a>Print the last field of every input line:</p>
-<p id="ch5func_1dc"></a>{ print $NF }</p>
-</li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch5func_1dd"></a>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.</p>
-<p id="ch5func_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
-<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
-*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
-<p id="ch5func_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
-<p id="ch5func_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
-<pre class="programlisting">$ prog foo 'f??'; echo $?
-
-$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
-<p id="ch5func_1e1"></a>Here is a one line shell script to show directories:</p>
-<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
-</div>
-</div>
-</div></body>
-</html>
--- a/web/html/ch6oop.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1138 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Strings and Dicts </title>
-<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
-<script type="text/javascript" src="/review/support/jquery-min.js"></script>
-<script type="text/javascript" src="/review/support/form.js"></script>
-<script type="text/javascript" src="/review/support/hsbook.js"></script>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch6op">
-<div class="titlepage"></div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="article"><a href="#id2674385"></a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2484509">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2672204">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2725444">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2725708">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2725835">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2725844">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2726115">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2726124">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2726281">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2726339">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2726437">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2726517">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2726690">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2726699">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2726779">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2726983">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2727073">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2727127">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2727136">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2727446">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2725240">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2727886">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2727979">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2727988">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2728075">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2728202">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2728288">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2728423">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2728530">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2728538">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2728726">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2728840">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2729078">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2729343">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2729359">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2729381">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2729390">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2730149">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2730186">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2730255">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2730315">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2730516">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2730550">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2730580">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2730589">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2730777">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2730925">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2731134">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2731210">15. One Liners</a></span></dt>
-</dl></dd>
-</dl>
-</div>
-<div class="article">
-<div class="titlepage">
-<div><div><h2 class="title" id="id2674385"></a></h2></div></div>
-<hr>
-</div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="section"><a href="#id2484509">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2672204">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2725444">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2725708">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2725835">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2725844">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2726115">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2726124">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2726281">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2726339">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2726437">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2726517">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2726690">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2726699">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2726779">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2726983">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2727073">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2727127">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2727136">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2727446">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2725240">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2727886">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2727979">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2727988">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2728075">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2728202">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2728288">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2728423">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2728530">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2728538">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2728726">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2728840">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2729078">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2729343">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2729359">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2729381">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2729390">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2730149">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2730186">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2730255">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2730315">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2730516">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2730550">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2730580">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2730589">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2730777">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2730925">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2731134">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2731210">15. One Liners</a></span></dt>
-</dl>
-</div>
-<div class="section" title="1. Introducing Linux">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2484509"></a>1. Introducing Linux</h2></div></div></div>
-<p id="ch6oop_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
-<p id="ch6oop_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
-<p id="ch6oop_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
-<p id="ch6oop_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
-<div class="section" title="1.1. Historical Background">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2672204"></a>1.1. Historical Background</h3></div></div></div>
-<div class="section" title="1.1.1. Events leading to the creation">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2672078"></a>1.1.1. Events leading to the creation</h4></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
-</ul></div>
-</div>
-<div class="section" title="1.1.2. The Creation of Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2725399"></a>1.1.2. The Creation of Linux</h4></div></div></div>
-<p id="ch6oop_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
-<p id="ch6oop_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
-</div>
-</div>
-<div class="section" title="1.2. Design and Implications">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2725444"></a>1.2. Design and Implications</h3></div></div></div>
-<p id="ch6oop_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
-<div class="section" title="1.2.1. User Interface">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2725468"></a>1.2.1. User Interface</h4></div></div></div>
-<p id="ch6oop_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
-<p id="ch6oop_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
-</div>
-<div class="section" title="1.2.2. Development">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2725520"></a>1.2.2. Development</h4></div></div></div>
-<p id="ch6oop_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
-<p id="ch6oop_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
-<p id="ch6oop_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
-</div>
-<div class="section" title="1.2.3. Community">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2725575"></a>1.2.3. Community</h4></div></div></div>
-<p id="ch6oop_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
-<p id="ch6oop_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
-<p id="ch6oop_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
-</div>
-<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2725619"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
-<p id="ch6oop_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
-</div>
-<div class="section" title="1.2.5. Programming on Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2725664"></a>1.2.5. Programming on Linux</h4></div></div></div>
-<p id="ch6oop_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
-<p id="ch6oop_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
-<p id="ch6oop_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
-</div>
-</div>
-<div class="section" title="1.3. Reasons for Using Linux">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2725708"></a>1.3. Reasons for Using Linux</h3></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch6oop_16"></a>Linux is free:</p></li></ul></div>
-<p id="ch6oop_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
-Most of all, Linux is free as in "free speech":
-The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch6oop_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
-<p id="ch6oop_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch6oop_1a"></a>Linux was made to keep on running:</p></li></ul></div>
-<p id="ch6oop_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch6oop_1c"></a>Linux is secure and versatile:</p></li></ul></div>
-<p id="ch6oop_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch6oop_1e"></a>Linux is scalable:</p></li></ul></div>
-<p id="ch6oop_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch6oop_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
-<p id="ch6oop_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
-</div>
-</div>
-<div class="section" title="2. Getting Started">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2725835"></a>2. Getting Started</h2></div></div></div>
-<div class="section" title="2.1. Logging in, activating the user interface and logging out">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2725844"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
-<p id="ch6oop_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
-<div class="section" title="2.1.1. Graphical Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2725874"></a>2.1.1. Graphical Mode</h4></div></div></div>
-<p id="ch6oop_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
-<p id="ch6oop_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
-It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
-<p id="ch6oop_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
-<p id="ch6oop_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
-<p id="ch6oop_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
-<p id="ch6oop_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
-<p id="ch6oop_29"></a>Another common form for a prompt is this one:
-[</p>
-<div class="reference">
-<div class="titlepage"><hr></div>user@host</div>
-<p> dir]</p>
-<p id="ch6oop_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
-<p id="ch6oop_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
-</div>
-<div class="section" title="2.1.2. Text Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2726028"></a>2.1.2. Text Mode</h4></div></div></div>
-<p id="ch6oop_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
-<p id="ch6oop_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
-reasons.</p>
-<p id="ch6oop_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
-<p id="ch6oop_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
-<p id="ch6oop_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
-</div>
-</div>
-</div>
-<div class="section" title="3. Basic Commands">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2726115"></a>3. Basic Commands</h2></div></div></div>
-<div class="section" title="3.1. ls">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2726124"></a>3.1. ls</h3></div></div></div>
-<p id="ch6oop_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
-<p id="ch6oop_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
-<p id="ch6oop_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch6oop_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
-<pre class="programlisting">$ ls
-jeeves.rst psmith.html blandings.html
-$ ls -l
-drwxr--r--   1 plum  editors   4096  jeeves
--rw-r--r--   1 plum  editors  30405  psmith
--r-xr-xr-x   1 plum  plum      8460  blandings</pre>
-<p id="ch6oop_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
-</div>
-<div class="section" title="3.2. date">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2726281"></a>3.2. date</h3></div></div></div>
-<p id="ch6oop_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
-<p id="ch6oop_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
-<pre class="programlisting">$date
-Tue Sep  8 12:01:45 IST 2009</pre>
-<p id="ch6oop_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
-<pre class="programlisting">$date --set="20040908 01:22"</pre>
-<p id="ch6oop_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
-<pre class="programlisting">$man date</pre>
-<p id="ch6oop_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
-</div>
-<div class="section" title="3.3. cd">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2726339"></a>3.3. cd</h3></div></div></div>
-<p id="ch6oop_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
-<p id="ch6oop_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
-<p id="ch6oop_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
-<p id="ch6oop_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
-<p id="ch6oop_46"></a>Absolute paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch6oop_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch6oop_48"></a>For example to get to /boot/grub you would type:</p>
-<pre class="programlisting">$cd /boot/grub</pre>
-<p id="ch6oop_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
-<p id="ch6oop_4a"></a>Relative paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch6oop_4b"></a>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.</p>
-<p id="ch6oop_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
-<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch6oop_4d"></a>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.</p>
-</div>
-<div class="section" title="3.4. who">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2726437"></a>3.4. who</h3></div></div></div>
-<p id="ch6oop_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
-<p id="ch6oop_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
-<pre class="programlisting">$who
-beeblebrox tty7         2009-09-08 10:50 (:0)
-beeblebrox pts/0        2009-09-08 11:25 (:0.0)
-dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
-beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
-<p id="ch6oop_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
-<p id="ch6oop_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
-<pre class="programlisting">$man who</pre>
-<p id="ch6oop_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
-</div>
-<div class="section" title="3.5. mkdir">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2726517"></a>3.5. mkdir</h3></div></div></div>
-<p id="ch6oop_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
-<pre class="programlisting">$mkdir name_of_directory</pre>
-<p id="ch6oop_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
-<div class="section" title="3.5.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2726548"></a>3.5.1. Options</h4></div></div></div>
-<p id="ch6oop_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch6oop_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
-</div>
-<div class="section" title="3.5.2. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2726607"></a>3.5.2. Examples</h4></div></div></div>
-<p id="ch6oop_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
-<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
-<p id="ch6oop_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
-<p id="ch6oop_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
-<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
-<p id="ch6oop_5d"></a>This will create:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_5e"></a>tag</p></li>
-<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch6oop_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
-</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
-</div>
-</div>
-</div>
-<div class="section" title="4. Getting Help">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2726690"></a>4. Getting Help</h2></div></div></div>
-<div class="section" title="4.1. apropos and whatis">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2726699"></a>4.1. apropos and whatis</h3></div></div></div>
-<p id="ch6oop_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
-<pre class="programlisting">$ apropos grep
-egrep       egrep (1)       Search a file for a pattern using full regular expressions
-fgrep       fgrep (1)       Search a file for a fixed-character string
-fmlgrep     fmlgrep (1)     Search a file for a pattern
-grep        grep (1)        Search a file for a pattern
-gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
-nisgrep     nismatch (1)    Utilities for searching NIS+ tables
-pgrep       pgrep (1)       Find or signal a process by name or other attribute
-zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
-...</pre>
-<p id="ch6oop_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
-<p id="ch6oop_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
-<pre class="programlisting">$whatis ls
-ls (1)           - list directory contents</pre>
-<p id="ch6oop_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
-<p id="ch6oop_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
-<pre class="programlisting">$apropos browser
-gmusicbrowser (1)    - Jukebox for large collections of audio files
-infobrowser (1)      - read Info documents
-libsmbclient (7)     - An extension library for browsers and that               can be used...
-opera (1)            - a standards-compliant graphical Web browser
-sensible-browser (1) - sensible editing, paging, and web browsing
-smbtree (1)          - A text based smb network browser
-tvtk_doc (1)         - A GUI based TVTK documentation search browser.
-viewres (1)          - graphical class browser for Xt
-w3m (1)              - a text based Web browser and pager
-www-browser (1)      - a text based Web browser and pager
-...</pre>
-</div>
-<div class="section" title="4.2. man">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2726779"></a>4.2. man</h3></div></div></div>
-<p id="ch6oop_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
-<p id="ch6oop_66"></a>To read a manual page for a Unix command, one can use:</p>
-<pre class="programlisting">$ man &lt;command_name&gt;</pre>
-<p id="ch6oop_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
-<p id="ch6oop_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
-<pre class="programlisting">$man 3 printf</pre>
-<p id="ch6oop_69"></a>Another example:</p>
-<pre class="programlisting">$man man</pre>
-<p id="ch6oop_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
-<div class="section" title="4.2.1. Layout">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2726859"></a>4.2.1. Layout</h4></div></div></div>
-<p id="ch6oop_6b"></a>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:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch6oop_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch6oop_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch6oop_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch6oop_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch6oop_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch6oop_71"></a>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.</p>
-<p id="ch6oop_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
-<p id="ch6oop_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
-<p id="ch6oop_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
-<p id="ch6oop_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
-<p id="ch6oop_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
-</div>
-</div>
-<div class="section" title="4.3. info">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2726983"></a>4.3. info</h3></div></div></div>
-<p id="ch6oop_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
-<p id="ch6oop_78"></a>The syntax is</p>
-<pre class="programlisting">$ info &lt;command_name&gt;</pre>
-<p id="ch6oop_79"></a><span class="emphasis"><em>info</em></span> 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</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch6oop_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
-</div>
-<div class="section" title="4.4. --help">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2727073"></a>4.4. --help</h3></div></div></div>
-<p id="ch6oop_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
-<pre class="programlisting">$ userprompt@host: cat --help
-Usage: cat [OPTION] [FILE]...
-Concatenate FILE(s), or standard input, to standard output.
-
-  -A, --show-all           equivalent to -vET
-  -b, --number-nonblank    number nonempty output lines
-  -e                       equivalent to -vE
-  -E, --show-ends          display $ at end of each line
-  -n, --number             number all output lines
-  -s, --squeeze-blank      suppress repeated empty output lines
-  -t                       equivalent to -vT
-  -T, --show-tabs          display TAB characters as ^I
-  -u                       (ignored)
-  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
-  --help     display this help and exit
-  --version  output version information and exit
-
-With no FILE, or when FILE is -, read standard input.
-
-Examples:
-  cat f - g  Output f's contents, then standard input, then g's           contents.
-  cat        Copy standard input to standard output.
-
-Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
-</div>
-</div>
-<div class="section" title="5. Basic file handling">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2727127"></a>5. Basic file handling</h2></div></div></div>
-<div class="section" title="5.1. cp">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2727136"></a>5.1. cp</h3></div></div></div>
-<p id="ch6oop_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
-<div class="section" title="5.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2727153"></a>5.1.1. Usage</h4></div></div></div>
-<p id="ch6oop_82"></a>To copy a file to another file:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
-<p id="ch6oop_83"></a>To copy a file to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
-<p id="ch6oop_84"></a>To copy a directory to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
-SourceDirectory ... TargetDirectory</pre>
-</div>
-<div class="section" title="5.1.2. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2727187"></a>5.1.2. Flags</h4></div></div></div>
-<p id="ch6oop_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
-<p id="ch6oop_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
-<p id="ch6oop_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
-<p id="ch6oop_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_89"></a>The time of the last data modification and the time of the last access.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch6oop_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
-</div>
-<div class="section" title="5.1.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2727285"></a>5.1.3. Examples</h4></div></div></div>
-<p id="ch6oop_8d"></a>To make a copy of a file in the current directory, enter:</p>
-<pre class="programlisting">$ cp prog.c prog.bak</pre>
-<p id="ch6oop_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
-<p id="ch6oop_8f"></a>To copy a file in your current directory into another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
-<p id="ch6oop_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
-<p id="ch6oop_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
-<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
-<p id="ch6oop_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
-<p id="ch6oop_93"></a>To copy all the files in a directory to a new directory, enter:</p>
-<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
-<p id="ch6oop_94"></a>This copies only the files in the clients directory to the customers directory.</p>
-<p id="ch6oop_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch6oop_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch6oop_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
-<p id="ch6oop_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
-<p id="ch6oop_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
-<p id="ch6oop_9a"></a>To use pattern-matching characters to copy files, enter:</p>
-<pre class="programlisting">$ cp programs/*.py .</pre>
-<p id="ch6oop_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
-</div>
-</div>
-<div class="section" title="5.2. mv">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2727446"></a>5.2. mv</h3></div></div></div>
-<p id="ch6oop_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
-<div class="section" title="5.2.1. Conflicting existing file">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2727470"></a>5.2.1. Conflicting existing file</h4></div></div></div>
-<p id="ch6oop_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
-</div>
-<div class="section" title="5.2.2. Differences with copy and delete">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2727489"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
-<p id="ch6oop_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
-</div>
-<div class="section" title="5.2.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2725181"></a>5.2.3. Examples</h4></div></div></div>
-<pre class="programlisting">$ mv myfile mynewfilename    renames a file
-$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
-$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
-$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
-$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
-$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
-$ mv foo bar baz dir         moves multiple files to directory dir
-$ mv --help                  shows a very concise help about the                syntax of the command
-$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
-<p id="ch6oop_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
-<p id="ch6oop_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
-</div>
-</div>
-<div class="section" title="5.3. rm">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2725240"></a>5.3. rm</h3></div></div></div>
-<p id="ch6oop_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
-<p id="ch6oop_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
-<pre class="programlisting">$ rm -i foo
-remove foo? y</pre>
-<div class="section" title="5.3.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2725269"></a>5.3.1. Options</h4></div></div></div>
-<p id="ch6oop_a3"></a>Common options that rm accepts include:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch6oop_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
-<p id="ch6oop_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
-<p id="ch6oop_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
-<pre class="programlisting">xargs rm &lt; filelist</pre>
-<p id="ch6oop_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
-</div>
-<div class="section" title="5.3.2. Permissions">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2727846"></a>5.3.2. Permissions</h4></div></div></div>
-<p id="ch6oop_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
-<p id="ch6oop_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
-<p id="ch6oop_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
-</div>
-</div>
-</div>
-<div class="section" title="6. Command Line Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2727886"></a>6. Command Line Arguments</h2></div></div></div>
-<p id="ch6oop_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
-<p id="ch6oop_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
-<pre class="programlisting">rm file.s</pre>
-<p id="ch6oop_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
-<p id="ch6oop_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
-<p id="ch6oop_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
-<p id="ch6oop_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
-<p id="ch6oop_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
-</div>
-<div class="section" title="7. Basic Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2727979"></a>7. Basic Text Processing</h2></div></div></div>
-<div class="section" title="7.1. head">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2727988"></a>7.1. head</h3></div></div></div>
-<p id="ch6oop_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
-<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
-<p id="ch6oop_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
-<pre class="programlisting">$ head -n 20 filename</pre>
-<p id="ch6oop_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ head -n 5 foo*</pre>
-<p id="ch6oop_b9"></a>Some versions omit the n and just let you say -5.</p>
-<div class="section" title="7.1.1. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2728039"></a>7.1.1. Flags</h4></div></div></div>
-<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
-<p id="ch6oop_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
-<p id="ch6oop_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
-<pre class="programlisting">sed 5q foo</pre>
-<p id="ch6oop_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
-</div>
-</div>
-<div class="section" title="7.2. tail">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2728075"></a>7.2. tail</h3></div></div></div>
-<p id="ch6oop_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
-<p id="ch6oop_be"></a>The command-syntax is:</p>
-<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
-<p id="ch6oop_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
-<pre class="programlisting">$ tail -n 20 filename</pre>
-<p id="ch6oop_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ tail -c 15 foo*</pre>
-<p id="ch6oop_c1"></a>This example shows all lines of filename from the second line onwards:</p>
-<pre class="programlisting">$ tail -n +2 filename</pre>
-<p id="ch6oop_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
-<pre class="programlisting">$ tail -20 filename
-$ tail -50c filename</pre>
-<p id="ch6oop_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
-<div class="section" title="7.2.1. File monitoring">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2728153"></a>7.2.1. File monitoring</h4></div></div></div>
-<p id="ch6oop_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
-<pre class="programlisting">$ tail -f /var/adm/messages</pre>
-<p id="ch6oop_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
-<p id="ch6oop_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
-</div>
-</div>
-<div class="section" title="7.3. cut">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2728202"></a>7.3. cut</h3></div></div></div>
-<p id="ch6oop_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
-<p id="ch6oop_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
-<p id="ch6oop_c9"></a>Assuming a file named file containing the lines:</p>
-<pre class="programlisting">foo:bar:baz:qux:quux
-one:two:three:four:five:six:seven
-alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-<p id="ch6oop_ca"></a>To output the fourth through tenth characters of each line:</p>
-<pre class="programlisting">$ cut -c 4-10 file</pre>
-<p id="ch6oop_cb"></a>This gives the output:</p>
-<pre class="programlisting">:bar:ba
-:two:th
-ha:beta</pre>
-<p id="ch6oop_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
-<pre class="programlisting">$ cut -d : -f 5- file</pre>
-<p id="ch6oop_cd"></a>This gives the output:</p>
-<pre class="programlisting">quux
-five:six:seven
-epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-</div>
-<div class="section" title="7.4. paste">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2728288"></a>7.4. paste</h3></div></div></div>
-<p id="ch6oop_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
-<p id="ch6oop_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
-<pre class="programlisting">$ paste who where when &gt; www</pre>
-<p id="ch6oop_d0"></a>If the files contain:</p>
-<table summary="paste" border="1"><colgroup>
-<col width="11">
-<col width="12">
-<col width="12">
-</colgroup></table>
-<p id="ch6oop_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
-<pre class="programlisting">Batman            GothamCity       January 3
-Trillian          Andromeda        February 4
-Jeeves            London           March 19</pre>
-</div>
-</div>
-<div class="section" title="8. Shell Meta Characters">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2728423"></a>8. Shell Meta Characters</h2></div></div></div>
-<p id="ch6oop_de"></a>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.</p>
-<p id="ch6oop_df"></a>The shell meta characters include:</p>
-<p id="ch6oop_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
-<p id="ch6oop_e1"></a>Different shells may differ in the meta characters recognized.</p>
-<p id="ch6oop_e2"></a>As an example,</p>
-<pre class="programlisting">$ ls file.*</pre>
-<p id="ch6oop_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
-<pre class="programlisting">$ ls file.?</pre>
-<p id="ch6oop_e4"></a>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:</p>
-<pre class="programlisting">$ more c*</pre>
-<p id="ch6oop_e5"></a>because the c* matches that long file name.</p>
-<p id="ch6oop_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
-<pre class="programlisting">$ rm ??more</pre>
-<p id="ch6oop_e7"></a>or:</p>
-<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
-<p id="ch6oop_e8"></a>or:</p>
-<pre class="programlisting">$ rm ''*|more''</pre>
-</div>
-<div class="section" title="9. Looking At Files">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2728530"></a>9. Looking At Files</h2></div></div></div>
-<div class="section" title="9.1. cat">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2728538"></a>9.1. cat</h3></div></div></div>
-<p id="ch6oop_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
-<p id="ch6oop_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
-<p id="ch6oop_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
-<div class="section" title="9.1.1. Jargon File Definition">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2728582"></a>9.1.1. Jargon File Definition</h4></div></div></div>
-<p id="ch6oop_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
-<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
-     pause (syn. blast).
-
-2. By extension, to dump large amounts of data at an unprepared target or
-     with no intention of browsing it carefully. Usage: considered silly.
-     Rare outside Unix sites. See also dd, BLT.
-
-     Among Unix fans, *cat(1)* is considered an excellent example of
-     user-interface design, because it delivers the file contents without
-     such verbosity as spacing or headers between the files, and because
-     it does not require the files to consist of lines of text, but works
-     with any sort of data.
-
-     Among Unix critics, *cat(1)* is considered the canonical example of
-     bad user-interface design, because of its woefully unobvious name.
-     It is far more often used to blast a single file to standard output
-     than to concatenate two or more files. The name cat for the former
-     operation is just as unintuitive as, say, LISP's cdr.
-
-     Of such oppositions are holy wars made...</pre>
-</div>
-<div class="section" title="9.1.2. Useless Use of 'cat'">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2728620"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
-<p id="ch6oop_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
-<p id="ch6oop_ee"></a>Nevertheless one sees people doing:</p>
-<pre class="programlisting">$ cat file | some_command and its args ...</pre>
-<p id="ch6oop_ef"></a>instead of the equivalent and cheaper:</p>
-<pre class="programlisting">&lt;file some_command and its args ...</pre>
-<p id="ch6oop_f0"></a>or (equivalently and more classically):</p>
-<pre class="programlisting">some_command and its args ... &lt;file</pre>
-<p id="ch6oop_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
-<p id="ch6oop_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
-</div>
-<div class="section" title="9.1.3. zcat">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2728690"></a>9.1.3. zcat</h4></div></div></div>
-<p id="ch6oop_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
-</div>
-</div>
-<div class="section" title="9.2. more">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2728726"></a>9.2. more</h3></div></div></div>
-<p id="ch6oop_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
-<div class="section" title="9.2.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2728746"></a>9.2.1. Usage</h4></div></div></div>
-<p id="ch6oop_f5"></a>The command-syntax is:</p>
-<pre class="programlisting">$ more [options] [file_name]</pre>
-<p id="ch6oop_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
-<p id="ch6oop_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
-<p id="ch6oop_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
-<p id="ch6oop_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
-</div>
-</div>
-<div class="section" title="9.3. less">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2728840"></a>9.3. less</h3></div></div></div>
-<p id="ch6oop_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
-<div class="section" title="9.3.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2728870"></a>9.3.1. Usage</h4></div></div></div>
-<p id="ch6oop_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
-<p id="ch6oop_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
-<p id="ch6oop_fd"></a>The command-syntax is:</p>
-<pre class="programlisting">$ less [options] file_name</pre>
-</div>
-<div class="section" title="9.3.2. Frequently Used Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2728924"></a>9.3.2. Frequently Used Options</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_ff"></a>-I: Case-insensitive searches.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_103"></a>-?: Shows help.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.3. Frequently Used Commands">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2728975"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_105"></a>[Space bar]: Next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_106"></a>b: Previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_10a"></a>'^ or g: Go to start of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_10b"></a>'$ or G: Go to end of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_10d"></a>=: File information.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_10e"></a>h: Help.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_10f"></a>q: Quit.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.4. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2729063"></a>9.3.4. Examples</h4></div></div></div>
-<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
-$ less +F /var/log/mail.log              #Follow mode for log
-$ file * | less                          #Easier file analysis.
-$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
-</div>
-</div>
-</div>
-<div class="section" title="10. Directory Structure">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2729078"></a>10. Directory Structure</h2></div></div></div>
-<p id="ch6oop_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
-<p id="ch6oop_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
-<table summary="Directory Structure" border="1"><colgroup>
-<col width="15">
-<col width="48">
-</colgroup></table>
-<div class="section" title="10.1. man hier">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2729343"></a>10.1. man hier</h3></div></div></div>
-<p id="ch6oop_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
-<pre class="programlisting">$ man hier</pre>
-</div>
-<div class="section" title="10.2. ls -l">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2729359"></a>10.2. ls -l</h3></div></div></div>
-<p id="ch6oop_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
-<pre class="programlisting">$ ls -l</pre>
-<p id="ch6oop_138"></a>This can be done after entering the required directory.</p>
-</div>
-</div>
-<div class="section" title="11. Permissions and Ownership">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2729381"></a>11. Permissions and Ownership</h2></div></div></div>
-<div class="section" title="11.1. chmod">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2729390"></a>11.1. chmod</h3></div></div></div>
-<p id="ch6oop_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
-<div class="section" title="11.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2729416"></a>11.1.1. Usage</h4></div></div></div>
-<p id="ch6oop_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
-<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
-<p id="ch6oop_13b"></a>To view what the permissions currently are, type:</p>
-<pre class="programlisting">$ ls -l file</pre>
-</div>
-<div class="section" title="11.1.2. Command line options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2729443"></a>11.1.2. Command line options</h4></div></div></div>
-<p id="ch6oop_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch6oop_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
-</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2729480"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
-<p id="ch6oop_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
-<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
-<p id="ch6oop_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="8">
-<col width="45">
-</colgroup></table>
-<p id="ch6oop_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="54">
-</colgroup></table>
-<p id="ch6oop_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="5">
-<col width="14">
-<col width="48">
-</colgroup></table>
-<p id="ch6oop_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
-</div>
-<div class="section" title="11.1.2.2. Symbolic examples">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2730027"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
-<p id="ch6oop_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
-<pre class="programlisting">$ chmod ug+rw mydir
-$ ls -ld mydir
-drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
-<p id="ch6oop_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
-<pre class="programlisting">$ chmod a-w myfile
-$ ls -l myfile
--r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
-<p id="ch6oop_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
-<pre class="programlisting">$ chmod ug=rx mydir
-$ ls -ld mydir
-dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
-</div>
-<div class="section" title="11.1.2.3. Octal numbers">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2730068"></a>11.1.2.3. Octal numbers</h5></div></div></div>
-<p id="ch6oop_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
-<pre class="programlisting">$ chmod 664 myfile
-$ ls -l myfile
--rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
-<p id="ch6oop_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
-<pre class="programlisting">$ chmod 0664 myfile</pre>
-</div>
-<div class="section" title="11.1.2.4. Special modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2730106"></a>11.1.2.4. Special modes</h5></div></div></div>
-<p id="ch6oop_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
-<p id="ch6oop_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
-</div>
-</div>
-</div>
-</div>
-<div class="section" title="12. Redirection and Piping">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2730149"></a>12. Redirection and Piping</h2></div></div></div>
-<p id="ch6oop_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
-<p id="ch6oop_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
-<div class="section" title="12.1. Redirecting standard input and standard output">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2730186"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
-<p id="ch6oop_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
-<pre class="programlisting">$ command1 &gt; file1</pre>
-<p id="ch6oop_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
-<pre class="programlisting">$ command1 &lt; file1</pre>
-<p id="ch6oop_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
-<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
-<p id="ch6oop_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
-</div>
-<div class="section" title="12.2. Piping">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2730255"></a>12.2. Piping</h3></div></div></div>
-<p id="ch6oop_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
-A pipeline of three programs run on a text terminal:</p>
-<pre class="programlisting">$ command1 | command2</pre>
-<p id="ch6oop_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
-<p id="ch6oop_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
-<pre class="programlisting">$ command1 &gt; tempfile
-$ command2 &lt; tempfile
-$ rm tempfile</pre>
-<p id="ch6oop_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
-<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
-<p id="ch6oop_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
-</div>
-<div class="section" title="12.3. Redirecting to and from the standard file handles">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2730315"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
-<p id="ch6oop_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
-<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
-<col width="12">
-<col width="13">
-<col width="24">
-</colgroup></table>
-<p id="ch6oop_18d"></a>For example:</p>
-<pre class="programlisting">$ command1 2&gt; file1</pre>
-<p id="ch6oop_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
-<p id="ch6oop_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
-<p id="ch6oop_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
-<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
-<p id="ch6oop_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
-<p id="ch6oop_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
-<p id="ch6oop_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
-<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
-<p id="ch6oop_194"></a>A simplified form of the command:</p>
-<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
-<p id="ch6oop_195"></a>is:</p>
-<pre class="programlisting">$ command &amp;&gt;file</pre>
-<p id="ch6oop_196"></a>or:</p>
-<pre class="programlisting">$command &gt;&amp;file</pre>
-</div>
-<div class="section" title="12.4. Chained pipelines">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2730516"></a>12.4. Chained pipelines</h3></div></div></div>
-<p id="ch6oop_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
-<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
-<p id="ch6oop_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
-</div>
-<div class="section" title="12.5. Redirect to multiple outputs">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2730550"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
-<p id="ch6oop_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
-<pre class="programlisting">$ ls -lrt | tee xyz</pre>
-<p id="ch6oop_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
-</div>
-</div>
-<div class="section" title="13. More Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2730580"></a>13. More Text Processing</h2></div></div></div>
-<div class="section" title="13.1. grep">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2730589"></a>13.1. grep</h3></div></div></div>
-<p id="ch6oop_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
-<div class="section" title="13.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2730620"></a>13.1.1. Usage</h4></div></div></div>
-<p id="ch6oop_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
-<pre class="programlisting">$ grep apple fruitlist.txt</pre>
-<p id="ch6oop_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
-<p id="ch6oop_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
-<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
-<p id="ch6oop_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
-<p id="ch6oop_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
-<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
-<p id="ch6oop_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
-<div class="section" title="13.1.1.1. Variations">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2730698"></a>13.1.1.1. Variations</h5></div></div></div>
-<p id="ch6oop_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
-<p id="ch6oop_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
-<p id="ch6oop_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
-</div>
-</div>
-</div>
-<div class="section" title="13.2. tr">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2730777"></a>13.2. tr</h3></div></div></div>
-<p id="ch6oop_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
-<p id="ch6oop_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
-<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
-<p id="ch6oop_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
-<p id="ch6oop_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
-<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
-<p id="ch6oop_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
-<p id="ch6oop_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
-<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
-<p id="ch6oop_1ab"></a>therefore removes all non-alphanumeric characters.</p>
-<p id="ch6oop_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
-<pre class="programlisting">$ tr -s '\n' '\n'</pre>
-<p id="ch6oop_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
-<p id="ch6oop_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
-<pre class="programlisting">$ tr -d '\r'</pre>
-<p id="ch6oop_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
-<p id="ch6oop_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
-</div>
-</div>
-<div class="section" title="14. Elementary Regex">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2730925"></a>14. Elementary Regex</h2></div></div></div>
-<p id="ch6oop_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
-<p id="ch6oop_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
-<p id="ch6oop_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
-<p id="ch6oop_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
-<table summary="Elementary Regex" border="1"><colgroup>
-<col width="13">
-<col width="60">
-</colgroup></table>
-<div class="section" title="14.1. Lazy quantification">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2731134"></a>14.1. Lazy quantification</h3></div></div></div>
-<p id="ch6oop_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
-<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
-<p id="ch6oop_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
-<p id="ch6oop_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
-</div>
-</div>
-<div class="section" title="15. One Liners">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2731210"></a>15. One Liners</h2></div></div></div>
-<p id="ch6oop_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
-<p id="ch6oop_1cd"></a>The one liner can be</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem"><p id="ch6oop_1ce"></a>An expression written in the language of the shell.</p></li>
-<li class="listitem"><p id="ch6oop_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
-<li class="listitem"><p id="ch6oop_1d0"></a>The invocation of a compiler together with source to compile and
-instructions for executing the compiled program.</p></li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch6oop_1d1"></a>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.</p>
-<p id="ch6oop_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
-<p id="ch6oop_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
-<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
-<p id="ch6oop_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
-<p id="ch6oop_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
-<p id="ch6oop_1d6"></a>Here are the first few of them:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem">
-<p id="ch6oop_1d7"></a>Print the total number of input lines:</p>
-<p id="ch6oop_1d8"></a>END { print NR }</p>
-</li>
-<li class="listitem">
-<p id="ch6oop_1d9"></a>Print the tenth input line:</p>
-<p id="ch6oop_1da"></a>NR == 10</p>
-</li>
-<li class="listitem">
-<p id="ch6oop_1db"></a>Print the last field of every input line:</p>
-<p id="ch6oop_1dc"></a>{ print $NF }</p>
-</li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch6oop_1dd"></a>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.</p>
-<p id="ch6oop_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
-<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
-*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
-<p id="ch6oop_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
-<p id="ch6oop_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
-<pre class="programlisting">$ prog foo 'f??'; echo $?
-
-$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
-<p id="ch6oop_1e1"></a>Here is a one line shell script to show directories:</p>
-<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
-</div>
-</div>
-</div></body>
-</html>
--- a/web/html/ch7interim_assessment.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1139 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Internal assesment </title>
-<link rel="stylesheet" href="/review/support/styles.css" type="text/css">
-<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
-<script type="text/javascript" src="/review/support/jquery-min.js"></script>
-<script type="text/javascript" src="/review/support/form.js"></script>
-<script type="text/javascript" src="/review/support/hsbook.js"></script>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch7interim_assessment">
-<div class="titlepage"></div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="article"><a href="#id2484740"></a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2294864">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2484544">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2535791">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2536201">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2536342">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2536351">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2536630">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2536639">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2536803">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2536864">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2536967">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2537050">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2537230">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2537239">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2537322">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2537533">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2537625">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2537678">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2537687">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2537999">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2538132">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2538304">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2538397">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2538406">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2538493">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2538621">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2538708">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2538842">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2538959">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2538968">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2539156">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2539267">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2539510">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2539784">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2539801">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2539824">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2539833">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2540610">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2540646">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2540714">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2540776">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2540984">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2541018">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2541049">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2541057">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2541248">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2541399">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2541615">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2541692">15. One Liners</a></span></dt>
-</dl></dd>
-</dl>
-</div>
-<div class="article">
-<div class="titlepage">
-<div><div><h2 class="title" id="id2484740"></a></h2></div></div>
-<hr>
-</div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="section"><a href="#id2294864">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2484544">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2535791">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2536201">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2536342">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2536351">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2536630">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2536639">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2536803">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2536864">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2536967">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2537050">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2537230">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2537239">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2537322">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2537533">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2537625">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2537678">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2537687">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2537999">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2538132">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2538304">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2538397">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2538406">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2538493">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2538621">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2538708">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2538842">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2538959">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2538968">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2539156">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2539267">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2539510">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2539784">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2539801">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2539824">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2539833">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2540610">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2540646">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2540714">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2540776">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2540984">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2541018">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2541049">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2541057">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2541248">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2541399">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2541615">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2541692">15. One Liners</a></span></dt>
-</dl>
-</div>
-<div class="section" title="1. Introducing Linux">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2294864"></a>1. Introducing Linux</h2></div></div></div>
-<p id="ch7interim_assessment_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
-<p id="ch7interim_assessment_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
-<p id="ch7interim_assessment_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
-<p id="ch7interim_assessment_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
-<div class="section" title="1.1. Historical Background">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2484544"></a>1.1. Historical Background</h3></div></div></div>
-<div class="section" title="1.1.1. Events leading to the creation">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2482525"></a>1.1.1. Events leading to the creation</h4></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
-</ul></div>
-</div>
-<div class="section" title="1.1.2. The Creation of Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2535756"></a>1.1.2. The Creation of Linux</h4></div></div></div>
-<p id="ch7interim_assessment_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
-<p id="ch7interim_assessment_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
-</div>
-</div>
-<div class="section" title="1.2. Design and Implications">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2535791"></a>1.2. Design and Implications</h3></div></div></div>
-<p id="ch7interim_assessment_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
-<div class="section" title="1.2.1. User Interface">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2535816"></a>1.2.1. User Interface</h4></div></div></div>
-<p id="ch7interim_assessment_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
-<p id="ch7interim_assessment_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
-</div>
-<div class="section" title="1.2.2. Development">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2535870"></a>1.2.2. Development</h4></div></div></div>
-<p id="ch7interim_assessment_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
-<p id="ch7interim_assessment_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
-<p id="ch7interim_assessment_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
-</div>
-<div class="section" title="1.2.3. Community">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2535571"></a>1.2.3. Community</h4></div></div></div>
-<p id="ch7interim_assessment_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
-<p id="ch7interim_assessment_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
-<p id="ch7interim_assessment_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
-</div>
-<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2535616"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
-<p id="ch7interim_assessment_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
-</div>
-<div class="section" title="1.2.5. Programming on Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2535662"></a>1.2.5. Programming on Linux</h4></div></div></div>
-<p id="ch7interim_assessment_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
-<p id="ch7interim_assessment_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
-<p id="ch7interim_assessment_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
-</div>
-</div>
-<div class="section" title="1.3. Reasons for Using Linux">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2536201"></a>1.3. Reasons for Using Linux</h3></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_16"></a>Linux is free:</p></li></ul></div>
-<p id="ch7interim_assessment_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
-Most of all, Linux is free as in "free speech":
-The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
-<p id="ch7interim_assessment_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_1a"></a>Linux was made to keep on running:</p></li></ul></div>
-<p id="ch7interim_assessment_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_1c"></a>Linux is secure and versatile:</p></li></ul></div>
-<p id="ch7interim_assessment_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_1e"></a>Linux is scalable:</p></li></ul></div>
-<p id="ch7interim_assessment_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
-<p id="ch7interim_assessment_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
-</div>
-</div>
-<div class="section" title="2. Getting Started">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2536342"></a>2. Getting Started</h2></div></div></div>
-<div class="section" title="2.1. Logging in, activating the user interface and logging out">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2536351"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
-<p id="ch7interim_assessment_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
-<div class="section" title="2.1.1. Graphical Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2536381"></a>2.1.1. Graphical Mode</h4></div></div></div>
-<p id="ch7interim_assessment_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
-<p id="ch7interim_assessment_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
-It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
-<p id="ch7interim_assessment_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
-<p id="ch7interim_assessment_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
-<p id="ch7interim_assessment_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
-<p id="ch7interim_assessment_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
-<p id="ch7interim_assessment_29"></a>Another common form for a prompt is this one:
-[</p>
-<div class="reference">
-<div class="titlepage"><hr></div>user@host</div>
-<p> dir]</p>
-<p id="ch7interim_assessment_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
-<p id="ch7interim_assessment_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
-</div>
-<div class="section" title="2.1.2. Text Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2536540"></a>2.1.2. Text Mode</h4></div></div></div>
-<p id="ch7interim_assessment_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
-<p id="ch7interim_assessment_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
-reasons.</p>
-<p id="ch7interim_assessment_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
-<p id="ch7interim_assessment_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
-<p id="ch7interim_assessment_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
-</div>
-</div>
-</div>
-<div class="section" title="3. Basic Commands">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2536630"></a>3. Basic Commands</h2></div></div></div>
-<div class="section" title="3.1. ls">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2536639"></a>3.1. ls</h3></div></div></div>
-<p id="ch7interim_assessment_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
-<p id="ch7interim_assessment_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
-<p id="ch7interim_assessment_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
-<pre class="programlisting">$ ls
-jeeves.rst psmith.html blandings.html
-$ ls -l
-drwxr--r--   1 plum  editors   4096  jeeves
--rw-r--r--   1 plum  editors  30405  psmith
--r-xr-xr-x   1 plum  plum      8460  blandings</pre>
-<p id="ch7interim_assessment_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
-</div>
-<div class="section" title="3.2. date">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2536803"></a>3.2. date</h3></div></div></div>
-<p id="ch7interim_assessment_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
-<p id="ch7interim_assessment_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
-<pre class="programlisting">$date
-Tue Sep  8 12:01:45 IST 2009</pre>
-<p id="ch7interim_assessment_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
-<pre class="programlisting">$date --set="20040908 01:22"</pre>
-<p id="ch7interim_assessment_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
-<pre class="programlisting">$man date</pre>
-<p id="ch7interim_assessment_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
-</div>
-<div class="section" title="3.3. cd">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2536864"></a>3.3. cd</h3></div></div></div>
-<p id="ch7interim_assessment_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
-<p id="ch7interim_assessment_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
-<p id="ch7interim_assessment_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
-<p id="ch7interim_assessment_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
-<p id="ch7interim_assessment_46"></a>Absolute paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch7interim_assessment_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_48"></a>For example to get to /boot/grub you would type:</p>
-<pre class="programlisting">$cd /boot/grub</pre>
-<p id="ch7interim_assessment_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
-<p id="ch7interim_assessment_4a"></a>Relative paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch7interim_assessment_4b"></a>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.</p>
-<p id="ch7interim_assessment_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
-<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_4d"></a>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.</p>
-</div>
-<div class="section" title="3.4. who">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2536967"></a>3.4. who</h3></div></div></div>
-<p id="ch7interim_assessment_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
-<p id="ch7interim_assessment_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
-<pre class="programlisting">$who
-beeblebrox tty7         2009-09-08 10:50 (:0)
-beeblebrox pts/0        2009-09-08 11:25 (:0.0)
-dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
-beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
-<p id="ch7interim_assessment_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
-<p id="ch7interim_assessment_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
-<pre class="programlisting">$man who</pre>
-<p id="ch7interim_assessment_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
-</div>
-<div class="section" title="3.5. mkdir">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2537050"></a>3.5. mkdir</h3></div></div></div>
-<p id="ch7interim_assessment_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
-<pre class="programlisting">$mkdir name_of_directory</pre>
-<p id="ch7interim_assessment_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
-<div class="section" title="3.5.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2537082"></a>3.5.1. Options</h4></div></div></div>
-<p id="ch7interim_assessment_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
-</div>
-<div class="section" title="3.5.2. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2537144"></a>3.5.2. Examples</h4></div></div></div>
-<p id="ch7interim_assessment_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
-<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
-<p id="ch7interim_assessment_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
-<p id="ch7interim_assessment_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
-<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
-<p id="ch7interim_assessment_5d"></a>This will create:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_5e"></a>tag</p></li>
-<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
-</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
-</div>
-</div>
-</div>
-<div class="section" title="4. Getting Help">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2537230"></a>4. Getting Help</h2></div></div></div>
-<div class="section" title="4.1. apropos and whatis">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2537239"></a>4.1. apropos and whatis</h3></div></div></div>
-<p id="ch7interim_assessment_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
-<pre class="programlisting">$ apropos grep
-egrep       egrep (1)       Search a file for a pattern using full regular expressions
-fgrep       fgrep (1)       Search a file for a fixed-character string
-fmlgrep     fmlgrep (1)     Search a file for a pattern
-grep        grep (1)        Search a file for a pattern
-gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
-nisgrep     nismatch (1)    Utilities for searching NIS+ tables
-pgrep       pgrep (1)       Find or signal a process by name or other attribute
-zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
-...</pre>
-<p id="ch7interim_assessment_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
-<p id="ch7interim_assessment_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
-<pre class="programlisting">$whatis ls
-ls (1)           - list directory contents</pre>
-<p id="ch7interim_assessment_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
-<p id="ch7interim_assessment_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
-<pre class="programlisting">$apropos browser
-gmusicbrowser (1)    - Jukebox for large collections of audio files
-infobrowser (1)      - read Info documents
-libsmbclient (7)     - An extension library for browsers and that               can be used...
-opera (1)            - a standards-compliant graphical Web browser
-sensible-browser (1) - sensible editing, paging, and web browsing
-smbtree (1)          - A text based smb network browser
-tvtk_doc (1)         - A GUI based TVTK documentation search browser.
-viewres (1)          - graphical class browser for Xt
-w3m (1)              - a text based Web browser and pager
-www-browser (1)      - a text based Web browser and pager
-...</pre>
-</div>
-<div class="section" title="4.2. man">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2537322"></a>4.2. man</h3></div></div></div>
-<p id="ch7interim_assessment_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
-<p id="ch7interim_assessment_66"></a>To read a manual page for a Unix command, one can use:</p>
-<pre class="programlisting">$ man &lt;command_name&gt;</pre>
-<p id="ch7interim_assessment_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
-<p id="ch7interim_assessment_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
-<pre class="programlisting">$man 3 printf</pre>
-<p id="ch7interim_assessment_69"></a>Another example:</p>
-<pre class="programlisting">$man man</pre>
-<p id="ch7interim_assessment_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
-<div class="section" title="4.2.1. Layout">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2537405"></a>4.2.1. Layout</h4></div></div></div>
-<p id="ch7interim_assessment_6b"></a>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:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch7interim_assessment_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch7interim_assessment_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch7interim_assessment_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch7interim_assessment_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch7interim_assessment_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch7interim_assessment_71"></a>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.</p>
-<p id="ch7interim_assessment_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
-<p id="ch7interim_assessment_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
-<p id="ch7interim_assessment_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
-<p id="ch7interim_assessment_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
-<p id="ch7interim_assessment_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
-</div>
-</div>
-<div class="section" title="4.3. info">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2537533"></a>4.3. info</h3></div></div></div>
-<p id="ch7interim_assessment_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
-<p id="ch7interim_assessment_78"></a>The syntax is</p>
-<pre class="programlisting">$ info &lt;command_name&gt;</pre>
-<p id="ch7interim_assessment_79"></a><span class="emphasis"><em>info</em></span> 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</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
-</div>
-<div class="section" title="4.4. --help">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2537625"></a>4.4. --help</h3></div></div></div>
-<p id="ch7interim_assessment_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
-<pre class="programlisting">$ userprompt@host: cat --help
-Usage: cat [OPTION] [FILE]...
-Concatenate FILE(s), or standard input, to standard output.
-
-  -A, --show-all           equivalent to -vET
-  -b, --number-nonblank    number nonempty output lines
-  -e                       equivalent to -vE
-  -E, --show-ends          display $ at end of each line
-  -n, --number             number all output lines
-  -s, --squeeze-blank      suppress repeated empty output lines
-  -t                       equivalent to -vT
-  -T, --show-tabs          display TAB characters as ^I
-  -u                       (ignored)
-  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
-  --help     display this help and exit
-  --version  output version information and exit
-
-With no FILE, or when FILE is -, read standard input.
-
-Examples:
-  cat f - g  Output f's contents, then standard input, then g's           contents.
-  cat        Copy standard input to standard output.
-
-Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
-</div>
-</div>
-<div class="section" title="5. Basic file handling">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2537678"></a>5. Basic file handling</h2></div></div></div>
-<div class="section" title="5.1. cp">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2537687"></a>5.1. cp</h3></div></div></div>
-<p id="ch7interim_assessment_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
-<div class="section" title="5.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2537704"></a>5.1.1. Usage</h4></div></div></div>
-<p id="ch7interim_assessment_82"></a>To copy a file to another file:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
-<p id="ch7interim_assessment_83"></a>To copy a file to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
-<p id="ch7interim_assessment_84"></a>To copy a directory to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
-SourceDirectory ... TargetDirectory</pre>
-</div>
-<div class="section" title="5.1.2. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2537738"></a>5.1.2. Flags</h4></div></div></div>
-<p id="ch7interim_assessment_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
-<p id="ch7interim_assessment_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
-<p id="ch7interim_assessment_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
-<p id="ch7interim_assessment_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_89"></a>The time of the last data modification and the time of the last access.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
-</div>
-<div class="section" title="5.1.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2537835"></a>5.1.3. Examples</h4></div></div></div>
-<p id="ch7interim_assessment_8d"></a>To make a copy of a file in the current directory, enter:</p>
-<pre class="programlisting">$ cp prog.c prog.bak</pre>
-<p id="ch7interim_assessment_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
-<p id="ch7interim_assessment_8f"></a>To copy a file in your current directory into another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
-<p id="ch7interim_assessment_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
-<p id="ch7interim_assessment_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
-<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
-<p id="ch7interim_assessment_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
-<p id="ch7interim_assessment_93"></a>To copy all the files in a directory to a new directory, enter:</p>
-<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
-<p id="ch7interim_assessment_94"></a>This copies only the files in the clients directory to the customers directory.</p>
-<p id="ch7interim_assessment_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch7interim_assessment_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
-<p id="ch7interim_assessment_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
-<p id="ch7interim_assessment_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
-<p id="ch7interim_assessment_9a"></a>To use pattern-matching characters to copy files, enter:</p>
-<pre class="programlisting">$ cp programs/*.py .</pre>
-<p id="ch7interim_assessment_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
-</div>
-</div>
-<div class="section" title="5.2. mv">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2537999"></a>5.2. mv</h3></div></div></div>
-<p id="ch7interim_assessment_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
-<div class="section" title="5.2.1. Conflicting existing file">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2538023"></a>5.2.1. Conflicting existing file</h4></div></div></div>
-<p id="ch7interim_assessment_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
-</div>
-<div class="section" title="5.2.2. Differences with copy and delete">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2538043"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
-<p id="ch7interim_assessment_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
-</div>
-<div class="section" title="5.2.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2538073"></a>5.2.3. Examples</h4></div></div></div>
-<pre class="programlisting">$ mv myfile mynewfilename    renames a file
-$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
-$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
-$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
-$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
-$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
-$ mv foo bar baz dir         moves multiple files to directory dir
-$ mv --help                  shows a very concise help about the                syntax of the command
-$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
-<p id="ch7interim_assessment_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
-<p id="ch7interim_assessment_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
-</div>
-</div>
-<div class="section" title="5.3. rm">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2538132"></a>5.3. rm</h3></div></div></div>
-<p id="ch7interim_assessment_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
-<p id="ch7interim_assessment_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
-<pre class="programlisting">$ rm -i foo
-remove foo? y</pre>
-<div class="section" title="5.3.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2538162"></a>5.3.1. Options</h4></div></div></div>
-<p id="ch7interim_assessment_a3"></a>Common options that rm accepts include:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
-<p id="ch7interim_assessment_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
-<p id="ch7interim_assessment_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
-<pre class="programlisting">xargs rm &lt; filelist</pre>
-<p id="ch7interim_assessment_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
-</div>
-<div class="section" title="5.3.2. Permissions">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2538265"></a>5.3.2. Permissions</h4></div></div></div>
-<p id="ch7interim_assessment_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
-<p id="ch7interim_assessment_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
-<p id="ch7interim_assessment_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
-</div>
-</div>
-</div>
-<div class="section" title="6. Command Line Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2538304"></a>6. Command Line Arguments</h2></div></div></div>
-<p id="ch7interim_assessment_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
-<p id="ch7interim_assessment_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
-<pre class="programlisting">rm file.s</pre>
-<p id="ch7interim_assessment_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
-<p id="ch7interim_assessment_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
-<p id="ch7interim_assessment_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
-<p id="ch7interim_assessment_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
-<p id="ch7interim_assessment_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
-</div>
-<div class="section" title="7. Basic Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2538397"></a>7. Basic Text Processing</h2></div></div></div>
-<div class="section" title="7.1. head">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2538406"></a>7.1. head</h3></div></div></div>
-<p id="ch7interim_assessment_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
-<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
-<p id="ch7interim_assessment_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
-<pre class="programlisting">$ head -n 20 filename</pre>
-<p id="ch7interim_assessment_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ head -n 5 foo*</pre>
-<p id="ch7interim_assessment_b9"></a>Some versions omit the n and just let you say -5.</p>
-<div class="section" title="7.1.1. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2538457"></a>7.1.1. Flags</h4></div></div></div>
-<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
-<p id="ch7interim_assessment_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
-<p id="ch7interim_assessment_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
-<pre class="programlisting">sed 5q foo</pre>
-<p id="ch7interim_assessment_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
-</div>
-</div>
-<div class="section" title="7.2. tail">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2538493"></a>7.2. tail</h3></div></div></div>
-<p id="ch7interim_assessment_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
-<p id="ch7interim_assessment_be"></a>The command-syntax is:</p>
-<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
-<p id="ch7interim_assessment_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
-<pre class="programlisting">$ tail -n 20 filename</pre>
-<p id="ch7interim_assessment_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ tail -c 15 foo*</pre>
-<p id="ch7interim_assessment_c1"></a>This example shows all lines of filename from the second line onwards:</p>
-<pre class="programlisting">$ tail -n +2 filename</pre>
-<p id="ch7interim_assessment_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
-<pre class="programlisting">$ tail -20 filename
-$ tail -50c filename</pre>
-<p id="ch7interim_assessment_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
-<div class="section" title="7.2.1. File monitoring">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2538572"></a>7.2.1. File monitoring</h4></div></div></div>
-<p id="ch7interim_assessment_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
-<pre class="programlisting">$ tail -f /var/adm/messages</pre>
-<p id="ch7interim_assessment_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
-<p id="ch7interim_assessment_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
-</div>
-</div>
-<div class="section" title="7.3. cut">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2538621"></a>7.3. cut</h3></div></div></div>
-<p id="ch7interim_assessment_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
-<p id="ch7interim_assessment_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
-<p id="ch7interim_assessment_c9"></a>Assuming a file named file containing the lines:</p>
-<pre class="programlisting">foo:bar:baz:qux:quux
-one:two:three:four:five:six:seven
-alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-<p id="ch7interim_assessment_ca"></a>To output the fourth through tenth characters of each line:</p>
-<pre class="programlisting">$ cut -c 4-10 file</pre>
-<p id="ch7interim_assessment_cb"></a>This gives the output:</p>
-<pre class="programlisting">:bar:ba
-:two:th
-ha:beta</pre>
-<p id="ch7interim_assessment_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
-<pre class="programlisting">$ cut -d : -f 5- file</pre>
-<p id="ch7interim_assessment_cd"></a>This gives the output:</p>
-<pre class="programlisting">quux
-five:six:seven
-epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-</div>
-<div class="section" title="7.4. paste">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2538708"></a>7.4. paste</h3></div></div></div>
-<p id="ch7interim_assessment_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
-<p id="ch7interim_assessment_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
-<pre class="programlisting">$ paste who where when &gt; www</pre>
-<p id="ch7interim_assessment_d0"></a>If the files contain:</p>
-<table summary="paste" border="1"><colgroup>
-<col width="11">
-<col width="12">
-<col width="12">
-</colgroup></table>
-<p id="ch7interim_assessment_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
-<pre class="programlisting">Batman            GothamCity       January 3
-Trillian          Andromeda        February 4
-Jeeves            London           March 19</pre>
-</div>
-</div>
-<div class="section" title="8. Shell Meta Characters">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2538842"></a>8. Shell Meta Characters</h2></div></div></div>
-<p id="ch7interim_assessment_de"></a>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.</p>
-<p id="ch7interim_assessment_df"></a>The shell meta characters include:</p>
-<p id="ch7interim_assessment_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
-<p id="ch7interim_assessment_e1"></a>Different shells may differ in the meta characters recognized.</p>
-<p id="ch7interim_assessment_e2"></a>As an example,</p>
-<pre class="programlisting">$ ls file.*</pre>
-<p id="ch7interim_assessment_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
-<pre class="programlisting">$ ls file.?</pre>
-<p id="ch7interim_assessment_e4"></a>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:</p>
-<pre class="programlisting">$ more c*</pre>
-<p id="ch7interim_assessment_e5"></a>because the c* matches that long file name.</p>
-<p id="ch7interim_assessment_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
-<pre class="programlisting">$ rm ??more</pre>
-<p id="ch7interim_assessment_e7"></a>or:</p>
-<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
-<p id="ch7interim_assessment_e8"></a>or:</p>
-<pre class="programlisting">$ rm ''*|more''</pre>
-</div>
-<div class="section" title="9. Looking At Files">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2538959"></a>9. Looking At Files</h2></div></div></div>
-<div class="section" title="9.1. cat">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2538968"></a>9.1. cat</h3></div></div></div>
-<p id="ch7interim_assessment_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
-<p id="ch7interim_assessment_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
-<p id="ch7interim_assessment_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
-<div class="section" title="9.1.1. Jargon File Definition">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2539011"></a>9.1.1. Jargon File Definition</h4></div></div></div>
-<p id="ch7interim_assessment_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
-<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
-     pause (syn. blast).
-
-2. By extension, to dump large amounts of data at an unprepared target or
-     with no intention of browsing it carefully. Usage: considered silly.
-     Rare outside Unix sites. See also dd, BLT.
-
-     Among Unix fans, *cat(1)* is considered an excellent example of
-     user-interface design, because it delivers the file contents without
-     such verbosity as spacing or headers between the files, and because
-     it does not require the files to consist of lines of text, but works
-     with any sort of data.
-
-     Among Unix critics, *cat(1)* is considered the canonical example of
-     bad user-interface design, because of its woefully unobvious name.
-     It is far more often used to blast a single file to standard output
-     than to concatenate two or more files. The name cat for the former
-     operation is just as unintuitive as, say, LISP's cdr.
-
-     Of such oppositions are holy wars made...</pre>
-</div>
-<div class="section" title="9.1.2. Useless Use of 'cat'">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2539050"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
-<p id="ch7interim_assessment_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
-<p id="ch7interim_assessment_ee"></a>Nevertheless one sees people doing:</p>
-<pre class="programlisting">$ cat file | some_command and its args ...</pre>
-<p id="ch7interim_assessment_ef"></a>instead of the equivalent and cheaper:</p>
-<pre class="programlisting">&lt;file some_command and its args ...</pre>
-<p id="ch7interim_assessment_f0"></a>or (equivalently and more classically):</p>
-<pre class="programlisting">some_command and its args ... &lt;file</pre>
-<p id="ch7interim_assessment_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
-<p id="ch7interim_assessment_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
-</div>
-<div class="section" title="9.1.3. zcat">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2539122"></a>9.1.3. zcat</h4></div></div></div>
-<p id="ch7interim_assessment_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
-</div>
-</div>
-<div class="section" title="9.2. more">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2539156"></a>9.2. more</h3></div></div></div>
-<p id="ch7interim_assessment_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
-<div class="section" title="9.2.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2539175"></a>9.2.1. Usage</h4></div></div></div>
-<p id="ch7interim_assessment_f5"></a>The command-syntax is:</p>
-<pre class="programlisting">$ more [options] [file_name]</pre>
-<p id="ch7interim_assessment_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
-<p id="ch7interim_assessment_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
-<p id="ch7interim_assessment_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
-<p id="ch7interim_assessment_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
-</div>
-</div>
-<div class="section" title="9.3. less">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2539267"></a>9.3. less</h3></div></div></div>
-<p id="ch7interim_assessment_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
-<div class="section" title="9.3.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2539296"></a>9.3.1. Usage</h4></div></div></div>
-<p id="ch7interim_assessment_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
-<p id="ch7interim_assessment_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
-<p id="ch7interim_assessment_fd"></a>The command-syntax is:</p>
-<pre class="programlisting">$ less [options] file_name</pre>
-</div>
-<div class="section" title="9.3.2. Frequently Used Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2539350"></a>9.3.2. Frequently Used Options</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_ff"></a>-I: Case-insensitive searches.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_103"></a>-?: Shows help.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.3. Frequently Used Commands">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2539404"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_105"></a>[Space bar]: Next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_106"></a>b: Previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_10a"></a>'^ or g: Go to start of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_10b"></a>'$ or G: Go to end of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_10d"></a>=: File information.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_10e"></a>h: Help.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_10f"></a>q: Quit.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.4. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2539494"></a>9.3.4. Examples</h4></div></div></div>
-<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
-$ less +F /var/log/mail.log              #Follow mode for log
-$ file * | less                          #Easier file analysis.
-$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
-</div>
-</div>
-</div>
-<div class="section" title="10. Directory Structure">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2539510"></a>10. Directory Structure</h2></div></div></div>
-<p id="ch7interim_assessment_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
-<p id="ch7interim_assessment_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
-<table summary="Directory Structure" border="1"><colgroup>
-<col width="15">
-<col width="48">
-</colgroup></table>
-<div class="section" title="10.1. man hier">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2539784"></a>10.1. man hier</h3></div></div></div>
-<p id="ch7interim_assessment_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
-<pre class="programlisting">$ man hier</pre>
-</div>
-<div class="section" title="10.2. ls -l">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2539801"></a>10.2. ls -l</h3></div></div></div>
-<p id="ch7interim_assessment_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
-<pre class="programlisting">$ ls -l</pre>
-<p id="ch7interim_assessment_138"></a>This can be done after entering the required directory.</p>
-</div>
-</div>
-<div class="section" title="11. Permissions and Ownership">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2539824"></a>11. Permissions and Ownership</h2></div></div></div>
-<div class="section" title="11.1. chmod">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2539833"></a>11.1. chmod</h3></div></div></div>
-<p id="ch7interim_assessment_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
-<div class="section" title="11.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2539859"></a>11.1.1. Usage</h4></div></div></div>
-<p id="ch7interim_assessment_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
-<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
-<p id="ch7interim_assessment_13b"></a>To view what the permissions currently are, type:</p>
-<pre class="programlisting">$ ls -l file</pre>
-</div>
-<div class="section" title="11.1.2. Command line options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2539887"></a>11.1.2. Command line options</h4></div></div></div>
-<p id="ch7interim_assessment_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch7interim_assessment_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
-</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2539924"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
-<p id="ch7interim_assessment_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
-<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
-<p id="ch7interim_assessment_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="8">
-<col width="45">
-</colgroup></table>
-<p id="ch7interim_assessment_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="54">
-</colgroup></table>
-<p id="ch7interim_assessment_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="5">
-<col width="14">
-<col width="48">
-</colgroup></table>
-<p id="ch7interim_assessment_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
-</div>
-<div class="section" title="11.1.2.2. Symbolic examples">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2540485"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
-<p id="ch7interim_assessment_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
-<pre class="programlisting">$ chmod ug+rw mydir
-$ ls -ld mydir
-drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
-<p id="ch7interim_assessment_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
-<pre class="programlisting">$ chmod a-w myfile
-$ ls -l myfile
--r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
-<p id="ch7interim_assessment_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
-<pre class="programlisting">$ chmod ug=rx mydir
-$ ls -ld mydir
-dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
-</div>
-<div class="section" title="11.1.2.3. Octal numbers">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2540528"></a>11.1.2.3. Octal numbers</h5></div></div></div>
-<p id="ch7interim_assessment_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
-<pre class="programlisting">$ chmod 664 myfile
-$ ls -l myfile
--rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
-<p id="ch7interim_assessment_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
-<pre class="programlisting">$ chmod 0664 myfile</pre>
-</div>
-<div class="section" title="11.1.2.4. Special modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2540566"></a>11.1.2.4. Special modes</h5></div></div></div>
-<p id="ch7interim_assessment_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
-<p id="ch7interim_assessment_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
-</div>
-</div>
-</div>
-</div>
-<div class="section" title="12. Redirection and Piping">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2540610"></a>12. Redirection and Piping</h2></div></div></div>
-<p id="ch7interim_assessment_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
-<p id="ch7interim_assessment_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
-<div class="section" title="12.1. Redirecting standard input and standard output">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2540646"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
-<p id="ch7interim_assessment_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
-<pre class="programlisting">$ command1 &gt; file1</pre>
-<p id="ch7interim_assessment_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
-<pre class="programlisting">$ command1 &lt; file1</pre>
-<p id="ch7interim_assessment_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
-<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
-<p id="ch7interim_assessment_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
-</div>
-<div class="section" title="12.2. Piping">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2540714"></a>12.2. Piping</h3></div></div></div>
-<p id="ch7interim_assessment_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
-A pipeline of three programs run on a text terminal:</p>
-<pre class="programlisting">$ command1 | command2</pre>
-<p id="ch7interim_assessment_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
-<p id="ch7interim_assessment_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
-<pre class="programlisting">$ command1 &gt; tempfile
-$ command2 &lt; tempfile
-$ rm tempfile</pre>
-<p id="ch7interim_assessment_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
-<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
-<p id="ch7interim_assessment_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
-</div>
-<div class="section" title="12.3. Redirecting to and from the standard file handles">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2540776"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
-<p id="ch7interim_assessment_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
-<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
-<col width="12">
-<col width="13">
-<col width="24">
-</colgroup></table>
-<p id="ch7interim_assessment_18d"></a>For example:</p>
-<pre class="programlisting">$ command1 2&gt; file1</pre>
-<p id="ch7interim_assessment_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
-<p id="ch7interim_assessment_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
-<p id="ch7interim_assessment_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
-<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
-<p id="ch7interim_assessment_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
-<p id="ch7interim_assessment_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
-<p id="ch7interim_assessment_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
-<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
-<p id="ch7interim_assessment_194"></a>A simplified form of the command:</p>
-<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
-<p id="ch7interim_assessment_195"></a>is:</p>
-<pre class="programlisting">$ command &amp;&gt;file</pre>
-<p id="ch7interim_assessment_196"></a>or:</p>
-<pre class="programlisting">$command &gt;&amp;file</pre>
-</div>
-<div class="section" title="12.4. Chained pipelines">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2540984"></a>12.4. Chained pipelines</h3></div></div></div>
-<p id="ch7interim_assessment_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
-<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
-<p id="ch7interim_assessment_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
-</div>
-<div class="section" title="12.5. Redirect to multiple outputs">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2541018"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
-<p id="ch7interim_assessment_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
-<pre class="programlisting">$ ls -lrt | tee xyz</pre>
-<p id="ch7interim_assessment_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
-</div>
-</div>
-<div class="section" title="13. More Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2541049"></a>13. More Text Processing</h2></div></div></div>
-<div class="section" title="13.1. grep">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2541057"></a>13.1. grep</h3></div></div></div>
-<p id="ch7interim_assessment_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
-<div class="section" title="13.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2541089"></a>13.1.1. Usage</h4></div></div></div>
-<p id="ch7interim_assessment_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
-<pre class="programlisting">$ grep apple fruitlist.txt</pre>
-<p id="ch7interim_assessment_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
-<p id="ch7interim_assessment_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
-<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
-<p id="ch7interim_assessment_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
-<p id="ch7interim_assessment_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
-<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
-<p id="ch7interim_assessment_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
-<div class="section" title="13.1.1.1. Variations">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2541168"></a>13.1.1.1. Variations</h5></div></div></div>
-<p id="ch7interim_assessment_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
-<p id="ch7interim_assessment_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
-<p id="ch7interim_assessment_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
-</div>
-</div>
-</div>
-<div class="section" title="13.2. tr">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2541248"></a>13.2. tr</h3></div></div></div>
-<p id="ch7interim_assessment_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
-<p id="ch7interim_assessment_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
-<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
-<p id="ch7interim_assessment_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
-<p id="ch7interim_assessment_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
-<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
-<p id="ch7interim_assessment_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
-<p id="ch7interim_assessment_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
-<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
-<p id="ch7interim_assessment_1ab"></a>therefore removes all non-alphanumeric characters.</p>
-<p id="ch7interim_assessment_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
-<pre class="programlisting">$ tr -s '\n' '\n'</pre>
-<p id="ch7interim_assessment_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
-<p id="ch7interim_assessment_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
-<pre class="programlisting">$ tr -d '\r'</pre>
-<p id="ch7interim_assessment_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
-<p id="ch7interim_assessment_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
-</div>
-</div>
-<div class="section" title="14. Elementary Regex">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2541399"></a>14. Elementary Regex</h2></div></div></div>
-<p id="ch7interim_assessment_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
-<p id="ch7interim_assessment_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
-<p id="ch7interim_assessment_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
-<p id="ch7interim_assessment_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
-<table summary="Elementary Regex" border="1"><colgroup>
-<col width="13">
-<col width="60">
-</colgroup></table>
-<div class="section" title="14.1. Lazy quantification">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2541615"></a>14.1. Lazy quantification</h3></div></div></div>
-<p id="ch7interim_assessment_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
-<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
-<p id="ch7interim_assessment_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
-<p id="ch7interim_assessment_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
-</div>
-</div>
-<div class="section" title="15. One Liners">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2541692"></a>15. One Liners</h2></div></div></div>
-<p id="ch7interim_assessment_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
-<p id="ch7interim_assessment_1cd"></a>The one liner can be</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem"><p id="ch7interim_assessment_1ce"></a>An expression written in the language of the shell.</p></li>
-<li class="listitem"><p id="ch7interim_assessment_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
-<li class="listitem"><p id="ch7interim_assessment_1d0"></a>The invocation of a compiler together with source to compile and
-instructions for executing the compiled program.</p></li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_1d1"></a>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.</p>
-<p id="ch7interim_assessment_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
-<p id="ch7interim_assessment_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
-<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
-<p id="ch7interim_assessment_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
-<p id="ch7interim_assessment_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
-<p id="ch7interim_assessment_1d6"></a>Here are the first few of them:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem">
-<p id="ch7interim_assessment_1d7"></a>Print the total number of input lines:</p>
-<p id="ch7interim_assessment_1d8"></a>END { print NR }</p>
-</li>
-<li class="listitem">
-<p id="ch7interim_assessment_1d9"></a>Print the tenth input line:</p>
-<p id="ch7interim_assessment_1da"></a>NR == 10</p>
-</li>
-<li class="listitem">
-<p id="ch7interim_assessment_1db"></a>Print the last field of every input line:</p>
-<p id="ch7interim_assessment_1dc"></a>{ print $NF }</p>
-</li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch7interim_assessment_1dd"></a>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.</p>
-<p id="ch7interim_assessment_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
-<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
-*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
-<p id="ch7interim_assessment_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
-<p id="ch7interim_assessment_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
-<pre class="programlisting">$ prog foo 'f??'; echo $?
-
-$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
-<p id="ch7interim_assessment_1e1"></a>Here is a one line shell script to show directories:</p>
-<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
-</div>
-</div>
-</div></body>
-</html>
--- a/web/html/ch8ult_module_plan.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1139 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>ULT Module Plan </title>
-<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
-<link rel="stylesheet" href="/review/support/styles.css" type="text/css">
-<script type="text/javascript" src="/review/support/jquery-min.js"></script>
-<script type="text/javascript" src="/review/support/form.js"></script>
-<script type="text/javascript" src="/review/support/hsbook.js"></script>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch8ult_module_plan">
-<div class="titlepage"></div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="article"><a href="#id2718075"></a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2528200">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2717879">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2769136">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2769410">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2769551">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2769560">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2769839">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2769848">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2770012">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2770073">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2770176">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2770259">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2770440">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2770448">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2770542">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2770752">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2770844">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2770897">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2770906">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2771220">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2771353">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2771662">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2771755">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2771764">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2771851">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2771978">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2772065">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2772200">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2772308">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2772317">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2772505">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2772616">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2772859">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2773133">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2773150">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2773173">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2773182">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2773959">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2773995">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2774063">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2774125">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2774332">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2774367">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2774397">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2774406">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2774596">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2774748">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2774972">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2775048">15. One Liners</a></span></dt>
-</dl></dd>
-</dl>
-</div>
-<div class="article">
-<div class="titlepage">
-<div><div><h2 class="title" id="id2718075"></a></h2></div></div>
-<hr>
-</div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="section"><a href="#id2528200">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2717879">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2769136">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2769410">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2769551">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2769560">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2769839">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2769848">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2770012">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2770073">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2770176">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2770259">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2770440">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2770448">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2770542">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2770752">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2770844">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2770897">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2770906">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2771220">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2771353">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2771662">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2771755">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2771764">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2771851">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2771978">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2772065">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2772200">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2772308">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2772317">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2772505">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2772616">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2772859">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2773133">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2773150">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2773173">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2773182">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2773959">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2773995">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2774063">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2774125">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2774332">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2774367">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2774397">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2774406">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2774596">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2774748">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2774972">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2775048">15. One Liners</a></span></dt>
-</dl>
-</div>
-<div class="section" title="1. Introducing Linux">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2528200"></a>1. Introducing Linux</h2></div></div></div>
-<p id="ch8ult_module_plan_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
-<p id="ch8ult_module_plan_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
-<p id="ch8ult_module_plan_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
-<p id="ch8ult_module_plan_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
-<div class="section" title="1.1. Historical Background">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2717879"></a>1.1. Historical Background</h3></div></div></div>
-<div class="section" title="1.1.1. Events leading to the creation">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2715861"></a>1.1.1. Events leading to the creation</h4></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
-</ul></div>
-</div>
-<div class="section" title="1.1.2. The Creation of Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2769092"></a>1.1.2. The Creation of Linux</h4></div></div></div>
-<p id="ch8ult_module_plan_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
-<p id="ch8ult_module_plan_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
-</div>
-</div>
-<div class="section" title="1.2. Design and Implications">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2769136"></a>1.2. Design and Implications</h3></div></div></div>
-<p id="ch8ult_module_plan_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
-<div class="section" title="1.2.1. User Interface">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2769161"></a>1.2.1. User Interface</h4></div></div></div>
-<p id="ch8ult_module_plan_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
-<p id="ch8ult_module_plan_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
-</div>
-<div class="section" title="1.2.2. Development">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2769215"></a>1.2.2. Development</h4></div></div></div>
-<p id="ch8ult_module_plan_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
-<p id="ch8ult_module_plan_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
-<p id="ch8ult_module_plan_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
-</div>
-<div class="section" title="1.2.3. Community">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2769272"></a>1.2.3. Community</h4></div></div></div>
-<p id="ch8ult_module_plan_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
-<p id="ch8ult_module_plan_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
-<p id="ch8ult_module_plan_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
-</div>
-<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2769317"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
-<p id="ch8ult_module_plan_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
-</div>
-<div class="section" title="1.2.5. Programming on Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2769363"></a>1.2.5. Programming on Linux</h4></div></div></div>
-<p id="ch8ult_module_plan_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
-<p id="ch8ult_module_plan_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
-<p id="ch8ult_module_plan_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
-</div>
-</div>
-<div class="section" title="1.3. Reasons for Using Linux">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2769410"></a>1.3. Reasons for Using Linux</h3></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_16"></a>Linux is free:</p></li></ul></div>
-<p id="ch8ult_module_plan_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
-Most of all, Linux is free as in "free speech":
-The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
-<p id="ch8ult_module_plan_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_1a"></a>Linux was made to keep on running:</p></li></ul></div>
-<p id="ch8ult_module_plan_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_1c"></a>Linux is secure and versatile:</p></li></ul></div>
-<p id="ch8ult_module_plan_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_1e"></a>Linux is scalable:</p></li></ul></div>
-<p id="ch8ult_module_plan_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
-<p id="ch8ult_module_plan_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
-</div>
-</div>
-<div class="section" title="2. Getting Started">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2769551"></a>2. Getting Started</h2></div></div></div>
-<div class="section" title="2.1. Logging in, activating the user interface and logging out">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2769560"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
-<p id="ch8ult_module_plan_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
-<div class="section" title="2.1.1. Graphical Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2769590"></a>2.1.1. Graphical Mode</h4></div></div></div>
-<p id="ch8ult_module_plan_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
-<p id="ch8ult_module_plan_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
-It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
-<p id="ch8ult_module_plan_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
-<p id="ch8ult_module_plan_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
-<p id="ch8ult_module_plan_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
-<p id="ch8ult_module_plan_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
-<p id="ch8ult_module_plan_29"></a>Another common form for a prompt is this one:
-[</p>
-<div class="reference">
-<div class="titlepage"><hr></div>user@host</div>
-<p> dir]</p>
-<p id="ch8ult_module_plan_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
-<p id="ch8ult_module_plan_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
-</div>
-<div class="section" title="2.1.2. Text Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2769750"></a>2.1.2. Text Mode</h4></div></div></div>
-<p id="ch8ult_module_plan_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
-<p id="ch8ult_module_plan_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
-reasons.</p>
-<p id="ch8ult_module_plan_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
-<p id="ch8ult_module_plan_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
-<p id="ch8ult_module_plan_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
-</div>
-</div>
-</div>
-<div class="section" title="3. Basic Commands">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2769839"></a>3. Basic Commands</h2></div></div></div>
-<div class="section" title="3.1. ls">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2769848"></a>3.1. ls</h3></div></div></div>
-<p id="ch8ult_module_plan_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
-<p id="ch8ult_module_plan_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
-<p id="ch8ult_module_plan_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
-<pre class="programlisting">$ ls
-jeeves.rst psmith.html blandings.html
-$ ls -l
-drwxr--r--   1 plum  editors   4096  jeeves
--rw-r--r--   1 plum  editors  30405  psmith
--r-xr-xr-x   1 plum  plum      8460  blandings</pre>
-<p id="ch8ult_module_plan_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
-</div>
-<div class="section" title="3.2. date">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2770012"></a>3.2. date</h3></div></div></div>
-<p id="ch8ult_module_plan_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
-<p id="ch8ult_module_plan_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
-<pre class="programlisting">$date
-Tue Sep  8 12:01:45 IST 2009</pre>
-<p id="ch8ult_module_plan_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
-<pre class="programlisting">$date --set="20040908 01:22"</pre>
-<p id="ch8ult_module_plan_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
-<pre class="programlisting">$man date</pre>
-<p id="ch8ult_module_plan_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
-</div>
-<div class="section" title="3.3. cd">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2770073"></a>3.3. cd</h3></div></div></div>
-<p id="ch8ult_module_plan_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
-<p id="ch8ult_module_plan_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
-<p id="ch8ult_module_plan_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
-<p id="ch8ult_module_plan_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
-<p id="ch8ult_module_plan_46"></a>Absolute paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch8ult_module_plan_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_48"></a>For example to get to /boot/grub you would type:</p>
-<pre class="programlisting">$cd /boot/grub</pre>
-<p id="ch8ult_module_plan_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
-<p id="ch8ult_module_plan_4a"></a>Relative paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch8ult_module_plan_4b"></a>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.</p>
-<p id="ch8ult_module_plan_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
-<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_4d"></a>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.</p>
-</div>
-<div class="section" title="3.4. who">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2770176"></a>3.4. who</h3></div></div></div>
-<p id="ch8ult_module_plan_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
-<p id="ch8ult_module_plan_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
-<pre class="programlisting">$who
-beeblebrox tty7         2009-09-08 10:50 (:0)
-beeblebrox pts/0        2009-09-08 11:25 (:0.0)
-dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
-beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
-<p id="ch8ult_module_plan_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
-<p id="ch8ult_module_plan_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
-<pre class="programlisting">$man who</pre>
-<p id="ch8ult_module_plan_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
-</div>
-<div class="section" title="3.5. mkdir">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2770259"></a>3.5. mkdir</h3></div></div></div>
-<p id="ch8ult_module_plan_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
-<pre class="programlisting">$mkdir name_of_directory</pre>
-<p id="ch8ult_module_plan_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
-<div class="section" title="3.5.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2770291"></a>3.5.1. Options</h4></div></div></div>
-<p id="ch8ult_module_plan_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
-</div>
-<div class="section" title="3.5.2. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2770353"></a>3.5.2. Examples</h4></div></div></div>
-<p id="ch8ult_module_plan_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
-<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
-<p id="ch8ult_module_plan_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
-<p id="ch8ult_module_plan_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
-<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
-<p id="ch8ult_module_plan_5d"></a>This will create:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_5e"></a>tag</p></li>
-<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
-</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
-</div>
-</div>
-</div>
-<div class="section" title="4. Getting Help">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2770440"></a>4. Getting Help</h2></div></div></div>
-<div class="section" title="4.1. apropos and whatis">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2770448"></a>4.1. apropos and whatis</h3></div></div></div>
-<p id="ch8ult_module_plan_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
-<pre class="programlisting">$ apropos grep
-egrep       egrep (1)       Search a file for a pattern using full regular expressions
-fgrep       fgrep (1)       Search a file for a fixed-character string
-fmlgrep     fmlgrep (1)     Search a file for a pattern
-grep        grep (1)        Search a file for a pattern
-gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
-nisgrep     nismatch (1)    Utilities for searching NIS+ tables
-pgrep       pgrep (1)       Find or signal a process by name or other attribute
-zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
-...</pre>
-<p id="ch8ult_module_plan_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
-<p id="ch8ult_module_plan_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
-<pre class="programlisting">$whatis ls
-ls (1)           - list directory contents</pre>
-<p id="ch8ult_module_plan_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
-<p id="ch8ult_module_plan_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
-<pre class="programlisting">$apropos browser
-gmusicbrowser (1)    - Jukebox for large collections of audio files
-infobrowser (1)      - read Info documents
-libsmbclient (7)     - An extension library for browsers and that               can be used...
-opera (1)            - a standards-compliant graphical Web browser
-sensible-browser (1) - sensible editing, paging, and web browsing
-smbtree (1)          - A text based smb network browser
-tvtk_doc (1)         - A GUI based TVTK documentation search browser.
-viewres (1)          - graphical class browser for Xt
-w3m (1)              - a text based Web browser and pager
-www-browser (1)      - a text based Web browser and pager
-...</pre>
-</div>
-<div class="section" title="4.2. man">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2770542"></a>4.2. man</h3></div></div></div>
-<p id="ch8ult_module_plan_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
-<p id="ch8ult_module_plan_66"></a>To read a manual page for a Unix command, one can use:</p>
-<pre class="programlisting">$ man &lt;command_name&gt;</pre>
-<p id="ch8ult_module_plan_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
-<p id="ch8ult_module_plan_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
-<pre class="programlisting">$man 3 printf</pre>
-<p id="ch8ult_module_plan_69"></a>Another example:</p>
-<pre class="programlisting">$man man</pre>
-<p id="ch8ult_module_plan_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
-<div class="section" title="4.2.1. Layout">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2770624"></a>4.2.1. Layout</h4></div></div></div>
-<p id="ch8ult_module_plan_6b"></a>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:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch8ult_module_plan_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch8ult_module_plan_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch8ult_module_plan_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch8ult_module_plan_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch8ult_module_plan_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch8ult_module_plan_71"></a>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.</p>
-<p id="ch8ult_module_plan_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
-<p id="ch8ult_module_plan_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
-<p id="ch8ult_module_plan_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
-<p id="ch8ult_module_plan_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
-<p id="ch8ult_module_plan_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
-</div>
-</div>
-<div class="section" title="4.3. info">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2770752"></a>4.3. info</h3></div></div></div>
-<p id="ch8ult_module_plan_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
-<p id="ch8ult_module_plan_78"></a>The syntax is</p>
-<pre class="programlisting">$ info &lt;command_name&gt;</pre>
-<p id="ch8ult_module_plan_79"></a><span class="emphasis"><em>info</em></span> 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</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
-</div>
-<div class="section" title="4.4. --help">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2770844"></a>4.4. --help</h3></div></div></div>
-<p id="ch8ult_module_plan_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
-<pre class="programlisting">$ userprompt@host: cat --help
-Usage: cat [OPTION] [FILE]...
-Concatenate FILE(s), or standard input, to standard output.
-
-  -A, --show-all           equivalent to -vET
-  -b, --number-nonblank    number nonempty output lines
-  -e                       equivalent to -vE
-  -E, --show-ends          display $ at end of each line
-  -n, --number             number all output lines
-  -s, --squeeze-blank      suppress repeated empty output lines
-  -t                       equivalent to -vT
-  -T, --show-tabs          display TAB characters as ^I
-  -u                       (ignored)
-  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
-  --help     display this help and exit
-  --version  output version information and exit
-
-With no FILE, or when FILE is -, read standard input.
-
-Examples:
-  cat f - g  Output f's contents, then standard input, then g's           contents.
-  cat        Copy standard input to standard output.
-
-Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
-</div>
-</div>
-<div class="section" title="5. Basic file handling">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2770897"></a>5. Basic file handling</h2></div></div></div>
-<div class="section" title="5.1. cp">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2770906"></a>5.1. cp</h3></div></div></div>
-<p id="ch8ult_module_plan_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
-<div class="section" title="5.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2770923"></a>5.1.1. Usage</h4></div></div></div>
-<p id="ch8ult_module_plan_82"></a>To copy a file to another file:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
-<p id="ch8ult_module_plan_83"></a>To copy a file to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
-<p id="ch8ult_module_plan_84"></a>To copy a directory to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
-SourceDirectory ... TargetDirectory</pre>
-</div>
-<div class="section" title="5.1.2. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2770957"></a>5.1.2. Flags</h4></div></div></div>
-<p id="ch8ult_module_plan_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
-<p id="ch8ult_module_plan_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
-<p id="ch8ult_module_plan_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
-<p id="ch8ult_module_plan_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_89"></a>The time of the last data modification and the time of the last access.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
-</div>
-<div class="section" title="5.1.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2771056"></a>5.1.3. Examples</h4></div></div></div>
-<p id="ch8ult_module_plan_8d"></a>To make a copy of a file in the current directory, enter:</p>
-<pre class="programlisting">$ cp prog.c prog.bak</pre>
-<p id="ch8ult_module_plan_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
-<p id="ch8ult_module_plan_8f"></a>To copy a file in your current directory into another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
-<p id="ch8ult_module_plan_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
-<p id="ch8ult_module_plan_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
-<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
-<p id="ch8ult_module_plan_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
-<p id="ch8ult_module_plan_93"></a>To copy all the files in a directory to a new directory, enter:</p>
-<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
-<p id="ch8ult_module_plan_94"></a>This copies only the files in the clients directory to the customers directory.</p>
-<p id="ch8ult_module_plan_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch8ult_module_plan_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
-<p id="ch8ult_module_plan_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
-<p id="ch8ult_module_plan_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
-<p id="ch8ult_module_plan_9a"></a>To use pattern-matching characters to copy files, enter:</p>
-<pre class="programlisting">$ cp programs/*.py .</pre>
-<p id="ch8ult_module_plan_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
-</div>
-</div>
-<div class="section" title="5.2. mv">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2771220"></a>5.2. mv</h3></div></div></div>
-<p id="ch8ult_module_plan_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
-<div class="section" title="5.2.1. Conflicting existing file">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2771244"></a>5.2.1. Conflicting existing file</h4></div></div></div>
-<p id="ch8ult_module_plan_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
-</div>
-<div class="section" title="5.2.2. Differences with copy and delete">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2771264"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
-<p id="ch8ult_module_plan_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
-</div>
-<div class="section" title="5.2.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2771294"></a>5.2.3. Examples</h4></div></div></div>
-<pre class="programlisting">$ mv myfile mynewfilename    renames a file
-$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
-$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
-$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
-$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
-$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
-$ mv foo bar baz dir         moves multiple files to directory dir
-$ mv --help                  shows a very concise help about the                syntax of the command
-$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
-<p id="ch8ult_module_plan_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
-<p id="ch8ult_module_plan_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
-</div>
-</div>
-<div class="section" title="5.3. rm">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2771353"></a>5.3. rm</h3></div></div></div>
-<p id="ch8ult_module_plan_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
-<p id="ch8ult_module_plan_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
-<pre class="programlisting">$ rm -i foo
-remove foo? y</pre>
-<div class="section" title="5.3.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2768880"></a>5.3.1. Options</h4></div></div></div>
-<p id="ch8ult_module_plan_a3"></a>Common options that rm accepts include:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
-<p id="ch8ult_module_plan_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
-<p id="ch8ult_module_plan_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
-<pre class="programlisting">xargs rm &lt; filelist</pre>
-<p id="ch8ult_module_plan_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
-</div>
-<div class="section" title="5.3.2. Permissions">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2768983"></a>5.3.2. Permissions</h4></div></div></div>
-<p id="ch8ult_module_plan_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
-<p id="ch8ult_module_plan_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
-<p id="ch8ult_module_plan_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
-</div>
-</div>
-</div>
-<div class="section" title="6. Command Line Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2771662"></a>6. Command Line Arguments</h2></div></div></div>
-<p id="ch8ult_module_plan_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
-<p id="ch8ult_module_plan_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
-<pre class="programlisting">rm file.s</pre>
-<p id="ch8ult_module_plan_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
-<p id="ch8ult_module_plan_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
-<p id="ch8ult_module_plan_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
-<p id="ch8ult_module_plan_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
-<p id="ch8ult_module_plan_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
-</div>
-<div class="section" title="7. Basic Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2771755"></a>7. Basic Text Processing</h2></div></div></div>
-<div class="section" title="7.1. head">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2771764"></a>7.1. head</h3></div></div></div>
-<p id="ch8ult_module_plan_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
-<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
-<p id="ch8ult_module_plan_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
-<pre class="programlisting">$ head -n 20 filename</pre>
-<p id="ch8ult_module_plan_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ head -n 5 foo*</pre>
-<p id="ch8ult_module_plan_b9"></a>Some versions omit the n and just let you say -5.</p>
-<div class="section" title="7.1.1. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2771815"></a>7.1.1. Flags</h4></div></div></div>
-<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
-<p id="ch8ult_module_plan_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
-<p id="ch8ult_module_plan_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
-<pre class="programlisting">sed 5q foo</pre>
-<p id="ch8ult_module_plan_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
-</div>
-</div>
-<div class="section" title="7.2. tail">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2771851"></a>7.2. tail</h3></div></div></div>
-<p id="ch8ult_module_plan_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
-<p id="ch8ult_module_plan_be"></a>The command-syntax is:</p>
-<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
-<p id="ch8ult_module_plan_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
-<pre class="programlisting">$ tail -n 20 filename</pre>
-<p id="ch8ult_module_plan_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ tail -c 15 foo*</pre>
-<p id="ch8ult_module_plan_c1"></a>This example shows all lines of filename from the second line onwards:</p>
-<pre class="programlisting">$ tail -n +2 filename</pre>
-<p id="ch8ult_module_plan_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
-<pre class="programlisting">$ tail -20 filename
-$ tail -50c filename</pre>
-<p id="ch8ult_module_plan_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
-<div class="section" title="7.2.1. File monitoring">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2771929"></a>7.2.1. File monitoring</h4></div></div></div>
-<p id="ch8ult_module_plan_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
-<pre class="programlisting">$ tail -f /var/adm/messages</pre>
-<p id="ch8ult_module_plan_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
-<p id="ch8ult_module_plan_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
-</div>
-</div>
-<div class="section" title="7.3. cut">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2771978"></a>7.3. cut</h3></div></div></div>
-<p id="ch8ult_module_plan_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
-<p id="ch8ult_module_plan_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
-<p id="ch8ult_module_plan_c9"></a>Assuming a file named file containing the lines:</p>
-<pre class="programlisting">foo:bar:baz:qux:quux
-one:two:three:four:five:six:seven
-alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-<p id="ch8ult_module_plan_ca"></a>To output the fourth through tenth characters of each line:</p>
-<pre class="programlisting">$ cut -c 4-10 file</pre>
-<p id="ch8ult_module_plan_cb"></a>This gives the output:</p>
-<pre class="programlisting">:bar:ba
-:two:th
-ha:beta</pre>
-<p id="ch8ult_module_plan_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
-<pre class="programlisting">$ cut -d : -f 5- file</pre>
-<p id="ch8ult_module_plan_cd"></a>This gives the output:</p>
-<pre class="programlisting">quux
-five:six:seven
-epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-</div>
-<div class="section" title="7.4. paste">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2772065"></a>7.4. paste</h3></div></div></div>
-<p id="ch8ult_module_plan_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
-<p id="ch8ult_module_plan_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
-<pre class="programlisting">$ paste who where when &gt; www</pre>
-<p id="ch8ult_module_plan_d0"></a>If the files contain:</p>
-<table summary="paste" border="1"><colgroup>
-<col width="11">
-<col width="12">
-<col width="12">
-</colgroup></table>
-<p id="ch8ult_module_plan_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
-<pre class="programlisting">Batman            GothamCity       January 3
-Trillian          Andromeda        February 4
-Jeeves            London           March 19</pre>
-</div>
-</div>
-<div class="section" title="8. Shell Meta Characters">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2772200"></a>8. Shell Meta Characters</h2></div></div></div>
-<p id="ch8ult_module_plan_de"></a>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.</p>
-<p id="ch8ult_module_plan_df"></a>The shell meta characters include:</p>
-<p id="ch8ult_module_plan_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
-<p id="ch8ult_module_plan_e1"></a>Different shells may differ in the meta characters recognized.</p>
-<p id="ch8ult_module_plan_e2"></a>As an example,</p>
-<pre class="programlisting">$ ls file.*</pre>
-<p id="ch8ult_module_plan_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
-<pre class="programlisting">$ ls file.?</pre>
-<p id="ch8ult_module_plan_e4"></a>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:</p>
-<pre class="programlisting">$ more c*</pre>
-<p id="ch8ult_module_plan_e5"></a>because the c* matches that long file name.</p>
-<p id="ch8ult_module_plan_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
-<pre class="programlisting">$ rm ??more</pre>
-<p id="ch8ult_module_plan_e7"></a>or:</p>
-<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
-<p id="ch8ult_module_plan_e8"></a>or:</p>
-<pre class="programlisting">$ rm ''*|more''</pre>
-</div>
-<div class="section" title="9. Looking At Files">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2772308"></a>9. Looking At Files</h2></div></div></div>
-<div class="section" title="9.1. cat">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2772317"></a>9.1. cat</h3></div></div></div>
-<p id="ch8ult_module_plan_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
-<p id="ch8ult_module_plan_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
-<p id="ch8ult_module_plan_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
-<div class="section" title="9.1.1. Jargon File Definition">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2772360"></a>9.1.1. Jargon File Definition</h4></div></div></div>
-<p id="ch8ult_module_plan_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
-<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
-     pause (syn. blast).
-
-2. By extension, to dump large amounts of data at an unprepared target or
-     with no intention of browsing it carefully. Usage: considered silly.
-     Rare outside Unix sites. See also dd, BLT.
-
-     Among Unix fans, *cat(1)* is considered an excellent example of
-     user-interface design, because it delivers the file contents without
-     such verbosity as spacing or headers between the files, and because
-     it does not require the files to consist of lines of text, but works
-     with any sort of data.
-
-     Among Unix critics, *cat(1)* is considered the canonical example of
-     bad user-interface design, because of its woefully unobvious name.
-     It is far more often used to blast a single file to standard output
-     than to concatenate two or more files. The name cat for the former
-     operation is just as unintuitive as, say, LISP's cdr.
-
-     Of such oppositions are holy wars made...</pre>
-</div>
-<div class="section" title="9.1.2. Useless Use of 'cat'">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2772400"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
-<p id="ch8ult_module_plan_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
-<p id="ch8ult_module_plan_ee"></a>Nevertheless one sees people doing:</p>
-<pre class="programlisting">$ cat file | some_command and its args ...</pre>
-<p id="ch8ult_module_plan_ef"></a>instead of the equivalent and cheaper:</p>
-<pre class="programlisting">&lt;file some_command and its args ...</pre>
-<p id="ch8ult_module_plan_f0"></a>or (equivalently and more classically):</p>
-<pre class="programlisting">some_command and its args ... &lt;file</pre>
-<p id="ch8ult_module_plan_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
-<p id="ch8ult_module_plan_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
-</div>
-<div class="section" title="9.1.3. zcat">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2772471"></a>9.1.3. zcat</h4></div></div></div>
-<p id="ch8ult_module_plan_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
-</div>
-</div>
-<div class="section" title="9.2. more">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2772505"></a>9.2. more</h3></div></div></div>
-<p id="ch8ult_module_plan_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
-<div class="section" title="9.2.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2772524"></a>9.2.1. Usage</h4></div></div></div>
-<p id="ch8ult_module_plan_f5"></a>The command-syntax is:</p>
-<pre class="programlisting">$ more [options] [file_name]</pre>
-<p id="ch8ult_module_plan_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
-<p id="ch8ult_module_plan_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
-<p id="ch8ult_module_plan_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
-<p id="ch8ult_module_plan_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
-</div>
-</div>
-<div class="section" title="9.3. less">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2772616"></a>9.3. less</h3></div></div></div>
-<p id="ch8ult_module_plan_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
-<div class="section" title="9.3.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2772644"></a>9.3.1. Usage</h4></div></div></div>
-<p id="ch8ult_module_plan_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
-<p id="ch8ult_module_plan_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
-<p id="ch8ult_module_plan_fd"></a>The command-syntax is:</p>
-<pre class="programlisting">$ less [options] file_name</pre>
-</div>
-<div class="section" title="9.3.2. Frequently Used Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2772699"></a>9.3.2. Frequently Used Options</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_ff"></a>-I: Case-insensitive searches.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_103"></a>-?: Shows help.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.3. Frequently Used Commands">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2772752"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_105"></a>[Space bar]: Next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_106"></a>b: Previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_10a"></a>'^ or g: Go to start of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_10b"></a>'$ or G: Go to end of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_10d"></a>=: File information.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_10e"></a>h: Help.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_10f"></a>q: Quit.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.4. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2772843"></a>9.3.4. Examples</h4></div></div></div>
-<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
-$ less +F /var/log/mail.log              #Follow mode for log
-$ file * | less                          #Easier file analysis.
-$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
-</div>
-</div>
-</div>
-<div class="section" title="10. Directory Structure">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2772859"></a>10. Directory Structure</h2></div></div></div>
-<p id="ch8ult_module_plan_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
-<p id="ch8ult_module_plan_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
-<table summary="Directory Structure" border="1"><colgroup>
-<col width="15">
-<col width="48">
-</colgroup></table>
-<div class="section" title="10.1. man hier">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2773133"></a>10.1. man hier</h3></div></div></div>
-<p id="ch8ult_module_plan_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
-<pre class="programlisting">$ man hier</pre>
-</div>
-<div class="section" title="10.2. ls -l">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2773150"></a>10.2. ls -l</h3></div></div></div>
-<p id="ch8ult_module_plan_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
-<pre class="programlisting">$ ls -l</pre>
-<p id="ch8ult_module_plan_138"></a>This can be done after entering the required directory.</p>
-</div>
-</div>
-<div class="section" title="11. Permissions and Ownership">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2773173"></a>11. Permissions and Ownership</h2></div></div></div>
-<div class="section" title="11.1. chmod">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2773182"></a>11.1. chmod</h3></div></div></div>
-<p id="ch8ult_module_plan_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
-<div class="section" title="11.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2773207"></a>11.1.1. Usage</h4></div></div></div>
-<p id="ch8ult_module_plan_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
-<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
-<p id="ch8ult_module_plan_13b"></a>To view what the permissions currently are, type:</p>
-<pre class="programlisting">$ ls -l file</pre>
-</div>
-<div class="section" title="11.1.2. Command line options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2773236"></a>11.1.2. Command line options</h4></div></div></div>
-<p id="ch8ult_module_plan_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch8ult_module_plan_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
-</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2773272"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
-<p id="ch8ult_module_plan_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
-<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
-<p id="ch8ult_module_plan_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="8">
-<col width="45">
-</colgroup></table>
-<p id="ch8ult_module_plan_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="54">
-</colgroup></table>
-<p id="ch8ult_module_plan_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="5">
-<col width="14">
-<col width="48">
-</colgroup></table>
-<p id="ch8ult_module_plan_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
-</div>
-<div class="section" title="11.1.2.2. Symbolic examples">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2773833"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
-<p id="ch8ult_module_plan_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
-<pre class="programlisting">$ chmod ug+rw mydir
-$ ls -ld mydir
-drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
-<p id="ch8ult_module_plan_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
-<pre class="programlisting">$ chmod a-w myfile
-$ ls -l myfile
--r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
-<p id="ch8ult_module_plan_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
-<pre class="programlisting">$ chmod ug=rx mydir
-$ ls -ld mydir
-dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
-</div>
-<div class="section" title="11.1.2.3. Octal numbers">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2773877"></a>11.1.2.3. Octal numbers</h5></div></div></div>
-<p id="ch8ult_module_plan_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
-<pre class="programlisting">$ chmod 664 myfile
-$ ls -l myfile
--rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
-<p id="ch8ult_module_plan_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
-<pre class="programlisting">$ chmod 0664 myfile</pre>
-</div>
-<div class="section" title="11.1.2.4. Special modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2773915"></a>11.1.2.4. Special modes</h5></div></div></div>
-<p id="ch8ult_module_plan_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
-<p id="ch8ult_module_plan_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
-</div>
-</div>
-</div>
-</div>
-<div class="section" title="12. Redirection and Piping">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2773959"></a>12. Redirection and Piping</h2></div></div></div>
-<p id="ch8ult_module_plan_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
-<p id="ch8ult_module_plan_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
-<div class="section" title="12.1. Redirecting standard input and standard output">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2773995"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
-<p id="ch8ult_module_plan_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
-<pre class="programlisting">$ command1 &gt; file1</pre>
-<p id="ch8ult_module_plan_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
-<pre class="programlisting">$ command1 &lt; file1</pre>
-<p id="ch8ult_module_plan_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
-<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
-<p id="ch8ult_module_plan_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
-</div>
-<div class="section" title="12.2. Piping">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2774063"></a>12.2. Piping</h3></div></div></div>
-<p id="ch8ult_module_plan_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
-A pipeline of three programs run on a text terminal:</p>
-<pre class="programlisting">$ command1 | command2</pre>
-<p id="ch8ult_module_plan_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
-<p id="ch8ult_module_plan_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
-<pre class="programlisting">$ command1 &gt; tempfile
-$ command2 &lt; tempfile
-$ rm tempfile</pre>
-<p id="ch8ult_module_plan_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
-<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
-<p id="ch8ult_module_plan_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
-</div>
-<div class="section" title="12.3. Redirecting to and from the standard file handles">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2774125"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
-<p id="ch8ult_module_plan_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
-<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
-<col width="12">
-<col width="13">
-<col width="24">
-</colgroup></table>
-<p id="ch8ult_module_plan_18d"></a>For example:</p>
-<pre class="programlisting">$ command1 2&gt; file1</pre>
-<p id="ch8ult_module_plan_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
-<p id="ch8ult_module_plan_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
-<p id="ch8ult_module_plan_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
-<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
-<p id="ch8ult_module_plan_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
-<p id="ch8ult_module_plan_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
-<p id="ch8ult_module_plan_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
-<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
-<p id="ch8ult_module_plan_194"></a>A simplified form of the command:</p>
-<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
-<p id="ch8ult_module_plan_195"></a>is:</p>
-<pre class="programlisting">$ command &amp;&gt;file</pre>
-<p id="ch8ult_module_plan_196"></a>or:</p>
-<pre class="programlisting">$command &gt;&amp;file</pre>
-</div>
-<div class="section" title="12.4. Chained pipelines">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2774332"></a>12.4. Chained pipelines</h3></div></div></div>
-<p id="ch8ult_module_plan_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
-<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
-<p id="ch8ult_module_plan_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
-</div>
-<div class="section" title="12.5. Redirect to multiple outputs">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2774367"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
-<p id="ch8ult_module_plan_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
-<pre class="programlisting">$ ls -lrt | tee xyz</pre>
-<p id="ch8ult_module_plan_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
-</div>
-</div>
-<div class="section" title="13. More Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2774397"></a>13. More Text Processing</h2></div></div></div>
-<div class="section" title="13.1. grep">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2774406"></a>13.1. grep</h3></div></div></div>
-<p id="ch8ult_module_plan_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
-<div class="section" title="13.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2774437"></a>13.1.1. Usage</h4></div></div></div>
-<p id="ch8ult_module_plan_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
-<pre class="programlisting">$ grep apple fruitlist.txt</pre>
-<p id="ch8ult_module_plan_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
-<p id="ch8ult_module_plan_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
-<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
-<p id="ch8ult_module_plan_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
-<p id="ch8ult_module_plan_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
-<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
-<p id="ch8ult_module_plan_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
-<div class="section" title="13.1.1.1. Variations">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2774517"></a>13.1.1.1. Variations</h5></div></div></div>
-<p id="ch8ult_module_plan_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
-<p id="ch8ult_module_plan_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
-<p id="ch8ult_module_plan_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
-</div>
-</div>
-</div>
-<div class="section" title="13.2. tr">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2774596"></a>13.2. tr</h3></div></div></div>
-<p id="ch8ult_module_plan_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
-<p id="ch8ult_module_plan_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
-<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
-<p id="ch8ult_module_plan_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
-<p id="ch8ult_module_plan_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
-<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
-<p id="ch8ult_module_plan_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
-<p id="ch8ult_module_plan_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
-<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
-<p id="ch8ult_module_plan_1ab"></a>therefore removes all non-alphanumeric characters.</p>
-<p id="ch8ult_module_plan_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
-<pre class="programlisting">$ tr -s '\n' '\n'</pre>
-<p id="ch8ult_module_plan_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
-<p id="ch8ult_module_plan_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
-<pre class="programlisting">$ tr -d '\r'</pre>
-<p id="ch8ult_module_plan_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
-<p id="ch8ult_module_plan_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
-</div>
-</div>
-<div class="section" title="14. Elementary Regex">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2774748"></a>14. Elementary Regex</h2></div></div></div>
-<p id="ch8ult_module_plan_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
-<p id="ch8ult_module_plan_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
-<p id="ch8ult_module_plan_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
-<p id="ch8ult_module_plan_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
-<table summary="Elementary Regex" border="1"><colgroup>
-<col width="13">
-<col width="60">
-</colgroup></table>
-<div class="section" title="14.1. Lazy quantification">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2774972"></a>14.1. Lazy quantification</h3></div></div></div>
-<p id="ch8ult_module_plan_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
-<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
-<p id="ch8ult_module_plan_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
-<p id="ch8ult_module_plan_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
-</div>
-</div>
-<div class="section" title="15. One Liners">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2775048"></a>15. One Liners</h2></div></div></div>
-<p id="ch8ult_module_plan_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
-<p id="ch8ult_module_plan_1cd"></a>The one liner can be</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem"><p id="ch8ult_module_plan_1ce"></a>An expression written in the language of the shell.</p></li>
-<li class="listitem"><p id="ch8ult_module_plan_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
-<li class="listitem"><p id="ch8ult_module_plan_1d0"></a>The invocation of a compiler together with source to compile and
-instructions for executing the compiled program.</p></li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_1d1"></a>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.</p>
-<p id="ch8ult_module_plan_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
-<p id="ch8ult_module_plan_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
-<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
-<p id="ch8ult_module_plan_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
-<p id="ch8ult_module_plan_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
-<p id="ch8ult_module_plan_1d6"></a>Here are the first few of them:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem">
-<p id="ch8ult_module_plan_1d7"></a>Print the total number of input lines:</p>
-<p id="ch8ult_module_plan_1d8"></a>END { print NR }</p>
-</li>
-<li class="listitem">
-<p id="ch8ult_module_plan_1d9"></a>Print the tenth input line:</p>
-<p id="ch8ult_module_plan_1da"></a>NR == 10</p>
-</li>
-<li class="listitem">
-<p id="ch8ult_module_plan_1db"></a>Print the last field of every input line:</p>
-<p id="ch8ult_module_plan_1dc"></a>{ print $NF }</p>
-</li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch8ult_module_plan_1dd"></a>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.</p>
-<p id="ch8ult_module_plan_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
-<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
-*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
-<p id="ch8ult_module_plan_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
-<p id="ch8ult_module_plan_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
-<pre class="programlisting">$ prog foo 'f??'; echo $?
-
-$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
-<p id="ch8ult_module_plan_1e1"></a>Here is a one line shell script to show directories:</p>
-<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
-</div>
-</div>
-</div></body>
-</html>
--- a/web/html/ch9Using_Linux_Tools.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1139 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Using Linux tools</title>
-<link rel="stylesheet" href="/review/support/styles.css" type="text/css">
-<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
-<script type="text/javascript" src="/review/support/jquery-min.js"></script>
-<script type="text/javascript" src="/review/support/form.js"></script>
-<script type="text/javascript" src="/review/support/hsbook.js"></script>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch9Using_Linux_Tools">
-<div class="titlepage"></div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="article"><a href="#id2938781"></a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2748906">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2938586">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2989832">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2990243">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2990384">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2990392">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2990672">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2990680">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2990844">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2990905">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2991009">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2991092">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2991272">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2991280">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2991364">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2991575">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2991667">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2991720">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2991728">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2992043">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2992175">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2992348">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2992441">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2992450">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2992537">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2992664">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2992751">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2992886">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2992994">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2993003">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2993191">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2993302">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2993551">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2993825">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2993842">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2993865">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2993874">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2994651">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2994687">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2994755">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2994817">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2995024">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2995059">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2995089">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2995098">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2995288">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2995440">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2995656">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2995732">15. One Liners</a></span></dt>
-</dl></dd>
-</dl>
-</div>
-<div class="article">
-<div class="titlepage">
-<div><div><h2 class="title" id="id2938781"></a></h2></div></div>
-<hr>
-</div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="section"><a href="#id2748906">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2938586">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2989832">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2990243">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2990384">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2990392">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2990672">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2990680">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2990844">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2990905">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2991009">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2991092">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2991272">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2991280">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2991364">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2991575">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2991667">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2991720">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2991728">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2992043">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2992175">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2992348">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2992441">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2992450">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2992537">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2992664">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2992751">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2992886">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2992994">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2993003">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2993191">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2993302">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2993551">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2993825">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2993842">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2993865">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2993874">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2994651">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2994687">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2994755">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2994817">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2995024">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2995059">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2995089">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2995098">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2995288">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2995440">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2995656">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2995732">15. One Liners</a></span></dt>
-</dl>
-</div>
-<div class="section" title="1. Introducing Linux">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2748906"></a>1. Introducing Linux</h2></div></div></div>
-<p id="ch9Using_Linux_Tools_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
-<p id="ch9Using_Linux_Tools_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
-<p id="ch9Using_Linux_Tools_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
-<p id="ch9Using_Linux_Tools_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
-<div class="section" title="1.1. Historical Background">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2938586"></a>1.1. Historical Background</h3></div></div></div>
-<div class="section" title="1.1.1. Events leading to the creation">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2936567"></a>1.1.1. Events leading to the creation</h4></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
-</ul></div>
-</div>
-<div class="section" title="1.1.2. The Creation of Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2989798"></a>1.1.2. The Creation of Linux</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
-<p id="ch9Using_Linux_Tools_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
-</div>
-</div>
-<div class="section" title="1.2. Design and Implications">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2989832"></a>1.2. Design and Implications</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
-<div class="section" title="1.2.1. User Interface">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2989857"></a>1.2.1. User Interface</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
-<p id="ch9Using_Linux_Tools_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
-</div>
-<div class="section" title="1.2.2. Development">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2989911"></a>1.2.2. Development</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
-<p id="ch9Using_Linux_Tools_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
-<p id="ch9Using_Linux_Tools_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
-</div>
-<div class="section" title="1.2.3. Community">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2989612"></a>1.2.3. Community</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
-<p id="ch9Using_Linux_Tools_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
-<p id="ch9Using_Linux_Tools_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
-</div>
-<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2989657"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
-</div>
-<div class="section" title="1.2.5. Programming on Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2989703"></a>1.2.5. Programming on Linux</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
-<p id="ch9Using_Linux_Tools_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
-<p id="ch9Using_Linux_Tools_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
-</div>
-</div>
-<div class="section" title="1.3. Reasons for Using Linux">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2990243"></a>1.3. Reasons for Using Linux</h3></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_16"></a>Linux is free:</p></li></ul></div>
-<p id="ch9Using_Linux_Tools_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
-Most of all, Linux is free as in "free speech":
-The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
-<p id="ch9Using_Linux_Tools_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_1a"></a>Linux was made to keep on running:</p></li></ul></div>
-<p id="ch9Using_Linux_Tools_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_1c"></a>Linux is secure and versatile:</p></li></ul></div>
-<p id="ch9Using_Linux_Tools_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_1e"></a>Linux is scalable:</p></li></ul></div>
-<p id="ch9Using_Linux_Tools_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
-<p id="ch9Using_Linux_Tools_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
-</div>
-</div>
-<div class="section" title="2. Getting Started">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2990384"></a>2. Getting Started</h2></div></div></div>
-<div class="section" title="2.1. Logging in, activating the user interface and logging out">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2990392"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
-<div class="section" title="2.1.1. Graphical Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2990423"></a>2.1.1. Graphical Mode</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
-<p id="ch9Using_Linux_Tools_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
-It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
-<p id="ch9Using_Linux_Tools_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
-<p id="ch9Using_Linux_Tools_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
-<p id="ch9Using_Linux_Tools_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
-<p id="ch9Using_Linux_Tools_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
-<p id="ch9Using_Linux_Tools_29"></a>Another common form for a prompt is this one:
-[</p>
-<div class="reference">
-<div class="titlepage"><hr></div>user@host</div>
-<p> dir]</p>
-<p id="ch9Using_Linux_Tools_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
-<p id="ch9Using_Linux_Tools_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
-</div>
-<div class="section" title="2.1.2. Text Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2990582"></a>2.1.2. Text Mode</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
-<p id="ch9Using_Linux_Tools_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
-reasons.</p>
-<p id="ch9Using_Linux_Tools_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
-<p id="ch9Using_Linux_Tools_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
-<p id="ch9Using_Linux_Tools_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
-</div>
-</div>
-</div>
-<div class="section" title="3. Basic Commands">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2990672"></a>3. Basic Commands</h2></div></div></div>
-<div class="section" title="3.1. ls">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2990680"></a>3.1. ls</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
-<p id="ch9Using_Linux_Tools_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
-<p id="ch9Using_Linux_Tools_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
-<pre class="programlisting">$ ls
-jeeves.rst psmith.html blandings.html
-$ ls -l
-drwxr--r--   1 plum  editors   4096  jeeves
--rw-r--r--   1 plum  editors  30405  psmith
--r-xr-xr-x   1 plum  plum      8460  blandings</pre>
-<p id="ch9Using_Linux_Tools_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
-</div>
-<div class="section" title="3.2. date">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2990844"></a>3.2. date</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
-<p id="ch9Using_Linux_Tools_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
-<pre class="programlisting">$date
-Tue Sep  8 12:01:45 IST 2009</pre>
-<p id="ch9Using_Linux_Tools_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
-<pre class="programlisting">$date --set="20040908 01:22"</pre>
-<p id="ch9Using_Linux_Tools_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
-<pre class="programlisting">$man date</pre>
-<p id="ch9Using_Linux_Tools_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
-</div>
-<div class="section" title="3.3. cd">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2990905"></a>3.3. cd</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
-<p id="ch9Using_Linux_Tools_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
-<p id="ch9Using_Linux_Tools_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
-<p id="ch9Using_Linux_Tools_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
-<p id="ch9Using_Linux_Tools_46"></a>Absolute paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch9Using_Linux_Tools_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_48"></a>For example to get to /boot/grub you would type:</p>
-<pre class="programlisting">$cd /boot/grub</pre>
-<p id="ch9Using_Linux_Tools_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
-<p id="ch9Using_Linux_Tools_4a"></a>Relative paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch9Using_Linux_Tools_4b"></a>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.</p>
-<p id="ch9Using_Linux_Tools_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
-<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_4d"></a>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.</p>
-</div>
-<div class="section" title="3.4. who">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2991009"></a>3.4. who</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
-<p id="ch9Using_Linux_Tools_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
-<pre class="programlisting">$who
-beeblebrox tty7         2009-09-08 10:50 (:0)
-beeblebrox pts/0        2009-09-08 11:25 (:0.0)
-dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
-beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
-<p id="ch9Using_Linux_Tools_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
-<p id="ch9Using_Linux_Tools_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
-<pre class="programlisting">$man who</pre>
-<p id="ch9Using_Linux_Tools_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
-</div>
-<div class="section" title="3.5. mkdir">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2991092"></a>3.5. mkdir</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
-<pre class="programlisting">$mkdir name_of_directory</pre>
-<p id="ch9Using_Linux_Tools_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
-<div class="section" title="3.5.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2991124"></a>3.5.1. Options</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
-</div>
-<div class="section" title="3.5.2. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2991185"></a>3.5.2. Examples</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
-<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
-<p id="ch9Using_Linux_Tools_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
-<p id="ch9Using_Linux_Tools_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
-<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
-<p id="ch9Using_Linux_Tools_5d"></a>This will create:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_5e"></a>tag</p></li>
-<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
-</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
-</div>
-</div>
-</div>
-<div class="section" title="4. Getting Help">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2991272"></a>4. Getting Help</h2></div></div></div>
-<div class="section" title="4.1. apropos and whatis">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2991280"></a>4.1. apropos and whatis</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
-<pre class="programlisting">$ apropos grep
-egrep       egrep (1)       Search a file for a pattern using full regular expressions
-fgrep       fgrep (1)       Search a file for a fixed-character string
-fmlgrep     fmlgrep (1)     Search a file for a pattern
-grep        grep (1)        Search a file for a pattern
-gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
-nisgrep     nismatch (1)    Utilities for searching NIS+ tables
-pgrep       pgrep (1)       Find or signal a process by name or other attribute
-zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
-...</pre>
-<p id="ch9Using_Linux_Tools_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
-<p id="ch9Using_Linux_Tools_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
-<pre class="programlisting">$whatis ls
-ls (1)           - list directory contents</pre>
-<p id="ch9Using_Linux_Tools_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
-<p id="ch9Using_Linux_Tools_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
-<pre class="programlisting">$apropos browser
-gmusicbrowser (1)    - Jukebox for large collections of audio files
-infobrowser (1)      - read Info documents
-libsmbclient (7)     - An extension library for browsers and that               can be used...
-opera (1)            - a standards-compliant graphical Web browser
-sensible-browser (1) - sensible editing, paging, and web browsing
-smbtree (1)          - A text based smb network browser
-tvtk_doc (1)         - A GUI based TVTK documentation search browser.
-viewres (1)          - graphical class browser for Xt
-w3m (1)              - a text based Web browser and pager
-www-browser (1)      - a text based Web browser and pager
-...</pre>
-</div>
-<div class="section" title="4.2. man">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2991364"></a>4.2. man</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
-<p id="ch9Using_Linux_Tools_66"></a>To read a manual page for a Unix command, one can use:</p>
-<pre class="programlisting">$ man &lt;command_name&gt;</pre>
-<p id="ch9Using_Linux_Tools_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
-<p id="ch9Using_Linux_Tools_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
-<pre class="programlisting">$man 3 printf</pre>
-<p id="ch9Using_Linux_Tools_69"></a>Another example:</p>
-<pre class="programlisting">$man man</pre>
-<p id="ch9Using_Linux_Tools_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
-<div class="section" title="4.2.1. Layout">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2991447"></a>4.2.1. Layout</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_6b"></a>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:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch9Using_Linux_Tools_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch9Using_Linux_Tools_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch9Using_Linux_Tools_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch9Using_Linux_Tools_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch9Using_Linux_Tools_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch9Using_Linux_Tools_71"></a>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.</p>
-<p id="ch9Using_Linux_Tools_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
-<p id="ch9Using_Linux_Tools_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
-<p id="ch9Using_Linux_Tools_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
-<p id="ch9Using_Linux_Tools_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
-<p id="ch9Using_Linux_Tools_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
-</div>
-</div>
-<div class="section" title="4.3. info">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2991575"></a>4.3. info</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
-<p id="ch9Using_Linux_Tools_78"></a>The syntax is</p>
-<pre class="programlisting">$ info &lt;command_name&gt;</pre>
-<p id="ch9Using_Linux_Tools_79"></a><span class="emphasis"><em>info</em></span> 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</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
-</div>
-<div class="section" title="4.4. --help">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2991667"></a>4.4. --help</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
-<pre class="programlisting">$ userprompt@host: cat --help
-Usage: cat [OPTION] [FILE]...
-Concatenate FILE(s), or standard input, to standard output.
-
-  -A, --show-all           equivalent to -vET
-  -b, --number-nonblank    number nonempty output lines
-  -e                       equivalent to -vE
-  -E, --show-ends          display $ at end of each line
-  -n, --number             number all output lines
-  -s, --squeeze-blank      suppress repeated empty output lines
-  -t                       equivalent to -vT
-  -T, --show-tabs          display TAB characters as ^I
-  -u                       (ignored)
-  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
-  --help     display this help and exit
-  --version  output version information and exit
-
-With no FILE, or when FILE is -, read standard input.
-
-Examples:
-  cat f - g  Output f's contents, then standard input, then g's           contents.
-  cat        Copy standard input to standard output.
-
-Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
-</div>
-</div>
-<div class="section" title="5. Basic file handling">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2991720"></a>5. Basic file handling</h2></div></div></div>
-<div class="section" title="5.1. cp">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2991728"></a>5.1. cp</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
-<div class="section" title="5.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2991746"></a>5.1.1. Usage</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_82"></a>To copy a file to another file:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
-<p id="ch9Using_Linux_Tools_83"></a>To copy a file to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
-<p id="ch9Using_Linux_Tools_84"></a>To copy a directory to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
-SourceDirectory ... TargetDirectory</pre>
-</div>
-<div class="section" title="5.1.2. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2991780"></a>5.1.2. Flags</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
-<p id="ch9Using_Linux_Tools_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
-<p id="ch9Using_Linux_Tools_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
-<p id="ch9Using_Linux_Tools_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_89"></a>The time of the last data modification and the time of the last access.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
-</div>
-<div class="section" title="5.1.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2991879"></a>5.1.3. Examples</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_8d"></a>To make a copy of a file in the current directory, enter:</p>
-<pre class="programlisting">$ cp prog.c prog.bak</pre>
-<p id="ch9Using_Linux_Tools_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
-<p id="ch9Using_Linux_Tools_8f"></a>To copy a file in your current directory into another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
-<p id="ch9Using_Linux_Tools_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
-<p id="ch9Using_Linux_Tools_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
-<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
-<p id="ch9Using_Linux_Tools_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
-<p id="ch9Using_Linux_Tools_93"></a>To copy all the files in a directory to a new directory, enter:</p>
-<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
-<p id="ch9Using_Linux_Tools_94"></a>This copies only the files in the clients directory to the customers directory.</p>
-<p id="ch9Using_Linux_Tools_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch9Using_Linux_Tools_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
-<p id="ch9Using_Linux_Tools_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
-<p id="ch9Using_Linux_Tools_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
-<p id="ch9Using_Linux_Tools_9a"></a>To use pattern-matching characters to copy files, enter:</p>
-<pre class="programlisting">$ cp programs/*.py .</pre>
-<p id="ch9Using_Linux_Tools_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
-</div>
-</div>
-<div class="section" title="5.2. mv">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2992043"></a>5.2. mv</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
-<div class="section" title="5.2.1. Conflicting existing file">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2992067"></a>5.2.1. Conflicting existing file</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
-</div>
-<div class="section" title="5.2.2. Differences with copy and delete">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2992086"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
-</div>
-<div class="section" title="5.2.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2992117"></a>5.2.3. Examples</h4></div></div></div>
-<pre class="programlisting">$ mv myfile mynewfilename    renames a file
-$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
-$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
-$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
-$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
-$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
-$ mv foo bar baz dir         moves multiple files to directory dir
-$ mv --help                  shows a very concise help about the                syntax of the command
-$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
-<p id="ch9Using_Linux_Tools_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
-<p id="ch9Using_Linux_Tools_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
-</div>
-</div>
-<div class="section" title="5.3. rm">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2992175"></a>5.3. rm</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
-<p id="ch9Using_Linux_Tools_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
-<pre class="programlisting">$ rm -i foo
-remove foo? y</pre>
-<div class="section" title="5.3.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2992205"></a>5.3.1. Options</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_a3"></a>Common options that rm accepts include:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
-<p id="ch9Using_Linux_Tools_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
-<p id="ch9Using_Linux_Tools_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
-<pre class="programlisting">xargs rm &lt; filelist</pre>
-<p id="ch9Using_Linux_Tools_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
-</div>
-<div class="section" title="5.3.2. Permissions">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2992308"></a>5.3.2. Permissions</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
-<p id="ch9Using_Linux_Tools_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
-<p id="ch9Using_Linux_Tools_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
-</div>
-</div>
-</div>
-<div class="section" title="6. Command Line Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2992348"></a>6. Command Line Arguments</h2></div></div></div>
-<p id="ch9Using_Linux_Tools_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
-<p id="ch9Using_Linux_Tools_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
-<pre class="programlisting">rm file.s</pre>
-<p id="ch9Using_Linux_Tools_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
-<p id="ch9Using_Linux_Tools_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
-<p id="ch9Using_Linux_Tools_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
-<p id="ch9Using_Linux_Tools_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
-<p id="ch9Using_Linux_Tools_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
-</div>
-<div class="section" title="7. Basic Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2992441"></a>7. Basic Text Processing</h2></div></div></div>
-<div class="section" title="7.1. head">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2992450"></a>7.1. head</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
-<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
-<p id="ch9Using_Linux_Tools_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
-<pre class="programlisting">$ head -n 20 filename</pre>
-<p id="ch9Using_Linux_Tools_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ head -n 5 foo*</pre>
-<p id="ch9Using_Linux_Tools_b9"></a>Some versions omit the n and just let you say -5.</p>
-<div class="section" title="7.1.1. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2992501"></a>7.1.1. Flags</h4></div></div></div>
-<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
-<p id="ch9Using_Linux_Tools_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
-<p id="ch9Using_Linux_Tools_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
-<pre class="programlisting">sed 5q foo</pre>
-<p id="ch9Using_Linux_Tools_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
-</div>
-</div>
-<div class="section" title="7.2. tail">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2992537"></a>7.2. tail</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
-<p id="ch9Using_Linux_Tools_be"></a>The command-syntax is:</p>
-<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
-<p id="ch9Using_Linux_Tools_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
-<pre class="programlisting">$ tail -n 20 filename</pre>
-<p id="ch9Using_Linux_Tools_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ tail -c 15 foo*</pre>
-<p id="ch9Using_Linux_Tools_c1"></a>This example shows all lines of filename from the second line onwards:</p>
-<pre class="programlisting">$ tail -n +2 filename</pre>
-<p id="ch9Using_Linux_Tools_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
-<pre class="programlisting">$ tail -20 filename
-$ tail -50c filename</pre>
-<p id="ch9Using_Linux_Tools_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
-<div class="section" title="7.2.1. File monitoring">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2992615"></a>7.2.1. File monitoring</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
-<pre class="programlisting">$ tail -f /var/adm/messages</pre>
-<p id="ch9Using_Linux_Tools_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
-<p id="ch9Using_Linux_Tools_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
-</div>
-</div>
-<div class="section" title="7.3. cut">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2992664"></a>7.3. cut</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
-<p id="ch9Using_Linux_Tools_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
-<p id="ch9Using_Linux_Tools_c9"></a>Assuming a file named file containing the lines:</p>
-<pre class="programlisting">foo:bar:baz:qux:quux
-one:two:three:four:five:six:seven
-alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-<p id="ch9Using_Linux_Tools_ca"></a>To output the fourth through tenth characters of each line:</p>
-<pre class="programlisting">$ cut -c 4-10 file</pre>
-<p id="ch9Using_Linux_Tools_cb"></a>This gives the output:</p>
-<pre class="programlisting">:bar:ba
-:two:th
-ha:beta</pre>
-<p id="ch9Using_Linux_Tools_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
-<pre class="programlisting">$ cut -d : -f 5- file</pre>
-<p id="ch9Using_Linux_Tools_cd"></a>This gives the output:</p>
-<pre class="programlisting">quux
-five:six:seven
-epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-</div>
-<div class="section" title="7.4. paste">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2992751"></a>7.4. paste</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
-<p id="ch9Using_Linux_Tools_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
-<pre class="programlisting">$ paste who where when &gt; www</pre>
-<p id="ch9Using_Linux_Tools_d0"></a>If the files contain:</p>
-<table summary="paste" border="1"><colgroup>
-<col width="11">
-<col width="12">
-<col width="12">
-</colgroup></table>
-<p id="ch9Using_Linux_Tools_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
-<pre class="programlisting">Batman            GothamCity       January 3
-Trillian          Andromeda        February 4
-Jeeves            London           March 19</pre>
-</div>
-</div>
-<div class="section" title="8. Shell Meta Characters">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2992886"></a>8. Shell Meta Characters</h2></div></div></div>
-<p id="ch9Using_Linux_Tools_de"></a>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.</p>
-<p id="ch9Using_Linux_Tools_df"></a>The shell meta characters include:</p>
-<p id="ch9Using_Linux_Tools_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
-<p id="ch9Using_Linux_Tools_e1"></a>Different shells may differ in the meta characters recognized.</p>
-<p id="ch9Using_Linux_Tools_e2"></a>As an example,</p>
-<pre class="programlisting">$ ls file.*</pre>
-<p id="ch9Using_Linux_Tools_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
-<pre class="programlisting">$ ls file.?</pre>
-<p id="ch9Using_Linux_Tools_e4"></a>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:</p>
-<pre class="programlisting">$ more c*</pre>
-<p id="ch9Using_Linux_Tools_e5"></a>because the c* matches that long file name.</p>
-<p id="ch9Using_Linux_Tools_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
-<pre class="programlisting">$ rm ??more</pre>
-<p id="ch9Using_Linux_Tools_e7"></a>or:</p>
-<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
-<p id="ch9Using_Linux_Tools_e8"></a>or:</p>
-<pre class="programlisting">$ rm ''*|more''</pre>
-</div>
-<div class="section" title="9. Looking At Files">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2992994"></a>9. Looking At Files</h2></div></div></div>
-<div class="section" title="9.1. cat">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2993003"></a>9.1. cat</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
-<p id="ch9Using_Linux_Tools_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
-<p id="ch9Using_Linux_Tools_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
-<div class="section" title="9.1.1. Jargon File Definition">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2993046"></a>9.1.1. Jargon File Definition</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
-<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
-     pause (syn. blast).
-
-2. By extension, to dump large amounts of data at an unprepared target or
-     with no intention of browsing it carefully. Usage: considered silly.
-     Rare outside Unix sites. See also dd, BLT.
-
-     Among Unix fans, *cat(1)* is considered an excellent example of
-     user-interface design, because it delivers the file contents without
-     such verbosity as spacing or headers between the files, and because
-     it does not require the files to consist of lines of text, but works
-     with any sort of data.
-
-     Among Unix critics, *cat(1)* is considered the canonical example of
-     bad user-interface design, because of its woefully unobvious name.
-     It is far more often used to blast a single file to standard output
-     than to concatenate two or more files. The name cat for the former
-     operation is just as unintuitive as, say, LISP's cdr.
-
-     Of such oppositions are holy wars made...</pre>
-</div>
-<div class="section" title="9.1.2. Useless Use of 'cat'">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2993086"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
-<p id="ch9Using_Linux_Tools_ee"></a>Nevertheless one sees people doing:</p>
-<pre class="programlisting">$ cat file | some_command and its args ...</pre>
-<p id="ch9Using_Linux_Tools_ef"></a>instead of the equivalent and cheaper:</p>
-<pre class="programlisting">&lt;file some_command and its args ...</pre>
-<p id="ch9Using_Linux_Tools_f0"></a>or (equivalently and more classically):</p>
-<pre class="programlisting">some_command and its args ... &lt;file</pre>
-<p id="ch9Using_Linux_Tools_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
-<p id="ch9Using_Linux_Tools_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
-</div>
-<div class="section" title="9.1.3. zcat">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2993157"></a>9.1.3. zcat</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
-</div>
-</div>
-<div class="section" title="9.2. more">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2993191"></a>9.2. more</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
-<div class="section" title="9.2.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2993210"></a>9.2.1. Usage</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_f5"></a>The command-syntax is:</p>
-<pre class="programlisting">$ more [options] [file_name]</pre>
-<p id="ch9Using_Linux_Tools_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
-<p id="ch9Using_Linux_Tools_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
-<p id="ch9Using_Linux_Tools_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
-<p id="ch9Using_Linux_Tools_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
-</div>
-</div>
-<div class="section" title="9.3. less">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2993302"></a>9.3. less</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
-<div class="section" title="9.3.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2993331"></a>9.3.1. Usage</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
-<p id="ch9Using_Linux_Tools_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
-<p id="ch9Using_Linux_Tools_fd"></a>The command-syntax is:</p>
-<pre class="programlisting">$ less [options] file_name</pre>
-</div>
-<div class="section" title="9.3.2. Frequently Used Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2993391"></a>9.3.2. Frequently Used Options</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_ff"></a>-I: Case-insensitive searches.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_103"></a>-?: Shows help.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.3. Frequently Used Commands">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2993444"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_105"></a>[Space bar]: Next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_106"></a>b: Previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_10a"></a>'^ or g: Go to start of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_10b"></a>'$ or G: Go to end of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_10d"></a>=: File information.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_10e"></a>h: Help.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_10f"></a>q: Quit.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.4. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2993535"></a>9.3.4. Examples</h4></div></div></div>
-<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
-$ less +F /var/log/mail.log              #Follow mode for log
-$ file * | less                          #Easier file analysis.
-$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
-</div>
-</div>
-</div>
-<div class="section" title="10. Directory Structure">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2993551"></a>10. Directory Structure</h2></div></div></div>
-<p id="ch9Using_Linux_Tools_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
-<p id="ch9Using_Linux_Tools_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
-<table summary="Directory Structure" border="1"><colgroup>
-<col width="15">
-<col width="48">
-</colgroup></table>
-<div class="section" title="10.1. man hier">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2993825"></a>10.1. man hier</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
-<pre class="programlisting">$ man hier</pre>
-</div>
-<div class="section" title="10.2. ls -l">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2993842"></a>10.2. ls -l</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
-<pre class="programlisting">$ ls -l</pre>
-<p id="ch9Using_Linux_Tools_138"></a>This can be done after entering the required directory.</p>
-</div>
-</div>
-<div class="section" title="11. Permissions and Ownership">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2993865"></a>11. Permissions and Ownership</h2></div></div></div>
-<div class="section" title="11.1. chmod">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2993874"></a>11.1. chmod</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
-<div class="section" title="11.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2993899"></a>11.1.1. Usage</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
-<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
-<p id="ch9Using_Linux_Tools_13b"></a>To view what the permissions currently are, type:</p>
-<pre class="programlisting">$ ls -l file</pre>
-</div>
-<div class="section" title="11.1.2. Command line options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2993928"></a>11.1.2. Command line options</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch9Using_Linux_Tools_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
-</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2993964"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
-<p id="ch9Using_Linux_Tools_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
-<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
-<p id="ch9Using_Linux_Tools_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="8">
-<col width="45">
-</colgroup></table>
-<p id="ch9Using_Linux_Tools_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="54">
-</colgroup></table>
-<p id="ch9Using_Linux_Tools_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="5">
-<col width="14">
-<col width="48">
-</colgroup></table>
-<p id="ch9Using_Linux_Tools_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
-</div>
-<div class="section" title="11.1.2.2. Symbolic examples">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2994525"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
-<p id="ch9Using_Linux_Tools_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
-<pre class="programlisting">$ chmod ug+rw mydir
-$ ls -ld mydir
-drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
-<p id="ch9Using_Linux_Tools_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
-<pre class="programlisting">$ chmod a-w myfile
-$ ls -l myfile
--r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
-<p id="ch9Using_Linux_Tools_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
-<pre class="programlisting">$ chmod ug=rx mydir
-$ ls -ld mydir
-dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
-</div>
-<div class="section" title="11.1.2.3. Octal numbers">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2994569"></a>11.1.2.3. Octal numbers</h5></div></div></div>
-<p id="ch9Using_Linux_Tools_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
-<pre class="programlisting">$ chmod 664 myfile
-$ ls -l myfile
--rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
-<p id="ch9Using_Linux_Tools_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
-<pre class="programlisting">$ chmod 0664 myfile</pre>
-</div>
-<div class="section" title="11.1.2.4. Special modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2994607"></a>11.1.2.4. Special modes</h5></div></div></div>
-<p id="ch9Using_Linux_Tools_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
-<p id="ch9Using_Linux_Tools_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
-</div>
-</div>
-</div>
-</div>
-<div class="section" title="12. Redirection and Piping">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2994651"></a>12. Redirection and Piping</h2></div></div></div>
-<p id="ch9Using_Linux_Tools_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
-<p id="ch9Using_Linux_Tools_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
-<div class="section" title="12.1. Redirecting standard input and standard output">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2994687"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
-<pre class="programlisting">$ command1 &gt; file1</pre>
-<p id="ch9Using_Linux_Tools_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
-<pre class="programlisting">$ command1 &lt; file1</pre>
-<p id="ch9Using_Linux_Tools_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
-<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
-<p id="ch9Using_Linux_Tools_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
-</div>
-<div class="section" title="12.2. Piping">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2994755"></a>12.2. Piping</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
-A pipeline of three programs run on a text terminal:</p>
-<pre class="programlisting">$ command1 | command2</pre>
-<p id="ch9Using_Linux_Tools_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
-<p id="ch9Using_Linux_Tools_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
-<pre class="programlisting">$ command1 &gt; tempfile
-$ command2 &lt; tempfile
-$ rm tempfile</pre>
-<p id="ch9Using_Linux_Tools_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
-<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
-<p id="ch9Using_Linux_Tools_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
-</div>
-<div class="section" title="12.3. Redirecting to and from the standard file handles">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2994817"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
-<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
-<col width="12">
-<col width="13">
-<col width="24">
-</colgroup></table>
-<p id="ch9Using_Linux_Tools_18d"></a>For example:</p>
-<pre class="programlisting">$ command1 2&gt; file1</pre>
-<p id="ch9Using_Linux_Tools_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
-<p id="ch9Using_Linux_Tools_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
-<p id="ch9Using_Linux_Tools_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
-<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
-<p id="ch9Using_Linux_Tools_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
-<p id="ch9Using_Linux_Tools_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
-<p id="ch9Using_Linux_Tools_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
-<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
-<p id="ch9Using_Linux_Tools_194"></a>A simplified form of the command:</p>
-<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
-<p id="ch9Using_Linux_Tools_195"></a>is:</p>
-<pre class="programlisting">$ command &amp;&gt;file</pre>
-<p id="ch9Using_Linux_Tools_196"></a>or:</p>
-<pre class="programlisting">$command &gt;&amp;file</pre>
-</div>
-<div class="section" title="12.4. Chained pipelines">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2995024"></a>12.4. Chained pipelines</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
-<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
-<p id="ch9Using_Linux_Tools_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
-</div>
-<div class="section" title="12.5. Redirect to multiple outputs">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2995059"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
-<pre class="programlisting">$ ls -lrt | tee xyz</pre>
-<p id="ch9Using_Linux_Tools_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
-</div>
-</div>
-<div class="section" title="13. More Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2995089"></a>13. More Text Processing</h2></div></div></div>
-<div class="section" title="13.1. grep">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2995098"></a>13.1. grep</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
-<div class="section" title="13.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2995129"></a>13.1.1. Usage</h4></div></div></div>
-<p id="ch9Using_Linux_Tools_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
-<pre class="programlisting">$ grep apple fruitlist.txt</pre>
-<p id="ch9Using_Linux_Tools_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
-<p id="ch9Using_Linux_Tools_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
-<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
-<p id="ch9Using_Linux_Tools_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
-<p id="ch9Using_Linux_Tools_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
-<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
-<p id="ch9Using_Linux_Tools_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
-<div class="section" title="13.1.1.1. Variations">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2995209"></a>13.1.1.1. Variations</h5></div></div></div>
-<p id="ch9Using_Linux_Tools_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
-<p id="ch9Using_Linux_Tools_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
-<p id="ch9Using_Linux_Tools_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
-</div>
-</div>
-</div>
-<div class="section" title="13.2. tr">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2995288"></a>13.2. tr</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
-<p id="ch9Using_Linux_Tools_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
-<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
-<p id="ch9Using_Linux_Tools_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
-<p id="ch9Using_Linux_Tools_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
-<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
-<p id="ch9Using_Linux_Tools_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
-<p id="ch9Using_Linux_Tools_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
-<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
-<p id="ch9Using_Linux_Tools_1ab"></a>therefore removes all non-alphanumeric characters.</p>
-<p id="ch9Using_Linux_Tools_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
-<pre class="programlisting">$ tr -s '\n' '\n'</pre>
-<p id="ch9Using_Linux_Tools_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
-<p id="ch9Using_Linux_Tools_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
-<pre class="programlisting">$ tr -d '\r'</pre>
-<p id="ch9Using_Linux_Tools_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
-<p id="ch9Using_Linux_Tools_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
-</div>
-</div>
-<div class="section" title="14. Elementary Regex">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2995440"></a>14. Elementary Regex</h2></div></div></div>
-<p id="ch9Using_Linux_Tools_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
-<p id="ch9Using_Linux_Tools_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
-<p id="ch9Using_Linux_Tools_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
-<p id="ch9Using_Linux_Tools_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
-<table summary="Elementary Regex" border="1"><colgroup>
-<col width="13">
-<col width="60">
-</colgroup></table>
-<div class="section" title="14.1. Lazy quantification">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2995656"></a>14.1. Lazy quantification</h3></div></div></div>
-<p id="ch9Using_Linux_Tools_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
-<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
-<p id="ch9Using_Linux_Tools_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
-<p id="ch9Using_Linux_Tools_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
-</div>
-</div>
-<div class="section" title="15. One Liners">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2995732"></a>15. One Liners</h2></div></div></div>
-<p id="ch9Using_Linux_Tools_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
-<p id="ch9Using_Linux_Tools_1cd"></a>The one liner can be</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem"><p id="ch9Using_Linux_Tools_1ce"></a>An expression written in the language of the shell.</p></li>
-<li class="listitem"><p id="ch9Using_Linux_Tools_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
-<li class="listitem"><p id="ch9Using_Linux_Tools_1d0"></a>The invocation of a compiler together with source to compile and
-instructions for executing the compiled program.</p></li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_1d1"></a>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.</p>
-<p id="ch9Using_Linux_Tools_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
-<p id="ch9Using_Linux_Tools_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
-<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
-<p id="ch9Using_Linux_Tools_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
-<p id="ch9Using_Linux_Tools_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
-<p id="ch9Using_Linux_Tools_1d6"></a>Here are the first few of them:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem">
-<p id="ch9Using_Linux_Tools_1d7"></a>Print the total number of input lines:</p>
-<p id="ch9Using_Linux_Tools_1d8"></a>END { print NR }</p>
-</li>
-<li class="listitem">
-<p id="ch9Using_Linux_Tools_1d9"></a>Print the tenth input line:</p>
-<p id="ch9Using_Linux_Tools_1da"></a>NR == 10</p>
-</li>
-<li class="listitem">
-<p id="ch9Using_Linux_Tools_1db"></a>Print the last field of every input line:</p>
-<p id="ch9Using_Linux_Tools_1dc"></a>{ print $NF }</p>
-</li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch9Using_Linux_Tools_1dd"></a>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.</p>
-<p id="ch9Using_Linux_Tools_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
-<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
-*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
-<p id="ch9Using_Linux_Tools_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
-<p id="ch9Using_Linux_Tools_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
-<pre class="programlisting">$ prog foo 'f??'; echo $?
-
-$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
-<p id="ch9Using_Linux_Tools_1e1"></a>Here is a one line shell script to show directories:</p>
-<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
-</div>
-</div>
-</div></body>
-</html>
--- a/web/html/chn10session4.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1139 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Session 4 </title>
-<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
-<link rel="stylesheet" href="/review/support/styles.css" type="text/css">
-<script type="text/javascript" src="/review/support/jquery-min.js"></script>
-<script type="text/javascript" src="/review/support/form.js"></script>
-<script type="text/javascript" src="/review/support/hsbook.js"></script>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch10session4">
-<div class="titlepage"></div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="article"><a href="#id2855701"></a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2665826">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2853520">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2906761">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2907033">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2907165">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2907174">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2907452">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2907460">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2907622">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2907682">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2907784">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2907867">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2908045">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2908054">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2908136">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2906583">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2908572">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2908625">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2908633">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2908944">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2909093">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2909263">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2909355">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2909364">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2909450">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2909577">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2909663">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2909795">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2909902">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2909910">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2910114">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2910224">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2910464">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2910734">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2910750">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2910773">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2910782">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2911546">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2911583">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2911652">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2911713">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2911918">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2911952">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2911982">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2911991">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2912180">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2912329">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2912542">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2912618">15. One Liners</a></span></dt>
-</dl></dd>
-</dl>
-</div>
-<div class="article">
-<div class="titlepage">
-<div><div><h2 class="title" id="id2855701"></a></h2></div></div>
-<hr>
-</div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="section"><a href="#id2665826">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2853520">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2906761">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2907033">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2907165">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2907174">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2907452">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2907460">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2907622">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2907682">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2907784">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2907867">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2908045">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2908054">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2908136">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2906583">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2908572">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2908625">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2908633">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2908944">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2909093">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2909263">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2909355">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2909364">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2909450">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2909577">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2909663">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2909795">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2909902">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2909910">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2910114">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2910224">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2910464">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2910734">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2910750">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2910773">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2910782">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2911546">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2911583">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2911652">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2911713">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2911918">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2911952">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2911982">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2911991">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2912180">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2912329">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2912542">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2912618">15. One Liners</a></span></dt>
-</dl>
-</div>
-<div class="section" title="1. Introducing Linux">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2665826"></a>1. Introducing Linux</h2></div></div></div>
-<p id="ch10session4_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
-<p id="ch10session4_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
-<p id="ch10session4_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
-<p id="ch10session4_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
-<div class="section" title="1.1. Historical Background">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2853520"></a>1.1. Historical Background</h3></div></div></div>
-<div class="section" title="1.1.1. Events leading to the creation">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2853486"></a>1.1.1. Events leading to the creation</h4></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
-</ul></div>
-</div>
-<div class="section" title="1.1.2. The Creation of Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2906716"></a>1.1.2. The Creation of Linux</h4></div></div></div>
-<p id="ch10session4_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
-<p id="ch10session4_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
-</div>
-</div>
-<div class="section" title="1.2. Design and Implications">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2906761"></a>1.2. Design and Implications</h3></div></div></div>
-<p id="ch10session4_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
-<div class="section" title="1.2.1. User Interface">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2906785"></a>1.2.1. User Interface</h4></div></div></div>
-<p id="ch10session4_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
-<p id="ch10session4_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
-</div>
-<div class="section" title="1.2.2. Development">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2906839"></a>1.2.2. Development</h4></div></div></div>
-<p id="ch10session4_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
-<p id="ch10session4_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
-<p id="ch10session4_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
-</div>
-<div class="section" title="1.2.3. Community">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2906896"></a>1.2.3. Community</h4></div></div></div>
-<p id="ch10session4_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
-<p id="ch10session4_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
-<p id="ch10session4_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
-</div>
-<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2906940"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
-<p id="ch10session4_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
-</div>
-<div class="section" title="1.2.5. Programming on Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2906986"></a>1.2.5. Programming on Linux</h4></div></div></div>
-<p id="ch10session4_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
-<p id="ch10session4_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
-<p id="ch10session4_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
-</div>
-</div>
-<div class="section" title="1.3. Reasons for Using Linux">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2907033"></a>1.3. Reasons for Using Linux</h3></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch10session4_16"></a>Linux is free:</p></li></ul></div>
-<p id="ch10session4_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
-Most of all, Linux is free as in "free speech":
-The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch10session4_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
-<p id="ch10session4_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch10session4_1a"></a>Linux was made to keep on running:</p></li></ul></div>
-<p id="ch10session4_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch10session4_1c"></a>Linux is secure and versatile:</p></li></ul></div>
-<p id="ch10session4_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch10session4_1e"></a>Linux is scalable:</p></li></ul></div>
-<p id="ch10session4_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch10session4_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
-<p id="ch10session4_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
-</div>
-</div>
-<div class="section" title="2. Getting Started">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2907165"></a>2. Getting Started</h2></div></div></div>
-<div class="section" title="2.1. Logging in, activating the user interface and logging out">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2907174"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
-<p id="ch10session4_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
-<div class="section" title="2.1.1. Graphical Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2907204"></a>2.1.1. Graphical Mode</h4></div></div></div>
-<p id="ch10session4_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
-<p id="ch10session4_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
-It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
-<p id="ch10session4_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
-<p id="ch10session4_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
-<p id="ch10session4_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
-<p id="ch10session4_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
-<p id="ch10session4_29"></a>Another common form for a prompt is this one:
-[</p>
-<div class="reference">
-<div class="titlepage"><hr></div>user@host</div>
-<p> dir]</p>
-<p id="ch10session4_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
-<p id="ch10session4_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
-</div>
-<div class="section" title="2.1.2. Text Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2907362"></a>2.1.2. Text Mode</h4></div></div></div>
-<p id="ch10session4_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
-<p id="ch10session4_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
-reasons.</p>
-<p id="ch10session4_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
-<p id="ch10session4_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
-<p id="ch10session4_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
-</div>
-</div>
-</div>
-<div class="section" title="3. Basic Commands">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2907452"></a>3. Basic Commands</h2></div></div></div>
-<div class="section" title="3.1. ls">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2907460"></a>3.1. ls</h3></div></div></div>
-<p id="ch10session4_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
-<p id="ch10session4_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
-<p id="ch10session4_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch10session4_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
-<pre class="programlisting">$ ls
-jeeves.rst psmith.html blandings.html
-$ ls -l
-drwxr--r--   1 plum  editors   4096  jeeves
--rw-r--r--   1 plum  editors  30405  psmith
--r-xr-xr-x   1 plum  plum      8460  blandings</pre>
-<p id="ch10session4_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
-</div>
-<div class="section" title="3.2. date">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2907622"></a>3.2. date</h3></div></div></div>
-<p id="ch10session4_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
-<p id="ch10session4_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
-<pre class="programlisting">$date
-Tue Sep  8 12:01:45 IST 2009</pre>
-<p id="ch10session4_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
-<pre class="programlisting">$date --set="20040908 01:22"</pre>
-<p id="ch10session4_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
-<pre class="programlisting">$man date</pre>
-<p id="ch10session4_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
-</div>
-<div class="section" title="3.3. cd">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2907682"></a>3.3. cd</h3></div></div></div>
-<p id="ch10session4_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
-<p id="ch10session4_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
-<p id="ch10session4_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
-<p id="ch10session4_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
-<p id="ch10session4_46"></a>Absolute paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch10session4_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch10session4_48"></a>For example to get to /boot/grub you would type:</p>
-<pre class="programlisting">$cd /boot/grub</pre>
-<p id="ch10session4_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
-<p id="ch10session4_4a"></a>Relative paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch10session4_4b"></a>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.</p>
-<p id="ch10session4_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
-<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch10session4_4d"></a>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.</p>
-</div>
-<div class="section" title="3.4. who">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2907784"></a>3.4. who</h3></div></div></div>
-<p id="ch10session4_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
-<p id="ch10session4_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
-<pre class="programlisting">$who
-beeblebrox tty7         2009-09-08 10:50 (:0)
-beeblebrox pts/0        2009-09-08 11:25 (:0.0)
-dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
-beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
-<p id="ch10session4_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
-<p id="ch10session4_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
-<pre class="programlisting">$man who</pre>
-<p id="ch10session4_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
-</div>
-<div class="section" title="3.5. mkdir">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2907867"></a>3.5. mkdir</h3></div></div></div>
-<p id="ch10session4_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
-<pre class="programlisting">$mkdir name_of_directory</pre>
-<p id="ch10session4_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
-<div class="section" title="3.5.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2907898"></a>3.5.1. Options</h4></div></div></div>
-<p id="ch10session4_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch10session4_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
-</div>
-<div class="section" title="3.5.2. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2907959"></a>3.5.2. Examples</h4></div></div></div>
-<p id="ch10session4_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
-<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
-<p id="ch10session4_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
-<p id="ch10session4_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
-<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
-<p id="ch10session4_5d"></a>This will create:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_5e"></a>tag</p></li>
-<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch10session4_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
-</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
-</div>
-</div>
-</div>
-<div class="section" title="4. Getting Help">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2908045"></a>4. Getting Help</h2></div></div></div>
-<div class="section" title="4.1. apropos and whatis">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2908054"></a>4.1. apropos and whatis</h3></div></div></div>
-<p id="ch10session4_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
-<pre class="programlisting">$ apropos grep
-egrep       egrep (1)       Search a file for a pattern using full regular expressions
-fgrep       fgrep (1)       Search a file for a fixed-character string
-fmlgrep     fmlgrep (1)     Search a file for a pattern
-grep        grep (1)        Search a file for a pattern
-gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
-nisgrep     nismatch (1)    Utilities for searching NIS+ tables
-pgrep       pgrep (1)       Find or signal a process by name or other attribute
-zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
-...</pre>
-<p id="ch10session4_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
-<p id="ch10session4_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
-<pre class="programlisting">$whatis ls
-ls (1)           - list directory contents</pre>
-<p id="ch10session4_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
-<p id="ch10session4_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
-<pre class="programlisting">$apropos browser
-gmusicbrowser (1)    - Jukebox for large collections of audio files
-infobrowser (1)      - read Info documents
-libsmbclient (7)     - An extension library for browsers and that               can be used...
-opera (1)            - a standards-compliant graphical Web browser
-sensible-browser (1) - sensible editing, paging, and web browsing
-smbtree (1)          - A text based smb network browser
-tvtk_doc (1)         - A GUI based TVTK documentation search browser.
-viewres (1)          - graphical class browser for Xt
-w3m (1)              - a text based Web browser and pager
-www-browser (1)      - a text based Web browser and pager
-...</pre>
-</div>
-<div class="section" title="4.2. man">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2908136"></a>4.2. man</h3></div></div></div>
-<p id="ch10session4_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
-<p id="ch10session4_66"></a>To read a manual page for a Unix command, one can use:</p>
-<pre class="programlisting">$ man &lt;command_name&gt;</pre>
-<p id="ch10session4_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
-<p id="ch10session4_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
-<pre class="programlisting">$man 3 printf</pre>
-<p id="ch10session4_69"></a>Another example:</p>
-<pre class="programlisting">$man man</pre>
-<p id="ch10session4_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
-<div class="section" title="4.2.1. Layout">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2908219"></a>4.2.1. Layout</h4></div></div></div>
-<p id="ch10session4_6b"></a>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:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch10session4_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch10session4_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch10session4_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch10session4_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch10session4_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch10session4_71"></a>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.</p>
-<p id="ch10session4_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
-<p id="ch10session4_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
-<p id="ch10session4_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
-<p id="ch10session4_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
-<p id="ch10session4_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
-</div>
-</div>
-<div class="section" title="4.3. info">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2906583"></a>4.3. info</h3></div></div></div>
-<p id="ch10session4_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
-<p id="ch10session4_78"></a>The syntax is</p>
-<pre class="programlisting">$ info &lt;command_name&gt;</pre>
-<p id="ch10session4_79"></a><span class="emphasis"><em>info</em></span> 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</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch10session4_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
-</div>
-<div class="section" title="4.4. --help">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2908572"></a>4.4. --help</h3></div></div></div>
-<p id="ch10session4_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
-<pre class="programlisting">$ userprompt@host: cat --help
-Usage: cat [OPTION] [FILE]...
-Concatenate FILE(s), or standard input, to standard output.
-
-  -A, --show-all           equivalent to -vET
-  -b, --number-nonblank    number nonempty output lines
-  -e                       equivalent to -vE
-  -E, --show-ends          display $ at end of each line
-  -n, --number             number all output lines
-  -s, --squeeze-blank      suppress repeated empty output lines
-  -t                       equivalent to -vT
-  -T, --show-tabs          display TAB characters as ^I
-  -u                       (ignored)
-  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
-  --help     display this help and exit
-  --version  output version information and exit
-
-With no FILE, or when FILE is -, read standard input.
-
-Examples:
-  cat f - g  Output f's contents, then standard input, then g's           contents.
-  cat        Copy standard input to standard output.
-
-Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
-</div>
-</div>
-<div class="section" title="5. Basic file handling">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2908625"></a>5. Basic file handling</h2></div></div></div>
-<div class="section" title="5.1. cp">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2908633"></a>5.1. cp</h3></div></div></div>
-<p id="ch10session4_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
-<div class="section" title="5.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2908651"></a>5.1.1. Usage</h4></div></div></div>
-<p id="ch10session4_82"></a>To copy a file to another file:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
-<p id="ch10session4_83"></a>To copy a file to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
-<p id="ch10session4_84"></a>To copy a directory to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
-SourceDirectory ... TargetDirectory</pre>
-</div>
-<div class="section" title="5.1.2. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2908685"></a>5.1.2. Flags</h4></div></div></div>
-<p id="ch10session4_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
-<p id="ch10session4_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
-<p id="ch10session4_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
-<p id="ch10session4_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_89"></a>The time of the last data modification and the time of the last access.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch10session4_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
-</div>
-<div class="section" title="5.1.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2908782"></a>5.1.3. Examples</h4></div></div></div>
-<p id="ch10session4_8d"></a>To make a copy of a file in the current directory, enter:</p>
-<pre class="programlisting">$ cp prog.c prog.bak</pre>
-<p id="ch10session4_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
-<p id="ch10session4_8f"></a>To copy a file in your current directory into another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
-<p id="ch10session4_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
-<p id="ch10session4_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
-<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
-<p id="ch10session4_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
-<p id="ch10session4_93"></a>To copy all the files in a directory to a new directory, enter:</p>
-<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
-<p id="ch10session4_94"></a>This copies only the files in the clients directory to the customers directory.</p>
-<p id="ch10session4_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch10session4_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch10session4_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
-<p id="ch10session4_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
-<p id="ch10session4_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
-<p id="ch10session4_9a"></a>To use pattern-matching characters to copy files, enter:</p>
-<pre class="programlisting">$ cp programs/*.py .</pre>
-<p id="ch10session4_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
-</div>
-</div>
-<div class="section" title="5.2. mv">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2908944"></a>5.2. mv</h3></div></div></div>
-<p id="ch10session4_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
-<div class="section" title="5.2.1. Conflicting existing file">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2908968"></a>5.2.1. Conflicting existing file</h4></div></div></div>
-<p id="ch10session4_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
-</div>
-<div class="section" title="5.2.2. Differences with copy and delete">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2908988"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
-<p id="ch10session4_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
-</div>
-<div class="section" title="5.2.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2909034"></a>5.2.3. Examples</h4></div></div></div>
-<pre class="programlisting">$ mv myfile mynewfilename    renames a file
-$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
-$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
-$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
-$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
-$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
-$ mv foo bar baz dir         moves multiple files to directory dir
-$ mv --help                  shows a very concise help about the                syntax of the command
-$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
-<p id="ch10session4_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
-<p id="ch10session4_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
-</div>
-</div>
-<div class="section" title="5.3. rm">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2909093"></a>5.3. rm</h3></div></div></div>
-<p id="ch10session4_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
-<p id="ch10session4_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
-<pre class="programlisting">$ rm -i foo
-remove foo? y</pre>
-<div class="section" title="5.3.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2909122"></a>5.3.1. Options</h4></div></div></div>
-<p id="ch10session4_a3"></a>Common options that rm accepts include:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch10session4_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
-<p id="ch10session4_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
-<p id="ch10session4_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
-<pre class="programlisting">xargs rm &lt; filelist</pre>
-<p id="ch10session4_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
-</div>
-<div class="section" title="5.3.2. Permissions">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2909224"></a>5.3.2. Permissions</h4></div></div></div>
-<p id="ch10session4_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
-<p id="ch10session4_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
-<p id="ch10session4_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
-</div>
-</div>
-</div>
-<div class="section" title="6. Command Line Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2909263"></a>6. Command Line Arguments</h2></div></div></div>
-<p id="ch10session4_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
-<p id="ch10session4_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
-<pre class="programlisting">rm file.s</pre>
-<p id="ch10session4_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
-<p id="ch10session4_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
-<p id="ch10session4_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
-<p id="ch10session4_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
-<p id="ch10session4_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
-</div>
-<div class="section" title="7. Basic Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2909355"></a>7. Basic Text Processing</h2></div></div></div>
-<div class="section" title="7.1. head">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2909364"></a>7.1. head</h3></div></div></div>
-<p id="ch10session4_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
-<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
-<p id="ch10session4_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
-<pre class="programlisting">$ head -n 20 filename</pre>
-<p id="ch10session4_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ head -n 5 foo*</pre>
-<p id="ch10session4_b9"></a>Some versions omit the n and just let you say -5.</p>
-<div class="section" title="7.1.1. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2909415"></a>7.1.1. Flags</h4></div></div></div>
-<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
-<p id="ch10session4_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
-<p id="ch10session4_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
-<pre class="programlisting">sed 5q foo</pre>
-<p id="ch10session4_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
-</div>
-</div>
-<div class="section" title="7.2. tail">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2909450"></a>7.2. tail</h3></div></div></div>
-<p id="ch10session4_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
-<p id="ch10session4_be"></a>The command-syntax is:</p>
-<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
-<p id="ch10session4_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
-<pre class="programlisting">$ tail -n 20 filename</pre>
-<p id="ch10session4_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ tail -c 15 foo*</pre>
-<p id="ch10session4_c1"></a>This example shows all lines of filename from the second line onwards:</p>
-<pre class="programlisting">$ tail -n +2 filename</pre>
-<p id="ch10session4_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
-<pre class="programlisting">$ tail -20 filename
-$ tail -50c filename</pre>
-<p id="ch10session4_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
-<div class="section" title="7.2.1. File monitoring">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2909528"></a>7.2.1. File monitoring</h4></div></div></div>
-<p id="ch10session4_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
-<pre class="programlisting">$ tail -f /var/adm/messages</pre>
-<p id="ch10session4_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
-<p id="ch10session4_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
-</div>
-</div>
-<div class="section" title="7.3. cut">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2909577"></a>7.3. cut</h3></div></div></div>
-<p id="ch10session4_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
-<p id="ch10session4_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
-<p id="ch10session4_c9"></a>Assuming a file named file containing the lines:</p>
-<pre class="programlisting">foo:bar:baz:qux:quux
-one:two:three:four:five:six:seven
-alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-<p id="ch10session4_ca"></a>To output the fourth through tenth characters of each line:</p>
-<pre class="programlisting">$ cut -c 4-10 file</pre>
-<p id="ch10session4_cb"></a>This gives the output:</p>
-<pre class="programlisting">:bar:ba
-:two:th
-ha:beta</pre>
-<p id="ch10session4_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
-<pre class="programlisting">$ cut -d : -f 5- file</pre>
-<p id="ch10session4_cd"></a>This gives the output:</p>
-<pre class="programlisting">quux
-five:six:seven
-epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-</div>
-<div class="section" title="7.4. paste">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2909663"></a>7.4. paste</h3></div></div></div>
-<p id="ch10session4_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
-<p id="ch10session4_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
-<pre class="programlisting">$ paste who where when &gt; www</pre>
-<p id="ch10session4_d0"></a>If the files contain:</p>
-<table summary="paste" border="1"><colgroup>
-<col width="11">
-<col width="12">
-<col width="12">
-</colgroup></table>
-<p id="ch10session4_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
-<pre class="programlisting">Batman            GothamCity       January 3
-Trillian          Andromeda        February 4
-Jeeves            London           March 19</pre>
-</div>
-</div>
-<div class="section" title="8. Shell Meta Characters">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2909795"></a>8. Shell Meta Characters</h2></div></div></div>
-<p id="ch10session4_de"></a>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.</p>
-<p id="ch10session4_df"></a>The shell meta characters include:</p>
-<p id="ch10session4_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
-<p id="ch10session4_e1"></a>Different shells may differ in the meta characters recognized.</p>
-<p id="ch10session4_e2"></a>As an example,</p>
-<pre class="programlisting">$ ls file.*</pre>
-<p id="ch10session4_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
-<pre class="programlisting">$ ls file.?</pre>
-<p id="ch10session4_e4"></a>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:</p>
-<pre class="programlisting">$ more c*</pre>
-<p id="ch10session4_e5"></a>because the c* matches that long file name.</p>
-<p id="ch10session4_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
-<pre class="programlisting">$ rm ??more</pre>
-<p id="ch10session4_e7"></a>or:</p>
-<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
-<p id="ch10session4_e8"></a>or:</p>
-<pre class="programlisting">$ rm ''*|more''</pre>
-</div>
-<div class="section" title="9. Looking At Files">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2909902"></a>9. Looking At Files</h2></div></div></div>
-<div class="section" title="9.1. cat">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2909910"></a>9.1. cat</h3></div></div></div>
-<p id="ch10session4_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
-<p id="ch10session4_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
-<p id="ch10session4_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
-<div class="section" title="9.1.1. Jargon File Definition">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2909954"></a>9.1.1. Jargon File Definition</h4></div></div></div>
-<p id="ch10session4_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
-<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
-     pause (syn. blast).
-
-2. By extension, to dump large amounts of data at an unprepared target or
-     with no intention of browsing it carefully. Usage: considered silly.
-     Rare outside Unix sites. See also dd, BLT.
-
-     Among Unix fans, *cat(1)* is considered an excellent example of
-     user-interface design, because it delivers the file contents without
-     such verbosity as spacing or headers between the files, and because
-     it does not require the files to consist of lines of text, but works
-     with any sort of data.
-
-     Among Unix critics, *cat(1)* is considered the canonical example of
-     bad user-interface design, because of its woefully unobvious name.
-     It is far more often used to blast a single file to standard output
-     than to concatenate two or more files. The name cat for the former
-     operation is just as unintuitive as, say, LISP's cdr.
-
-     Of such oppositions are holy wars made...</pre>
-</div>
-<div class="section" title="9.1.2. Useless Use of 'cat'">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2910010"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
-<p id="ch10session4_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
-<p id="ch10session4_ee"></a>Nevertheless one sees people doing:</p>
-<pre class="programlisting">$ cat file | some_command and its args ...</pre>
-<p id="ch10session4_ef"></a>instead of the equivalent and cheaper:</p>
-<pre class="programlisting">&lt;file some_command and its args ...</pre>
-<p id="ch10session4_f0"></a>or (equivalently and more classically):</p>
-<pre class="programlisting">some_command and its args ... &lt;file</pre>
-<p id="ch10session4_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
-<p id="ch10session4_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
-</div>
-<div class="section" title="9.1.3. zcat">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2910080"></a>9.1.3. zcat</h4></div></div></div>
-<p id="ch10session4_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
-</div>
-</div>
-<div class="section" title="9.2. more">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2910114"></a>9.2. more</h3></div></div></div>
-<p id="ch10session4_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
-<div class="section" title="9.2.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2910133"></a>9.2.1. Usage</h4></div></div></div>
-<p id="ch10session4_f5"></a>The command-syntax is:</p>
-<pre class="programlisting">$ more [options] [file_name]</pre>
-<p id="ch10session4_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
-<p id="ch10session4_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
-<p id="ch10session4_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
-<p id="ch10session4_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
-</div>
-</div>
-<div class="section" title="9.3. less">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2910224"></a>9.3. less</h3></div></div></div>
-<p id="ch10session4_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
-<div class="section" title="9.3.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2910253"></a>9.3.1. Usage</h4></div></div></div>
-<p id="ch10session4_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
-<p id="ch10session4_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
-<p id="ch10session4_fd"></a>The command-syntax is:</p>
-<pre class="programlisting">$ less [options] file_name</pre>
-</div>
-<div class="section" title="9.3.2. Frequently Used Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2910307"></a>9.3.2. Frequently Used Options</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_ff"></a>-I: Case-insensitive searches.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_103"></a>-?: Shows help.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.3. Frequently Used Commands">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2910360"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_105"></a>[Space bar]: Next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_106"></a>b: Previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_10a"></a>'^ or g: Go to start of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_10b"></a>'$ or G: Go to end of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_10d"></a>=: File information.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_10e"></a>h: Help.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_10f"></a>q: Quit.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.4. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2910449"></a>9.3.4. Examples</h4></div></div></div>
-<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
-$ less +F /var/log/mail.log              #Follow mode for log
-$ file * | less                          #Easier file analysis.
-$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
-</div>
-</div>
-</div>
-<div class="section" title="10. Directory Structure">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2910464"></a>10. Directory Structure</h2></div></div></div>
-<p id="ch10session4_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
-<p id="ch10session4_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
-<table summary="Directory Structure" border="1"><colgroup>
-<col width="15">
-<col width="48">
-</colgroup></table>
-<div class="section" title="10.1. man hier">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2910734"></a>10.1. man hier</h3></div></div></div>
-<p id="ch10session4_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
-<pre class="programlisting">$ man hier</pre>
-</div>
-<div class="section" title="10.2. ls -l">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2910750"></a>10.2. ls -l</h3></div></div></div>
-<p id="ch10session4_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
-<pre class="programlisting">$ ls -l</pre>
-<p id="ch10session4_138"></a>This can be done after entering the required directory.</p>
-</div>
-</div>
-<div class="section" title="11. Permissions and Ownership">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2910773"></a>11. Permissions and Ownership</h2></div></div></div>
-<div class="section" title="11.1. chmod">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2910782"></a>11.1. chmod</h3></div></div></div>
-<p id="ch10session4_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
-<div class="section" title="11.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2910807"></a>11.1.1. Usage</h4></div></div></div>
-<p id="ch10session4_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
-<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
-<p id="ch10session4_13b"></a>To view what the permissions currently are, type:</p>
-<pre class="programlisting">$ ls -l file</pre>
-</div>
-<div class="section" title="11.1.2. Command line options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2910835"></a>11.1.2. Command line options</h4></div></div></div>
-<p id="ch10session4_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch10session4_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
-</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2910872"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
-<p id="ch10session4_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
-<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
-<p id="ch10session4_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="8">
-<col width="45">
-</colgroup></table>
-<p id="ch10session4_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="54">
-</colgroup></table>
-<p id="ch10session4_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="5">
-<col width="14">
-<col width="48">
-</colgroup></table>
-<p id="ch10session4_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
-</div>
-<div class="section" title="11.1.2.2. Symbolic examples">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2911418"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
-<p id="ch10session4_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
-<pre class="programlisting">$ chmod ug+rw mydir
-$ ls -ld mydir
-drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
-<p id="ch10session4_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
-<pre class="programlisting">$ chmod a-w myfile
-$ ls -l myfile
--r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
-<p id="ch10session4_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
-<pre class="programlisting">$ chmod ug=rx mydir
-$ ls -ld mydir
-dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
-</div>
-<div class="section" title="11.1.2.3. Octal numbers">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2911459"></a>11.1.2.3. Octal numbers</h5></div></div></div>
-<p id="ch10session4_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
-<pre class="programlisting">$ chmod 664 myfile
-$ ls -l myfile
--rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
-<p id="ch10session4_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
-<pre class="programlisting">$ chmod 0664 myfile</pre>
-</div>
-<div class="section" title="11.1.2.4. Special modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2911498"></a>11.1.2.4. Special modes</h5></div></div></div>
-<p id="ch10session4_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
-<p id="ch10session4_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
-</div>
-</div>
-</div>
-</div>
-<div class="section" title="12. Redirection and Piping">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2911546"></a>12. Redirection and Piping</h2></div></div></div>
-<p id="ch10session4_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
-<p id="ch10session4_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
-<div class="section" title="12.1. Redirecting standard input and standard output">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2911583"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
-<p id="ch10session4_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
-<pre class="programlisting">$ command1 &gt; file1</pre>
-<p id="ch10session4_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
-<pre class="programlisting">$ command1 &lt; file1</pre>
-<p id="ch10session4_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
-<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
-<p id="ch10session4_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
-</div>
-<div class="section" title="12.2. Piping">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2911652"></a>12.2. Piping</h3></div></div></div>
-<p id="ch10session4_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
-A pipeline of three programs run on a text terminal:</p>
-<pre class="programlisting">$ command1 | command2</pre>
-<p id="ch10session4_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
-<p id="ch10session4_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
-<pre class="programlisting">$ command1 &gt; tempfile
-$ command2 &lt; tempfile
-$ rm tempfile</pre>
-<p id="ch10session4_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
-<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
-<p id="ch10session4_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
-</div>
-<div class="section" title="12.3. Redirecting to and from the standard file handles">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2911713"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
-<p id="ch10session4_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
-<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
-<col width="12">
-<col width="13">
-<col width="24">
-</colgroup></table>
-<p id="ch10session4_18d"></a>For example:</p>
-<pre class="programlisting">$ command1 2&gt; file1</pre>
-<p id="ch10session4_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
-<p id="ch10session4_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
-<p id="ch10session4_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
-<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
-<p id="ch10session4_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
-<p id="ch10session4_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
-<p id="ch10session4_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
-<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
-<p id="ch10session4_194"></a>A simplified form of the command:</p>
-<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
-<p id="ch10session4_195"></a>is:</p>
-<pre class="programlisting">$ command &amp;&gt;file</pre>
-<p id="ch10session4_196"></a>or:</p>
-<pre class="programlisting">$command &gt;&amp;file</pre>
-</div>
-<div class="section" title="12.4. Chained pipelines">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2911918"></a>12.4. Chained pipelines</h3></div></div></div>
-<p id="ch10session4_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
-<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
-<p id="ch10session4_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
-</div>
-<div class="section" title="12.5. Redirect to multiple outputs">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2911952"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
-<p id="ch10session4_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
-<pre class="programlisting">$ ls -lrt | tee xyz</pre>
-<p id="ch10session4_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
-</div>
-</div>
-<div class="section" title="13. More Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2911982"></a>13. More Text Processing</h2></div></div></div>
-<div class="section" title="13.1. grep">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2911991"></a>13.1. grep</h3></div></div></div>
-<p id="ch10session4_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
-<div class="section" title="13.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2912022"></a>13.1.1. Usage</h4></div></div></div>
-<p id="ch10session4_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
-<pre class="programlisting">$ grep apple fruitlist.txt</pre>
-<p id="ch10session4_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
-<p id="ch10session4_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
-<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
-<p id="ch10session4_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
-<p id="ch10session4_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
-<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
-<p id="ch10session4_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
-<div class="section" title="13.1.1.1. Variations">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2912100"></a>13.1.1.1. Variations</h5></div></div></div>
-<p id="ch10session4_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
-<p id="ch10session4_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
-<p id="ch10session4_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
-</div>
-</div>
-</div>
-<div class="section" title="13.2. tr">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2912180"></a>13.2. tr</h3></div></div></div>
-<p id="ch10session4_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
-<p id="ch10session4_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
-<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
-<p id="ch10session4_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
-<p id="ch10session4_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
-<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
-<p id="ch10session4_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
-<p id="ch10session4_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
-<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
-<p id="ch10session4_1ab"></a>therefore removes all non-alphanumeric characters.</p>
-<p id="ch10session4_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
-<pre class="programlisting">$ tr -s '\n' '\n'</pre>
-<p id="ch10session4_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
-<p id="ch10session4_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
-<pre class="programlisting">$ tr -d '\r'</pre>
-<p id="ch10session4_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
-<p id="ch10session4_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
-</div>
-</div>
-<div class="section" title="14. Elementary Regex">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2912329"></a>14. Elementary Regex</h2></div></div></div>
-<p id="ch10session4_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
-<p id="ch10session4_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
-<p id="ch10session4_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
-<p id="ch10session4_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
-<table summary="Elementary Regex" border="1"><colgroup>
-<col width="13">
-<col width="60">
-</colgroup></table>
-<div class="section" title="14.1. Lazy quantification">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2912542"></a>14.1. Lazy quantification</h3></div></div></div>
-<p id="ch10session4_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
-<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
-<p id="ch10session4_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
-<p id="ch10session4_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
-</div>
-</div>
-<div class="section" title="15. One Liners">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2912618"></a>15. One Liners</h2></div></div></div>
-<p id="ch10session4_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
-<p id="ch10session4_1cd"></a>The one liner can be</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem"><p id="ch10session4_1ce"></a>An expression written in the language of the shell.</p></li>
-<li class="listitem"><p id="ch10session4_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
-<li class="listitem"><p id="ch10session4_1d0"></a>The invocation of a compiler together with source to compile and
-instructions for executing the compiled program.</p></li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch10session4_1d1"></a>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.</p>
-<p id="ch10session4_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
-<p id="ch10session4_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
-<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
-<p id="ch10session4_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
-<p id="ch10session4_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
-<p id="ch10session4_1d6"></a>Here are the first few of them:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem">
-<p id="ch10session4_1d7"></a>Print the total number of input lines:</p>
-<p id="ch10session4_1d8"></a>END { print NR }</p>
-</li>
-<li class="listitem">
-<p id="ch10session4_1d9"></a>Print the tenth input line:</p>
-<p id="ch10session4_1da"></a>NR == 10</p>
-</li>
-<li class="listitem">
-<p id="ch10session4_1db"></a>Print the last field of every input line:</p>
-<p id="ch10session4_1dc"></a>{ print $NF }</p>
-</li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch10session4_1dd"></a>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.</p>
-<p id="ch10session4_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
-<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
-*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
-<p id="ch10session4_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
-<p id="ch10session4_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
-<pre class="programlisting">$ prog foo 'f??'; echo $?
-
-$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
-<p id="ch10session4_1e1"></a>Here is a one line shell script to show directories:</p>
-<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
-</div>
-</div>
-</div></body>
-</html>
--- a/web/html/chn11Section_5.html	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1138 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Section 5</title>
-<link rel="shortcut icon" type="image/png" href="/review/support/figs/favicon.png">
-<script type="text/javascript" src="/review/support/jquery-min.js"></script>
-<script type="text/javascript" src="/review/support/form.js"></script>
-<script type="text/javascript" src="/review/support/hsbook.js"></script>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" id="ch11Section_5">
-<div class="titlepage"></div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="article"><a href="#id2451767"></a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2261892">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2449586">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2502827">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2503099">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2503232">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2503240">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2503518">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2503526">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2503688">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2503749">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2503851">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2503933">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2504112">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2504120">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2502619">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2504548">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2504638">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2504691">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2504700">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2505011">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2505142">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2505313">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2505405">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2505414">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2505500">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2505634">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2505719">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2505852">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2505959">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2505967">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2506170">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2506281">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2506521">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2506791">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2506807">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2506830">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2506838">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2507603">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2507640">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2507709">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2507770">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2507974">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2508008">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2508039">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2508048">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2508237">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2508386">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2508599">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2508675">15. One Liners</a></span></dt>
-</dl></dd>
-</dl>
-</div>
-<div class="article">
-<div class="titlepage">
-<div><div><h2 class="title" id="id2451767"></a></h2></div></div>
-<hr>
-</div>
-<div class="toc">
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><span class="section"><a href="#id2261892">1. Introducing Linux</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2449586">1.1. Historical Background</a></span></dt>
-<dt><span class="section"><a href="#id2502827">1.2. Design and Implications</a></span></dt>
-<dt><span class="section"><a href="#id2503099">1.3. Reasons for Using Linux</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2503232">2. Getting Started</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2503240">2.1. Logging in, activating the user interface and logging out</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2503518">3. Basic Commands</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2503526">3.1. ls</a></span></dt>
-<dt><span class="section"><a href="#id2503688">3.2. date</a></span></dt>
-<dt><span class="section"><a href="#id2503749">3.3. cd</a></span></dt>
-<dt><span class="section"><a href="#id2503851">3.4. who</a></span></dt>
-<dt><span class="section"><a href="#id2503933">3.5. mkdir</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2504112">4. Getting Help</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2504120">4.1. apropos and whatis</a></span></dt>
-<dt><span class="section"><a href="#id2502619">4.2. man</a></span></dt>
-<dt><span class="section"><a href="#id2504548">4.3. info</a></span></dt>
-<dt><span class="section"><a href="#id2504638">4.4. --help</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2504691">5. Basic file handling</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2504700">5.1. cp</a></span></dt>
-<dt><span class="section"><a href="#id2505011">5.2. mv</a></span></dt>
-<dt><span class="section"><a href="#id2505142">5.3. rm</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2505313">6. Command Line Arguments</a></span></dt>
-<dt><span class="section"><a href="#id2505405">7. Basic Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2505414">7.1. head</a></span></dt>
-<dt><span class="section"><a href="#id2505500">7.2. tail</a></span></dt>
-<dt><span class="section"><a href="#id2505634">7.3. cut</a></span></dt>
-<dt><span class="section"><a href="#id2505719">7.4. paste</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2505852">8. Shell Meta Characters</a></span></dt>
-<dt><span class="section"><a href="#id2505959">9. Looking At Files</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2505967">9.1. cat</a></span></dt>
-<dt><span class="section"><a href="#id2506170">9.2. more</a></span></dt>
-<dt><span class="section"><a href="#id2506281">9.3. less</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2506521">10. Directory Structure</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2506791">10.1. man hier</a></span></dt>
-<dt><span class="section"><a href="#id2506807">10.2. ls -l</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2506830">11. Permissions and Ownership</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2506838">11.1. chmod</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2507603">12. Redirection and Piping</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2507640">12.1. Redirecting standard input and standard output</a></span></dt>
-<dt><span class="section"><a href="#id2507709">12.2. Piping</a></span></dt>
-<dt><span class="section"><a href="#id2507770">12.3. Redirecting to and from the standard file handles</a></span></dt>
-<dt><span class="section"><a href="#id2507974">12.4. Chained pipelines</a></span></dt>
-<dt><span class="section"><a href="#id2508008">12.5. Redirect to multiple outputs</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2508039">13. More Text Processing</a></span></dt>
-<dd><dl>
-<dt><span class="section"><a href="#id2508048">13.1. grep</a></span></dt>
-<dt><span class="section"><a href="#id2508237">13.2. tr</a></span></dt>
-</dl></dd>
-<dt><span class="section"><a href="#id2508386">14. Elementary Regex</a></span></dt>
-<dd><dl><dt><span class="section"><a href="#id2508599">14.1. Lazy quantification</a></span></dt></dl></dd>
-<dt><span class="section"><a href="#id2508675">15. One Liners</a></span></dt>
-</dl>
-</div>
-<div class="section" title="1. Introducing Linux">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2261892"></a>1. Introducing Linux</h2></div></div></div>
-<p id="ch11Section_5_1"></a>(Attribution : A significant chunk of the content under this section is based on data from Wikipedia and the Linux Documentation Project)</p>
-<p id="ch11Section_5_2"></a>Linux (usually pronounced ˈlɪnəks') is a generic term referring to Unix-like computer operating systems based on the Linux kernel, where a kernel is the intermediate layer between the hardware and the applications. The kernel is, on an abstract level, the core of (most) operating systems, that manages the various system resources. The development of the Linux OS is considered the basis for Free and Open Source Software (FOSS) collaboration since typically the underlying source code can be used, modified freely, and redistributed by anyone under the terms of the GNU (a recursive acronym for "GNU's Not Unix!") Global Public License (GPL) and other free software licences. This freedom to access and reuse various components of a system, is one of the primary reasons for the popularity of Linux.</p>
-<p id="ch11Section_5_3"></a>Linux is installed on a variety of computer hardware, that include mobile phones, embedded devices and supercomputers, but is infamous for its use in servers.</p>
-<p id="ch11Section_5_4"></a>The name "Linux"  comes from the Linux kernel, originally written in 1991 by Linus Torvalds. The rest of the system usually comprises components such as the Apache HTTP Server, the X Window System, the GNOME and KDE desktop environments, and utilities and libraries from the GNU Project (announced in 1983 by Richard Stallman). Commonly-used applications with desktop Linux systems include the Mozilla Firefox web-browser and the OpenOffice.org office application suite. The GNU contribution is the basis for the Free Software Foundation's preferred name GNU/Linux. The kernel's mascot is a penguin named "Tux". Mozilla Firefox and OpenOffice.org are open-source projects which can be run on most Operating Systems, including proprietary ones.</p>
-<div class="section" title="1.1. Historical Background">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2449586"></a>1.1. Historical Background</h3></div></div></div>
-<div class="section" title="1.1.1. Events leading to the creation">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2449553"></a>1.1.1. Events leading to the creation</h4></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_5"></a>The Unix operating system was developed in the 1960s and released for public use in 1970. Its accessibility and portability caused it to be widely adopted, copied and modified by academic institutions and businesses. Its design became influential to authors of other systems. Other free operating systems include the Berkeley Software Distribution (BSD), developed at the University of California at Berkeley, and MINIX which was released by Andrew S. Tanenbaum. The development and adoption of BSD and MINIX were limited due to various reasons, and this lack of a widely-adopted and free kernel triggered Linus Torvalds into starting his project.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_6"></a>In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system. As part of this work, he wrote the GNU General Public License (GPL). By the early 1990s there was almost enough available software to create a full operating system. However, the GNU kernel, called Hurd, failed to attract enough attention from developers leaving GNU incomplete.</p></li>
-</ul></div>
-</div>
-<div class="section" title="1.1.2. The Creation of Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2502782"></a>1.1.2. The Creation of Linux</h4></div></div></div>
-<p id="ch11Section_5_7"></a>In 1991, Linus Torvalds began a project at the University of Helsinki that later became the Linux kernel. It was initially a terminal (command-line) emulator, which Torvalds used to access the large UNIX servers of the university. He wrote the program targeting just the hardware he was using and independent of an operating system because he wanted to use the functions of his computer with an 80386 processor. Development was done on Minix using the GNU C compiler. This application is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).</p>
-<p id="ch11Section_5_8"></a>Torvalds continues to direct the development of the kernel. Stallman heads the Free Software Foundation, which in turn supports the GNU components. Finally, individuals and corporations develop third-party non-GNU components, which constitute a vast body of work and including kernel modules, and user applications and libraries. Linux vendors and communities combine and distribute the kernel, GNU components, and non-GNU components, with additional package management software in the form of Linux distributions.</p>
-</div>
-</div>
-<div class="section" title="1.2. Design and Implications">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2502827"></a>1.2. Design and Implications</h3></div></div></div>
-<p id="ch11Section_5_9"></a>A Linux-based system is a modular Unix-like operating system, deriving much of its basic design from principles established in Unix earlier. Such a system uses a monolithic kernel, called the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are integrated directly with the kernel. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is based on the "X Window System".</p>
-<div class="section" title="1.2.1. User Interface">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2502852"></a>1.2.1. User Interface</h4></div></div></div>
-<p id="ch11Section_5_a"></a>Users can control a Linux-based system through a command line interface (or CLI), a graphical user interface (or GUI), or through controls attached to the associated hardware (this is common for embedded systems). For desktop systems, the default mode is usually the GUI. On desktop machines, "KDE", "GNOME" and "Xfce" are the most popular user interfaces,though a variety of additional user interfaces exist. Most popular user interfaces run on top of the "X Window System" (or X), which enables a graphical application running on one machine to be displayed and controlled from another in a network.</p>
-<p id="ch11Section_5_b"></a>A Linux system also provides a CLI of some sort through a shell, which is the traditional way of interacting with a Unix system. A Linux distribution specialized for servers may use the CLI as its only interface. A “headless system” (system run without even a monitor) can be controlled by the command line via a remote-control protocol such as SSH or telnet. The CLI is particularly suited for automation of repetitive or delayed tasks, and provides very simple inter-process communication. A graphical terminal emulator program is often used to access the CLI from a Linux desktop.</p>
-</div>
-<div class="section" title="1.2.2. Development">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2502906"></a>1.2.2. Development</h4></div></div></div>
-<p id="ch11Section_5_c"></a>The primary difference between Linux and many other popular contemporary operating systems is that the Linux kernel and other components are free and open source software. Linux is not the only such operating system, although it is by far the most widely used. Some free and open source software licenses are based on the principle of "copyleft", a kind of reciprocity: any work derived from a copyleft piece of software must also be copyleft itself. The most common free software license, the GNU GPL, is a form of copyleft, and is used for the Linux kernel and many of the components from the GNU project.</p>
-<p id="ch11Section_5_d"></a>Linux based distributions are intended by developers for interoperability with other operating systems and established computing standards. Linux systems adhere to POSIX, SUS, ISO and ANSI standards where possible, although to date only one Linux distribution has been POSIX.1 certified, Linux-FT.Free software projects, although developed in a collaborative fashion, are often produced independently of each other. The fact that the software licenses explicitly permit redistribution, however, provides a basis for larger scale projects that collect the software produced by stand-alone projects and make it available all at once in the form of a Linux distribution.</p>
-<p id="ch11Section_5_e"></a>A Linux distribution, commonly called a "distro", is a project that manages a remote collection of system software and application software packages available for download and installation through a network connection. This allows the user to adapt the operating system to his/her specific needs. Distributions are maintained by individuals, loose-knit teams, volunteer organizations, and commercial entities. A distribution can be installed using a CD that contains distribution-specific software for initial system installation and configuration. A package manager such as Synaptic or YAST allows later package upgrades and installations. A distribution is responsible for the default configuration of the installed Linux kernel, general system security, and more generally integration of the different software packages into a coherent whole.</p>
-</div>
-<div class="section" title="1.2.3. Community">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2502962"></a>1.2.3. Community</h4></div></div></div>
-<p id="ch11Section_5_f"></a>A distribution is largely driven by its developer and user communities. Some vendors develop and fund their distributions on a volunteer basis. Examples include Debian and the Debian-based, Ubuntu. Others maintain a community version of their commercial distributions, as Red Hat does with Fedora.</p>
-<p id="ch11Section_5_10"></a>In many cities and regions, local associations known as Linux Users Groups (LUGs) seek to promote their preferred distribution and by extension free software. They hold meetings and provide free demonstrations, training, technical support, and operating system installation to new users. Many Internet communities also provide support to Linux users and developers. Most distributions and free software / open source projects have IRC (Internet Relay Chat) chatrooms or newsgroups. Online forums are another means for support. Linux distributions host mailing lists; commonly there will be a specific topic such as usage or development for a given list. All these can be found simply by running an appropriate search on Google.</p>
-<p id="ch11Section_5_11"></a>Although Linux distributions are generally available without charge, several large corporations sell, support, and contribute to the development of the components of the system and of free software. These include Dell, IBM, HP, Oracle, Sun Microsystems, Novell, Nokia. A number of corporations, notably Red Hat, have built their entire business around Linux distributions.</p>
-</div>
-<div class="section" title="1.2.4. Can I make a profit out of running a business involving Linux?">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2503007"></a>1.2.4. Can I make a profit out of running a business involving Linux?</h4></div></div></div>
-<p id="ch11Section_5_12"></a>The answer is, "Yes!". The free software licenses, on which the various software packages of a distribution built on the Linux kernel are based, explicitly accommodate and encourage commercialization; the relationship between a Linux distribution as a whole and individual vendors may be seen as symbiotic. One common business model of commercial suppliers is charging for support, especially for business users. A number of companies also offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks. Another business model is to give away the software in order to sell hardware. Examples of corporations that are extensively (and sometimes exclusively) open-source and Linux-powered , with successful revenue generation models involving these, are Google, SUN, Mozilla, etc.</p>
-</div>
-<div class="section" title="1.2.5. Programming on Linux">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2503052"></a>1.2.5. Programming on Linux</h4></div></div></div>
-<p id="ch11Section_5_13"></a>Most Linux distributions support dozens of programming languages. The most common collection of utilities for building both Linux applications and operating system programs is found within the GNU toolchain, which includes the GNU Compiler Collection (GCC) and the GNU build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran. The Linux kernel itself is written to be compiled with GCC. Proprietary compilers for Linux include the Intel C++ Compiler, Sun Studio, and IBM XL C/C++ Compiler.</p>
-<p id="ch11Section_5_14"></a>Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic languages. Examples of languages that are less common, but still supported, are C# via the Mono project, sponsored by Novell, and Scheme. A number of Java Virtual Machines and development kits run on Linux, including the original Sun Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like Kaffe.</p>
-<p id="ch11Section_5_15"></a>The two main frameworks for developing graphical applications are those of GNOME and KDE. These projects are based on the GTK+ and Qt widget toolkits, respectively, which can also be used independently of the larger framework. Both support a wide variety of languages. There are a number of Integrated Development Environments (IDEs) available including Anjuta, Code::Blocks, Eclipse, KDevelop, Lazarus, MonoDevelop, NetBeans, and Omnis Studio while the long-established editors Vim and Emacs remain popular.</p>
-</div>
-</div>
-<div class="section" title="1.3. Reasons for Using Linux">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2503099"></a>1.3. Reasons for Using Linux</h3></div></div></div>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch11Section_5_16"></a>Linux is free:</p></li></ul></div>
-<p id="ch11Section_5_17"></a>As in "free beer". Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
-Most of all, Linux is free as in "free speech":
-The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image and sell the new code, as long as your customers can still have a copy of that code.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch11Section_5_18"></a>Linux is portable to any hardware platform:</p></li></ul></div>
-<p id="ch11Section_5_19"></a>A vendor, who wants to sell a new type of computer and who does not know what kind of OS his/her new machine will run, can take a Linux kernel and make it work on his/her hardware, because documentation related to this activity is freely available.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch11Section_5_1a"></a>Linux was made to keep on running:</p></li></ul></div>
-<p id="ch11Section_5_1b"></a>As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other times, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable to environments where people do not have the time or the possibility to control their systems constantly.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch11Section_5_1c"></a>Linux is secure and versatile:</p></li></ul></div>
-<p id="ch11Section_5_1d"></a>The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only safe from attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch11Section_5_1e"></a>Linux is scalable:</p></li></ul></div>
-<p id="ch11Section_5_1f"></a>From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. One does not need a supercomputer anymore,because you can use Linux to do big things using the building blocks provided with the system. If one wants to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well.</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch11Section_5_20"></a>The Linux OS and Linux applications have very short debug−times:</p></li></ul></div>
-<p id="ch11Section_5_21"></a>Because Linux has been developed and tested by thousands of people, both errors and people to fix them are found very quickly. It often happens that there are only a couple of hours between discovery and fixing of a bug.</p>
-</div>
-</div>
-<div class="section" title="2. Getting Started">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2503232"></a>2. Getting Started</h2></div></div></div>
-<div class="section" title="2.1. Logging in, activating the user interface and logging out">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2503240"></a>2.1. Logging in, activating the user interface and logging out</h3></div></div></div>
-<p id="ch11Section_5_22"></a>In order to work on a Linux system directly, one needs to provide a user name and password. You always need to authenticate to the system. Most PC−based Linux systems have two basic modes for a system to run in: either quick and clean in text console mode,which includes with mouse, multitasking and multi−user features, or in graphical console mode, which looks better but eats more system resources.</p>
-<div class="section" title="2.1.1. Graphical Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2503270"></a>2.1.1. Graphical Mode</h4></div></div></div>
-<p id="ch11Section_5_23"></a>This is the default nowadays on most desktop computers. You know you will be connecting to the system using graphical mode when you are first asked for your user name, and then to type your password.</p>
-<p id="ch11Section_5_24"></a>To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and click <span class="emphasis"><em>OK</em></span> or press <span class="emphasis"><em>Enter</em></span>.
-It is generally considered a bad idea to connect (graphically) using the root user name, the system adminstrator's account, since the use of graphics includes running a lot of extra programs, in root's case with a lot of extra permissions. To keep all risks as low as possible, use a normal user account to connect graphically. But there are enough risks to keep this in mind as a general advice, for all use of the root account: only log in as root when extra privileges are required.</p>
-<p id="ch11Section_5_25"></a>After entering your user name/password combination, it can take a little while before the graphical environment is started, depending on the CPU speed of your computer, on the software you use and on your personal settings.</p>
-<p id="ch11Section_5_26"></a>To continue, you will need to open a <span class="emphasis"><em>terminal window</em></span> or <span class="emphasis"><em>xterm</em></span> for short (X being the name for the underlying software supporting the graphical environment). This program can be found in the <span class="emphasis"><em>Applications−&gt;Utilities-&gt;System Tools</em></span> or <span class="emphasis"><em>Internet menu</em></span>, depending on what window manager you are using. There might be icons that you can use as a shortcut to get an <span class="emphasis"><em>xterm</em></span> window as well, and clicking the right mouse button on the desktop background will usually present you with a menu containing a terminal window application.</p>
-<p id="ch11Section_5_27"></a>While browsing the menus, you will notice that a lot of things can be done without entering commands via the keyboard. For most users, the good old point−n−click method of dealing with the computer will do. But for those who want to enter the "heart" of the system, a tool stronger than a mouse will be required to handle the various tasks. This tool is the shell, and when in graphical mode, we activate our shell by opening a terminal window.</p>
-<p id="ch11Section_5_28"></a>A terminal window should always show a command prompt when you open one. This terminal shows a standard prompt, which displays the user's login name, and the current working directory, represented by the twiddle (~)</p>
-<p id="ch11Section_5_29"></a>Another common form for a prompt is this one:
-[</p>
-<div class="reference">
-<div class="titlepage"><hr></div>user@host</div>
-<p> dir]</p>
-<p id="ch11Section_5_2a"></a>In the above example, <span class="emphasis"><em>user</em></span> will be your login name, <span class="emphasis"><em>hosts</em></span> the name of the machine you are working on, and <span class="emphasis"><em>dir</em></span> an indication of your current location in the file system. Prompts can display all kinds of information, but they are not part of the commands you are giving to your system. To disconnect from the system in graphical mode, you need to close all terminal windows and other applications. After that, hit the <span class="emphasis"><em>logout</em></span> icon or find <span class="emphasis"><em>Log Out</em></span> in the menu. Closing everything is not really necessary, and the system can do this for you, but session management might put all currently open applications back on your screen when you connect again, which takes longer and is not always the desired effect. However, this behavior is configurable.</p>
-<p id="ch11Section_5_2b"></a>When you see the login screen again, asking to enter user name and password, logout was successful.</p>
-</div>
-<div class="section" title="2.1.2. Text Mode">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2503428"></a>2.1.2. Text Mode</h4></div></div></div>
-<p id="ch11Section_5_2c"></a>One is in text mode when the whole screen is black, showing (in most cases white) characters. A text mode login screen typically shows some information about the machine you are working on, the name of the machine and a prompt waiting for you to log in.</p>
-<p id="ch11Section_5_2d"></a>The login is different from a graphical login, in that you have to hit the <span class="emphasis"><em>Enter</em></span> key after providing your user name, because there are no buttons on the screen that you can click with the mouse. Then you should type your password, followed by another <span class="emphasis"><em>Enter</em></span>. You will not see any indication that you are entering something, not even an asterisk, and you won't see the cursor move. But this is normal on Linux and is done for security
-reasons.</p>
-<p id="ch11Section_5_2e"></a>When the system has accepted you as a valid user, you may get some more information, called the <span class="emphasis"><em>message of the day</em></span>, which can be anything. Additionally, it is popular on UNIX systems to display a fortune cookie, which contains some general wise or unwise (this is up to you) thoughts. After that, you will be given a shell, indicated with the same prompt that you would get in graphical mode.</p>
-<p id="ch11Section_5_2f"></a>Also in text mode: log in as root only to do setup and configuration that absolutely requires administrator privileges, such as adding users, installing software packages, and performing network and other system configuration. Once you are finished, immediately leave the special account and resume your work as a non−privileged user.</p>
-<p id="ch11Section_5_30"></a>Logging out is done by entering the <span class="emphasis"><em>logout</em></span> command, followed by Enter. You are successfully disconnected from the system when you see the login screen again.Don't power−off the computer after logging out. It is not meant to be shut off without application of the proper procedures for halting the system. Powering it off without going through the halting process might cause severe damage!</p>
-</div>
-</div>
-</div>
-<div class="section" title="3. Basic Commands">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2503518"></a>3. Basic Commands</h2></div></div></div>
-<div class="section" title="3.1. ls">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2503526"></a>3.1. ls</h3></div></div></div>
-<p id="ch11Section_5_31"></a>When invoked without any arguments, <span class="emphasis"><em>ls</em></span> lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed. The name <span class="emphasis"><em>ls</em></span> is derived from <span class="emphasis"><em>list segments</em></span> which was used in earlier systems.</p>
-<p id="ch11Section_5_32"></a>Files whose names start with "." are not listed, unless the <span class="emphasis"><em>-a</em></span> flag is specified or the files are specified explicitly.</p>
-<p id="ch11Section_5_33"></a>Without options, <span class="emphasis"><em>ls</em></span> 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:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_34"></a><span class="emphasis"><em>-l</em></span> long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and filename</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_35"></a><span class="emphasis"><em>-F</em></span> appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_36"></a><span class="emphasis"><em>-a</em></span> 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_37"></a><span class="emphasis"><em>-R</em></span> recursively lists subdirectories. The command ls -R / would therefore list all files.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_38"></a><span class="emphasis"><em>-d</em></span> shows information about a symbolic link or directory, rather than about the link's target or listing the contents of a directory.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_39"></a><span class="emphasis"><em>-t</em></span> sort the list of files by modification time.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_3a"></a><span class="emphasis"><em>-h</em></span> print sizes in human readable format. (e.g., 1K, 234M, 2G, etc.)</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch11Section_5_3b"></a>In some environments, providing the option <span class="emphasis"><em>--color</em></span> (for GNU ls) or <span class="emphasis"><em>-G</em></span> (FreeBSD ls) causes ls to highlight different types of files with different colors, instead of with characters as <span class="emphasis"><em>-F</em></span> would. To determine what color to use for a file, GNU <span class="emphasis"><em>ls</em></span> checks the Unix file type, the file permissions, and the file extension, while FreeBSD <span class="emphasis"><em>ls</em></span> checks only the Unix file type and file permissions.:</p>
-<pre class="programlisting">$ ls
-jeeves.rst psmith.html blandings.html
-$ ls -l
-drwxr--r--   1 plum  editors   4096  jeeves
--rw-r--r--   1 plum  editors  30405  psmith
--r-xr-xr-x   1 plum  plum      8460  blandings</pre>
-<p id="ch11Section_5_3c"></a>Here "$" actually is the beginning of the prompt. This is typical in most Unix-based systems.</p>
-</div>
-<div class="section" title="3.2. date">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2503688"></a>3.2. date</h3></div></div></div>
-<p id="ch11Section_5_3d"></a>The Unix date command displays the time and date. The super-user can use it to set the system clock.</p>
-<p id="ch11Section_5_3e"></a>With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone name, and the year. For example:</p>
-<pre class="programlisting">$date
-Tue Sep  8 12:01:45 IST 2009</pre>
-<p id="ch11Section_5_3f"></a>On some systems to set the current date and time to September 8, 2004 01:22 you type:</p>
-<pre class="programlisting">$date --set="20040908 01:22"</pre>
-<p id="ch11Section_5_40"></a>In order to view the various options for the <span class="emphasis"><em>date</em></span> command, type:</p>
-<pre class="programlisting">$man date</pre>
-<p id="ch11Section_5_41"></a>This will take you to the "Manual" page comprising of all the details on the <span class="emphasis"><em>date</em></span> command. You can return to the terminal from the "man" page by pressing the <span class="emphasis"><em>Esc</em></span> key in the keyboard and typing ":q" in that order.</p>
-</div>
-<div class="section" title="3.3. cd">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2503749"></a>3.3. cd</h3></div></div></div>
-<p id="ch11Section_5_42"></a>This stands for "change directory". When one wants to go up to the parent directory, bypassing the tree of directories one has entered, “ cd ..” can be used.</p>
-<p id="ch11Section_5_43"></a>One dot '.' represents the current directory while two dots '..' represent the parent directory.</p>
-<p id="ch11Section_5_44"></a>“ cd -” will return you to the previous directory (a bit like an “undo”).</p>
-<p id="ch11Section_5_45"></a>You can also use cd absolute path or cd relative path (see below):</p>
-<p id="ch11Section_5_46"></a>Absolute paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch11Section_5_47"></a>An “ absolute path” is easily recognised from the leading forward slash, /. The / means that you start at the top level directory and continue down.</p>&lt;/block_quote&gt;</span><p id="ch11Section_5_48"></a>For example to get to /boot/grub you would type:</p>
-<pre class="programlisting">$cd /boot/grub</pre>
-<p id="ch11Section_5_49"></a>This is an absolute path because you start at the top of the hierarchy and go downwards from there (it doesn't matter where in the filesystem you were when you typed the command).</p>
-<p id="ch11Section_5_4a"></a>Relative paths:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch11Section_5_4b"></a>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.</p>
-<p id="ch11Section_5_4c"></a>For example if you are in root's home directory and want to get to /root/music, you type:</p>
-<pre class="programlisting">$ cd music</pre>&lt;/block_quote&gt;</span><p id="ch11Section_5_4d"></a>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.</p>
-</div>
-<div class="section" title="3.4. who">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2503851"></a>3.4. who</h3></div></div></div>
-<p id="ch11Section_5_4e"></a>The standard Unix command <span class="emphasis"><em>who</em></span> displays a list of users who are currently logged into a computer.</p>
-<p id="ch11Section_5_4f"></a>The <span class="emphasis"><em>who</em></span> command is related to the command <span class="emphasis"><em>w</em></span>, which provides the same information but also displays additional data and statistics.:</p>
-<pre class="programlisting">$who
-beeblebrox tty7         2009-09-08 10:50 (:0)
-beeblebrox pts/0        2009-09-08 11:25 (:0.0)
-dumbledore pts/1        2009-09-08 18:11 (potter.xyz.in)
-beeblebrox pts/2        2009-09-08 18:53 (:0.0)</pre>
-<p id="ch11Section_5_50"></a>The command can be invoked with the arguments <span class="emphasis"><em>am i</em></span> or <span class="emphasis"><em>am I</em></span> (so it is invoked as <span class="emphasis"><em>who am i</em></span> or * who am I*), showing information about the current terminal only (see the <span class="emphasis"><em>-m</em></span> option below, of which this invocation is equivalent).</p>
-<p id="ch11Section_5_51"></a>In order to find out the various options that can be appended to the <span class="emphasis"><em>who</em></span> command, check the <span class="emphasis"><em>man</em></span> page by typing out the following in the terminal:</p>
-<pre class="programlisting">$man who</pre>
-<p id="ch11Section_5_52"></a>This will take you to the "Manual" page containing details about the <span class="emphasis"><em>who</em></span> command</p>
-</div>
-<div class="section" title="3.5. mkdir">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2503933"></a>3.5. mkdir</h3></div></div></div>
-<p id="ch11Section_5_53"></a>This command is used to make a new directory. Normal usage is as straightforward as follows:</p>
-<pre class="programlisting">$mkdir name_of_directory</pre>
-<p id="ch11Section_5_54"></a>Where <span class="emphasis"><em>name_of_directory</em></span> is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory. On Unix, multiple directories can be specified, and <span class="emphasis"><em>mkdir</em></span> will try to create all of them.</p>
-<div class="section" title="3.5.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2503964"></a>3.5.1. Options</h4></div></div></div>
-<p id="ch11Section_5_55"></a>On Unix-like operating systems, <span class="emphasis"><em>mkdir</em></span> takes options. Three of the most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_56"></a><span class="emphasis"><em>-p</em></span>: 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.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_57"></a><span class="emphasis"><em>-v</em></span>: display each directory that mkdir creates. Most often used with -p.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_58"></a><span class="emphasis"><em>-m</em></span>: specify the octal permissions of directories created by mkdir.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch11Section_5_59"></a><span class="emphasis"><em>-p</em></span> is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.</p>
-</div>
-<div class="section" title="3.5.2. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2504026"></a>3.5.2. Examples</h4></div></div></div>
-<p id="ch11Section_5_5a"></a>An example of <span class="emphasis"><em>-p</em></span> in action is:</p>
-<pre class="programlisting">$mkdir -p /tmp/a/b/c</pre>
-<p id="ch11Section_5_5b"></a>If <span class="emphasis"><em>/tmp/a</em></span> exists but <span class="emphasis"><em>/tmp/a/b</em></span> does not, mkdir will create <span class="emphasis"><em>/tmp/a/b</em></span> before creating <span class="emphasis"><em>/tmp/a/b/c</em></span>.</p>
-<p id="ch11Section_5_5c"></a>And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):</p>
-<pre class="programlisting">$mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}</pre>
-<p id="ch11Section_5_5d"></a>This will create:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;tmpdir  - branches&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_5e"></a>tag</p></li>
-<li class="listitem" style="list-style-type: *"><span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;trunk - sources - includes&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*"><li class="listitem" style="list-style-type: *"><p id="ch11Section_5_5f"></a>docs</p></li></ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span></li>
-</ul></div>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span>
-</div>
-</div>
-</div>
-<div class="section" title="4. Getting Help">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2504112"></a>4. Getting Help</h2></div></div></div>
-<div class="section" title="4.1. apropos and whatis">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2504120"></a>4.1. apropos and whatis</h3></div></div></div>
-<p id="ch11Section_5_60"></a>This is a command to search the manual pages files in Unix and Unix-like operating systems.</p>
-<pre class="programlisting">$ apropos grep
-egrep       egrep (1)       Search a file for a pattern using full regular expressions
-fgrep       fgrep (1)       Search a file for a fixed-character string
-fmlgrep     fmlgrep (1)     Search a file for a pattern
-grep        grep (1)        Search a file for a pattern
-gzgrep      gzgrep (1)      Search a possibly compressed file for a regular expression
-nisgrep     nismatch (1)    Utilities for searching NIS+ tables
-pgrep       pgrep (1)       Find or signal a process by name or other attribute
-zgrep       zgrep (1)       Search a possibly compressed file for a regular expression
-...</pre>
-<p id="ch11Section_5_61"></a>In this example, the user uses <span class="emphasis"><em>apropos</em></span> to search for the string "grep", and apropos returns the indicated <span class="emphasis"><em>man</em></span> pages that include the term "grep".</p>
-<p id="ch11Section_5_62"></a>A short index of explanations for commands is available using the <span class="emphasis"><em>whatis</em></span> command, like in the examples below:</p>
-<pre class="programlisting">$whatis ls
-ls (1)           - list directory contents</pre>
-<p id="ch11Section_5_63"></a>This displays short information about a command, and the first section in the collection of man pages that contains an appropriate page.</p>
-<p id="ch11Section_5_64"></a>If you don't know where to get started and which man page to read, <span class="emphasis"><em>apropos</em></span> gives more information. Say that you do not know how to start a browser, then you could enter the following command:</p>
-<pre class="programlisting">$apropos browser
-gmusicbrowser (1)    - Jukebox for large collections of audio files
-infobrowser (1)      - read Info documents
-libsmbclient (7)     - An extension library for browsers and that               can be used...
-opera (1)            - a standards-compliant graphical Web browser
-sensible-browser (1) - sensible editing, paging, and web browsing
-smbtree (1)          - A text based smb network browser
-tvtk_doc (1)         - A GUI based TVTK documentation search browser.
-viewres (1)          - graphical class browser for Xt
-w3m (1)              - a text based Web browser and pager
-www-browser (1)      - a text based Web browser and pager
-...</pre>
-</div>
-<div class="section" title="4.2. man">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2502619"></a>4.2. man</h3></div></div></div>
-<p id="ch11Section_5_65"></a>Man pages (short for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is <span class="emphasis"><em>man</em></span>. Each page is a self-contained document.</p>
-<p id="ch11Section_5_66"></a>To read a manual page for a Unix command, one can use:</p>
-<pre class="programlisting">$ man &lt;command_name&gt;</pre>
-<p id="ch11Section_5_67"></a>at a shell prompt; for example, "man ftp". In order to simplify navigation through the output, <span class="emphasis"><em>man</em></span> generally uses the less terminal pager.</p>
-<p id="ch11Section_5_68"></a>Pages are traditionally referred to using the notation "name(section)"; for example, ftp(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages coincide. Two examples are <span class="emphasis"><em>man(1)</em></span> and <span class="emphasis"><em>man(7)</em></span>, or <span class="emphasis"><em>exit(2)</em></span> and <span class="emphasis"><em>exit(3)</em></span>. The syntax for accessing the non-default manual section varies between different man implementations. On Linux and <span class="emphasis"><em>BSD, for example, the syntax for reading *printf(3)</em></span> is:</p>
-<pre class="programlisting">$man 3 printf</pre>
-<p id="ch11Section_5_69"></a>Another example:</p>
-<pre class="programlisting">$man man</pre>
-<p id="ch11Section_5_6a"></a>The previous example will take you to the "Manual" page entry about manual pages!</p>
-<div class="section" title="4.2.1. Layout">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2504422"></a>4.2.1. Layout</h4></div></div></div>
-<p id="ch11Section_5_6b"></a>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:</p>
-<span style="color: red">&lt;definition_list&gt;<span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;NAME&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch11Section_5_6c"></a>The name of the command or function, followed by a one-line description of what it does.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SYNOPSIS&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch11Section_5_6d"></a>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.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;DESCRIPTION&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch11Section_5_6e"></a>A textual description of the functioning of the command or function.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;EXAMPLES&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch11Section_5_6f"></a>Some examples of common usage.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span><span style="color: red">&lt;definition_list_item&gt;<span style="color: red">&lt;term&gt;SEE ALSO&lt;/term&gt;</span><span style="color: red">&lt;definition&gt;<p id="ch11Section_5_70"></a>A list of related commands or functions.</p>&lt;/definition&gt;</span>&lt;/definition_list_item&gt;</span>&lt;/definition_list&gt;</span><p id="ch11Section_5_71"></a>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.</p>
-<p id="ch11Section_5_72"></a>These days virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to <span class="emphasis"><em>man</em></span> have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.</p>
-<p id="ch11Section_5_73"></a>However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned "info" system.</p>
-<p id="ch11Section_5_74"></a>Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as yelp for reading the help within the application.</p>
-<p id="ch11Section_5_75"></a>Usually the man pages are written in English. Translations into other languages can be also available on the system.</p>
-<p id="ch11Section_5_76"></a>The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.</p>
-</div>
-</div>
-<div class="section" title="4.3. info">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2504548"></a>4.3. info</h3></div></div></div>
-<p id="ch11Section_5_77"></a><span class="emphasis"><em>info</em></span> is a software utility which forms a hypertextual, multipage documentation and help viewer working on a command line interface, useful when there is no GUI available.</p>
-<p id="ch11Section_5_78"></a>The syntax is</p>
-<pre class="programlisting">$ info &lt;command_name&gt;</pre>
-<p id="ch11Section_5_79"></a><span class="emphasis"><em>info</em></span> 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</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_7a"></a><span class="emphasis"><em>n</em></span> goes to the next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_7b"></a><span class="emphasis"><em>p</em></span> goes to the previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_7c"></a><span class="emphasis"><em>u</em></span> goes to the upper page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_7d"></a><span class="emphasis"><em>l</em></span> goes to the last(visited) node</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_7e"></a>To follow a cross reference, the cursor can be moved over a link (a word preceded by a <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>) and enter pressed.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch11Section_5_7f"></a>info was initially written for use with GNU/Linux and then ported to other Unix-like operating systems.</p>
-</div>
-<div class="section" title="4.4. --help">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2504638"></a>4.4. --help</h3></div></div></div>
-<p id="ch11Section_5_80"></a>Most GNU commands support the --help, which gives a short explanation about how to use the command and a list of available options. Below is the output of this option with the <span class="emphasis"><em>cat</em></span> command:</p>
-<pre class="programlisting">$ userprompt@host: cat --help
-Usage: cat [OPTION] [FILE]...
-Concatenate FILE(s), or standard input, to standard output.
-
-  -A, --show-all           equivalent to -vET
-  -b, --number-nonblank    number nonempty output lines
-  -e                       equivalent to -vE
-  -E, --show-ends          display $ at end of each line
-  -n, --number             number all output lines
-  -s, --squeeze-blank      suppress repeated empty output lines
-  -t                       equivalent to -vT
-  -T, --show-tabs          display TAB characters as ^I
-  -u                       (ignored)
-  -v, --show-nonprinting   use ^ and M- notation, except for LFD and              TAB
-  --help     display this help and exit
-  --version  output version information and exit
-
-With no FILE, or when FILE is -, read standard input.
-
-Examples:
-  cat f - g  Output f's contents, then standard input, then g's           contents.
-  cat        Copy standard input to standard output.
-
-Report bugs to &lt;bug-coreutils@gnu.org&gt;.</pre>
-</div>
-</div>
-<div class="section" title="5. Basic file handling">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2504691"></a>5. Basic file handling</h2></div></div></div>
-<div class="section" title="5.1. cp">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2504700"></a>5.1. cp</h3></div></div></div>
-<p id="ch11Section_5_81"></a><span class="emphasis"><em>cp</em></span> is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.</p>
-<div class="section" title="5.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2504717"></a>5.1.1. Usage</h4></div></div></div>
-<p id="ch11Section_5_82"></a>To copy a file to another file:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ][ -- ] SourceFile TargetFile</pre>
-<p id="ch11Section_5_83"></a>To copy a file to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ...              TargetDirectory</pre>
-<p id="ch11Section_5_84"></a>To copy a directory to a directory:</p>
-<pre class="programlisting">$ cp [ -f ] [ -H ] [ -i ] [ -p ] [ -- ] { -r | -R }
-SourceDirectory ... TargetDirectory</pre>
-</div>
-<div class="section" title="5.1.2. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2504751"></a>5.1.2. Flags</h4></div></div></div>
-<p id="ch11Section_5_85"></a><span class="emphasis"><em>-f</em></span> (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.</p>
-<p id="ch11Section_5_86"></a><span class="emphasis"><em>-P</em></span> – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.</p>
-<p id="ch11Section_5_87"></a><span class="emphasis"><em>-i</em></span> (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.</p>
-<p id="ch11Section_5_88"></a><span class="emphasis"><em>-p</em></span> (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_89"></a>The time of the last data modification and the time of the last access.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_8a"></a>The user ID and group ID (only if it has permissions to do this)</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_8b"></a>The file permission bits and the SUID and SGID bits.</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch11Section_5_8c"></a><span class="emphasis"><em>-R</em></span> (recursive) – copy directories (recursively copying all the contents)</p>
-</div>
-<div class="section" title="5.1.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2504849"></a>5.1.3. Examples</h4></div></div></div>
-<p id="ch11Section_5_8d"></a>To make a copy of a file in the current directory, enter:</p>
-<pre class="programlisting">$ cp prog.c prog.bak</pre>
-<p id="ch11Section_5_8e"></a>This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.</p>
-<p id="ch11Section_5_8f"></a>To copy a file in your current directory into another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod /home/books/hhgg</pre>
-<p id="ch11Section_5_90"></a>This copies the jones file to /home/books/hhgg/zaphod.</p>
-<p id="ch11Section_5_91"></a>To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:</p>
-<pre class="programlisting">$ cp -p martin_luther_king martin_luther_king.jr</pre>
-<p id="ch11Section_5_92"></a>This copies the <span class="emphasis"><em>martin_luther_king</em></span> file to the <span class="emphasis"><em>martin_luther_king.jr</em></span> file. Instead of creating the file with the current date and time stamp, the system gives the <span class="emphasis"><em>martin_luther_king.jr</em></span> file the same date and time as the <span class="emphasis"><em>martin_luther_king</em></span> file. The <span class="emphasis"><em>martin_luther_king.jr</em></span> file also inherits the <span class="emphasis"><em>martin_luther_king</em></span> file's access control protection.</p>
-<p id="ch11Section_5_93"></a>To copy all the files in a directory to a new directory, enter:</p>
-<pre class="programlisting">$ cp /home/galactica/clients/* /home/hhgg/customers</pre>
-<p id="ch11Section_5_94"></a>This copies only the files in the clients directory to the customers directory.</p>
-<p id="ch11Section_5_95"></a>To copy a directory, including all its files and subdirectories, to another directory, enter:</p>
-<span style="color: red">&lt;block_quote&gt;<p id="ch11Section_5_96"></a>$ cp -R /home/hhgg/clients /home/hhgg/customers</p>&lt;/block_quote&gt;</span><p id="ch11Section_5_97"></a>This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.</p>
-<p id="ch11Section_5_98"></a>To copy a specific set of files of any extension to another directory, enter:</p>
-<pre class="programlisting">$ cp zaphod arthur ford /home/hhgg/clients</pre>
-<p id="ch11Section_5_99"></a>This copies the <span class="emphasis"><em>zaphod</em></span>, <span class="emphasis"><em>arthur</em></span>, and <span class="emphasis"><em>ford</em></span> files in your current working directory to the /home/hhgg/clients directory.</p>
-<p id="ch11Section_5_9a"></a>To use pattern-matching characters to copy files, enter:</p>
-<pre class="programlisting">$ cp programs/*.py .</pre>
-<p id="ch11Section_5_9b"></a>This copies the files in the programs directory that end with <span class="emphasis"><em>.py</em></span> to the current directory, signified by the single "." (dot). You must type a space between the <span class="emphasis"><em>py</em></span> and the final dot.</p>
-</div>
-</div>
-<div class="section" title="5.2. mv">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2505011"></a>5.2. mv</h3></div></div></div>
-<p id="ch11Section_5_9c"></a><span class="emphasis"><em>mv</em></span> (short for move) is a Unix command that moves one or more files or directories from one place to another. The original file is deleted, and the new file may have the same or a different name. If possible (i.e. when the original and new files are on the same file system), <span class="emphasis"><em>mv</em></span> will rename the file instead. Write permission is required on all directories being modified.</p>
-<div class="section" title="5.2.1. Conflicting existing file">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2505034"></a>5.2.1. Conflicting existing file</h4></div></div></div>
-<p id="ch11Section_5_9d"></a>In all cases, when a file is moved to have the name of an existing file (in the same directory), the existing file is deleted. If the existing file is not writable but is in a directory that is writable, then the mv command asks for confirmation if possible (i.e. if run from a terminal) before proceeding, unless the -f (force) option is used.</p>
-</div>
-<div class="section" title="5.2.2. Differences with copy and delete">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2505054"></a>5.2.2. Differences with copy and delete</h4></div></div></div>
-<p id="ch11Section_5_9e"></a>Note that, usually, when moving files within the same volume, moving (and/or renaming) is not the same as simply copying and then deleting the original. When moving a file, the link is simply removed from the old parent directory and added to the new parent directory. However, the file itself is untouched (i.e. it has the same inodes and resides at the same place on the disk). For example, you cannot copy a file you cannot read, but you can move (and/or rename) it (provided you have write permission to its old and new parent directories). Also, suppose there is a non-empty directory you do not have write permission to. You cannot delete this directory (since you cannot delete its contents); but you can move (and/or rename) it. Also, since moving between filenames on a single volume does not involve copying, it is faster and does not place strain of lots of reads and writes on the disk. Moving files across different volumes, however, does necessitate copying and deleting.</p>
-</div>
-<div class="section" title="5.2.3. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2505084"></a>5.2.3. Examples</h4></div></div></div>
-<pre class="programlisting">$ mv myfile mynewfilename    renames a file
-$ mv myfile otherfilename    renames a file and deletes the existing            file "myfile"
-$ mv myfile /myfile          moves 'myfile' from the current            directory to the root directory
-$ mv myfile dir/myfile       moves 'myfile' to 'dir/myfile' relative            to the current directory
-$ mv myfile dir              same as the previous command (the          filename is implied to be the same)
-$ mv myfile dir/myfile2      moves 'myfile' to dir and renames it to            'myfile2'
-$ mv foo bar baz dir         moves multiple files to directory dir
-$ mv --help                  shows a very concise help about the                syntax of the command
-$ man mv                     prints an extensive user manual for                'mv' in the terminal</pre>
-<p id="ch11Section_5_9f"></a>In all cases, the file or files being moved or renamed can be a directory.</p>
-<p id="ch11Section_5_a0"></a>Note that when the command is called with two arguments (as <span class="emphasis"><em>mv name1 name2</em></span> or <span class="emphasis"><em>mv name1 /dir/name2</em></span>), it can have three different effects, depending on whether <span class="emphasis"><em>name2</em></span> does not exist, is an existing file, or is an existing directory. If the user intends to refer to an existing directory, <span class="emphasis"><em>/.</em></span> (or in some Unix versions <span class="emphasis"><em>/</em></span> is sufficient) may be appended to the name to force the system to check this. To move a file to a new directory, the directory must be created first.</p>
-</div>
-</div>
-<div class="section" title="5.3. rm">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2505142"></a>5.3. rm</h3></div></div></div>
-<p id="ch11Section_5_a1"></a><span class="emphasis"><em>rm</em></span> (short for "remove") is one of several basic Unix command lines that operates on files. It is used to delete files from a filesystem. The data is not actually destroyed. Only the index listing where the file is stored is destroyed, and the storage is made available for reuse. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused.</p>
-<p id="ch11Section_5_a2"></a>Here's example to remove a file named "foo" from a directory, here shown with the -i option:</p>
-<pre class="programlisting">$ rm -i foo
-remove foo? y</pre>
-<div class="section" title="5.3.1. Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2505172"></a>5.3.1. Options</h4></div></div></div>
-<p id="ch11Section_5_a3"></a>Common options that rm accepts include:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_a4"></a><span class="emphasis"><em>-r</em></span>, which removes directories, removing the contents recursively beforehand (so as not to leave files without a directory to reside in) ("recursive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_a5"></a><span class="emphasis"><em>-i</em></span>, which asks for every deletion to be confirmed ("interactive")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_a6"></a><span class="emphasis"><em>-f</em></span>, which ignores non-existent files and overrides any confirmation prompts ("force")</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_a7"></a><span class="emphasis"><em>-v</em></span>, which shows what is being removed as it happens ("verbose")</p></li>
-</ul></div>&lt;/block_quote&gt;</span><p id="ch11Section_5_a8"></a><span class="emphasis"><em>rm</em></span> is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).</p>
-<p id="ch11Section_5_a9"></a><span class="emphasis"><em>rm -rf</em></span> (variously, rm -rf /, rm -rf <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span>, 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.</p>
-<p id="ch11Section_5_aa"></a><span class="emphasis"><em>rm</em></span> is often used in conjunction with xargs to supply a list of files to delete:</p>
-<pre class="programlisting">xargs rm &lt; filelist</pre>
-<p id="ch11Section_5_ab"></a>When <span class="emphasis"><em>rm</em></span> is used on a symbolic link, it deletes the link, but does not affect the target of the link.</p>
-</div>
-<div class="section" title="5.3.2. Permissions">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2505274"></a>5.3.2. Permissions</h4></div></div></div>
-<p id="ch11Section_5_ac"></a>Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). (Note that, confusingly for beginners, permissions on the file itself are irrelevant. However, GNU rm asks for confirmation if a write-protected file is to be deleted, unless the -f option is used.)</p>
-<p id="ch11Section_5_ad"></a>To delete a directory (with rm -r), one must delete all of its contents recursively. This requires that one must have read and write and execute permission to that directory (if it's not empty) and all non-empty subdirectories recursively (if there are any). The read permissions are needed to list the contents of the directory in order to delete them. This sometimes leads to an odd situation where a non-empty directory cannot be deleted because one doesn't have write permission to it and so cannot delete its contents; but if the same directory were empty, one would be able to delete it.</p>
-<p id="ch11Section_5_ae"></a>If a file resides in a directory with the sticky bit set, then deleting the file requires one to be the owner of the file.</p>
-</div>
-</div>
-</div>
-<div class="section" title="6. Command Line Arguments">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2505313"></a>6. Command Line Arguments</h2></div></div></div>
-<p id="ch11Section_5_af"></a>In computer command line interfaces, a command line argument is an argument sent to a program being called. In general, a program can take any number of command line arguments, which may be necessary for the program to run, or may even be ignored, depending on the function of that program.</p>
-<p id="ch11Section_5_b0"></a>For example, in Unix and Unix-like environments, an example of a command-line argument is:</p>
-<pre class="programlisting">rm file.s</pre>
-<p id="ch11Section_5_b1"></a>"file.s" is a command line argument which tells the program rm to remove the file "file.s".</p>
-<p id="ch11Section_5_b2"></a>Programming languages such as C, C++ and Java allow a program to interpret the command line arguments by handling them as string parameters in the main function.</p>
-<p id="ch11Section_5_b3"></a>A command line option or simply <span class="emphasis"><em>option</em></span> (also known as a command line parameter, flag, or a switch) is an indication by a user that a computer program should change its default output.</p>
-<p id="ch11Section_5_b4"></a>Long options are introduced via "--", and are typically whole words. For example, <span class="emphasis"><em>ls --long --classify --all</em></span>. Arguments to long options are provided with "=", as <span class="emphasis"><em>ls --block-size=1024</em></span>. Some Unix programs use long options with single dashes, for example MPlayer as in <span class="emphasis"><em>mplayer -nosound</em></span>.</p>
-<p id="ch11Section_5_b5"></a>Linux also uses "--" to terminate option lists. For example, an attempt to delete a file called <span class="emphasis"><em>-file1</em></span> by using <span class="emphasis"><em>rm -file1</em></span> may produce an error, since rm may interpret <span class="emphasis"><em>-file1</em></span> as a command line switch. Using <span class="emphasis"><em>rm -- -file1</em></span> removes ambiguity.</p>
-</div>
-<div class="section" title="7. Basic Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2505405"></a>7. Basic Text Processing</h2></div></div></div>
-<div class="section" title="7.1. head">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2505414"></a>7.1. head</h3></div></div></div>
-<p id="ch11Section_5_b6"></a><span class="emphasis"><em>head</em></span> is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:</p>
-<pre class="programlisting">$ head [options] &lt;file_name&gt;</pre>
-<p id="ch11Section_5_b7"></a>By default, <span class="emphasis"><em>head</em></span> will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of filename:</p>
-<pre class="programlisting">$ head -n 20 filename</pre>
-<p id="ch11Section_5_b8"></a>This displays the first 5 lines of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ head -n 5 foo*</pre>
-<p id="ch11Section_5_b9"></a>Some versions omit the n and just let you say -5.</p>
-<div class="section" title="7.1.1. Flags">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2505465"></a>7.1.1. Flags</h4></div></div></div>
-<pre class="programlisting">-c &lt;x number of bytes&gt; Copy first x number of bytes.</pre>
-<p id="ch11Section_5_ba"></a>Other options: <span class="emphasis"><em>sed</em></span></p>
-<p id="ch11Section_5_bb"></a>Many early versions of Unix did not have this command, and so documentation and books had <span class="emphasis"><em>sed</em></span> do this job:</p>
-<pre class="programlisting">sed 5q foo</pre>
-<p id="ch11Section_5_bc"></a>This says to print every line (implicit), and quit after the fifth.</p>
-</div>
-</div>
-<div class="section" title="7.2. tail">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2505500"></a>7.2. tail</h3></div></div></div>
-<p id="ch11Section_5_bd"></a><span class="emphasis"><em>tail</em></span> is a program on Unix and Unix-like systems used to display the last few lines of a text file or piped data.</p>
-<p id="ch11Section_5_be"></a>The command-syntax is:</p>
-<pre class="programlisting">$ tail [options] &lt;file_name&gt;</pre>
-<p id="ch11Section_5_bf"></a>By default, <span class="emphasis"><em>tail</em></span> will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:</p>
-<pre class="programlisting">$ tail -n 20 filename</pre>
-<p id="ch11Section_5_c0"></a>This example shows the last 15 bytes of all files starting with <span class="emphasis"><em>foo</em></span>:</p>
-<pre class="programlisting">$ tail -c 15 foo*</pre>
-<p id="ch11Section_5_c1"></a>This example shows all lines of filename from the second line onwards:</p>
-<pre class="programlisting">$ tail -n +2 filename</pre>
-<p id="ch11Section_5_c2"></a>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:</p>
-<pre class="programlisting">$ tail -20 filename
-$ tail -50c filename</pre>
-<p id="ch11Section_5_c3"></a>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
-<div class="section" title="7.2.1. File monitoring">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2505578"></a>7.2.1. File monitoring</h4></div></div></div>
-<p id="ch11Section_5_c4"></a><span class="emphasis"><em>tail</em></span> has a special command line option <span class="emphasis"><em>-f</em></span> (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
-<pre class="programlisting">$ tail -f /var/adm/messages</pre>
-<p id="ch11Section_5_c5"></a>To interrupt tail while it is monitoring, break-in with <span class="emphasis"><em>Ctrl+C</em></span>. This command can be run "in the background" with &amp;, see job control.</p>
-<p id="ch11Section_5_c6"></a>If you have a command's result to monitor, you can use the <span class="emphasis"><em>watch</em></span> command.</p>
-</div>
-</div>
-<div class="section" title="7.3. cut">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2505634"></a>7.3. cut</h3></div></div></div>
-<p id="ch11Section_5_c7"></a>In computing, <span class="emphasis"><em>cut</em></span> is a Unix command line utility which is used to extract sections from each line of input — usually from a file.</p>
-<p id="ch11Section_5_c8"></a>Extraction of line segments can typically be done by <span class="emphasis"><em>bytes (-b), characters (-c)</em></span>, or <span class="emphasis"><em>fields (-f)</em></span> separated by a <span class="emphasis"><em>delimiter (-d — the tab character by default)</em></span>. A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1.</p>
-<p id="ch11Section_5_c9"></a>Assuming a file named file containing the lines:</p>
-<pre class="programlisting">foo:bar:baz:qux:quux
-one:two:three:four:five:six:seven
-alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-<p id="ch11Section_5_ca"></a>To output the fourth through tenth characters of each line:</p>
-<pre class="programlisting">$ cut -c 4-10 file</pre>
-<p id="ch11Section_5_cb"></a>This gives the output:</p>
-<pre class="programlisting">:bar:ba
-:two:th
-ha:beta</pre>
-<p id="ch11Section_5_cc"></a>To output the fifth field through the end of the line of each line using the colon character as the field delimiter:</p>
-<pre class="programlisting">$ cut -d : -f 5- file</pre>
-<p id="ch11Section_5_cd"></a>This gives the output:</p>
-<pre class="programlisting">quux
-five:six:seven
-epsilon:zeta:eta:teta:iota:kappa:lambda:mu</pre>
-</div>
-<div class="section" title="7.4. paste">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2505719"></a>7.4. paste</h3></div></div></div>
-<p id="ch11Section_5_ce"></a><span class="emphasis"><em>paste</em></span> is a Unix command line utility which is used to join files horizontally (parallel merging) by outputting lines consisting of the sequentially corresponding lines of each file specified, separated by tabs, to the standard output. It is effectively the horizontal equivalent to the utility <span class="emphasis"><em>cat</em></span> command which operates on the vertical plane of two or more files.</p>
-<p id="ch11Section_5_cf"></a>To paste several columns of data together into the file <span class="emphasis"><em>www</em></span> from files <span class="emphasis"><em>who</em></span>, <span class="emphasis"><em>where</em></span>, and <span class="emphasis"><em>when</em></span>:</p>
-<pre class="programlisting">$ paste who where when &gt; www</pre>
-<p id="ch11Section_5_d0"></a>If the files contain:</p>
-<table summary="paste" border="1"><colgroup>
-<col width="11">
-<col width="12">
-<col width="12">
-</colgroup></table>
-<p id="ch11Section_5_dd"></a>This creates the file named <span class="emphasis"><em>www</em></span> containing:</p>
-<pre class="programlisting">Batman            GothamCity       January 3
-Trillian          Andromeda        February 4
-Jeeves            London           March 19</pre>
-</div>
-</div>
-<div class="section" title="8. Shell Meta Characters">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2505852"></a>8. Shell Meta Characters</h2></div></div></div>
-<p id="ch11Section_5_de"></a>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.</p>
-<p id="ch11Section_5_df"></a>The shell meta characters include:</p>
-<p id="ch11Section_5_e0"></a>/ &lt; &gt; ! $ % ^ &amp; * | { } [ ] " ' ` ~ ;</p>
-<p id="ch11Section_5_e1"></a>Different shells may differ in the meta characters recognized.</p>
-<p id="ch11Section_5_e2"></a>As an example,</p>
-<pre class="programlisting">$ ls file.*</pre>
-<p id="ch11Section_5_e3"></a>run on a directory containing the files file, file.c, file.lst, and myfile would list the files file.c and file.lst. However,:</p>
-<pre class="programlisting">$ ls file.?</pre>
-<p id="ch11Section_5_e4"></a>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:</p>
-<pre class="programlisting">$ more c*</pre>
-<p id="ch11Section_5_e5"></a>because the c* matches that long file name.</p>
-<p id="ch11Section_5_e6"></a>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 <span style="color: red">&lt;title_reference&gt;"``*`|more&lt;/title_reference&gt;</span>"` can be accomplished with:</p>
-<pre class="programlisting">$ rm ??more</pre>
-<p id="ch11Section_5_e7"></a>or:</p>
-<pre class="programlisting">$ rm $\backslash$*$\backslash$|more</pre>
-<p id="ch11Section_5_e8"></a>or:</p>
-<pre class="programlisting">$ rm ''*|more''</pre>
-</div>
-<div class="section" title="9. Looking At Files">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2505959"></a>9. Looking At Files</h2></div></div></div>
-<div class="section" title="9.1. cat">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2505967"></a>9.1. cat</h3></div></div></div>
-<p id="ch11Section_5_e9"></a>The <span class="emphasis"><em>cat</em></span> command is a standard Unix program used to concatenate and display files. The name is from "catenate", a synonym of <span class="emphasis"><em>concatenate</em></span>.</p>
-<p id="ch11Section_5_ea"></a>The Single Unix Specification specifies the behavior that the contents of each of the files given in sequence as arguments will be written to the standard output in the same sequence, and mandates one option, -u, where each byte is printed as it is read.</p>
-<p id="ch11Section_5_eb"></a>If the filename is specified as -, then <span class="emphasis"><em>cat</em></span> will read from standard input at that point in the sequence. If no files are specified, <span class="emphasis"><em>cat</em></span> will read from standard input entered.</p>
-<div class="section" title="9.1.1. Jargon File Definition">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2506010"></a>9.1.1. Jargon File Definition</h4></div></div></div>
-<p id="ch11Section_5_ec"></a>The Jargon File version 4.4.7 lists this as the definition of <span class="emphasis"><em>cat</em></span>:</p>
-<pre class="programlisting">1. To spew an entire file to the screen or some other output sink without
-     pause (syn. blast).
-
-2. By extension, to dump large amounts of data at an unprepared target or
-     with no intention of browsing it carefully. Usage: considered silly.
-     Rare outside Unix sites. See also dd, BLT.
-
-     Among Unix fans, *cat(1)* is considered an excellent example of
-     user-interface design, because it delivers the file contents without
-     such verbosity as spacing or headers between the files, and because
-     it does not require the files to consist of lines of text, but works
-     with any sort of data.
-
-     Among Unix critics, *cat(1)* is considered the canonical example of
-     bad user-interface design, because of its woefully unobvious name.
-     It is far more often used to blast a single file to standard output
-     than to concatenate two or more files. The name cat for the former
-     operation is just as unintuitive as, say, LISP's cdr.
-
-     Of such oppositions are holy wars made...</pre>
-</div>
-<div class="section" title="9.1.2. Useless Use of 'cat'">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2506066"></a>9.1.2. Useless Use of 'cat'</h4></div></div></div>
-<p id="ch11Section_5_ed"></a>UUOC (from comp.unix.shell on Usenet) stands for “Useless Use of cat”. As it is observed on <span class="emphasis"><em>comp.unix.shell</em></span>, “The purpose of cat is to concatenate (or 'catenate') files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”</p>
-<p id="ch11Section_5_ee"></a>Nevertheless one sees people doing:</p>
-<pre class="programlisting">$ cat file | some_command and its args ...</pre>
-<p id="ch11Section_5_ef"></a>instead of the equivalent and cheaper:</p>
-<pre class="programlisting">&lt;file some_command and its args ...</pre>
-<p id="ch11Section_5_f0"></a>or (equivalently and more classically):</p>
-<pre class="programlisting">some_command and its args ... &lt;file</pre>
-<p id="ch11Section_5_f1"></a>Since 1995, occasional awards for UUOC have been given out. The activity of fixing instances of UUOC is sometimes called 'demoggification'.</p>
-<p id="ch11Section_5_f2"></a>Amongst many, it is still considered safer to use <span class="emphasis"><em>cat</em></span> for such cases given that the &lt; and &gt; keys are next to each other in many popular keyboard mappings. While the risk might be low, the impact of using &gt; instead of &lt; can be high and prohibitive.</p>
-</div>
-<div class="section" title="9.1.3. zcat">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2506137"></a>9.1.3. zcat</h4></div></div></div>
-<p id="ch11Section_5_f3"></a><span class="emphasis"><em>zcat</em></span> is a Unix program similar to <span class="emphasis"><em>cat</em></span>, that decompresses individual files and concatenates them to standard output. Traditionally <span class="emphasis"><em>zcat</em></span> operated on files compressed by compress but today it is usually able to operate on <span class="emphasis"><em>gzip</em></span> or even <span class="emphasis"><em>bzip2</em></span> archives. On such systems, it is equivalent to <span class="emphasis"><em>gunzip -c</em></span></p>
-</div>
-</div>
-<div class="section" title="9.2. more">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2506170"></a>9.2. more</h3></div></div></div>
-<p id="ch11Section_5_f4"></a>In computing, <span class="emphasis"><em>more</em></span> is a command to view (but not modify) the contents of a text file one screen at a time (terminal pager). It is available on Unix and Unix-like systems, DOS, OS/2 and Microsoft Windows. Programs of this sort are called pagers.</p>
-<div class="section" title="9.2.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2506190"></a>9.2.1. Usage</h4></div></div></div>
-<p id="ch11Section_5_f5"></a>The command-syntax is:</p>
-<pre class="programlisting">$ more [options] [file_name]</pre>
-<p id="ch11Section_5_f6"></a>If no file name is provided, <span class="emphasis"><em>more</em></span> looks for input from stdin.</p>
-<p id="ch11Section_5_f7"></a>Once <span class="emphasis"><em>more</em></span> has obtained input, it displays as much as can fit on the current screen and waits for user input to advance, with the exception that a form feed (^L) will also cause <span class="emphasis"><em>more</em></span> to wait at that line, regardless of the amount of text on the screen. In the lower-left corner of the screen is displayed the text "--More--" and a percentage, representing the percent of the file that <span class="emphasis"><em>more</em></span> has paged through. (This percentage includes the text displayed on the current screen.) When <span class="emphasis"><em>more</em></span> reaches the end of a file (100%) it exits. The most common methods of navigating through a file are <span class="emphasis"><em>Enter</em></span>, which advances the output by one line, and <span class="emphasis"><em>Space</em></span>, which advances the output by one screen.</p>
-<p id="ch11Section_5_f8"></a>There are also other commands that can be used while navigating through the document; consult <span class="emphasis"><em>more</em></span>'s <span class="emphasis"><em>man</em></span> page for more details.</p>
-<p id="ch11Section_5_f9"></a><span class="emphasis"><em>Options</em></span> are typically entered before the file name, but can also be entered in the environment variable <span class="emphasis"><em>$MORE</em></span>. Options entered in the actual command line will override those entered in the <span class="emphasis"><em>$MORE</em></span> environment variable. Available options may vary between Unix systems.</p>
-</div>
-</div>
-<div class="section" title="9.3. less">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2506281"></a>9.3. less</h3></div></div></div>
-<p id="ch11Section_5_fa"></a><span class="emphasis"><em>less</em></span> is a terminal pager program on Unix, Windows and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is similar to <span class="emphasis"><em>more</em></span>, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, <span class="emphasis"><em>less</em></span> does not need to read the entire file before starting, resulting in faster load times with large files.</p>
-<div class="section" title="9.3.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2506310"></a>9.3.1. Usage</h4></div></div></div>
-<p id="ch11Section_5_fb"></a><span class="emphasis"><em>less</em></span> can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While <span class="emphasis"><em>less</em></span> is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both <span class="emphasis"><em>more</em></span> and <span class="emphasis"><em>vi</em></span>. It is also possible to search for character patterns in the file.</p>
-<p id="ch11Section_5_fc"></a>By default, <span class="emphasis"><em>less</em></span> displays the contents of the file to the standard output (one screen at a time). If the file name argument is omitted, it displays the contents from standard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.</p>
-<p id="ch11Section_5_fd"></a>The command-syntax is:</p>
-<pre class="programlisting">$ less [options] file_name</pre>
-</div>
-<div class="section" title="9.3.2. Frequently Used Options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2506364"></a>9.3.2. Frequently Used Options</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_fe"></a>-g: Highlights just the current match of any searched string.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_ff"></a>-I: Case-insensitive searches.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_100"></a>-M: Shows more detailed prompt, including file position.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_101"></a>-N: Shows line numbers (useful for source code viewing).</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_102"></a>-S: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_103"></a>-?: Shows help.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.3. Frequently Used Commands">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2506416"></a>9.3.3. Frequently Used Commands</h4></div></div></div>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_104"></a>[Arrows]/[Page Up]/[Page Down]/[Home]/[End]: Navigation.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_105"></a>[Space bar]: Next page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_106"></a>b: Previous page.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_107"></a>ng: Jump to line number n. Default is the start of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_108"></a>nG: Jump to line number n. Default is the end of the file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_109"></a>/pattern: Search for pattern. Regular expressions can be used.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_10a"></a>'^ or g: Go to start of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_10b"></a>'$ or G: Go to end of file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_10c"></a>s: Save current content (got from another program like grep) in a file.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_10d"></a>=: File information.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_10e"></a>h: Help.</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_10f"></a>q: Quit.</p></li>
-</ul></div>&lt;/block_quote&gt;</span>
-</div>
-<div class="section" title="9.3.4. Examples">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2506506"></a>9.3.4. Examples</h4></div></div></div>
-<pre class="programlisting">$ less -M readme.txt                     #Read "readme.txt."
-$ less +F /var/log/mail.log              #Follow mode for log
-$ file * | less                          #Easier file analysis.
-$ grep -i void *.c | less -I -p void     #Case insensitive search                                                         for "void" in all .c files</pre>
-</div>
-</div>
-</div>
-<div class="section" title="10. Directory Structure">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2506521"></a>10. Directory Structure</h2></div></div></div>
-<p id="ch11Section_5_110"></a>In the File Hierarchy Standard (FHS) all files and directories appear under the root directory "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System, are installed.</p>
-<p id="ch11Section_5_111"></a>The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.</p>
-<table summary="Directory Structure" border="1"><colgroup>
-<col width="15">
-<col width="48">
-</colgroup></table>
-<div class="section" title="10.1. man hier">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2506791"></a>10.1. man hier</h3></div></div></div>
-<p id="ch11Section_5_136"></a>This is the manual page on the UNIX filesystem. The syntax for this is:</p>
-<pre class="programlisting">$ man hier</pre>
-</div>
-<div class="section" title="10.2. ls -l">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2506807"></a>10.2. ls -l</h3></div></div></div>
-<p id="ch11Section_5_137"></a>Shows you huge amounts of information (permissions, owners, size, and when last modified) for folders and files. The syntax is</p>
-<pre class="programlisting">$ ls -l</pre>
-<p id="ch11Section_5_138"></a>This can be done after entering the required directory.</p>
-</div>
-</div>
-<div class="section" title="11. Permissions and Ownership">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2506830"></a>11. Permissions and Ownership</h2></div></div></div>
-<div class="section" title="11.1. chmod">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2506838"></a>11.1. chmod</h3></div></div></div>
-<p id="ch11Section_5_139"></a>The <span class="emphasis"><em>chmod</em></span> command (abbreviated from 'change mode') is a shell command and C language function in Unix and Unix-like environments. When executed, it can change file system modes of files and directories. The modes include permissions and special modes.A chmod command first appeared in AT&amp;T Unix version 1, and is still used today on Unix-like machines.</p>
-<div class="section" title="11.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2506864"></a>11.1.1. Usage</h4></div></div></div>
-<p id="ch11Section_5_13a"></a>The <span class="emphasis"><em>chmod</em></span> command options are specified like this:</p>
-<pre class="programlisting">$ chmod [options] mode[,mode] file1 [file2 ...]</pre>
-<p id="ch11Section_5_13b"></a>To view what the permissions currently are, type:</p>
-<pre class="programlisting">$ ls -l file</pre>
-</div>
-<div class="section" title="11.1.2. Command line options">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2506892"></a>11.1.2. Command line options</h4></div></div></div>
-<p id="ch11Section_5_13c"></a>The <span class="emphasis"><em>chmod</em></span> command has a number of command line options that affect its behavior. The most common options are:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="itemizedlist"><ul class="itemizedlist" type="*">
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_13d"></a>-R: Changes the modes of directories and files recursively</p></li>
-<li class="listitem" style="list-style-type: *"><p id="ch11Section_5_13e"></a>-v: Verbose mode; lists all files as they are being processed</p></li>
-</ul></div>&lt;/block_quote&gt;</span><div class="section" title="11.1.2.1. Symbolic modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2506929"></a>11.1.2.1. Symbolic modes</h5></div></div></div>
-<p id="ch11Section_5_13f"></a>To the <span class="emphasis"><em>chmod</em></span> utility, all permissions and special modes are represented by its mode parameter. One way to adjust the mode of files or directories is to specify a symbolic mode. The symbolic mode is composed of three components, which are combined to form a single string of text:</p>
-<pre class="programlisting">$ chmod [references][operator][modes] file1 ...</pre>
-<p id="ch11Section_5_140"></a>The references (or classes) are used to distinguish the users to whom the permissions apply. If no references are specified it defaults to “all” but modifies only the permissions allowed by the umask. The references are represented by one or more of the following letters:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="8">
-<col width="45">
-</colgroup></table>
-<p id="ch11Section_5_150"></a>The <span class="emphasis"><em>chmod</em></span> program uses an operator to specify how the modes of a file should be adjusted. The following operators are accepted:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="14">
-<col width="54">
-</colgroup></table>
-<p id="ch11Section_5_157"></a>The modes indicate which permissions are to be granted or taken away from the specified classes. There are three basic modes which correspond to the basic permissions:</p>
-<table summary="Symbolic modes" border="1"><colgroup>
-<col width="5">
-<col width="14">
-<col width="48">
-</colgroup></table>
-<p id="ch11Section_5_16d"></a>The combination of these three components produces a string that is understood by the chmod command. Multiple changes can be specified by separating multiple symbolic modes with commas.</p>
-</div>
-<div class="section" title="11.1.2.2. Symbolic examples">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2507475"></a>11.1.2.2. Symbolic examples</h5></div></div></div>
-<p id="ch11Section_5_16e"></a>Add the 'read' and 'write' permissions to the 'user' and 'group' classes of a directory:</p>
-<pre class="programlisting">$ chmod ug+rw mydir
-$ ls -ld mydir
-drw-rw----   2 starwars  yoda  96 Dec 8 12:53 mydir</pre>
-<p id="ch11Section_5_16f"></a>For a file, remove <span class="emphasis"><em>write</em></span> permissions for all classes:</p>
-<pre class="programlisting">$ chmod a-w myfile
-$ ls -l myfile
--r-xr-xr-x   2 starwars  yoda 96 Dec 8 12:53 myfile</pre>
-<p id="ch11Section_5_170"></a>Set the permissions for the <span class="emphasis"><em>u*ser and the *g*roup to read and execute only (no write permission) on *mydir</em></span>.</p>
-<pre class="programlisting">$ chmod ug=rx mydir
-$ ls -ld mydir
-dr-xr-x---   2 starwars  yoda 96 Dec 8 12:53 mydir</pre>
-</div>
-<div class="section" title="11.1.2.3. Octal numbers">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2507516"></a>11.1.2.3. Octal numbers</h5></div></div></div>
-<p id="ch11Section_5_171"></a>The <span class="emphasis"><em>chmod</em></span> command also accepts three and four-digit octal numbers representing modes. Using a three-digit octal number to set the modes of a file named myfile :</p>
-<pre class="programlisting">$ chmod 664 myfile
-$ ls -l myfile
--rw-rw-r--  1   57 Jul  3 10:13  myfile</pre>
-<p id="ch11Section_5_172"></a>Since the <span class="emphasis"><em>setuid</em></span>, <span class="emphasis"><em>setgid</em></span> and <span class="emphasis"><em>sticky</em></span> bits are not set, this is equivalent to:</p>
-<pre class="programlisting">$ chmod 0664 myfile</pre>
-</div>
-<div class="section" title="11.1.2.4. Special modes">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2507555"></a>11.1.2.4. Special modes</h5></div></div></div>
-<p id="ch11Section_5_173"></a>The <span class="emphasis"><em>chmod</em></span> command is also capable of changing the additional permissions or special modes of a file or directory. The symbolic modes use <span class="strong"><strong>s</strong></span> to represent the <span class="emphasis"><em>setuid</em></span> and <span class="emphasis"><em>setgid</em></span> modes, and <span class="strong"><strong>t</strong></span> to represent the sticky mode. The modes are only applied to the appropriate classes, regardless of whether or not other classes are specified.</p>
-<p id="ch11Section_5_174"></a>Most operating systems support the specification of special modes using octal modes, but some do not. On these systems, only the symbolic modes can be used.</p>
-</div>
-</div>
-</div>
-</div>
-<div class="section" title="12. Redirection and Piping">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2507603"></a>12. Redirection and Piping</h2></div></div></div>
-<p id="ch11Section_5_175"></a>In computing, <span class="emphasis"><em>redirection</em></span> is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations.</p>
-<p id="ch11Section_5_176"></a>Programs do redirection with the <span class="emphasis"><em>dup2(2)</em></span> system call, or its less-flexible but higher-level stdio analogues, <span class="emphasis"><em>freopen(3)</em></span> and <span class="emphasis"><em>popen(3)</em></span>.</p>
-<div class="section" title="12.1. Redirecting standard input and standard output">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2507640"></a>12.1. Redirecting standard input and standard output</h3></div></div></div>
-<p id="ch11Section_5_177"></a>Redirection is usually implemented by placing certain characters between commands. Typically, the syntax of these characters is as follows:</p>
-<pre class="programlisting">$ command1 &gt; file1</pre>
-<p id="ch11Section_5_178"></a>executes <span class="emphasis"><em>command1</em></span>, placing the output in file1. Note that this will truncate any existing data in <span class="emphasis"><em>file1</em></span>. To append output to the end of the file, use the &gt;&gt; operator.:</p>
-<pre class="programlisting">$ command1 &lt; file1</pre>
-<p id="ch11Section_5_179"></a>executes <span class="emphasis"><em>command1</em></span>, using <span class="emphasis"><em>file1</em></span> as the source of input (as opposed to the keyboard).:</p>
-<pre class="programlisting">$ command1 &lt; infile &gt; outfile</pre>
-<p id="ch11Section_5_17a"></a>combines the two capabilities: <span class="emphasis"><em>command1</em></span> reads from <span class="emphasis"><em>infile</em></span> and writes to <span class="emphasis"><em>outfile</em></span></p>
-</div>
-<div class="section" title="12.2. Piping">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2507709"></a>12.2. Piping</h3></div></div></div>
-<p id="ch11Section_5_17b"></a>Programs can be run together such that one program reads the output from another with no need for an explicit intermediate file:
-A pipeline of three programs run on a text terminal:</p>
-<pre class="programlisting">$ command1 | command2</pre>
-<p id="ch11Section_5_17c"></a>executes <span class="emphasis"><em>command1</em></span>, using its output as the input for <span class="emphasis"><em>command2</em></span> (commonly called piping, since the "|" character is known as a "pipe").</p>
-<p id="ch11Section_5_17d"></a>This is equivalent to using two redirects and a temporary file:</p>
-<pre class="programlisting">$ command1 &gt; tempfile
-$ command2 &lt; tempfile
-$ rm tempfile</pre>
-<p id="ch11Section_5_17e"></a>A good example for command piping is combining <span class="emphasis"><em>echo</em></span> with another command to achieve something interactive in a non-interactive shell, e.g.:</p>
-<pre class="programlisting">$ echo -e "user\npass" | ftp localhost</pre>
-<p id="ch11Section_5_17f"></a>This runs the ftp client with input user, press return, then pass.</p>
-</div>
-<div class="section" title="12.3. Redirecting to and from the standard file handles">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2507770"></a>12.3. Redirecting to and from the standard file handles</h3></div></div></div>
-<p id="ch11Section_5_180"></a>In Unix shells derived from the original Bourne shell, the first two actions can be further modified by placing a number (the file descriptor) immediately before the character; this will affect which stream is used for the redirection. The Unix standard I/O streams are:</p>
-<table summary="Redirecting to and from the standard file handles" border="1"><colgroup>
-<col width="12">
-<col width="13">
-<col width="24">
-</colgroup></table>
-<p id="ch11Section_5_18d"></a>For example:</p>
-<pre class="programlisting">$ command1 2&gt; file1</pre>
-<p id="ch11Section_5_18e"></a>executes <span class="emphasis"><em>command1</em></span>, directing the standard error stream to <span class="emphasis"><em>file1</em></span>.</p>
-<p id="ch11Section_5_18f"></a>In shells derived from <span class="emphasis"><em>csh</em></span> (the C shell), the syntax instead appends the &amp; character to the redirect characters, thus achieving a similar result.</p>
-<p id="ch11Section_5_190"></a>Another useful capability is to redirect one standard file handle to another. The most popular variation is to merge standard error into standard output so error messages can be processed together with (or alternately to) the usual output. Example:</p>
-<pre class="programlisting">$ find / -name .profile &gt; results 2&gt;&amp;1</pre>
-<p id="ch11Section_5_191"></a>will try to find all files named <span class="emphasis"><em>.profile</em></span>. Executed without redirection, it will output hits to <span class="emphasis"><em>stdout</em></span> and errors (e.g. for lack of privilege to traverse protected directories) to <span class="emphasis"><em>stderr</em></span>. If standard output is directed to file results, error messages appear on the console. To see both hits and error messages in file results, merge <span class="emphasis"><em>stderr</em></span> (handle 2) into <span class="emphasis"><em>stdout</em></span> (handle 1) using 2&gt;&amp;1 .</p>
-<p id="ch11Section_5_192"></a>It's possible use 2&gt;&amp;1 before "&gt;" but it doesn't work. In fact, when the interpreter reads 2&gt;&amp;1, it doesn't know yet where standard output is redirected and then standard error isn't merged.</p>
-<p id="ch11Section_5_193"></a>If the merged output is to be piped into another program, the file merge sequence 2&gt;&amp;1 must precede the pipe symbol, thus:</p>
-<pre class="programlisting">$ find / -name .profile 2&gt;&amp;1 | less</pre>
-<p id="ch11Section_5_194"></a>A simplified form of the command:</p>
-<pre class="programlisting">$ command &gt; file 2&gt;&amp;1</pre>
-<p id="ch11Section_5_195"></a>is:</p>
-<pre class="programlisting">$ command &amp;&gt;file</pre>
-<p id="ch11Section_5_196"></a>or:</p>
-<pre class="programlisting">$command &gt;&amp;file</pre>
-</div>
-<div class="section" title="12.4. Chained pipelines">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2507974"></a>12.4. Chained pipelines</h3></div></div></div>
-<p id="ch11Section_5_197"></a>The redirection and piping tokens can be chained together to create complex commands. For example:</p>
-<pre class="programlisting">$ ls | grep '\.sh' | sort &gt; shlist</pre>
-<p id="ch11Section_5_198"></a>lists the contents of the current directory, where this output is filtered to only contain lines which contain <span class="emphasis"><em>.sh</em></span>, sort this resultant output lexicographically, and place the final output in <span class="emphasis"><em>shlist</em></span>. This type of construction is used very commonly in shell scripts and batch files.</p>
-</div>
-<div class="section" title="12.5. Redirect to multiple outputs">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2508008"></a>12.5. Redirect to multiple outputs</h3></div></div></div>
-<p id="ch11Section_5_199"></a>The standard command <span class="emphasis"><em>tee</em></span> can redirect output from a command to several destinations.</p>
-<pre class="programlisting">$ ls -lrt | tee xyz</pre>
-<p id="ch11Section_5_19a"></a>This directs the file list output to both standard output as well as to the file <span class="emphasis"><em>xyz</em></span>.</p>
-</div>
-</div>
-<div class="section" title="13. More Text Processing">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2508039"></a>13. More Text Processing</h2></div></div></div>
-<div class="section" title="13.1. grep">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2508048"></a>13.1. grep</h3></div></div></div>
-<p id="ch11Section_5_19b"></a><span class="emphasis"><em>grep</em></span> is a command line text search utility originally written for Unix. The name is taken from the first letters in <span class="emphasis"><em>global / regular expression / print</em></span>, a series of instructions for the <span class="emphasis"><em>ed</em></span> text editor. The <span class="emphasis"><em>grep</em></span> command searches files or standard input globally for lines matching a given regular expression, and prints them to the program's standard output.</p>
-<div class="section" title="13.1.1. Usage">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="id2508079"></a>13.1.1. Usage</h4></div></div></div>
-<p id="ch11Section_5_19c"></a>This is an example of a common <span class="emphasis"><em>grep</em></span> usage:</p>
-<pre class="programlisting">$ grep apple fruitlist.txt</pre>
-<p id="ch11Section_5_19d"></a>In this case, <span class="emphasis"><em>grep</em></span> prints all lines containing 'apple' from the file <span class="emphasis"><em>fruitlist.txt</em></span>, regardless of word boundaries; therefore lines containing 'pineapple' or 'apples' are also printed. The <span class="emphasis"><em>grep</em></span> command is case sensitive by default, so this example's output does not include lines containing 'Apple' (with a capital A) unless they also contain 'apple'.</p>
-<p id="ch11Section_5_19e"></a>Like most Unix commands, <span class="emphasis"><em>grep</em></span> accepts command line arguments to change this and many other behaviors. For example:</p>
-<pre class="programlisting">$ grep -i apple fruitlist.txt</pre>
-<p id="ch11Section_5_19f"></a>This prints all lines containing 'apple' regardless of capitalization. The '-i' argument tells <span class="emphasis"><em>grep</em></span> to be case insensitive, or to ignore case.</p>
-<p id="ch11Section_5_1a0"></a>To print all lines containing 'apple' as a word ('pineapple' and 'apples' will not match):</p>
-<pre class="programlisting">$ grep -w apple fruitlist.txt</pre>
-<p id="ch11Section_5_1a1"></a>Regular expressions can be used to match more complicated queries.</p>
-<div class="section" title="13.1.1.1. Variations">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="id2508157"></a>13.1.1.1. Variations</h5></div></div></div>
-<p id="ch11Section_5_1a2"></a>There are countless implementations and derivatives of <span class="emphasis"><em>grep</em></span> available for many operating systems. Early variants of <span class="emphasis"><em>grep</em></span> included <span class="emphasis"><em>egrep</em></span> and <span class="emphasis"><em>fgrep</em></span>. The former applies an extended regular expression syntax that was added to Unix after Ken Thompson's original regular expression implementation. The latter searches for any of a list of 'fixed' strings using the Aho-Corasick algorithm. These variants are embodied in most modern <span class="emphasis"><em>grep</em></span> implementations as command-line switches (and standardized as -E and -F in POSIX). In such combined implementations, <span class="emphasis"><em>grep</em></span> may also behave differently depending on the name by which it is invoked, allowing <span class="emphasis"><em>fgrep</em></span>, <span class="emphasis"><em>egrep</em></span>, and <span class="emphasis"><em>grep</em></span> to be links to the same program.</p>
-<p id="ch11Section_5_1a3"></a><span class="emphasis"><em>pcregrep</em></span> is an implementation of <span class="emphasis"><em>grep</em></span> that uses Perl regular expression syntax.</p>
-<p id="ch11Section_5_1a4"></a>Other commands contain the word 'grep' to indicate that they search (usually for regular expression matches). The <span class="emphasis"><em>pgrep</em></span> utility, for instance, displays the processes whose names match a given regular expression.</p>
-</div>
-</div>
-</div>
-<div class="section" title="13.2. tr">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2508237"></a>13.2. tr</h3></div></div></div>
-<p id="ch11Section_5_1a5"></a><span class="emphasis"><em>tr</em></span> (abbreviated from <span class="emphasis"><em>translate</em></span> or <span class="emphasis"><em>transliterate</em></span>) is a command in Unix-like operating systems.</p>
-<p id="ch11Section_5_1a6"></a>When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. For example,</p>
-<pre class="programlisting">$ tr 'abcd' 'jkmn'</pre>
-<p id="ch11Section_5_1a7"></a>maps 'a' to 'j', 'b' to 'k', 'c' to 'm', and 'd' to 'n'.</p>
-<p id="ch11Section_5_1a8"></a>Sets of characters may be abbreviated by using character ranges. The previous example could be written:</p>
-<pre class="programlisting">$ tr 'a-d' 'jkmn'</pre>
-<p id="ch11Section_5_1a9"></a>In POSIX compliant versions of <span class="emphasis"><em>tr</em></span> the set represented by a character range depends on the locale's collating order, so it is safer to avoid character ranges in scripts that might be executed in a locale different from that in which they were written. Ranges can often be replaced with POSIX character sets such as [:alpha:].</p>
-<p id="ch11Section_5_1aa"></a>The <span class="emphasis"><em>-c</em></span> flag complements the first set of characters.</p>
-<pre class="programlisting">$ tr -cd '[:alnum:]'</pre>
-<p id="ch11Section_5_1ab"></a>therefore removes all non-alphanumeric characters.</p>
-<p id="ch11Section_5_1ac"></a>The <span class="emphasis"><em>-s</em></span> flag causes tr to compress sequences of identical adjacent characters in its output to a single token. For example,</p>
-<pre class="programlisting">$ tr -s '\n' '\n'</pre>
-<p id="ch11Section_5_1ad"></a>replaces sequences of one or more newline characters with a single newline.</p>
-<p id="ch11Section_5_1ae"></a>The <span class="emphasis"><em>-d</em></span> flag causes tr to delete all tokens of the specified set of characters from its input. In this case, only a single character set argument is used. The following command removes carriage return characters, thereby converting a file in DOS/Windows format to one in Unix format.</p>
-<pre class="programlisting">$ tr -d '\r'</pre>
-<p id="ch11Section_5_1af"></a>Most versions of <span class="emphasis"><em>tr</em></span>, including GNU <span class="emphasis"><em>tr</em></span> and classic Unix <span class="emphasis"><em>tr</em></span>, operate on single byte characters and are not Unicode compliant. An exception is the Heirloom Toolchest implementation, which provides basic Unicode support.</p>
-<p id="ch11Section_5_1b0"></a>Ruby and Perl also have an internal <span class="emphasis"><em>tr</em></span> operator, which operates analogously. Tcl's <span class="emphasis"><em>string map</em></span> command is more general in that it maps strings to strings while <span class="emphasis"><em>tr</em></span> maps characters to characters.</p>
-</div>
-</div>
-<div class="section" title="14. Elementary Regex">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2508386"></a>14. Elementary Regex</h2></div></div></div>
-<p id="ch11Section_5_1b1"></a>In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. A regular expression (often shortened to regex or regexp) is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.</p>
-<p id="ch11Section_5_1b2"></a>Regular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. For example, Perl, Ruby and Tcl have a powerful regular expression engine built directly into their syntax. Several utilities provided by Unix distributions—including the editor <span class="emphasis"><em>ed</em></span> and the filter <span class="emphasis"><em>grep</em></span> — were the first to popularize the concept of regular expressions.</p>
-<p id="ch11Section_5_1b3"></a>Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX <span class="emphasis"><em>Basic Regular Expressions</em></span> (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features. Many such tools also provide support for ERE syntax with command line arguments.</p>
-<p id="ch11Section_5_1b4"></a>In the BRE syntax, most characters are treated as literals — they match only themselves (i.e., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.</p>
-<table summary="Elementary Regex" border="1"><colgroup>
-<col width="13">
-<col width="60">
-</colgroup></table>
-<div class="section" title="14.1. Lazy quantification">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="id2508599"></a>14.1. Lazy quantification</h3></div></div></div>
-<p id="ch11Section_5_1c9"></a>The standard quantifiers in regular expressions are greedy, meaning they match as much as they can, only giving back as necessary to match the remainder of the regex. For example, someone new to regexes wishing to find the first instance of an item between &lt; and &gt; symbols in this example:</p>
-<pre class="programlisting">Another whale explosion occurred on &lt;January 26&gt;, &lt;2004&gt;.</pre>
-<p id="ch11Section_5_1ca"></a>...would likely come up with the pattern &lt;.*&gt;, or similar. However, this pattern will actually return "&lt;January 26&gt;, &lt;2004&gt;" instead of the "&lt;January 26&gt;" which might be expected, because the <span style="color: red">&lt;title_reference&gt;*&lt;/title_reference&gt;</span> quantifier is greedy — it will consume as many characters as possible from the input, and "January 26&gt;, &lt;2004" has more characters than "January 26".</p>
-<p id="ch11Section_5_1cb"></a>Though this problem can be avoided in a number of ways (e.g., by specifying the text that is not to be matched: &lt;[^&gt;]*&gt;), modern regular expression tools allow a quantifier to be specified as <span class="emphasis"><em>lazy</em></span> (also known as non-greedy, reluctant, minimal, or ungreedy) by putting a question mark after the quantifier (e.g., &lt;.*?&gt;), or by using a modifier which reverses the greediness of quantifiers (though changing the meaning of the standard quantifiers can be confusing). By using a lazy quantifier, the expression tries the minimal match first. Though in the previous example lazy matching is used to select one of many matching results, in some cases it can also be used to improve performance when greedy matching would require more backtracking.</p>
-</div>
-</div>
-<div class="section" title="15. One Liners">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id2508675"></a>15. One Liners</h2></div></div></div>
-<p id="ch11Section_5_1cc"></a>A <span class="emphasis"><em>one-liner</em></span> is textual input to the command-line of an operating system shell that performs some function in just one line of input.</p>
-<p id="ch11Section_5_1cd"></a>The one liner can be</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem"><p id="ch11Section_5_1ce"></a>An expression written in the language of the shell.</p></li>
-<li class="listitem"><p id="ch11Section_5_1cf"></a>The invocation of an interpreter together with program source for the interpreter to run.</p></li>
-<li class="listitem"><p id="ch11Section_5_1d0"></a>The invocation of a compiler together with source to compile and
-instructions for executing the compiled program.</p></li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch11Section_5_1d1"></a>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.</p>
-<p id="ch11Section_5_1d2"></a>The use of the phrase one-liner has been widened to also include program-source for any language that does something useful in one line.</p>
-<p id="ch11Section_5_1d3"></a>The word <span class="emphasis"><em>One-liner</em></span> has two references in the index of the book <span class="emphasis"><em>The AWK Programming Language</em></span> (the book is often referred to by the abbreviation TAPL). It explains the programming language AWK, which is part of the Unix operating system. The authors explain the birth of the One-liner paradigm with their daily work on early Unix machines:</p>
-<pre class="programlisting">“The 1977 version had only a few built-in variables and predefined functions. It was designed for writing short programs [...] Our model was that an invocation would be one or two lines long, typed in and used immediately. Defaults were chosen to match this style [...] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.”</pre>
-<p id="ch11Section_5_1d4"></a>Notice that this original definition of a One-liner implies immediate execution of the program without any compilation. So, in a strict sense, only source code for interpreted languages qualifies as a One-liner. But this strict understanding of a One-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.</p>
-<p id="ch11Section_5_1d5"></a>The TAPL book contains 20 examples of One-liners (A Handful of Useful awk One-Liners) at the end of the book's first chapter.</p>
-<p id="ch11Section_5_1d6"></a>Here are the first few of them:</p>
-<span style="color: red">&lt;block_quote&gt;<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem">
-<p id="ch11Section_5_1d7"></a>Print the total number of input lines:</p>
-<p id="ch11Section_5_1d8"></a>END { print NR }</p>
-</li>
-<li class="listitem">
-<p id="ch11Section_5_1d9"></a>Print the tenth input line:</p>
-<p id="ch11Section_5_1da"></a>NR == 10</p>
-</li>
-<li class="listitem">
-<p id="ch11Section_5_1db"></a>Print the last field of every input line:</p>
-<p id="ch11Section_5_1dc"></a>{ print $NF }</p>
-</li>
-</ol></div>&lt;/block_quote&gt;</span><p id="ch11Section_5_1dd"></a>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.</p>
-<p id="ch11Section_5_1de"></a>The following example is a C program (a winning entry in the "Best one-liner" category of the IOCCC, here split to two lines for presentation).:</p>
-<pre class="programlisting">main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return
-*t-42?*s?63==*t|*s==*t&amp;&amp;m(s+1,t+1):!*t:m(s,t+1)||*s&amp;&amp;m(s+1,t);}</pre>
-<p id="ch11Section_5_1df"></a>This one-liner program is a <span class="emphasis"><em>glob pattern matcher</em></span>. It understands the glob characters '*' meaning 'zero or more characters' and '?' meaning exactly one character, just like most Unix shells.</p>
-<p id="ch11Section_5_1e0"></a>Run it with two args, the string and the glob pattern. The exit status is 0 (shell true) when the pattern matches, 1 otherwise. The glob pattern must match the whole string, so you may want to use * at the beginning and end of the pattern if you are looking for something in the middle. Examples:</p>
-<pre class="programlisting">$ prog foo 'f??'; echo $?
-
-$ prog 'best short program' '??st*o**p?*'; echo $?</pre>
-<p id="ch11Section_5_1e1"></a>Here is a one line shell script to show directories:</p>
-<pre class="programlisting">$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'</pre>
-</div>
-</div>
-</div></body>
-</html>
Binary file web/html/support/figs/bad-merge-1.png has changed
Binary file web/html/support/figs/bad-merge-2.png has changed
Binary file web/html/support/figs/bad-merge-3.png has changed
Binary file web/html/support/figs/bad-merge-4.png has changed
Binary file web/html/support/figs/bad-merge-5.png has changed
Binary file web/html/support/figs/caution.png has changed
Binary file web/html/support/figs/feature-branches.png has changed
Binary file web/html/support/figs/filelog.png has changed
Binary file web/html/support/figs/kdiff3.png has changed
Binary file web/html/support/figs/metadata.png has changed
Binary file web/html/support/figs/mq-stack.png has changed
Binary file web/html/support/figs/note.png has changed
Binary file web/html/support/figs/revlog.png has changed
Binary file web/html/support/figs/rss.png has changed
Binary file web/html/support/figs/snapshot.png has changed
Binary file web/html/support/figs/tip.png has changed
Binary file web/html/support/figs/tour-history.png has changed
Binary file web/html/support/figs/tour-merge-conflict.png has changed
Binary file web/html/support/figs/tour-merge-merge.png has changed
Binary file web/html/support/figs/tour-merge-pull.png has changed
Binary file web/html/support/figs/tour-merge-sep-repos.png has changed
Binary file web/html/support/figs/undo-manual-merge.png has changed
Binary file web/html/support/figs/undo-manual.png has changed
Binary file web/html/support/figs/undo-non-tip.png has changed
Binary file web/html/support/figs/undo-simple.png has changed
Binary file web/html/support/figs/wdir-after-commit.png has changed
Binary file web/html/support/figs/wdir-branch.png has changed
Binary file web/html/support/figs/wdir-merge.png has changed
Binary file web/html/support/figs/wdir-pre-branch.png has changed
Binary file web/html/support/figs/wdir.png has changed
--- a/web/html/support/form-min.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-(function($){$.fn.ajaxSubmit=function(_2){if(typeof _2=="function"){_2={success:_2};}_2=$.extend({url:this.attr("action")||window.location,type:this.attr("method")||"GET"},_2||{});var _3={};$.event.trigger("form.pre.serialize",[this,_2,_3]);if(_3.veto){return this;}var a=this.formToArray(_2.semantic);if(_2.data){for(var n in _2.data){a.push({name:n,value:_2.data[n]});}}if(_2.beforeSubmit&&_2.beforeSubmit(a,this,_2)===false){return this;}$.event.trigger("form.submit.validate",[a,this,_2,_3]);if(_3.veto){return this;}var q=$.param(a);if(_2.type.toUpperCase()=="GET"){_2.url+=(_2.url.indexOf("?")>=0?"&":"?")+q;_2.data=null;}else{_2.data=q;}var _7=this,callbacks=[];if(_2.resetForm){callbacks.push(function(){_7.resetForm();});}if(_2.clearForm){callbacks.push(function(){_7.clearForm();});}if(!_2.dataType&&_2.target){var _8=_2.success||function(){};callbacks.push(function(_9){if(this.evalScripts){$(_2.target).attr("innerHTML",_9).evalScripts().each(_8,arguments);}else{$(_2.target).html(_9).each(_8,arguments);}});}else{if(_2.success){callbacks.push(_2.success);}}_2.success=function(_a,_b){for(var i=0,max=callbacks.length;i<max;i++){callbacks[i](_a,_b,_7);}};var _d=$("input:file",this).fieldValue();var _e=false;for(var j=0;j<_d.length;j++){if(_d[j]){_e=true;}}if(_2.iframe||_e){fileUpload();}else{$.ajax(_2);}$.event.trigger("form.submit.notify",[this,_2]);return this;function fileUpload(){var _10=_7[0];var _11=$.extend({},$.ajaxSettings,_2);var id="jqFormIO"+$.fn.ajaxSubmit.counter++;var $io=$("<iframe id=\""+id+"\" name=\""+id+"\" />");var io=$io[0];var op8=$.browser.opera&&window.opera.version()<9;if($.browser.msie||op8){io.src="javascript:false;document.write(\"\");";}$io.css({position:"absolute",top:"-1000px",left:"-1000px"});var xhr={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=_11.global;if(g&&!$.active++){$.event.trigger("ajaxStart");}if(g){$.event.trigger("ajaxSend",[xhr,_11]);}var _18=0;var _19=0;setTimeout(function(){$io.appendTo("body");io.attachEvent?io.attachEvent("onload",cb):io.addEventListener("load",cb,false);var _1a=_10.encoding?"encoding":"enctype";var t=_7.attr("target");_7.attr({target:id,method:"POST",action:_11.url});_10[_1a]="multipart/form-data";if(_11.timeout){setTimeout(function(){_19=true;cb();},_11.timeout);}_10.submit();_7.attr("target",t);},10);function cb(){if(_18++){return;}io.detachEvent?io.detachEvent("onload",cb):io.removeEventListener("load",cb,false);var ok=true;try{if(_19){throw "timeout";}var _1d,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(_11.dataType=="json"||_11.dataType=="script"){var ta=doc.getElementsByTagName("textarea")[0];_1d=ta?ta.value:xhr.responseText;if(_11.dataType=="json"){eval("data = "+_1d);}else{$.globalEval(_1d);}}else{if(_11.dataType=="xml"){_1d=xhr.responseXML;if(!_1d&&xhr.responseText!=null){_1d=toXml(xhr.responseText);}}else{_1d=xhr.responseText;}}}catch(e){ok=false;$.handleError(_11,xhr,"error",e);}if(ok){_11.success(_1d,"success");if(g){$.event.trigger("ajaxSuccess",[xhr,_11]);}}if(g){$.event.trigger("ajaxComplete",[xhr,_11]);}if(g&&!--$.active){$.event.trigger("ajaxStop");}if(_11.complete){_11.complete(xhr,ok?"success":"error");}setTimeout(function(){$io.remove();xhr.responseXML=null;},100);}function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s);}else{doc=(new DOMParser()).parseFromString(s,"text/xml");}return (doc&&doc.documentElement&&doc.documentElement.tagName!="parsererror")?doc:null;}}};$.fn.ajaxSubmit.counter=0;$.fn.ajaxForm=function(_21){return this.ajaxFormUnbind().submit(submitHandler).each(function(){this.formPluginId=$.fn.ajaxForm.counter++;$.fn.ajaxForm.optionHash[this.formPluginId]=_21;$(":submit,input:image",this).click(clickHandler);});};$.fn.ajaxForm.counter=1;$.fn.ajaxForm.optionHash={};function clickHandler(e){var _23=this.form;_23.clk=this;if(this.type=="image"){if(e.offsetX!=undefined){_23.clk_x=e.offsetX;_23.clk_y=e.offsetY;}else{if(typeof $.fn.offset=="function"){var _24=$(this).offset();_23.clk_x=e.pageX-_24.left;_23.clk_y=e.pageY-_24.top;}else{_23.clk_x=e.pageX-this.offsetLeft;_23.clk_y=e.pageY-this.offsetTop;}}}setTimeout(function(){_23.clk=_23.clk_x=_23.clk_y=null;},10);}function submitHandler(){var id=this.formPluginId;var _26=$.fn.ajaxForm.optionHash[id];$(this).ajaxSubmit(_26);return false;}$.fn.ajaxFormUnbind=function(){this.unbind("submit",submitHandler);return this.each(function(){$(":submit,input:image",this).unbind("click",clickHandler);});};$.fn.formToArray=function(_27){var a=[];if(this.length==0){return a;}var _29=this[0];var els=_27?_29.getElementsByTagName("*"):_29.elements;if(!els){return a;}for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n){continue;}if(_27&&_29.clk&&el.type=="image"){if(!el.disabled&&_29.clk==el){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}continue;}var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:n,value:v});}}}if(!_27&&_29.clk){var _30=_29.getElementsByTagName("input");for(var i=0,max=_30.length;i<max;i++){var _32=_30[i];var n=_32.name;if(n&&!_32.disabled&&_32.type=="image"&&_29.clk==_32){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}}}return a;};$.fn.formSerialize=function(_34){return $.param(this.formToArray(_34));};$.fn.fieldSerialize=function(_35){var a=[];this.each(function(){var n=this.name;if(!n){return;}var v=$.fieldValue(this,_35);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:this.name,value:v});}}});return $.param(a);};$.fn.fieldValue=function(_3a){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,_3a);if(v===null||typeof v=="undefined"||(v.constructor==Array&&!v.length)){continue;}v.constructor==Array?$.merge(val,v):val.push(v);}return val;};$.fieldValue=function(el,_3f){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof _3f=="undefined"){_3f=true;}if(_3f&&(!n||el.disabled||t=="reset"||t=="button"||(t=="checkbox"||t=="radio")&&!el.checked||(t=="submit"||t=="image")&&el.form&&el.form.clk!=el||tag=="select"&&el.selectedIndex==-1)){return null;}if(tag=="select"){var _41=el.selectedIndex;if(_41<0){return null;}var a=[],ops=el.options;var one=(t=="select-one");var max=(one?_41+1:ops.length);for(var i=(one?_41:0);i<max;i++){var op=ops[i];if(op.selected){var v=$.browser.msie&&!(op.attributes["value"].specified)?op.text:op.value;if(one){return v;}a.push(v);}}return a;}return el.value;};$.fn.clearForm=function(){return this.each(function(){$("input,select,textarea",this).clearFields();});};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=="text"||t=="password"||tag=="textarea"){this.value="";}else{if(t=="checkbox"||t=="radio"){this.checked=false;}else{if(tag=="select"){this.selectedIndex=-1;}}}});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset();}});};})(jQuery);
\ No newline at end of file
--- a/web/html/support/form.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,819 +0,0 @@
-/*
- * jQuery Form Plugin
- * @requires jQuery v1.1 or later
- *
- * Examples at: http://malsup.com/jquery/form/
- * Dual licensed under the MIT and GPL licenses:
- *   http://www.opensource.org/licenses/mit-license.php
- *   http://www.gnu.org/licenses/gpl.html
- *
- * Revision: $Id$
- */
- (function($) {
-/**
- * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.
- *
- * ajaxSubmit accepts a single argument which can be either a success callback function
- * or an options Object.  If a function is provided it will be invoked upon successful
- * completion of the submit and will be passed the response from the server.
- * If an options Object is provided, the following attributes are supported:
- *
- *  target:   Identifies the element(s) in the page to be updated with the server response.
- *            This value may be specified as a jQuery selection string, a jQuery object,
- *            or a DOM element.
- *            default value: null
- *
- *  url:      URL to which the form data will be submitted.
- *            default value: value of form's 'action' attribute
- *
- *  type:     The method in which the form data should be submitted, 'GET' or 'POST'.
- *            default value: value of form's 'method' attribute (or 'GET' if none found)
- *
- *  data:     Additional data to add to the request, specified as key/value pairs (see $.ajax).
- *
- *  beforeSubmit:  Callback method to be invoked before the form is submitted.
- *            default value: null
- *
- *  success:  Callback method to be invoked after the form has been successfully submitted
- *            and the response has been returned from the server
- *            default value: null
- *
- *  dataType: Expected dataType of the response.  One of: null, 'xml', 'script', or 'json'
- *            default value: null
- *
- *  semantic: Boolean flag indicating whether data must be submitted in semantic order (slower).
- *            default value: false
- *
- *  resetForm: Boolean flag indicating whether the form should be reset if the submit is successful
- *
- *  clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful
- *
- *
- * The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for
- * validating the form data.  If the 'beforeSubmit' callback returns false then the form will
- * not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data
- * in array format, the jQuery object, and the options object passed into ajaxSubmit.
- * The form data array takes the following form:
- *
- *     [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * If a 'success' callback method is provided it is invoked after the response has been returned
- * from the server.  It is passed the responseText or responseXML value (depending on dataType).
- * See jQuery.ajax for further details.
- *
- *
- * The dataType option provides a means for specifying how the server response should be handled.
- * This maps directly to the jQuery.httpData method.  The following values are supported:
- *
- *      'xml':    if dataType == 'xml' the server response is treated as XML and the 'success'
- *                   callback method, if specified, will be passed the responseXML value
- *      'json':   if dataType == 'json' the server response will be evaluted and passed to
- *                   the 'success' callback, if specified
- *      'script': if dataType == 'script' the server response is evaluated in the global context
- *
- *
- * Note that it does not make sense to use both the 'target' and 'dataType' options.  If both
- * are provided the target will be ignored.
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * This is normally true anyway, unless the form contains input elements of type='image'.
- * If your form must be submitted with name/value pairs in semantic order and your form
- * contains an input of type='image" then pass true for this arg, otherwise pass false
- * (or nothing) to avoid the overhead for this logic.
- *
- *
- * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this:
- *
- * $("#form-id").submit(function() {
- *     $(this).ajaxSubmit(options);
- *     return false; // cancel conventional submit
- * });
- *
- * When using ajaxForm(), however, this is done for you.
- *
- * @example
- * $('#myForm').ajaxSubmit(function(data) {
- *     alert('Form submit succeeded! Server returned: ' + data);
- * });
- * @desc Submit form and alert server response
- *
- *
- * @example
- * var options = {
- *     target: '#myTargetDiv'
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Submit form and update page element with server response
- *
- *
- * @example
- * var options = {
- *     success: function(responseText) {
- *         alert(responseText);
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Submit form and alert the server response
- *
- *
- * @example
- * var options = {
- *     beforeSubmit: function(formArray, jqForm) {
- *         if (formArray.length == 0) {
- *             alert('Please enter data.');
- *             return false;
- *         }
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Pre-submit validation which aborts the submit operation if form data is empty
- *
- *
- * @example
- * var options = {
- *     url: myJsonUrl.php,
- *     dataType: 'json',
- *     success: function(data) {
- *        // 'data' is an object representing the the evaluated json data
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc json data returned and evaluated
- *
- *
- * @example
- * var options = {
- *     url: myXmlUrl.php,
- *     dataType: 'xml',
- *     success: function(responseXML) {
- *        // responseXML is XML document object
- *        var data = $('myElement', responseXML).text();
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc XML data returned from server
- *
- *
- * @example
- * var options = {
- *     resetForm: true
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc submit form and reset it if successful
- *
- * @example
- * $('#myForm).submit(function() {
- *    $(this).ajaxSubmit();
- *    return false;
- * });
- * @desc Bind form's submit event to use ajaxSubmit
- *
- *
- * @name ajaxSubmit
- * @type jQuery
- * @param options  object literal containing options which control the form submission process
- * @cat Plugins/Form
- * @return jQuery
- */
-$.fn.ajaxSubmit = function(options) {
-    if (typeof options == 'function')
-        options = { success: options };
-
-    options = $.extend({
-        url:  this.attr('action') || window.location,
-        type: this.attr('method') || 'GET'
-    }, options || {});
-
-    // hook for manipulating the form data before it is extracted;
-    // convenient for use with rich editors like tinyMCE or FCKEditor
-    var veto = {};
-    $.event.trigger('form.pre.serialize', [this, options, veto]);
-    if (veto.veto) return this;
-
-    var a = this.formToArray(options.semantic);
-	if (options.data) {
-	    for (var n in options.data)
-	        a.push( { name: n, value: options.data[n] } );
-	}
-
-    // give pre-submit callback an opportunity to abort the submit
-    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this;
-
-    // fire vetoable 'validate' event
-    $.event.trigger('form.submit.validate', [a, this, options, veto]);
-    if (veto.veto) return this;
-
-    var q = $.param(a);//.replace(/%20/g,'+');
-
-    if (options.type.toUpperCase() == 'GET') {
-        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
-        options.data = null;  // data is null for 'get'
-    }
-    else
-        options.data = q; // data is the query string for 'post'
-
-    var $form = this, callbacks = [];
-    if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
-    if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
-
-    // perform a load on the target only if dataType is not provided
-    if (!options.dataType && options.target) {
-        var oldSuccess = options.success || function(){};
-        callbacks.push(function(data) {
-            if (this.evalScripts)
-                $(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments);
-            else // jQuery v1.1.4
-                $(options.target).html(data).each(oldSuccess, arguments);
-        });
-    }
-    else if (options.success)
-        callbacks.push(options.success);
-
-    options.success = function(data, status) {
-        for (var i=0, max=callbacks.length; i < max; i++)
-            callbacks[i](data, status, $form);
-    };
-
-    // are there files to upload?
-    var files = $('input:file', this).fieldValue();
-    var found = false;
-    for (var j=0; j < files.length; j++)
-        if (files[j])
-            found = true;
-
-    if (options.iframe || found) // options.iframe allows user to force iframe mode
-        fileUpload();
-    else
-        $.ajax(options);
-
-    // fire 'notify' event
-    $.event.trigger('form.submit.notify', [this, options]);
-    return this;
-
-
-    // private function for handling file uploads (hat tip to YAHOO!)
-    function fileUpload() {
-        var form = $form[0];
-        var opts = $.extend({}, $.ajaxSettings, options);
-
-        var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++;
-        var $io = $('<iframe id="' + id + '" name="' + id + '" />');
-        var io = $io[0];
-        var op8 = $.browser.opera && window.opera.version() < 9;
-        if ($.browser.msie || op8) io.src = 'javascript:false;document.write("");';
-        $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
-
-        var xhr = { // mock object
-            responseText: null,
-            responseXML: null,
-            status: 0,
-            statusText: 'n/a',
-            getAllResponseHeaders: function() {},
-            getResponseHeader: function() {},
-            setRequestHeader: function() {}
-        };
-
-        var g = opts.global;
-        // trigger ajax global events so that activity/block indicators work like normal
-        if (g && ! $.active++) $.event.trigger("ajaxStart");
-        if (g) $.event.trigger("ajaxSend", [xhr, opts]);
-
-        var cbInvoked = 0;
-        var timedOut = 0;
-
-        // take a breath so that pending repaints get some cpu time before the upload starts
-        setTimeout(function() {
-            $io.appendTo('body');
-            // jQuery's event binding doesn't work for iframe events in IE
-            io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
-
-            // make sure form attrs are set
-            var encAttr = form.encoding ? 'encoding' : 'enctype';
-            var t = $form.attr('target');
-            $form.attr({
-                target:   id,
-                method:  'POST',
-                action:   opts.url
-            });
-            form[encAttr] = 'multipart/form-data';
-
-            // support timout
-            if (opts.timeout)
-                setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
-
-            form.submit();
-            $form.attr('target', t); // reset target
-        }, 10);
-
-        function cb() {
-            if (cbInvoked++) return;
-
-            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
-
-            var ok = true;
-            try {
-                if (timedOut) throw 'timeout';
-                // extract the server response from the iframe
-                var data, doc;
-                doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
-                xhr.responseText = doc.body ? doc.body.innerHTML : null;
-                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
-
-                if (opts.dataType == 'json' || opts.dataType == 'script') {
-                    var ta = doc.getElementsByTagName('textarea')[0];
-                    data = ta ? ta.value : xhr.responseText;
-                    if (opts.dataType == 'json')
-                        eval("data = " + data);
-                    else
-                        $.globalEval(data);
-                }
-                else if (opts.dataType == 'xml') {
-                    data = xhr.responseXML;
-                    if (!data && xhr.responseText != null)
-                        data = toXml(xhr.responseText);
-                }
-                else {
-                    data = xhr.responseText;
-                }
-            }
-            catch(e){
-                ok = false;
-                $.handleError(opts, xhr, 'error', e);
-            }
-
-            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
-            if (ok) {
-                opts.success(data, 'success');
-                if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
-            }
-            if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
-            if (g && ! --$.active) $.event.trigger("ajaxStop");
-            if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
-
-            // clean up
-            setTimeout(function() {
-                $io.remove();
-                xhr.responseXML = null;
-            }, 100);
-        };
-
-        function toXml(s, doc) {
-            if (window.ActiveXObject) {
-                doc = new ActiveXObject('Microsoft.XMLDOM');
-                doc.async = 'false';
-                doc.loadXML(s);
-            }
-            else
-                doc = (new DOMParser()).parseFromString(s, 'text/xml');
-            return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
-        };
-    };
-};
-$.fn.ajaxSubmit.counter = 0; // used to create unique iframe ids
-
-/**
- * ajaxForm() provides a mechanism for fully automating form submission.
- *
- * The advantages of using this method instead of ajaxSubmit() are:
- *
- * 1: This method will include coordinates for <input type="image" /> elements (if the element
- *    is used to submit the form).
- * 2. This method will include the submit element's name/value data (for the element that was
- *    used to submit the form).
- * 3. This method binds the submit() method to the form for you.
- *
- * Note that for accurate x/y coordinates of image submit elements in all browsers
- * you need to also use the "dimensions" plugin (this method will auto-detect its presence).
- *
- * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
- * passes the options argument along after properly binding events for submit elements and
- * the form itself.  See ajaxSubmit for a full description of the options argument.
- *
- *
- * @example
- * var options = {
- *     target: '#myTargetDiv'
- * };
- * $('#myForm').ajaxSForm(options);
- * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response
- *       when the form is submitted.
- *
- *
- * @example
- * var options = {
- *     success: function(responseText) {
- *         alert(responseText);
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Bind form's submit event so that server response is alerted after the form is submitted.
- *
- *
- * @example
- * var options = {
- *     beforeSubmit: function(formArray, jqForm) {
- *         if (formArray.length == 0) {
- *             alert('Please enter data.');
- *             return false;
- *         }
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Bind form's submit event so that pre-submit callback is invoked before the form
- *       is submitted.
- *
- *
- * @name   ajaxForm
- * @param  options  object literal containing options which control the form submission process
- * @return jQuery
- * @cat    Plugins/Form
- * @type   jQuery
- */
-$.fn.ajaxForm = function(options) {
-    return this.ajaxFormUnbind().submit(submitHandler).each(function() {
-        // store options in hash
-        this.formPluginId = $.fn.ajaxForm.counter++;
-        $.fn.ajaxForm.optionHash[this.formPluginId] = options;
-        $(":submit,input:image", this).click(clickHandler);
-    });
-};
-
-$.fn.ajaxForm.counter = 1;
-$.fn.ajaxForm.optionHash = {};
-
-function clickHandler(e) {
-    var $form = this.form;
-    $form.clk = this;
-    if (this.type == 'image') {
-        if (e.offsetX != undefined) {
-            $form.clk_x = e.offsetX;
-            $form.clk_y = e.offsetY;
-        } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
-            var offset = $(this).offset();
-            $form.clk_x = e.pageX - offset.left;
-            $form.clk_y = e.pageY - offset.top;
-        } else {
-            $form.clk_x = e.pageX - this.offsetLeft;
-            $form.clk_y = e.pageY - this.offsetTop;
-        }
-    }
-    // clear form vars
-    setTimeout(function() { $form.clk = $form.clk_x = $form.clk_y = null; }, 10);
-};
-
-function submitHandler() {
-    // retrieve options from hash
-    var id = this.formPluginId;
-    var options = $.fn.ajaxForm.optionHash[id];
-    $(this).ajaxSubmit(options);
-    return false;
-};
-
-/**
- * ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
- *
- * @name   ajaxFormUnbind
- * @return jQuery
- * @cat    Plugins/Form
- * @type   jQuery
- */
-$.fn.ajaxFormUnbind = function() {
-    this.unbind('submit', submitHandler);
-    return this.each(function() {
-        $(":submit,input:image", this).unbind('click', clickHandler);
-    });
-
-};
-
-/**
- * formToArray() gathers form element data into an array of objects that can
- * be passed to any of the following ajax functions: $.get, $.post, or load.
- * Each object in the array has both a 'name' and 'value' property.  An example of
- * an array for a simple login form might be:
- *
- * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * It is this array that is passed to pre-submit callback functions provided to the
- * ajaxSubmit() and ajaxForm() methods.
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * This is normally true anyway, unless the form contains input elements of type='image'.
- * If your form must be submitted with name/value pairs in semantic order and your form
- * contains an input of type='image" then pass true for this arg, otherwise pass false
- * (or nothing) to avoid the overhead for this logic.
- *
- * @example var data = $("#myForm").formToArray();
- * $.post( "myscript.cgi", data );
- * @desc Collect all the data from a form and submit it to the server.
- *
- * @name formToArray
- * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
- * @type Array<Object>
- * @cat Plugins/Form
- */
-$.fn.formToArray = function(semantic) {
-    var a = [];
-    if (this.length == 0) return a;
-
-    var form = this[0];
-    var els = semantic ? form.getElementsByTagName('*') : form.elements;
-    if (!els) return a;
-    for(var i=0, max=els.length; i < max; i++) {
-        var el = els[i];
-        var n = el.name;
-        if (!n) continue;
-
-        if (semantic && form.clk && el.type == "image") {
-            // handle image inputs on the fly when semantic == true
-            if(!el.disabled && form.clk == el)
-                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-            continue;
-        }
-
-        var v = $.fieldValue(el, true);
-        if (v && v.constructor == Array) {
-            for(var j=0, jmax=v.length; j < jmax; j++)
-                a.push({name: n, value: v[j]});
-        }
-        else if (v !== null && typeof v != 'undefined')
-            a.push({name: n, value: v});
-    }
-
-    if (!semantic && form.clk) {
-        // input type=='image' are not found in elements array! handle them here
-        var inputs = form.getElementsByTagName("input");
-        for(var i=0, max=inputs.length; i < max; i++) {
-            var input = inputs[i];
-            var n = input.name;
-            if(n && !input.disabled && input.type == "image" && form.clk == input)
-                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-        }
-    }
-    return a;
-};
-
-
-/**
- * Serializes form data into a 'submittable' string. This method will return a string
- * in the format: name1=value1&amp;name2=value2
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * If your form must be submitted with name/value pairs in semantic order then pass
- * true for this arg, otherwise pass false (or nothing) to avoid the overhead for
- * this logic (which can be significant for very large forms).
- *
- * @example var data = $("#myForm").formSerialize();
- * $.ajax('POST', "myscript.cgi", data);
- * @desc Collect all the data from a form into a single string
- *
- * @name formSerialize
- * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
- * @type String
- * @cat Plugins/Form
- */
-$.fn.formSerialize = function(semantic) {
-    //hand off to jQuery.param for proper encoding
-    return $.param(this.formToArray(semantic));
-};
-
-
-/**
- * Serializes all field elements in the jQuery object into a query string.
- * This method will return a string in the format: name1=value1&amp;name2=value2
- *
- * The successful argument controls whether or not serialization is limited to
- * 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.
- *
- * @example var data = $("input").formSerialize();
- * @desc Collect the data from all successful input elements into a query string
- *
- * @example var data = $(":radio").formSerialize();
- * @desc Collect the data from all successful radio input elements into a query string
- *
- * @example var data = $("#myForm :checkbox").formSerialize();
- * @desc Collect the data from all successful checkbox input elements in myForm into a query string
- *
- * @example var data = $("#myForm :checkbox").formSerialize(false);
- * @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string
- *
- * @example var data = $(":input").formSerialize();
- * @desc Collect the data from all successful input, select, textarea and button elements into a query string
- *
- * @name fieldSerialize
- * @param successful true if only successful controls should be serialized (default is true)
- * @type String
- * @cat Plugins/Form
- */
-$.fn.fieldSerialize = function(successful) {
-    var a = [];
-    this.each(function() {
-        var n = this.name;
-        if (!n) return;
-        var v = $.fieldValue(this, successful);
-        if (v && v.constructor == Array) {
-            for (var i=0,max=v.length; i < max; i++)
-                a.push({name: n, value: v[i]});
-        }
-        else if (v !== null && typeof v != 'undefined')
-            a.push({name: this.name, value: v});
-    });
-    //hand off to jQuery.param for proper encoding
-    return $.param(a);
-};
-
-
-/**
- * Returns the value(s) of the element in the matched set.  For example, consider the following form:
- *
- *  <form><fieldset>
- *      <input name="A" type="text" />
- *      <input name="A" type="text" />
- *      <input name="B" type="checkbox" value="B1" />
- *      <input name="B" type="checkbox" value="B2"/>
- *      <input name="C" type="radio" value="C1" />
- *      <input name="C" type="radio" value="C2" />
- *  </fieldset></form>
- *
- *  var v = $(':text').fieldValue();
- *  // if no values are entered into the text inputs
- *  v == ['','']
- *  // if values entered into the text inputs are 'foo' and 'bar'
- *  v == ['foo','bar']
- *
- *  var v = $(':checkbox').fieldValue();
- *  // if neither checkbox is checked
- *  v === undefined
- *  // if both checkboxes are checked
- *  v == ['B1', 'B2']
- *
- *  var v = $(':radio').fieldValue();
- *  // if neither radio is checked
- *  v === undefined
- *  // if first radio is checked
- *  v == ['C1']
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.  If this value is false the value(s)
- * for each element is returned.
- *
- * Note: This method *always* returns an array.  If no valid value can be determined the
- *       array will be empty, otherwise it will contain one or more values.
- *
- * @example var data = $("#myPasswordElement").fieldValue();
- * alert(data[0]);
- * @desc Alerts the current value of the myPasswordElement element
- *
- * @example var data = $("#myForm :input").fieldValue();
- * @desc Get the value(s) of the form elements in myForm
- *
- * @example var data = $("#myForm :checkbox").fieldValue();
- * @desc Get the value(s) for the successful checkbox element(s) in the jQuery object.
- *
- * @example var data = $("#mySingleSelect").fieldValue();
- * @desc Get the value(s) of the select control
- *
- * @example var data = $(':text').fieldValue();
- * @desc Get the value(s) of the text input or textarea elements
- *
- * @example var data = $("#myMultiSelect").fieldValue();
- * @desc Get the values for the select-multiple control
- *
- * @name fieldValue
- * @param Boolean successful true if only the values for successful controls should be returned (default is true)
- * @type Array<String>
- * @cat Plugins/Form
- */
-$.fn.fieldValue = function(successful) {
-    for (var val=[], i=0, max=this.length; i < max; i++) {
-        var el = this[i];
-        var v = $.fieldValue(el, successful);
-        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
-            continue;
-        v.constructor == Array ? $.merge(val, v) : val.push(v);
-    }
-    return val;
-};
-
-/**
- * Returns the value of the field element.
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.  If the given element is not
- * successful and the successful arg is not false then the returned value will be null.
- *
- * Note: If the successful flag is true (default) but the element is not successful, the return will be null
- * Note: The value returned for a successful select-multiple element will always be an array.
- * Note: If the element has no value the return value will be undefined.
- *
- * @example var data = jQuery.fieldValue($("#myPasswordElement")[0]);
- * @desc Gets the current value of the myPasswordElement element
- *
- * @name fieldValue
- * @param Element el The DOM element for which the value will be returned
- * @param Boolean successful true if value returned must be for a successful controls (default is true)
- * @type String or Array<String> or null or undefined
- * @cat Plugins/Form
- */
-$.fieldValue = function(el, successful) {
-    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
-    if (typeof successful == 'undefined') successful = true;
-
-    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
-        (t == 'checkbox' || t == 'radio') && !el.checked ||
-        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
-        tag == 'select' && el.selectedIndex == -1))
-            return null;
-
-    if (tag == 'select') {
-        var index = el.selectedIndex;
-        if (index < 0) return null;
-        var a = [], ops = el.options;
-        var one = (t == 'select-one');
-        var max = (one ? index+1 : ops.length);
-        for(var i=(one ? index : 0); i < max; i++) {
-            var op = ops[i];
-            if (op.selected) {
-                // extra pain for IE...
-                var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
-                if (one) return v;
-                a.push(v);
-            }
-        }
-        return a;
-    }
-    return el.value;
-};
-
-
-/**
- * Clears the form data.  Takes the following actions on the form's input fields:
- *  - input text fields will have their 'value' property set to the empty string
- *  - select elements will have their 'selectedIndex' property set to -1
- *  - checkbox and radio inputs will have their 'checked' property set to false
- *  - inputs of type submit, button, reset, and hidden will *not* be effected
- *  - button elements will *not* be effected
- *
- * @example $('form').clearForm();
- * @desc Clears all forms on the page.
- *
- * @name clearForm
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.clearForm = function() {
-    return this.each(function() {
-        $('input,select,textarea', this).clearFields();
-    });
-};
-
-/**
- * Clears the selected form elements.  Takes the following actions on the matched elements:
- *  - input text fields will have their 'value' property set to the empty string
- *  - select elements will have their 'selectedIndex' property set to -1
- *  - checkbox and radio inputs will have their 'checked' property set to false
- *  - inputs of type submit, button, reset, and hidden will *not* be effected
- *  - button elements will *not* be effected
- *
- * @example $('.myInputs').clearFields();
- * @desc Clears all inputs with class myInputs
- *
- * @name clearFields
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.clearFields = $.fn.clearInputs = function() {
-    return this.each(function() {
-        var t = this.type, tag = this.tagName.toLowerCase();
-        if (t == 'text' || t == 'password' || tag == 'textarea')
-            this.value = '';
-        else if (t == 'checkbox' || t == 'radio')
-            this.checked = false;
-        else if (tag == 'select')
-            this.selectedIndex = -1;
-    });
-};
-
-
-/**
- * Resets the form data.  Causes all form elements to be reset to their original value.
- *
- * @example $('form').resetForm();
- * @desc Resets all forms on the page.
- *
- * @name resetForm
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.resetForm = function() {
-    return this.each(function() {
-        // guard against an input with the name of 'reset'
-        // note that IE reports the reset function as an 'object'
-        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
-            this.reset();
-    });
-};
-
-})(jQuery);
--- a/web/html/support/hsbook.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-function qid(id) {
-  return id.replace(/([.:])/g, "\\$1");
-}
-
-function beforeComment(formData, jqForm, options) {
-  var form = jqForm[0];
-  if (!form.comment.value) {
-    $(options.target + " span.comment_error").empty().append(
-      "<span class=\"comment_error\">Your comment is empty</span>");
-    return false;
-  }
-  if (!form.name.value) {
-    $(options.target + " span.comment_error").empty().append(
-      "<span class=\"comment_error\">Please provide a name</span>");
-    return false;
-  }
-  $(options.target + " span.comment_error").empty().after(
-    "<img src=\"/support/icons/throbber.gif\" style=\"vertical-align: middle\"/>");
-  $(options.target + " input[@name=submit]").attr("disabled", true);
-}
-
-function ajaxifyForm(id) {
-  var q = qid(id);
-  
-  $("#form_" + q).ajaxForm({ beforeSubmit: beforeComment,
-			     success: function() { ajaxifyForm(id); },
-			     target: "#comments_" + q });
-}
-
-function toggleComment(id) {
-  $("#toggle_" + qid(id)).nextAll().toggle();
-  return false;
-}
-
-function loadComments(id) {
-  $("#comments_" + qid(id)).load(location.protocol + "//" + location.host +
-				 "/comments/single/" + id + "/", function() {
-    ajaxifyForm(id);
-  });
-  return false;
-}
-
-function loadAllComments() {
-  $("a.commenttoggle").each(function() {
-    var id = $(this).attr("pid");
-    if (id) {
-      loadComments(id);
-    }
-  });
-}
-
-$(document).ready(function() {
-  function loading(id) {
-    return " <span id=\"comments_" + id + "\" class=\"comment\">" +
-      "<span pid=\"" + id + "\" class=\"commenttoggle\">Loading..." +
-      "</span></span>";
-  }
-  $("div.toc>p")
-    .after("<p style='display: none;'><a onclick='return loadAllComments()'>" +
-	   "Load all comments (<b>slow</b>)</a></p>")
-    .toggle(function() { $(this).nextAll().show("normal"); },
-	    function() { $(this).nextAll().hide("normal"); })
-    .hover(function() { $(this).fadeTo("normal", 0.8); },
-	   function() { $(this).fadeTo("normal", 0.35); });
-  $(".chapter p[@id]").each(function() {
-    $(this).append(loading($(this).attr("id")));
-  });
-  $(".chapter table[@id].equation").each(function() {
-    id = $(this).attr("id");
-    $("#" + id + " tr").after('<tr><td colspan="4">' + loading($(this).attr("id")) + '</td></tr>');
-  });
-  $(".chapter pre[@id]").each(function() {
-    $(this).after(loading($(this).attr("id")));
-  });
-  var chapid = $("div.preface, div.chapter, div.appendix, div.bibliography").attr("id");
-  $("#chapterfeed").attr("href",
-			 $("#chapterfeed").attr("href") + chapid + "/");
-  $.getJSON(location.protocol + "//" + location.host + "/comments/chapter/" +
-	    chapid + "/count/", function(data) {
-    $.each(data, function(id, item) {
-      var s = item == 1 ? "" : "s";
-      $("#comments_" + qid(id) + " span.commenttoggle").replaceWith(
-        "<a class='commenttoggle' id='toggle_" + id + "' " +
-	"pid='" + id + "' " +
-	"onclick='return loadComments(\"" + id + "\")' " +
-	"href='comments: show / hide'>" + item + " comment" + s + "</a>");
-    });
-    $("span.commenttoggle").each(function() {
-      var id = $(this).attr("pid");
-      $(this).replaceWith("<a class='commenttoggle' id='toggle_" + id + "' " +
-			  "onclick='return loadComments(\"" + id + "\")' " +
-			  "href='comment: add'>No comments</a>");
-    });
-  });
-});
Binary file web/html/support/icons/caution.png has changed
Binary file web/html/support/icons/favicon.png has changed
Binary file web/html/support/icons/important.png has changed
Binary file web/html/support/icons/note.png has changed
Binary file web/html/support/icons/remark.png has changed
Binary file web/html/support/icons/rss.png has changed
Binary file web/html/support/icons/shell.png has changed
Binary file web/html/support/icons/source.png has changed
Binary file web/html/support/icons/throbber.gif has changed
Binary file web/html/support/icons/tip.png has changed
Binary file web/html/support/icons/warning.png has changed
--- a/web/html/support/javascript/form-min.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-(function($){$.fn.ajaxSubmit=function(_2){if(typeof _2=="function"){_2={success:_2};}_2=$.extend({url:this.attr("action")||window.location,type:this.attr("method")||"GET"},_2||{});var _3={};$.event.trigger("form.pre.serialize",[this,_2,_3]);if(_3.veto){return this;}var a=this.formToArray(_2.semantic);if(_2.data){for(var n in _2.data){a.push({name:n,value:_2.data[n]});}}if(_2.beforeSubmit&&_2.beforeSubmit(a,this,_2)===false){return this;}$.event.trigger("form.submit.validate",[a,this,_2,_3]);if(_3.veto){return this;}var q=$.param(a);if(_2.type.toUpperCase()=="GET"){_2.url+=(_2.url.indexOf("?")>=0?"&":"?")+q;_2.data=null;}else{_2.data=q;}var _7=this,callbacks=[];if(_2.resetForm){callbacks.push(function(){_7.resetForm();});}if(_2.clearForm){callbacks.push(function(){_7.clearForm();});}if(!_2.dataType&&_2.target){var _8=_2.success||function(){};callbacks.push(function(_9){if(this.evalScripts){$(_2.target).attr("innerHTML",_9).evalScripts().each(_8,arguments);}else{$(_2.target).html(_9).each(_8,arguments);}});}else{if(_2.success){callbacks.push(_2.success);}}_2.success=function(_a,_b){for(var i=0,max=callbacks.length;i<max;i++){callbacks[i](_a,_b,_7);}};var _d=$("input:file",this).fieldValue();var _e=false;for(var j=0;j<_d.length;j++){if(_d[j]){_e=true;}}if(_2.iframe||_e){fileUpload();}else{$.ajax(_2);}$.event.trigger("form.submit.notify",[this,_2]);return this;function fileUpload(){var _10=_7[0];var _11=$.extend({},$.ajaxSettings,_2);var id="jqFormIO"+$.fn.ajaxSubmit.counter++;var $io=$("<iframe id=\""+id+"\" name=\""+id+"\" />");var io=$io[0];var op8=$.browser.opera&&window.opera.version()<9;if($.browser.msie||op8){io.src="javascript:false;document.write(\"\");";}$io.css({position:"absolute",top:"-1000px",left:"-1000px"});var xhr={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=_11.global;if(g&&!$.active++){$.event.trigger("ajaxStart");}if(g){$.event.trigger("ajaxSend",[xhr,_11]);}var _18=0;var _19=0;setTimeout(function(){$io.appendTo("body");io.attachEvent?io.attachEvent("onload",cb):io.addEventListener("load",cb,false);var _1a=_10.encoding?"encoding":"enctype";var t=_7.attr("target");_7.attr({target:id,method:"POST",action:_11.url});_10[_1a]="multipart/form-data";if(_11.timeout){setTimeout(function(){_19=true;cb();},_11.timeout);}_10.submit();_7.attr("target",t);},10);function cb(){if(_18++){return;}io.detachEvent?io.detachEvent("onload",cb):io.removeEventListener("load",cb,false);var ok=true;try{if(_19){throw "timeout";}var _1d,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(_11.dataType=="json"||_11.dataType=="script"){var ta=doc.getElementsByTagName("textarea")[0];_1d=ta?ta.value:xhr.responseText;if(_11.dataType=="json"){eval("data = "+_1d);}else{$.globalEval(_1d);}}else{if(_11.dataType=="xml"){_1d=xhr.responseXML;if(!_1d&&xhr.responseText!=null){_1d=toXml(xhr.responseText);}}else{_1d=xhr.responseText;}}}catch(e){ok=false;$.handleError(_11,xhr,"error",e);}if(ok){_11.success(_1d,"success");if(g){$.event.trigger("ajaxSuccess",[xhr,_11]);}}if(g){$.event.trigger("ajaxComplete",[xhr,_11]);}if(g&&!--$.active){$.event.trigger("ajaxStop");}if(_11.complete){_11.complete(xhr,ok?"success":"error");}setTimeout(function(){$io.remove();xhr.responseXML=null;},100);}function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s);}else{doc=(new DOMParser()).parseFromString(s,"text/xml");}return (doc&&doc.documentElement&&doc.documentElement.tagName!="parsererror")?doc:null;}}};$.fn.ajaxSubmit.counter=0;$.fn.ajaxForm=function(_21){return this.ajaxFormUnbind().submit(submitHandler).each(function(){this.formPluginId=$.fn.ajaxForm.counter++;$.fn.ajaxForm.optionHash[this.formPluginId]=_21;$(":submit,input:image",this).click(clickHandler);});};$.fn.ajaxForm.counter=1;$.fn.ajaxForm.optionHash={};function clickHandler(e){var _23=this.form;_23.clk=this;if(this.type=="image"){if(e.offsetX!=undefined){_23.clk_x=e.offsetX;_23.clk_y=e.offsetY;}else{if(typeof $.fn.offset=="function"){var _24=$(this).offset();_23.clk_x=e.pageX-_24.left;_23.clk_y=e.pageY-_24.top;}else{_23.clk_x=e.pageX-this.offsetLeft;_23.clk_y=e.pageY-this.offsetTop;}}}setTimeout(function(){_23.clk=_23.clk_x=_23.clk_y=null;},10);}function submitHandler(){var id=this.formPluginId;var _26=$.fn.ajaxForm.optionHash[id];$(this).ajaxSubmit(_26);return false;}$.fn.ajaxFormUnbind=function(){this.unbind("submit",submitHandler);return this.each(function(){$(":submit,input:image",this).unbind("click",clickHandler);});};$.fn.formToArray=function(_27){var a=[];if(this.length==0){return a;}var _29=this[0];var els=_27?_29.getElementsByTagName("*"):_29.elements;if(!els){return a;}for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n){continue;}if(_27&&_29.clk&&el.type=="image"){if(!el.disabled&&_29.clk==el){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}continue;}var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:n,value:v});}}}if(!_27&&_29.clk){var _30=_29.getElementsByTagName("input");for(var i=0,max=_30.length;i<max;i++){var _32=_30[i];var n=_32.name;if(n&&!_32.disabled&&_32.type=="image"&&_29.clk==_32){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}}}return a;};$.fn.formSerialize=function(_34){return $.param(this.formToArray(_34));};$.fn.fieldSerialize=function(_35){var a=[];this.each(function(){var n=this.name;if(!n){return;}var v=$.fieldValue(this,_35);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:this.name,value:v});}}});return $.param(a);};$.fn.fieldValue=function(_3a){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,_3a);if(v===null||typeof v=="undefined"||(v.constructor==Array&&!v.length)){continue;}v.constructor==Array?$.merge(val,v):val.push(v);}return val;};$.fieldValue=function(el,_3f){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof _3f=="undefined"){_3f=true;}if(_3f&&(!n||el.disabled||t=="reset"||t=="button"||(t=="checkbox"||t=="radio")&&!el.checked||(t=="submit"||t=="image")&&el.form&&el.form.clk!=el||tag=="select"&&el.selectedIndex==-1)){return null;}if(tag=="select"){var _41=el.selectedIndex;if(_41<0){return null;}var a=[],ops=el.options;var one=(t=="select-one");var max=(one?_41+1:ops.length);for(var i=(one?_41:0);i<max;i++){var op=ops[i];if(op.selected){var v=$.browser.msie&&!(op.attributes["value"].specified)?op.text:op.value;if(one){return v;}a.push(v);}}return a;}return el.value;};$.fn.clearForm=function(){return this.each(function(){$("input,select,textarea",this).clearFields();});};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=="text"||t=="password"||tag=="textarea"){this.value="";}else{if(t=="checkbox"||t=="radio"){this.checked=false;}else{if(tag=="select"){this.selectedIndex=-1;}}}});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset();}});};})(jQuery);
\ No newline at end of file
--- a/web/html/support/javascript/form.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,819 +0,0 @@
-/*
- * jQuery Form Plugin
- * @requires jQuery v1.1 or later
- *
- * Examples at: http://malsup.com/jquery/form/
- * Dual licensed under the MIT and GPL licenses:
- *   http://www.opensource.org/licenses/mit-license.php
- *   http://www.gnu.org/licenses/gpl.html
- *
- * Revision: $Id$
- */
- (function($) {
-/**
- * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.
- *
- * ajaxSubmit accepts a single argument which can be either a success callback function
- * or an options Object.  If a function is provided it will be invoked upon successful
- * completion of the submit and will be passed the response from the server.
- * If an options Object is provided, the following attributes are supported:
- *
- *  target:   Identifies the element(s) in the page to be updated with the server response.
- *            This value may be specified as a jQuery selection string, a jQuery object,
- *            or a DOM element.
- *            default value: null
- *
- *  url:      URL to which the form data will be submitted.
- *            default value: value of form's 'action' attribute
- *
- *  type:     The method in which the form data should be submitted, 'GET' or 'POST'.
- *            default value: value of form's 'method' attribute (or 'GET' if none found)
- *
- *  data:     Additional data to add to the request, specified as key/value pairs (see $.ajax).
- *
- *  beforeSubmit:  Callback method to be invoked before the form is submitted.
- *            default value: null
- *
- *  success:  Callback method to be invoked after the form has been successfully submitted
- *            and the response has been returned from the server
- *            default value: null
- *
- *  dataType: Expected dataType of the response.  One of: null, 'xml', 'script', or 'json'
- *            default value: null
- *
- *  semantic: Boolean flag indicating whether data must be submitted in semantic order (slower).
- *            default value: false
- *
- *  resetForm: Boolean flag indicating whether the form should be reset if the submit is successful
- *
- *  clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful
- *
- *
- * The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for
- * validating the form data.  If the 'beforeSubmit' callback returns false then the form will
- * not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data
- * in array format, the jQuery object, and the options object passed into ajaxSubmit.
- * The form data array takes the following form:
- *
- *     [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * If a 'success' callback method is provided it is invoked after the response has been returned
- * from the server.  It is passed the responseText or responseXML value (depending on dataType).
- * See jQuery.ajax for further details.
- *
- *
- * The dataType option provides a means for specifying how the server response should be handled.
- * This maps directly to the jQuery.httpData method.  The following values are supported:
- *
- *      'xml':    if dataType == 'xml' the server response is treated as XML and the 'success'
- *                   callback method, if specified, will be passed the responseXML value
- *      'json':   if dataType == 'json' the server response will be evaluted and passed to
- *                   the 'success' callback, if specified
- *      'script': if dataType == 'script' the server response is evaluated in the global context
- *
- *
- * Note that it does not make sense to use both the 'target' and 'dataType' options.  If both
- * are provided the target will be ignored.
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * This is normally true anyway, unless the form contains input elements of type='image'.
- * If your form must be submitted with name/value pairs in semantic order and your form
- * contains an input of type='image" then pass true for this arg, otherwise pass false
- * (or nothing) to avoid the overhead for this logic.
- *
- *
- * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this:
- *
- * $("#form-id").submit(function() {
- *     $(this).ajaxSubmit(options);
- *     return false; // cancel conventional submit
- * });
- *
- * When using ajaxForm(), however, this is done for you.
- *
- * @example
- * $('#myForm').ajaxSubmit(function(data) {
- *     alert('Form submit succeeded! Server returned: ' + data);
- * });
- * @desc Submit form and alert server response
- *
- *
- * @example
- * var options = {
- *     target: '#myTargetDiv'
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Submit form and update page element with server response
- *
- *
- * @example
- * var options = {
- *     success: function(responseText) {
- *         alert(responseText);
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Submit form and alert the server response
- *
- *
- * @example
- * var options = {
- *     beforeSubmit: function(formArray, jqForm) {
- *         if (formArray.length == 0) {
- *             alert('Please enter data.');
- *             return false;
- *         }
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Pre-submit validation which aborts the submit operation if form data is empty
- *
- *
- * @example
- * var options = {
- *     url: myJsonUrl.php,
- *     dataType: 'json',
- *     success: function(data) {
- *        // 'data' is an object representing the the evaluated json data
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc json data returned and evaluated
- *
- *
- * @example
- * var options = {
- *     url: myXmlUrl.php,
- *     dataType: 'xml',
- *     success: function(responseXML) {
- *        // responseXML is XML document object
- *        var data = $('myElement', responseXML).text();
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc XML data returned from server
- *
- *
- * @example
- * var options = {
- *     resetForm: true
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc submit form and reset it if successful
- *
- * @example
- * $('#myForm).submit(function() {
- *    $(this).ajaxSubmit();
- *    return false;
- * });
- * @desc Bind form's submit event to use ajaxSubmit
- *
- *
- * @name ajaxSubmit
- * @type jQuery
- * @param options  object literal containing options which control the form submission process
- * @cat Plugins/Form
- * @return jQuery
- */
-$.fn.ajaxSubmit = function(options) {
-    if (typeof options == 'function')
-        options = { success: options };
-
-    options = $.extend({
-        url:  this.attr('action') || window.location,
-        type: this.attr('method') || 'GET'
-    }, options || {});
-
-    // hook for manipulating the form data before it is extracted;
-    // convenient for use with rich editors like tinyMCE or FCKEditor
-    var veto = {};
-    $.event.trigger('form.pre.serialize', [this, options, veto]);
-    if (veto.veto) return this;
-
-    var a = this.formToArray(options.semantic);
-	if (options.data) {
-	    for (var n in options.data)
-	        a.push( { name: n, value: options.data[n] } );
-	}
-
-    // give pre-submit callback an opportunity to abort the submit
-    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this;
-
-    // fire vetoable 'validate' event
-    $.event.trigger('form.submit.validate', [a, this, options, veto]);
-    if (veto.veto) return this;
-
-    var q = $.param(a);//.replace(/%20/g,'+');
-
-    if (options.type.toUpperCase() == 'GET') {
-        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
-        options.data = null;  // data is null for 'get'
-    }
-    else
-        options.data = q; // data is the query string for 'post'
-
-    var $form = this, callbacks = [];
-    if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
-    if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
-
-    // perform a load on the target only if dataType is not provided
-    if (!options.dataType && options.target) {
-        var oldSuccess = options.success || function(){};
-        callbacks.push(function(data) {
-            if (this.evalScripts)
-                $(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments);
-            else // jQuery v1.1.4
-                $(options.target).html(data).each(oldSuccess, arguments);
-        });
-    }
-    else if (options.success)
-        callbacks.push(options.success);
-
-    options.success = function(data, status) {
-        for (var i=0, max=callbacks.length; i < max; i++)
-            callbacks[i](data, status, $form);
-    };
-
-    // are there files to upload?
-    var files = $('input:file', this).fieldValue();
-    var found = false;
-    for (var j=0; j < files.length; j++)
-        if (files[j])
-            found = true;
-
-    if (options.iframe || found) // options.iframe allows user to force iframe mode
-        fileUpload();
-    else
-        $.ajax(options);
-
-    // fire 'notify' event
-    $.event.trigger('form.submit.notify', [this, options]);
-    return this;
-
-
-    // private function for handling file uploads (hat tip to YAHOO!)
-    function fileUpload() {
-        var form = $form[0];
-        var opts = $.extend({}, $.ajaxSettings, options);
-
-        var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++;
-        var $io = $('<iframe id="' + id + '" name="' + id + '" />');
-        var io = $io[0];
-        var op8 = $.browser.opera && window.opera.version() < 9;
-        if ($.browser.msie || op8) io.src = 'javascript:false;document.write("");';
-        $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
-
-        var xhr = { // mock object
-            responseText: null,
-            responseXML: null,
-            status: 0,
-            statusText: 'n/a',
-            getAllResponseHeaders: function() {},
-            getResponseHeader: function() {},
-            setRequestHeader: function() {}
-        };
-
-        var g = opts.global;
-        // trigger ajax global events so that activity/block indicators work like normal
-        if (g && ! $.active++) $.event.trigger("ajaxStart");
-        if (g) $.event.trigger("ajaxSend", [xhr, opts]);
-
-        var cbInvoked = 0;
-        var timedOut = 0;
-
-        // take a breath so that pending repaints get some cpu time before the upload starts
-        setTimeout(function() {
-            $io.appendTo('body');
-            // jQuery's event binding doesn't work for iframe events in IE
-            io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
-
-            // make sure form attrs are set
-            var encAttr = form.encoding ? 'encoding' : 'enctype';
-            var t = $form.attr('target');
-            $form.attr({
-                target:   id,
-                method:  'POST',
-                action:   opts.url
-            });
-            form[encAttr] = 'multipart/form-data';
-
-            // support timout
-            if (opts.timeout)
-                setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
-
-            form.submit();
-            $form.attr('target', t); // reset target
-        }, 10);
-
-        function cb() {
-            if (cbInvoked++) return;
-
-            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
-
-            var ok = true;
-            try {
-                if (timedOut) throw 'timeout';
-                // extract the server response from the iframe
-                var data, doc;
-                doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
-                xhr.responseText = doc.body ? doc.body.innerHTML : null;
-                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
-
-                if (opts.dataType == 'json' || opts.dataType == 'script') {
-                    var ta = doc.getElementsByTagName('textarea')[0];
-                    data = ta ? ta.value : xhr.responseText;
-                    if (opts.dataType == 'json')
-                        eval("data = " + data);
-                    else
-                        $.globalEval(data);
-                }
-                else if (opts.dataType == 'xml') {
-                    data = xhr.responseXML;
-                    if (!data && xhr.responseText != null)
-                        data = toXml(xhr.responseText);
-                }
-                else {
-                    data = xhr.responseText;
-                }
-            }
-            catch(e){
-                ok = false;
-                $.handleError(opts, xhr, 'error', e);
-            }
-
-            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
-            if (ok) {
-                opts.success(data, 'success');
-                if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
-            }
-            if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
-            if (g && ! --$.active) $.event.trigger("ajaxStop");
-            if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
-
-            // clean up
-            setTimeout(function() {
-                $io.remove();
-                xhr.responseXML = null;
-            }, 100);
-        };
-
-        function toXml(s, doc) {
-            if (window.ActiveXObject) {
-                doc = new ActiveXObject('Microsoft.XMLDOM');
-                doc.async = 'false';
-                doc.loadXML(s);
-            }
-            else
-                doc = (new DOMParser()).parseFromString(s, 'text/xml');
-            return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
-        };
-    };
-};
-$.fn.ajaxSubmit.counter = 0; // used to create unique iframe ids
-
-/**
- * ajaxForm() provides a mechanism for fully automating form submission.
- *
- * The advantages of using this method instead of ajaxSubmit() are:
- *
- * 1: This method will include coordinates for <input type="image" /> elements (if the element
- *    is used to submit the form).
- * 2. This method will include the submit element's name/value data (for the element that was
- *    used to submit the form).
- * 3. This method binds the submit() method to the form for you.
- *
- * Note that for accurate x/y coordinates of image submit elements in all browsers
- * you need to also use the "dimensions" plugin (this method will auto-detect its presence).
- *
- * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
- * passes the options argument along after properly binding events for submit elements and
- * the form itself.  See ajaxSubmit for a full description of the options argument.
- *
- *
- * @example
- * var options = {
- *     target: '#myTargetDiv'
- * };
- * $('#myForm').ajaxSForm(options);
- * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response
- *       when the form is submitted.
- *
- *
- * @example
- * var options = {
- *     success: function(responseText) {
- *         alert(responseText);
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Bind form's submit event so that server response is alerted after the form is submitted.
- *
- *
- * @example
- * var options = {
- *     beforeSubmit: function(formArray, jqForm) {
- *         if (formArray.length == 0) {
- *             alert('Please enter data.');
- *             return false;
- *         }
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Bind form's submit event so that pre-submit callback is invoked before the form
- *       is submitted.
- *
- *
- * @name   ajaxForm
- * @param  options  object literal containing options which control the form submission process
- * @return jQuery
- * @cat    Plugins/Form
- * @type   jQuery
- */
-$.fn.ajaxForm = function(options) {
-    return this.ajaxFormUnbind().submit(submitHandler).each(function() {
-        // store options in hash
-        this.formPluginId = $.fn.ajaxForm.counter++;
-        $.fn.ajaxForm.optionHash[this.formPluginId] = options;
-        $(":submit,input:image", this).click(clickHandler);
-    });
-};
-
-$.fn.ajaxForm.counter = 1;
-$.fn.ajaxForm.optionHash = {};
-
-function clickHandler(e) {
-    var $form = this.form;
-    $form.clk = this;
-    if (this.type == 'image') {
-        if (e.offsetX != undefined) {
-            $form.clk_x = e.offsetX;
-            $form.clk_y = e.offsetY;
-        } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
-            var offset = $(this).offset();
-            $form.clk_x = e.pageX - offset.left;
-            $form.clk_y = e.pageY - offset.top;
-        } else {
-            $form.clk_x = e.pageX - this.offsetLeft;
-            $form.clk_y = e.pageY - this.offsetTop;
-        }
-    }
-    // clear form vars
-    setTimeout(function() { $form.clk = $form.clk_x = $form.clk_y = null; }, 10);
-};
-
-function submitHandler() {
-    // retrieve options from hash
-    var id = this.formPluginId;
-    var options = $.fn.ajaxForm.optionHash[id];
-    $(this).ajaxSubmit(options);
-    return false;
-};
-
-/**
- * ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
- *
- * @name   ajaxFormUnbind
- * @return jQuery
- * @cat    Plugins/Form
- * @type   jQuery
- */
-$.fn.ajaxFormUnbind = function() {
-    this.unbind('submit', submitHandler);
-    return this.each(function() {
-        $(":submit,input:image", this).unbind('click', clickHandler);
-    });
-
-};
-
-/**
- * formToArray() gathers form element data into an array of objects that can
- * be passed to any of the following ajax functions: $.get, $.post, or load.
- * Each object in the array has both a 'name' and 'value' property.  An example of
- * an array for a simple login form might be:
- *
- * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * It is this array that is passed to pre-submit callback functions provided to the
- * ajaxSubmit() and ajaxForm() methods.
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * This is normally true anyway, unless the form contains input elements of type='image'.
- * If your form must be submitted with name/value pairs in semantic order and your form
- * contains an input of type='image" then pass true for this arg, otherwise pass false
- * (or nothing) to avoid the overhead for this logic.
- *
- * @example var data = $("#myForm").formToArray();
- * $.post( "myscript.cgi", data );
- * @desc Collect all the data from a form and submit it to the server.
- *
- * @name formToArray
- * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
- * @type Array<Object>
- * @cat Plugins/Form
- */
-$.fn.formToArray = function(semantic) {
-    var a = [];
-    if (this.length == 0) return a;
-
-    var form = this[0];
-    var els = semantic ? form.getElementsByTagName('*') : form.elements;
-    if (!els) return a;
-    for(var i=0, max=els.length; i < max; i++) {
-        var el = els[i];
-        var n = el.name;
-        if (!n) continue;
-
-        if (semantic && form.clk && el.type == "image") {
-            // handle image inputs on the fly when semantic == true
-            if(!el.disabled && form.clk == el)
-                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-            continue;
-        }
-
-        var v = $.fieldValue(el, true);
-        if (v && v.constructor == Array) {
-            for(var j=0, jmax=v.length; j < jmax; j++)
-                a.push({name: n, value: v[j]});
-        }
-        else if (v !== null && typeof v != 'undefined')
-            a.push({name: n, value: v});
-    }
-
-    if (!semantic && form.clk) {
-        // input type=='image' are not found in elements array! handle them here
-        var inputs = form.getElementsByTagName("input");
-        for(var i=0, max=inputs.length; i < max; i++) {
-            var input = inputs[i];
-            var n = input.name;
-            if(n && !input.disabled && input.type == "image" && form.clk == input)
-                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-        }
-    }
-    return a;
-};
-
-
-/**
- * Serializes form data into a 'submittable' string. This method will return a string
- * in the format: name1=value1&amp;name2=value2
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * If your form must be submitted with name/value pairs in semantic order then pass
- * true for this arg, otherwise pass false (or nothing) to avoid the overhead for
- * this logic (which can be significant for very large forms).
- *
- * @example var data = $("#myForm").formSerialize();
- * $.ajax('POST', "myscript.cgi", data);
- * @desc Collect all the data from a form into a single string
- *
- * @name formSerialize
- * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
- * @type String
- * @cat Plugins/Form
- */
-$.fn.formSerialize = function(semantic) {
-    //hand off to jQuery.param for proper encoding
-    return $.param(this.formToArray(semantic));
-};
-
-
-/**
- * Serializes all field elements in the jQuery object into a query string.
- * This method will return a string in the format: name1=value1&amp;name2=value2
- *
- * The successful argument controls whether or not serialization is limited to
- * 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.
- *
- * @example var data = $("input").formSerialize();
- * @desc Collect the data from all successful input elements into a query string
- *
- * @example var data = $(":radio").formSerialize();
- * @desc Collect the data from all successful radio input elements into a query string
- *
- * @example var data = $("#myForm :checkbox").formSerialize();
- * @desc Collect the data from all successful checkbox input elements in myForm into a query string
- *
- * @example var data = $("#myForm :checkbox").formSerialize(false);
- * @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string
- *
- * @example var data = $(":input").formSerialize();
- * @desc Collect the data from all successful input, select, textarea and button elements into a query string
- *
- * @name fieldSerialize
- * @param successful true if only successful controls should be serialized (default is true)
- * @type String
- * @cat Plugins/Form
- */
-$.fn.fieldSerialize = function(successful) {
-    var a = [];
-    this.each(function() {
-        var n = this.name;
-        if (!n) return;
-        var v = $.fieldValue(this, successful);
-        if (v && v.constructor == Array) {
-            for (var i=0,max=v.length; i < max; i++)
-                a.push({name: n, value: v[i]});
-        }
-        else if (v !== null && typeof v != 'undefined')
-            a.push({name: this.name, value: v});
-    });
-    //hand off to jQuery.param for proper encoding
-    return $.param(a);
-};
-
-
-/**
- * Returns the value(s) of the element in the matched set.  For example, consider the following form:
- *
- *  <form><fieldset>
- *      <input name="A" type="text" />
- *      <input name="A" type="text" />
- *      <input name="B" type="checkbox" value="B1" />
- *      <input name="B" type="checkbox" value="B2"/>
- *      <input name="C" type="radio" value="C1" />
- *      <input name="C" type="radio" value="C2" />
- *  </fieldset></form>
- *
- *  var v = $(':text').fieldValue();
- *  // if no values are entered into the text inputs
- *  v == ['','']
- *  // if values entered into the text inputs are 'foo' and 'bar'
- *  v == ['foo','bar']
- *
- *  var v = $(':checkbox').fieldValue();
- *  // if neither checkbox is checked
- *  v === undefined
- *  // if both checkboxes are checked
- *  v == ['B1', 'B2']
- *
- *  var v = $(':radio').fieldValue();
- *  // if neither radio is checked
- *  v === undefined
- *  // if first radio is checked
- *  v == ['C1']
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.  If this value is false the value(s)
- * for each element is returned.
- *
- * Note: This method *always* returns an array.  If no valid value can be determined the
- *       array will be empty, otherwise it will contain one or more values.
- *
- * @example var data = $("#myPasswordElement").fieldValue();
- * alert(data[0]);
- * @desc Alerts the current value of the myPasswordElement element
- *
- * @example var data = $("#myForm :input").fieldValue();
- * @desc Get the value(s) of the form elements in myForm
- *
- * @example var data = $("#myForm :checkbox").fieldValue();
- * @desc Get the value(s) for the successful checkbox element(s) in the jQuery object.
- *
- * @example var data = $("#mySingleSelect").fieldValue();
- * @desc Get the value(s) of the select control
- *
- * @example var data = $(':text').fieldValue();
- * @desc Get the value(s) of the text input or textarea elements
- *
- * @example var data = $("#myMultiSelect").fieldValue();
- * @desc Get the values for the select-multiple control
- *
- * @name fieldValue
- * @param Boolean successful true if only the values for successful controls should be returned (default is true)
- * @type Array<String>
- * @cat Plugins/Form
- */
-$.fn.fieldValue = function(successful) {
-    for (var val=[], i=0, max=this.length; i < max; i++) {
-        var el = this[i];
-        var v = $.fieldValue(el, successful);
-        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
-            continue;
-        v.constructor == Array ? $.merge(val, v) : val.push(v);
-    }
-    return val;
-};
-
-/**
- * Returns the value of the field element.
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.  If the given element is not
- * successful and the successful arg is not false then the returned value will be null.
- *
- * Note: If the successful flag is true (default) but the element is not successful, the return will be null
- * Note: The value returned for a successful select-multiple element will always be an array.
- * Note: If the element has no value the return value will be undefined.
- *
- * @example var data = jQuery.fieldValue($("#myPasswordElement")[0]);
- * @desc Gets the current value of the myPasswordElement element
- *
- * @name fieldValue
- * @param Element el The DOM element for which the value will be returned
- * @param Boolean successful true if value returned must be for a successful controls (default is true)
- * @type String or Array<String> or null or undefined
- * @cat Plugins/Form
- */
-$.fieldValue = function(el, successful) {
-    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
-    if (typeof successful == 'undefined') successful = true;
-
-    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
-        (t == 'checkbox' || t == 'radio') && !el.checked ||
-        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
-        tag == 'select' && el.selectedIndex == -1))
-            return null;
-
-    if (tag == 'select') {
-        var index = el.selectedIndex;
-        if (index < 0) return null;
-        var a = [], ops = el.options;
-        var one = (t == 'select-one');
-        var max = (one ? index+1 : ops.length);
-        for(var i=(one ? index : 0); i < max; i++) {
-            var op = ops[i];
-            if (op.selected) {
-                // extra pain for IE...
-                var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
-                if (one) return v;
-                a.push(v);
-            }
-        }
-        return a;
-    }
-    return el.value;
-};
-
-
-/**
- * Clears the form data.  Takes the following actions on the form's input fields:
- *  - input text fields will have their 'value' property set to the empty string
- *  - select elements will have their 'selectedIndex' property set to -1
- *  - checkbox and radio inputs will have their 'checked' property set to false
- *  - inputs of type submit, button, reset, and hidden will *not* be effected
- *  - button elements will *not* be effected
- *
- * @example $('form').clearForm();
- * @desc Clears all forms on the page.
- *
- * @name clearForm
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.clearForm = function() {
-    return this.each(function() {
-        $('input,select,textarea', this).clearFields();
-    });
-};
-
-/**
- * Clears the selected form elements.  Takes the following actions on the matched elements:
- *  - input text fields will have their 'value' property set to the empty string
- *  - select elements will have their 'selectedIndex' property set to -1
- *  - checkbox and radio inputs will have their 'checked' property set to false
- *  - inputs of type submit, button, reset, and hidden will *not* be effected
- *  - button elements will *not* be effected
- *
- * @example $('.myInputs').clearFields();
- * @desc Clears all inputs with class myInputs
- *
- * @name clearFields
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.clearFields = $.fn.clearInputs = function() {
-    return this.each(function() {
-        var t = this.type, tag = this.tagName.toLowerCase();
-        if (t == 'text' || t == 'password' || tag == 'textarea')
-            this.value = '';
-        else if (t == 'checkbox' || t == 'radio')
-            this.checked = false;
-        else if (tag == 'select')
-            this.selectedIndex = -1;
-    });
-};
-
-
-/**
- * Resets the form data.  Causes all form elements to be reset to their original value.
- *
- * @example $('form').resetForm();
- * @desc Resets all forms on the page.
- *
- * @name resetForm
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.resetForm = function() {
-    return this.each(function() {
-        // guard against an input with the name of 'reset'
-        // note that IE reports the reset function as an 'object'
-        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
-            this.reset();
-    });
-};
-
-})(jQuery);
--- a/web/html/support/javascript/hsbook.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-function qid(id) {
-  return id.replace(/([.:])/g, "\\$1");
-}
-
-function beforeComment(formData, jqForm, options) {
-  var form = jqForm[0];
-  if (!form.comment.value) {
-    $(options.target + " span.comment_error").empty().append(
-      "<span class=\"comment_error\">Your comment is empty</span>");
-    return false;
-  }
-  if (!form.name.value) {
-    $(options.target + " span.comment_error").empty().append(
-      "<span class=\"comment_error\">Please provide a name</span>");
-    return false;
-  }
-  $(options.target + " span.comment_error").empty().after(
-    "<img src=\"/support/icons/throbber.gif\" style=\"vertical-align: middle\"/>");
-  $(options.target + " input[@name=submit]").attr("disabled", true);
-}
-
-function ajaxifyForm(id) {
-  var q = qid(id);
-  
-  $("#form_" + q).ajaxForm({ beforeSubmit: beforeComment,
-			     success: function() { ajaxifyForm(id); },
-			     target: "#comments_" + q });
-}
-
-function toggleComment(id) {
-  $("#toggle_" + qid(id)).nextAll().toggle();
-  return false;
-}
-
-function loadComments(id) {
-  $("#comments_" + qid(id)).load(location.protocol + "//" + location.host +
-				 "/comments/single/" + id + "/", function() {
-    ajaxifyForm(id);
-  });
-  return false;
-}
-
-function loadAllComments() {
-  $("a.commenttoggle").each(function() {
-    var id = $(this).attr("pid");
-    if (id) {
-      loadComments(id);
-    }
-  });
-}
-
-$(document).ready(function() {
-  function loading(id) {
-    return " <span id=\"comments_" + id + "\" class=\"comment\">" +
-      "<span pid=\"" + id + "\" class=\"commenttoggle\">Loading..." +
-      "</span></span>";
-  }
-  $("div.toc>p")
-    .after("<p style='display: none;'><a onclick='return loadAllComments()'>" +
-	   "Load all comments (<b>slow</b>)</a></p>")
-    .toggle(function() { $(this).nextAll().show("normal"); },
-	    function() { $(this).nextAll().hide("normal"); })
-    .hover(function() { $(this).fadeTo("normal", 0.8); },
-	   function() { $(this).fadeTo("normal", 0.35); });
-  $(".chapter p[@id]").each(function() {
-    $(this).append(loading($(this).attr("id")));
-  });
-  $(".chapter table[@id].equation").each(function() {
-    id = $(this).attr("id");
-    $("#" + id + " tr").after('<tr><td colspan="4">' + loading($(this).attr("id")) + '</td></tr>');
-  });
-  $(".chapter pre[@id]").each(function() {
-    $(this).after(loading($(this).attr("id")));
-  });
-  var chapid = $("div.preface, div.chapter, div.appendix, div.bibliography").attr("id");
-  $("#chapterfeed").attr("href",
-			 $("#chapterfeed").attr("href") + chapid + "/");
-  $.getJSON(location.protocol + "//" + location.host + "/comments/chapter/" +
-	    chapid + "/count/", function(data) {
-    $.each(data, function(id, item) {
-      var s = item == 1 ? "" : "s";
-      $("#comments_" + qid(id) + " span.commenttoggle").replaceWith(
-        "<a class='commenttoggle' id='toggle_" + id + "' " +
-	"pid='" + id + "' " +
-	"onclick='return loadComments(\"" + id + "\")' " +
-	"href='comments: show / hide'>" + item + " comment" + s + "</a>");
-    });
-    $("span.commenttoggle").each(function() {
-      var id = $(this).attr("pid");
-      $(this).replaceWith("<a class='commenttoggle' id='toggle_" + id + "' " +
-			  "onclick='return loadComments(\"" + id + "\")' " +
-			  "href='comment: add'>No comments</a>");
-    });
-  });
-});
--- a/web/html/support/javascript/jquery-min.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
- * jQuery 1.2.1 - New Wave Javascript
- *
- * Copyright (c) 2007 John Resig (jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
- * $Rev: 3353 $
- */
-(function(){if(typeof jQuery!="undefined")var _jQuery=jQuery;var jQuery=window.jQuery=function(selector,context){return this instanceof jQuery?this.init(selector,context):new jQuery(selector,context);};if(typeof $!="undefined")var _$=$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(typeof selector=="string"){var m=quickExpr.exec(selector);if(m&&(m[1]||!context)){if(m[1])selector=jQuery.clean([m[1]],context);else{var tmp=document.getElementById(m[3]);if(tmp)if(tmp.id!=m[3])return jQuery().find(selector);else{this[0]=tmp;this.length=1;return this;}else
-selector=[];}}else
-return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.1",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(a){var ret=jQuery(a);ret.prevObject=this;return ret;},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this;},each:function(fn,args){return jQuery.each(this,fn,args);},index:function(obj){var pos=-1;this.each(function(i){if(this==obj)pos=i;});return pos;},attr:function(key,value,type){var obj=key;if(key.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],key)||undefined;else{obj={};obj[key]=value;}return this.each(function(index){for(var prop in obj)jQuery.attr(type?this.style:this,prop,jQuery.prop(this,obj[prop],type,index,prop));});},css:function(key,value){return this.attr(key,value,"curCSS");},text:function(e){if(typeof e!="object"&&e!=null)return this.empty().append(document.createTextNode(e));var t="";jQuery.each(e||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)t+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return t;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,1,function(a){this.appendChild(a);});},prepend:function(){return this.domManip(arguments,true,-1,function(a){this.insertBefore(a,this.firstChild);});},before:function(){return this.domManip(arguments,false,1,function(a){this.parentNode.insertBefore(a,this);});},after:function(){return this.domManip(arguments,false,-1,function(a){this.parentNode.insertBefore(a,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(t){var data=jQuery.map(this,function(a){return jQuery.find(t,a);});return this.pushStack(/[^+>] [^+>]/.test(t)||t.indexOf("..")>-1?jQuery.unique(data):data);},clone:function(events){var ret=this.map(function(){return this.outerHTML?jQuery(this.outerHTML)[0]:this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(t){return this.pushStack(jQuery.isFunction(t)&&jQuery.grep(this,function(el,index){return t.apply(el,[index]);})||jQuery.multiFilter(t,this));},not:function(t){return this.pushStack(t.constructor==String&&jQuery.multiFilter(t,this,true)||jQuery.grep(this,function(a){return(t.constructor==Array||t.jquery)?jQuery.inArray(a,t)<0:a!=t;}));},add:function(t){return this.pushStack(jQuery.merge(this.get(),t.constructor==String?jQuery(t).get():t.length!=undefined&&(!t.nodeName||jQuery.nodeName(t,"form"))?t:[t]));},is:function(expr){return expr?jQuery.multiFilter(expr,this).length>0:false;},hasClass:function(expr){return this.is("."+expr);},val:function(val){if(val==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,a=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){var val=jQuery.browser.msie&&!option.attributes["value"].specified?option.text:option.value;if(one)return val;a.push(val);}}return a;}else
-return this[0].value.replace(/\r/g,"");}}else
-return this.each(function(){if(val.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,val)>=0||jQuery.inArray(this.name,val)>=0);else if(jQuery.nodeName(this,"select")){var tmp=val.constructor==Array?val:[val];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,tmp)>=0||jQuery.inArray(this.text,tmp)>=0);});if(!tmp.length)this.selectedIndex=-1;}else
-this.value=val;});},html:function(val){return val==undefined?(this.length?this[0].innerHTML:null):this.empty().append(val);},replaceWith:function(val){return this.after(val).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(fn){return this.pushStack(jQuery.map(this,function(elem,i){return fn.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},domManip:function(args,table,dir,fn){var clone=this.length>1,a;return this.each(function(){if(!a){a=jQuery.clean(args,this.ownerDocument);if(dir<0)a.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(a[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(document.createElement("tbody"));jQuery.each(a,function(){var elem=clone?this.cloneNode(true):this;if(!evalScript(0,elem))fn.call(obj,elem);});});}};function evalScript(i,elem){var script=jQuery.nodeName(elem,"script");if(script){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
-jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}else if(elem.nodeType==1)jQuery("script",elem).each(evalScript);return script;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},a=1,al=arguments.length,deep=false;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};}if(al==1){target=this;a=0;}var prop;for(;a<al;a++)if((prop=arguments[a])!=null)for(var i in prop){if(target==prop[i])continue;if(deep&&typeof prop[i]=='object'&&target[i])jQuery.extend(target[i],prop[i]);else if(prop[i]!=undefined)target[i]=prop[i];}return target;};var expando="jQuery"+(new Date()).getTime(),uuid=0,win={};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/function/i.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){if(window.execScript)window.execScript(data);else if(jQuery.browser.safari)window.setTimeout(data,0);else
-eval.call(window,data);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?win:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!=undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?win:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(obj,fn,args){if(args){if(obj.length==undefined)for(var i in obj)fn.apply(obj[i],args);else
-for(var i=0,ol=obj.length;i<ol;i++)if(fn.apply(obj[i],args)===false)break;}else{if(obj.length==undefined)for(var i in obj)fn.call(obj[i],i,obj[i]);else
-for(var i=0,ol=obj.length,val=obj[0];i<ol&&fn.call(val,i,val)!==false;val=obj[++i]){}}return obj;},prop:function(elem,value,type,index,prop){if(jQuery.isFunction(value))value=value.call(elem,[index]);var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i;return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(prop)?value+"px":value;},className:{add:function(elem,c){jQuery.each((c||"").split(/\s+/),function(i,cur){if(!jQuery.className.has(elem.className,cur))elem.className+=(elem.className?" ":"")+cur;});},remove:function(elem,c){elem.className=c!=undefined?jQuery.grep(elem.className.split(/\s+/),function(cur){return!jQuery.className.has(c,cur);}).join(" "):"";},has:function(t,c){return jQuery.inArray(c,(t.className||t).toString().split(/\s+/))>-1;}},swap:function(e,o,f){for(var i in o){e.style["old"+i]=e.style[i];e.style[i]=o[i];}f.apply(e,[]);for(var i in o)e.style[i]=e.style["old"+i];},css:function(e,p){if(p=="height"||p=="width"){var old={},oHeight,oWidth,d=["Top","Bottom","Right","Left"];jQuery.each(d,function(){old["padding"+this]=0;old["border"+this+"Width"]=0;});jQuery.swap(e,old,function(){if(jQuery(e).is(':visible')){oHeight=e.offsetHeight;oWidth=e.offsetWidth;}else{e=jQuery(e.cloneNode(true)).find(":radio").removeAttr("checked").end().css({visibility:"hidden",position:"absolute",display:"block",right:"0",left:"0"}).appendTo(e.parentNode)[0];var parPos=jQuery.css(e.parentNode,"position")||"static";if(parPos=="static")e.parentNode.style.position="relative";oHeight=e.clientHeight;oWidth=e.clientWidth;if(parPos=="static")e.parentNode.style.position="static";e.parentNode.removeChild(e);}});return p=="height"?oHeight:oWidth;}return jQuery.curCSS(e,p);},curCSS:function(elem,prop,force){var ret,stack=[],swap=[];function color(a){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(a,null);return!ret||ret.getPropertyValue("color")=="";}if(prop=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(prop.match(/float/i))prop=styleFloat;if(!force&&elem.style[prop])ret=elem.style[prop];else if(document.defaultView&&document.defaultView.getComputedStyle){if(prop.match(/float/i))prop="float";prop=prop.replace(/([A-Z])/g,"-$1").toLowerCase();var cur=document.defaultView.getComputedStyle(elem,null);if(cur&&!color(elem))ret=cur.getPropertyValue(prop);else{for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(a=0;a<stack.length;a++)if(color(stack[a])){swap[a]=stack[a].style.display;stack[a].style.display="block";}ret=prop=="display"&&swap[stack.length-1]!=null?"none":document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop)||"";for(a=0;a<swap.length;a++)if(swap[a]!=null)stack[a].style.display=swap[a];}if(prop=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var newProp=prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});ret=elem.currentStyle[prop]||elem.currentStyle[newProp];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var style=elem.style.left;var runtimeStyle=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;elem.style.left=ret||0;ret=elem.style.pixelLeft+"px";elem.style.left=style;elem.runtimeStyle.left=runtimeStyle;}}return ret;},clean:function(a,doc){var r=[];doc=doc||document;jQuery.each(a,function(i,arg){if(!arg)return;if(arg.constructor==Number)arg=arg.toString();if(typeof arg=="string"){arg=arg.replace(/(<(\w+)[^>]*?)\/>/g,function(m,all,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)?m:all+"></"+tag+">";});var s=jQuery.trim(arg).toLowerCase(),div=doc.createElement("div"),tb=[];var wrap=!s.indexOf("<opt")&&[1,"<select>","</select>"]||!s.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||s.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!s.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!s.indexOf("<td")||!s.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!s.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+arg+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){if(!s.indexOf("<table")&&s.indexOf("<tbody")<0)tb=div.firstChild&&div.firstChild.childNodes;else if(wrap[1]=="<table>"&&s.indexOf("<tbody")<0)tb=div.childNodes;for(var n=tb.length-1;n>=0;--n)if(jQuery.nodeName(tb[n],"tbody")&&!tb[n].childNodes.length)tb[n].parentNode.removeChild(tb[n]);if(/^\s/.test(arg))div.insertBefore(doc.createTextNode(arg.match(/^\s*/)[0]),div.firstChild);}arg=jQuery.makeArray(div.childNodes);}if(0===arg.length&&(!jQuery.nodeName(arg,"form")&&!jQuery.nodeName(arg,"select")))return;if(arg[0]==undefined||jQuery.nodeName(arg,"form")||arg.options)r.push(arg);else
-r=jQuery.merge(r,arg);});return r;},attr:function(elem,name,value){var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(t){return(t||"").replace(/^\s+|\s+$/g,"");},makeArray:function(a){var r=[];if(typeof a!="array")for(var i=0,al=a.length;i<al;i++)r.push(a[i]);else
-r=a.slice(0);return r;},inArray:function(b,a){for(var i=0,al=a.length;i<al;i++)if(a[i]==b)return i;return-1;},merge:function(first,second){if(jQuery.browser.msie){for(var i=0;second[i];i++)if(second[i].nodeType!=8)first.push(second[i]);}else
-for(var i=0;second[i];i++)first.push(second[i]);return first;},unique:function(first){var r=[],done={};try{for(var i=0,fl=first.length;i<fl;i++){var id=jQuery.data(first[i]);if(!done[id]){done[id]=true;r.push(first[i]);}}}catch(e){r=first;}return r;},grep:function(elems,fn,inv){if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++)if(!inv&&fn(elems[i],i)||inv&&!fn(elems[i],i))result.push(elems[i]);return result;},map:function(elems,fn){if(typeof fn=="string")fn=eval("false||function(a){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++){var val=fn(elems[i],i);if(val!==null&&val!=undefined){if(val.constructor!=Array)val=[val];result=result.concat(val);}}return result;}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",styleFloat:jQuery.browser.msie?"styleFloat":"cssFloat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,innerHTML:"innerHTML",className:"className",value:"value",disabled:"disabled",checked:"checked",readonly:"readOnly",selected:"selected",maxlength:"maxLength"}});jQuery.each({parent:"a.parentNode",parents:"jQuery.dir(a,'parentNode')",next:"jQuery.nth(a,2,'nextSibling')",prev:"jQuery.nth(a,2,'previousSibling')",nextAll:"jQuery.dir(a,'nextSibling')",prevAll:"jQuery.dir(a,'previousSibling')",siblings:"jQuery.sibling(a.parentNode.firstChild,a)",children:"jQuery.sibling(a.firstChild)",contents:"jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"},function(i,n){jQuery.fn[i]=function(a){var ret=jQuery.map(this,n);if(a&&typeof a=="string")ret=jQuery.multiFilter(a,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(i,n){jQuery.fn[i]=function(){var a=arguments;return this.each(function(){for(var j=0,al=a.length;j<al;j++)jQuery(a[j])[n](this);});};});jQuery.each({removeAttr:function(key){jQuery.attr(this,key,"");this.removeAttribute(key);},addClass:function(c){jQuery.className.add(this,c);},removeClass:function(c){jQuery.className.remove(this,c);},toggleClass:function(c){jQuery.className[jQuery.className.has(this,c)?"remove":"add"](this,c);},remove:function(a){if(!a||jQuery.filter(a,[this]).r.length){jQuery.removeData(this);this.parentNode.removeChild(this);}},empty:function(){jQuery("*",this).each(function(){jQuery.removeData(this);});while(this.firstChild)this.removeChild(this.firstChild);}},function(i,n){jQuery.fn[i]=function(){return this.each(n,arguments);};});jQuery.each(["Height","Width"],function(i,name){var n=name.toLowerCase();jQuery.fn[n]=function(h){return this[0]==window?jQuery.browser.safari&&self["inner"+name]||jQuery.boxModel&&Math.max(document.documentElement["client"+name],document.body["client"+name])||document.body["client"+name]:this[0]==document?Math.max(document.body["scroll"+name],document.body["offset"+name]):h==undefined?(this.length?jQuery.css(this[0],n):null):this.css(n,h.constructor==String?h:h+"px");};});var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":"m[2]=='*'||jQuery.nodeName(a,m[2])","#":"a.getAttribute('id')==m[2]",":":{lt:"i<m[3]-0",gt:"i>m[3]-0",nth:"m[3]-0==i",eq:"m[3]-0==i",first:"i==0",last:"i==r.length-1",even:"i%2==0",odd:"i%2","first-child":"a.parentNode.getElementsByTagName('*')[0]==a","last-child":"jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a","only-child":"!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",parent:"a.firstChild",empty:"!a.firstChild",contains:"(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",visible:'"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',hidden:'"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',enabled:"!a.disabled",disabled:"a.disabled",checked:"a.checked",selected:"a.selected||jQuery.attr(a,'selected')",text:"'text'==a.type",radio:"'radio'==a.type",checkbox:"'checkbox'==a.type",file:"'file'==a.type",password:"'password'==a.type",submit:"'submit'==a.type",image:"'image'==a.type",reset:"'reset'==a.type",button:'"button"==a.type||jQuery.nodeName(a,"button")',input:"/input|select|textarea|button/i.test(a.nodeName)",has:"jQuery.find(m[3],a).length",header:"/h\\d/i.test(a.nodeName)",animated:"jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&!context.nodeType)context=null;context=context||document;var ret=[context],done=[],last;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){var nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName.toUpperCase()))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var nodeName=m[2],merge={};m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName.toUpperCase()){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=jQuery.filter(m[3],r,true).r;else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(\d*)n\+?(\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"n+"+m[3]||m[3]),first=(test[1]||1)-0,last=test[2]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==1){if(last==0||node.nodeIndex==last)add=true;}else if((node.nodeIndex+last)%first==0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var f=jQuery.expr[m[1]];if(typeof f!="string")f=jQuery.expr[m[1]][m[2]];f=eval("false||function(a,i){return "+f+"}");r=jQuery.grep(r,f,not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(element,type,handler,data){if(jQuery.browser.msie&&element.setInterval!=undefined)element=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var parts=type.split(".");type=parts[0];handler.type=parts[1];var events=jQuery.data(element,"events")||jQuery.data(element,"events",{});var handle=jQuery.data(element,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(element,arguments);return val;});var handlers=events[type];if(!handlers){handlers=events[type]={};if(element.addEventListener)element.addEventListener(type,handle,false);else
-element.attachEvent("on"+type,handle);}handlers[handler.guid]=handler;this.global[type]=true;},guid:1,global:{},remove:function(element,type,handler){var events=jQuery.data(element,"events"),ret,index;if(typeof type=="string"){var parts=type.split(".");type=parts[0];}if(events){if(type&&type.type){handler=type.handler;type=type.type;}if(!type){for(type in events)this.remove(element,type);}else if(events[type]){if(handler)delete events[type][handler.guid];else
-for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(element.removeEventListener)element.removeEventListener(type,jQuery.data(element,"handle"),false);else
-element.detachEvent("on"+type,jQuery.data(element,"handle"));ret=null;delete events[type];}}for(ret in events)break;if(!ret){jQuery.removeData(element,"events");jQuery.removeData(element,"handle");}}},trigger:function(type,data,element,donative,extra){data=jQuery.makeArray(data||[]);if(!element){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{var val,ret,fn=jQuery.isFunction(element[type]||null),evt=!data[0]||!data[0].preventDefault;if(evt)data.unshift(this.fix({type:type,target:element}));data[0].type=type;if(jQuery.isFunction(jQuery.data(element,"handle")))val=jQuery.data(element,"handle").apply(element,data);if(!fn&&element["on"+type]&&element["on"+type].apply(element,data)===false)val=false;if(evt)data.shift();if(extra&&extra.apply(element,data)===false)val=false;if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(element,'a')&&type=="click")){this.triggered=true;element[type]();}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var c=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in c){args[0].handler=c[j];args[0].data=c[j].data;if(!parts[1]||c[j].type==parts[1]){var tmp=c[j].apply(this,args);if(val!==false)val=tmp;if(tmp===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target&&event.srcElement)event.target=event.srcElement;if(jQuery.browser.safari&&event.target.nodeType==3)event.target=originalEvent.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var e=document.documentElement,b=document.body;event.pageX=event.clientX+(e&&e.scrollLeft||b.scrollLeft||0);event.pageY=event.clientY+(e&&e.scrollTop||b.scrollTop||0);}if(!event.which&&(event.charCode||event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(){var a=arguments;return this.click(function(e){this.lastToggle=0==this.lastToggle?1:0;e.preventDefault();return a[this.lastToggle].apply(this,[e])||false;});},hover:function(f,g){function handleHover(e){var p=e.relatedTarget;while(p&&p!=this)try{p=p.parentNode;}catch(e){p=this;};if(p==this)return false;return(e.type=="mouseover"?f:g).apply(this,[e]);}return this.mouseover(handleHover).mouseout(handleHover);},ready:function(f){bindReady();if(jQuery.isReady)f.apply(document,[jQuery]);else
-jQuery.readyList.push(function(){return f.apply(this,[jQuery]);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}if(jQuery.browser.mozilla||jQuery.browser.opera)document.removeEventListener("DOMContentLoaded",jQuery.ready,false);if(!window.frames.length)jQuery(window).load(function(){jQuery("#__ie_init").remove();});}}});jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,o){jQuery.fn[o]=function(f){return f?this.bind(o,f):this.trigger(o);};});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(jQuery.browser.mozilla||jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);else if(jQuery.browser.msie){document.write("<scr"+"ipt id=__ie_init defer=true "+"src=//:><\/script>");var script=document.getElementById("__ie_init");if(script)script.onreadystatechange=function(){if(this.readyState!="complete")return;jQuery.ready();};script=null;}else if(jQuery.browser.safari)jQuery.safariTimer=setInterval(function(){if(document.readyState=="loaded"||document.readyState=="complete"){clearInterval(jQuery.safariTimer);jQuery.safariTimer=null;jQuery.ready();}},10);jQuery.event.add(window,"load",jQuery.ready);}jQuery.fn.extend({load:function(url,params,callback){if(jQuery.isFunction(url))return this.bind("load",url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);setTimeout(function(){self.each(callback,[res.responseText,status,res]);},13);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null},lastModified:{},ajax:function(s){var jsonp,jsre=/=(\?|%3F)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=s.data.replace(jsre,"="+jsonp);s.url=s.url.replace(jsre,"="+jsonp);s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get")s.url+=(s.url.match(/\?/)?"&":"?")+"_="+(new Date()).getTime();if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if(!s.url.indexOf("http")&&s.dataType=="script"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(!jsonp&&(s.success||s.complete)){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async);if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
-jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();return xml;function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
-for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
-s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock?this.oldblock:"";if(jQuery.css(this,"display")=="none")this.style.display="block";}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");if(this.oldblock=="none")this.oldblock="block";this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var opt=jQuery.speed(speed,easing,callback);return this[opt.queue===false?"each":"queue"](function(){opt=jQuery.extend({},opt);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
-e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(){var timers=jQuery.timers;return this.each(function(){for(var i=0;i<timers.length;i++)if(timers[i].elem==this)timers.splice(i--,1);}).dequeue();}});var queue=function(elem,type,array){if(!elem)return;var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.curCSS(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.css(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(){return self.step();}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timers.length==1){var timer=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length)clearInterval(timer);},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(){var t=(new Date()).getTime();if(t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var absolute=jQuery.css(elem,"position")=="absolute",parent=elem.parentNode,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522;if(elem.getBoundingClientRect){box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));if(msie){var border=jQuery("html").css("borderWidth");border=(border=="medium"||jQuery.boxModel&&parseInt(version)>=7)&&2||border;add(-border,-border);}}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&/^t[d|h]$/i.test(parent.tagName)||!safari2)border(offsetParent);if(safari2&&!absolute&&jQuery.css(offsetParent,"position")=="absolute")absolute=true;offsetParent=offsetParent.offsetParent;}while(parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table-row.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if(safari2&&absolute)add(-doc.body.offsetLeft,-doc.body.offsetTop);}results={top:top,left:left};}return results;function border(elem){add(jQuery.css(elem,"borderLeftWidth"),jQuery.css(elem,"borderTopWidth"));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}};})();
\ No newline at end of file
--- a/web/html/support/javascript/jquery.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2992 +0,0 @@
-(function(){
-/*
- * jQuery 1.2.1 - New Wave Javascript
- *
- * Copyright (c) 2007 John Resig (jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
- * $Rev: 3353 $
- */
-
-// Map over jQuery in case of overwrite
-if ( typeof jQuery != "undefined" )
-	var _jQuery = jQuery;
-
-var jQuery = window.jQuery = function(selector, context) {
-	// If the context is a namespace object, return a new object
-	return this instanceof jQuery ?
-		this.init(selector, context) :
-		new jQuery(selector, context);
-};
-
-// Map over the $ in case of overwrite
-if ( typeof $ != "undefined" )
-	var _$ = $;
-	
-// Map the jQuery namespace to the '$' one
-window.$ = jQuery;
-
-var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;
-
-jQuery.fn = jQuery.prototype = {
-	init: function(selector, context) {
-		// Make sure that a selection was provided
-		selector = selector || document;
-
-		// Handle HTML strings
-		if ( typeof selector  == "string" ) {
-			var m = quickExpr.exec(selector);
-			if ( m && (m[1] || !context) ) {
-				// HANDLE: $(html) -> $(array)
-				if ( m[1] )
-					selector = jQuery.clean( [ m[1] ], context );
-
-				// HANDLE: $("#id")
-				else {
-					var tmp = document.getElementById( m[3] );
-					if ( tmp )
-						// Handle the case where IE and Opera return items
-						// by name instead of ID
-						if ( tmp.id != m[3] )
-							return jQuery().find( selector );
-						else {
-							this[0] = tmp;
-							this.length = 1;
-							return this;
-						}
-					else
-						selector = [];
-				}
-
-			// HANDLE: $(expr)
-			} else
-				return new jQuery( context ).find( selector );
-
-		// HANDLE: $(function)
-		// Shortcut for document ready
-		} else if ( jQuery.isFunction(selector) )
-			return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( selector );
-
-		return this.setArray(
-			// HANDLE: $(array)
-			selector.constructor == Array && selector ||
-
-			// HANDLE: $(arraylike)
-			// Watch for when an array-like object is passed as the selector
-			(selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) ||
-
-			// HANDLE: $(*)
-			[ selector ] );
-	},
-	
-	jquery: "1.2.1",
-
-	size: function() {
-		return this.length;
-	},
-	
-	length: 0,
-
-	get: function( num ) {
-		return num == undefined ?
-
-			// Return a 'clean' array
-			jQuery.makeArray( this ) :
-
-			// Return just the object
-			this[num];
-	},
-	
-	pushStack: function( a ) {
-		var ret = jQuery(a);
-		ret.prevObject = this;
-		return ret;
-	},
-	
-	setArray: function( a ) {
-		this.length = 0;
-		Array.prototype.push.apply( this, a );
-		return this;
-	},
-
-	each: function( fn, args ) {
-		return jQuery.each( this, fn, args );
-	},
-
-	index: function( obj ) {
-		var pos = -1;
-		this.each(function(i){
-			if ( this == obj ) pos = i;
-		});
-		return pos;
-	},
-
-	attr: function( key, value, type ) {
-		var obj = key;
-		
-		// Look for the case where we're accessing a style value
-		if ( key.constructor == String )
-			if ( value == undefined )
-				return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined;
-			else {
-				obj = {};
-				obj[ key ] = value;
-			}
-		
-		// Check to see if we're setting style values
-		return this.each(function(index){
-			// Set all the styles
-			for ( var prop in obj )
-				jQuery.attr(
-					type ? this.style : this,
-					prop, jQuery.prop(this, obj[prop], type, index, prop)
-				);
-		});
-	},
-
-	css: function( key, value ) {
-		return this.attr( key, value, "curCSS" );
-	},
-
-	text: function(e) {
-		if ( typeof e != "object" && e != null )
-			return this.empty().append( document.createTextNode( e ) );
-
-		var t = "";
-		jQuery.each( e || this, function(){
-			jQuery.each( this.childNodes, function(){
-				if ( this.nodeType != 8 )
-					t += this.nodeType != 1 ?
-						this.nodeValue : jQuery.fn.text([ this ]);
-			});
-		});
-		return t;
-	},
-
-	wrapAll: function(html) {
-		if ( this[0] )
-			// The elements to wrap the target around
-			jQuery(html, this[0].ownerDocument)
-				.clone()
-				.insertBefore(this[0])
-				.map(function(){
-					var elem = this;
-					while ( elem.firstChild )
-						elem = elem.firstChild;
-					return elem;
-				})
-				.append(this);
-
-		return this;
-	},
-
-	wrapInner: function(html) {
-		return this.each(function(){
-			jQuery(this).contents().wrapAll(html);
-		});
-	},
-
-	wrap: function(html) {
-		return this.each(function(){
-			jQuery(this).wrapAll(html);
-		});
-	},
-
-	append: function() {
-		return this.domManip(arguments, true, 1, function(a){
-			this.appendChild( a );
-		});
-	},
-
-	prepend: function() {
-		return this.domManip(arguments, true, -1, function(a){
-			this.insertBefore( a, this.firstChild );
-		});
-	},
-	
-	before: function() {
-		return this.domManip(arguments, false, 1, function(a){
-			this.parentNode.insertBefore( a, this );
-		});
-	},
-
-	after: function() {
-		return this.domManip(arguments, false, -1, function(a){
-			this.parentNode.insertBefore( a, this.nextSibling );
-		});
-	},
-
-	end: function() {
-		return this.prevObject || jQuery([]);
-	},
-
-	find: function(t) {
-		var data = jQuery.map(this, function(a){ return jQuery.find(t,a); });
-		return this.pushStack( /[^+>] [^+>]/.test( t ) || t.indexOf("..") > -1 ?
-			jQuery.unique( data ) : data );
-	},
-
-	clone: function(events) {
-		// Do the clone
-		var ret = this.map(function(){
-			return this.outerHTML ? jQuery(this.outerHTML)[0] : this.cloneNode(true);
-		});
-
-		// Need to set the expando to null on the cloned set if it exists
-		// removeData doesn't work here, IE removes it from the original as well
-		// this is primarily for IE but the data expando shouldn't be copied over in any browser
-		var clone = ret.find("*").andSelf().each(function(){
-			if ( this[ expando ] != undefined )
-				this[ expando ] = null;
-		});
-		
-		// Copy the events from the original to the clone
-		if (events === true)
-			this.find("*").andSelf().each(function(i) {
-				var events = jQuery.data(this, "events");
-				for ( var type in events )
-					for ( var handler in events[type] )
-						jQuery.event.add(clone[i], type, events[type][handler], events[type][handler].data);
-			});
-
-		// Return the cloned set
-		return ret;
-	},
-
-	filter: function(t) {
-		return this.pushStack(
-			jQuery.isFunction( t ) &&
-			jQuery.grep(this, function(el, index){
-				return t.apply(el, [index]);
-			}) ||
-
-			jQuery.multiFilter(t,this) );
-	},
-
-	not: function(t) {
-		return this.pushStack(
-			t.constructor == String &&
-			jQuery.multiFilter(t, this, true) ||
-
-			jQuery.grep(this, function(a) {
-				return ( t.constructor == Array || t.jquery )
-					? jQuery.inArray( a, t ) < 0
-					: a != t;
-			})
-		);
-	},
-
-	add: function(t) {
-		return this.pushStack( jQuery.merge(
-			this.get(),
-			t.constructor == String ?
-				jQuery(t).get() :
-				t.length != undefined && (!t.nodeName || jQuery.nodeName(t, "form")) ?
-					t : [t] )
-		);
-	},
-
-	is: function(expr) {
-		return expr ? jQuery.multiFilter(expr,this).length > 0 : false;
-	},
-
-	hasClass: function(expr) {
-		return this.is("." + expr);
-	},
-	
-	val: function( val ) {
-		if ( val == undefined ) {
-			if ( this.length ) {
-				var elem = this[0];
-		    	
-				// We need to handle select boxes special
-				if ( jQuery.nodeName(elem, "select") ) {
-					var index = elem.selectedIndex,
-						a = [],
-						options = elem.options,
-						one = elem.type == "select-one";
-					
-					// Nothing was selected
-					if ( index < 0 )
-						return null;
-
-					// Loop through all the selected options
-					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
-						var option = options[i];
-						if ( option.selected ) {
-							// Get the specifc value for the option
-							var val = jQuery.browser.msie && !option.attributes["value"].specified ? option.text : option.value;
-							
-							// We don't need an array for one selects
-							if ( one )
-								return val;
-							
-							// Multi-Selects return an array
-							a.push(val);
-						}
-					}
-					
-					return a;
-					
-				// Everything else, we just grab the value
-				} else
-					return this[0].value.replace(/\r/g, "");
-			}
-		} else
-			return this.each(function(){
-				if ( val.constructor == Array && /radio|checkbox/.test(this.type) )
-					this.checked = (jQuery.inArray(this.value, val) >= 0 ||
-						jQuery.inArray(this.name, val) >= 0);
-				else if ( jQuery.nodeName(this, "select") ) {
-					var tmp = val.constructor == Array ? val : [val];
-
-					jQuery("option", this).each(function(){
-						this.selected = (jQuery.inArray(this.value, tmp) >= 0 ||
-						jQuery.inArray(this.text, tmp) >= 0);
-					});
-
-					if ( !tmp.length )
-						this.selectedIndex = -1;
-				} else
-					this.value = val;
-			});
-	},
-	
-	html: function( val ) {
-		return val == undefined ?
-			( this.length ? this[0].innerHTML : null ) :
-			this.empty().append( val );
-	},
-
-	replaceWith: function( val ) {
-		return this.after( val ).remove();
-	},
-
-	eq: function(i){
-		return this.slice(i, i+1);
-	},
-
-	slice: function() {
-		return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
-	},
-
-	map: function(fn) {
-		return this.pushStack(jQuery.map( this, function(elem,i){
-			return fn.call( elem, i, elem );
-		}));
-	},
-
-	andSelf: function() {
-		return this.add( this.prevObject );
-	},
-	
-	domManip: function(args, table, dir, fn) {
-		var clone = this.length > 1, a; 
-
-		return this.each(function(){
-			if ( !a ) {
-				a = jQuery.clean(args, this.ownerDocument);
-				if ( dir < 0 )
-					a.reverse();
-			}
-
-			var obj = this;
-
-			if ( table && jQuery.nodeName(this, "table") && jQuery.nodeName(a[0], "tr") )
-				obj = this.getElementsByTagName("tbody")[0] || this.appendChild(document.createElement("tbody"));
-
-			jQuery.each( a, function(){
-				var elem = clone ? this.cloneNode(true) : this;
-				if ( !evalScript(0, elem) )
-					fn.call( obj, elem );
-			});
-		});
-	}
-};
-
-function evalScript(i, elem){
-	var script = jQuery.nodeName(elem, "script");
-
-	if ( script ) {
-		if ( elem.src )
-			jQuery.ajax({ url: elem.src, async: false, dataType: "script" });
-		else
-			jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
-	
-		if ( elem.parentNode )
-			elem.parentNode.removeChild(elem);
-
-	} else if ( elem.nodeType == 1 )
-    jQuery("script", elem).each(evalScript);
-
-	return script;
-}
-
-jQuery.extend = jQuery.fn.extend = function() {
-	// copy reference to target object
-	var target = arguments[0] || {}, a = 1, al = arguments.length, deep = false;
-
-	// Handle a deep copy situation
-	if ( target.constructor == Boolean ) {
-		deep = target;
-		target = arguments[1] || {};
-	}
-
-	// extend jQuery itself if only one argument is passed
-	if ( al == 1 ) {
-		target = this;
-		a = 0;
-	}
-
-	var prop;
-
-	for ( ; a < al; a++ )
-		// Only deal with non-null/undefined values
-		if ( (prop = arguments[a]) != null )
-			// Extend the base object
-			for ( var i in prop ) {
-				// Prevent never-ending loop
-				if ( target == prop[i] )
-					continue;
-
-				// Recurse if we're merging object values
-				if ( deep && typeof prop[i] == 'object' && target[i] )
-					jQuery.extend( target[i], prop[i] );
-
-				// Don't bring in undefined values
-				else if ( prop[i] != undefined )
-					target[i] = prop[i];
-			}
-
-	// Return the modified object
-	return target;
-};
-
-var expando = "jQuery" + (new Date()).getTime(), uuid = 0, win = {};
-
-jQuery.extend({
-	noConflict: function(deep) {
-		window.$ = _$;
-		if ( deep )
-			window.jQuery = _jQuery;
-		return jQuery;
-	},
-
-	// This may seem like some crazy code, but trust me when I say that this
-	// is the only cross-browser way to do this. --John
-	isFunction: function( fn ) {
-		return !!fn && typeof fn != "string" && !fn.nodeName && 
-			fn.constructor != Array && /function/i.test( fn + "" );
-	},
-	
-	// check if an element is in a XML document
-	isXMLDoc: function(elem) {
-		return elem.documentElement && !elem.body ||
-			elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
-	},
-
-	// Evalulates a script in a global context
-	// Evaluates Async. in Safari 2 :-(
-	globalEval: function( data ) {
-		data = jQuery.trim( data );
-		if ( data ) {
-			if ( window.execScript )
-				window.execScript( data );
-			else if ( jQuery.browser.safari )
-				// safari doesn't provide a synchronous global eval
-				window.setTimeout( data, 0 );
-			else
-				eval.call( window, data );
-		}
-	},
-
-	nodeName: function( elem, name ) {
-		return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
-	},
-	
-	cache: {},
-	
-	data: function( elem, name, data ) {
-		elem = elem == window ? win : elem;
-
-		var id = elem[ expando ];
-
-		// Compute a unique ID for the element
-		if ( !id ) 
-			id = elem[ expando ] = ++uuid;
-
-		// Only generate the data cache if we're
-		// trying to access or manipulate it
-		if ( name && !jQuery.cache[ id ] )
-			jQuery.cache[ id ] = {};
-		
-		// Prevent overriding the named cache with undefined values
-		if ( data != undefined )
-			jQuery.cache[ id ][ name ] = data;
-		
-		// Return the named cache data, or the ID for the element	
-		return name ? jQuery.cache[ id ][ name ] : id;
-	},
-	
-	removeData: function( elem, name ) {
-		elem = elem == window ? win : elem;
-
-		var id = elem[ expando ];
-
-		// If we want to remove a specific section of the element's data
-		if ( name ) {
-			if ( jQuery.cache[ id ] ) {
-				// Remove the section of cache data
-				delete jQuery.cache[ id ][ name ];
-
-				// If we've removed all the data, remove the element's cache
-				name = "";
-				for ( name in jQuery.cache[ id ] ) break;
-				if ( !name )
-					jQuery.removeData( elem );
-			}
-
-		// Otherwise, we want to remove all of the element's data
-		} else {
-			// Clean up the element expando
-			try {
-				delete elem[ expando ];
-			} catch(e){
-				// IE has trouble directly removing the expando
-				// but it's ok with using removeAttribute
-				if ( elem.removeAttribute )
-					elem.removeAttribute( expando );
-			}
-
-			// Completely remove the data cache
-			delete jQuery.cache[ id ];
-		}
-	},
-
-	// args is for internal usage only
-	each: function( obj, fn, args ) {
-		if ( args ) {
-			if ( obj.length == undefined )
-				for ( var i in obj )
-					fn.apply( obj[i], args );
-			else
-				for ( var i = 0, ol = obj.length; i < ol; i++ )
-					if ( fn.apply( obj[i], args ) === false ) break;
-
-		// A special, fast, case for the most common use of each
-		} else {
-			if ( obj.length == undefined )
-				for ( var i in obj )
-					fn.call( obj[i], i, obj[i] );
-			else
-				for ( var i = 0, ol = obj.length, val = obj[0]; 
-					i < ol && fn.call(val,i,val) !== false; val = obj[++i] ){}
-		}
-
-		return obj;
-	},
-	
-	prop: function(elem, value, type, index, prop){
-			// Handle executable functions
-			if ( jQuery.isFunction( value ) )
-				value = value.call( elem, [index] );
-				
-			// exclude the following css properties to add px
-			var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
-
-			// Handle passing in a number to a CSS property
-			return value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) ?
-				value + "px" :
-				value;
-	},
-
-	className: {
-		// internal only, use addClass("class")
-		add: function( elem, c ){
-			jQuery.each( (c || "").split(/\s+/), function(i, cur){
-				if ( !jQuery.className.has( elem.className, cur ) )
-					elem.className += ( elem.className ? " " : "" ) + cur;
-			});
-		},
-
-		// internal only, use removeClass("class")
-		remove: function( elem, c ){
-			elem.className = c != undefined ?
-				jQuery.grep( elem.className.split(/\s+/), function(cur){
-					return !jQuery.className.has( c, cur );	
-				}).join(" ") : "";
-		},
-
-		// internal only, use is(".class")
-		has: function( t, c ) {
-			return jQuery.inArray( c, (t.className || t).toString().split(/\s+/) ) > -1;
-		}
-	},
-
-	swap: function(e,o,f) {
-		for ( var i in o ) {
-			e.style["old"+i] = e.style[i];
-			e.style[i] = o[i];
-		}
-		f.apply( e, [] );
-		for ( var i in o )
-			e.style[i] = e.style["old"+i];
-	},
-
-	css: function(e,p) {
-		if ( p == "height" || p == "width" ) {
-			var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"];
-
-			jQuery.each( d, function(){
-				old["padding" + this] = 0;
-				old["border" + this + "Width"] = 0;
-			});
-
-			jQuery.swap( e, old, function() {
-				if ( jQuery(e).is(':visible') ) {
-					oHeight = e.offsetHeight;
-					oWidth = e.offsetWidth;
-				} else {
-					e = jQuery(e.cloneNode(true))
-						.find(":radio").removeAttr("checked").end()
-						.css({
-							visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0"
-						}).appendTo(e.parentNode)[0];
-
-					var parPos = jQuery.css(e.parentNode,"position") || "static";
-					if ( parPos == "static" )
-						e.parentNode.style.position = "relative";
-
-					oHeight = e.clientHeight;
-					oWidth = e.clientWidth;
-
-					if ( parPos == "static" )
-						e.parentNode.style.position = "static";
-
-					e.parentNode.removeChild(e);
-				}
-			});
-
-			return p == "height" ? oHeight : oWidth;
-		}
-
-		return jQuery.curCSS( e, p );
-	},
-
-	curCSS: function(elem, prop, force) {
-		var ret, stack = [], swap = [];
-
-		// A helper method for determining if an element's values are broken
-		function color(a){
-			if ( !jQuery.browser.safari )
-				return false;
-
-			var ret = document.defaultView.getComputedStyle(a,null);
-			return !ret || ret.getPropertyValue("color") == "";
-		}
-
-		if (prop == "opacity" && jQuery.browser.msie) {
-			ret = jQuery.attr(elem.style, "opacity");
-			return ret == "" ? "1" : ret;
-		}
-		
-		if (prop.match(/float/i))
-			prop = styleFloat;
-
-		if (!force && elem.style[prop])
-			ret = elem.style[prop];
-
-		else if (document.defaultView && document.defaultView.getComputedStyle) {
-
-			if (prop.match(/float/i))
-				prop = "float";
-
-			prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase();
-			var cur = document.defaultView.getComputedStyle(elem, null);
-
-			if ( cur && !color(elem) )
-				ret = cur.getPropertyValue(prop);
-
-			// If the element isn't reporting its values properly in Safari
-			// then some display: none elements are involved
-			else {
-				// Locate all of the parent display: none elements
-				for ( var a = elem; a && color(a); a = a.parentNode )
-					stack.unshift(a);
-
-				// Go through and make them visible, but in reverse
-				// (It would be better if we knew the exact display type that they had)
-				for ( a = 0; a < stack.length; a++ )
-					if ( color(stack[a]) ) {
-						swap[a] = stack[a].style.display;
-						stack[a].style.display = "block";
-					}
-
-				// Since we flip the display style, we have to handle that
-				// one special, otherwise get the value
-				ret = prop == "display" && swap[stack.length-1] != null ?
-					"none" :
-					document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop) || "";
-
-				// Finally, revert the display styles back
-				for ( a = 0; a < swap.length; a++ )
-					if ( swap[a] != null )
-						stack[a].style.display = swap[a];
-			}
-
-			if ( prop == "opacity" && ret == "" )
-				ret = "1";
-
-		} else if (elem.currentStyle) {
-			var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});
-			ret = elem.currentStyle[prop] || elem.currentStyle[newProp];
-
-			// From the awesome hack by Dean Edwards
-			// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
-			// If we're not dealing with a regular pixel number
-			// but a number that has a weird ending, we need to convert it to pixels
-			if ( !/^\d+(px)?$/i.test(ret) && /^\d/.test(ret) ) {
-				var style = elem.style.left;
-				var runtimeStyle = elem.runtimeStyle.left;
-				elem.runtimeStyle.left = elem.currentStyle.left;
-				elem.style.left = ret || 0;
-				ret = elem.style.pixelLeft + "px";
-				elem.style.left = style;
-				elem.runtimeStyle.left = runtimeStyle;
-			}
-		}
-
-		return ret;
-	},
-	
-	clean: function(a, doc) {
-		var r = [];
-		doc = doc || document;
-
-		jQuery.each( a, function(i,arg){
-			if ( !arg ) return;
-
-			if ( arg.constructor == Number )
-				arg = arg.toString();
-			
-			// Convert html string into DOM nodes
-			if ( typeof arg == "string" ) {
-				// Fix "XHTML"-style tags in all browsers
-				arg = arg.replace(/(<(\w+)[^>]*?)\/>/g, function(m, all, tag){
-					return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)? m : all+"></"+tag+">";
-				});
-
-				// Trim whitespace, otherwise indexOf won't work as expected
-				var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = [];
-
-				var wrap =
-					// option or optgroup
-					!s.indexOf("<opt") &&
-					[1, "<select>", "</select>"] ||
-					
-					!s.indexOf("<leg") &&
-					[1, "<fieldset>", "</fieldset>"] ||
-					
-					s.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
-					[1, "<table>", "</table>"] ||
-					
-					!s.indexOf("<tr") &&
-					[2, "<table><tbody>", "</tbody></table>"] ||
-					
-				 	// <thead> matched above
-					(!s.indexOf("<td") || !s.indexOf("<th")) &&
-					[3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
-					
-					!s.indexOf("<col") &&
-					[2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] ||
-
-					// IE can't serialize <link> and <script> tags normally
-					jQuery.browser.msie &&
-					[1, "div<div>", "</div>"] ||
-					
-					[0,"",""];
-
-				// Go to html and back, then peel off extra wrappers
-				div.innerHTML = wrap[1] + arg + wrap[2];
-				
-				// Move to the right depth
-				while ( wrap[0]-- )
-					div = div.lastChild;
-				
-				// Remove IE's autoinserted <tbody> from table fragments
-				if ( jQuery.browser.msie ) {
-					
-					// String was a <table>, *may* have spurious <tbody>
-					if ( !s.indexOf("<table") && s.indexOf("<tbody") < 0 ) 
-						tb = div.firstChild && div.firstChild.childNodes;
-						
-					// String was a bare <thead> or <tfoot>
-					else if ( wrap[1] == "<table>" && s.indexOf("<tbody") < 0 )
-						tb = div.childNodes;
-
-					for ( var n = tb.length-1; n >= 0 ; --n )
-						if ( jQuery.nodeName(tb[n], "tbody") && !tb[n].childNodes.length )
-							tb[n].parentNode.removeChild(tb[n]);
-	
-					// IE completely kills leading whitespace when innerHTML is used	
-					if ( /^\s/.test(arg) )	
-						div.insertBefore( doc.createTextNode( arg.match(/^\s*/)[0] ), div.firstChild );
-
-				}
-				
-				arg = jQuery.makeArray( div.childNodes );
-			}
-
-			if ( 0 === arg.length && (!jQuery.nodeName(arg, "form") && !jQuery.nodeName(arg, "select")) )
-				return;
-
-			if ( arg[0] == undefined || jQuery.nodeName(arg, "form") || arg.options )
-				r.push( arg );
-			else
-				r = jQuery.merge( r, arg );
-
-		});
-
-		return r;
-	},
-	
-	attr: function(elem, name, value){
-		var fix = jQuery.isXMLDoc(elem) ? {} : jQuery.props;
-
-		// Safari mis-reports the default selected property of a hidden option
-		// Accessing the parent's selectedIndex property fixes it
-		if ( name == "selected" && jQuery.browser.safari )
-			elem.parentNode.selectedIndex;
-		
-		// Certain attributes only work when accessed via the old DOM 0 way
-		if ( fix[name] ) {
-			if ( value != undefined ) elem[fix[name]] = value;
-			return elem[fix[name]];
-		} else if ( jQuery.browser.msie && name == "style" )
-			return jQuery.attr( elem.style, "cssText", value );
-
-		else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName(elem, "form") && (name == "action" || name == "method") )
-			return elem.getAttributeNode(name).nodeValue;
-
-		// IE elem.getAttribute passes even for style
-		else if ( elem.tagName ) {
-
-			if ( value != undefined ) {
-				if ( name == "type" && jQuery.nodeName(elem,"input") && elem.parentNode )
-					throw "type property can't be changed";
-				elem.setAttribute( name, value );
-			}
-
-			if ( jQuery.browser.msie && /href|src/.test(name) && !jQuery.isXMLDoc(elem) ) 
-				return elem.getAttribute( name, 2 );
-
-			return elem.getAttribute( name );
-
-		// elem is actually elem.style ... set the style
-		} else {
-			// IE actually uses filters for opacity
-			if ( name == "opacity" && jQuery.browser.msie ) {
-				if ( value != undefined ) {
-					// IE has trouble with opacity if it does not have layout
-					// Force it by setting the zoom level
-					elem.zoom = 1; 
-	
-					// Set the alpha filter to set the opacity
-					elem.filter = (elem.filter || "").replace(/alpha\([^)]*\)/,"") +
-						(parseFloat(value).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
-				}
-	
-				return elem.filter ? 
-					(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100).toString() : "";
-			}
-			name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});
-			if ( value != undefined ) elem[name] = value;
-			return elem[name];
-		}
-	},
-	
-	trim: function(t){
-		return (t||"").replace(/^\s+|\s+$/g, "");
-	},
-
-	makeArray: function( a ) {
-		var r = [];
-
-		// Need to use typeof to fight Safari childNodes crashes
-		if ( typeof a != "array" )
-			for ( var i = 0, al = a.length; i < al; i++ )
-				r.push( a[i] );
-		else
-			r = a.slice( 0 );
-
-		return r;
-	},
-
-	inArray: function( b, a ) {
-		for ( var i = 0, al = a.length; i < al; i++ )
-			if ( a[i] == b )
-				return i;
-		return -1;
-	},
-
-	merge: function(first, second) {
-		// We have to loop this way because IE & Opera overwrite the length
-		// expando of getElementsByTagName
-
-		// Also, we need to make sure that the correct elements are being returned
-		// (IE returns comment nodes in a '*' query)
-		if ( jQuery.browser.msie ) {
-			for ( var i = 0; second[i]; i++ )
-				if ( second[i].nodeType != 8 )
-					first.push(second[i]);
-		} else
-			for ( var i = 0; second[i]; i++ )
-				first.push(second[i]);
-
-		return first;
-	},
-
-	unique: function(first) {
-		var r = [], done = {};
-
-		try {
-			for ( var i = 0, fl = first.length; i < fl; i++ ) {
-				var id = jQuery.data(first[i]);
-				if ( !done[id] ) {
-					done[id] = true;
-					r.push(first[i]);
-				}
-			}
-		} catch(e) {
-			r = first;
-		}
-
-		return r;
-	},
-
-	grep: function(elems, fn, inv) {
-		// If a string is passed in for the function, make a function
-		// for it (a handy shortcut)
-		if ( typeof fn == "string" )
-			fn = eval("false||function(a,i){return " + fn + "}");
-
-		var result = [];
-
-		// Go through the array, only saving the items
-		// that pass the validator function
-		for ( var i = 0, el = elems.length; i < el; i++ )
-			if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )
-				result.push( elems[i] );
-
-		return result;
-	},
-
-	map: function(elems, fn) {
-		// If a string is passed in for the function, make a function
-		// for it (a handy shortcut)
-		if ( typeof fn == "string" )
-			fn = eval("false||function(a){return " + fn + "}");
-
-		var result = [];
-
-		// Go through the array, translating each of the items to their
-		// new value (or values).
-		for ( var i = 0, el = elems.length; i < el; i++ ) {
-			var val = fn(elems[i],i);
-
-			if ( val !== null && val != undefined ) {
-				if ( val.constructor != Array ) val = [val];
-				result = result.concat( val );
-			}
-		}
-
-		return result;
-	}
-});
-
-var userAgent = navigator.userAgent.toLowerCase();
-
-// Figure out what browser is being used
-jQuery.browser = {
-	version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
-	safari: /webkit/.test(userAgent),
-	opera: /opera/.test(userAgent),
-	msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
-	mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
-};
-
-var styleFloat = jQuery.browser.msie ? "styleFloat" : "cssFloat";
-	
-jQuery.extend({
-	// Check to see if the W3C box model is being used
-	boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",
-	
-	styleFloat: jQuery.browser.msie ? "styleFloat" : "cssFloat",
-	
-	props: {
-		"for": "htmlFor",
-		"class": "className",
-		"float": styleFloat,
-		cssFloat: styleFloat,
-		styleFloat: styleFloat,
-		innerHTML: "innerHTML",
-		className: "className",
-		value: "value",
-		disabled: "disabled",
-		checked: "checked",
-		readonly: "readOnly",
-		selected: "selected",
-		maxlength: "maxLength"
-	}
-});
-
-jQuery.each({
-	parent: "a.parentNode",
-	parents: "jQuery.dir(a,'parentNode')",
-	next: "jQuery.nth(a,2,'nextSibling')",
-	prev: "jQuery.nth(a,2,'previousSibling')",
-	nextAll: "jQuery.dir(a,'nextSibling')",
-	prevAll: "jQuery.dir(a,'previousSibling')",
-	siblings: "jQuery.sibling(a.parentNode.firstChild,a)",
-	children: "jQuery.sibling(a.firstChild)",
-	contents: "jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"
-}, function(i,n){
-	jQuery.fn[ i ] = function(a) {
-		var ret = jQuery.map(this,n);
-		if ( a && typeof a == "string" )
-			ret = jQuery.multiFilter(a,ret);
-		return this.pushStack( jQuery.unique(ret) );
-	};
-});
-
-jQuery.each({
-	appendTo: "append",
-	prependTo: "prepend",
-	insertBefore: "before",
-	insertAfter: "after",
-	replaceAll: "replaceWith"
-}, function(i,n){
-	jQuery.fn[ i ] = function(){
-		var a = arguments;
-		return this.each(function(){
-			for ( var j = 0, al = a.length; j < al; j++ )
-				jQuery(a[j])[n]( this );
-		});
-	};
-});
-
-jQuery.each( {
-	removeAttr: function( key ) {
-		jQuery.attr( this, key, "" );
-		this.removeAttribute( key );
-	},
-	addClass: function(c){
-		jQuery.className.add(this,c);
-	},
-	removeClass: function(c){
-		jQuery.className.remove(this,c);
-	},
-	toggleClass: function( c ){
-		jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this, c);
-	},
-	remove: function(a){
-		if ( !a || jQuery.filter( a, [this] ).r.length ) {
-			jQuery.removeData( this );
-			this.parentNode.removeChild( this );
-		}
-	},
-	empty: function() {
-		// Clean up the cache
-		jQuery("*", this).each(function(){ jQuery.removeData(this); });
-
-		while ( this.firstChild )
-			this.removeChild( this.firstChild );
-	}
-}, function(i,n){
-	jQuery.fn[ i ] = function() {
-		return this.each( n, arguments );
-	};
-});
-
-jQuery.each( [ "Height", "Width" ], function(i,name){
-	var n = name.toLowerCase();
-	
-	jQuery.fn[ n ] = function(h) {
-		return this[0] == window ?
-			jQuery.browser.safari && self["inner" + name] ||
-			jQuery.boxModel && Math.max(document.documentElement["client" + name], document.body["client" + name]) ||
-			document.body["client" + name] :
-		
-			this[0] == document ?
-				Math.max( document.body["scroll" + name], document.body["offset" + name] ) :
-        
-				h == undefined ?
-					( this.length ? jQuery.css( this[0], n ) : null ) :
-					this.css( n, h.constructor == String ? h : h + "px" );
-	};
-});
-
-var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
-		"(?:[\\w*_-]|\\\\.)" :
-		"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
-	quickChild = new RegExp("^>\\s*(" + chars + "+)"),
-	quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
-	quickClass = new RegExp("^([#.]?)(" + chars + "*)");
-
-jQuery.extend({
-	expr: {
-		"": "m[2]=='*'||jQuery.nodeName(a,m[2])",
-		"#": "a.getAttribute('id')==m[2]",
-		":": {
-			// Position Checks
-			lt: "i<m[3]-0",
-			gt: "i>m[3]-0",
-			nth: "m[3]-0==i",
-			eq: "m[3]-0==i",
-			first: "i==0",
-			last: "i==r.length-1",
-			even: "i%2==0",
-			odd: "i%2",
-
-			// Child Checks
-			"first-child": "a.parentNode.getElementsByTagName('*')[0]==a",
-			"last-child": "jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a",
-			"only-child": "!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",
-
-			// Parent Checks
-			parent: "a.firstChild",
-			empty: "!a.firstChild",
-
-			// Text Check
-			contains: "(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",
-
-			// Visibility
-			visible: '"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',
-			hidden: '"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',
-
-			// Form attributes
-			enabled: "!a.disabled",
-			disabled: "a.disabled",
-			checked: "a.checked",
-			selected: "a.selected||jQuery.attr(a,'selected')",
-
-			// Form elements
-			text: "'text'==a.type",
-			radio: "'radio'==a.type",
-			checkbox: "'checkbox'==a.type",
-			file: "'file'==a.type",
-			password: "'password'==a.type",
-			submit: "'submit'==a.type",
-			image: "'image'==a.type",
-			reset: "'reset'==a.type",
-			button: '"button"==a.type||jQuery.nodeName(a,"button")',
-			input: "/input|select|textarea|button/i.test(a.nodeName)",
-
-			// :has()
-			has: "jQuery.find(m[3],a).length",
-
-			// :header
-			header: "/h\\d/i.test(a.nodeName)",
-
-			// :animated
-			animated: "jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"
-		}
-	},
-	
-	// The regular expressions that power the parsing engine
-	parse: [
-		// Match: [@value='test'], [@foo]
-		/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,
-
-		// Match: :contains('foo')
-		/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,
-
-		// Match: :even, :last-chlid, #id, .class
-		new RegExp("^([:.#]*)(" + chars + "+)")
-	],
-
-	multiFilter: function( expr, elems, not ) {
-		var old, cur = [];
-
-		while ( expr && expr != old ) {
-			old = expr;
-			var f = jQuery.filter( expr, elems, not );
-			expr = f.t.replace(/^\s*,\s*/, "" );
-			cur = not ? elems = f.r : jQuery.merge( cur, f.r );
-		}
-
-		return cur;
-	},
-
-	find: function( t, context ) {
-		// Quickly handle non-string expressions
-		if ( typeof t != "string" )
-			return [ t ];
-
-		// Make sure that the context is a DOM Element
-		if ( context && !context.nodeType )
-			context = null;
-
-		// Set the correct context (if none is provided)
-		context = context || document;
-
-		// Initialize the search
-		var ret = [context], done = [], last;
-
-		// Continue while a selector expression exists, and while
-		// we're no longer looping upon ourselves
-		while ( t && last != t ) {
-			var r = [];
-			last = t;
-
-			t = jQuery.trim(t);
-
-			var foundToken = false;
-
-			// An attempt at speeding up child selectors that
-			// point to a specific element tag
-			var re = quickChild;
-			var m = re.exec(t);
-
-			if ( m ) {
-				var nodeName = m[1].toUpperCase();
-
-				// Perform our own iteration and filter
-				for ( var i = 0; ret[i]; i++ )
-					for ( var c = ret[i].firstChild; c; c = c.nextSibling )
-						if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName.toUpperCase()) )
-							r.push( c );
-
-				ret = r;
-				t = t.replace( re, "" );
-				if ( t.indexOf(" ") == 0 ) continue;
-				foundToken = true;
-			} else {
-				re = /^([>+~])\s*(\w*)/i;
-
-				if ( (m = re.exec(t)) != null ) {
-					r = [];
-
-					var nodeName = m[2], merge = {};
-					m = m[1];
-
-					for ( var j = 0, rl = ret.length; j < rl; j++ ) {
-						var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
-						for ( ; n; n = n.nextSibling )
-							if ( n.nodeType == 1 ) {
-								var id = jQuery.data(n);
-
-								if ( m == "~" && merge[id] ) break;
-								
-								if (!nodeName || n.nodeName.toUpperCase() == nodeName.toUpperCase() ) {
-									if ( m == "~" ) merge[id] = true;
-									r.push( n );
-								}
-								
-								if ( m == "+" ) break;
-							}
-					}
-
-					ret = r;
-
-					// And remove the token
-					t = jQuery.trim( t.replace( re, "" ) );
-					foundToken = true;
-				}
-			}
-
-			// See if there's still an expression, and that we haven't already
-			// matched a token
-			if ( t && !foundToken ) {
-				// Handle multiple expressions
-				if ( !t.indexOf(",") ) {
-					// Clean the result set
-					if ( context == ret[0] ) ret.shift();
-
-					// Merge the result sets
-					done = jQuery.merge( done, ret );
-
-					// Reset the context
-					r = ret = [context];
-
-					// Touch up the selector string
-					t = " " + t.substr(1,t.length);
-
-				} else {
-					// Optimize for the case nodeName#idName
-					var re2 = quickID;
-					var m = re2.exec(t);
-					
-					// Re-organize the results, so that they're consistent
-					if ( m ) {
-					   m = [ 0, m[2], m[3], m[1] ];
-
-					} else {
-						// Otherwise, do a traditional filter check for
-						// ID, class, and element selectors
-						re2 = quickClass;
-						m = re2.exec(t);
-					}
-
-					m[2] = m[2].replace(/\\/g, "");
-
-					var elem = ret[ret.length-1];
-
-					// Try to do a global search by ID, where we can
-					if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
-						// Optimization for HTML document case
-						var oid = elem.getElementById(m[2]);
-						
-						// Do a quick check for the existence of the actual ID attribute
-						// to avoid selecting by the name attribute in IE
-						// also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
-						if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
-							oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
-
-						// Do a quick check for node name (where applicable) so
-						// that div#foo searches will be really fast
-						ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
-					} else {
-						// We need to find all descendant elements
-						for ( var i = 0; ret[i]; i++ ) {
-							// Grab the tag name being searched for
-							var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];
-
-							// Handle IE7 being really dumb about <object>s
-							if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
-								tag = "param";
-
-							r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
-						}
-
-						// It's faster to filter by class and be done with it
-						if ( m[1] == "." )
-							r = jQuery.classFilter( r, m[2] );
-
-						// Same with ID filtering
-						if ( m[1] == "#" ) {
-							var tmp = [];
-
-							// Try to find the element with the ID
-							for ( var i = 0; r[i]; i++ )
-								if ( r[i].getAttribute("id") == m[2] ) {
-									tmp = [ r[i] ];
-									break;
-								}
-
-							r = tmp;
-						}
-
-						ret = r;
-					}
-
-					t = t.replace( re2, "" );
-				}
-
-			}
-
-			// If a selector string still exists
-			if ( t ) {
-				// Attempt to filter it
-				var val = jQuery.filter(t,r);
-				ret = r = val.r;
-				t = jQuery.trim(val.t);
-			}
-		}
-
-		// An error occurred with the selector;
-		// just return an empty set instead
-		if ( t )
-			ret = [];
-
-		// Remove the root context
-		if ( ret && context == ret[0] )
-			ret.shift();
-
-		// And combine the results
-		done = jQuery.merge( done, ret );
-
-		return done;
-	},
-
-	classFilter: function(r,m,not){
-		m = " " + m + " ";
-		var tmp = [];
-		for ( var i = 0; r[i]; i++ ) {
-			var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
-			if ( !not && pass || not && !pass )
-				tmp.push( r[i] );
-		}
-		return tmp;
-	},
-
-	filter: function(t,r,not) {
-		var last;
-
-		// Look for common filter expressions
-		while ( t  && t != last ) {
-			last = t;
-
-			var p = jQuery.parse, m;
-
-			for ( var i = 0; p[i]; i++ ) {
-				m = p[i].exec( t );
-
-				if ( m ) {
-					// Remove what we just matched
-					t = t.substring( m[0].length );
-
-					m[2] = m[2].replace(/\\/g, "");
-					break;
-				}
-			}
-
-			if ( !m )
-				break;
-
-			// :not() is a special case that can be optimized by
-			// keeping it out of the expression list
-			if ( m[1] == ":" && m[2] == "not" )
-				r = jQuery.filter(m[3], r, true).r;
-
-			// We can get a big speed boost by filtering by class here
-			else if ( m[1] == "." )
-				r = jQuery.classFilter(r, m[2], not);
-
-			else if ( m[1] == "[" ) {
-				var tmp = [], type = m[3];
-				
-				for ( var i = 0, rl = r.length; i < rl; i++ ) {
-					var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
-					
-					if ( z == null || /href|src|selected/.test(m[2]) )
-						z = jQuery.attr(a,m[2]) || '';
-
-					if ( (type == "" && !!z ||
-						 type == "=" && z == m[5] ||
-						 type == "!=" && z != m[5] ||
-						 type == "^=" && z && !z.indexOf(m[5]) ||
-						 type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
-						 (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
-							tmp.push( a );
-				}
-				
-				r = tmp;
-
-			// We can get a speed boost by handling nth-child here
-			} else if ( m[1] == ":" && m[2] == "nth-child" ) {
-				var merge = {}, tmp = [],
-					test = /(\d*)n\+?(\d*)/.exec(
-						m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
-						!/\D/.test(m[3]) && "n+" + m[3] || m[3]),
-					first = (test[1] || 1) - 0, last = test[2] - 0;
-
-				for ( var i = 0, rl = r.length; i < rl; i++ ) {
-					var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);
-
-					if ( !merge[id] ) {
-						var c = 1;
-
-						for ( var n = parentNode.firstChild; n; n = n.nextSibling )
-							if ( n.nodeType == 1 )
-								n.nodeIndex = c++;
-
-						merge[id] = true;
-					}
-
-					var add = false;
-
-					if ( first == 1 ) {
-						if ( last == 0 || node.nodeIndex == last )
-							add = true;
-					} else if ( (node.nodeIndex + last) % first == 0 )
-						add = true;
-
-					if ( add ^ not )
-						tmp.push( node );
-				}
-
-				r = tmp;
-
-			// Otherwise, find the expression to execute
-			} else {
-				var f = jQuery.expr[m[1]];
-				if ( typeof f != "string" )
-					f = jQuery.expr[m[1]][m[2]];
-
-				// Build a custom macro to enclose it
-				f = eval("false||function(a,i){return " + f + "}");
-
-				// Execute it against the current filter
-				r = jQuery.grep( r, f, not );
-			}
-		}
-
-		// Return an array of filtered elements (r)
-		// and the modified expression string (t)
-		return { r: r, t: t };
-	},
-
-	dir: function( elem, dir ){
-		var matched = [];
-		var cur = elem[dir];
-		while ( cur && cur != document ) {
-			if ( cur.nodeType == 1 )
-				matched.push( cur );
-			cur = cur[dir];
-		}
-		return matched;
-	},
-	
-	nth: function(cur,result,dir,elem){
-		result = result || 1;
-		var num = 0;
-
-		for ( ; cur; cur = cur[dir] )
-			if ( cur.nodeType == 1 && ++num == result )
-				break;
-
-		return cur;
-	},
-	
-	sibling: function( n, elem ) {
-		var r = [];
-
-		for ( ; n; n = n.nextSibling ) {
-			if ( n.nodeType == 1 && (!elem || n != elem) )
-				r.push( n );
-		}
-
-		return r;
-	}
-});
-/*
- * A number of helper functions used for managing events.
- * Many of the ideas behind this code orignated from 
- * Dean Edwards' addEvent library.
- */
-jQuery.event = {
-
-	// Bind an event to an element
-	// Original by Dean Edwards
-	add: function(element, type, handler, data) {
-		// For whatever reason, IE has trouble passing the window object
-		// around, causing it to be cloned in the process
-		if ( jQuery.browser.msie && element.setInterval != undefined )
-			element = window;
-
-		// Make sure that the function being executed has a unique ID
-		if ( !handler.guid )
-			handler.guid = this.guid++;
-			
-		// if data is passed, bind to handler 
-		if( data != undefined ) { 
-        		// Create temporary function pointer to original handler 
-			var fn = handler; 
-
-			// Create unique handler function, wrapped around original handler 
-			handler = function() { 
-				// Pass arguments and context to original handler 
-				return fn.apply(this, arguments); 
-			};
-
-			// Store data in unique handler 
-			handler.data = data;
-
-			// Set the guid of unique handler to the same of original handler, so it can be removed 
-			handler.guid = fn.guid;
-		}
-
-		// Namespaced event handlers
-		var parts = type.split(".");
-		type = parts[0];
-		handler.type = parts[1];
-
-		// Init the element's event structure
-		var events = jQuery.data(element, "events") || jQuery.data(element, "events", {});
-		
-		var handle = jQuery.data(element, "handle", function(){
-			// returned undefined or false
-			var val;
-
-			// Handle the second event of a trigger and when
-			// an event is called after a page has unloaded
-			if ( typeof jQuery == "undefined" || jQuery.event.triggered )
-				return val;
-			
-			val = jQuery.event.handle.apply(element, arguments);
-			
-			return val;
-		});
-
-		// Get the current list of functions bound to this event
-		var handlers = events[type];
-
-		// Init the event handler queue
-		if (!handlers) {
-			handlers = events[type] = {};	
-			
-			// And bind the global event handler to the element
-			if (element.addEventListener)
-				element.addEventListener(type, handle, false);
-			else
-				element.attachEvent("on" + type, handle);
-		}
-
-		// Add the function to the element's handler list
-		handlers[handler.guid] = handler;
-
-		// Keep track of which events have been used, for global triggering
-		this.global[type] = true;
-	},
-
-	guid: 1,
-	global: {},
-
-	// Detach an event or set of events from an element
-	remove: function(element, type, handler) {
-		var events = jQuery.data(element, "events"), ret, index;
-
-		// Namespaced event handlers
-		if ( typeof type == "string" ) {
-			var parts = type.split(".");
-			type = parts[0];
-		}
-
-		if ( events ) {
-			// type is actually an event object here
-			if ( type && type.type ) {
-				handler = type.handler;
-				type = type.type;
-			}
-			
-			if ( !type ) {
-				for ( type in events )
-					this.remove( element, type );
-
-			} else if ( events[type] ) {
-				// remove the given handler for the given type
-				if ( handler )
-					delete events[type][handler.guid];
-				
-				// remove all handlers for the given type
-				else
-					for ( handler in events[type] )
-						// Handle the removal of namespaced events
-						if ( !parts[1] || events[type][handler].type == parts[1] )
-							delete events[type][handler];
-
-				// remove generic event handler if no more handlers exist
-				for ( ret in events[type] ) break;
-				if ( !ret ) {
-					if (element.removeEventListener)
-						element.removeEventListener(type, jQuery.data(element, "handle"), false);
-					else
-						element.detachEvent("on" + type, jQuery.data(element, "handle"));
-					ret = null;
-					delete events[type];
-				}
-			}
-
-			// Remove the expando if it's no longer used
-			for ( ret in events ) break;
-			if ( !ret ) {
-				jQuery.removeData( element, "events" );
-				jQuery.removeData( element, "handle" );
-			}
-		}
-	},
-
-	trigger: function(type, data, element, donative, extra) {
-		// Clone the incoming data, if any
-		data = jQuery.makeArray(data || []);
-
-		// Handle a global trigger
-		if ( !element ) {
-			// Only trigger if we've ever bound an event for it
-			if ( this.global[type] )
-				jQuery("*").add([window, document]).trigger(type, data);
-
-		// Handle triggering a single element
-		} else {
-			var val, ret, fn = jQuery.isFunction( element[ type ] || null ),
-				// Check to see if we need to provide a fake event, or not
-				evt = !data[0] || !data[0].preventDefault;
-			
-			// Pass along a fake event
-			if ( evt )
-				data.unshift( this.fix({ type: type, target: element }) );
-
-			// Enforce the right trigger type
-			data[0].type = type;
-
-			// Trigger the event
-			if ( jQuery.isFunction( jQuery.data(element, "handle") ) )
-				val = jQuery.data(element, "handle").apply( element, data );
-
-			// Handle triggering native .onfoo handlers
-			if ( !fn && element["on"+type] && element["on"+type].apply( element, data ) === false )
-				val = false;
-
-			// Extra functions don't get the custom event object
-			if ( evt )
-				data.shift();
-
-			// Handle triggering of extra function
-			if ( extra && extra.apply( element, data ) === false )
-				val = false;
-
-			// Trigger the native events (except for clicks on links)
-			if ( fn && donative !== false && val !== false && !(jQuery.nodeName(element, 'a') && type == "click") ) {
-				this.triggered = true;
-				element[ type ]();
-			}
-
-			this.triggered = false;
-		}
-
-		return val;
-	},
-
-	handle: function(event) {
-		// returned undefined or false
-		var val;
-
-		// Empty object is for triggered events with no data
-		event = jQuery.event.fix( event || window.event || {} ); 
-
-		// Namespaced event handlers
-		var parts = event.type.split(".");
-		event.type = parts[0];
-
-		var c = jQuery.data(this, "events") && jQuery.data(this, "events")[event.type], args = Array.prototype.slice.call( arguments, 1 );
-		args.unshift( event );
-
-		for ( var j in c ) {
-			// Pass in a reference to the handler function itself
-			// So that we can later remove it
-			args[0].handler = c[j];
-			args[0].data = c[j].data;
-
-			// Filter the functions by class
-			if ( !parts[1] || c[j].type == parts[1] ) {
-				var tmp = c[j].apply( this, args );
-
-				if ( val !== false )
-					val = tmp;
-
-				if ( tmp === false ) {
-					event.preventDefault();
-					event.stopPropagation();
-				}
-			}
-		}
-
-		// Clean up added properties in IE to prevent memory leak
-		if (jQuery.browser.msie)
-			event.target = event.preventDefault = event.stopPropagation =
-				event.handler = event.data = null;
-
-		return val;
-	},
-
-	fix: function(event) {
-		// store a copy of the original event object 
-		// and clone to set read-only properties
-		var originalEvent = event;
-		event = jQuery.extend({}, originalEvent);
-		
-		// add preventDefault and stopPropagation since 
-		// they will not work on the clone
-		event.preventDefault = function() {
-			// if preventDefault exists run it on the original event
-			if (originalEvent.preventDefault)
-				originalEvent.preventDefault();
-			// otherwise set the returnValue property of the original event to false (IE)
-			originalEvent.returnValue = false;
-		};
-		event.stopPropagation = function() {
-			// if stopPropagation exists run it on the original event
-			if (originalEvent.stopPropagation)
-				originalEvent.stopPropagation();
-			// otherwise set the cancelBubble property of the original event to true (IE)
-			originalEvent.cancelBubble = true;
-		};
-		
-		// Fix target property, if necessary
-		if ( !event.target && event.srcElement )
-			event.target = event.srcElement;
-				
-		// check if target is a textnode (safari)
-		if (jQuery.browser.safari && event.target.nodeType == 3)
-			event.target = originalEvent.target.parentNode;
-
-		// Add relatedTarget, if necessary
-		if ( !event.relatedTarget && event.fromElement )
-			event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
-
-		// Calculate pageX/Y if missing and clientX/Y available
-		if ( event.pageX == null && event.clientX != null ) {
-			var e = document.documentElement, b = document.body;
-			event.pageX = event.clientX + (e && e.scrollLeft || b.scrollLeft || 0);
-			event.pageY = event.clientY + (e && e.scrollTop || b.scrollTop || 0);
-		}
-			
-		// Add which for key events
-		if ( !event.which && (event.charCode || event.keyCode) )
-			event.which = event.charCode || event.keyCode;
-		
-		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
-		if ( !event.metaKey && event.ctrlKey )
-			event.metaKey = event.ctrlKey;
-
-		// Add which for click: 1 == left; 2 == middle; 3 == right
-		// Note: button is not normalized, so don't use it
-		if ( !event.which && event.button )
-			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
-			
-		return event;
-	}
-};
-
-jQuery.fn.extend({
-	bind: function( type, data, fn ) {
-		return type == "unload" ? this.one(type, data, fn) : this.each(function(){
-			jQuery.event.add( this, type, fn || data, fn && data );
-		});
-	},
-	
-	one: function( type, data, fn ) {
-		return this.each(function(){
-			jQuery.event.add( this, type, function(event) {
-				jQuery(this).unbind(event);
-				return (fn || data).apply( this, arguments);
-			}, fn && data);
-		});
-	},
-
-	unbind: function( type, fn ) {
-		return this.each(function(){
-			jQuery.event.remove( this, type, fn );
-		});
-	},
-
-	trigger: function( type, data, fn ) {
-		return this.each(function(){
-			jQuery.event.trigger( type, data, this, true, fn );
-		});
-	},
-
-	triggerHandler: function( type, data, fn ) {
-		if ( this[0] )
-			return jQuery.event.trigger( type, data, this[0], false, fn );
-	},
-
-	toggle: function() {
-		// Save reference to arguments for access in closure
-		var a = arguments;
-
-		return this.click(function(e) {
-			// Figure out which function to execute
-			this.lastToggle = 0 == this.lastToggle ? 1 : 0;
-			
-			// Make sure that clicks stop
-			e.preventDefault();
-			
-			// and execute the function
-			return a[this.lastToggle].apply( this, [e] ) || false;
-		});
-	},
-
-	hover: function(f,g) {
-		
-		// A private function for handling mouse 'hovering'
-		function handleHover(e) {
-			// Check if mouse(over|out) are still within the same parent element
-			var p = e.relatedTarget;
-	
-			// Traverse up the tree
-			while ( p && p != this ) try { p = p.parentNode; } catch(e) { p = this; };
-			
-			// If we actually just moused on to a sub-element, ignore it
-			if ( p == this ) return false;
-			
-			// Execute the right function
-			return (e.type == "mouseover" ? f : g).apply(this, [e]);
-		}
-		
-		// Bind the function to the two event listeners
-		return this.mouseover(handleHover).mouseout(handleHover);
-	},
-	
-	ready: function(f) {
-		// Attach the listeners
-		bindReady();
-
-		// If the DOM is already ready
-		if ( jQuery.isReady )
-			// Execute the function immediately
-			f.apply( document, [jQuery] );
-			
-		// Otherwise, remember the function for later
-		else
-			// Add the function to the wait list
-			jQuery.readyList.push( function() { return f.apply(this, [jQuery]); } );
-	
-		return this;
-	}
-});
-
-jQuery.extend({
-	/*
-	 * All the code that makes DOM Ready work nicely.
-	 */
-	isReady: false,
-	readyList: [],
-	
-	// Handle when the DOM is ready
-	ready: function() {
-		// Make sure that the DOM is not already loaded
-		if ( !jQuery.isReady ) {
-			// Remember that the DOM is ready
-			jQuery.isReady = true;
-			
-			// If there are functions bound, to execute
-			if ( jQuery.readyList ) {
-				// Execute all of them
-				jQuery.each( jQuery.readyList, function(){
-					this.apply( document );
-				});
-				
-				// Reset the list of functions
-				jQuery.readyList = null;
-			}
-			// Remove event listener to avoid memory leak
-			if ( jQuery.browser.mozilla || jQuery.browser.opera )
-				document.removeEventListener( "DOMContentLoaded", jQuery.ready, false );
-			
-			// Remove script element used by IE hack
-			if( !window.frames.length ) // don't remove if frames are present (#1187)
-				jQuery(window).load(function(){ jQuery("#__ie_init").remove(); });
-		}
-	}
-});
-
-jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
-	"mousedown,mouseup,mousemove,mouseover,mouseout,change,select," + 
-	"submit,keydown,keypress,keyup,error").split(","), function(i,o){
-	
-	// Handle event binding
-	jQuery.fn[o] = function(f){
-		return f ? this.bind(o, f) : this.trigger(o);
-	};
-});
-
-var readyBound = false;
-
-function bindReady(){
-	if ( readyBound ) return;
-	readyBound = true;
-
-	// If Mozilla is used
-	if ( jQuery.browser.mozilla || jQuery.browser.opera )
-		// Use the handy event callback
-		document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
-	
-	// If IE is used, use the excellent hack by Matthias Miller
-	// http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited
-	else if ( jQuery.browser.msie ) {
-	
-		// Only works if you document.write() it
-		document.write("<scr" + "ipt id=__ie_init defer=true " + 
-			"src=//:><\/script>");
-	
-		// Use the defer script hack
-		var script = document.getElementById("__ie_init");
-		
-		// script does not exist if jQuery is loaded dynamically
-		if ( script ) 
-			script.onreadystatechange = function() {
-				if ( this.readyState != "complete" ) return;
-				jQuery.ready();
-			};
-	
-		// Clear from memory
-		script = null;
-	
-	// If Safari  is used
-	} else if ( jQuery.browser.safari )
-		// Continually check to see if the document.readyState is valid
-		jQuery.safariTimer = setInterval(function(){
-			// loaded and complete are both valid states
-			if ( document.readyState == "loaded" || 
-				document.readyState == "complete" ) {
-	
-				// If either one are found, remove the timer
-				clearInterval( jQuery.safariTimer );
-				jQuery.safariTimer = null;
-	
-				// and execute any waiting functions
-				jQuery.ready();
-			}
-		}, 10); 
-
-	// A fallback to window.onload, that will always work
-	jQuery.event.add( window, "load", jQuery.ready );
-}
-jQuery.fn.extend({
-	load: function( url, params, callback ) {
-		if ( jQuery.isFunction( url ) )
-			return this.bind("load", url);
-
-		var off = url.indexOf(" ");
-		if ( off >= 0 ) {
-			var selector = url.slice(off, url.length);
-			url = url.slice(0, off);
-		}
-
-		callback = callback || function(){};
-
-		// Default to a GET request
-		var type = "GET";
-
-		// If the second parameter was provided
-		if ( params )
-			// If it's a function
-			if ( jQuery.isFunction( params ) ) {
-				// We assume that it's the callback
-				callback = params;
-				params = null;
-
-			// Otherwise, build a param string
-			} else {
-				params = jQuery.param( params );
-				type = "POST";
-			}
-
-		var self = this;
-
-		// Request the remote document
-		jQuery.ajax({
-			url: url,
-			type: type,
-			data: params,
-			complete: function(res, status){
-				// If successful, inject the HTML into all the matched elements
-				if ( status == "success" || status == "notmodified" )
-					// See if a selector was specified
-					self.html( selector ?
-						// Create a dummy div to hold the results
-						jQuery("<div/>")
-							// inject the contents of the document in, removing the scripts
-							// to avoid any 'Permission Denied' errors in IE
-							.append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
-
-							// Locate the specified elements
-							.find(selector) :
-
-						// If not, just inject the full result
-						res.responseText );
-
-				// Add delay to account for Safari's delay in globalEval
-				setTimeout(function(){
-					self.each( callback, [res.responseText, status, res] );
-				}, 13);
-			}
-		});
-		return this;
-	},
-
-	serialize: function() {
-		return jQuery.param(this.serializeArray());
-	},
-	serializeArray: function() {
-		return this.map(function(){
-			return jQuery.nodeName(this, "form") ?
-				jQuery.makeArray(this.elements) : this;
-		})
-		.filter(function(){
-			return this.name && !this.disabled && 
-				(this.checked || /select|textarea/i.test(this.nodeName) || 
-					/text|hidden|password/i.test(this.type));
-		})
-		.map(function(i, elem){
-			var val = jQuery(this).val();
-			return val == null ? null :
-				val.constructor == Array ?
-					jQuery.map( val, function(val, i){
-						return {name: elem.name, value: val};
-					}) :
-					{name: elem.name, value: val};
-		}).get();
-	}
-});
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
-	jQuery.fn[o] = function(f){
-		return this.bind(o, f);
-	};
-});
-
-var jsc = (new Date).getTime();
-
-jQuery.extend({
-	get: function( url, data, callback, type ) {
-		// shift arguments if data argument was ommited
-		if ( jQuery.isFunction( data ) ) {
-			callback = data;
-			data = null;
-		}
-		
-		return jQuery.ajax({
-			type: "GET",
-			url: url,
-			data: data,
-			success: callback,
-			dataType: type
-		});
-	},
-
-	getScript: function( url, callback ) {
-		return jQuery.get(url, null, callback, "script");
-	},
-
-	getJSON: function( url, data, callback ) {
-		return jQuery.get(url, data, callback, "json");
-	},
-
-	post: function( url, data, callback, type ) {
-		if ( jQuery.isFunction( data ) ) {
-			callback = data;
-			data = {};
-		}
-
-		return jQuery.ajax({
-			type: "POST",
-			url: url,
-			data: data,
-			success: callback,
-			dataType: type
-		});
-	},
-
-	ajaxSetup: function( settings ) {
-		jQuery.extend( jQuery.ajaxSettings, settings );
-	},
-
-	ajaxSettings: {
-		global: true,
-		type: "GET",
-		timeout: 0,
-		contentType: "application/x-www-form-urlencoded",
-		processData: true,
-		async: true,
-		data: null
-	},
-	
-	// Last-Modified header cache for next request
-	lastModified: {},
-
-	ajax: function( s ) {
-		var jsonp, jsre = /=(\?|%3F)/g, status, data;
-
-		// Extend the settings, but re-extend 's' so that it can be
-		// checked again later (in the test suite, specifically)
-		s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
-
-		// convert data if not already a string
-		if ( s.data && s.processData && typeof s.data != "string" )
-			s.data = jQuery.param(s.data);
-
-		// Handle JSONP Parameter Callbacks
-		if ( s.dataType == "jsonp" ) {
-			if ( s.type.toLowerCase() == "get" ) {
-				if ( !s.url.match(jsre) )
-					s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
-			} else if ( !s.data || !s.data.match(jsre) )
-				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
-			s.dataType = "json";
-		}
-
-		// Build temporary JSONP function
-		if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
-			jsonp = "jsonp" + jsc++;
-
-			// Replace the =? sequence both in the query string and the data
-			if ( s.data )
-				s.data = s.data.replace(jsre, "=" + jsonp);
-			s.url = s.url.replace(jsre, "=" + jsonp);
-
-			// We need to make sure
-			// that a JSONP style response is executed properly
-			s.dataType = "script";
-
-			// Handle JSONP-style loading
-			window[ jsonp ] = function(tmp){
-				data = tmp;
-				success();
-				complete();
-				// Garbage collect
-				window[ jsonp ] = undefined;
-				try{ delete window[ jsonp ]; } catch(e){}
-			};
-		}
-
-		if ( s.dataType == "script" && s.cache == null )
-			s.cache = false;
-
-		if ( s.cache === false && s.type.toLowerCase() == "get" )
-			s.url += (s.url.match(/\?/) ? "&" : "?") + "_=" + (new Date()).getTime();
-
-		// If data is available, append data to url for get requests
-		if ( s.data && s.type.toLowerCase() == "get" ) {
-			s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
-
-			// IE likes to send both get and post data, prevent this
-			s.data = null;
-		}
-
-		// Watch for a new set of requests
-		if ( s.global && ! jQuery.active++ )
-			jQuery.event.trigger( "ajaxStart" );
-
-		// If we're requesting a remote document
-		// and trying to load JSON or Script
-		if ( !s.url.indexOf("http") && s.dataType == "script" ) {
-			var head = document.getElementsByTagName("head")[0];
-			var script = document.createElement("script");
-			script.src = s.url;
-
-			// Handle Script loading
-			if ( !jsonp && (s.success || s.complete) ) {
-				var done = false;
-
-				// Attach handlers for all browsers
-				script.onload = script.onreadystatechange = function(){
-					if ( !done && (!this.readyState || 
-							this.readyState == "loaded" || this.readyState == "complete") ) {
-						done = true;
-						success();
-						complete();
-						head.removeChild( script );
-					}
-				};
-			}
-
-			head.appendChild(script);
-
-			// We handle everything using the script element injection
-			return;
-		}
-
-		var requestDone = false;
-
-		// Create the request object; Microsoft failed to properly
-		// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
-		var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
-
-		// Open the socket
-		xml.open(s.type, s.url, s.async);
-
-		// Set the correct header, if data is being sent
-		if ( s.data )
-			xml.setRequestHeader("Content-Type", s.contentType);
-
-		// Set the If-Modified-Since header, if ifModified mode.
-		if ( s.ifModified )
-			xml.setRequestHeader("If-Modified-Since",
-				jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
-
-		// Set header so the called script knows that it's an XMLHttpRequest
-		xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
-
-		// Allow custom headers/mimetypes
-		if ( s.beforeSend )
-			s.beforeSend(xml);
-			
-		if ( s.global )
-		    jQuery.event.trigger("ajaxSend", [xml, s]);
-
-		// Wait for a response to come back
-		var onreadystatechange = function(isTimeout){
-			// The transfer is complete and the data is available, or the request timed out
-			if ( !requestDone && xml && (xml.readyState == 4 || isTimeout == "timeout") ) {
-				requestDone = true;
-				
-				// clear poll interval
-				if (ival) {
-					clearInterval(ival);
-					ival = null;
-				}
-				
-				status = isTimeout == "timeout" && "timeout" ||
-					!jQuery.httpSuccess( xml ) && "error" ||
-					s.ifModified && jQuery.httpNotModified( xml, s.url ) && "notmodified" ||
-					"success";
-
-				if ( status == "success" ) {
-					// Watch for, and catch, XML document parse errors
-					try {
-						// process the data (runs the xml through httpData regardless of callback)
-						data = jQuery.httpData( xml, s.dataType );
-					} catch(e) {
-						status = "parsererror";
-					}
-				}
-
-				// Make sure that the request was successful or notmodified
-				if ( status == "success" ) {
-					// Cache Last-Modified header, if ifModified mode.
-					var modRes;
-					try {
-						modRes = xml.getResponseHeader("Last-Modified");
-					} catch(e) {} // swallow exception thrown by FF if header is not available
-	
-					if ( s.ifModified && modRes )
-						jQuery.lastModified[s.url] = modRes;
-
-					// JSONP handles its own success callback
-					if ( !jsonp )
-						success();	
-				} else
-					jQuery.handleError(s, xml, status);
-
-				// Fire the complete handlers
-				complete();
-
-				// Stop memory leaks
-				if ( s.async )
-					xml = null;
-			}
-		};
-		
-		if ( s.async ) {
-			// don't attach the handler to the request, just poll it instead
-			var ival = setInterval(onreadystatechange, 13); 
-
-			// Timeout checker
-			if ( s.timeout > 0 )
-				setTimeout(function(){
-					// Check to see if the request is still happening
-					if ( xml ) {
-						// Cancel the request
-						xml.abort();
-	
-						if( !requestDone )
-							onreadystatechange( "timeout" );
-					}
-				}, s.timeout);
-		}
-			
-		// Send the data
-		try {
-			xml.send(s.data);
-		} catch(e) {
-			jQuery.handleError(s, xml, null, e);
-		}
-		
-		// firefox 1.5 doesn't fire statechange for sync requests
-		if ( !s.async )
-			onreadystatechange();
-		
-		// return XMLHttpRequest to allow aborting the request etc.
-		return xml;
-
-		function success(){
-			// If a local callback was specified, fire it and pass it the data
-			if ( s.success )
-				s.success( data, status );
-
-			// Fire the global callback
-			if ( s.global )
-				jQuery.event.trigger( "ajaxSuccess", [xml, s] );
-		}
-
-		function complete(){
-			// Process result
-			if ( s.complete )
-				s.complete(xml, status);
-
-			// The request was completed
-			if ( s.global )
-				jQuery.event.trigger( "ajaxComplete", [xml, s] );
-
-			// Handle the global AJAX counter
-			if ( s.global && ! --jQuery.active )
-				jQuery.event.trigger( "ajaxStop" );
-		}
-	},
-
-	handleError: function( s, xml, status, e ) {
-		// If a local callback was specified, fire it
-		if ( s.error ) s.error( xml, status, e );
-
-		// Fire the global callback
-		if ( s.global )
-			jQuery.event.trigger( "ajaxError", [xml, s, e] );
-	},
-
-	// Counter for holding the number of active queries
-	active: 0,
-
-	// Determines if an XMLHttpRequest was successful or not
-	httpSuccess: function( r ) {
-		try {
-			return !r.status && location.protocol == "file:" ||
-				( r.status >= 200 && r.status < 300 ) || r.status == 304 ||
-				jQuery.browser.safari && r.status == undefined;
-		} catch(e){}
-		return false;
-	},
-
-	// Determines if an XMLHttpRequest returns NotModified
-	httpNotModified: function( xml, url ) {
-		try {
-			var xmlRes = xml.getResponseHeader("Last-Modified");
-
-			// Firefox always returns 200. check Last-Modified date
-			return xml.status == 304 || xmlRes == jQuery.lastModified[url] ||
-				jQuery.browser.safari && xml.status == undefined;
-		} catch(e){}
-		return false;
-	},
-
-	httpData: function( r, type ) {
-		var ct = r.getResponseHeader("content-type");
-		var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0;
-		var data = xml ? r.responseXML : r.responseText;
-
-		if ( xml && data.documentElement.tagName == "parsererror" )
-			throw "parsererror";
-
-		// If the type is "script", eval it in global context
-		if ( type == "script" )
-			jQuery.globalEval( data );
-
-		// Get the JavaScript object, if JSON is used.
-		if ( type == "json" )
-			data = eval("(" + data + ")");
-
-		return data;
-	},
-
-	// Serialize an array of form elements or a set of
-	// key/values into a query string
-	param: function( a ) {
-		var s = [];
-
-		// If an array was passed in, assume that it is an array
-		// of form elements
-		if ( a.constructor == Array || a.jquery )
-			// Serialize the form elements
-			jQuery.each( a, function(){
-				s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) );
-			});
-
-		// Otherwise, assume that it's an object of key/value pairs
-		else
-			// Serialize the key/values
-			for ( var j in a )
-				// If the value is an array then the key names need to be repeated
-				if ( a[j] && a[j].constructor == Array )
-					jQuery.each( a[j], function(){
-						s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) );
-					});
-				else
-					s.push( encodeURIComponent(j) + "=" + encodeURIComponent( a[j] ) );
-
-		// Return the resulting serialization
-		return s.join("&").replace(/%20/g, "+");
-	}
-
-});
-jQuery.fn.extend({
-	show: function(speed,callback){
-		return speed ?
-			this.animate({
-				height: "show", width: "show", opacity: "show"
-			}, speed, callback) :
-			
-			this.filter(":hidden").each(function(){
-				this.style.display = this.oldblock ? this.oldblock : "";
-				if ( jQuery.css(this,"display") == "none" )
-					this.style.display = "block";
-			}).end();
-	},
-	
-	hide: function(speed,callback){
-		return speed ?
-			this.animate({
-				height: "hide", width: "hide", opacity: "hide"
-			}, speed, callback) :
-			
-			this.filter(":visible").each(function(){
-				this.oldblock = this.oldblock || jQuery.css(this,"display");
-				if ( this.oldblock == "none" )
-					this.oldblock = "block";
-				this.style.display = "none";
-			}).end();
-	},
-
-	// Save the old toggle function
-	_toggle: jQuery.fn.toggle,
-	
-	toggle: function( fn, fn2 ){
-		return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
-			this._toggle( fn, fn2 ) :
-			fn ?
-				this.animate({
-					height: "toggle", width: "toggle", opacity: "toggle"
-				}, fn, fn2) :
-				this.each(function(){
-					jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
-				});
-	},
-	
-	slideDown: function(speed,callback){
-		return this.animate({height: "show"}, speed, callback);
-	},
-	
-	slideUp: function(speed,callback){
-		return this.animate({height: "hide"}, speed, callback);
-	},
-
-	slideToggle: function(speed, callback){
-		return this.animate({height: "toggle"}, speed, callback);
-	},
-	
-	fadeIn: function(speed, callback){
-		return this.animate({opacity: "show"}, speed, callback);
-	},
-	
-	fadeOut: function(speed, callback){
-		return this.animate({opacity: "hide"}, speed, callback);
-	},
-	
-	fadeTo: function(speed,to,callback){
-		return this.animate({opacity: to}, speed, callback);
-	},
-	
-	animate: function( prop, speed, easing, callback ) {
-		var opt = jQuery.speed(speed, easing, callback);
-
-		return this[ opt.queue === false ? "each" : "queue" ](function(){
-			opt = jQuery.extend({}, opt);
-			var hidden = jQuery(this).is(":hidden"), self = this;
-			
-			for ( var p in prop ) {
-				if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
-					return jQuery.isFunction(opt.complete) && opt.complete.apply(this);
-
-				if ( p == "height" || p == "width" ) {
-					// Store display property
-					opt.display = jQuery.css(this, "display");
-
-					// Make sure that nothing sneaks out
-					opt.overflow = this.style.overflow;
-				}
-			}
-
-			if ( opt.overflow != null )
-				this.style.overflow = "hidden";
-
-			opt.curAnim = jQuery.extend({}, prop);
-			
-			jQuery.each( prop, function(name, val){
-				var e = new jQuery.fx( self, opt, name );
-
-				if ( /toggle|show|hide/.test(val) )
-					e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
-				else {
-					var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
-						start = e.cur(true) || 0;
-
-					if ( parts ) {
-						var end = parseFloat(parts[2]),
-							unit = parts[3] || "px";
-
-						// We need to compute starting value
-						if ( unit != "px" ) {
-							self.style[ name ] = (end || 1) + unit;
-							start = ((end || 1) / e.cur(true)) * start;
-							self.style[ name ] = start + unit;
-						}
-
-						// If a +=/-= token was provided, we're doing a relative animation
-						if ( parts[1] )
-							end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
-
-						e.custom( start, end, unit );
-					} else
-						e.custom( start, val, "" );
-				}
-			});
-
-			// For JS strict compliance
-			return true;
-		});
-	},
-	
-	queue: function(type, fn){
-		if ( jQuery.isFunction(type) ) {
-			fn = type;
-			type = "fx";
-		}
-
-		if ( !type || (typeof type == "string" && !fn) )
-			return queue( this[0], type );
-
-		return this.each(function(){
-			if ( fn.constructor == Array )
-				queue(this, type, fn);
-			else {
-				queue(this, type).push( fn );
-			
-				if ( queue(this, type).length == 1 )
-					fn.apply(this);
-			}
-		});
-	},
-
-	stop: function(){
-		var timers = jQuery.timers;
-
-		return this.each(function(){
-			for ( var i = 0; i < timers.length; i++ )
-				if ( timers[i].elem == this )
-					timers.splice(i--, 1);
-		}).dequeue();
-	}
-
-});
-
-var queue = function( elem, type, array ) {
-	if ( !elem )
-		return;
-
-	var q = jQuery.data( elem, type + "queue" );
-
-	if ( !q || array )
-		q = jQuery.data( elem, type + "queue", 
-			array ? jQuery.makeArray(array) : [] );
-
-	return q;
-};
-
-jQuery.fn.dequeue = function(type){
-	type = type || "fx";
-
-	return this.each(function(){
-		var q = queue(this, type);
-
-		q.shift();
-
-		if ( q.length )
-			q[0].apply( this );
-	});
-};
-
-jQuery.extend({
-	
-	speed: function(speed, easing, fn) {
-		var opt = speed && speed.constructor == Object ? speed : {
-			complete: fn || !fn && easing || 
-				jQuery.isFunction( speed ) && speed,
-			duration: speed,
-			easing: fn && easing || easing && easing.constructor != Function && easing
-		};
-
-		opt.duration = (opt.duration && opt.duration.constructor == Number ? 
-			opt.duration : 
-			{ slow: 600, fast: 200 }[opt.duration]) || 400;
-	
-		// Queueing
-		opt.old = opt.complete;
-		opt.complete = function(){
-			jQuery(this).dequeue();
-			if ( jQuery.isFunction( opt.old ) )
-				opt.old.apply( this );
-		};
-	
-		return opt;
-	},
-	
-	easing: {
-		linear: function( p, n, firstNum, diff ) {
-			return firstNum + diff * p;
-		},
-		swing: function( p, n, firstNum, diff ) {
-			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
-		}
-	},
-	
-	timers: [],
-
-	fx: function( elem, options, prop ){
-		this.options = options;
-		this.elem = elem;
-		this.prop = prop;
-
-		if ( !options.orig )
-			options.orig = {};
-	}
-
-});
-
-jQuery.fx.prototype = {
-
-	// Simple function for setting a style value
-	update: function(){
-		if ( this.options.step )
-			this.options.step.apply( this.elem, [ this.now, this ] );
-
-		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
-
-		// Set display property to block for height/width animations
-		if ( this.prop == "height" || this.prop == "width" )
-			this.elem.style.display = "block";
-	},
-
-	// Get the current size
-	cur: function(force){
-		if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null )
-			return this.elem[ this.prop ];
-
-		var r = parseFloat(jQuery.curCSS(this.elem, this.prop, force));
-		return r && r > -10000 ? r : parseFloat(jQuery.css(this.elem, this.prop)) || 0;
-	},
-
-	// Start an animation from one number to another
-	custom: function(from, to, unit){
-		this.startTime = (new Date()).getTime();
-		this.start = from;
-		this.end = to;
-		this.unit = unit || this.unit || "px";
-		this.now = this.start;
-		this.pos = this.state = 0;
-		this.update();
-
-		var self = this;
-		function t(){
-			return self.step();
-		}
-
-		t.elem = this.elem;
-
-		jQuery.timers.push(t);
-
-		if ( jQuery.timers.length == 1 ) {
-			var timer = setInterval(function(){
-				var timers = jQuery.timers;
-				
-				for ( var i = 0; i < timers.length; i++ )
-					if ( !timers[i]() )
-						timers.splice(i--, 1);
-
-				if ( !timers.length )
-					clearInterval( timer );
-			}, 13);
-		}
-	},
-
-	// Simple 'show' function
-	show: function(){
-		// Remember where we started, so that we can go back to it later
-		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
-		this.options.show = true;
-
-		// Begin the animation
-		this.custom(0, this.cur());
-
-		// Make sure that we start at a small width/height to avoid any
-		// flash of content
-		if ( this.prop == "width" || this.prop == "height" )
-			this.elem.style[this.prop] = "1px";
-		
-		// Start by showing the element
-		jQuery(this.elem).show();
-	},
-
-	// Simple 'hide' function
-	hide: function(){
-		// Remember where we started, so that we can go back to it later
-		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
-		this.options.hide = true;
-
-		// Begin the animation
-		this.custom(this.cur(), 0);
-	},
-
-	// Each step of an animation
-	step: function(){
-		var t = (new Date()).getTime();
-
-		if ( t > this.options.duration + this.startTime ) {
-			this.now = this.end;
-			this.pos = this.state = 1;
-			this.update();
-
-			this.options.curAnim[ this.prop ] = true;
-
-			var done = true;
-			for ( var i in this.options.curAnim )
-				if ( this.options.curAnim[i] !== true )
-					done = false;
-
-			if ( done ) {
-				if ( this.options.display != null ) {
-					// Reset the overflow
-					this.elem.style.overflow = this.options.overflow;
-				
-					// Reset the display
-					this.elem.style.display = this.options.display;
-					if ( jQuery.css(this.elem, "display") == "none" )
-						this.elem.style.display = "block";
-				}
-
-				// Hide the element if the "hide" operation was done
-				if ( this.options.hide )
-					this.elem.style.display = "none";
-
-				// Reset the properties, if the item has been hidden or shown
-				if ( this.options.hide || this.options.show )
-					for ( var p in this.options.curAnim )
-						jQuery.attr(this.elem.style, p, this.options.orig[p]);
-			}
-
-			// If a callback was provided, execute it
-			if ( done && jQuery.isFunction( this.options.complete ) )
-				// Execute the complete function
-				this.options.complete.apply( this.elem );
-
-			return false;
-		} else {
-			var n = t - this.startTime;
-			this.state = n / this.options.duration;
-
-			// Perform the easing function, defaults to swing
-			this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
-			this.now = this.start + ((this.end - this.start) * this.pos);
-
-			// Perform the next step of the animation
-			this.update();
-		}
-
-		return true;
-	}
-
-};
-
-jQuery.fx.step = {
-	scrollLeft: function(fx){
-		fx.elem.scrollLeft = fx.now;
-	},
-
-	scrollTop: function(fx){
-		fx.elem.scrollTop = fx.now;
-	},
-
-	opacity: function(fx){
-		jQuery.attr(fx.elem.style, "opacity", fx.now);
-	},
-
-	_default: function(fx){
-		fx.elem.style[ fx.prop ] = fx.now + fx.unit;
-	}
-};
-// The Offset Method
-// Originally By Brandon Aaron, part of the Dimension Plugin
-// http://jquery.com/plugins/project/dimensions
-jQuery.fn.offset = function() {
-	var left = 0, top = 0, elem = this[0], results;
-	
-	if ( elem ) with ( jQuery.browser ) {
-		var	absolute     = jQuery.css(elem, "position") == "absolute", 
-		    parent       = elem.parentNode, 
-		    offsetParent = elem.offsetParent, 
-		    doc          = elem.ownerDocument,
-		    safari2      = safari && parseInt(version) < 522;
-	
-		// Use getBoundingClientRect if available
-		if ( elem.getBoundingClientRect ) {
-			box = elem.getBoundingClientRect();
-		
-			// Add the document scroll offsets
-			add(
-				box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
-				box.top  + Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop)
-			);
-		
-			// IE adds the HTML element's border, by default it is medium which is 2px
-			// IE 6 and IE 7 quirks mode the border width is overwritable by the following css html { border: 0; }
-			// IE 7 standards mode, the border is always 2px
-			if ( msie ) {
-				var border = jQuery("html").css("borderWidth");
-				border = (border == "medium" || jQuery.boxModel && parseInt(version) >= 7) && 2 || border;
-				add( -border, -border );
-			}
-	
-		// Otherwise loop through the offsetParents and parentNodes
-		} else {
-		
-			// Initial element offsets
-			add( elem.offsetLeft, elem.offsetTop );
-		
-			// Get parent offsets
-			while ( offsetParent ) {
-				// Add offsetParent offsets
-				add( offsetParent.offsetLeft, offsetParent.offsetTop );
-			
-				// Mozilla and Safari > 2 does not include the border on offset parents
-				// However Mozilla adds the border for table cells
-				if ( mozilla && /^t[d|h]$/i.test(parent.tagName) || !safari2 )
-					border( offsetParent );
-				
-				// Safari <= 2 doubles body offsets with an absolutely positioned element or parent
-				if ( safari2 && !absolute && jQuery.css(offsetParent, "position") == "absolute" )
-					absolute = true;
-			
-				// Get next offsetParent
-				offsetParent = offsetParent.offsetParent;
-			}
-		
-			// Get parent scroll offsets
-			while ( parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
-				// Work around opera inline/table scrollLeft/Top bug
-				if ( !/^inline|table-row.*$/i.test(jQuery.css(parent, "display")) )
-					// Subtract parent scroll offsets
-					add( -parent.scrollLeft, -parent.scrollTop );
-			
-				// Mozilla does not add the border for a parent that has overflow != visible
-				if ( mozilla && jQuery.css(parent, "overflow") != "visible" )
-					border( parent );
-			
-				// Get next parent
-				parent = parent.parentNode;
-			}
-		
-			// Safari doubles body offsets with an absolutely positioned element or parent
-			if ( safari2 && absolute )
-				add( -doc.body.offsetLeft, -doc.body.offsetTop );
-		}
-
-		// Return an object with top and left properties
-		results = { top: top, left: left };
-	}
-
-	return results;
-
-	function border(elem) {
-		add( jQuery.css(elem, "borderLeftWidth"), jQuery.css(elem, "borderTopWidth") );
-	}
-
-	function add(l, t) {
-		left += parseInt(l) || 0;
-		top += parseInt(t) || 0;
-	}
-};
-})();
--- a/web/html/support/jquery-min.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
- * jQuery 1.2.1 - New Wave Javascript
- *
- * Copyright (c) 2007 John Resig (jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
- * $Rev: 3353 $
- */
-(function(){if(typeof jQuery!="undefined")var _jQuery=jQuery;var jQuery=window.jQuery=function(selector,context){return this instanceof jQuery?this.init(selector,context):new jQuery(selector,context);};if(typeof $!="undefined")var _$=$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(typeof selector=="string"){var m=quickExpr.exec(selector);if(m&&(m[1]||!context)){if(m[1])selector=jQuery.clean([m[1]],context);else{var tmp=document.getElementById(m[3]);if(tmp)if(tmp.id!=m[3])return jQuery().find(selector);else{this[0]=tmp;this.length=1;return this;}else
-selector=[];}}else
-return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.1",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(a){var ret=jQuery(a);ret.prevObject=this;return ret;},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this;},each:function(fn,args){return jQuery.each(this,fn,args);},index:function(obj){var pos=-1;this.each(function(i){if(this==obj)pos=i;});return pos;},attr:function(key,value,type){var obj=key;if(key.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],key)||undefined;else{obj={};obj[key]=value;}return this.each(function(index){for(var prop in obj)jQuery.attr(type?this.style:this,prop,jQuery.prop(this,obj[prop],type,index,prop));});},css:function(key,value){return this.attr(key,value,"curCSS");},text:function(e){if(typeof e!="object"&&e!=null)return this.empty().append(document.createTextNode(e));var t="";jQuery.each(e||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)t+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return t;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,1,function(a){this.appendChild(a);});},prepend:function(){return this.domManip(arguments,true,-1,function(a){this.insertBefore(a,this.firstChild);});},before:function(){return this.domManip(arguments,false,1,function(a){this.parentNode.insertBefore(a,this);});},after:function(){return this.domManip(arguments,false,-1,function(a){this.parentNode.insertBefore(a,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(t){var data=jQuery.map(this,function(a){return jQuery.find(t,a);});return this.pushStack(/[^+>] [^+>]/.test(t)||t.indexOf("..")>-1?jQuery.unique(data):data);},clone:function(events){var ret=this.map(function(){return this.outerHTML?jQuery(this.outerHTML)[0]:this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(t){return this.pushStack(jQuery.isFunction(t)&&jQuery.grep(this,function(el,index){return t.apply(el,[index]);})||jQuery.multiFilter(t,this));},not:function(t){return this.pushStack(t.constructor==String&&jQuery.multiFilter(t,this,true)||jQuery.grep(this,function(a){return(t.constructor==Array||t.jquery)?jQuery.inArray(a,t)<0:a!=t;}));},add:function(t){return this.pushStack(jQuery.merge(this.get(),t.constructor==String?jQuery(t).get():t.length!=undefined&&(!t.nodeName||jQuery.nodeName(t,"form"))?t:[t]));},is:function(expr){return expr?jQuery.multiFilter(expr,this).length>0:false;},hasClass:function(expr){return this.is("."+expr);},val:function(val){if(val==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,a=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){var val=jQuery.browser.msie&&!option.attributes["value"].specified?option.text:option.value;if(one)return val;a.push(val);}}return a;}else
-return this[0].value.replace(/\r/g,"");}}else
-return this.each(function(){if(val.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,val)>=0||jQuery.inArray(this.name,val)>=0);else if(jQuery.nodeName(this,"select")){var tmp=val.constructor==Array?val:[val];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,tmp)>=0||jQuery.inArray(this.text,tmp)>=0);});if(!tmp.length)this.selectedIndex=-1;}else
-this.value=val;});},html:function(val){return val==undefined?(this.length?this[0].innerHTML:null):this.empty().append(val);},replaceWith:function(val){return this.after(val).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(fn){return this.pushStack(jQuery.map(this,function(elem,i){return fn.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},domManip:function(args,table,dir,fn){var clone=this.length>1,a;return this.each(function(){if(!a){a=jQuery.clean(args,this.ownerDocument);if(dir<0)a.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(a[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(document.createElement("tbody"));jQuery.each(a,function(){var elem=clone?this.cloneNode(true):this;if(!evalScript(0,elem))fn.call(obj,elem);});});}};function evalScript(i,elem){var script=jQuery.nodeName(elem,"script");if(script){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
-jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}else if(elem.nodeType==1)jQuery("script",elem).each(evalScript);return script;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},a=1,al=arguments.length,deep=false;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};}if(al==1){target=this;a=0;}var prop;for(;a<al;a++)if((prop=arguments[a])!=null)for(var i in prop){if(target==prop[i])continue;if(deep&&typeof prop[i]=='object'&&target[i])jQuery.extend(target[i],prop[i]);else if(prop[i]!=undefined)target[i]=prop[i];}return target;};var expando="jQuery"+(new Date()).getTime(),uuid=0,win={};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/function/i.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){if(window.execScript)window.execScript(data);else if(jQuery.browser.safari)window.setTimeout(data,0);else
-eval.call(window,data);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?win:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!=undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?win:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(obj,fn,args){if(args){if(obj.length==undefined)for(var i in obj)fn.apply(obj[i],args);else
-for(var i=0,ol=obj.length;i<ol;i++)if(fn.apply(obj[i],args)===false)break;}else{if(obj.length==undefined)for(var i in obj)fn.call(obj[i],i,obj[i]);else
-for(var i=0,ol=obj.length,val=obj[0];i<ol&&fn.call(val,i,val)!==false;val=obj[++i]){}}return obj;},prop:function(elem,value,type,index,prop){if(jQuery.isFunction(value))value=value.call(elem,[index]);var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i;return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(prop)?value+"px":value;},className:{add:function(elem,c){jQuery.each((c||"").split(/\s+/),function(i,cur){if(!jQuery.className.has(elem.className,cur))elem.className+=(elem.className?" ":"")+cur;});},remove:function(elem,c){elem.className=c!=undefined?jQuery.grep(elem.className.split(/\s+/),function(cur){return!jQuery.className.has(c,cur);}).join(" "):"";},has:function(t,c){return jQuery.inArray(c,(t.className||t).toString().split(/\s+/))>-1;}},swap:function(e,o,f){for(var i in o){e.style["old"+i]=e.style[i];e.style[i]=o[i];}f.apply(e,[]);for(var i in o)e.style[i]=e.style["old"+i];},css:function(e,p){if(p=="height"||p=="width"){var old={},oHeight,oWidth,d=["Top","Bottom","Right","Left"];jQuery.each(d,function(){old["padding"+this]=0;old["border"+this+"Width"]=0;});jQuery.swap(e,old,function(){if(jQuery(e).is(':visible')){oHeight=e.offsetHeight;oWidth=e.offsetWidth;}else{e=jQuery(e.cloneNode(true)).find(":radio").removeAttr("checked").end().css({visibility:"hidden",position:"absolute",display:"block",right:"0",left:"0"}).appendTo(e.parentNode)[0];var parPos=jQuery.css(e.parentNode,"position")||"static";if(parPos=="static")e.parentNode.style.position="relative";oHeight=e.clientHeight;oWidth=e.clientWidth;if(parPos=="static")e.parentNode.style.position="static";e.parentNode.removeChild(e);}});return p=="height"?oHeight:oWidth;}return jQuery.curCSS(e,p);},curCSS:function(elem,prop,force){var ret,stack=[],swap=[];function color(a){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(a,null);return!ret||ret.getPropertyValue("color")=="";}if(prop=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(prop.match(/float/i))prop=styleFloat;if(!force&&elem.style[prop])ret=elem.style[prop];else if(document.defaultView&&document.defaultView.getComputedStyle){if(prop.match(/float/i))prop="float";prop=prop.replace(/([A-Z])/g,"-$1").toLowerCase();var cur=document.defaultView.getComputedStyle(elem,null);if(cur&&!color(elem))ret=cur.getPropertyValue(prop);else{for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(a=0;a<stack.length;a++)if(color(stack[a])){swap[a]=stack[a].style.display;stack[a].style.display="block";}ret=prop=="display"&&swap[stack.length-1]!=null?"none":document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop)||"";for(a=0;a<swap.length;a++)if(swap[a]!=null)stack[a].style.display=swap[a];}if(prop=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var newProp=prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});ret=elem.currentStyle[prop]||elem.currentStyle[newProp];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var style=elem.style.left;var runtimeStyle=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;elem.style.left=ret||0;ret=elem.style.pixelLeft+"px";elem.style.left=style;elem.runtimeStyle.left=runtimeStyle;}}return ret;},clean:function(a,doc){var r=[];doc=doc||document;jQuery.each(a,function(i,arg){if(!arg)return;if(arg.constructor==Number)arg=arg.toString();if(typeof arg=="string"){arg=arg.replace(/(<(\w+)[^>]*?)\/>/g,function(m,all,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)?m:all+"></"+tag+">";});var s=jQuery.trim(arg).toLowerCase(),div=doc.createElement("div"),tb=[];var wrap=!s.indexOf("<opt")&&[1,"<select>","</select>"]||!s.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||s.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!s.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!s.indexOf("<td")||!s.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!s.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+arg+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){if(!s.indexOf("<table")&&s.indexOf("<tbody")<0)tb=div.firstChild&&div.firstChild.childNodes;else if(wrap[1]=="<table>"&&s.indexOf("<tbody")<0)tb=div.childNodes;for(var n=tb.length-1;n>=0;--n)if(jQuery.nodeName(tb[n],"tbody")&&!tb[n].childNodes.length)tb[n].parentNode.removeChild(tb[n]);if(/^\s/.test(arg))div.insertBefore(doc.createTextNode(arg.match(/^\s*/)[0]),div.firstChild);}arg=jQuery.makeArray(div.childNodes);}if(0===arg.length&&(!jQuery.nodeName(arg,"form")&&!jQuery.nodeName(arg,"select")))return;if(arg[0]==undefined||jQuery.nodeName(arg,"form")||arg.options)r.push(arg);else
-r=jQuery.merge(r,arg);});return r;},attr:function(elem,name,value){var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(t){return(t||"").replace(/^\s+|\s+$/g,"");},makeArray:function(a){var r=[];if(typeof a!="array")for(var i=0,al=a.length;i<al;i++)r.push(a[i]);else
-r=a.slice(0);return r;},inArray:function(b,a){for(var i=0,al=a.length;i<al;i++)if(a[i]==b)return i;return-1;},merge:function(first,second){if(jQuery.browser.msie){for(var i=0;second[i];i++)if(second[i].nodeType!=8)first.push(second[i]);}else
-for(var i=0;second[i];i++)first.push(second[i]);return first;},unique:function(first){var r=[],done={};try{for(var i=0,fl=first.length;i<fl;i++){var id=jQuery.data(first[i]);if(!done[id]){done[id]=true;r.push(first[i]);}}}catch(e){r=first;}return r;},grep:function(elems,fn,inv){if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++)if(!inv&&fn(elems[i],i)||inv&&!fn(elems[i],i))result.push(elems[i]);return result;},map:function(elems,fn){if(typeof fn=="string")fn=eval("false||function(a){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++){var val=fn(elems[i],i);if(val!==null&&val!=undefined){if(val.constructor!=Array)val=[val];result=result.concat(val);}}return result;}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",styleFloat:jQuery.browser.msie?"styleFloat":"cssFloat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,innerHTML:"innerHTML",className:"className",value:"value",disabled:"disabled",checked:"checked",readonly:"readOnly",selected:"selected",maxlength:"maxLength"}});jQuery.each({parent:"a.parentNode",parents:"jQuery.dir(a,'parentNode')",next:"jQuery.nth(a,2,'nextSibling')",prev:"jQuery.nth(a,2,'previousSibling')",nextAll:"jQuery.dir(a,'nextSibling')",prevAll:"jQuery.dir(a,'previousSibling')",siblings:"jQuery.sibling(a.parentNode.firstChild,a)",children:"jQuery.sibling(a.firstChild)",contents:"jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"},function(i,n){jQuery.fn[i]=function(a){var ret=jQuery.map(this,n);if(a&&typeof a=="string")ret=jQuery.multiFilter(a,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(i,n){jQuery.fn[i]=function(){var a=arguments;return this.each(function(){for(var j=0,al=a.length;j<al;j++)jQuery(a[j])[n](this);});};});jQuery.each({removeAttr:function(key){jQuery.attr(this,key,"");this.removeAttribute(key);},addClass:function(c){jQuery.className.add(this,c);},removeClass:function(c){jQuery.className.remove(this,c);},toggleClass:function(c){jQuery.className[jQuery.className.has(this,c)?"remove":"add"](this,c);},remove:function(a){if(!a||jQuery.filter(a,[this]).r.length){jQuery.removeData(this);this.parentNode.removeChild(this);}},empty:function(){jQuery("*",this).each(function(){jQuery.removeData(this);});while(this.firstChild)this.removeChild(this.firstChild);}},function(i,n){jQuery.fn[i]=function(){return this.each(n,arguments);};});jQuery.each(["Height","Width"],function(i,name){var n=name.toLowerCase();jQuery.fn[n]=function(h){return this[0]==window?jQuery.browser.safari&&self["inner"+name]||jQuery.boxModel&&Math.max(document.documentElement["client"+name],document.body["client"+name])||document.body["client"+name]:this[0]==document?Math.max(document.body["scroll"+name],document.body["offset"+name]):h==undefined?(this.length?jQuery.css(this[0],n):null):this.css(n,h.constructor==String?h:h+"px");};});var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":"m[2]=='*'||jQuery.nodeName(a,m[2])","#":"a.getAttribute('id')==m[2]",":":{lt:"i<m[3]-0",gt:"i>m[3]-0",nth:"m[3]-0==i",eq:"m[3]-0==i",first:"i==0",last:"i==r.length-1",even:"i%2==0",odd:"i%2","first-child":"a.parentNode.getElementsByTagName('*')[0]==a","last-child":"jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a","only-child":"!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",parent:"a.firstChild",empty:"!a.firstChild",contains:"(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",visible:'"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',hidden:'"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',enabled:"!a.disabled",disabled:"a.disabled",checked:"a.checked",selected:"a.selected||jQuery.attr(a,'selected')",text:"'text'==a.type",radio:"'radio'==a.type",checkbox:"'checkbox'==a.type",file:"'file'==a.type",password:"'password'==a.type",submit:"'submit'==a.type",image:"'image'==a.type",reset:"'reset'==a.type",button:'"button"==a.type||jQuery.nodeName(a,"button")',input:"/input|select|textarea|button/i.test(a.nodeName)",has:"jQuery.find(m[3],a).length",header:"/h\\d/i.test(a.nodeName)",animated:"jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&!context.nodeType)context=null;context=context||document;var ret=[context],done=[],last;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){var nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName.toUpperCase()))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var nodeName=m[2],merge={};m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName.toUpperCase()){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=jQuery.filter(m[3],r,true).r;else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(\d*)n\+?(\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"n+"+m[3]||m[3]),first=(test[1]||1)-0,last=test[2]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==1){if(last==0||node.nodeIndex==last)add=true;}else if((node.nodeIndex+last)%first==0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var f=jQuery.expr[m[1]];if(typeof f!="string")f=jQuery.expr[m[1]][m[2]];f=eval("false||function(a,i){return "+f+"}");r=jQuery.grep(r,f,not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(element,type,handler,data){if(jQuery.browser.msie&&element.setInterval!=undefined)element=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var parts=type.split(".");type=parts[0];handler.type=parts[1];var events=jQuery.data(element,"events")||jQuery.data(element,"events",{});var handle=jQuery.data(element,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(element,arguments);return val;});var handlers=events[type];if(!handlers){handlers=events[type]={};if(element.addEventListener)element.addEventListener(type,handle,false);else
-element.attachEvent("on"+type,handle);}handlers[handler.guid]=handler;this.global[type]=true;},guid:1,global:{},remove:function(element,type,handler){var events=jQuery.data(element,"events"),ret,index;if(typeof type=="string"){var parts=type.split(".");type=parts[0];}if(events){if(type&&type.type){handler=type.handler;type=type.type;}if(!type){for(type in events)this.remove(element,type);}else if(events[type]){if(handler)delete events[type][handler.guid];else
-for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(element.removeEventListener)element.removeEventListener(type,jQuery.data(element,"handle"),false);else
-element.detachEvent("on"+type,jQuery.data(element,"handle"));ret=null;delete events[type];}}for(ret in events)break;if(!ret){jQuery.removeData(element,"events");jQuery.removeData(element,"handle");}}},trigger:function(type,data,element,donative,extra){data=jQuery.makeArray(data||[]);if(!element){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{var val,ret,fn=jQuery.isFunction(element[type]||null),evt=!data[0]||!data[0].preventDefault;if(evt)data.unshift(this.fix({type:type,target:element}));data[0].type=type;if(jQuery.isFunction(jQuery.data(element,"handle")))val=jQuery.data(element,"handle").apply(element,data);if(!fn&&element["on"+type]&&element["on"+type].apply(element,data)===false)val=false;if(evt)data.shift();if(extra&&extra.apply(element,data)===false)val=false;if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(element,'a')&&type=="click")){this.triggered=true;element[type]();}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var c=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in c){args[0].handler=c[j];args[0].data=c[j].data;if(!parts[1]||c[j].type==parts[1]){var tmp=c[j].apply(this,args);if(val!==false)val=tmp;if(tmp===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target&&event.srcElement)event.target=event.srcElement;if(jQuery.browser.safari&&event.target.nodeType==3)event.target=originalEvent.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var e=document.documentElement,b=document.body;event.pageX=event.clientX+(e&&e.scrollLeft||b.scrollLeft||0);event.pageY=event.clientY+(e&&e.scrollTop||b.scrollTop||0);}if(!event.which&&(event.charCode||event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(){var a=arguments;return this.click(function(e){this.lastToggle=0==this.lastToggle?1:0;e.preventDefault();return a[this.lastToggle].apply(this,[e])||false;});},hover:function(f,g){function handleHover(e){var p=e.relatedTarget;while(p&&p!=this)try{p=p.parentNode;}catch(e){p=this;};if(p==this)return false;return(e.type=="mouseover"?f:g).apply(this,[e]);}return this.mouseover(handleHover).mouseout(handleHover);},ready:function(f){bindReady();if(jQuery.isReady)f.apply(document,[jQuery]);else
-jQuery.readyList.push(function(){return f.apply(this,[jQuery]);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}if(jQuery.browser.mozilla||jQuery.browser.opera)document.removeEventListener("DOMContentLoaded",jQuery.ready,false);if(!window.frames.length)jQuery(window).load(function(){jQuery("#__ie_init").remove();});}}});jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,o){jQuery.fn[o]=function(f){return f?this.bind(o,f):this.trigger(o);};});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(jQuery.browser.mozilla||jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);else if(jQuery.browser.msie){document.write("<scr"+"ipt id=__ie_init defer=true "+"src=//:><\/script>");var script=document.getElementById("__ie_init");if(script)script.onreadystatechange=function(){if(this.readyState!="complete")return;jQuery.ready();};script=null;}else if(jQuery.browser.safari)jQuery.safariTimer=setInterval(function(){if(document.readyState=="loaded"||document.readyState=="complete"){clearInterval(jQuery.safariTimer);jQuery.safariTimer=null;jQuery.ready();}},10);jQuery.event.add(window,"load",jQuery.ready);}jQuery.fn.extend({load:function(url,params,callback){if(jQuery.isFunction(url))return this.bind("load",url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);setTimeout(function(){self.each(callback,[res.responseText,status,res]);},13);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null},lastModified:{},ajax:function(s){var jsonp,jsre=/=(\?|%3F)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=s.data.replace(jsre,"="+jsonp);s.url=s.url.replace(jsre,"="+jsonp);s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get")s.url+=(s.url.match(/\?/)?"&":"?")+"_="+(new Date()).getTime();if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if(!s.url.indexOf("http")&&s.dataType=="script"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(!jsonp&&(s.success||s.complete)){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async);if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
-jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();return xml;function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
-for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
-s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock?this.oldblock:"";if(jQuery.css(this,"display")=="none")this.style.display="block";}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");if(this.oldblock=="none")this.oldblock="block";this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var opt=jQuery.speed(speed,easing,callback);return this[opt.queue===false?"each":"queue"](function(){opt=jQuery.extend({},opt);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
-e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(){var timers=jQuery.timers;return this.each(function(){for(var i=0;i<timers.length;i++)if(timers[i].elem==this)timers.splice(i--,1);}).dequeue();}});var queue=function(elem,type,array){if(!elem)return;var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.curCSS(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.css(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(){return self.step();}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timers.length==1){var timer=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length)clearInterval(timer);},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(){var t=(new Date()).getTime();if(t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var absolute=jQuery.css(elem,"position")=="absolute",parent=elem.parentNode,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522;if(elem.getBoundingClientRect){box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));if(msie){var border=jQuery("html").css("borderWidth");border=(border=="medium"||jQuery.boxModel&&parseInt(version)>=7)&&2||border;add(-border,-border);}}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&/^t[d|h]$/i.test(parent.tagName)||!safari2)border(offsetParent);if(safari2&&!absolute&&jQuery.css(offsetParent,"position")=="absolute")absolute=true;offsetParent=offsetParent.offsetParent;}while(parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table-row.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if(safari2&&absolute)add(-doc.body.offsetLeft,-doc.body.offsetTop);}results={top:top,left:left};}return results;function border(elem){add(jQuery.css(elem,"borderLeftWidth"),jQuery.css(elem,"borderTopWidth"));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}};})();
\ No newline at end of file
--- a/web/html/support/jquery.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2992 +0,0 @@
-(function(){
-/*
- * jQuery 1.2.1 - New Wave Javascript
- *
- * Copyright (c) 2007 John Resig (jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
- * $Rev: 3353 $
- */
-
-// Map over jQuery in case of overwrite
-if ( typeof jQuery != "undefined" )
-	var _jQuery = jQuery;
-
-var jQuery = window.jQuery = function(selector, context) {
-	// If the context is a namespace object, return a new object
-	return this instanceof jQuery ?
-		this.init(selector, context) :
-		new jQuery(selector, context);
-};
-
-// Map over the $ in case of overwrite
-if ( typeof $ != "undefined" )
-	var _$ = $;
-	
-// Map the jQuery namespace to the '$' one
-window.$ = jQuery;
-
-var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;
-
-jQuery.fn = jQuery.prototype = {
-	init: function(selector, context) {
-		// Make sure that a selection was provided
-		selector = selector || document;
-
-		// Handle HTML strings
-		if ( typeof selector  == "string" ) {
-			var m = quickExpr.exec(selector);
-			if ( m && (m[1] || !context) ) {
-				// HANDLE: $(html) -> $(array)
-				if ( m[1] )
-					selector = jQuery.clean( [ m[1] ], context );
-
-				// HANDLE: $("#id")
-				else {
-					var tmp = document.getElementById( m[3] );
-					if ( tmp )
-						// Handle the case where IE and Opera return items
-						// by name instead of ID
-						if ( tmp.id != m[3] )
-							return jQuery().find( selector );
-						else {
-							this[0] = tmp;
-							this.length = 1;
-							return this;
-						}
-					else
-						selector = [];
-				}
-
-			// HANDLE: $(expr)
-			} else
-				return new jQuery( context ).find( selector );
-
-		// HANDLE: $(function)
-		// Shortcut for document ready
-		} else if ( jQuery.isFunction(selector) )
-			return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( selector );
-
-		return this.setArray(
-			// HANDLE: $(array)
-			selector.constructor == Array && selector ||
-
-			// HANDLE: $(arraylike)
-			// Watch for when an array-like object is passed as the selector
-			(selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) ||
-
-			// HANDLE: $(*)
-			[ selector ] );
-	},
-	
-	jquery: "1.2.1",
-
-	size: function() {
-		return this.length;
-	},
-	
-	length: 0,
-
-	get: function( num ) {
-		return num == undefined ?
-
-			// Return a 'clean' array
-			jQuery.makeArray( this ) :
-
-			// Return just the object
-			this[num];
-	},
-	
-	pushStack: function( a ) {
-		var ret = jQuery(a);
-		ret.prevObject = this;
-		return ret;
-	},
-	
-	setArray: function( a ) {
-		this.length = 0;
-		Array.prototype.push.apply( this, a );
-		return this;
-	},
-
-	each: function( fn, args ) {
-		return jQuery.each( this, fn, args );
-	},
-
-	index: function( obj ) {
-		var pos = -1;
-		this.each(function(i){
-			if ( this == obj ) pos = i;
-		});
-		return pos;
-	},
-
-	attr: function( key, value, type ) {
-		var obj = key;
-		
-		// Look for the case where we're accessing a style value
-		if ( key.constructor == String )
-			if ( value == undefined )
-				return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined;
-			else {
-				obj = {};
-				obj[ key ] = value;
-			}
-		
-		// Check to see if we're setting style values
-		return this.each(function(index){
-			// Set all the styles
-			for ( var prop in obj )
-				jQuery.attr(
-					type ? this.style : this,
-					prop, jQuery.prop(this, obj[prop], type, index, prop)
-				);
-		});
-	},
-
-	css: function( key, value ) {
-		return this.attr( key, value, "curCSS" );
-	},
-
-	text: function(e) {
-		if ( typeof e != "object" && e != null )
-			return this.empty().append( document.createTextNode( e ) );
-
-		var t = "";
-		jQuery.each( e || this, function(){
-			jQuery.each( this.childNodes, function(){
-				if ( this.nodeType != 8 )
-					t += this.nodeType != 1 ?
-						this.nodeValue : jQuery.fn.text([ this ]);
-			});
-		});
-		return t;
-	},
-
-	wrapAll: function(html) {
-		if ( this[0] )
-			// The elements to wrap the target around
-			jQuery(html, this[0].ownerDocument)
-				.clone()
-				.insertBefore(this[0])
-				.map(function(){
-					var elem = this;
-					while ( elem.firstChild )
-						elem = elem.firstChild;
-					return elem;
-				})
-				.append(this);
-
-		return this;
-	},
-
-	wrapInner: function(html) {
-		return this.each(function(){
-			jQuery(this).contents().wrapAll(html);
-		});
-	},
-
-	wrap: function(html) {
-		return this.each(function(){
-			jQuery(this).wrapAll(html);
-		});
-	},
-
-	append: function() {
-		return this.domManip(arguments, true, 1, function(a){
-			this.appendChild( a );
-		});
-	},
-
-	prepend: function() {
-		return this.domManip(arguments, true, -1, function(a){
-			this.insertBefore( a, this.firstChild );
-		});
-	},
-	
-	before: function() {
-		return this.domManip(arguments, false, 1, function(a){
-			this.parentNode.insertBefore( a, this );
-		});
-	},
-
-	after: function() {
-		return this.domManip(arguments, false, -1, function(a){
-			this.parentNode.insertBefore( a, this.nextSibling );
-		});
-	},
-
-	end: function() {
-		return this.prevObject || jQuery([]);
-	},
-
-	find: function(t) {
-		var data = jQuery.map(this, function(a){ return jQuery.find(t,a); });
-		return this.pushStack( /[^+>] [^+>]/.test( t ) || t.indexOf("..") > -1 ?
-			jQuery.unique( data ) : data );
-	},
-
-	clone: function(events) {
-		// Do the clone
-		var ret = this.map(function(){
-			return this.outerHTML ? jQuery(this.outerHTML)[0] : this.cloneNode(true);
-		});
-
-		// Need to set the expando to null on the cloned set if it exists
-		// removeData doesn't work here, IE removes it from the original as well
-		// this is primarily for IE but the data expando shouldn't be copied over in any browser
-		var clone = ret.find("*").andSelf().each(function(){
-			if ( this[ expando ] != undefined )
-				this[ expando ] = null;
-		});
-		
-		// Copy the events from the original to the clone
-		if (events === true)
-			this.find("*").andSelf().each(function(i) {
-				var events = jQuery.data(this, "events");
-				for ( var type in events )
-					for ( var handler in events[type] )
-						jQuery.event.add(clone[i], type, events[type][handler], events[type][handler].data);
-			});
-
-		// Return the cloned set
-		return ret;
-	},
-
-	filter: function(t) {
-		return this.pushStack(
-			jQuery.isFunction( t ) &&
-			jQuery.grep(this, function(el, index){
-				return t.apply(el, [index]);
-			}) ||
-
-			jQuery.multiFilter(t,this) );
-	},
-
-	not: function(t) {
-		return this.pushStack(
-			t.constructor == String &&
-			jQuery.multiFilter(t, this, true) ||
-
-			jQuery.grep(this, function(a) {
-				return ( t.constructor == Array || t.jquery )
-					? jQuery.inArray( a, t ) < 0
-					: a != t;
-			})
-		);
-	},
-
-	add: function(t) {
-		return this.pushStack( jQuery.merge(
-			this.get(),
-			t.constructor == String ?
-				jQuery(t).get() :
-				t.length != undefined && (!t.nodeName || jQuery.nodeName(t, "form")) ?
-					t : [t] )
-		);
-	},
-
-	is: function(expr) {
-		return expr ? jQuery.multiFilter(expr,this).length > 0 : false;
-	},
-
-	hasClass: function(expr) {
-		return this.is("." + expr);
-	},
-	
-	val: function( val ) {
-		if ( val == undefined ) {
-			if ( this.length ) {
-				var elem = this[0];
-		    	
-				// We need to handle select boxes special
-				if ( jQuery.nodeName(elem, "select") ) {
-					var index = elem.selectedIndex,
-						a = [],
-						options = elem.options,
-						one = elem.type == "select-one";
-					
-					// Nothing was selected
-					if ( index < 0 )
-						return null;
-
-					// Loop through all the selected options
-					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
-						var option = options[i];
-						if ( option.selected ) {
-							// Get the specifc value for the option
-							var val = jQuery.browser.msie && !option.attributes["value"].specified ? option.text : option.value;
-							
-							// We don't need an array for one selects
-							if ( one )
-								return val;
-							
-							// Multi-Selects return an array
-							a.push(val);
-						}
-					}
-					
-					return a;
-					
-				// Everything else, we just grab the value
-				} else
-					return this[0].value.replace(/\r/g, "");
-			}
-		} else
-			return this.each(function(){
-				if ( val.constructor == Array && /radio|checkbox/.test(this.type) )
-					this.checked = (jQuery.inArray(this.value, val) >= 0 ||
-						jQuery.inArray(this.name, val) >= 0);
-				else if ( jQuery.nodeName(this, "select") ) {
-					var tmp = val.constructor == Array ? val : [val];
-
-					jQuery("option", this).each(function(){
-						this.selected = (jQuery.inArray(this.value, tmp) >= 0 ||
-						jQuery.inArray(this.text, tmp) >= 0);
-					});
-
-					if ( !tmp.length )
-						this.selectedIndex = -1;
-				} else
-					this.value = val;
-			});
-	},
-	
-	html: function( val ) {
-		return val == undefined ?
-			( this.length ? this[0].innerHTML : null ) :
-			this.empty().append( val );
-	},
-
-	replaceWith: function( val ) {
-		return this.after( val ).remove();
-	},
-
-	eq: function(i){
-		return this.slice(i, i+1);
-	},
-
-	slice: function() {
-		return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
-	},
-
-	map: function(fn) {
-		return this.pushStack(jQuery.map( this, function(elem,i){
-			return fn.call( elem, i, elem );
-		}));
-	},
-
-	andSelf: function() {
-		return this.add( this.prevObject );
-	},
-	
-	domManip: function(args, table, dir, fn) {
-		var clone = this.length > 1, a; 
-
-		return this.each(function(){
-			if ( !a ) {
-				a = jQuery.clean(args, this.ownerDocument);
-				if ( dir < 0 )
-					a.reverse();
-			}
-
-			var obj = this;
-
-			if ( table && jQuery.nodeName(this, "table") && jQuery.nodeName(a[0], "tr") )
-				obj = this.getElementsByTagName("tbody")[0] || this.appendChild(document.createElement("tbody"));
-
-			jQuery.each( a, function(){
-				var elem = clone ? this.cloneNode(true) : this;
-				if ( !evalScript(0, elem) )
-					fn.call( obj, elem );
-			});
-		});
-	}
-};
-
-function evalScript(i, elem){
-	var script = jQuery.nodeName(elem, "script");
-
-	if ( script ) {
-		if ( elem.src )
-			jQuery.ajax({ url: elem.src, async: false, dataType: "script" });
-		else
-			jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
-	
-		if ( elem.parentNode )
-			elem.parentNode.removeChild(elem);
-
-	} else if ( elem.nodeType == 1 )
-    jQuery("script", elem).each(evalScript);
-
-	return script;
-}
-
-jQuery.extend = jQuery.fn.extend = function() {
-	// copy reference to target object
-	var target = arguments[0] || {}, a = 1, al = arguments.length, deep = false;
-
-	// Handle a deep copy situation
-	if ( target.constructor == Boolean ) {
-		deep = target;
-		target = arguments[1] || {};
-	}
-
-	// extend jQuery itself if only one argument is passed
-	if ( al == 1 ) {
-		target = this;
-		a = 0;
-	}
-
-	var prop;
-
-	for ( ; a < al; a++ )
-		// Only deal with non-null/undefined values
-		if ( (prop = arguments[a]) != null )
-			// Extend the base object
-			for ( var i in prop ) {
-				// Prevent never-ending loop
-				if ( target == prop[i] )
-					continue;
-
-				// Recurse if we're merging object values
-				if ( deep && typeof prop[i] == 'object' && target[i] )
-					jQuery.extend( target[i], prop[i] );
-
-				// Don't bring in undefined values
-				else if ( prop[i] != undefined )
-					target[i] = prop[i];
-			}
-
-	// Return the modified object
-	return target;
-};
-
-var expando = "jQuery" + (new Date()).getTime(), uuid = 0, win = {};
-
-jQuery.extend({
-	noConflict: function(deep) {
-		window.$ = _$;
-		if ( deep )
-			window.jQuery = _jQuery;
-		return jQuery;
-	},
-
-	// This may seem like some crazy code, but trust me when I say that this
-	// is the only cross-browser way to do this. --John
-	isFunction: function( fn ) {
-		return !!fn && typeof fn != "string" && !fn.nodeName && 
-			fn.constructor != Array && /function/i.test( fn + "" );
-	},
-	
-	// check if an element is in a XML document
-	isXMLDoc: function(elem) {
-		return elem.documentElement && !elem.body ||
-			elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
-	},
-
-	// Evalulates a script in a global context
-	// Evaluates Async. in Safari 2 :-(
-	globalEval: function( data ) {
-		data = jQuery.trim( data );
-		if ( data ) {
-			if ( window.execScript )
-				window.execScript( data );
-			else if ( jQuery.browser.safari )
-				// safari doesn't provide a synchronous global eval
-				window.setTimeout( data, 0 );
-			else
-				eval.call( window, data );
-		}
-	},
-
-	nodeName: function( elem, name ) {
-		return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
-	},
-	
-	cache: {},
-	
-	data: function( elem, name, data ) {
-		elem = elem == window ? win : elem;
-
-		var id = elem[ expando ];
-
-		// Compute a unique ID for the element
-		if ( !id ) 
-			id = elem[ expando ] = ++uuid;
-
-		// Only generate the data cache if we're
-		// trying to access or manipulate it
-		if ( name && !jQuery.cache[ id ] )
-			jQuery.cache[ id ] = {};
-		
-		// Prevent overriding the named cache with undefined values
-		if ( data != undefined )
-			jQuery.cache[ id ][ name ] = data;
-		
-		// Return the named cache data, or the ID for the element	
-		return name ? jQuery.cache[ id ][ name ] : id;
-	},
-	
-	removeData: function( elem, name ) {
-		elem = elem == window ? win : elem;
-
-		var id = elem[ expando ];
-
-		// If we want to remove a specific section of the element's data
-		if ( name ) {
-			if ( jQuery.cache[ id ] ) {
-				// Remove the section of cache data
-				delete jQuery.cache[ id ][ name ];
-
-				// If we've removed all the data, remove the element's cache
-				name = "";
-				for ( name in jQuery.cache[ id ] ) break;
-				if ( !name )
-					jQuery.removeData( elem );
-			}
-
-		// Otherwise, we want to remove all of the element's data
-		} else {
-			// Clean up the element expando
-			try {
-				delete elem[ expando ];
-			} catch(e){
-				// IE has trouble directly removing the expando
-				// but it's ok with using removeAttribute
-				if ( elem.removeAttribute )
-					elem.removeAttribute( expando );
-			}
-
-			// Completely remove the data cache
-			delete jQuery.cache[ id ];
-		}
-	},
-
-	// args is for internal usage only
-	each: function( obj, fn, args ) {
-		if ( args ) {
-			if ( obj.length == undefined )
-				for ( var i in obj )
-					fn.apply( obj[i], args );
-			else
-				for ( var i = 0, ol = obj.length; i < ol; i++ )
-					if ( fn.apply( obj[i], args ) === false ) break;
-
-		// A special, fast, case for the most common use of each
-		} else {
-			if ( obj.length == undefined )
-				for ( var i in obj )
-					fn.call( obj[i], i, obj[i] );
-			else
-				for ( var i = 0, ol = obj.length, val = obj[0]; 
-					i < ol && fn.call(val,i,val) !== false; val = obj[++i] ){}
-		}
-
-		return obj;
-	},
-	
-	prop: function(elem, value, type, index, prop){
-			// Handle executable functions
-			if ( jQuery.isFunction( value ) )
-				value = value.call( elem, [index] );
-				
-			// exclude the following css properties to add px
-			var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
-
-			// Handle passing in a number to a CSS property
-			return value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) ?
-				value + "px" :
-				value;
-	},
-
-	className: {
-		// internal only, use addClass("class")
-		add: function( elem, c ){
-			jQuery.each( (c || "").split(/\s+/), function(i, cur){
-				if ( !jQuery.className.has( elem.className, cur ) )
-					elem.className += ( elem.className ? " " : "" ) + cur;
-			});
-		},
-
-		// internal only, use removeClass("class")
-		remove: function( elem, c ){
-			elem.className = c != undefined ?
-				jQuery.grep( elem.className.split(/\s+/), function(cur){
-					return !jQuery.className.has( c, cur );	
-				}).join(" ") : "";
-		},
-
-		// internal only, use is(".class")
-		has: function( t, c ) {
-			return jQuery.inArray( c, (t.className || t).toString().split(/\s+/) ) > -1;
-		}
-	},
-
-	swap: function(e,o,f) {
-		for ( var i in o ) {
-			e.style["old"+i] = e.style[i];
-			e.style[i] = o[i];
-		}
-		f.apply( e, [] );
-		for ( var i in o )
-			e.style[i] = e.style["old"+i];
-	},
-
-	css: function(e,p) {
-		if ( p == "height" || p == "width" ) {
-			var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"];
-
-			jQuery.each( d, function(){
-				old["padding" + this] = 0;
-				old["border" + this + "Width"] = 0;
-			});
-
-			jQuery.swap( e, old, function() {
-				if ( jQuery(e).is(':visible') ) {
-					oHeight = e.offsetHeight;
-					oWidth = e.offsetWidth;
-				} else {
-					e = jQuery(e.cloneNode(true))
-						.find(":radio").removeAttr("checked").end()
-						.css({
-							visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0"
-						}).appendTo(e.parentNode)[0];
-
-					var parPos = jQuery.css(e.parentNode,"position") || "static";
-					if ( parPos == "static" )
-						e.parentNode.style.position = "relative";
-
-					oHeight = e.clientHeight;
-					oWidth = e.clientWidth;
-
-					if ( parPos == "static" )
-						e.parentNode.style.position = "static";
-
-					e.parentNode.removeChild(e);
-				}
-			});
-
-			return p == "height" ? oHeight : oWidth;
-		}
-
-		return jQuery.curCSS( e, p );
-	},
-
-	curCSS: function(elem, prop, force) {
-		var ret, stack = [], swap = [];
-
-		// A helper method for determining if an element's values are broken
-		function color(a){
-			if ( !jQuery.browser.safari )
-				return false;
-
-			var ret = document.defaultView.getComputedStyle(a,null);
-			return !ret || ret.getPropertyValue("color") == "";
-		}
-
-		if (prop == "opacity" && jQuery.browser.msie) {
-			ret = jQuery.attr(elem.style, "opacity");
-			return ret == "" ? "1" : ret;
-		}
-		
-		if (prop.match(/float/i))
-			prop = styleFloat;
-
-		if (!force && elem.style[prop])
-			ret = elem.style[prop];
-
-		else if (document.defaultView && document.defaultView.getComputedStyle) {
-
-			if (prop.match(/float/i))
-				prop = "float";
-
-			prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase();
-			var cur = document.defaultView.getComputedStyle(elem, null);
-
-			if ( cur && !color(elem) )
-				ret = cur.getPropertyValue(prop);
-
-			// If the element isn't reporting its values properly in Safari
-			// then some display: none elements are involved
-			else {
-				// Locate all of the parent display: none elements
-				for ( var a = elem; a && color(a); a = a.parentNode )
-					stack.unshift(a);
-
-				// Go through and make them visible, but in reverse
-				// (It would be better if we knew the exact display type that they had)
-				for ( a = 0; a < stack.length; a++ )
-					if ( color(stack[a]) ) {
-						swap[a] = stack[a].style.display;
-						stack[a].style.display = "block";
-					}
-
-				// Since we flip the display style, we have to handle that
-				// one special, otherwise get the value
-				ret = prop == "display" && swap[stack.length-1] != null ?
-					"none" :
-					document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop) || "";
-
-				// Finally, revert the display styles back
-				for ( a = 0; a < swap.length; a++ )
-					if ( swap[a] != null )
-						stack[a].style.display = swap[a];
-			}
-
-			if ( prop == "opacity" && ret == "" )
-				ret = "1";
-
-		} else if (elem.currentStyle) {
-			var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});
-			ret = elem.currentStyle[prop] || elem.currentStyle[newProp];
-
-			// From the awesome hack by Dean Edwards
-			// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
-			// If we're not dealing with a regular pixel number
-			// but a number that has a weird ending, we need to convert it to pixels
-			if ( !/^\d+(px)?$/i.test(ret) && /^\d/.test(ret) ) {
-				var style = elem.style.left;
-				var runtimeStyle = elem.runtimeStyle.left;
-				elem.runtimeStyle.left = elem.currentStyle.left;
-				elem.style.left = ret || 0;
-				ret = elem.style.pixelLeft + "px";
-				elem.style.left = style;
-				elem.runtimeStyle.left = runtimeStyle;
-			}
-		}
-
-		return ret;
-	},
-	
-	clean: function(a, doc) {
-		var r = [];
-		doc = doc || document;
-
-		jQuery.each( a, function(i,arg){
-			if ( !arg ) return;
-
-			if ( arg.constructor == Number )
-				arg = arg.toString();
-			
-			// Convert html string into DOM nodes
-			if ( typeof arg == "string" ) {
-				// Fix "XHTML"-style tags in all browsers
-				arg = arg.replace(/(<(\w+)[^>]*?)\/>/g, function(m, all, tag){
-					return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)? m : all+"></"+tag+">";
-				});
-
-				// Trim whitespace, otherwise indexOf won't work as expected
-				var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = [];
-
-				var wrap =
-					// option or optgroup
-					!s.indexOf("<opt") &&
-					[1, "<select>", "</select>"] ||
-					
-					!s.indexOf("<leg") &&
-					[1, "<fieldset>", "</fieldset>"] ||
-					
-					s.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
-					[1, "<table>", "</table>"] ||
-					
-					!s.indexOf("<tr") &&
-					[2, "<table><tbody>", "</tbody></table>"] ||
-					
-				 	// <thead> matched above
-					(!s.indexOf("<td") || !s.indexOf("<th")) &&
-					[3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
-					
-					!s.indexOf("<col") &&
-					[2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] ||
-
-					// IE can't serialize <link> and <script> tags normally
-					jQuery.browser.msie &&
-					[1, "div<div>", "</div>"] ||
-					
-					[0,"",""];
-
-				// Go to html and back, then peel off extra wrappers
-				div.innerHTML = wrap[1] + arg + wrap[2];
-				
-				// Move to the right depth
-				while ( wrap[0]-- )
-					div = div.lastChild;
-				
-				// Remove IE's autoinserted <tbody> from table fragments
-				if ( jQuery.browser.msie ) {
-					
-					// String was a <table>, *may* have spurious <tbody>
-					if ( !s.indexOf("<table") && s.indexOf("<tbody") < 0 ) 
-						tb = div.firstChild && div.firstChild.childNodes;
-						
-					// String was a bare <thead> or <tfoot>
-					else if ( wrap[1] == "<table>" && s.indexOf("<tbody") < 0 )
-						tb = div.childNodes;
-
-					for ( var n = tb.length-1; n >= 0 ; --n )
-						if ( jQuery.nodeName(tb[n], "tbody") && !tb[n].childNodes.length )
-							tb[n].parentNode.removeChild(tb[n]);
-	
-					// IE completely kills leading whitespace when innerHTML is used	
-					if ( /^\s/.test(arg) )	
-						div.insertBefore( doc.createTextNode( arg.match(/^\s*/)[0] ), div.firstChild );
-
-				}
-				
-				arg = jQuery.makeArray( div.childNodes );
-			}
-
-			if ( 0 === arg.length && (!jQuery.nodeName(arg, "form") && !jQuery.nodeName(arg, "select")) )
-				return;
-
-			if ( arg[0] == undefined || jQuery.nodeName(arg, "form") || arg.options )
-				r.push( arg );
-			else
-				r = jQuery.merge( r, arg );
-
-		});
-
-		return r;
-	},
-	
-	attr: function(elem, name, value){
-		var fix = jQuery.isXMLDoc(elem) ? {} : jQuery.props;
-
-		// Safari mis-reports the default selected property of a hidden option
-		// Accessing the parent's selectedIndex property fixes it
-		if ( name == "selected" && jQuery.browser.safari )
-			elem.parentNode.selectedIndex;
-		
-		// Certain attributes only work when accessed via the old DOM 0 way
-		if ( fix[name] ) {
-			if ( value != undefined ) elem[fix[name]] = value;
-			return elem[fix[name]];
-		} else if ( jQuery.browser.msie && name == "style" )
-			return jQuery.attr( elem.style, "cssText", value );
-
-		else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName(elem, "form") && (name == "action" || name == "method") )
-			return elem.getAttributeNode(name).nodeValue;
-
-		// IE elem.getAttribute passes even for style
-		else if ( elem.tagName ) {
-
-			if ( value != undefined ) {
-				if ( name == "type" && jQuery.nodeName(elem,"input") && elem.parentNode )
-					throw "type property can't be changed";
-				elem.setAttribute( name, value );
-			}
-
-			if ( jQuery.browser.msie && /href|src/.test(name) && !jQuery.isXMLDoc(elem) ) 
-				return elem.getAttribute( name, 2 );
-
-			return elem.getAttribute( name );
-
-		// elem is actually elem.style ... set the style
-		} else {
-			// IE actually uses filters for opacity
-			if ( name == "opacity" && jQuery.browser.msie ) {
-				if ( value != undefined ) {
-					// IE has trouble with opacity if it does not have layout
-					// Force it by setting the zoom level
-					elem.zoom = 1; 
-	
-					// Set the alpha filter to set the opacity
-					elem.filter = (elem.filter || "").replace(/alpha\([^)]*\)/,"") +
-						(parseFloat(value).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
-				}
-	
-				return elem.filter ? 
-					(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100).toString() : "";
-			}
-			name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});
-			if ( value != undefined ) elem[name] = value;
-			return elem[name];
-		}
-	},
-	
-	trim: function(t){
-		return (t||"").replace(/^\s+|\s+$/g, "");
-	},
-
-	makeArray: function( a ) {
-		var r = [];
-
-		// Need to use typeof to fight Safari childNodes crashes
-		if ( typeof a != "array" )
-			for ( var i = 0, al = a.length; i < al; i++ )
-				r.push( a[i] );
-		else
-			r = a.slice( 0 );
-
-		return r;
-	},
-
-	inArray: function( b, a ) {
-		for ( var i = 0, al = a.length; i < al; i++ )
-			if ( a[i] == b )
-				return i;
-		return -1;
-	},
-
-	merge: function(first, second) {
-		// We have to loop this way because IE & Opera overwrite the length
-		// expando of getElementsByTagName
-
-		// Also, we need to make sure that the correct elements are being returned
-		// (IE returns comment nodes in a '*' query)
-		if ( jQuery.browser.msie ) {
-			for ( var i = 0; second[i]; i++ )
-				if ( second[i].nodeType != 8 )
-					first.push(second[i]);
-		} else
-			for ( var i = 0; second[i]; i++ )
-				first.push(second[i]);
-
-		return first;
-	},
-
-	unique: function(first) {
-		var r = [], done = {};
-
-		try {
-			for ( var i = 0, fl = first.length; i < fl; i++ ) {
-				var id = jQuery.data(first[i]);
-				if ( !done[id] ) {
-					done[id] = true;
-					r.push(first[i]);
-				}
-			}
-		} catch(e) {
-			r = first;
-		}
-
-		return r;
-	},
-
-	grep: function(elems, fn, inv) {
-		// If a string is passed in for the function, make a function
-		// for it (a handy shortcut)
-		if ( typeof fn == "string" )
-			fn = eval("false||function(a,i){return " + fn + "}");
-
-		var result = [];
-
-		// Go through the array, only saving the items
-		// that pass the validator function
-		for ( var i = 0, el = elems.length; i < el; i++ )
-			if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )
-				result.push( elems[i] );
-
-		return result;
-	},
-
-	map: function(elems, fn) {
-		// If a string is passed in for the function, make a function
-		// for it (a handy shortcut)
-		if ( typeof fn == "string" )
-			fn = eval("false||function(a){return " + fn + "}");
-
-		var result = [];
-
-		// Go through the array, translating each of the items to their
-		// new value (or values).
-		for ( var i = 0, el = elems.length; i < el; i++ ) {
-			var val = fn(elems[i],i);
-
-			if ( val !== null && val != undefined ) {
-				if ( val.constructor != Array ) val = [val];
-				result = result.concat( val );
-			}
-		}
-
-		return result;
-	}
-});
-
-var userAgent = navigator.userAgent.toLowerCase();
-
-// Figure out what browser is being used
-jQuery.browser = {
-	version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
-	safari: /webkit/.test(userAgent),
-	opera: /opera/.test(userAgent),
-	msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
-	mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
-};
-
-var styleFloat = jQuery.browser.msie ? "styleFloat" : "cssFloat";
-	
-jQuery.extend({
-	// Check to see if the W3C box model is being used
-	boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",
-	
-	styleFloat: jQuery.browser.msie ? "styleFloat" : "cssFloat",
-	
-	props: {
-		"for": "htmlFor",
-		"class": "className",
-		"float": styleFloat,
-		cssFloat: styleFloat,
-		styleFloat: styleFloat,
-		innerHTML: "innerHTML",
-		className: "className",
-		value: "value",
-		disabled: "disabled",
-		checked: "checked",
-		readonly: "readOnly",
-		selected: "selected",
-		maxlength: "maxLength"
-	}
-});
-
-jQuery.each({
-	parent: "a.parentNode",
-	parents: "jQuery.dir(a,'parentNode')",
-	next: "jQuery.nth(a,2,'nextSibling')",
-	prev: "jQuery.nth(a,2,'previousSibling')",
-	nextAll: "jQuery.dir(a,'nextSibling')",
-	prevAll: "jQuery.dir(a,'previousSibling')",
-	siblings: "jQuery.sibling(a.parentNode.firstChild,a)",
-	children: "jQuery.sibling(a.firstChild)",
-	contents: "jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"
-}, function(i,n){
-	jQuery.fn[ i ] = function(a) {
-		var ret = jQuery.map(this,n);
-		if ( a && typeof a == "string" )
-			ret = jQuery.multiFilter(a,ret);
-		return this.pushStack( jQuery.unique(ret) );
-	};
-});
-
-jQuery.each({
-	appendTo: "append",
-	prependTo: "prepend",
-	insertBefore: "before",
-	insertAfter: "after",
-	replaceAll: "replaceWith"
-}, function(i,n){
-	jQuery.fn[ i ] = function(){
-		var a = arguments;
-		return this.each(function(){
-			for ( var j = 0, al = a.length; j < al; j++ )
-				jQuery(a[j])[n]( this );
-		});
-	};
-});
-
-jQuery.each( {
-	removeAttr: function( key ) {
-		jQuery.attr( this, key, "" );
-		this.removeAttribute( key );
-	},
-	addClass: function(c){
-		jQuery.className.add(this,c);
-	},
-	removeClass: function(c){
-		jQuery.className.remove(this,c);
-	},
-	toggleClass: function( c ){
-		jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this, c);
-	},
-	remove: function(a){
-		if ( !a || jQuery.filter( a, [this] ).r.length ) {
-			jQuery.removeData( this );
-			this.parentNode.removeChild( this );
-		}
-	},
-	empty: function() {
-		// Clean up the cache
-		jQuery("*", this).each(function(){ jQuery.removeData(this); });
-
-		while ( this.firstChild )
-			this.removeChild( this.firstChild );
-	}
-}, function(i,n){
-	jQuery.fn[ i ] = function() {
-		return this.each( n, arguments );
-	};
-});
-
-jQuery.each( [ "Height", "Width" ], function(i,name){
-	var n = name.toLowerCase();
-	
-	jQuery.fn[ n ] = function(h) {
-		return this[0] == window ?
-			jQuery.browser.safari && self["inner" + name] ||
-			jQuery.boxModel && Math.max(document.documentElement["client" + name], document.body["client" + name]) ||
-			document.body["client" + name] :
-		
-			this[0] == document ?
-				Math.max( document.body["scroll" + name], document.body["offset" + name] ) :
-        
-				h == undefined ?
-					( this.length ? jQuery.css( this[0], n ) : null ) :
-					this.css( n, h.constructor == String ? h : h + "px" );
-	};
-});
-
-var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
-		"(?:[\\w*_-]|\\\\.)" :
-		"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
-	quickChild = new RegExp("^>\\s*(" + chars + "+)"),
-	quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
-	quickClass = new RegExp("^([#.]?)(" + chars + "*)");
-
-jQuery.extend({
-	expr: {
-		"": "m[2]=='*'||jQuery.nodeName(a,m[2])",
-		"#": "a.getAttribute('id')==m[2]",
-		":": {
-			// Position Checks
-			lt: "i<m[3]-0",
-			gt: "i>m[3]-0",
-			nth: "m[3]-0==i",
-			eq: "m[3]-0==i",
-			first: "i==0",
-			last: "i==r.length-1",
-			even: "i%2==0",
-			odd: "i%2",
-
-			// Child Checks
-			"first-child": "a.parentNode.getElementsByTagName('*')[0]==a",
-			"last-child": "jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a",
-			"only-child": "!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",
-
-			// Parent Checks
-			parent: "a.firstChild",
-			empty: "!a.firstChild",
-
-			// Text Check
-			contains: "(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",
-
-			// Visibility
-			visible: '"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',
-			hidden: '"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',
-
-			// Form attributes
-			enabled: "!a.disabled",
-			disabled: "a.disabled",
-			checked: "a.checked",
-			selected: "a.selected||jQuery.attr(a,'selected')",
-
-			// Form elements
-			text: "'text'==a.type",
-			radio: "'radio'==a.type",
-			checkbox: "'checkbox'==a.type",
-			file: "'file'==a.type",
-			password: "'password'==a.type",
-			submit: "'submit'==a.type",
-			image: "'image'==a.type",
-			reset: "'reset'==a.type",
-			button: '"button"==a.type||jQuery.nodeName(a,"button")',
-			input: "/input|select|textarea|button/i.test(a.nodeName)",
-
-			// :has()
-			has: "jQuery.find(m[3],a).length",
-
-			// :header
-			header: "/h\\d/i.test(a.nodeName)",
-
-			// :animated
-			animated: "jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"
-		}
-	},
-	
-	// The regular expressions that power the parsing engine
-	parse: [
-		// Match: [@value='test'], [@foo]
-		/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,
-
-		// Match: :contains('foo')
-		/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,
-
-		// Match: :even, :last-chlid, #id, .class
-		new RegExp("^([:.#]*)(" + chars + "+)")
-	],
-
-	multiFilter: function( expr, elems, not ) {
-		var old, cur = [];
-
-		while ( expr && expr != old ) {
-			old = expr;
-			var f = jQuery.filter( expr, elems, not );
-			expr = f.t.replace(/^\s*,\s*/, "" );
-			cur = not ? elems = f.r : jQuery.merge( cur, f.r );
-		}
-
-		return cur;
-	},
-
-	find: function( t, context ) {
-		// Quickly handle non-string expressions
-		if ( typeof t != "string" )
-			return [ t ];
-
-		// Make sure that the context is a DOM Element
-		if ( context && !context.nodeType )
-			context = null;
-
-		// Set the correct context (if none is provided)
-		context = context || document;
-
-		// Initialize the search
-		var ret = [context], done = [], last;
-
-		// Continue while a selector expression exists, and while
-		// we're no longer looping upon ourselves
-		while ( t && last != t ) {
-			var r = [];
-			last = t;
-
-			t = jQuery.trim(t);
-
-			var foundToken = false;
-
-			// An attempt at speeding up child selectors that
-			// point to a specific element tag
-			var re = quickChild;
-			var m = re.exec(t);
-
-			if ( m ) {
-				var nodeName = m[1].toUpperCase();
-
-				// Perform our own iteration and filter
-				for ( var i = 0; ret[i]; i++ )
-					for ( var c = ret[i].firstChild; c; c = c.nextSibling )
-						if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName.toUpperCase()) )
-							r.push( c );
-
-				ret = r;
-				t = t.replace( re, "" );
-				if ( t.indexOf(" ") == 0 ) continue;
-				foundToken = true;
-			} else {
-				re = /^([>+~])\s*(\w*)/i;
-
-				if ( (m = re.exec(t)) != null ) {
-					r = [];
-
-					var nodeName = m[2], merge = {};
-					m = m[1];
-
-					for ( var j = 0, rl = ret.length; j < rl; j++ ) {
-						var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
-						for ( ; n; n = n.nextSibling )
-							if ( n.nodeType == 1 ) {
-								var id = jQuery.data(n);
-
-								if ( m == "~" && merge[id] ) break;
-								
-								if (!nodeName || n.nodeName.toUpperCase() == nodeName.toUpperCase() ) {
-									if ( m == "~" ) merge[id] = true;
-									r.push( n );
-								}
-								
-								if ( m == "+" ) break;
-							}
-					}
-
-					ret = r;
-
-					// And remove the token
-					t = jQuery.trim( t.replace( re, "" ) );
-					foundToken = true;
-				}
-			}
-
-			// See if there's still an expression, and that we haven't already
-			// matched a token
-			if ( t && !foundToken ) {
-				// Handle multiple expressions
-				if ( !t.indexOf(",") ) {
-					// Clean the result set
-					if ( context == ret[0] ) ret.shift();
-
-					// Merge the result sets
-					done = jQuery.merge( done, ret );
-
-					// Reset the context
-					r = ret = [context];
-
-					// Touch up the selector string
-					t = " " + t.substr(1,t.length);
-
-				} else {
-					// Optimize for the case nodeName#idName
-					var re2 = quickID;
-					var m = re2.exec(t);
-					
-					// Re-organize the results, so that they're consistent
-					if ( m ) {
-					   m = [ 0, m[2], m[3], m[1] ];
-
-					} else {
-						// Otherwise, do a traditional filter check for
-						// ID, class, and element selectors
-						re2 = quickClass;
-						m = re2.exec(t);
-					}
-
-					m[2] = m[2].replace(/\\/g, "");
-
-					var elem = ret[ret.length-1];
-
-					// Try to do a global search by ID, where we can
-					if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
-						// Optimization for HTML document case
-						var oid = elem.getElementById(m[2]);
-						
-						// Do a quick check for the existence of the actual ID attribute
-						// to avoid selecting by the name attribute in IE
-						// also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
-						if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
-							oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
-
-						// Do a quick check for node name (where applicable) so
-						// that div#foo searches will be really fast
-						ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
-					} else {
-						// We need to find all descendant elements
-						for ( var i = 0; ret[i]; i++ ) {
-							// Grab the tag name being searched for
-							var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];
-
-							// Handle IE7 being really dumb about <object>s
-							if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
-								tag = "param";
-
-							r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
-						}
-
-						// It's faster to filter by class and be done with it
-						if ( m[1] == "." )
-							r = jQuery.classFilter( r, m[2] );
-
-						// Same with ID filtering
-						if ( m[1] == "#" ) {
-							var tmp = [];
-
-							// Try to find the element with the ID
-							for ( var i = 0; r[i]; i++ )
-								if ( r[i].getAttribute("id") == m[2] ) {
-									tmp = [ r[i] ];
-									break;
-								}
-
-							r = tmp;
-						}
-
-						ret = r;
-					}
-
-					t = t.replace( re2, "" );
-				}
-
-			}
-
-			// If a selector string still exists
-			if ( t ) {
-				// Attempt to filter it
-				var val = jQuery.filter(t,r);
-				ret = r = val.r;
-				t = jQuery.trim(val.t);
-			}
-		}
-
-		// An error occurred with the selector;
-		// just return an empty set instead
-		if ( t )
-			ret = [];
-
-		// Remove the root context
-		if ( ret && context == ret[0] )
-			ret.shift();
-
-		// And combine the results
-		done = jQuery.merge( done, ret );
-
-		return done;
-	},
-
-	classFilter: function(r,m,not){
-		m = " " + m + " ";
-		var tmp = [];
-		for ( var i = 0; r[i]; i++ ) {
-			var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
-			if ( !not && pass || not && !pass )
-				tmp.push( r[i] );
-		}
-		return tmp;
-	},
-
-	filter: function(t,r,not) {
-		var last;
-
-		// Look for common filter expressions
-		while ( t  && t != last ) {
-			last = t;
-
-			var p = jQuery.parse, m;
-
-			for ( var i = 0; p[i]; i++ ) {
-				m = p[i].exec( t );
-
-				if ( m ) {
-					// Remove what we just matched
-					t = t.substring( m[0].length );
-
-					m[2] = m[2].replace(/\\/g, "");
-					break;
-				}
-			}
-
-			if ( !m )
-				break;
-
-			// :not() is a special case that can be optimized by
-			// keeping it out of the expression list
-			if ( m[1] == ":" && m[2] == "not" )
-				r = jQuery.filter(m[3], r, true).r;
-
-			// We can get a big speed boost by filtering by class here
-			else if ( m[1] == "." )
-				r = jQuery.classFilter(r, m[2], not);
-
-			else if ( m[1] == "[" ) {
-				var tmp = [], type = m[3];
-				
-				for ( var i = 0, rl = r.length; i < rl; i++ ) {
-					var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
-					
-					if ( z == null || /href|src|selected/.test(m[2]) )
-						z = jQuery.attr(a,m[2]) || '';
-
-					if ( (type == "" && !!z ||
-						 type == "=" && z == m[5] ||
-						 type == "!=" && z != m[5] ||
-						 type == "^=" && z && !z.indexOf(m[5]) ||
-						 type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
-						 (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
-							tmp.push( a );
-				}
-				
-				r = tmp;
-
-			// We can get a speed boost by handling nth-child here
-			} else if ( m[1] == ":" && m[2] == "nth-child" ) {
-				var merge = {}, tmp = [],
-					test = /(\d*)n\+?(\d*)/.exec(
-						m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
-						!/\D/.test(m[3]) && "n+" + m[3] || m[3]),
-					first = (test[1] || 1) - 0, last = test[2] - 0;
-
-				for ( var i = 0, rl = r.length; i < rl; i++ ) {
-					var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);
-
-					if ( !merge[id] ) {
-						var c = 1;
-
-						for ( var n = parentNode.firstChild; n; n = n.nextSibling )
-							if ( n.nodeType == 1 )
-								n.nodeIndex = c++;
-
-						merge[id] = true;
-					}
-
-					var add = false;
-
-					if ( first == 1 ) {
-						if ( last == 0 || node.nodeIndex == last )
-							add = true;
-					} else if ( (node.nodeIndex + last) % first == 0 )
-						add = true;
-
-					if ( add ^ not )
-						tmp.push( node );
-				}
-
-				r = tmp;
-
-			// Otherwise, find the expression to execute
-			} else {
-				var f = jQuery.expr[m[1]];
-				if ( typeof f != "string" )
-					f = jQuery.expr[m[1]][m[2]];
-
-				// Build a custom macro to enclose it
-				f = eval("false||function(a,i){return " + f + "}");
-
-				// Execute it against the current filter
-				r = jQuery.grep( r, f, not );
-			}
-		}
-
-		// Return an array of filtered elements (r)
-		// and the modified expression string (t)
-		return { r: r, t: t };
-	},
-
-	dir: function( elem, dir ){
-		var matched = [];
-		var cur = elem[dir];
-		while ( cur && cur != document ) {
-			if ( cur.nodeType == 1 )
-				matched.push( cur );
-			cur = cur[dir];
-		}
-		return matched;
-	},
-	
-	nth: function(cur,result,dir,elem){
-		result = result || 1;
-		var num = 0;
-
-		for ( ; cur; cur = cur[dir] )
-			if ( cur.nodeType == 1 && ++num == result )
-				break;
-
-		return cur;
-	},
-	
-	sibling: function( n, elem ) {
-		var r = [];
-
-		for ( ; n; n = n.nextSibling ) {
-			if ( n.nodeType == 1 && (!elem || n != elem) )
-				r.push( n );
-		}
-
-		return r;
-	}
-});
-/*
- * A number of helper functions used for managing events.
- * Many of the ideas behind this code orignated from 
- * Dean Edwards' addEvent library.
- */
-jQuery.event = {
-
-	// Bind an event to an element
-	// Original by Dean Edwards
-	add: function(element, type, handler, data) {
-		// For whatever reason, IE has trouble passing the window object
-		// around, causing it to be cloned in the process
-		if ( jQuery.browser.msie && element.setInterval != undefined )
-			element = window;
-
-		// Make sure that the function being executed has a unique ID
-		if ( !handler.guid )
-			handler.guid = this.guid++;
-			
-		// if data is passed, bind to handler 
-		if( data != undefined ) { 
-        		// Create temporary function pointer to original handler 
-			var fn = handler; 
-
-			// Create unique handler function, wrapped around original handler 
-			handler = function() { 
-				// Pass arguments and context to original handler 
-				return fn.apply(this, arguments); 
-			};
-
-			// Store data in unique handler 
-			handler.data = data;
-
-			// Set the guid of unique handler to the same of original handler, so it can be removed 
-			handler.guid = fn.guid;
-		}
-
-		// Namespaced event handlers
-		var parts = type.split(".");
-		type = parts[0];
-		handler.type = parts[1];
-
-		// Init the element's event structure
-		var events = jQuery.data(element, "events") || jQuery.data(element, "events", {});
-		
-		var handle = jQuery.data(element, "handle", function(){
-			// returned undefined or false
-			var val;
-
-			// Handle the second event of a trigger and when
-			// an event is called after a page has unloaded
-			if ( typeof jQuery == "undefined" || jQuery.event.triggered )
-				return val;
-			
-			val = jQuery.event.handle.apply(element, arguments);
-			
-			return val;
-		});
-
-		// Get the current list of functions bound to this event
-		var handlers = events[type];
-
-		// Init the event handler queue
-		if (!handlers) {
-			handlers = events[type] = {};	
-			
-			// And bind the global event handler to the element
-			if (element.addEventListener)
-				element.addEventListener(type, handle, false);
-			else
-				element.attachEvent("on" + type, handle);
-		}
-
-		// Add the function to the element's handler list
-		handlers[handler.guid] = handler;
-
-		// Keep track of which events have been used, for global triggering
-		this.global[type] = true;
-	},
-
-	guid: 1,
-	global: {},
-
-	// Detach an event or set of events from an element
-	remove: function(element, type, handler) {
-		var events = jQuery.data(element, "events"), ret, index;
-
-		// Namespaced event handlers
-		if ( typeof type == "string" ) {
-			var parts = type.split(".");
-			type = parts[0];
-		}
-
-		if ( events ) {
-			// type is actually an event object here
-			if ( type && type.type ) {
-				handler = type.handler;
-				type = type.type;
-			}
-			
-			if ( !type ) {
-				for ( type in events )
-					this.remove( element, type );
-
-			} else if ( events[type] ) {
-				// remove the given handler for the given type
-				if ( handler )
-					delete events[type][handler.guid];
-				
-				// remove all handlers for the given type
-				else
-					for ( handler in events[type] )
-						// Handle the removal of namespaced events
-						if ( !parts[1] || events[type][handler].type == parts[1] )
-							delete events[type][handler];
-
-				// remove generic event handler if no more handlers exist
-				for ( ret in events[type] ) break;
-				if ( !ret ) {
-					if (element.removeEventListener)
-						element.removeEventListener(type, jQuery.data(element, "handle"), false);
-					else
-						element.detachEvent("on" + type, jQuery.data(element, "handle"));
-					ret = null;
-					delete events[type];
-				}
-			}
-
-			// Remove the expando if it's no longer used
-			for ( ret in events ) break;
-			if ( !ret ) {
-				jQuery.removeData( element, "events" );
-				jQuery.removeData( element, "handle" );
-			}
-		}
-	},
-
-	trigger: function(type, data, element, donative, extra) {
-		// Clone the incoming data, if any
-		data = jQuery.makeArray(data || []);
-
-		// Handle a global trigger
-		if ( !element ) {
-			// Only trigger if we've ever bound an event for it
-			if ( this.global[type] )
-				jQuery("*").add([window, document]).trigger(type, data);
-
-		// Handle triggering a single element
-		} else {
-			var val, ret, fn = jQuery.isFunction( element[ type ] || null ),
-				// Check to see if we need to provide a fake event, or not
-				evt = !data[0] || !data[0].preventDefault;
-			
-			// Pass along a fake event
-			if ( evt )
-				data.unshift( this.fix({ type: type, target: element }) );
-
-			// Enforce the right trigger type
-			data[0].type = type;
-
-			// Trigger the event
-			if ( jQuery.isFunction( jQuery.data(element, "handle") ) )
-				val = jQuery.data(element, "handle").apply( element, data );
-
-			// Handle triggering native .onfoo handlers
-			if ( !fn && element["on"+type] && element["on"+type].apply( element, data ) === false )
-				val = false;
-
-			// Extra functions don't get the custom event object
-			if ( evt )
-				data.shift();
-
-			// Handle triggering of extra function
-			if ( extra && extra.apply( element, data ) === false )
-				val = false;
-
-			// Trigger the native events (except for clicks on links)
-			if ( fn && donative !== false && val !== false && !(jQuery.nodeName(element, 'a') && type == "click") ) {
-				this.triggered = true;
-				element[ type ]();
-			}
-
-			this.triggered = false;
-		}
-
-		return val;
-	},
-
-	handle: function(event) {
-		// returned undefined or false
-		var val;
-
-		// Empty object is for triggered events with no data
-		event = jQuery.event.fix( event || window.event || {} ); 
-
-		// Namespaced event handlers
-		var parts = event.type.split(".");
-		event.type = parts[0];
-
-		var c = jQuery.data(this, "events") && jQuery.data(this, "events")[event.type], args = Array.prototype.slice.call( arguments, 1 );
-		args.unshift( event );
-
-		for ( var j in c ) {
-			// Pass in a reference to the handler function itself
-			// So that we can later remove it
-			args[0].handler = c[j];
-			args[0].data = c[j].data;
-
-			// Filter the functions by class
-			if ( !parts[1] || c[j].type == parts[1] ) {
-				var tmp = c[j].apply( this, args );
-
-				if ( val !== false )
-					val = tmp;
-
-				if ( tmp === false ) {
-					event.preventDefault();
-					event.stopPropagation();
-				}
-			}
-		}
-
-		// Clean up added properties in IE to prevent memory leak
-		if (jQuery.browser.msie)
-			event.target = event.preventDefault = event.stopPropagation =
-				event.handler = event.data = null;
-
-		return val;
-	},
-
-	fix: function(event) {
-		// store a copy of the original event object 
-		// and clone to set read-only properties
-		var originalEvent = event;
-		event = jQuery.extend({}, originalEvent);
-		
-		// add preventDefault and stopPropagation since 
-		// they will not work on the clone
-		event.preventDefault = function() {
-			// if preventDefault exists run it on the original event
-			if (originalEvent.preventDefault)
-				originalEvent.preventDefault();
-			// otherwise set the returnValue property of the original event to false (IE)
-			originalEvent.returnValue = false;
-		};
-		event.stopPropagation = function() {
-			// if stopPropagation exists run it on the original event
-			if (originalEvent.stopPropagation)
-				originalEvent.stopPropagation();
-			// otherwise set the cancelBubble property of the original event to true (IE)
-			originalEvent.cancelBubble = true;
-		};
-		
-		// Fix target property, if necessary
-		if ( !event.target && event.srcElement )
-			event.target = event.srcElement;
-				
-		// check if target is a textnode (safari)
-		if (jQuery.browser.safari && event.target.nodeType == 3)
-			event.target = originalEvent.target.parentNode;
-
-		// Add relatedTarget, if necessary
-		if ( !event.relatedTarget && event.fromElement )
-			event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
-
-		// Calculate pageX/Y if missing and clientX/Y available
-		if ( event.pageX == null && event.clientX != null ) {
-			var e = document.documentElement, b = document.body;
-			event.pageX = event.clientX + (e && e.scrollLeft || b.scrollLeft || 0);
-			event.pageY = event.clientY + (e && e.scrollTop || b.scrollTop || 0);
-		}
-			
-		// Add which for key events
-		if ( !event.which && (event.charCode || event.keyCode) )
-			event.which = event.charCode || event.keyCode;
-		
-		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
-		if ( !event.metaKey && event.ctrlKey )
-			event.metaKey = event.ctrlKey;
-
-		// Add which for click: 1 == left; 2 == middle; 3 == right
-		// Note: button is not normalized, so don't use it
-		if ( !event.which && event.button )
-			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
-			
-		return event;
-	}
-};
-
-jQuery.fn.extend({
-	bind: function( type, data, fn ) {
-		return type == "unload" ? this.one(type, data, fn) : this.each(function(){
-			jQuery.event.add( this, type, fn || data, fn && data );
-		});
-	},
-	
-	one: function( type, data, fn ) {
-		return this.each(function(){
-			jQuery.event.add( this, type, function(event) {
-				jQuery(this).unbind(event);
-				return (fn || data).apply( this, arguments);
-			}, fn && data);
-		});
-	},
-
-	unbind: function( type, fn ) {
-		return this.each(function(){
-			jQuery.event.remove( this, type, fn );
-		});
-	},
-
-	trigger: function( type, data, fn ) {
-		return this.each(function(){
-			jQuery.event.trigger( type, data, this, true, fn );
-		});
-	},
-
-	triggerHandler: function( type, data, fn ) {
-		if ( this[0] )
-			return jQuery.event.trigger( type, data, this[0], false, fn );
-	},
-
-	toggle: function() {
-		// Save reference to arguments for access in closure
-		var a = arguments;
-
-		return this.click(function(e) {
-			// Figure out which function to execute
-			this.lastToggle = 0 == this.lastToggle ? 1 : 0;
-			
-			// Make sure that clicks stop
-			e.preventDefault();
-			
-			// and execute the function
-			return a[this.lastToggle].apply( this, [e] ) || false;
-		});
-	},
-
-	hover: function(f,g) {
-		
-		// A private function for handling mouse 'hovering'
-		function handleHover(e) {
-			// Check if mouse(over|out) are still within the same parent element
-			var p = e.relatedTarget;
-	
-			// Traverse up the tree
-			while ( p && p != this ) try { p = p.parentNode; } catch(e) { p = this; };
-			
-			// If we actually just moused on to a sub-element, ignore it
-			if ( p == this ) return false;
-			
-			// Execute the right function
-			return (e.type == "mouseover" ? f : g).apply(this, [e]);
-		}
-		
-		// Bind the function to the two event listeners
-		return this.mouseover(handleHover).mouseout(handleHover);
-	},
-	
-	ready: function(f) {
-		// Attach the listeners
-		bindReady();
-
-		// If the DOM is already ready
-		if ( jQuery.isReady )
-			// Execute the function immediately
-			f.apply( document, [jQuery] );
-			
-		// Otherwise, remember the function for later
-		else
-			// Add the function to the wait list
-			jQuery.readyList.push( function() { return f.apply(this, [jQuery]); } );
-	
-		return this;
-	}
-});
-
-jQuery.extend({
-	/*
-	 * All the code that makes DOM Ready work nicely.
-	 */
-	isReady: false,
-	readyList: [],
-	
-	// Handle when the DOM is ready
-	ready: function() {
-		// Make sure that the DOM is not already loaded
-		if ( !jQuery.isReady ) {
-			// Remember that the DOM is ready
-			jQuery.isReady = true;
-			
-			// If there are functions bound, to execute
-			if ( jQuery.readyList ) {
-				// Execute all of them
-				jQuery.each( jQuery.readyList, function(){
-					this.apply( document );
-				});
-				
-				// Reset the list of functions
-				jQuery.readyList = null;
-			}
-			// Remove event listener to avoid memory leak
-			if ( jQuery.browser.mozilla || jQuery.browser.opera )
-				document.removeEventListener( "DOMContentLoaded", jQuery.ready, false );
-			
-			// Remove script element used by IE hack
-			if( !window.frames.length ) // don't remove if frames are present (#1187)
-				jQuery(window).load(function(){ jQuery("#__ie_init").remove(); });
-		}
-	}
-});
-
-jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
-	"mousedown,mouseup,mousemove,mouseover,mouseout,change,select," + 
-	"submit,keydown,keypress,keyup,error").split(","), function(i,o){
-	
-	// Handle event binding
-	jQuery.fn[o] = function(f){
-		return f ? this.bind(o, f) : this.trigger(o);
-	};
-});
-
-var readyBound = false;
-
-function bindReady(){
-	if ( readyBound ) return;
-	readyBound = true;
-
-	// If Mozilla is used
-	if ( jQuery.browser.mozilla || jQuery.browser.opera )
-		// Use the handy event callback
-		document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
-	
-	// If IE is used, use the excellent hack by Matthias Miller
-	// http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited
-	else if ( jQuery.browser.msie ) {
-	
-		// Only works if you document.write() it
-		document.write("<scr" + "ipt id=__ie_init defer=true " + 
-			"src=//:><\/script>");
-	
-		// Use the defer script hack
-		var script = document.getElementById("__ie_init");
-		
-		// script does not exist if jQuery is loaded dynamically
-		if ( script ) 
-			script.onreadystatechange = function() {
-				if ( this.readyState != "complete" ) return;
-				jQuery.ready();
-			};
-	
-		// Clear from memory
-		script = null;
-	
-	// If Safari  is used
-	} else if ( jQuery.browser.safari )
-		// Continually check to see if the document.readyState is valid
-		jQuery.safariTimer = setInterval(function(){
-			// loaded and complete are both valid states
-			if ( document.readyState == "loaded" || 
-				document.readyState == "complete" ) {
-	
-				// If either one are found, remove the timer
-				clearInterval( jQuery.safariTimer );
-				jQuery.safariTimer = null;
-	
-				// and execute any waiting functions
-				jQuery.ready();
-			}
-		}, 10); 
-
-	// A fallback to window.onload, that will always work
-	jQuery.event.add( window, "load", jQuery.ready );
-}
-jQuery.fn.extend({
-	load: function( url, params, callback ) {
-		if ( jQuery.isFunction( url ) )
-			return this.bind("load", url);
-
-		var off = url.indexOf(" ");
-		if ( off >= 0 ) {
-			var selector = url.slice(off, url.length);
-			url = url.slice(0, off);
-		}
-
-		callback = callback || function(){};
-
-		// Default to a GET request
-		var type = "GET";
-
-		// If the second parameter was provided
-		if ( params )
-			// If it's a function
-			if ( jQuery.isFunction( params ) ) {
-				// We assume that it's the callback
-				callback = params;
-				params = null;
-
-			// Otherwise, build a param string
-			} else {
-				params = jQuery.param( params );
-				type = "POST";
-			}
-
-		var self = this;
-
-		// Request the remote document
-		jQuery.ajax({
-			url: url,
-			type: type,
-			data: params,
-			complete: function(res, status){
-				// If successful, inject the HTML into all the matched elements
-				if ( status == "success" || status == "notmodified" )
-					// See if a selector was specified
-					self.html( selector ?
-						// Create a dummy div to hold the results
-						jQuery("<div/>")
-							// inject the contents of the document in, removing the scripts
-							// to avoid any 'Permission Denied' errors in IE
-							.append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
-
-							// Locate the specified elements
-							.find(selector) :
-
-						// If not, just inject the full result
-						res.responseText );
-
-				// Add delay to account for Safari's delay in globalEval
-				setTimeout(function(){
-					self.each( callback, [res.responseText, status, res] );
-				}, 13);
-			}
-		});
-		return this;
-	},
-
-	serialize: function() {
-		return jQuery.param(this.serializeArray());
-	},
-	serializeArray: function() {
-		return this.map(function(){
-			return jQuery.nodeName(this, "form") ?
-				jQuery.makeArray(this.elements) : this;
-		})
-		.filter(function(){
-			return this.name && !this.disabled && 
-				(this.checked || /select|textarea/i.test(this.nodeName) || 
-					/text|hidden|password/i.test(this.type));
-		})
-		.map(function(i, elem){
-			var val = jQuery(this).val();
-			return val == null ? null :
-				val.constructor == Array ?
-					jQuery.map( val, function(val, i){
-						return {name: elem.name, value: val};
-					}) :
-					{name: elem.name, value: val};
-		}).get();
-	}
-});
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
-	jQuery.fn[o] = function(f){
-		return this.bind(o, f);
-	};
-});
-
-var jsc = (new Date).getTime();
-
-jQuery.extend({
-	get: function( url, data, callback, type ) {
-		// shift arguments if data argument was ommited
-		if ( jQuery.isFunction( data ) ) {
-			callback = data;
-			data = null;
-		}
-		
-		return jQuery.ajax({
-			type: "GET",
-			url: url,
-			data: data,
-			success: callback,
-			dataType: type
-		});
-	},
-
-	getScript: function( url, callback ) {
-		return jQuery.get(url, null, callback, "script");
-	},
-
-	getJSON: function( url, data, callback ) {
-		return jQuery.get(url, data, callback, "json");
-	},
-
-	post: function( url, data, callback, type ) {
-		if ( jQuery.isFunction( data ) ) {
-			callback = data;
-			data = {};
-		}
-
-		return jQuery.ajax({
-			type: "POST",
-			url: url,
-			data: data,
-			success: callback,
-			dataType: type
-		});
-	},
-
-	ajaxSetup: function( settings ) {
-		jQuery.extend( jQuery.ajaxSettings, settings );
-	},
-
-	ajaxSettings: {
-		global: true,
-		type: "GET",
-		timeout: 0,
-		contentType: "application/x-www-form-urlencoded",
-		processData: true,
-		async: true,
-		data: null
-	},
-	
-	// Last-Modified header cache for next request
-	lastModified: {},
-
-	ajax: function( s ) {
-		var jsonp, jsre = /=(\?|%3F)/g, status, data;
-
-		// Extend the settings, but re-extend 's' so that it can be
-		// checked again later (in the test suite, specifically)
-		s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
-
-		// convert data if not already a string
-		if ( s.data && s.processData && typeof s.data != "string" )
-			s.data = jQuery.param(s.data);
-
-		// Handle JSONP Parameter Callbacks
-		if ( s.dataType == "jsonp" ) {
-			if ( s.type.toLowerCase() == "get" ) {
-				if ( !s.url.match(jsre) )
-					s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
-			} else if ( !s.data || !s.data.match(jsre) )
-				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
-			s.dataType = "json";
-		}
-
-		// Build temporary JSONP function
-		if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
-			jsonp = "jsonp" + jsc++;
-
-			// Replace the =? sequence both in the query string and the data
-			if ( s.data )
-				s.data = s.data.replace(jsre, "=" + jsonp);
-			s.url = s.url.replace(jsre, "=" + jsonp);
-
-			// We need to make sure
-			// that a JSONP style response is executed properly
-			s.dataType = "script";
-
-			// Handle JSONP-style loading
-			window[ jsonp ] = function(tmp){
-				data = tmp;
-				success();
-				complete();
-				// Garbage collect
-				window[ jsonp ] = undefined;
-				try{ delete window[ jsonp ]; } catch(e){}
-			};
-		}
-
-		if ( s.dataType == "script" && s.cache == null )
-			s.cache = false;
-
-		if ( s.cache === false && s.type.toLowerCase() == "get" )
-			s.url += (s.url.match(/\?/) ? "&" : "?") + "_=" + (new Date()).getTime();
-
-		// If data is available, append data to url for get requests
-		if ( s.data && s.type.toLowerCase() == "get" ) {
-			s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
-
-			// IE likes to send both get and post data, prevent this
-			s.data = null;
-		}
-
-		// Watch for a new set of requests
-		if ( s.global && ! jQuery.active++ )
-			jQuery.event.trigger( "ajaxStart" );
-
-		// If we're requesting a remote document
-		// and trying to load JSON or Script
-		if ( !s.url.indexOf("http") && s.dataType == "script" ) {
-			var head = document.getElementsByTagName("head")[0];
-			var script = document.createElement("script");
-			script.src = s.url;
-
-			// Handle Script loading
-			if ( !jsonp && (s.success || s.complete) ) {
-				var done = false;
-
-				// Attach handlers for all browsers
-				script.onload = script.onreadystatechange = function(){
-					if ( !done && (!this.readyState || 
-							this.readyState == "loaded" || this.readyState == "complete") ) {
-						done = true;
-						success();
-						complete();
-						head.removeChild( script );
-					}
-				};
-			}
-
-			head.appendChild(script);
-
-			// We handle everything using the script element injection
-			return;
-		}
-
-		var requestDone = false;
-
-		// Create the request object; Microsoft failed to properly
-		// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
-		var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
-
-		// Open the socket
-		xml.open(s.type, s.url, s.async);
-
-		// Set the correct header, if data is being sent
-		if ( s.data )
-			xml.setRequestHeader("Content-Type", s.contentType);
-
-		// Set the If-Modified-Since header, if ifModified mode.
-		if ( s.ifModified )
-			xml.setRequestHeader("If-Modified-Since",
-				jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
-
-		// Set header so the called script knows that it's an XMLHttpRequest
-		xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
-
-		// Allow custom headers/mimetypes
-		if ( s.beforeSend )
-			s.beforeSend(xml);
-			
-		if ( s.global )
-		    jQuery.event.trigger("ajaxSend", [xml, s]);
-
-		// Wait for a response to come back
-		var onreadystatechange = function(isTimeout){
-			// The transfer is complete and the data is available, or the request timed out
-			if ( !requestDone && xml && (xml.readyState == 4 || isTimeout == "timeout") ) {
-				requestDone = true;
-				
-				// clear poll interval
-				if (ival) {
-					clearInterval(ival);
-					ival = null;
-				}
-				
-				status = isTimeout == "timeout" && "timeout" ||
-					!jQuery.httpSuccess( xml ) && "error" ||
-					s.ifModified && jQuery.httpNotModified( xml, s.url ) && "notmodified" ||
-					"success";
-
-				if ( status == "success" ) {
-					// Watch for, and catch, XML document parse errors
-					try {
-						// process the data (runs the xml through httpData regardless of callback)
-						data = jQuery.httpData( xml, s.dataType );
-					} catch(e) {
-						status = "parsererror";
-					}
-				}
-
-				// Make sure that the request was successful or notmodified
-				if ( status == "success" ) {
-					// Cache Last-Modified header, if ifModified mode.
-					var modRes;
-					try {
-						modRes = xml.getResponseHeader("Last-Modified");
-					} catch(e) {} // swallow exception thrown by FF if header is not available
-	
-					if ( s.ifModified && modRes )
-						jQuery.lastModified[s.url] = modRes;
-
-					// JSONP handles its own success callback
-					if ( !jsonp )
-						success();	
-				} else
-					jQuery.handleError(s, xml, status);
-
-				// Fire the complete handlers
-				complete();
-
-				// Stop memory leaks
-				if ( s.async )
-					xml = null;
-			}
-		};
-		
-		if ( s.async ) {
-			// don't attach the handler to the request, just poll it instead
-			var ival = setInterval(onreadystatechange, 13); 
-
-			// Timeout checker
-			if ( s.timeout > 0 )
-				setTimeout(function(){
-					// Check to see if the request is still happening
-					if ( xml ) {
-						// Cancel the request
-						xml.abort();
-	
-						if( !requestDone )
-							onreadystatechange( "timeout" );
-					}
-				}, s.timeout);
-		}
-			
-		// Send the data
-		try {
-			xml.send(s.data);
-		} catch(e) {
-			jQuery.handleError(s, xml, null, e);
-		}
-		
-		// firefox 1.5 doesn't fire statechange for sync requests
-		if ( !s.async )
-			onreadystatechange();
-		
-		// return XMLHttpRequest to allow aborting the request etc.
-		return xml;
-
-		function success(){
-			// If a local callback was specified, fire it and pass it the data
-			if ( s.success )
-				s.success( data, status );
-
-			// Fire the global callback
-			if ( s.global )
-				jQuery.event.trigger( "ajaxSuccess", [xml, s] );
-		}
-
-		function complete(){
-			// Process result
-			if ( s.complete )
-				s.complete(xml, status);
-
-			// The request was completed
-			if ( s.global )
-				jQuery.event.trigger( "ajaxComplete", [xml, s] );
-
-			// Handle the global AJAX counter
-			if ( s.global && ! --jQuery.active )
-				jQuery.event.trigger( "ajaxStop" );
-		}
-	},
-
-	handleError: function( s, xml, status, e ) {
-		// If a local callback was specified, fire it
-		if ( s.error ) s.error( xml, status, e );
-
-		// Fire the global callback
-		if ( s.global )
-			jQuery.event.trigger( "ajaxError", [xml, s, e] );
-	},
-
-	// Counter for holding the number of active queries
-	active: 0,
-
-	// Determines if an XMLHttpRequest was successful or not
-	httpSuccess: function( r ) {
-		try {
-			return !r.status && location.protocol == "file:" ||
-				( r.status >= 200 && r.status < 300 ) || r.status == 304 ||
-				jQuery.browser.safari && r.status == undefined;
-		} catch(e){}
-		return false;
-	},
-
-	// Determines if an XMLHttpRequest returns NotModified
-	httpNotModified: function( xml, url ) {
-		try {
-			var xmlRes = xml.getResponseHeader("Last-Modified");
-
-			// Firefox always returns 200. check Last-Modified date
-			return xml.status == 304 || xmlRes == jQuery.lastModified[url] ||
-				jQuery.browser.safari && xml.status == undefined;
-		} catch(e){}
-		return false;
-	},
-
-	httpData: function( r, type ) {
-		var ct = r.getResponseHeader("content-type");
-		var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0;
-		var data = xml ? r.responseXML : r.responseText;
-
-		if ( xml && data.documentElement.tagName == "parsererror" )
-			throw "parsererror";
-
-		// If the type is "script", eval it in global context
-		if ( type == "script" )
-			jQuery.globalEval( data );
-
-		// Get the JavaScript object, if JSON is used.
-		if ( type == "json" )
-			data = eval("(" + data + ")");
-
-		return data;
-	},
-
-	// Serialize an array of form elements or a set of
-	// key/values into a query string
-	param: function( a ) {
-		var s = [];
-
-		// If an array was passed in, assume that it is an array
-		// of form elements
-		if ( a.constructor == Array || a.jquery )
-			// Serialize the form elements
-			jQuery.each( a, function(){
-				s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) );
-			});
-
-		// Otherwise, assume that it's an object of key/value pairs
-		else
-			// Serialize the key/values
-			for ( var j in a )
-				// If the value is an array then the key names need to be repeated
-				if ( a[j] && a[j].constructor == Array )
-					jQuery.each( a[j], function(){
-						s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) );
-					});
-				else
-					s.push( encodeURIComponent(j) + "=" + encodeURIComponent( a[j] ) );
-
-		// Return the resulting serialization
-		return s.join("&").replace(/%20/g, "+");
-	}
-
-});
-jQuery.fn.extend({
-	show: function(speed,callback){
-		return speed ?
-			this.animate({
-				height: "show", width: "show", opacity: "show"
-			}, speed, callback) :
-			
-			this.filter(":hidden").each(function(){
-				this.style.display = this.oldblock ? this.oldblock : "";
-				if ( jQuery.css(this,"display") == "none" )
-					this.style.display = "block";
-			}).end();
-	},
-	
-	hide: function(speed,callback){
-		return speed ?
-			this.animate({
-				height: "hide", width: "hide", opacity: "hide"
-			}, speed, callback) :
-			
-			this.filter(":visible").each(function(){
-				this.oldblock = this.oldblock || jQuery.css(this,"display");
-				if ( this.oldblock == "none" )
-					this.oldblock = "block";
-				this.style.display = "none";
-			}).end();
-	},
-
-	// Save the old toggle function
-	_toggle: jQuery.fn.toggle,
-	
-	toggle: function( fn, fn2 ){
-		return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
-			this._toggle( fn, fn2 ) :
-			fn ?
-				this.animate({
-					height: "toggle", width: "toggle", opacity: "toggle"
-				}, fn, fn2) :
-				this.each(function(){
-					jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
-				});
-	},
-	
-	slideDown: function(speed,callback){
-		return this.animate({height: "show"}, speed, callback);
-	},
-	
-	slideUp: function(speed,callback){
-		return this.animate({height: "hide"}, speed, callback);
-	},
-
-	slideToggle: function(speed, callback){
-		return this.animate({height: "toggle"}, speed, callback);
-	},
-	
-	fadeIn: function(speed, callback){
-		return this.animate({opacity: "show"}, speed, callback);
-	},
-	
-	fadeOut: function(speed, callback){
-		return this.animate({opacity: "hide"}, speed, callback);
-	},
-	
-	fadeTo: function(speed,to,callback){
-		return this.animate({opacity: to}, speed, callback);
-	},
-	
-	animate: function( prop, speed, easing, callback ) {
-		var opt = jQuery.speed(speed, easing, callback);
-
-		return this[ opt.queue === false ? "each" : "queue" ](function(){
-			opt = jQuery.extend({}, opt);
-			var hidden = jQuery(this).is(":hidden"), self = this;
-			
-			for ( var p in prop ) {
-				if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
-					return jQuery.isFunction(opt.complete) && opt.complete.apply(this);
-
-				if ( p == "height" || p == "width" ) {
-					// Store display property
-					opt.display = jQuery.css(this, "display");
-
-					// Make sure that nothing sneaks out
-					opt.overflow = this.style.overflow;
-				}
-			}
-
-			if ( opt.overflow != null )
-				this.style.overflow = "hidden";
-
-			opt.curAnim = jQuery.extend({}, prop);
-			
-			jQuery.each( prop, function(name, val){
-				var e = new jQuery.fx( self, opt, name );
-
-				if ( /toggle|show|hide/.test(val) )
-					e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
-				else {
-					var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
-						start = e.cur(true) || 0;
-
-					if ( parts ) {
-						var end = parseFloat(parts[2]),
-							unit = parts[3] || "px";
-
-						// We need to compute starting value
-						if ( unit != "px" ) {
-							self.style[ name ] = (end || 1) + unit;
-							start = ((end || 1) / e.cur(true)) * start;
-							self.style[ name ] = start + unit;
-						}
-
-						// If a +=/-= token was provided, we're doing a relative animation
-						if ( parts[1] )
-							end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
-
-						e.custom( start, end, unit );
-					} else
-						e.custom( start, val, "" );
-				}
-			});
-
-			// For JS strict compliance
-			return true;
-		});
-	},
-	
-	queue: function(type, fn){
-		if ( jQuery.isFunction(type) ) {
-			fn = type;
-			type = "fx";
-		}
-
-		if ( !type || (typeof type == "string" && !fn) )
-			return queue( this[0], type );
-
-		return this.each(function(){
-			if ( fn.constructor == Array )
-				queue(this, type, fn);
-			else {
-				queue(this, type).push( fn );
-			
-				if ( queue(this, type).length == 1 )
-					fn.apply(this);
-			}
-		});
-	},
-
-	stop: function(){
-		var timers = jQuery.timers;
-
-		return this.each(function(){
-			for ( var i = 0; i < timers.length; i++ )
-				if ( timers[i].elem == this )
-					timers.splice(i--, 1);
-		}).dequeue();
-	}
-
-});
-
-var queue = function( elem, type, array ) {
-	if ( !elem )
-		return;
-
-	var q = jQuery.data( elem, type + "queue" );
-
-	if ( !q || array )
-		q = jQuery.data( elem, type + "queue", 
-			array ? jQuery.makeArray(array) : [] );
-
-	return q;
-};
-
-jQuery.fn.dequeue = function(type){
-	type = type || "fx";
-
-	return this.each(function(){
-		var q = queue(this, type);
-
-		q.shift();
-
-		if ( q.length )
-			q[0].apply( this );
-	});
-};
-
-jQuery.extend({
-	
-	speed: function(speed, easing, fn) {
-		var opt = speed && speed.constructor == Object ? speed : {
-			complete: fn || !fn && easing || 
-				jQuery.isFunction( speed ) && speed,
-			duration: speed,
-			easing: fn && easing || easing && easing.constructor != Function && easing
-		};
-
-		opt.duration = (opt.duration && opt.duration.constructor == Number ? 
-			opt.duration : 
-			{ slow: 600, fast: 200 }[opt.duration]) || 400;
-	
-		// Queueing
-		opt.old = opt.complete;
-		opt.complete = function(){
-			jQuery(this).dequeue();
-			if ( jQuery.isFunction( opt.old ) )
-				opt.old.apply( this );
-		};
-	
-		return opt;
-	},
-	
-	easing: {
-		linear: function( p, n, firstNum, diff ) {
-			return firstNum + diff * p;
-		},
-		swing: function( p, n, firstNum, diff ) {
-			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
-		}
-	},
-	
-	timers: [],
-
-	fx: function( elem, options, prop ){
-		this.options = options;
-		this.elem = elem;
-		this.prop = prop;
-
-		if ( !options.orig )
-			options.orig = {};
-	}
-
-});
-
-jQuery.fx.prototype = {
-
-	// Simple function for setting a style value
-	update: function(){
-		if ( this.options.step )
-			this.options.step.apply( this.elem, [ this.now, this ] );
-
-		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
-
-		// Set display property to block for height/width animations
-		if ( this.prop == "height" || this.prop == "width" )
-			this.elem.style.display = "block";
-	},
-
-	// Get the current size
-	cur: function(force){
-		if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null )
-			return this.elem[ this.prop ];
-
-		var r = parseFloat(jQuery.curCSS(this.elem, this.prop, force));
-		return r && r > -10000 ? r : parseFloat(jQuery.css(this.elem, this.prop)) || 0;
-	},
-
-	// Start an animation from one number to another
-	custom: function(from, to, unit){
-		this.startTime = (new Date()).getTime();
-		this.start = from;
-		this.end = to;
-		this.unit = unit || this.unit || "px";
-		this.now = this.start;
-		this.pos = this.state = 0;
-		this.update();
-
-		var self = this;
-		function t(){
-			return self.step();
-		}
-
-		t.elem = this.elem;
-
-		jQuery.timers.push(t);
-
-		if ( jQuery.timers.length == 1 ) {
-			var timer = setInterval(function(){
-				var timers = jQuery.timers;
-				
-				for ( var i = 0; i < timers.length; i++ )
-					if ( !timers[i]() )
-						timers.splice(i--, 1);
-
-				if ( !timers.length )
-					clearInterval( timer );
-			}, 13);
-		}
-	},
-
-	// Simple 'show' function
-	show: function(){
-		// Remember where we started, so that we can go back to it later
-		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
-		this.options.show = true;
-
-		// Begin the animation
-		this.custom(0, this.cur());
-
-		// Make sure that we start at a small width/height to avoid any
-		// flash of content
-		if ( this.prop == "width" || this.prop == "height" )
-			this.elem.style[this.prop] = "1px";
-		
-		// Start by showing the element
-		jQuery(this.elem).show();
-	},
-
-	// Simple 'hide' function
-	hide: function(){
-		// Remember where we started, so that we can go back to it later
-		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
-		this.options.hide = true;
-
-		// Begin the animation
-		this.custom(this.cur(), 0);
-	},
-
-	// Each step of an animation
-	step: function(){
-		var t = (new Date()).getTime();
-
-		if ( t > this.options.duration + this.startTime ) {
-			this.now = this.end;
-			this.pos = this.state = 1;
-			this.update();
-
-			this.options.curAnim[ this.prop ] = true;
-
-			var done = true;
-			for ( var i in this.options.curAnim )
-				if ( this.options.curAnim[i] !== true )
-					done = false;
-
-			if ( done ) {
-				if ( this.options.display != null ) {
-					// Reset the overflow
-					this.elem.style.overflow = this.options.overflow;
-				
-					// Reset the display
-					this.elem.style.display = this.options.display;
-					if ( jQuery.css(this.elem, "display") == "none" )
-						this.elem.style.display = "block";
-				}
-
-				// Hide the element if the "hide" operation was done
-				if ( this.options.hide )
-					this.elem.style.display = "none";
-
-				// Reset the properties, if the item has been hidden or shown
-				if ( this.options.hide || this.options.show )
-					for ( var p in this.options.curAnim )
-						jQuery.attr(this.elem.style, p, this.options.orig[p]);
-			}
-
-			// If a callback was provided, execute it
-			if ( done && jQuery.isFunction( this.options.complete ) )
-				// Execute the complete function
-				this.options.complete.apply( this.elem );
-
-			return false;
-		} else {
-			var n = t - this.startTime;
-			this.state = n / this.options.duration;
-
-			// Perform the easing function, defaults to swing
-			this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
-			this.now = this.start + ((this.end - this.start) * this.pos);
-
-			// Perform the next step of the animation
-			this.update();
-		}
-
-		return true;
-	}
-
-};
-
-jQuery.fx.step = {
-	scrollLeft: function(fx){
-		fx.elem.scrollLeft = fx.now;
-	},
-
-	scrollTop: function(fx){
-		fx.elem.scrollTop = fx.now;
-	},
-
-	opacity: function(fx){
-		jQuery.attr(fx.elem.style, "opacity", fx.now);
-	},
-
-	_default: function(fx){
-		fx.elem.style[ fx.prop ] = fx.now + fx.unit;
-	}
-};
-// The Offset Method
-// Originally By Brandon Aaron, part of the Dimension Plugin
-// http://jquery.com/plugins/project/dimensions
-jQuery.fn.offset = function() {
-	var left = 0, top = 0, elem = this[0], results;
-	
-	if ( elem ) with ( jQuery.browser ) {
-		var	absolute     = jQuery.css(elem, "position") == "absolute", 
-		    parent       = elem.parentNode, 
-		    offsetParent = elem.offsetParent, 
-		    doc          = elem.ownerDocument,
-		    safari2      = safari && parseInt(version) < 522;
-	
-		// Use getBoundingClientRect if available
-		if ( elem.getBoundingClientRect ) {
-			box = elem.getBoundingClientRect();
-		
-			// Add the document scroll offsets
-			add(
-				box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
-				box.top  + Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop)
-			);
-		
-			// IE adds the HTML element's border, by default it is medium which is 2px
-			// IE 6 and IE 7 quirks mode the border width is overwritable by the following css html { border: 0; }
-			// IE 7 standards mode, the border is always 2px
-			if ( msie ) {
-				var border = jQuery("html").css("borderWidth");
-				border = (border == "medium" || jQuery.boxModel && parseInt(version) >= 7) && 2 || border;
-				add( -border, -border );
-			}
-	
-		// Otherwise loop through the offsetParents and parentNodes
-		} else {
-		
-			// Initial element offsets
-			add( elem.offsetLeft, elem.offsetTop );
-		
-			// Get parent offsets
-			while ( offsetParent ) {
-				// Add offsetParent offsets
-				add( offsetParent.offsetLeft, offsetParent.offsetTop );
-			
-				// Mozilla and Safari > 2 does not include the border on offset parents
-				// However Mozilla adds the border for table cells
-				if ( mozilla && /^t[d|h]$/i.test(parent.tagName) || !safari2 )
-					border( offsetParent );
-				
-				// Safari <= 2 doubles body offsets with an absolutely positioned element or parent
-				if ( safari2 && !absolute && jQuery.css(offsetParent, "position") == "absolute" )
-					absolute = true;
-			
-				// Get next offsetParent
-				offsetParent = offsetParent.offsetParent;
-			}
-		
-			// Get parent scroll offsets
-			while ( parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
-				// Work around opera inline/table scrollLeft/Top bug
-				if ( !/^inline|table-row.*$/i.test(jQuery.css(parent, "display")) )
-					// Subtract parent scroll offsets
-					add( -parent.scrollLeft, -parent.scrollTop );
-			
-				// Mozilla does not add the border for a parent that has overflow != visible
-				if ( mozilla && jQuery.css(parent, "overflow") != "visible" )
-					border( parent );
-			
-				// Get next parent
-				parent = parent.parentNode;
-			}
-		
-			// Safari doubles body offsets with an absolutely positioned element or parent
-			if ( safari2 && absolute )
-				add( -doc.body.offsetLeft, -doc.body.offsetTop );
-		}
-
-		// Return an object with top and left properties
-		results = { top: top, left: left };
-	}
-
-	return results;
-
-	function border(elem) {
-		add( jQuery.css(elem, "borderLeftWidth"), jQuery.css(elem, "borderTopWidth") );
-	}
-
-	function add(l, t) {
-		left += parseInt(l) || 0;
-		top += parseInt(t) || 0;
-	}
-};
-})();
--- a/web/html/support/styles.css	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
-body {
-  background: #F2F1F0;
-  font-family: verdana,sans-serif;
-}
-
-.navheader, .book, .preface, .chapter, .appendix, .bibliography, .navfooter, .basetemplate {
-  width: 50em;
-  margin-left: auto;
-  margin-right: auto;
-}
-
-a.commenttoggle:hover, a.commenttoggle:active {
-  opacity: 0.7;
-}
-
-.book, .preface, .chapter, .appendix, .bibliography, .basetemplate {
-  background: white;
-  padding: 2em;
-}
-
-h1 {
-  margin-top: 1.5em;
-}
-
-span.beta {
-  font-size: 80%;
-  font-style: italic;
-  opacity: 0.4;
-}
-
-h2, h3 {
-  margin-top: 2em;
-}
-
-h1, h2, h3 {
-  font-family: georgia,serif;
-  font-weight: normal;
-  margin-bottom: 0.5em;
-}
-
-h1.booktitle {
-  margin-bottom: 0px;
-}
-
-h2.booktitle {
-  text-align: center;
-}
-
-h2.booktitle > a {
-  color: black;
-}
-
-.authors {
-  font-size: 80%;
-  opacity: 0.55;
-  padding-left: 0.5em;
-}
-
-div.note th, div.tip th, div.warning th {
-  font-family: georgia,serif;
-  font-weight: normal;
-  font-size: 110%;
-}
-
-div.navheader th, div.navfooter td {
-  font-family: georgia,serif;
-}
-
-div.navheader th {
-  opacity: 0;
-  font-size: 0;
-}
-
-pre.screen {
-  background-image: url(/support/icons/shell.png);
-}
-
-pre.programlisting {
-  background-image: url(/support/icons/source.png);
-}
-
-pre.programlisting, pre.screen, p.remark {
-  border-style: solid;
-  border-width: 1px;
-  font-size: medium;
-  padding: 1em;
-  background-repeat: no-repeat;
-  background-position: 10px 10px;
-  padding-left: 70px;
-}
-
-strong.command, code, pre, span.type {
-  font-family: monospace;
-  font-weight: normal;
-}
-
-strong.userinput > code {
-  font-weight: bolder;
-  color: #303030;
-}
-
-div.toc > p {
-  opacity: 0.35;
-  font-family: georgia,serif;
-  cursor: pointer;
-}
-
-div.toc b {
-  font-weight: normal;
-  font-size: large;
-}
-
-ul.booktoc {
-  padding-left: 0px;
-  list-style-type: none;
-}
-
-.booktoc > li {
-  padding: 0.5em;
-}
-
-.chapinfo {
-  float: right;
-  color: #a0a0a0;
-}
-
-.unpublished {
-  color: #a0a0a0;
-}
-
-.chapinfo img {
-  vertical-align: -35%;
-  border: 0px;
-}
-
-.zebra_b {
-  background: #f4f4f4;
-}
-
-.book .titlepage {
-  display: none;
-}
-
-.chapter div.toc > dl {
-  display: none;
-}
-
-pre.programlisting, pre.screen, p.remark {
-  overflow: hidden;
-}
-
-p.remark {
-  background-image: url(/support/icons/remark.png);
-}
-
-div.warning, p.remark {
-  background-color: #FFEFE8;
-  border-color: #e0a8a0;
-}
-
-span.remark {
-  font-style: normal;
-  color: #707070;
-}
-
-.screen {
-  background: #e7ffc7 none repeat scroll 0% 50%;
-  border-color: #94DA3A;
-}
-
-.programlisting {
-  background: #F0F4FF none repeat scroll 0% 50%;
-  border-color: #B4BAEA;
-}
-
-.prompt {
-  color: #448844;
-}
-
-div.note, div.tip {
-  background: #ffffc9;
-  border-color: #B4BAEA;
-}
-
-div.note, div.warning, div.tip {
-  border-style: solid;
-  border-width: 1px;
-  padding: 1em;
-}
-
-.note .title {
-  font-size: 90%;
-}
-
-.comment {
-  font-size: 80%;
-}
-
-div.comment, div.new_comment {
-  padding: 0.5em;
-  margin: 0.5em;
-  margin-left: 2em;
-  border-style: solid;
-  border-width: 1px;
-  border-color: #aaaaff;
-}
-
-div.comment {
-  background: #eeeeff;
-}
-
-div.new_comment {
-  background: #d0d0ff;
-}
-
-.commenttoggle {
-  opacity: 0.35;
-}
-
-.comment_help {
-  font-size: 80%;
-}
-
-.comment_header {
-  opacity: 0.75;
-}
-
-.comment_id {
-  float: right;
-  opacity: 0.3;
-  font-size: 60%;
-}
-
-.comment_name {
-  font-weight: bolder;
-}
-
-.comment_reviewed {
-  color: darkgreen;
-  margin-left: 1em;
-  font-style: italic;
-}
-
-.comment_date {
-  opacity: 0.75;
-}
-
-.comment_thanks {
-  color: darkblue;
-  margin-left: 1em;
-  font-style: italic;
-  font-weight: bolder;
-}
-
-.comment_error {
-  padding-left: 1em;
-  font-weight: bolder;
-  font-size: 80%;
-  color: darkred;
-}
-
-.hgbookfooter {
-  width: 60em;
-  margin-left: auto;
-  margin-right: auto;
-  margin-top: 2em;
-  padding: 2em;
-  margin-bottom: 2em;
-  font-size: 80%;
-  color: #727272;
-  border-top: 1px solid grey;
-}
-
-.hgbookfooter a {
-  color: #5555ff;
-}
-
-.hgbookfooter a:visited {
-  opacity: 0.7;
-}
-
-.hgbookfooter img {
-  vertical-align: -45%;
-}
-
-table.equation a.commenttoggle {
-  text-align: right;
-  display: block;
-}
-
-div.comment, div.new_comment, form.comment {
-  text-align: left;
-}
--- a/web/html/support/styles/styles.css	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
-body {
-  background: #F2F1F0;
-  font-family: verdana,sans-serif;
-}
-
-.navheader, .book, .preface, .chapter, .appendix, .bibliography, .navfooter, .basetemplate {
-  width: 50em;
-  margin-left: auto;
-  margin-right: auto;
-}
-
-a.commenttoggle:hover, a.commenttoggle:active {
-  opacity: 0.7;
-}
-
-.book, .preface, .chapter, .appendix, .bibliography, .basetemplate {
-  background: white;
-  padding: 2em;
-}
-
-h1 {
-  margin-top: 1.5em;
-}
-
-span.beta {
-  font-size: 80%;
-  font-style: italic;
-  opacity: 0.4;
-}
-
-h2, h3 {
-  margin-top: 2em;
-}
-
-h1, h2, h3 {
-  font-family: georgia,serif;
-  font-weight: normal;
-  margin-bottom: 0.5em;
-}
-
-h1.booktitle {
-  margin-bottom: 0px;
-}
-
-h2.booktitle {
-  text-align: center;
-}
-
-h2.booktitle > a {
-  color: black;
-}
-
-.authors {
-  font-size: 80%;
-  opacity: 0.55;
-  padding-left: 0.5em;
-}
-
-div.note th, div.tip th, div.warning th {
-  font-family: georgia,serif;
-  font-weight: normal;
-  font-size: 110%;
-}
-
-div.navheader th, div.navfooter td {
-  font-family: georgia,serif;
-}
-
-div.navheader th {
-  opacity: 0;
-  font-size: 0;
-}
-
-pre.screen {
-  background-image: url(/support/icons/shell.png);
-}
-
-pre.programlisting {
-  background-image: url(/support/icons/source.png);
-}
-
-pre.programlisting, pre.screen, p.remark {
-  border-style: solid;
-  border-width: 1px;
-  font-size: medium;
-  padding: 1em;
-  background-repeat: no-repeat;
-  background-position: 10px 10px;
-  padding-left: 70px;
-}
-
-strong.command, code, pre, span.type {
-  font-family: monospace;
-  font-weight: normal;
-}
-
-strong.userinput > code {
-  font-weight: bolder;
-  color: #303030;
-}
-
-div.toc > p {
-  opacity: 0.35;
-  font-family: georgia,serif;
-  cursor: pointer;
-}
-
-div.toc b {
-  font-weight: normal;
-  font-size: large;
-}
-
-ul.booktoc {
-  padding-left: 0px;
-  list-style-type: none;
-}
-
-.booktoc > li {
-  padding: 0.5em;
-}
-
-.chapinfo {
-  float: right;
-  color: #a0a0a0;
-}
-
-.unpublished {
-  color: #a0a0a0;
-}
-
-.chapinfo img {
-  vertical-align: -35%;
-  border: 0px;
-}
-
-.zebra_b {
-  background: #f4f4f4;
-}
-
-.book .titlepage {
-  display: none;
-}
-
-.chapter div.toc > dl {
-  display: none;
-}
-
-pre.programlisting, pre.screen, p.remark {
-  overflow: hidden;
-}
-
-p.remark {
-  background-image: url(/support/icons/remark.png);
-}
-
-div.warning, p.remark {
-  background-color: #FFEFE8;
-  border-color: #e0a8a0;
-}
-
-span.remark {
-  font-style: normal;
-  color: #707070;
-}
-
-.screen {
-  background: #e7ffc7 none repeat scroll 0% 50%;
-  border-color: #94DA3A;
-}
-
-.programlisting {
-  background: #F0F4FF none repeat scroll 0% 50%;
-  border-color: #B4BAEA;
-}
-
-.prompt {
-  color: #448844;
-}
-
-div.note, div.tip {
-  background: #ffffc9;
-  border-color: #B4BAEA;
-}
-
-div.note, div.warning, div.tip {
-  border-style: solid;
-  border-width: 1px;
-  padding: 1em;
-}
-
-.note .title {
-  font-size: 90%;
-}
-
-.comment {
-  font-size: 80%;
-}
-
-div.comment, div.new_comment {
-  padding: 0.5em;
-  margin: 0.5em;
-  margin-left: 2em;
-  border-style: solid;
-  border-width: 1px;
-  border-color: #aaaaff;
-}
-
-div.comment {
-  background: #eeeeff;
-}
-
-div.new_comment {
-  background: #d0d0ff;
-}
-
-.commenttoggle {
-  opacity: 0.35;
-}
-
-.comment_help {
-  font-size: 80%;
-}
-
-.comment_header {
-  opacity: 0.75;
-}
-
-.comment_id {
-  float: right;
-  opacity: 0.3;
-  font-size: 60%;
-}
-
-.comment_name {
-  font-weight: bolder;
-}
-
-.comment_reviewed {
-  color: darkgreen;
-  margin-left: 1em;
-  font-style: italic;
-}
-
-.comment_date {
-  opacity: 0.75;
-}
-
-.comment_thanks {
-  color: darkblue;
-  margin-left: 1em;
-  font-style: italic;
-  font-weight: bolder;
-}
-
-.comment_error {
-  padding-left: 1em;
-  font-weight: bolder;
-  font-size: 80%;
-  color: darkred;
-}
-
-.hgbookfooter {
-  width: 60em;
-  margin-left: auto;
-  margin-right: auto;
-  margin-top: 2em;
-  padding: 2em;
-  margin-bottom: 2em;
-  font-size: 80%;
-  color: #727272;
-  border-top: 1px solid grey;
-}
-
-.hgbookfooter a {
-  color: #5555ff;
-}
-
-.hgbookfooter a:visited {
-  opacity: 0.7;
-}
-
-.hgbookfooter img {
-  vertical-align: -45%;
-}
-
-table.equation a.commenttoggle {
-  text-align: right;
-  display: block;
-}
-
-div.comment, div.new_comment, form.comment {
-  text-align: left;
-}
--- a/web/index.html.in	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-<!-- -*- html -*- -->
-{% extends "boilerplate.html" %}
-
-{% block bodycontent %}
-<div class="navheader"><h1 class="booktitle">Mercurial: The Definitive Guide<div class="authors">by Bryan O'Sullivan</div></h1></div>
-
-<div class="book">
-  <h2>Welcome to Mercurial: The Definitive Guide</h2>
-
-  <p>This is the online home of the book &#8220;Mercurial: The
-    Definitive Guide&#8221;.  
-    It was published in 2009 by O'Reilly Media.</p>
-
-  <p><a href="http://www.selenic.com/mercurial">Mercurial</a> is a
-    fast, lightweight source control management system
-    designed for easy and efficient handling of very large distributed
-    projects.  My book tells you what it is, why you should care, and
-    how you can use it effectively.</p>
-
-  <h2>Read it online</h2>
-
-  <p>I make the content freely available online: you
-    can <a href="/read/"><i>read it here</i></a>.  If you like it,
-    please <a href="#buy">buy a copy</a>!</p>
-
-  <p>For news updates, please
-    visit <a href="http://www.serpentine.com/blog/">my blog</a>.  You
-    should follow me on
-    Twitter <a href="http://twitter.com/bos31337">here</a>.</p>
-
-  <h2><a name="#buy">How</a> to buy</h2>
-
-  <p>If you like the book, please support the work of the Software
-    Freedom Conservancy (<a href="#sfc">see below</a>) by buying a
-    copy.</p>
-
-  <ul>
-    <li><a href="http://www.amazon.com/gp/product/0596800673?ie=UTF8&tag=reaworhas-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0596800673">Amazon.com</a><img src="http://www.assoc-amazon.com/e/ir?t=reaworhas-20&l=as2&o=1&a=0596800673" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></li>
-    <li><a href="http://oreilly.com/catalog/9780596800673/">O'Reilly Media</a></li>
-  </ul>
-
-  <h2>You should contribute!</h2>
-
-  <p>I publish the source code for this book
-    as <a href="http://bitbucket.org/bos/hgbook">a
-      Mercurial repository</a>.  Please feel
-    welcome to clone it, make modifications to your copy, and send me
-    changes.  Getting a copy of the source takes just a few seconds if
-    you have Mercurial installed:</p>
-
-  <pre class="screen">hg clone http://bitbucket.org/bos/hgbook</pre>
-
-  <p>The online version of the book includes a comment system
-    that you can use to send feedback involving errors, omissions, and
-    suggestions.</p>
-
-  <p>(If you would like to adapt the comment system for a
-    publishing project of your own, the source for the web application
-    is included with the book source at the link above.)</p>
-
-  <h2><a name="sfc">How</a> I help Mercurial and free software, and
-    you can too</h2>
-
-  <p>Mercurial is a member of the <a href="http://conservancy.softwarefreedom.org/">Software Freedom Conservancy</a>, a
-    wonderful non-profit organisation that offers its member projects
-    legal and administrative advice.</p>
-
-  <p>I donate my royalties from the sales of this book to the
-    Software Freedom Conservancy, and I encourage you to support their
-    work, too.</p>
-
-  <p>The SFC can
-    accept <a href="http://conservancy.softwarefreedom.org/?donate">accept
-    donations</a> (tax-free under IRS 501(c)(3), within the United
-    States) on behalf of its member projects. If you would like to
-    support Mercurial directly, please consider making a donation to
-    the SFC on its behalf.</p>
-
-  <p>If you would like to help free software developers to provide
-    their important public services without being impeded by legal
-    issues, please consider donating to the SFC's sister organisation,
-    the <a href="http://www.softwarefreedom.org/">Software Freedom Law
-    Center</a>.</p>
-</div>
-{% endblock %}
--- a/web/javascript/hsbook.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-function qid(id) {
-  return id.replace(/([.:])/g, "\\$1");
-}
-
-function beforeComment(formData, jqForm, options) {
-  var form = jqForm[0];
-  if (!form.comment.value) {
-    $(options.target + " span.comment_error").empty().append(
-      "<span class=\"comment_error\">Your comment is empty</span>");
-    return false;
-  }
-  if (!form.name.value) {
-    $(options.target + " span.comment_error").empty().append(
-      "<span class=\"comment_error\">Please provide a name</span>");
-    return false;
-  }
-  $(options.target + " span.comment_error").empty().after(
-    "<img src=\"figs/throbber.gif\" style=\"vertical-align: middle\"/>");
-  $(options.target + " input[@name=submit]").attr("disabled", true);
-}
-
-function ajaxifyForm(id) {
-  var q = qid(id);
-  
-  $("#form_" + q).ajaxForm({ beforeSubmit: beforeComment,
-			     success: function() { ajaxifyForm(id); },
-			     target: "#comments_" + q });
-}
-
-function toggleComment(id) {
-  $("#toggle_" + qid(id)).nextAll().toggle();
-  return false;
-}
-
-function loadComments(id) {
-  $("#comments_" + qid(id)).load(location.protocol + "//" + location.host +
-				 "/comments/single/" + id + "/", function() {
-    ajaxifyForm(id);
-  });
-  return false;
-}
-
-function loadAllComments() {
-  $("a.commenttoggle").each(function() {
-    var id = $(this).attr("pid");
-    if (id) {
-      loadComments(id);
-    }
-  });
-}
-
-$(document).ready(function() {
-  function loading(id) {
-    return " <span id=\"comments_" + id + "\" class=\"comment\">" +
-      "<span pid=\"" + id + "\" class=\"commenttoggle\">Loading..." +
-      "</span></span>";
-  }
-  $("div.toc>p")
-    .after("<p style='display: none;'><a onclick='return loadAllComments()'>" +
-	   "Load all comments (<b>slow</b>)</a></p>")
-    .toggle(function() { $(this).nextAll().show("normal"); },
-	    function() { $(this).nextAll().hide("normal"); })
-    .hover(function() { $(this).fadeTo("normal", 0.8); },
-	   function() { $(this).fadeTo("normal", 0.35); });
-  $("p[@id]").each(function() {
-    $(this).append(loading($(this).attr("id")));
-  });
-  $("table[@id].equation").each(function() {
-    $(this).after(loading($(this).attr("id")));
-  });
-  $("pre[@id]").each(function() {
-    $(this).after(loading($(this).attr("id")));
-  });
-  var chapid = $("body, div.preface, div.chapter, div.appendix, div.bibliography").attr("id");
-  $("#chapterfeed").attr("href",
-			 $("#chapterfeed").attr("href") + chapid + "/");
-  $.getJSON(location.protocol + "//" + location.host + "/comments/chapter/" +
-	    chapid + "/count/", function(data) {
-    $.each(data, function(id, item) {
-      var s = item == 1 ? "" : "s";
-      $("#comments_" + qid(id) + " span.commenttoggle").replaceWith(
-        "<a class='commenttoggle' id='toggle_" + id + "' " +
-	"pid='" + id + "' " +
-	"onclick='return loadComments(\"" + id + "\")' " +
-	"href='comments: show / hide'>" + item + " comment" + s + "</a>");
-    });
-    $("span.commenttoggle").each(function() {
-      var id = $(this).attr("pid");
-      $(this).replaceWith("<a class='commenttoggle' id='toggle_" + id + "' " +
-			  "onclick='return loadComments(\"" + id + "\")' " +
-			  "href='comment: add'>No comments</a>");
-    });
-  });
-});
--- a/web/robots.txt	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-User-agent: *
-Disallow: /feeds/
Binary file web/support/figs/bad-merge-1.png has changed
Binary file web/support/figs/bad-merge-2.png has changed
Binary file web/support/figs/bad-merge-3.png has changed
Binary file web/support/figs/bad-merge-4.png has changed
Binary file web/support/figs/bad-merge-5.png has changed
Binary file web/support/figs/caution.png has changed
Binary file web/support/figs/feature-branches.png has changed
Binary file web/support/figs/filelog.png has changed
Binary file web/support/figs/kdiff3.png has changed
Binary file web/support/figs/metadata.png has changed
Binary file web/support/figs/mq-stack.png has changed
Binary file web/support/figs/note.png has changed
Binary file web/support/figs/revlog.png has changed
Binary file web/support/figs/rss.png has changed
Binary file web/support/figs/snapshot.png has changed
Binary file web/support/figs/tip.png has changed
Binary file web/support/figs/tour-history.png has changed
Binary file web/support/figs/tour-merge-conflict.png has changed
Binary file web/support/figs/tour-merge-merge.png has changed
Binary file web/support/figs/tour-merge-pull.png has changed
Binary file web/support/figs/tour-merge-sep-repos.png has changed
Binary file web/support/figs/undo-manual-merge.png has changed
Binary file web/support/figs/undo-manual.png has changed
Binary file web/support/figs/undo-non-tip.png has changed
Binary file web/support/figs/undo-simple.png has changed
Binary file web/support/figs/wdir-after-commit.png has changed
Binary file web/support/figs/wdir-branch.png has changed
Binary file web/support/figs/wdir-merge.png has changed
Binary file web/support/figs/wdir-pre-branch.png has changed
Binary file web/support/figs/wdir.png has changed
--- a/web/support/form-min.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-(function($){$.fn.ajaxSubmit=function(_2){if(typeof _2=="function"){_2={success:_2};}_2=$.extend({url:this.attr("action")||window.location,type:this.attr("method")||"GET"},_2||{});var _3={};$.event.trigger("form.pre.serialize",[this,_2,_3]);if(_3.veto){return this;}var a=this.formToArray(_2.semantic);if(_2.data){for(var n in _2.data){a.push({name:n,value:_2.data[n]});}}if(_2.beforeSubmit&&_2.beforeSubmit(a,this,_2)===false){return this;}$.event.trigger("form.submit.validate",[a,this,_2,_3]);if(_3.veto){return this;}var q=$.param(a);if(_2.type.toUpperCase()=="GET"){_2.url+=(_2.url.indexOf("?")>=0?"&":"?")+q;_2.data=null;}else{_2.data=q;}var _7=this,callbacks=[];if(_2.resetForm){callbacks.push(function(){_7.resetForm();});}if(_2.clearForm){callbacks.push(function(){_7.clearForm();});}if(!_2.dataType&&_2.target){var _8=_2.success||function(){};callbacks.push(function(_9){if(this.evalScripts){$(_2.target).attr("innerHTML",_9).evalScripts().each(_8,arguments);}else{$(_2.target).html(_9).each(_8,arguments);}});}else{if(_2.success){callbacks.push(_2.success);}}_2.success=function(_a,_b){for(var i=0,max=callbacks.length;i<max;i++){callbacks[i](_a,_b,_7);}};var _d=$("input:file",this).fieldValue();var _e=false;for(var j=0;j<_d.length;j++){if(_d[j]){_e=true;}}if(_2.iframe||_e){fileUpload();}else{$.ajax(_2);}$.event.trigger("form.submit.notify",[this,_2]);return this;function fileUpload(){var _10=_7[0];var _11=$.extend({},$.ajaxSettings,_2);var id="jqFormIO"+$.fn.ajaxSubmit.counter++;var $io=$("<iframe id=\""+id+"\" name=\""+id+"\" />");var io=$io[0];var op8=$.browser.opera&&window.opera.version()<9;if($.browser.msie||op8){io.src="javascript:false;document.write(\"\");";}$io.css({position:"absolute",top:"-1000px",left:"-1000px"});var xhr={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=_11.global;if(g&&!$.active++){$.event.trigger("ajaxStart");}if(g){$.event.trigger("ajaxSend",[xhr,_11]);}var _18=0;var _19=0;setTimeout(function(){$io.appendTo("body");io.attachEvent?io.attachEvent("onload",cb):io.addEventListener("load",cb,false);var _1a=_10.encoding?"encoding":"enctype";var t=_7.attr("target");_7.attr({target:id,method:"POST",action:_11.url});_10[_1a]="multipart/form-data";if(_11.timeout){setTimeout(function(){_19=true;cb();},_11.timeout);}_10.submit();_7.attr("target",t);},10);function cb(){if(_18++){return;}io.detachEvent?io.detachEvent("onload",cb):io.removeEventListener("load",cb,false);var ok=true;try{if(_19){throw "timeout";}var _1d,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(_11.dataType=="json"||_11.dataType=="script"){var ta=doc.getElementsByTagName("textarea")[0];_1d=ta?ta.value:xhr.responseText;if(_11.dataType=="json"){eval("data = "+_1d);}else{$.globalEval(_1d);}}else{if(_11.dataType=="xml"){_1d=xhr.responseXML;if(!_1d&&xhr.responseText!=null){_1d=toXml(xhr.responseText);}}else{_1d=xhr.responseText;}}}catch(e){ok=false;$.handleError(_11,xhr,"error",e);}if(ok){_11.success(_1d,"success");if(g){$.event.trigger("ajaxSuccess",[xhr,_11]);}}if(g){$.event.trigger("ajaxComplete",[xhr,_11]);}if(g&&!--$.active){$.event.trigger("ajaxStop");}if(_11.complete){_11.complete(xhr,ok?"success":"error");}setTimeout(function(){$io.remove();xhr.responseXML=null;},100);}function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s);}else{doc=(new DOMParser()).parseFromString(s,"text/xml");}return (doc&&doc.documentElement&&doc.documentElement.tagName!="parsererror")?doc:null;}}};$.fn.ajaxSubmit.counter=0;$.fn.ajaxForm=function(_21){return this.ajaxFormUnbind().submit(submitHandler).each(function(){this.formPluginId=$.fn.ajaxForm.counter++;$.fn.ajaxForm.optionHash[this.formPluginId]=_21;$(":submit,input:image",this).click(clickHandler);});};$.fn.ajaxForm.counter=1;$.fn.ajaxForm.optionHash={};function clickHandler(e){var _23=this.form;_23.clk=this;if(this.type=="image"){if(e.offsetX!=undefined){_23.clk_x=e.offsetX;_23.clk_y=e.offsetY;}else{if(typeof $.fn.offset=="function"){var _24=$(this).offset();_23.clk_x=e.pageX-_24.left;_23.clk_y=e.pageY-_24.top;}else{_23.clk_x=e.pageX-this.offsetLeft;_23.clk_y=e.pageY-this.offsetTop;}}}setTimeout(function(){_23.clk=_23.clk_x=_23.clk_y=null;},10);}function submitHandler(){var id=this.formPluginId;var _26=$.fn.ajaxForm.optionHash[id];$(this).ajaxSubmit(_26);return false;}$.fn.ajaxFormUnbind=function(){this.unbind("submit",submitHandler);return this.each(function(){$(":submit,input:image",this).unbind("click",clickHandler);});};$.fn.formToArray=function(_27){var a=[];if(this.length==0){return a;}var _29=this[0];var els=_27?_29.getElementsByTagName("*"):_29.elements;if(!els){return a;}for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n){continue;}if(_27&&_29.clk&&el.type=="image"){if(!el.disabled&&_29.clk==el){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}continue;}var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:n,value:v});}}}if(!_27&&_29.clk){var _30=_29.getElementsByTagName("input");for(var i=0,max=_30.length;i<max;i++){var _32=_30[i];var n=_32.name;if(n&&!_32.disabled&&_32.type=="image"&&_29.clk==_32){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}}}return a;};$.fn.formSerialize=function(_34){return $.param(this.formToArray(_34));};$.fn.fieldSerialize=function(_35){var a=[];this.each(function(){var n=this.name;if(!n){return;}var v=$.fieldValue(this,_35);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:this.name,value:v});}}});return $.param(a);};$.fn.fieldValue=function(_3a){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,_3a);if(v===null||typeof v=="undefined"||(v.constructor==Array&&!v.length)){continue;}v.constructor==Array?$.merge(val,v):val.push(v);}return val;};$.fieldValue=function(el,_3f){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof _3f=="undefined"){_3f=true;}if(_3f&&(!n||el.disabled||t=="reset"||t=="button"||(t=="checkbox"||t=="radio")&&!el.checked||(t=="submit"||t=="image")&&el.form&&el.form.clk!=el||tag=="select"&&el.selectedIndex==-1)){return null;}if(tag=="select"){var _41=el.selectedIndex;if(_41<0){return null;}var a=[],ops=el.options;var one=(t=="select-one");var max=(one?_41+1:ops.length);for(var i=(one?_41:0);i<max;i++){var op=ops[i];if(op.selected){var v=$.browser.msie&&!(op.attributes["value"].specified)?op.text:op.value;if(one){return v;}a.push(v);}}return a;}return el.value;};$.fn.clearForm=function(){return this.each(function(){$("input,select,textarea",this).clearFields();});};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=="text"||t=="password"||tag=="textarea"){this.value="";}else{if(t=="checkbox"||t=="radio"){this.checked=false;}else{if(tag=="select"){this.selectedIndex=-1;}}}});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset();}});};})(jQuery);
\ No newline at end of file
--- a/web/support/form.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,819 +0,0 @@
-/*
- * jQuery Form Plugin
- * @requires jQuery v1.1 or later
- *
- * Examples at: http://malsup.com/jquery/form/
- * Dual licensed under the MIT and GPL licenses:
- *   http://www.opensource.org/licenses/mit-license.php
- *   http://www.gnu.org/licenses/gpl.html
- *
- * Revision: $Id$
- */
- (function($) {
-/**
- * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.
- *
- * ajaxSubmit accepts a single argument which can be either a success callback function
- * or an options Object.  If a function is provided it will be invoked upon successful
- * completion of the submit and will be passed the response from the server.
- * If an options Object is provided, the following attributes are supported:
- *
- *  target:   Identifies the element(s) in the page to be updated with the server response.
- *            This value may be specified as a jQuery selection string, a jQuery object,
- *            or a DOM element.
- *            default value: null
- *
- *  url:      URL to which the form data will be submitted.
- *            default value: value of form's 'action' attribute
- *
- *  type:     The method in which the form data should be submitted, 'GET' or 'POST'.
- *            default value: value of form's 'method' attribute (or 'GET' if none found)
- *
- *  data:     Additional data to add to the request, specified as key/value pairs (see $.ajax).
- *
- *  beforeSubmit:  Callback method to be invoked before the form is submitted.
- *            default value: null
- *
- *  success:  Callback method to be invoked after the form has been successfully submitted
- *            and the response has been returned from the server
- *            default value: null
- *
- *  dataType: Expected dataType of the response.  One of: null, 'xml', 'script', or 'json'
- *            default value: null
- *
- *  semantic: Boolean flag indicating whether data must be submitted in semantic order (slower).
- *            default value: false
- *
- *  resetForm: Boolean flag indicating whether the form should be reset if the submit is successful
- *
- *  clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful
- *
- *
- * The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for
- * validating the form data.  If the 'beforeSubmit' callback returns false then the form will
- * not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data
- * in array format, the jQuery object, and the options object passed into ajaxSubmit.
- * The form data array takes the following form:
- *
- *     [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * If a 'success' callback method is provided it is invoked after the response has been returned
- * from the server.  It is passed the responseText or responseXML value (depending on dataType).
- * See jQuery.ajax for further details.
- *
- *
- * The dataType option provides a means for specifying how the server response should be handled.
- * This maps directly to the jQuery.httpData method.  The following values are supported:
- *
- *      'xml':    if dataType == 'xml' the server response is treated as XML and the 'success'
- *                   callback method, if specified, will be passed the responseXML value
- *      'json':   if dataType == 'json' the server response will be evaluted and passed to
- *                   the 'success' callback, if specified
- *      'script': if dataType == 'script' the server response is evaluated in the global context
- *
- *
- * Note that it does not make sense to use both the 'target' and 'dataType' options.  If both
- * are provided the target will be ignored.
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * This is normally true anyway, unless the form contains input elements of type='image'.
- * If your form must be submitted with name/value pairs in semantic order and your form
- * contains an input of type='image" then pass true for this arg, otherwise pass false
- * (or nothing) to avoid the overhead for this logic.
- *
- *
- * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this:
- *
- * $("#form-id").submit(function() {
- *     $(this).ajaxSubmit(options);
- *     return false; // cancel conventional submit
- * });
- *
- * When using ajaxForm(), however, this is done for you.
- *
- * @example
- * $('#myForm').ajaxSubmit(function(data) {
- *     alert('Form submit succeeded! Server returned: ' + data);
- * });
- * @desc Submit form and alert server response
- *
- *
- * @example
- * var options = {
- *     target: '#myTargetDiv'
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Submit form and update page element with server response
- *
- *
- * @example
- * var options = {
- *     success: function(responseText) {
- *         alert(responseText);
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Submit form and alert the server response
- *
- *
- * @example
- * var options = {
- *     beforeSubmit: function(formArray, jqForm) {
- *         if (formArray.length == 0) {
- *             alert('Please enter data.');
- *             return false;
- *         }
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Pre-submit validation which aborts the submit operation if form data is empty
- *
- *
- * @example
- * var options = {
- *     url: myJsonUrl.php,
- *     dataType: 'json',
- *     success: function(data) {
- *        // 'data' is an object representing the the evaluated json data
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc json data returned and evaluated
- *
- *
- * @example
- * var options = {
- *     url: myXmlUrl.php,
- *     dataType: 'xml',
- *     success: function(responseXML) {
- *        // responseXML is XML document object
- *        var data = $('myElement', responseXML).text();
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc XML data returned from server
- *
- *
- * @example
- * var options = {
- *     resetForm: true
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc submit form and reset it if successful
- *
- * @example
- * $('#myForm).submit(function() {
- *    $(this).ajaxSubmit();
- *    return false;
- * });
- * @desc Bind form's submit event to use ajaxSubmit
- *
- *
- * @name ajaxSubmit
- * @type jQuery
- * @param options  object literal containing options which control the form submission process
- * @cat Plugins/Form
- * @return jQuery
- */
-$.fn.ajaxSubmit = function(options) {
-    if (typeof options == 'function')
-        options = { success: options };
-
-    options = $.extend({
-        url:  this.attr('action') || window.location,
-        type: this.attr('method') || 'GET'
-    }, options || {});
-
-    // hook for manipulating the form data before it is extracted;
-    // convenient for use with rich editors like tinyMCE or FCKEditor
-    var veto = {};
-    $.event.trigger('form.pre.serialize', [this, options, veto]);
-    if (veto.veto) return this;
-
-    var a = this.formToArray(options.semantic);
-	if (options.data) {
-	    for (var n in options.data)
-	        a.push( { name: n, value: options.data[n] } );
-	}
-
-    // give pre-submit callback an opportunity to abort the submit
-    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this;
-
-    // fire vetoable 'validate' event
-    $.event.trigger('form.submit.validate', [a, this, options, veto]);
-    if (veto.veto) return this;
-
-    var q = $.param(a);//.replace(/%20/g,'+');
-
-    if (options.type.toUpperCase() == 'GET') {
-        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
-        options.data = null;  // data is null for 'get'
-    }
-    else
-        options.data = q; // data is the query string for 'post'
-
-    var $form = this, callbacks = [];
-    if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
-    if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
-
-    // perform a load on the target only if dataType is not provided
-    if (!options.dataType && options.target) {
-        var oldSuccess = options.success || function(){};
-        callbacks.push(function(data) {
-            if (this.evalScripts)
-                $(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments);
-            else // jQuery v1.1.4
-                $(options.target).html(data).each(oldSuccess, arguments);
-        });
-    }
-    else if (options.success)
-        callbacks.push(options.success);
-
-    options.success = function(data, status) {
-        for (var i=0, max=callbacks.length; i < max; i++)
-            callbacks[i](data, status, $form);
-    };
-
-    // are there files to upload?
-    var files = $('input:file', this).fieldValue();
-    var found = false;
-    for (var j=0; j < files.length; j++)
-        if (files[j])
-            found = true;
-
-    if (options.iframe || found) // options.iframe allows user to force iframe mode
-        fileUpload();
-    else
-        $.ajax(options);
-
-    // fire 'notify' event
-    $.event.trigger('form.submit.notify', [this, options]);
-    return this;
-
-
-    // private function for handling file uploads (hat tip to YAHOO!)
-    function fileUpload() {
-        var form = $form[0];
-        var opts = $.extend({}, $.ajaxSettings, options);
-
-        var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++;
-        var $io = $('<iframe id="' + id + '" name="' + id + '" />');
-        var io = $io[0];
-        var op8 = $.browser.opera && window.opera.version() < 9;
-        if ($.browser.msie || op8) io.src = 'javascript:false;document.write("");';
-        $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
-
-        var xhr = { // mock object
-            responseText: null,
-            responseXML: null,
-            status: 0,
-            statusText: 'n/a',
-            getAllResponseHeaders: function() {},
-            getResponseHeader: function() {},
-            setRequestHeader: function() {}
-        };
-
-        var g = opts.global;
-        // trigger ajax global events so that activity/block indicators work like normal
-        if (g && ! $.active++) $.event.trigger("ajaxStart");
-        if (g) $.event.trigger("ajaxSend", [xhr, opts]);
-
-        var cbInvoked = 0;
-        var timedOut = 0;
-
-        // take a breath so that pending repaints get some cpu time before the upload starts
-        setTimeout(function() {
-            $io.appendTo('body');
-            // jQuery's event binding doesn't work for iframe events in IE
-            io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
-
-            // make sure form attrs are set
-            var encAttr = form.encoding ? 'encoding' : 'enctype';
-            var t = $form.attr('target');
-            $form.attr({
-                target:   id,
-                method:  'POST',
-                action:  opts.url
-            });
-            form[encAttr] = 'multipart/form-data';
-
-            // support timout
-            if (opts.timeout)
-                setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
-
-            form.submit();
-            $form.attr('target', t); // reset target
-        }, 10);
-
-        function cb() {
-            if (cbInvoked++) return;
-
-            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
-
-            var ok = true;
-            try {
-                if (timedOut) throw 'timeout';
-                // extract the server response from the iframe
-                var data, doc;
-                doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
-                xhr.responseText = doc.body ? doc.body.innerHTML : null;
-                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
-
-                if (opts.dataType == 'json' || opts.dataType == 'script') {
-                    var ta = doc.getElementsByTagName('textarea')[0];
-                    data = ta ? ta.value : xhr.responseText;
-                    if (opts.dataType == 'json')
-                        eval("data = " + data);
-                    else
-                        $.globalEval(data);
-                }
-                else if (opts.dataType == 'xml') {
-                    data = xhr.responseXML;
-                    if (!data && xhr.responseText != null)
-                        data = toXml(xhr.responseText);
-                }
-                else {
-                    data = xhr.responseText;
-                }
-            }
-            catch(e){
-                ok = false;
-                $.handleError(opts, xhr, 'error', e);
-            }
-
-            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
-            if (ok) {
-                opts.success(data, 'success');
-                if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
-            }
-            if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
-            if (g && ! --$.active) $.event.trigger("ajaxStop");
-            if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
-
-            // clean up
-            setTimeout(function() {
-                $io.remove();
-                xhr.responseXML = null;
-            }, 100);
-        };
-
-        function toXml(s, doc) {
-            if (window.ActiveXObject) {
-                doc = new ActiveXObject('Microsoft.XMLDOM');
-                doc.async = 'false';
-                doc.loadXML(s);
-            }
-            else
-                doc = (new DOMParser()).parseFromString(s, 'text/xml');
-            return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
-        };
-    };
-};
-$.fn.ajaxSubmit.counter = 0; // used to create unique iframe ids
-
-/**
- * ajaxForm() provides a mechanism for fully automating form submission.
- *
- * The advantages of using this method instead of ajaxSubmit() are:
- *
- * 1: This method will include coordinates for <input type="image" /> elements (if the element
- *    is used to submit the form).
- * 2. This method will include the submit element's name/value data (for the element that was
- *    used to submit the form).
- * 3. This method binds the submit() method to the form for you.
- *
- * Note that for accurate x/y coordinates of image submit elements in all browsers
- * you need to also use the "dimensions" plugin (this method will auto-detect its presence).
- *
- * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
- * passes the options argument along after properly binding events for submit elements and
- * the form itself.  See ajaxSubmit for a full description of the options argument.
- *
- *
- * @example
- * var options = {
- *     target: '#myTargetDiv'
- * };
- * $('#myForm').ajaxSForm(options);
- * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response
- *       when the form is submitted.
- *
- *
- * @example
- * var options = {
- *     success: function(responseText) {
- *         alert(responseText);
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Bind form's submit event so that server response is alerted after the form is submitted.
- *
- *
- * @example
- * var options = {
- *     beforeSubmit: function(formArray, jqForm) {
- *         if (formArray.length == 0) {
- *             alert('Please enter data.');
- *             return false;
- *         }
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Bind form's submit event so that pre-submit callback is invoked before the form
- *       is submitted.
- *
- *
- * @name   ajaxForm
- * @param  options  object literal containing options which control the form submission process
- * @return jQuery
- * @cat    Plugins/Form
- * @type   jQuery
- */
-$.fn.ajaxForm = function(options) {
-    return this.ajaxFormUnbind().submit(submitHandler).each(function() {
-        // store options in hash
-        this.formPluginId = $.fn.ajaxForm.counter++;
-        $.fn.ajaxForm.optionHash[this.formPluginId] = options;
-        $(":submit,input:image", this).click(clickHandler);
-    });
-};
-
-$.fn.ajaxForm.counter = 1;
-$.fn.ajaxForm.optionHash = {};
-
-function clickHandler(e) {
-    var $form = this.form;
-    $form.clk = this;
-    if (this.type == 'image') {
-        if (e.offsetX != undefined) {
-            $form.clk_x = e.offsetX;
-            $form.clk_y = e.offsetY;
-        } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
-            var offset = $(this).offset();
-            $form.clk_x = e.pageX - offset.left;
-            $form.clk_y = e.pageY - offset.top;
-        } else {
-            $form.clk_x = e.pageX - this.offsetLeft;
-            $form.clk_y = e.pageY - this.offsetTop;
-        }
-    }
-    // clear form vars
-    setTimeout(function() { $form.clk = $form.clk_x = $form.clk_y = null; }, 10);
-};
-
-function submitHandler() {
-    // retrieve options from hash
-    var id = this.formPluginId;
-    var options = $.fn.ajaxForm.optionHash[id];
-    $(this).ajaxSubmit(options);
-    return false;
-};
-
-/**
- * ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
- *
- * @name   ajaxFormUnbind
- * @return jQuery
- * @cat    Plugins/Form
- * @type   jQuery
- */
-$.fn.ajaxFormUnbind = function() {
-    this.unbind('submit', submitHandler);
-    return this.each(function() {
-        $(":submit,input:image", this).unbind('click', clickHandler);
-    });
-
-};
-
-/**
- * formToArray() gathers form element data into an array of objects that can
- * be passed to any of the following ajax functions: $.get, $.post, or load.
- * Each object in the array has both a 'name' and 'value' property.  An example of
- * an array for a simple login form might be:
- *
- * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * It is this array that is passed to pre-submit callback functions provided to the
- * ajaxSubmit() and ajaxForm() methods.
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * This is normally true anyway, unless the form contains input elements of type='image'.
- * If your form must be submitted with name/value pairs in semantic order and your form
- * contains an input of type='image" then pass true for this arg, otherwise pass false
- * (or nothing) to avoid the overhead for this logic.
- *
- * @example var data = $("#myForm").formToArray();
- * $.post( "myscript.cgi", data );
- * @desc Collect all the data from a form and submit it to the server.
- *
- * @name formToArray
- * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
- * @type Array<Object>
- * @cat Plugins/Form
- */
-$.fn.formToArray = function(semantic) {
-    var a = [];
-    if (this.length == 0) return a;
-
-    var form = this[0];
-    var els = semantic ? form.getElementsByTagName('*') : form.elements;
-    if (!els) return a;
-    for(var i=0, max=els.length; i < max; i++) {
-        var el = els[i];
-        var n = el.name;
-        if (!n) continue;
-
-        if (semantic && form.clk && el.type == "image") {
-            // handle image inputs on the fly when semantic == true
-            if(!el.disabled && form.clk == el)
-                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-            continue;
-        }
-
-        var v = $.fieldValue(el, true);
-        if (v && v.constructor == Array) {
-            for(var j=0, jmax=v.length; j < jmax; j++)
-                a.push({name: n, value: v[j]});
-        }
-        else if (v !== null && typeof v != 'undefined')
-            a.push({name: n, value: v});
-    }
-
-    if (!semantic && form.clk) {
-        // input type=='image' are not found in elements array! handle them here
-        var inputs = form.getElementsByTagName("input");
-        for(var i=0, max=inputs.length; i < max; i++) {
-            var input = inputs[i];
-            var n = input.name;
-            if(n && !input.disabled && input.type == "image" && form.clk == input)
-                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-        }
-    }
-    return a;
-};
-
-
-/**
- * Serializes form data into a 'submittable' string. This method will return a string
- * in the format: name1=value1&amp;name2=value2
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * If your form must be submitted with name/value pairs in semantic order then pass
- * true for this arg, otherwise pass false (or nothing) to avoid the overhead for
- * this logic (which can be significant for very large forms).
- *
- * @example var data = $("#myForm").formSerialize();
- * $.ajax('POST', "myscript.cgi", data);
- * @desc Collect all the data from a form into a single string
- *
- * @name formSerialize
- * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
- * @type String
- * @cat Plugins/Form
- */
-$.fn.formSerialize = function(semantic) {
-    //hand off to jQuery.param for proper encoding
-    return $.param(this.formToArray(semantic));
-};
-
-
-/**
- * Serializes all field elements in the jQuery object into a query string.
- * This method will return a string in the format: name1=value1&amp;name2=value2
- *
- * The successful argument controls whether or not serialization is limited to
- * 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.
- *
- * @example var data = $("input").formSerialize();
- * @desc Collect the data from all successful input elements into a query string
- *
- * @example var data = $(":radio").formSerialize();
- * @desc Collect the data from all successful radio input elements into a query string
- *
- * @example var data = $("#myForm :checkbox").formSerialize();
- * @desc Collect the data from all successful checkbox input elements in myForm into a query string
- *
- * @example var data = $("#myForm :checkbox").formSerialize(false);
- * @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string
- *
- * @example var data = $(":input").formSerialize();
- * @desc Collect the data from all successful input, select, textarea and button elements into a query string
- *
- * @name fieldSerialize
- * @param successful true if only successful controls should be serialized (default is true)
- * @type String
- * @cat Plugins/Form
- */
-$.fn.fieldSerialize = function(successful) {
-    var a = [];
-    this.each(function() {
-        var n = this.name;
-        if (!n) return;
-        var v = $.fieldValue(this, successful);
-        if (v && v.constructor == Array) {
-            for (var i=0,max=v.length; i < max; i++)
-                a.push({name: n, value: v[i]});
-        }
-        else if (v !== null && typeof v != 'undefined')
-            a.push({name: this.name, value: v});
-    });
-    //hand off to jQuery.param for proper encoding
-    return $.param(a);
-};
-
-
-/**
- * Returns the value(s) of the element in the matched set.  For example, consider the following form:
- *
- *  <form><fieldset>
- *      <input name="A" type="text" />
- *      <input name="A" type="text" />
- *      <input name="B" type="checkbox" value="B1" />
- *      <input name="B" type="checkbox" value="B2"/>
- *      <input name="C" type="radio" value="C1" />
- *      <input name="C" type="radio" value="C2" />
- *  </fieldset></form>
- *
- *  var v = $(':text').fieldValue();
- *  // if no values are entered into the text inputs
- *  v == ['','']
- *  // if values entered into the text inputs are 'foo' and 'bar'
- *  v == ['foo','bar']
- *
- *  var v = $(':checkbox').fieldValue();
- *  // if neither checkbox is checked
- *  v === undefined
- *  // if both checkboxes are checked
- *  v == ['B1', 'B2']
- *
- *  var v = $(':radio').fieldValue();
- *  // if neither radio is checked
- *  v === undefined
- *  // if first radio is checked
- *  v == ['C1']
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.  If this value is false the value(s)
- * for each element is returned.
- *
- * Note: This method *always* returns an array.  If no valid value can be determined the
- *       array will be empty, otherwise it will contain one or more values.
- *
- * @example var data = $("#myPasswordElement").fieldValue();
- * alert(data[0]);
- * @desc Alerts the current value of the myPasswordElement element
- *
- * @example var data = $("#myForm :input").fieldValue();
- * @desc Get the value(s) of the form elements in myForm
- *
- * @example var data = $("#myForm :checkbox").fieldValue();
- * @desc Get the value(s) for the successful checkbox element(s) in the jQuery object.
- *
- * @example var data = $("#mySingleSelect").fieldValue();
- * @desc Get the value(s) of the select control
- *
- * @example var data = $(':text').fieldValue();
- * @desc Get the value(s) of the text input or textarea elements
- *
- * @example var data = $("#myMultiSelect").fieldValue();
- * @desc Get the values for the select-multiple control
- *
- * @name fieldValue
- * @param Boolean successful true if only the values for successful controls should be returned (default is true)
- * @type Array<String>
- * @cat Plugins/Form
- */
-$.fn.fieldValue = function(successful) {
-    for (var val=[], i=0, max=this.length; i < max; i++) {
-        var el = this[i];
-        var v = $.fieldValue(el, successful);
-        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
-            continue;
-        v.constructor == Array ? $.merge(val, v) : val.push(v);
-    }
-    return val;
-};
-
-/**
- * Returns the value of the field element.
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.  If the given element is not
- * successful and the successful arg is not false then the returned value will be null.
- *
- * Note: If the successful flag is true (default) but the element is not successful, the return will be null
- * Note: The value returned for a successful select-multiple element will always be an array.
- * Note: If the element has no value the return value will be undefined.
- *
- * @example var data = jQuery.fieldValue($("#myPasswordElement")[0]);
- * @desc Gets the current value of the myPasswordElement element
- *
- * @name fieldValue
- * @param Element el The DOM element for which the value will be returned
- * @param Boolean successful true if value returned must be for a successful controls (default is true)
- * @type String or Array<String> or null or undefined
- * @cat Plugins/Form
- */
-$.fieldValue = function(el, successful) {
-    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
-    if (typeof successful == 'undefined') successful = true;
-
-    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
-        (t == 'checkbox' || t == 'radio') && !el.checked ||
-        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
-        tag == 'select' && el.selectedIndex == -1))
-            return null;
-
-    if (tag == 'select') {
-        var index = el.selectedIndex;
-        if (index < 0) return null;
-        var a = [], ops = el.options;
-        var one = (t == 'select-one');
-        var max = (one ? index+1 : ops.length);
-        for(var i=(one ? index : 0); i < max; i++) {
-            var op = ops[i];
-            if (op.selected) {
-                // extra pain for IE...
-                var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
-                if (one) return v;
-                a.push(v);
-            }
-        }
-        return a;
-    }
-    return el.value;
-};
-
-
-/**
- * Clears the form data.  Takes the following actions on the form's input fields:
- *  - input text fields will have their 'value' property set to the empty string
- *  - select elements will have their 'selectedIndex' property set to -1
- *  - checkbox and radio inputs will have their 'checked' property set to false
- *  - inputs of type submit, button, reset, and hidden will *not* be effected
- *  - button elements will *not* be effected
- *
- * @example $('form').clearForm();
- * @desc Clears all forms on the page.
- *
- * @name clearForm
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.clearForm = function() {
-    return this.each(function() {
-        $('input,select,textarea', this).clearFields();
-    });
-};
-
-/**
- * Clears the selected form elements.  Takes the following actions on the matched elements:
- *  - input text fields will have their 'value' property set to the empty string
- *  - select elements will have their 'selectedIndex' property set to -1
- *  - checkbox and radio inputs will have their 'checked' property set to false
- *  - inputs of type submit, button, reset, and hidden will *not* be effected
- *  - button elements will *not* be effected
- *
- * @example $('.myInputs').clearFields();
- * @desc Clears all inputs with class myInputs
- *
- * @name clearFields
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.clearFields = $.fn.clearInputs = function() {
-    return this.each(function() {
-        var t = this.type, tag = this.tagName.toLowerCase();
-        if (t == 'text' || t == 'password' || tag == 'textarea')
-            this.value = '';
-        else if (t == 'checkbox' || t == 'radio')
-            this.checked = false;
-        else if (tag == 'select')
-            this.selectedIndex = -1;
-    });
-};
-
-
-/**
- * Resets the form data.  Causes all form elements to be reset to their original value.
- *
- * @example $('form').resetForm();
- * @desc Resets all forms on the page.
- *
- * @name resetForm
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.resetForm = function() {
-    return this.each(function() {
-        // guard against an input with the name of 'reset'
-        // note that IE reports the reset function as an 'object'
-        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
-            this.reset();
-    });
-};
-
-})(jQuery);
--- a/web/support/form.js~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,819 +0,0 @@
-/*
- * jQuery Form Plugin
- * @requires jQuery v1.1 or later
- *
- * Examples at: http://malsup.com/jquery/form/
- * Dual licensed under the MIT and GPL licenses:
- *   http://www.opensource.org/licenses/mit-license.php
- *   http://www.gnu.org/licenses/gpl.html
- *
- * Revision: $Id$
- */
- (function($) {
-/**
- * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.
- *
- * ajaxSubmit accepts a single argument which can be either a success callback function
- * or an options Object.  If a function is provided it will be invoked upon successful
- * completion of the submit and will be passed the response from the server.
- * If an options Object is provided, the following attributes are supported:
- *
- *  target:   Identifies the element(s) in the page to be updated with the server response.
- *            This value may be specified as a jQuery selection string, a jQuery object,
- *            or a DOM element.
- *            default value: null
- *
- *  url:      URL to which the form data will be submitted.
- *            default value: value of form's 'action' attribute
- *
- *  type:     The method in which the form data should be submitted, 'GET' or 'POST'.
- *            default value: value of form's 'method' attribute (or 'GET' if none found)
- *
- *  data:     Additional data to add to the request, specified as key/value pairs (see $.ajax).
- *
- *  beforeSubmit:  Callback method to be invoked before the form is submitted.
- *            default value: null
- *
- *  success:  Callback method to be invoked after the form has been successfully submitted
- *            and the response has been returned from the server
- *            default value: null
- *
- *  dataType: Expected dataType of the response.  One of: null, 'xml', 'script', or 'json'
- *            default value: null
- *
- *  semantic: Boolean flag indicating whether data must be submitted in semantic order (slower).
- *            default value: false
- *
- *  resetForm: Boolean flag indicating whether the form should be reset if the submit is successful
- *
- *  clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful
- *
- *
- * The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for
- * validating the form data.  If the 'beforeSubmit' callback returns false then the form will
- * not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data
- * in array format, the jQuery object, and the options object passed into ajaxSubmit.
- * The form data array takes the following form:
- *
- *     [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * If a 'success' callback method is provided it is invoked after the response has been returned
- * from the server.  It is passed the responseText or responseXML value (depending on dataType).
- * See jQuery.ajax for further details.
- *
- *
- * The dataType option provides a means for specifying how the server response should be handled.
- * This maps directly to the jQuery.httpData method.  The following values are supported:
- *
- *      'xml':    if dataType == 'xml' the server response is treated as XML and the 'success'
- *                   callback method, if specified, will be passed the responseXML value
- *      'json':   if dataType == 'json' the server response will be evaluted and passed to
- *                   the 'success' callback, if specified
- *      'script': if dataType == 'script' the server response is evaluated in the global context
- *
- *
- * Note that it does not make sense to use both the 'target' and 'dataType' options.  If both
- * are provided the target will be ignored.
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * This is normally true anyway, unless the form contains input elements of type='image'.
- * If your form must be submitted with name/value pairs in semantic order and your form
- * contains an input of type='image" then pass true for this arg, otherwise pass false
- * (or nothing) to avoid the overhead for this logic.
- *
- *
- * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this:
- *
- * $("#form-id").submit(function() {
- *     $(this).ajaxSubmit(options);
- *     return false; // cancel conventional submit
- * });
- *
- * When using ajaxForm(), however, this is done for you.
- *
- * @example
- * $('#myForm').ajaxSubmit(function(data) {
- *     alert('Form submit succeeded! Server returned: ' + data);
- * });
- * @desc Submit form and alert server response
- *
- *
- * @example
- * var options = {
- *     target: '#myTargetDiv'
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Submit form and update page element with server response
- *
- *
- * @example
- * var options = {
- *     success: function(responseText) {
- *         alert(responseText);
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Submit form and alert the server response
- *
- *
- * @example
- * var options = {
- *     beforeSubmit: function(formArray, jqForm) {
- *         if (formArray.length == 0) {
- *             alert('Please enter data.');
- *             return false;
- *         }
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Pre-submit validation which aborts the submit operation if form data is empty
- *
- *
- * @example
- * var options = {
- *     url: myJsonUrl.php,
- *     dataType: 'json',
- *     success: function(data) {
- *        // 'data' is an object representing the the evaluated json data
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc json data returned and evaluated
- *
- *
- * @example
- * var options = {
- *     url: myXmlUrl.php,
- *     dataType: 'xml',
- *     success: function(responseXML) {
- *        // responseXML is XML document object
- *        var data = $('myElement', responseXML).text();
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc XML data returned from server
- *
- *
- * @example
- * var options = {
- *     resetForm: true
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc submit form and reset it if successful
- *
- * @example
- * $('#myForm).submit(function() {
- *    $(this).ajaxSubmit();
- *    return false;
- * });
- * @desc Bind form's submit event to use ajaxSubmit
- *
- *
- * @name ajaxSubmit
- * @type jQuery
- * @param options  object literal containing options which control the form submission process
- * @cat Plugins/Form
- * @return jQuery
- */
-$.fn.ajaxSubmit = function(options) {
-    if (typeof options == 'function')
-        options = { success: options };
-
-    options = $.extend({
-        url:  this.attr('action') || window.location,
-        type: this.attr('method') || 'GET'
-    }, options || {});
-
-    // hook for manipulating the form data before it is extracted;
-    // convenient for use with rich editors like tinyMCE or FCKEditor
-    var veto = {};
-    $.event.trigger('form.pre.serialize', [this, options, veto]);
-    if (veto.veto) return this;
-
-    var a = this.formToArray(options.semantic);
-	if (options.data) {
-	    for (var n in options.data)
-	        a.push( { name: n, value: options.data[n] } );
-	}
-
-    // give pre-submit callback an opportunity to abort the submit
-    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this;
-
-    // fire vetoable 'validate' event
-    $.event.trigger('form.submit.validate', [a, this, options, veto]);
-    if (veto.veto) return this;
-
-    var q = $.param(a);//.replace(/%20/g,'+');
-
-    if (options.type.toUpperCase() == 'GET') {
-        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
-        options.data = null;  // data is null for 'get'
-    }
-    else
-        options.data = q; // data is the query string for 'post'
-
-    var $form = this, callbacks = [];
-    if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
-    if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
-
-    // perform a load on the target only if dataType is not provided
-    if (!options.dataType && options.target) {
-        var oldSuccess = options.success || function(){};
-        callbacks.push(function(data) {
-            if (this.evalScripts)
-                $(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments);
-            else // jQuery v1.1.4
-                $(options.target).html(data).each(oldSuccess, arguments);
-        });
-    }
-    else if (options.success)
-        callbacks.push(options.success);
-
-    options.success = function(data, status) {
-        for (var i=0, max=callbacks.length; i < max; i++)
-            callbacks[i](data, status, $form);
-    };
-
-    // are there files to upload?
-    var files = $('input:file', this).fieldValue();
-    var found = false;
-    for (var j=0; j < files.length; j++)
-        if (files[j])
-            found = true;
-
-    if (options.iframe || found) // options.iframe allows user to force iframe mode
-        fileUpload();
-    else
-        $.ajax(options);
-
-    // fire 'notify' event
-    $.event.trigger('form.submit.notify', [this, options]);
-    return this;
-
-
-    // private function for handling file uploads (hat tip to YAHOO!)
-    function fileUpload() {
-        var form = $form[0];
-        var opts = $.extend({}, $.ajaxSettings, options);
-
-        var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++;
-        var $io = $('<iframe id="' + id + '" name="' + id + '" />');
-        var io = $io[0];
-        var op8 = $.browser.opera && window.opera.version() < 9;
-        if ($.browser.msie || op8) io.src = 'javascript:false;document.write("");';
-        $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
-
-        var xhr = { // mock object
-            responseText: null,
-            responseXML: null,
-            status: 0,
-            statusText: 'n/a',
-            getAllResponseHeaders: function() {},
-            getResponseHeader: function() {},
-            setRequestHeader: function() {}
-        };
-
-        var g = opts.global;
-        // trigger ajax global events so that activity/block indicators work like normal
-        if (g && ! $.active++) $.event.trigger("ajaxStart");
-        if (g) $.event.trigger("ajaxSend", [xhr, opts]);
-
-        var cbInvoked = 0;
-        var timedOut = 0;
-
-        // take a breath so that pending repaints get some cpu time before the upload starts
-        setTimeout(function() {
-            $io.appendTo('body');
-            // jQuery's event binding doesn't work for iframe events in IE
-            io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
-
-            // make sure form attrs are set
-            var encAttr = form.encoding ? 'encoding' : 'enctype';
-            var t = $form.attr('target');
-            $form.attr({
-                target:   id,
-                method:  'POST',
-                action:   'review/'+opts.url
-            });
-            form[encAttr] = 'multipart/form-data';
-
-            // support timout
-            if (opts.timeout)
-                setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
-
-            form.submit();
-            $form.attr('target', t); // reset target
-        }, 10);
-
-        function cb() {
-            if (cbInvoked++) return;
-
-            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
-
-            var ok = true;
-            try {
-                if (timedOut) throw 'timeout';
-                // extract the server response from the iframe
-                var data, doc;
-                doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
-                xhr.responseText = doc.body ? doc.body.innerHTML : null;
-                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
-
-                if (opts.dataType == 'json' || opts.dataType == 'script') {
-                    var ta = doc.getElementsByTagName('textarea')[0];
-                    data = ta ? ta.value : xhr.responseText;
-                    if (opts.dataType == 'json')
-                        eval("data = " + data);
-                    else
-                        $.globalEval(data);
-                }
-                else if (opts.dataType == 'xml') {
-                    data = xhr.responseXML;
-                    if (!data && xhr.responseText != null)
-                        data = toXml(xhr.responseText);
-                }
-                else {
-                    data = xhr.responseText;
-                }
-            }
-            catch(e){
-                ok = false;
-                $.handleError(opts, xhr, 'error', e);
-            }
-
-            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
-            if (ok) {
-                opts.success(data, 'success');
-                if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
-            }
-            if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
-            if (g && ! --$.active) $.event.trigger("ajaxStop");
-            if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
-
-            // clean up
-            setTimeout(function() {
-                $io.remove();
-                xhr.responseXML = null;
-            }, 100);
-        };
-
-        function toXml(s, doc) {
-            if (window.ActiveXObject) {
-                doc = new ActiveXObject('Microsoft.XMLDOM');
-                doc.async = 'false';
-                doc.loadXML(s);
-            }
-            else
-                doc = (new DOMParser()).parseFromString(s, 'text/xml');
-            return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
-        };
-    };
-};
-$.fn.ajaxSubmit.counter = 0; // used to create unique iframe ids
-
-/**
- * ajaxForm() provides a mechanism for fully automating form submission.
- *
- * The advantages of using this method instead of ajaxSubmit() are:
- *
- * 1: This method will include coordinates for <input type="image" /> elements (if the element
- *    is used to submit the form).
- * 2. This method will include the submit element's name/value data (for the element that was
- *    used to submit the form).
- * 3. This method binds the submit() method to the form for you.
- *
- * Note that for accurate x/y coordinates of image submit elements in all browsers
- * you need to also use the "dimensions" plugin (this method will auto-detect its presence).
- *
- * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
- * passes the options argument along after properly binding events for submit elements and
- * the form itself.  See ajaxSubmit for a full description of the options argument.
- *
- *
- * @example
- * var options = {
- *     target: '#myTargetDiv'
- * };
- * $('#myForm').ajaxSForm(options);
- * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response
- *       when the form is submitted.
- *
- *
- * @example
- * var options = {
- *     success: function(responseText) {
- *         alert(responseText);
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Bind form's submit event so that server response is alerted after the form is submitted.
- *
- *
- * @example
- * var options = {
- *     beforeSubmit: function(formArray, jqForm) {
- *         if (formArray.length == 0) {
- *             alert('Please enter data.');
- *             return false;
- *         }
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Bind form's submit event so that pre-submit callback is invoked before the form
- *       is submitted.
- *
- *
- * @name   ajaxForm
- * @param  options  object literal containing options which control the form submission process
- * @return jQuery
- * @cat    Plugins/Form
- * @type   jQuery
- */
-$.fn.ajaxForm = function(options) {
-    return this.ajaxFormUnbind().submit(submitHandler).each(function() {
-        // store options in hash
-        this.formPluginId = $.fn.ajaxForm.counter++;
-        $.fn.ajaxForm.optionHash[this.formPluginId] = options;
-        $(":submit,input:image", this).click(clickHandler);
-    });
-};
-
-$.fn.ajaxForm.counter = 1;
-$.fn.ajaxForm.optionHash = {};
-
-function clickHandler(e) {
-    var $form = this.form;
-    $form.clk = this;
-    if (this.type == 'image') {
-        if (e.offsetX != undefined) {
-            $form.clk_x = e.offsetX;
-            $form.clk_y = e.offsetY;
-        } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
-            var offset = $(this).offset();
-            $form.clk_x = e.pageX - offset.left;
-            $form.clk_y = e.pageY - offset.top;
-        } else {
-            $form.clk_x = e.pageX - this.offsetLeft;
-            $form.clk_y = e.pageY - this.offsetTop;
-        }
-    }
-    // clear form vars
-    setTimeout(function() { $form.clk = $form.clk_x = $form.clk_y = null; }, 10);
-};
-
-function submitHandler() {
-    // retrieve options from hash
-    var id = this.formPluginId;
-    var options = $.fn.ajaxForm.optionHash[id];
-    $(this).ajaxSubmit(options);
-    return false;
-};
-
-/**
- * ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
- *
- * @name   ajaxFormUnbind
- * @return jQuery
- * @cat    Plugins/Form
- * @type   jQuery
- */
-$.fn.ajaxFormUnbind = function() {
-    this.unbind('submit', submitHandler);
-    return this.each(function() {
-        $(":submit,input:image", this).unbind('click', clickHandler);
-    });
-
-};
-
-/**
- * formToArray() gathers form element data into an array of objects that can
- * be passed to any of the following ajax functions: $.get, $.post, or load.
- * Each object in the array has both a 'name' and 'value' property.  An example of
- * an array for a simple login form might be:
- *
- * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * It is this array that is passed to pre-submit callback functions provided to the
- * ajaxSubmit() and ajaxForm() methods.
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * This is normally true anyway, unless the form contains input elements of type='image'.
- * If your form must be submitted with name/value pairs in semantic order and your form
- * contains an input of type='image" then pass true for this arg, otherwise pass false
- * (or nothing) to avoid the overhead for this logic.
- *
- * @example var data = $("#myForm").formToArray();
- * $.post( "myscript.cgi", data );
- * @desc Collect all the data from a form and submit it to the server.
- *
- * @name formToArray
- * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
- * @type Array<Object>
- * @cat Plugins/Form
- */
-$.fn.formToArray = function(semantic) {
-    var a = [];
-    if (this.length == 0) return a;
-
-    var form = this[0];
-    var els = semantic ? form.getElementsByTagName('*') : form.elements;
-    if (!els) return a;
-    for(var i=0, max=els.length; i < max; i++) {
-        var el = els[i];
-        var n = el.name;
-        if (!n) continue;
-
-        if (semantic && form.clk && el.type == "image") {
-            // handle image inputs on the fly when semantic == true
-            if(!el.disabled && form.clk == el)
-                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-            continue;
-        }
-
-        var v = $.fieldValue(el, true);
-        if (v && v.constructor == Array) {
-            for(var j=0, jmax=v.length; j < jmax; j++)
-                a.push({name: n, value: v[j]});
-        }
-        else if (v !== null && typeof v != 'undefined')
-            a.push({name: n, value: v});
-    }
-
-    if (!semantic && form.clk) {
-        // input type=='image' are not found in elements array! handle them here
-        var inputs = form.getElementsByTagName("input");
-        for(var i=0, max=inputs.length; i < max; i++) {
-            var input = inputs[i];
-            var n = input.name;
-            if(n && !input.disabled && input.type == "image" && form.clk == input)
-                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-        }
-    }
-    return a;
-};
-
-
-/**
- * Serializes form data into a 'submittable' string. This method will return a string
- * in the format: name1=value1&amp;name2=value2
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * If your form must be submitted with name/value pairs in semantic order then pass
- * true for this arg, otherwise pass false (or nothing) to avoid the overhead for
- * this logic (which can be significant for very large forms).
- *
- * @example var data = $("#myForm").formSerialize();
- * $.ajax('POST', "myscript.cgi", data);
- * @desc Collect all the data from a form into a single string
- *
- * @name formSerialize
- * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
- * @type String
- * @cat Plugins/Form
- */
-$.fn.formSerialize = function(semantic) {
-    //hand off to jQuery.param for proper encoding
-    return $.param(this.formToArray(semantic));
-};
-
-
-/**
- * Serializes all field elements in the jQuery object into a query string.
- * This method will return a string in the format: name1=value1&amp;name2=value2
- *
- * The successful argument controls whether or not serialization is limited to
- * 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.
- *
- * @example var data = $("input").formSerialize();
- * @desc Collect the data from all successful input elements into a query string
- *
- * @example var data = $(":radio").formSerialize();
- * @desc Collect the data from all successful radio input elements into a query string
- *
- * @example var data = $("#myForm :checkbox").formSerialize();
- * @desc Collect the data from all successful checkbox input elements in myForm into a query string
- *
- * @example var data = $("#myForm :checkbox").formSerialize(false);
- * @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string
- *
- * @example var data = $(":input").formSerialize();
- * @desc Collect the data from all successful input, select, textarea and button elements into a query string
- *
- * @name fieldSerialize
- * @param successful true if only successful controls should be serialized (default is true)
- * @type String
- * @cat Plugins/Form
- */
-$.fn.fieldSerialize = function(successful) {
-    var a = [];
-    this.each(function() {
-        var n = this.name;
-        if (!n) return;
-        var v = $.fieldValue(this, successful);
-        if (v && v.constructor == Array) {
-            for (var i=0,max=v.length; i < max; i++)
-                a.push({name: n, value: v[i]});
-        }
-        else if (v !== null && typeof v != 'undefined')
-            a.push({name: this.name, value: v});
-    });
-    //hand off to jQuery.param for proper encoding
-    return $.param(a);
-};
-
-
-/**
- * Returns the value(s) of the element in the matched set.  For example, consider the following form:
- *
- *  <form><fieldset>
- *      <input name="A" type="text" />
- *      <input name="A" type="text" />
- *      <input name="B" type="checkbox" value="B1" />
- *      <input name="B" type="checkbox" value="B2"/>
- *      <input name="C" type="radio" value="C1" />
- *      <input name="C" type="radio" value="C2" />
- *  </fieldset></form>
- *
- *  var v = $(':text').fieldValue();
- *  // if no values are entered into the text inputs
- *  v == ['','']
- *  // if values entered into the text inputs are 'foo' and 'bar'
- *  v == ['foo','bar']
- *
- *  var v = $(':checkbox').fieldValue();
- *  // if neither checkbox is checked
- *  v === undefined
- *  // if both checkboxes are checked
- *  v == ['B1', 'B2']
- *
- *  var v = $(':radio').fieldValue();
- *  // if neither radio is checked
- *  v === undefined
- *  // if first radio is checked
- *  v == ['C1']
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.  If this value is false the value(s)
- * for each element is returned.
- *
- * Note: This method *always* returns an array.  If no valid value can be determined the
- *       array will be empty, otherwise it will contain one or more values.
- *
- * @example var data = $("#myPasswordElement").fieldValue();
- * alert(data[0]);
- * @desc Alerts the current value of the myPasswordElement element
- *
- * @example var data = $("#myForm :input").fieldValue();
- * @desc Get the value(s) of the form elements in myForm
- *
- * @example var data = $("#myForm :checkbox").fieldValue();
- * @desc Get the value(s) for the successful checkbox element(s) in the jQuery object.
- *
- * @example var data = $("#mySingleSelect").fieldValue();
- * @desc Get the value(s) of the select control
- *
- * @example var data = $(':text').fieldValue();
- * @desc Get the value(s) of the text input or textarea elements
- *
- * @example var data = $("#myMultiSelect").fieldValue();
- * @desc Get the values for the select-multiple control
- *
- * @name fieldValue
- * @param Boolean successful true if only the values for successful controls should be returned (default is true)
- * @type Array<String>
- * @cat Plugins/Form
- */
-$.fn.fieldValue = function(successful) {
-    for (var val=[], i=0, max=this.length; i < max; i++) {
-        var el = this[i];
-        var v = $.fieldValue(el, successful);
-        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
-            continue;
-        v.constructor == Array ? $.merge(val, v) : val.push(v);
-    }
-    return val;
-};
-
-/**
- * Returns the value of the field element.
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.  If the given element is not
- * successful and the successful arg is not false then the returned value will be null.
- *
- * Note: If the successful flag is true (default) but the element is not successful, the return will be null
- * Note: The value returned for a successful select-multiple element will always be an array.
- * Note: If the element has no value the return value will be undefined.
- *
- * @example var data = jQuery.fieldValue($("#myPasswordElement")[0]);
- * @desc Gets the current value of the myPasswordElement element
- *
- * @name fieldValue
- * @param Element el The DOM element for which the value will be returned
- * @param Boolean successful true if value returned must be for a successful controls (default is true)
- * @type String or Array<String> or null or undefined
- * @cat Plugins/Form
- */
-$.fieldValue = function(el, successful) {
-    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
-    if (typeof successful == 'undefined') successful = true;
-
-    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
-        (t == 'checkbox' || t == 'radio') && !el.checked ||
-        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
-        tag == 'select' && el.selectedIndex == -1))
-            return null;
-
-    if (tag == 'select') {
-        var index = el.selectedIndex;
-        if (index < 0) return null;
-        var a = [], ops = el.options;
-        var one = (t == 'select-one');
-        var max = (one ? index+1 : ops.length);
-        for(var i=(one ? index : 0); i < max; i++) {
-            var op = ops[i];
-            if (op.selected) {
-                // extra pain for IE...
-                var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
-                if (one) return v;
-                a.push(v);
-            }
-        }
-        return a;
-    }
-    return el.value;
-};
-
-
-/**
- * Clears the form data.  Takes the following actions on the form's input fields:
- *  - input text fields will have their 'value' property set to the empty string
- *  - select elements will have their 'selectedIndex' property set to -1
- *  - checkbox and radio inputs will have their 'checked' property set to false
- *  - inputs of type submit, button, reset, and hidden will *not* be effected
- *  - button elements will *not* be effected
- *
- * @example $('form').clearForm();
- * @desc Clears all forms on the page.
- *
- * @name clearForm
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.clearForm = function() {
-    return this.each(function() {
-        $('input,select,textarea', this).clearFields();
-    });
-};
-
-/**
- * Clears the selected form elements.  Takes the following actions on the matched elements:
- *  - input text fields will have their 'value' property set to the empty string
- *  - select elements will have their 'selectedIndex' property set to -1
- *  - checkbox and radio inputs will have their 'checked' property set to false
- *  - inputs of type submit, button, reset, and hidden will *not* be effected
- *  - button elements will *not* be effected
- *
- * @example $('.myInputs').clearFields();
- * @desc Clears all inputs with class myInputs
- *
- * @name clearFields
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.clearFields = $.fn.clearInputs = function() {
-    return this.each(function() {
-        var t = this.type, tag = this.tagName.toLowerCase();
-        if (t == 'text' || t == 'password' || tag == 'textarea')
-            this.value = '';
-        else if (t == 'checkbox' || t == 'radio')
-            this.checked = false;
-        else if (tag == 'select')
-            this.selectedIndex = -1;
-    });
-};
-
-
-/**
- * Resets the form data.  Causes all form elements to be reset to their original value.
- *
- * @example $('form').resetForm();
- * @desc Resets all forms on the page.
- *
- * @name resetForm
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.resetForm = function() {
-    return this.each(function() {
-        // guard against an input with the name of 'reset'
-        // note that IE reports the reset function as an 'object'
-        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
-            this.reset();
-    });
-};
-
-})(jQuery);
--- a/web/support/hsbook.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-function qid(id) {
-  return id.replace(/([.:])/g, "\\$1");
-}
-
-function beforeComment(formData, jqForm, options) {
-  var form = jqForm[0];
-  if (!form.comment.value) {
-    $(options.target + " span.comment_error").empty().append(
-      "<span class=\"comment_error\">Your comment is empty</span>");
-    return false;
-  }
-  if (!form.name.value) {
-    $(options.target + " span.comment_error").empty().append(
-      "<span class=\"comment_error\">Please provide a name</span>");
-    return false;
-  }
-  $(options.target + " span.comment_error").empty().after(
-    "<img src=\"/support/icons/throbber.gif\" style=\"vertical-align: middle\"/>");
-  $(options.target + " input[@name=submit]").attr("disabled", true);
-}
-
-function ajaxifyForm(id) {
-  var q = qid(id);
-  
-  $("#form_" + q).ajaxForm({ beforeSubmit: beforeComment,
-			     success: function() { ajaxifyForm(id); },
-			     target: "#comments_" + q });
-}
-
-function toggleComment(id) {
-  $("#toggle_" + qid(id)).nextAll().toggle();
-  return false;
-}
-
-function loadComments(id) {
-  $("#comments_" + qid(id)).load(location.protocol + "//" + location.host +
-				 "/review/comments/single/" + id + "/", function() {
-    ajaxifyForm(id);
-  });
-  return false;
-}
-
-function loadAllComments() {
-  $("a.commenttoggle").each(function() {
-    var id = $(this).attr("pid");
-    if (id) {
-      loadComments(id);
-    }
-  });
-}
-
-$(document).ready(function() {
-  function loading(id) {
-    return " <span id=\"comments_" + id + "\" class=\"comment\">" +
-      "<span pid=\"" + id + "\" class=\"commenttoggle\">Loading..." +
-      "</span></span>";
-  }
-  $("div.toc>p")
-    .after("<p style='display: none;'><a onclick='return loadAllComments()'>" +
-	   "Load all comments (<b>slow</b>)</a></p>")
-    .toggle(function() { $(this).nextAll().show("normal"); },
-	    function() { $(this).nextAll().hide("normal"); })
-    .hover(function() { $(this).fadeTo("normal", 0.8); },
-	   function() { $(this).fadeTo("normal", 0.35); });
-  $(".chapter p[@id]").each(function() {
-    $(this).append(loading($(this).attr("id")));
-  });
-  $(".chapter table[@id].equation").each(function() {
-    id = $(this).attr("id");
-    $("#" + id + " tr").after('<tr><td colspan="4">' + loading($(this).attr("id")) + '</td></tr>');
-  });
-  $(".chapter pre[@id]").each(function() {
-    $(this).after(loading($(this).attr("id")));
-  });
-  var chapid = $("div.preface, div.chapter, div.appendix, div.bibliography").attr("id");
-  $("#chapterfeed").attr("href",
-			 $("#chapterfeed").attr("href") + chapid + "/");
-  $.getJSON(location.protocol + "//" + location.host + "/review/comments/chapter/" +
-	    chapid + "/count/", function(data) {
-    $.each(data, function(id, item) {
-      var s = item == 1 ? "" : "s";
-      $("#comments_" + qid(id) + " span.commenttoggle").replaceWith(
-        "<a class='commenttoggle' id='toggle_" + id + "' " +
-	"pid='" + id + "' " +
-	"onclick='return loadComments(\"" + id + "\")' " +
-	"href='comments: show / hide'>" + item + " comment" + s + "</a>");
-    });
-    $("span.commenttoggle").each(function() {
-      var id = $(this).attr("pid");
-      $(this).replaceWith("<a class='commenttoggle' id='toggle_" + id + "' " +
-			  "onclick='return loadComments(\"" + id + "\")' " +
-			  "href='comment: add'>No comments</a>");
-    });
-  });
-});
--- a/web/support/hsbook.js~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-function qid(id) {
-  return id.replace(/([.:])/g, "\\$1");
-}
-
-function beforeComment(formData, jqForm, options) {
-  var form = jqForm[0];
-  if (!form.comment.value) {
-    $(options.target + " span.comment_error").empty().append(
-      "<span class=\"comment_error\">Your comment is empty</span>");
-    return false;
-  }
-  if (!form.name.value) {
-    $(options.target + " span.comment_error").empty().append(
-      "<span class=\"comment_error\">Please provide a name</span>");
-    return false;
-  }
-  $(options.target + " span.comment_error").empty().after(
-    "<img src=\"/support/icons/throbber.gif\" style=\"vertical-align: middle\"/>");
-  $(options.target + " input[@name=submit]").attr("disabled", true);
-}
-
-function ajaxifyForm(id) {
-  var q = qid(id);
-  
-  $("#form_" + q).ajaxForm({ beforeSubmit: beforeComment,
-			     success: function() { ajaxifyForm(id); },
-			     target: "#comments_" + q });
-}
-
-function toggleComment(id) {
-  $("#toggle_" + qid(id)).nextAll().toggle();
-  return false;
-}
-
-function loadComments(id) {
-  $("#comments_" + qid(id)).load(location.protocol + "//" + location.host +
-				 "/comments/single/" + id + "/", function() {
-    ajaxifyForm(id);
-  });
-  return false;
-}
-
-function loadAllComments() {
-  $("a.commenttoggle").each(function() {
-    var id = $(this).attr("pid");
-    if (id) {
-      loadComments(id);
-    }
-  });
-}
-
-$(document).ready(function() {
-  function loading(id) {
-    return " <span id=\"comments_" + id + "\" class=\"comment\">" +
-      "<span pid=\"" + id + "\" class=\"commenttoggle\">Loading..." +
-      "</span></span>";
-  }
-  $("div.toc>p")
-    .after("<p style='display: none;'><a onclick='return loadAllComments()'>" +
-	   "Load all comments (<b>slow</b>)</a></p>")
-    .toggle(function() { $(this).nextAll().show("normal"); },
-	    function() { $(this).nextAll().hide("normal"); })
-    .hover(function() { $(this).fadeTo("normal", 0.8); },
-	   function() { $(this).fadeTo("normal", 0.35); });
-  $(".chapter p[@id]").each(function() {
-    $(this).append(loading($(this).attr("id")));
-  });
-  $(".chapter table[@id].equation").each(function() {
-    id = $(this).attr("id");
-    $("#" + id + " tr").after('<tr><td colspan="4">' + loading($(this).attr("id")) + '</td></tr>');
-  });
-  $(".chapter pre[@id]").each(function() {
-    $(this).after(loading($(this).attr("id")));
-  });
-  var chapid = $("div.preface, div.chapter, div.appendix, div.bibliography").attr("id");
-  $("#chapterfeed").attr("href",
-			 $("#chapterfeed").attr("href") + chapid + "/");
-  $.getJSON(location.protocol + "//" + location.host + "/comments/chapter/" +
-	    chapid + "/count/", function(data) {
-    $.each(data, function(id, item) {
-      var s = item == 1 ? "" : "s";
-      $("#comments_" + qid(id) + " span.commenttoggle").replaceWith(
-        "<a class='commenttoggle' id='toggle_" + id + "' " +
-	"pid='" + id + "' " +
-	"onclick='return loadComments(\"" + id + "\")' " +
-	"href='comments: show / hide'>" + item + " comment" + s + "</a>");
-    });
-    $("span.commenttoggle").each(function() {
-      var id = $(this).attr("pid");
-      $(this).replaceWith("<a class='commenttoggle' id='toggle_" + id + "' " +
-			  "onclick='return loadComments(\"" + id + "\")' " +
-			  "href='comment: add'>No comments</a>");
-    });
-  });
-});
Binary file web/support/icons/caution.png has changed
Binary file web/support/icons/favicon.png has changed
Binary file web/support/icons/important.png has changed
Binary file web/support/icons/note.png has changed
Binary file web/support/icons/remark.png has changed
Binary file web/support/icons/rss.png has changed
Binary file web/support/icons/shell.png has changed
Binary file web/support/icons/source.png has changed
Binary file web/support/icons/throbber.gif has changed
Binary file web/support/icons/tip.png has changed
Binary file web/support/icons/warning.png has changed
--- a/web/support/javascript/form-min.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-(function($){$.fn.ajaxSubmit=function(_2){if(typeof _2=="function"){_2={success:_2};}_2=$.extend({url:this.attr("action")||window.location,type:this.attr("method")||"GET"},_2||{});var _3={};$.event.trigger("form.pre.serialize",[this,_2,_3]);if(_3.veto){return this;}var a=this.formToArray(_2.semantic);if(_2.data){for(var n in _2.data){a.push({name:n,value:_2.data[n]});}}if(_2.beforeSubmit&&_2.beforeSubmit(a,this,_2)===false){return this;}$.event.trigger("form.submit.validate",[a,this,_2,_3]);if(_3.veto){return this;}var q=$.param(a);if(_2.type.toUpperCase()=="GET"){_2.url+=(_2.url.indexOf("?")>=0?"&":"?")+q;_2.data=null;}else{_2.data=q;}var _7=this,callbacks=[];if(_2.resetForm){callbacks.push(function(){_7.resetForm();});}if(_2.clearForm){callbacks.push(function(){_7.clearForm();});}if(!_2.dataType&&_2.target){var _8=_2.success||function(){};callbacks.push(function(_9){if(this.evalScripts){$(_2.target).attr("innerHTML",_9).evalScripts().each(_8,arguments);}else{$(_2.target).html(_9).each(_8,arguments);}});}else{if(_2.success){callbacks.push(_2.success);}}_2.success=function(_a,_b){for(var i=0,max=callbacks.length;i<max;i++){callbacks[i](_a,_b,_7);}};var _d=$("input:file",this).fieldValue();var _e=false;for(var j=0;j<_d.length;j++){if(_d[j]){_e=true;}}if(_2.iframe||_e){fileUpload();}else{$.ajax(_2);}$.event.trigger("form.submit.notify",[this,_2]);return this;function fileUpload(){var _10=_7[0];var _11=$.extend({},$.ajaxSettings,_2);var id="jqFormIO"+$.fn.ajaxSubmit.counter++;var $io=$("<iframe id=\""+id+"\" name=\""+id+"\" />");var io=$io[0];var op8=$.browser.opera&&window.opera.version()<9;if($.browser.msie||op8){io.src="javascript:false;document.write(\"\");";}$io.css({position:"absolute",top:"-1000px",left:"-1000px"});var xhr={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=_11.global;if(g&&!$.active++){$.event.trigger("ajaxStart");}if(g){$.event.trigger("ajaxSend",[xhr,_11]);}var _18=0;var _19=0;setTimeout(function(){$io.appendTo("body");io.attachEvent?io.attachEvent("onload",cb):io.addEventListener("load",cb,false);var _1a=_10.encoding?"encoding":"enctype";var t=_7.attr("target");_7.attr({target:id,method:"POST",action:_11.url});_10[_1a]="multipart/form-data";if(_11.timeout){setTimeout(function(){_19=true;cb();},_11.timeout);}_10.submit();_7.attr("target",t);},10);function cb(){if(_18++){return;}io.detachEvent?io.detachEvent("onload",cb):io.removeEventListener("load",cb,false);var ok=true;try{if(_19){throw "timeout";}var _1d,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(_11.dataType=="json"||_11.dataType=="script"){var ta=doc.getElementsByTagName("textarea")[0];_1d=ta?ta.value:xhr.responseText;if(_11.dataType=="json"){eval("data = "+_1d);}else{$.globalEval(_1d);}}else{if(_11.dataType=="xml"){_1d=xhr.responseXML;if(!_1d&&xhr.responseText!=null){_1d=toXml(xhr.responseText);}}else{_1d=xhr.responseText;}}}catch(e){ok=false;$.handleError(_11,xhr,"error",e);}if(ok){_11.success(_1d,"success");if(g){$.event.trigger("ajaxSuccess",[xhr,_11]);}}if(g){$.event.trigger("ajaxComplete",[xhr,_11]);}if(g&&!--$.active){$.event.trigger("ajaxStop");}if(_11.complete){_11.complete(xhr,ok?"success":"error");}setTimeout(function(){$io.remove();xhr.responseXML=null;},100);}function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s);}else{doc=(new DOMParser()).parseFromString(s,"text/xml");}return (doc&&doc.documentElement&&doc.documentElement.tagName!="parsererror")?doc:null;}}};$.fn.ajaxSubmit.counter=0;$.fn.ajaxForm=function(_21){return this.ajaxFormUnbind().submit(submitHandler).each(function(){this.formPluginId=$.fn.ajaxForm.counter++;$.fn.ajaxForm.optionHash[this.formPluginId]=_21;$(":submit,input:image",this).click(clickHandler);});};$.fn.ajaxForm.counter=1;$.fn.ajaxForm.optionHash={};function clickHandler(e){var _23=this.form;_23.clk=this;if(this.type=="image"){if(e.offsetX!=undefined){_23.clk_x=e.offsetX;_23.clk_y=e.offsetY;}else{if(typeof $.fn.offset=="function"){var _24=$(this).offset();_23.clk_x=e.pageX-_24.left;_23.clk_y=e.pageY-_24.top;}else{_23.clk_x=e.pageX-this.offsetLeft;_23.clk_y=e.pageY-this.offsetTop;}}}setTimeout(function(){_23.clk=_23.clk_x=_23.clk_y=null;},10);}function submitHandler(){var id=this.formPluginId;var _26=$.fn.ajaxForm.optionHash[id];$(this).ajaxSubmit(_26);return false;}$.fn.ajaxFormUnbind=function(){this.unbind("submit",submitHandler);return this.each(function(){$(":submit,input:image",this).unbind("click",clickHandler);});};$.fn.formToArray=function(_27){var a=[];if(this.length==0){return a;}var _29=this[0];var els=_27?_29.getElementsByTagName("*"):_29.elements;if(!els){return a;}for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n){continue;}if(_27&&_29.clk&&el.type=="image"){if(!el.disabled&&_29.clk==el){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}continue;}var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:n,value:v});}}}if(!_27&&_29.clk){var _30=_29.getElementsByTagName("input");for(var i=0,max=_30.length;i<max;i++){var _32=_30[i];var n=_32.name;if(n&&!_32.disabled&&_32.type=="image"&&_29.clk==_32){a.push({name:n+".x",value:_29.clk_x},{name:n+".y",value:_29.clk_y});}}}return a;};$.fn.formSerialize=function(_34){return $.param(this.formToArray(_34));};$.fn.fieldSerialize=function(_35){var a=[];this.each(function(){var n=this.name;if(!n){return;}var v=$.fieldValue(this,_35);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:this.name,value:v});}}});return $.param(a);};$.fn.fieldValue=function(_3a){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,_3a);if(v===null||typeof v=="undefined"||(v.constructor==Array&&!v.length)){continue;}v.constructor==Array?$.merge(val,v):val.push(v);}return val;};$.fieldValue=function(el,_3f){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof _3f=="undefined"){_3f=true;}if(_3f&&(!n||el.disabled||t=="reset"||t=="button"||(t=="checkbox"||t=="radio")&&!el.checked||(t=="submit"||t=="image")&&el.form&&el.form.clk!=el||tag=="select"&&el.selectedIndex==-1)){return null;}if(tag=="select"){var _41=el.selectedIndex;if(_41<0){return null;}var a=[],ops=el.options;var one=(t=="select-one");var max=(one?_41+1:ops.length);for(var i=(one?_41:0);i<max;i++){var op=ops[i];if(op.selected){var v=$.browser.msie&&!(op.attributes["value"].specified)?op.text:op.value;if(one){return v;}a.push(v);}}return a;}return el.value;};$.fn.clearForm=function(){return this.each(function(){$("input,select,textarea",this).clearFields();});};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=="text"||t=="password"||tag=="textarea"){this.value="";}else{if(t=="checkbox"||t=="radio"){this.checked=false;}else{if(tag=="select"){this.selectedIndex=-1;}}}});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset();}});};})(jQuery);
\ No newline at end of file
--- a/web/support/javascript/form.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,819 +0,0 @@
-/*
- * jQuery Form Plugin
- * @requires jQuery v1.1 or later
- *
- * Examples at: http://malsup.com/jquery/form/
- * Dual licensed under the MIT and GPL licenses:
- *   http://www.opensource.org/licenses/mit-license.php
- *   http://www.gnu.org/licenses/gpl.html
- *
- * Revision: $Id$
- */
- (function($) {
-/**
- * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.
- *
- * ajaxSubmit accepts a single argument which can be either a success callback function
- * or an options Object.  If a function is provided it will be invoked upon successful
- * completion of the submit and will be passed the response from the server.
- * If an options Object is provided, the following attributes are supported:
- *
- *  target:   Identifies the element(s) in the page to be updated with the server response.
- *            This value may be specified as a jQuery selection string, a jQuery object,
- *            or a DOM element.
- *            default value: null
- *
- *  url:      URL to which the form data will be submitted.
- *            default value: value of form's 'action' attribute
- *
- *  type:     The method in which the form data should be submitted, 'GET' or 'POST'.
- *            default value: value of form's 'method' attribute (or 'GET' if none found)
- *
- *  data:     Additional data to add to the request, specified as key/value pairs (see $.ajax).
- *
- *  beforeSubmit:  Callback method to be invoked before the form is submitted.
- *            default value: null
- *
- *  success:  Callback method to be invoked after the form has been successfully submitted
- *            and the response has been returned from the server
- *            default value: null
- *
- *  dataType: Expected dataType of the response.  One of: null, 'xml', 'script', or 'json'
- *            default value: null
- *
- *  semantic: Boolean flag indicating whether data must be submitted in semantic order (slower).
- *            default value: false
- *
- *  resetForm: Boolean flag indicating whether the form should be reset if the submit is successful
- *
- *  clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful
- *
- *
- * The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for
- * validating the form data.  If the 'beforeSubmit' callback returns false then the form will
- * not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data
- * in array format, the jQuery object, and the options object passed into ajaxSubmit.
- * The form data array takes the following form:
- *
- *     [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * If a 'success' callback method is provided it is invoked after the response has been returned
- * from the server.  It is passed the responseText or responseXML value (depending on dataType).
- * See jQuery.ajax for further details.
- *
- *
- * The dataType option provides a means for specifying how the server response should be handled.
- * This maps directly to the jQuery.httpData method.  The following values are supported:
- *
- *      'xml':    if dataType == 'xml' the server response is treated as XML and the 'success'
- *                   callback method, if specified, will be passed the responseXML value
- *      'json':   if dataType == 'json' the server response will be evaluted and passed to
- *                   the 'success' callback, if specified
- *      'script': if dataType == 'script' the server response is evaluated in the global context
- *
- *
- * Note that it does not make sense to use both the 'target' and 'dataType' options.  If both
- * are provided the target will be ignored.
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * This is normally true anyway, unless the form contains input elements of type='image'.
- * If your form must be submitted with name/value pairs in semantic order and your form
- * contains an input of type='image" then pass true for this arg, otherwise pass false
- * (or nothing) to avoid the overhead for this logic.
- *
- *
- * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this:
- *
- * $("#form-id").submit(function() {
- *     $(this).ajaxSubmit(options);
- *     return false; // cancel conventional submit
- * });
- *
- * When using ajaxForm(), however, this is done for you.
- *
- * @example
- * $('#myForm').ajaxSubmit(function(data) {
- *     alert('Form submit succeeded! Server returned: ' + data);
- * });
- * @desc Submit form and alert server response
- *
- *
- * @example
- * var options = {
- *     target: '#myTargetDiv'
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Submit form and update page element with server response
- *
- *
- * @example
- * var options = {
- *     success: function(responseText) {
- *         alert(responseText);
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Submit form and alert the server response
- *
- *
- * @example
- * var options = {
- *     beforeSubmit: function(formArray, jqForm) {
- *         if (formArray.length == 0) {
- *             alert('Please enter data.');
- *             return false;
- *         }
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Pre-submit validation which aborts the submit operation if form data is empty
- *
- *
- * @example
- * var options = {
- *     url: myJsonUrl.php,
- *     dataType: 'json',
- *     success: function(data) {
- *        // 'data' is an object representing the the evaluated json data
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc json data returned and evaluated
- *
- *
- * @example
- * var options = {
- *     url: myXmlUrl.php,
- *     dataType: 'xml',
- *     success: function(responseXML) {
- *        // responseXML is XML document object
- *        var data = $('myElement', responseXML).text();
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc XML data returned from server
- *
- *
- * @example
- * var options = {
- *     resetForm: true
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc submit form and reset it if successful
- *
- * @example
- * $('#myForm).submit(function() {
- *    $(this).ajaxSubmit();
- *    return false;
- * });
- * @desc Bind form's submit event to use ajaxSubmit
- *
- *
- * @name ajaxSubmit
- * @type jQuery
- * @param options  object literal containing options which control the form submission process
- * @cat Plugins/Form
- * @return jQuery
- */
-$.fn.ajaxSubmit = function(options) {
-    if (typeof options == 'function')
-        options = { success: options };
-
-    options = $.extend({
-        url:  this.attr('action') || window.location,
-        type: this.attr('method') || 'GET'
-    }, options || {});
-
-    // hook for manipulating the form data before it is extracted;
-    // convenient for use with rich editors like tinyMCE or FCKEditor
-    var veto = {};
-    $.event.trigger('form.pre.serialize', [this, options, veto]);
-    if (veto.veto) return this;
-
-    var a = this.formToArray(options.semantic);
-	if (options.data) {
-	    for (var n in options.data)
-	        a.push( { name: n, value: options.data[n] } );
-	}
-
-    // give pre-submit callback an opportunity to abort the submit
-    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this;
-
-    // fire vetoable 'validate' event
-    $.event.trigger('form.submit.validate', [a, this, options, veto]);
-    if (veto.veto) return this;
-
-    var q = $.param(a);//.replace(/%20/g,'+');
-
-    if (options.type.toUpperCase() == 'GET') {
-        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
-        options.data = null;  // data is null for 'get'
-    }
-    else
-        options.data = q; // data is the query string for 'post'
-
-    var $form = this, callbacks = [];
-    if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
-    if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
-
-    // perform a load on the target only if dataType is not provided
-    if (!options.dataType && options.target) {
-        var oldSuccess = options.success || function(){};
-        callbacks.push(function(data) {
-            if (this.evalScripts)
-                $(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments);
-            else // jQuery v1.1.4
-                $(options.target).html(data).each(oldSuccess, arguments);
-        });
-    }
-    else if (options.success)
-        callbacks.push(options.success);
-
-    options.success = function(data, status) {
-        for (var i=0, max=callbacks.length; i < max; i++)
-            callbacks[i](data, status, $form);
-    };
-
-    // are there files to upload?
-    var files = $('input:file', this).fieldValue();
-    var found = false;
-    for (var j=0; j < files.length; j++)
-        if (files[j])
-            found = true;
-
-    if (options.iframe || found) // options.iframe allows user to force iframe mode
-        fileUpload();
-    else
-        $.ajax(options);
-
-    // fire 'notify' event
-    $.event.trigger('form.submit.notify', [this, options]);
-    return this;
-
-
-    // private function for handling file uploads (hat tip to YAHOO!)
-    function fileUpload() {
-        var form = $form[0];
-        var opts = $.extend({}, $.ajaxSettings, options);
-
-        var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++;
-        var $io = $('<iframe id="' + id + '" name="' + id + '" />');
-        var io = $io[0];
-        var op8 = $.browser.opera && window.opera.version() < 9;
-        if ($.browser.msie || op8) io.src = 'javascript:false;document.write("");';
-        $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
-
-        var xhr = { // mock object
-            responseText: null,
-            responseXML: null,
-            status: 0,
-            statusText: 'n/a',
-            getAllResponseHeaders: function() {},
-            getResponseHeader: function() {},
-            setRequestHeader: function() {}
-        };
-
-        var g = opts.global;
-        // trigger ajax global events so that activity/block indicators work like normal
-        if (g && ! $.active++) $.event.trigger("ajaxStart");
-        if (g) $.event.trigger("ajaxSend", [xhr, opts]);
-
-        var cbInvoked = 0;
-        var timedOut = 0;
-
-        // take a breath so that pending repaints get some cpu time before the upload starts
-        setTimeout(function() {
-            $io.appendTo('body');
-            // jQuery's event binding doesn't work for iframe events in IE
-            io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
-
-            // make sure form attrs are set
-            var encAttr = form.encoding ? 'encoding' : 'enctype';
-            var t = $form.attr('target');
-            $form.attr({
-                target:   id,
-                method:  'POST',
-                action:   opts.url
-            });
-            form[encAttr] = 'multipart/form-data';
-
-            // support timout
-            if (opts.timeout)
-                setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
-
-            form.submit();
-            $form.attr('target', t); // reset target
-        }, 10);
-
-        function cb() {
-            if (cbInvoked++) return;
-
-            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
-
-            var ok = true;
-            try {
-                if (timedOut) throw 'timeout';
-                // extract the server response from the iframe
-                var data, doc;
-                doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
-                xhr.responseText = doc.body ? doc.body.innerHTML : null;
-                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
-
-                if (opts.dataType == 'json' || opts.dataType == 'script') {
-                    var ta = doc.getElementsByTagName('textarea')[0];
-                    data = ta ? ta.value : xhr.responseText;
-                    if (opts.dataType == 'json')
-                        eval("data = " + data);
-                    else
-                        $.globalEval(data);
-                }
-                else if (opts.dataType == 'xml') {
-                    data = xhr.responseXML;
-                    if (!data && xhr.responseText != null)
-                        data = toXml(xhr.responseText);
-                }
-                else {
-                    data = xhr.responseText;
-                }
-            }
-            catch(e){
-                ok = false;
-                $.handleError(opts, xhr, 'error', e);
-            }
-
-            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
-            if (ok) {
-                opts.success(data, 'success');
-                if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
-            }
-            if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
-            if (g && ! --$.active) $.event.trigger("ajaxStop");
-            if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
-
-            // clean up
-            setTimeout(function() {
-                $io.remove();
-                xhr.responseXML = null;
-            }, 100);
-        };
-
-        function toXml(s, doc) {
-            if (window.ActiveXObject) {
-                doc = new ActiveXObject('Microsoft.XMLDOM');
-                doc.async = 'false';
-                doc.loadXML(s);
-            }
-            else
-                doc = (new DOMParser()).parseFromString(s, 'text/xml');
-            return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
-        };
-    };
-};
-$.fn.ajaxSubmit.counter = 0; // used to create unique iframe ids
-
-/**
- * ajaxForm() provides a mechanism for fully automating form submission.
- *
- * The advantages of using this method instead of ajaxSubmit() are:
- *
- * 1: This method will include coordinates for <input type="image" /> elements (if the element
- *    is used to submit the form).
- * 2. This method will include the submit element's name/value data (for the element that was
- *    used to submit the form).
- * 3. This method binds the submit() method to the form for you.
- *
- * Note that for accurate x/y coordinates of image submit elements in all browsers
- * you need to also use the "dimensions" plugin (this method will auto-detect its presence).
- *
- * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
- * passes the options argument along after properly binding events for submit elements and
- * the form itself.  See ajaxSubmit for a full description of the options argument.
- *
- *
- * @example
- * var options = {
- *     target: '#myTargetDiv'
- * };
- * $('#myForm').ajaxSForm(options);
- * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response
- *       when the form is submitted.
- *
- *
- * @example
- * var options = {
- *     success: function(responseText) {
- *         alert(responseText);
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Bind form's submit event so that server response is alerted after the form is submitted.
- *
- *
- * @example
- * var options = {
- *     beforeSubmit: function(formArray, jqForm) {
- *         if (formArray.length == 0) {
- *             alert('Please enter data.');
- *             return false;
- *         }
- *     }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Bind form's submit event so that pre-submit callback is invoked before the form
- *       is submitted.
- *
- *
- * @name   ajaxForm
- * @param  options  object literal containing options which control the form submission process
- * @return jQuery
- * @cat    Plugins/Form
- * @type   jQuery
- */
-$.fn.ajaxForm = function(options) {
-    return this.ajaxFormUnbind().submit(submitHandler).each(function() {
-        // store options in hash
-        this.formPluginId = $.fn.ajaxForm.counter++;
-        $.fn.ajaxForm.optionHash[this.formPluginId] = options;
-        $(":submit,input:image", this).click(clickHandler);
-    });
-};
-
-$.fn.ajaxForm.counter = 1;
-$.fn.ajaxForm.optionHash = {};
-
-function clickHandler(e) {
-    var $form = this.form;
-    $form.clk = this;
-    if (this.type == 'image') {
-        if (e.offsetX != undefined) {
-            $form.clk_x = e.offsetX;
-            $form.clk_y = e.offsetY;
-        } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
-            var offset = $(this).offset();
-            $form.clk_x = e.pageX - offset.left;
-            $form.clk_y = e.pageY - offset.top;
-        } else {
-            $form.clk_x = e.pageX - this.offsetLeft;
-            $form.clk_y = e.pageY - this.offsetTop;
-        }
-    }
-    // clear form vars
-    setTimeout(function() { $form.clk = $form.clk_x = $form.clk_y = null; }, 10);
-};
-
-function submitHandler() {
-    // retrieve options from hash
-    var id = this.formPluginId;
-    var options = $.fn.ajaxForm.optionHash[id];
-    $(this).ajaxSubmit(options);
-    return false;
-};
-
-/**
- * ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
- *
- * @name   ajaxFormUnbind
- * @return jQuery
- * @cat    Plugins/Form
- * @type   jQuery
- */
-$.fn.ajaxFormUnbind = function() {
-    this.unbind('submit', submitHandler);
-    return this.each(function() {
-        $(":submit,input:image", this).unbind('click', clickHandler);
-    });
-
-};
-
-/**
- * formToArray() gathers form element data into an array of objects that can
- * be passed to any of the following ajax functions: $.get, $.post, or load.
- * Each object in the array has both a 'name' and 'value' property.  An example of
- * an array for a simple login form might be:
- *
- * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * It is this array that is passed to pre-submit callback functions provided to the
- * ajaxSubmit() and ajaxForm() methods.
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * This is normally true anyway, unless the form contains input elements of type='image'.
- * If your form must be submitted with name/value pairs in semantic order and your form
- * contains an input of type='image" then pass true for this arg, otherwise pass false
- * (or nothing) to avoid the overhead for this logic.
- *
- * @example var data = $("#myForm").formToArray();
- * $.post( "myscript.cgi", data );
- * @desc Collect all the data from a form and submit it to the server.
- *
- * @name formToArray
- * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
- * @type Array<Object>
- * @cat Plugins/Form
- */
-$.fn.formToArray = function(semantic) {
-    var a = [];
-    if (this.length == 0) return a;
-
-    var form = this[0];
-    var els = semantic ? form.getElementsByTagName('*') : form.elements;
-    if (!els) return a;
-    for(var i=0, max=els.length; i < max; i++) {
-        var el = els[i];
-        var n = el.name;
-        if (!n) continue;
-
-        if (semantic && form.clk && el.type == "image") {
-            // handle image inputs on the fly when semantic == true
-            if(!el.disabled && form.clk == el)
-                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-            continue;
-        }
-
-        var v = $.fieldValue(el, true);
-        if (v && v.constructor == Array) {
-            for(var j=0, jmax=v.length; j < jmax; j++)
-                a.push({name: n, value: v[j]});
-        }
-        else if (v !== null && typeof v != 'undefined')
-            a.push({name: n, value: v});
-    }
-
-    if (!semantic && form.clk) {
-        // input type=='image' are not found in elements array! handle them here
-        var inputs = form.getElementsByTagName("input");
-        for(var i=0, max=inputs.length; i < max; i++) {
-            var input = inputs[i];
-            var n = input.name;
-            if(n && !input.disabled && input.type == "image" && form.clk == input)
-                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-        }
-    }
-    return a;
-};
-
-
-/**
- * Serializes form data into a 'submittable' string. This method will return a string
- * in the format: name1=value1&amp;name2=value2
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * If your form must be submitted with name/value pairs in semantic order then pass
- * true for this arg, otherwise pass false (or nothing) to avoid the overhead for
- * this logic (which can be significant for very large forms).
- *
- * @example var data = $("#myForm").formSerialize();
- * $.ajax('POST', "myscript.cgi", data);
- * @desc Collect all the data from a form into a single string
- *
- * @name formSerialize
- * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
- * @type String
- * @cat Plugins/Form
- */
-$.fn.formSerialize = function(semantic) {
-    //hand off to jQuery.param for proper encoding
-    return $.param(this.formToArray(semantic));
-};
-
-
-/**
- * Serializes all field elements in the jQuery object into a query string.
- * This method will return a string in the format: name1=value1&amp;name2=value2
- *
- * The successful argument controls whether or not serialization is limited to
- * 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.
- *
- * @example var data = $("input").formSerialize();
- * @desc Collect the data from all successful input elements into a query string
- *
- * @example var data = $(":radio").formSerialize();
- * @desc Collect the data from all successful radio input elements into a query string
- *
- * @example var data = $("#myForm :checkbox").formSerialize();
- * @desc Collect the data from all successful checkbox input elements in myForm into a query string
- *
- * @example var data = $("#myForm :checkbox").formSerialize(false);
- * @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string
- *
- * @example var data = $(":input").formSerialize();
- * @desc Collect the data from all successful input, select, textarea and button elements into a query string
- *
- * @name fieldSerialize
- * @param successful true if only successful controls should be serialized (default is true)
- * @type String
- * @cat Plugins/Form
- */
-$.fn.fieldSerialize = function(successful) {
-    var a = [];
-    this.each(function() {
-        var n = this.name;
-        if (!n) return;
-        var v = $.fieldValue(this, successful);
-        if (v && v.constructor == Array) {
-            for (var i=0,max=v.length; i < max; i++)
-                a.push({name: n, value: v[i]});
-        }
-        else if (v !== null && typeof v != 'undefined')
-            a.push({name: this.name, value: v});
-    });
-    //hand off to jQuery.param for proper encoding
-    return $.param(a);
-};
-
-
-/**
- * Returns the value(s) of the element in the matched set.  For example, consider the following form:
- *
- *  <form><fieldset>
- *      <input name="A" type="text" />
- *      <input name="A" type="text" />
- *      <input name="B" type="checkbox" value="B1" />
- *      <input name="B" type="checkbox" value="B2"/>
- *      <input name="C" type="radio" value="C1" />
- *      <input name="C" type="radio" value="C2" />
- *  </fieldset></form>
- *
- *  var v = $(':text').fieldValue();
- *  // if no values are entered into the text inputs
- *  v == ['','']
- *  // if values entered into the text inputs are 'foo' and 'bar'
- *  v == ['foo','bar']
- *
- *  var v = $(':checkbox').fieldValue();
- *  // if neither checkbox is checked
- *  v === undefined
- *  // if both checkboxes are checked
- *  v == ['B1', 'B2']
- *
- *  var v = $(':radio').fieldValue();
- *  // if neither radio is checked
- *  v === undefined
- *  // if first radio is checked
- *  v == ['C1']
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.  If this value is false the value(s)
- * for each element is returned.
- *
- * Note: This method *always* returns an array.  If no valid value can be determined the
- *       array will be empty, otherwise it will contain one or more values.
- *
- * @example var data = $("#myPasswordElement").fieldValue();
- * alert(data[0]);
- * @desc Alerts the current value of the myPasswordElement element
- *
- * @example var data = $("#myForm :input").fieldValue();
- * @desc Get the value(s) of the form elements in myForm
- *
- * @example var data = $("#myForm :checkbox").fieldValue();
- * @desc Get the value(s) for the successful checkbox element(s) in the jQuery object.
- *
- * @example var data = $("#mySingleSelect").fieldValue();
- * @desc Get the value(s) of the select control
- *
- * @example var data = $(':text').fieldValue();
- * @desc Get the value(s) of the text input or textarea elements
- *
- * @example var data = $("#myMultiSelect").fieldValue();
- * @desc Get the values for the select-multiple control
- *
- * @name fieldValue
- * @param Boolean successful true if only the values for successful controls should be returned (default is true)
- * @type Array<String>
- * @cat Plugins/Form
- */
-$.fn.fieldValue = function(successful) {
-    for (var val=[], i=0, max=this.length; i < max; i++) {
-        var el = this[i];
-        var v = $.fieldValue(el, successful);
-        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
-            continue;
-        v.constructor == Array ? $.merge(val, v) : val.push(v);
-    }
-    return val;
-};
-
-/**
- * Returns the value of the field element.
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.  If the given element is not
- * successful and the successful arg is not false then the returned value will be null.
- *
- * Note: If the successful flag is true (default) but the element is not successful, the return will be null
- * Note: The value returned for a successful select-multiple element will always be an array.
- * Note: If the element has no value the return value will be undefined.
- *
- * @example var data = jQuery.fieldValue($("#myPasswordElement")[0]);
- * @desc Gets the current value of the myPasswordElement element
- *
- * @name fieldValue
- * @param Element el The DOM element for which the value will be returned
- * @param Boolean successful true if value returned must be for a successful controls (default is true)
- * @type String or Array<String> or null or undefined
- * @cat Plugins/Form
- */
-$.fieldValue = function(el, successful) {
-    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
-    if (typeof successful == 'undefined') successful = true;
-
-    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
-        (t == 'checkbox' || t == 'radio') && !el.checked ||
-        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
-        tag == 'select' && el.selectedIndex == -1))
-            return null;
-
-    if (tag == 'select') {
-        var index = el.selectedIndex;
-        if (index < 0) return null;
-        var a = [], ops = el.options;
-        var one = (t == 'select-one');
-        var max = (one ? index+1 : ops.length);
-        for(var i=(one ? index : 0); i < max; i++) {
-            var op = ops[i];
-            if (op.selected) {
-                // extra pain for IE...
-                var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
-                if (one) return v;
-                a.push(v);
-            }
-        }
-        return a;
-    }
-    return el.value;
-};
-
-
-/**
- * Clears the form data.  Takes the following actions on the form's input fields:
- *  - input text fields will have their 'value' property set to the empty string
- *  - select elements will have their 'selectedIndex' property set to -1
- *  - checkbox and radio inputs will have their 'checked' property set to false
- *  - inputs of type submit, button, reset, and hidden will *not* be effected
- *  - button elements will *not* be effected
- *
- * @example $('form').clearForm();
- * @desc Clears all forms on the page.
- *
- * @name clearForm
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.clearForm = function() {
-    return this.each(function() {
-        $('input,select,textarea', this).clearFields();
-    });
-};
-
-/**
- * Clears the selected form elements.  Takes the following actions on the matched elements:
- *  - input text fields will have their 'value' property set to the empty string
- *  - select elements will have their 'selectedIndex' property set to -1
- *  - checkbox and radio inputs will have their 'checked' property set to false
- *  - inputs of type submit, button, reset, and hidden will *not* be effected
- *  - button elements will *not* be effected
- *
- * @example $('.myInputs').clearFields();
- * @desc Clears all inputs with class myInputs
- *
- * @name clearFields
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.clearFields = $.fn.clearInputs = function() {
-    return this.each(function() {
-        var t = this.type, tag = this.tagName.toLowerCase();
-        if (t == 'text' || t == 'password' || tag == 'textarea')
-            this.value = '';
-        else if (t == 'checkbox' || t == 'radio')
-            this.checked = false;
-        else if (tag == 'select')
-            this.selectedIndex = -1;
-    });
-};
-
-
-/**
- * Resets the form data.  Causes all form elements to be reset to their original value.
- *
- * @example $('form').resetForm();
- * @desc Resets all forms on the page.
- *
- * @name resetForm
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.resetForm = function() {
-    return this.each(function() {
-        // guard against an input with the name of 'reset'
-        // note that IE reports the reset function as an 'object'
-        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
-            this.reset();
-    });
-};
-
-})(jQuery);
--- a/web/support/javascript/hsbook.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-function qid(id) {
-  return id.replace(/([.:])/g, "\\$1");
-}
-
-function beforeComment(formData, jqForm, options) {
-  var form = jqForm[0];
-  if (!form.comment.value) {
-    $(options.target + " span.comment_error").empty().append(
-      "<span class=\"comment_error\">Your comment is empty</span>");
-    return false;
-  }
-  if (!form.name.value) {
-    $(options.target + " span.comment_error").empty().append(
-      "<span class=\"comment_error\">Please provide a name</span>");
-    return false;
-  }
-  $(options.target + " span.comment_error").empty().after(
-    "<img src=\"/support/icons/throbber.gif\" style=\"vertical-align: middle\"/>");
-  $(options.target + " input[@name=submit]").attr("disabled", true);
-}
-
-function ajaxifyForm(id) {
-  var q = qid(id);
-  
-  $("#form_" + q).ajaxForm({ beforeSubmit: beforeComment,
-			     success: function() { ajaxifyForm(id); },
-			     target: "#comments_" + q });
-}
-
-function toggleComment(id) {
-  $("#toggle_" + qid(id)).nextAll().toggle();
-  return false;
-}
-
-function loadComments(id) {
-  $("#comments_" + qid(id)).load(location.protocol + "//" + location.host +
-				 "/comments/single/" + id + "/", function() {
-    ajaxifyForm(id);
-  });
-  return false;
-}
-
-function loadAllComments() {
-  $("a.commenttoggle").each(function() {
-    var id = $(this).attr("pid");
-    if (id) {
-      loadComments(id);
-    }
-  });
-}
-
-$(document).ready(function() {
-  function loading(id) {
-    return " <span id=\"comments_" + id + "\" class=\"comment\">" +
-      "<span pid=\"" + id + "\" class=\"commenttoggle\">Loading..." +
-      "</span></span>";
-  }
-  $("div.toc>p")
-    .after("<p style='display: none;'><a onclick='return loadAllComments()'>" +
-	   "Load all comments (<b>slow</b>)</a></p>")
-    .toggle(function() { $(this).nextAll().show("normal"); },
-	    function() { $(this).nextAll().hide("normal"); })
-    .hover(function() { $(this).fadeTo("normal", 0.8); },
-	   function() { $(this).fadeTo("normal", 0.35); });
-  $(".chapter p[@id]").each(function() {
-    $(this).append(loading($(this).attr("id")));
-  });
-  $(".chapter table[@id].equation").each(function() {
-    id = $(this).attr("id");
-    $("#" + id + " tr").after('<tr><td colspan="4">' + loading($(this).attr("id")) + '</td></tr>');
-  });
-  $(".chapter pre[@id]").each(function() {
-    $(this).after(loading($(this).attr("id")));
-  });
-  var chapid = $("div.preface, div.chapter, div.appendix, div.bibliography").attr("id");
-  $("#chapterfeed").attr("href",
-			 $("#chapterfeed").attr("href") + chapid + "/");
-  $.getJSON(location.protocol + "//" + location.host + "/comments/chapter/" +
-	    chapid + "/count/", function(data) {
-    $.each(data, function(id, item) {
-      var s = item == 1 ? "" : "s";
-      $("#comments_" + qid(id) + " span.commenttoggle").replaceWith(
-        "<a class='commenttoggle' id='toggle_" + id + "' " +
-	"pid='" + id + "' " +
-	"onclick='return loadComments(\"" + id + "\")' " +
-	"href='comments: show / hide'>" + item + " comment" + s + "</a>");
-    });
-    $("span.commenttoggle").each(function() {
-      var id = $(this).attr("pid");
-      $(this).replaceWith("<a class='commenttoggle' id='toggle_" + id + "' " +
-			  "onclick='return loadComments(\"" + id + "\")' " +
-			  "href='comment: add'>No comments</a>");
-    });
-  });
-});
--- a/web/support/javascript/jquery-min.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
- * jQuery 1.2.1 - New Wave Javascript
- *
- * Copyright (c) 2007 John Resig (jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
- * $Rev: 3353 $
- */
-(function(){if(typeof jQuery!="undefined")var _jQuery=jQuery;var jQuery=window.jQuery=function(selector,context){return this instanceof jQuery?this.init(selector,context):new jQuery(selector,context);};if(typeof $!="undefined")var _$=$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(typeof selector=="string"){var m=quickExpr.exec(selector);if(m&&(m[1]||!context)){if(m[1])selector=jQuery.clean([m[1]],context);else{var tmp=document.getElementById(m[3]);if(tmp)if(tmp.id!=m[3])return jQuery().find(selector);else{this[0]=tmp;this.length=1;return this;}else
-selector=[];}}else
-return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.1",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(a){var ret=jQuery(a);ret.prevObject=this;return ret;},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this;},each:function(fn,args){return jQuery.each(this,fn,args);},index:function(obj){var pos=-1;this.each(function(i){if(this==obj)pos=i;});return pos;},attr:function(key,value,type){var obj=key;if(key.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],key)||undefined;else{obj={};obj[key]=value;}return this.each(function(index){for(var prop in obj)jQuery.attr(type?this.style:this,prop,jQuery.prop(this,obj[prop],type,index,prop));});},css:function(key,value){return this.attr(key,value,"curCSS");},text:function(e){if(typeof e!="object"&&e!=null)return this.empty().append(document.createTextNode(e));var t="";jQuery.each(e||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)t+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return t;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,1,function(a){this.appendChild(a);});},prepend:function(){return this.domManip(arguments,true,-1,function(a){this.insertBefore(a,this.firstChild);});},before:function(){return this.domManip(arguments,false,1,function(a){this.parentNode.insertBefore(a,this);});},after:function(){return this.domManip(arguments,false,-1,function(a){this.parentNode.insertBefore(a,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(t){var data=jQuery.map(this,function(a){return jQuery.find(t,a);});return this.pushStack(/[^+>] [^+>]/.test(t)||t.indexOf("..")>-1?jQuery.unique(data):data);},clone:function(events){var ret=this.map(function(){return this.outerHTML?jQuery(this.outerHTML)[0]:this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(t){return this.pushStack(jQuery.isFunction(t)&&jQuery.grep(this,function(el,index){return t.apply(el,[index]);})||jQuery.multiFilter(t,this));},not:function(t){return this.pushStack(t.constructor==String&&jQuery.multiFilter(t,this,true)||jQuery.grep(this,function(a){return(t.constructor==Array||t.jquery)?jQuery.inArray(a,t)<0:a!=t;}));},add:function(t){return this.pushStack(jQuery.merge(this.get(),t.constructor==String?jQuery(t).get():t.length!=undefined&&(!t.nodeName||jQuery.nodeName(t,"form"))?t:[t]));},is:function(expr){return expr?jQuery.multiFilter(expr,this).length>0:false;},hasClass:function(expr){return this.is("."+expr);},val:function(val){if(val==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,a=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){var val=jQuery.browser.msie&&!option.attributes["value"].specified?option.text:option.value;if(one)return val;a.push(val);}}return a;}else
-return this[0].value.replace(/\r/g,"");}}else
-return this.each(function(){if(val.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,val)>=0||jQuery.inArray(this.name,val)>=0);else if(jQuery.nodeName(this,"select")){var tmp=val.constructor==Array?val:[val];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,tmp)>=0||jQuery.inArray(this.text,tmp)>=0);});if(!tmp.length)this.selectedIndex=-1;}else
-this.value=val;});},html:function(val){return val==undefined?(this.length?this[0].innerHTML:null):this.empty().append(val);},replaceWith:function(val){return this.after(val).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(fn){return this.pushStack(jQuery.map(this,function(elem,i){return fn.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},domManip:function(args,table,dir,fn){var clone=this.length>1,a;return this.each(function(){if(!a){a=jQuery.clean(args,this.ownerDocument);if(dir<0)a.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(a[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(document.createElement("tbody"));jQuery.each(a,function(){var elem=clone?this.cloneNode(true):this;if(!evalScript(0,elem))fn.call(obj,elem);});});}};function evalScript(i,elem){var script=jQuery.nodeName(elem,"script");if(script){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
-jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}else if(elem.nodeType==1)jQuery("script",elem).each(evalScript);return script;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},a=1,al=arguments.length,deep=false;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};}if(al==1){target=this;a=0;}var prop;for(;a<al;a++)if((prop=arguments[a])!=null)for(var i in prop){if(target==prop[i])continue;if(deep&&typeof prop[i]=='object'&&target[i])jQuery.extend(target[i],prop[i]);else if(prop[i]!=undefined)target[i]=prop[i];}return target;};var expando="jQuery"+(new Date()).getTime(),uuid=0,win={};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/function/i.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){if(window.execScript)window.execScript(data);else if(jQuery.browser.safari)window.setTimeout(data,0);else
-eval.call(window,data);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?win:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!=undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?win:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(obj,fn,args){if(args){if(obj.length==undefined)for(var i in obj)fn.apply(obj[i],args);else
-for(var i=0,ol=obj.length;i<ol;i++)if(fn.apply(obj[i],args)===false)break;}else{if(obj.length==undefined)for(var i in obj)fn.call(obj[i],i,obj[i]);else
-for(var i=0,ol=obj.length,val=obj[0];i<ol&&fn.call(val,i,val)!==false;val=obj[++i]){}}return obj;},prop:function(elem,value,type,index,prop){if(jQuery.isFunction(value))value=value.call(elem,[index]);var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i;return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(prop)?value+"px":value;},className:{add:function(elem,c){jQuery.each((c||"").split(/\s+/),function(i,cur){if(!jQuery.className.has(elem.className,cur))elem.className+=(elem.className?" ":"")+cur;});},remove:function(elem,c){elem.className=c!=undefined?jQuery.grep(elem.className.split(/\s+/),function(cur){return!jQuery.className.has(c,cur);}).join(" "):"";},has:function(t,c){return jQuery.inArray(c,(t.className||t).toString().split(/\s+/))>-1;}},swap:function(e,o,f){for(var i in o){e.style["old"+i]=e.style[i];e.style[i]=o[i];}f.apply(e,[]);for(var i in o)e.style[i]=e.style["old"+i];},css:function(e,p){if(p=="height"||p=="width"){var old={},oHeight,oWidth,d=["Top","Bottom","Right","Left"];jQuery.each(d,function(){old["padding"+this]=0;old["border"+this+"Width"]=0;});jQuery.swap(e,old,function(){if(jQuery(e).is(':visible')){oHeight=e.offsetHeight;oWidth=e.offsetWidth;}else{e=jQuery(e.cloneNode(true)).find(":radio").removeAttr("checked").end().css({visibility:"hidden",position:"absolute",display:"block",right:"0",left:"0"}).appendTo(e.parentNode)[0];var parPos=jQuery.css(e.parentNode,"position")||"static";if(parPos=="static")e.parentNode.style.position="relative";oHeight=e.clientHeight;oWidth=e.clientWidth;if(parPos=="static")e.parentNode.style.position="static";e.parentNode.removeChild(e);}});return p=="height"?oHeight:oWidth;}return jQuery.curCSS(e,p);},curCSS:function(elem,prop,force){var ret,stack=[],swap=[];function color(a){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(a,null);return!ret||ret.getPropertyValue("color")=="";}if(prop=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(prop.match(/float/i))prop=styleFloat;if(!force&&elem.style[prop])ret=elem.style[prop];else if(document.defaultView&&document.defaultView.getComputedStyle){if(prop.match(/float/i))prop="float";prop=prop.replace(/([A-Z])/g,"-$1").toLowerCase();var cur=document.defaultView.getComputedStyle(elem,null);if(cur&&!color(elem))ret=cur.getPropertyValue(prop);else{for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(a=0;a<stack.length;a++)if(color(stack[a])){swap[a]=stack[a].style.display;stack[a].style.display="block";}ret=prop=="display"&&swap[stack.length-1]!=null?"none":document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop)||"";for(a=0;a<swap.length;a++)if(swap[a]!=null)stack[a].style.display=swap[a];}if(prop=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var newProp=prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});ret=elem.currentStyle[prop]||elem.currentStyle[newProp];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var style=elem.style.left;var runtimeStyle=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;elem.style.left=ret||0;ret=elem.style.pixelLeft+"px";elem.style.left=style;elem.runtimeStyle.left=runtimeStyle;}}return ret;},clean:function(a,doc){var r=[];doc=doc||document;jQuery.each(a,function(i,arg){if(!arg)return;if(arg.constructor==Number)arg=arg.toString();if(typeof arg=="string"){arg=arg.replace(/(<(\w+)[^>]*?)\/>/g,function(m,all,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)?m:all+"></"+tag+">";});var s=jQuery.trim(arg).toLowerCase(),div=doc.createElement("div"),tb=[];var wrap=!s.indexOf("<opt")&&[1,"<select>","</select>"]||!s.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||s.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!s.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!s.indexOf("<td")||!s.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!s.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+arg+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){if(!s.indexOf("<table")&&s.indexOf("<tbody")<0)tb=div.firstChild&&div.firstChild.childNodes;else if(wrap[1]=="<table>"&&s.indexOf("<tbody")<0)tb=div.childNodes;for(var n=tb.length-1;n>=0;--n)if(jQuery.nodeName(tb[n],"tbody")&&!tb[n].childNodes.length)tb[n].parentNode.removeChild(tb[n]);if(/^\s/.test(arg))div.insertBefore(doc.createTextNode(arg.match(/^\s*/)[0]),div.firstChild);}arg=jQuery.makeArray(div.childNodes);}if(0===arg.length&&(!jQuery.nodeName(arg,"form")&&!jQuery.nodeName(arg,"select")))return;if(arg[0]==undefined||jQuery.nodeName(arg,"form")||arg.options)r.push(arg);else
-r=jQuery.merge(r,arg);});return r;},attr:function(elem,name,value){var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(t){return(t||"").replace(/^\s+|\s+$/g,"");},makeArray:function(a){var r=[];if(typeof a!="array")for(var i=0,al=a.length;i<al;i++)r.push(a[i]);else
-r=a.slice(0);return r;},inArray:function(b,a){for(var i=0,al=a.length;i<al;i++)if(a[i]==b)return i;return-1;},merge:function(first,second){if(jQuery.browser.msie){for(var i=0;second[i];i++)if(second[i].nodeType!=8)first.push(second[i]);}else
-for(var i=0;second[i];i++)first.push(second[i]);return first;},unique:function(first){var r=[],done={};try{for(var i=0,fl=first.length;i<fl;i++){var id=jQuery.data(first[i]);if(!done[id]){done[id]=true;r.push(first[i]);}}}catch(e){r=first;}return r;},grep:function(elems,fn,inv){if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++)if(!inv&&fn(elems[i],i)||inv&&!fn(elems[i],i))result.push(elems[i]);return result;},map:function(elems,fn){if(typeof fn=="string")fn=eval("false||function(a){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++){var val=fn(elems[i],i);if(val!==null&&val!=undefined){if(val.constructor!=Array)val=[val];result=result.concat(val);}}return result;}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",styleFloat:jQuery.browser.msie?"styleFloat":"cssFloat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,innerHTML:"innerHTML",className:"className",value:"value",disabled:"disabled",checked:"checked",readonly:"readOnly",selected:"selected",maxlength:"maxLength"}});jQuery.each({parent:"a.parentNode",parents:"jQuery.dir(a,'parentNode')",next:"jQuery.nth(a,2,'nextSibling')",prev:"jQuery.nth(a,2,'previousSibling')",nextAll:"jQuery.dir(a,'nextSibling')",prevAll:"jQuery.dir(a,'previousSibling')",siblings:"jQuery.sibling(a.parentNode.firstChild,a)",children:"jQuery.sibling(a.firstChild)",contents:"jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"},function(i,n){jQuery.fn[i]=function(a){var ret=jQuery.map(this,n);if(a&&typeof a=="string")ret=jQuery.multiFilter(a,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(i,n){jQuery.fn[i]=function(){var a=arguments;return this.each(function(){for(var j=0,al=a.length;j<al;j++)jQuery(a[j])[n](this);});};});jQuery.each({removeAttr:function(key){jQuery.attr(this,key,"");this.removeAttribute(key);},addClass:function(c){jQuery.className.add(this,c);},removeClass:function(c){jQuery.className.remove(this,c);},toggleClass:function(c){jQuery.className[jQuery.className.has(this,c)?"remove":"add"](this,c);},remove:function(a){if(!a||jQuery.filter(a,[this]).r.length){jQuery.removeData(this);this.parentNode.removeChild(this);}},empty:function(){jQuery("*",this).each(function(){jQuery.removeData(this);});while(this.firstChild)this.removeChild(this.firstChild);}},function(i,n){jQuery.fn[i]=function(){return this.each(n,arguments);};});jQuery.each(["Height","Width"],function(i,name){var n=name.toLowerCase();jQuery.fn[n]=function(h){return this[0]==window?jQuery.browser.safari&&self["inner"+name]||jQuery.boxModel&&Math.max(document.documentElement["client"+name],document.body["client"+name])||document.body["client"+name]:this[0]==document?Math.max(document.body["scroll"+name],document.body["offset"+name]):h==undefined?(this.length?jQuery.css(this[0],n):null):this.css(n,h.constructor==String?h:h+"px");};});var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":"m[2]=='*'||jQuery.nodeName(a,m[2])","#":"a.getAttribute('id')==m[2]",":":{lt:"i<m[3]-0",gt:"i>m[3]-0",nth:"m[3]-0==i",eq:"m[3]-0==i",first:"i==0",last:"i==r.length-1",even:"i%2==0",odd:"i%2","first-child":"a.parentNode.getElementsByTagName('*')[0]==a","last-child":"jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a","only-child":"!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",parent:"a.firstChild",empty:"!a.firstChild",contains:"(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",visible:'"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',hidden:'"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',enabled:"!a.disabled",disabled:"a.disabled",checked:"a.checked",selected:"a.selected||jQuery.attr(a,'selected')",text:"'text'==a.type",radio:"'radio'==a.type",checkbox:"'checkbox'==a.type",file:"'file'==a.type",password:"'password'==a.type",submit:"'submit'==a.type",image:"'image'==a.type",reset:"'reset'==a.type",button:'"button"==a.type||jQuery.nodeName(a,"button")',input:"/input|select|textarea|button/i.test(a.nodeName)",has:"jQuery.find(m[3],a).length",header:"/h\\d/i.test(a.nodeName)",animated:"jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&!context.nodeType)context=null;context=context||document;var ret=[context],done=[],last;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){var nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName.toUpperCase()))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var nodeName=m[2],merge={};m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName.toUpperCase()){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=jQuery.filter(m[3],r,true).r;else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(\d*)n\+?(\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"n+"+m[3]||m[3]),first=(test[1]||1)-0,last=test[2]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==1){if(last==0||node.nodeIndex==last)add=true;}else if((node.nodeIndex+last)%first==0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var f=jQuery.expr[m[1]];if(typeof f!="string")f=jQuery.expr[m[1]][m[2]];f=eval("false||function(a,i){return "+f+"}");r=jQuery.grep(r,f,not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(element,type,handler,data){if(jQuery.browser.msie&&element.setInterval!=undefined)element=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var parts=type.split(".");type=parts[0];handler.type=parts[1];var events=jQuery.data(element,"events")||jQuery.data(element,"events",{});var handle=jQuery.data(element,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(element,arguments);return val;});var handlers=events[type];if(!handlers){handlers=events[type]={};if(element.addEventListener)element.addEventListener(type,handle,false);else
-element.attachEvent("on"+type,handle);}handlers[handler.guid]=handler;this.global[type]=true;},guid:1,global:{},remove:function(element,type,handler){var events=jQuery.data(element,"events"),ret,index;if(typeof type=="string"){var parts=type.split(".");type=parts[0];}if(events){if(type&&type.type){handler=type.handler;type=type.type;}if(!type){for(type in events)this.remove(element,type);}else if(events[type]){if(handler)delete events[type][handler.guid];else
-for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(element.removeEventListener)element.removeEventListener(type,jQuery.data(element,"handle"),false);else
-element.detachEvent("on"+type,jQuery.data(element,"handle"));ret=null;delete events[type];}}for(ret in events)break;if(!ret){jQuery.removeData(element,"events");jQuery.removeData(element,"handle");}}},trigger:function(type,data,element,donative,extra){data=jQuery.makeArray(data||[]);if(!element){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{var val,ret,fn=jQuery.isFunction(element[type]||null),evt=!data[0]||!data[0].preventDefault;if(evt)data.unshift(this.fix({type:type,target:element}));data[0].type=type;if(jQuery.isFunction(jQuery.data(element,"handle")))val=jQuery.data(element,"handle").apply(element,data);if(!fn&&element["on"+type]&&element["on"+type].apply(element,data)===false)val=false;if(evt)data.shift();if(extra&&extra.apply(element,data)===false)val=false;if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(element,'a')&&type=="click")){this.triggered=true;element[type]();}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var c=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in c){args[0].handler=c[j];args[0].data=c[j].data;if(!parts[1]||c[j].type==parts[1]){var tmp=c[j].apply(this,args);if(val!==false)val=tmp;if(tmp===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target&&event.srcElement)event.target=event.srcElement;if(jQuery.browser.safari&&event.target.nodeType==3)event.target=originalEvent.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var e=document.documentElement,b=document.body;event.pageX=event.clientX+(e&&e.scrollLeft||b.scrollLeft||0);event.pageY=event.clientY+(e&&e.scrollTop||b.scrollTop||0);}if(!event.which&&(event.charCode||event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(){var a=arguments;return this.click(function(e){this.lastToggle=0==this.lastToggle?1:0;e.preventDefault();return a[this.lastToggle].apply(this,[e])||false;});},hover:function(f,g){function handleHover(e){var p=e.relatedTarget;while(p&&p!=this)try{p=p.parentNode;}catch(e){p=this;};if(p==this)return false;return(e.type=="mouseover"?f:g).apply(this,[e]);}return this.mouseover(handleHover).mouseout(handleHover);},ready:function(f){bindReady();if(jQuery.isReady)f.apply(document,[jQuery]);else
-jQuery.readyList.push(function(){return f.apply(this,[jQuery]);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}if(jQuery.browser.mozilla||jQuery.browser.opera)document.removeEventListener("DOMContentLoaded",jQuery.ready,false);if(!window.frames.length)jQuery(window).load(function(){jQuery("#__ie_init").remove();});}}});jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,o){jQuery.fn[o]=function(f){return f?this.bind(o,f):this.trigger(o);};});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(jQuery.browser.mozilla||jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);else if(jQuery.browser.msie){document.write("<scr"+"ipt id=__ie_init defer=true "+"src=//:><\/script>");var script=document.getElementById("__ie_init");if(script)script.onreadystatechange=function(){if(this.readyState!="complete")return;jQuery.ready();};script=null;}else if(jQuery.browser.safari)jQuery.safariTimer=setInterval(function(){if(document.readyState=="loaded"||document.readyState=="complete"){clearInterval(jQuery.safariTimer);jQuery.safariTimer=null;jQuery.ready();}},10);jQuery.event.add(window,"load",jQuery.ready);}jQuery.fn.extend({load:function(url,params,callback){if(jQuery.isFunction(url))return this.bind("load",url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);setTimeout(function(){self.each(callback,[res.responseText,status,res]);},13);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null},lastModified:{},ajax:function(s){var jsonp,jsre=/=(\?|%3F)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=s.data.replace(jsre,"="+jsonp);s.url=s.url.replace(jsre,"="+jsonp);s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get")s.url+=(s.url.match(/\?/)?"&":"?")+"_="+(new Date()).getTime();if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if(!s.url.indexOf("http")&&s.dataType=="script"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(!jsonp&&(s.success||s.complete)){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async);if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
-jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();return xml;function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
-for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
-s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock?this.oldblock:"";if(jQuery.css(this,"display")=="none")this.style.display="block";}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");if(this.oldblock=="none")this.oldblock="block";this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var opt=jQuery.speed(speed,easing,callback);return this[opt.queue===false?"each":"queue"](function(){opt=jQuery.extend({},opt);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
-e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(){var timers=jQuery.timers;return this.each(function(){for(var i=0;i<timers.length;i++)if(timers[i].elem==this)timers.splice(i--,1);}).dequeue();}});var queue=function(elem,type,array){if(!elem)return;var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.curCSS(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.css(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(){return self.step();}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timers.length==1){var timer=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length)clearInterval(timer);},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(){var t=(new Date()).getTime();if(t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var absolute=jQuery.css(elem,"position")=="absolute",parent=elem.parentNode,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522;if(elem.getBoundingClientRect){box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));if(msie){var border=jQuery("html").css("borderWidth");border=(border=="medium"||jQuery.boxModel&&parseInt(version)>=7)&&2||border;add(-border,-border);}}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&/^t[d|h]$/i.test(parent.tagName)||!safari2)border(offsetParent);if(safari2&&!absolute&&jQuery.css(offsetParent,"position")=="absolute")absolute=true;offsetParent=offsetParent.offsetParent;}while(parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table-row.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if(safari2&&absolute)add(-doc.body.offsetLeft,-doc.body.offsetTop);}results={top:top,left:left};}return results;function border(elem){add(jQuery.css(elem,"borderLeftWidth"),jQuery.css(elem,"borderTopWidth"));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}};})();
\ No newline at end of file
--- a/web/support/javascript/jquery.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2992 +0,0 @@
-(function(){
-/*
- * jQuery 1.2.1 - New Wave Javascript
- *
- * Copyright (c) 2007 John Resig (jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
- * $Rev: 3353 $
- */
-
-// Map over jQuery in case of overwrite
-if ( typeof jQuery != "undefined" )
-	var _jQuery = jQuery;
-
-var jQuery = window.jQuery = function(selector, context) {
-	// If the context is a namespace object, return a new object
-	return this instanceof jQuery ?
-		this.init(selector, context) :
-		new jQuery(selector, context);
-};
-
-// Map over the $ in case of overwrite
-if ( typeof $ != "undefined" )
-	var _$ = $;
-	
-// Map the jQuery namespace to the '$' one
-window.$ = jQuery;
-
-var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;
-
-jQuery.fn = jQuery.prototype = {
-	init: function(selector, context) {
-		// Make sure that a selection was provided
-		selector = selector || document;
-
-		// Handle HTML strings
-		if ( typeof selector  == "string" ) {
-			var m = quickExpr.exec(selector);
-			if ( m && (m[1] || !context) ) {
-				// HANDLE: $(html) -> $(array)
-				if ( m[1] )
-					selector = jQuery.clean( [ m[1] ], context );
-
-				// HANDLE: $("#id")
-				else {
-					var tmp = document.getElementById( m[3] );
-					if ( tmp )
-						// Handle the case where IE and Opera return items
-						// by name instead of ID
-						if ( tmp.id != m[3] )
-							return jQuery().find( selector );
-						else {
-							this[0] = tmp;
-							this.length = 1;
-							return this;
-						}
-					else
-						selector = [];
-				}
-
-			// HANDLE: $(expr)
-			} else
-				return new jQuery( context ).find( selector );
-
-		// HANDLE: $(function)
-		// Shortcut for document ready
-		} else if ( jQuery.isFunction(selector) )
-			return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( selector );
-
-		return this.setArray(
-			// HANDLE: $(array)
-			selector.constructor == Array && selector ||
-
-			// HANDLE: $(arraylike)
-			// Watch for when an array-like object is passed as the selector
-			(selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) ||
-
-			// HANDLE: $(*)
-			[ selector ] );
-	},
-	
-	jquery: "1.2.1",
-
-	size: function() {
-		return this.length;
-	},
-	
-	length: 0,
-
-	get: function( num ) {
-		return num == undefined ?
-
-			// Return a 'clean' array
-			jQuery.makeArray( this ) :
-
-			// Return just the object
-			this[num];
-	},
-	
-	pushStack: function( a ) {
-		var ret = jQuery(a);
-		ret.prevObject = this;
-		return ret;
-	},
-	
-	setArray: function( a ) {
-		this.length = 0;
-		Array.prototype.push.apply( this, a );
-		return this;
-	},
-
-	each: function( fn, args ) {
-		return jQuery.each( this, fn, args );
-	},
-
-	index: function( obj ) {
-		var pos = -1;
-		this.each(function(i){
-			if ( this == obj ) pos = i;
-		});
-		return pos;
-	},
-
-	attr: function( key, value, type ) {
-		var obj = key;
-		
-		// Look for the case where we're accessing a style value
-		if ( key.constructor == String )
-			if ( value == undefined )
-				return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined;
-			else {
-				obj = {};
-				obj[ key ] = value;
-			}
-		
-		// Check to see if we're setting style values
-		return this.each(function(index){
-			// Set all the styles
-			for ( var prop in obj )
-				jQuery.attr(
-					type ? this.style : this,
-					prop, jQuery.prop(this, obj[prop], type, index, prop)
-				);
-		});
-	},
-
-	css: function( key, value ) {
-		return this.attr( key, value, "curCSS" );
-	},
-
-	text: function(e) {
-		if ( typeof e != "object" && e != null )
-			return this.empty().append( document.createTextNode( e ) );
-
-		var t = "";
-		jQuery.each( e || this, function(){
-			jQuery.each( this.childNodes, function(){
-				if ( this.nodeType != 8 )
-					t += this.nodeType != 1 ?
-						this.nodeValue : jQuery.fn.text([ this ]);
-			});
-		});
-		return t;
-	},
-
-	wrapAll: function(html) {
-		if ( this[0] )
-			// The elements to wrap the target around
-			jQuery(html, this[0].ownerDocument)
-				.clone()
-				.insertBefore(this[0])
-				.map(function(){
-					var elem = this;
-					while ( elem.firstChild )
-						elem = elem.firstChild;
-					return elem;
-				})
-				.append(this);
-
-		return this;
-	},
-
-	wrapInner: function(html) {
-		return this.each(function(){
-			jQuery(this).contents().wrapAll(html);
-		});
-	},
-
-	wrap: function(html) {
-		return this.each(function(){
-			jQuery(this).wrapAll(html);
-		});
-	},
-
-	append: function() {
-		return this.domManip(arguments, true, 1, function(a){
-			this.appendChild( a );
-		});
-	},
-
-	prepend: function() {
-		return this.domManip(arguments, true, -1, function(a){
-			this.insertBefore( a, this.firstChild );
-		});
-	},
-	
-	before: function() {
-		return this.domManip(arguments, false, 1, function(a){
-			this.parentNode.insertBefore( a, this );
-		});
-	},
-
-	after: function() {
-		return this.domManip(arguments, false, -1, function(a){
-			this.parentNode.insertBefore( a, this.nextSibling );
-		});
-	},
-
-	end: function() {
-		return this.prevObject || jQuery([]);
-	},
-
-	find: function(t) {
-		var data = jQuery.map(this, function(a){ return jQuery.find(t,a); });
-		return this.pushStack( /[^+>] [^+>]/.test( t ) || t.indexOf("..") > -1 ?
-			jQuery.unique( data ) : data );
-	},
-
-	clone: function(events) {
-		// Do the clone
-		var ret = this.map(function(){
-			return this.outerHTML ? jQuery(this.outerHTML)[0] : this.cloneNode(true);
-		});
-
-		// Need to set the expando to null on the cloned set if it exists
-		// removeData doesn't work here, IE removes it from the original as well
-		// this is primarily for IE but the data expando shouldn't be copied over in any browser
-		var clone = ret.find("*").andSelf().each(function(){
-			if ( this[ expando ] != undefined )
-				this[ expando ] = null;
-		});
-		
-		// Copy the events from the original to the clone
-		if (events === true)
-			this.find("*").andSelf().each(function(i) {
-				var events = jQuery.data(this, "events");
-				for ( var type in events )
-					for ( var handler in events[type] )
-						jQuery.event.add(clone[i], type, events[type][handler], events[type][handler].data);
-			});
-
-		// Return the cloned set
-		return ret;
-	},
-
-	filter: function(t) {
-		return this.pushStack(
-			jQuery.isFunction( t ) &&
-			jQuery.grep(this, function(el, index){
-				return t.apply(el, [index]);
-			}) ||
-
-			jQuery.multiFilter(t,this) );
-	},
-
-	not: function(t) {
-		return this.pushStack(
-			t.constructor == String &&
-			jQuery.multiFilter(t, this, true) ||
-
-			jQuery.grep(this, function(a) {
-				return ( t.constructor == Array || t.jquery )
-					? jQuery.inArray( a, t ) < 0
-					: a != t;
-			})
-		);
-	},
-
-	add: function(t) {
-		return this.pushStack( jQuery.merge(
-			this.get(),
-			t.constructor == String ?
-				jQuery(t).get() :
-				t.length != undefined && (!t.nodeName || jQuery.nodeName(t, "form")) ?
-					t : [t] )
-		);
-	},
-
-	is: function(expr) {
-		return expr ? jQuery.multiFilter(expr,this).length > 0 : false;
-	},
-
-	hasClass: function(expr) {
-		return this.is("." + expr);
-	},
-	
-	val: function( val ) {
-		if ( val == undefined ) {
-			if ( this.length ) {
-				var elem = this[0];
-		    	
-				// We need to handle select boxes special
-				if ( jQuery.nodeName(elem, "select") ) {
-					var index = elem.selectedIndex,
-						a = [],
-						options = elem.options,
-						one = elem.type == "select-one";
-					
-					// Nothing was selected
-					if ( index < 0 )
-						return null;
-
-					// Loop through all the selected options
-					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
-						var option = options[i];
-						if ( option.selected ) {
-							// Get the specifc value for the option
-							var val = jQuery.browser.msie && !option.attributes["value"].specified ? option.text : option.value;
-							
-							// We don't need an array for one selects
-							if ( one )
-								return val;
-							
-							// Multi-Selects return an array
-							a.push(val);
-						}
-					}
-					
-					return a;
-					
-				// Everything else, we just grab the value
-				} else
-					return this[0].value.replace(/\r/g, "");
-			}
-		} else
-			return this.each(function(){
-				if ( val.constructor == Array && /radio|checkbox/.test(this.type) )
-					this.checked = (jQuery.inArray(this.value, val) >= 0 ||
-						jQuery.inArray(this.name, val) >= 0);
-				else if ( jQuery.nodeName(this, "select") ) {
-					var tmp = val.constructor == Array ? val : [val];
-
-					jQuery("option", this).each(function(){
-						this.selected = (jQuery.inArray(this.value, tmp) >= 0 ||
-						jQuery.inArray(this.text, tmp) >= 0);
-					});
-
-					if ( !tmp.length )
-						this.selectedIndex = -1;
-				} else
-					this.value = val;
-			});
-	},
-	
-	html: function( val ) {
-		return val == undefined ?
-			( this.length ? this[0].innerHTML : null ) :
-			this.empty().append( val );
-	},
-
-	replaceWith: function( val ) {
-		return this.after( val ).remove();
-	},
-
-	eq: function(i){
-		return this.slice(i, i+1);
-	},
-
-	slice: function() {
-		return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
-	},
-
-	map: function(fn) {
-		return this.pushStack(jQuery.map( this, function(elem,i){
-			return fn.call( elem, i, elem );
-		}));
-	},
-
-	andSelf: function() {
-		return this.add( this.prevObject );
-	},
-	
-	domManip: function(args, table, dir, fn) {
-		var clone = this.length > 1, a; 
-
-		return this.each(function(){
-			if ( !a ) {
-				a = jQuery.clean(args, this.ownerDocument);
-				if ( dir < 0 )
-					a.reverse();
-			}
-
-			var obj = this;
-
-			if ( table && jQuery.nodeName(this, "table") && jQuery.nodeName(a[0], "tr") )
-				obj = this.getElementsByTagName("tbody")[0] || this.appendChild(document.createElement("tbody"));
-
-			jQuery.each( a, function(){
-				var elem = clone ? this.cloneNode(true) : this;
-				if ( !evalScript(0, elem) )
-					fn.call( obj, elem );
-			});
-		});
-	}
-};
-
-function evalScript(i, elem){
-	var script = jQuery.nodeName(elem, "script");
-
-	if ( script ) {
-		if ( elem.src )
-			jQuery.ajax({ url: elem.src, async: false, dataType: "script" });
-		else
-			jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
-	
-		if ( elem.parentNode )
-			elem.parentNode.removeChild(elem);
-
-	} else if ( elem.nodeType == 1 )
-    jQuery("script", elem).each(evalScript);
-
-	return script;
-}
-
-jQuery.extend = jQuery.fn.extend = function() {
-	// copy reference to target object
-	var target = arguments[0] || {}, a = 1, al = arguments.length, deep = false;
-
-	// Handle a deep copy situation
-	if ( target.constructor == Boolean ) {
-		deep = target;
-		target = arguments[1] || {};
-	}
-
-	// extend jQuery itself if only one argument is passed
-	if ( al == 1 ) {
-		target = this;
-		a = 0;
-	}
-
-	var prop;
-
-	for ( ; a < al; a++ )
-		// Only deal with non-null/undefined values
-		if ( (prop = arguments[a]) != null )
-			// Extend the base object
-			for ( var i in prop ) {
-				// Prevent never-ending loop
-				if ( target == prop[i] )
-					continue;
-
-				// Recurse if we're merging object values
-				if ( deep && typeof prop[i] == 'object' && target[i] )
-					jQuery.extend( target[i], prop[i] );
-
-				// Don't bring in undefined values
-				else if ( prop[i] != undefined )
-					target[i] = prop[i];
-			}
-
-	// Return the modified object
-	return target;
-};
-
-var expando = "jQuery" + (new Date()).getTime(), uuid = 0, win = {};
-
-jQuery.extend({
-	noConflict: function(deep) {
-		window.$ = _$;
-		if ( deep )
-			window.jQuery = _jQuery;
-		return jQuery;
-	},
-
-	// This may seem like some crazy code, but trust me when I say that this
-	// is the only cross-browser way to do this. --John
-	isFunction: function( fn ) {
-		return !!fn && typeof fn != "string" && !fn.nodeName && 
-			fn.constructor != Array && /function/i.test( fn + "" );
-	},
-	
-	// check if an element is in a XML document
-	isXMLDoc: function(elem) {
-		return elem.documentElement && !elem.body ||
-			elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
-	},
-
-	// Evalulates a script in a global context
-	// Evaluates Async. in Safari 2 :-(
-	globalEval: function( data ) {
-		data = jQuery.trim( data );
-		if ( data ) {
-			if ( window.execScript )
-				window.execScript( data );
-			else if ( jQuery.browser.safari )
-				// safari doesn't provide a synchronous global eval
-				window.setTimeout( data, 0 );
-			else
-				eval.call( window, data );
-		}
-	},
-
-	nodeName: function( elem, name ) {
-		return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
-	},
-	
-	cache: {},
-	
-	data: function( elem, name, data ) {
-		elem = elem == window ? win : elem;
-
-		var id = elem[ expando ];
-
-		// Compute a unique ID for the element
-		if ( !id ) 
-			id = elem[ expando ] = ++uuid;
-
-		// Only generate the data cache if we're
-		// trying to access or manipulate it
-		if ( name && !jQuery.cache[ id ] )
-			jQuery.cache[ id ] = {};
-		
-		// Prevent overriding the named cache with undefined values
-		if ( data != undefined )
-			jQuery.cache[ id ][ name ] = data;
-		
-		// Return the named cache data, or the ID for the element	
-		return name ? jQuery.cache[ id ][ name ] : id;
-	},
-	
-	removeData: function( elem, name ) {
-		elem = elem == window ? win : elem;
-
-		var id = elem[ expando ];
-
-		// If we want to remove a specific section of the element's data
-		if ( name ) {
-			if ( jQuery.cache[ id ] ) {
-				// Remove the section of cache data
-				delete jQuery.cache[ id ][ name ];
-
-				// If we've removed all the data, remove the element's cache
-				name = "";
-				for ( name in jQuery.cache[ id ] ) break;
-				if ( !name )
-					jQuery.removeData( elem );
-			}
-
-		// Otherwise, we want to remove all of the element's data
-		} else {
-			// Clean up the element expando
-			try {
-				delete elem[ expando ];
-			} catch(e){
-				// IE has trouble directly removing the expando
-				// but it's ok with using removeAttribute
-				if ( elem.removeAttribute )
-					elem.removeAttribute( expando );
-			}
-
-			// Completely remove the data cache
-			delete jQuery.cache[ id ];
-		}
-	},
-
-	// args is for internal usage only
-	each: function( obj, fn, args ) {
-		if ( args ) {
-			if ( obj.length == undefined )
-				for ( var i in obj )
-					fn.apply( obj[i], args );
-			else
-				for ( var i = 0, ol = obj.length; i < ol; i++ )
-					if ( fn.apply( obj[i], args ) === false ) break;
-
-		// A special, fast, case for the most common use of each
-		} else {
-			if ( obj.length == undefined )
-				for ( var i in obj )
-					fn.call( obj[i], i, obj[i] );
-			else
-				for ( var i = 0, ol = obj.length, val = obj[0]; 
-					i < ol && fn.call(val,i,val) !== false; val = obj[++i] ){}
-		}
-
-		return obj;
-	},
-	
-	prop: function(elem, value, type, index, prop){
-			// Handle executable functions
-			if ( jQuery.isFunction( value ) )
-				value = value.call( elem, [index] );
-				
-			// exclude the following css properties to add px
-			var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
-
-			// Handle passing in a number to a CSS property
-			return value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) ?
-				value + "px" :
-				value;
-	},
-
-	className: {
-		// internal only, use addClass("class")
-		add: function( elem, c ){
-			jQuery.each( (c || "").split(/\s+/), function(i, cur){
-				if ( !jQuery.className.has( elem.className, cur ) )
-					elem.className += ( elem.className ? " " : "" ) + cur;
-			});
-		},
-
-		// internal only, use removeClass("class")
-		remove: function( elem, c ){
-			elem.className = c != undefined ?
-				jQuery.grep( elem.className.split(/\s+/), function(cur){
-					return !jQuery.className.has( c, cur );	
-				}).join(" ") : "";
-		},
-
-		// internal only, use is(".class")
-		has: function( t, c ) {
-			return jQuery.inArray( c, (t.className || t).toString().split(/\s+/) ) > -1;
-		}
-	},
-
-	swap: function(e,o,f) {
-		for ( var i in o ) {
-			e.style["old"+i] = e.style[i];
-			e.style[i] = o[i];
-		}
-		f.apply( e, [] );
-		for ( var i in o )
-			e.style[i] = e.style["old"+i];
-	},
-
-	css: function(e,p) {
-		if ( p == "height" || p == "width" ) {
-			var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"];
-
-			jQuery.each( d, function(){
-				old["padding" + this] = 0;
-				old["border" + this + "Width"] = 0;
-			});
-
-			jQuery.swap( e, old, function() {
-				if ( jQuery(e).is(':visible') ) {
-					oHeight = e.offsetHeight;
-					oWidth = e.offsetWidth;
-				} else {
-					e = jQuery(e.cloneNode(true))
-						.find(":radio").removeAttr("checked").end()
-						.css({
-							visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0"
-						}).appendTo(e.parentNode)[0];
-
-					var parPos = jQuery.css(e.parentNode,"position") || "static";
-					if ( parPos == "static" )
-						e.parentNode.style.position = "relative";
-
-					oHeight = e.clientHeight;
-					oWidth = e.clientWidth;
-
-					if ( parPos == "static" )
-						e.parentNode.style.position = "static";
-
-					e.parentNode.removeChild(e);
-				}
-			});
-
-			return p == "height" ? oHeight : oWidth;
-		}
-
-		return jQuery.curCSS( e, p );
-	},
-
-	curCSS: function(elem, prop, force) {
-		var ret, stack = [], swap = [];
-
-		// A helper method for determining if an element's values are broken
-		function color(a){
-			if ( !jQuery.browser.safari )
-				return false;
-
-			var ret = document.defaultView.getComputedStyle(a,null);
-			return !ret || ret.getPropertyValue("color") == "";
-		}
-
-		if (prop == "opacity" && jQuery.browser.msie) {
-			ret = jQuery.attr(elem.style, "opacity");
-			return ret == "" ? "1" : ret;
-		}
-		
-		if (prop.match(/float/i))
-			prop = styleFloat;
-
-		if (!force && elem.style[prop])
-			ret = elem.style[prop];
-
-		else if (document.defaultView && document.defaultView.getComputedStyle) {
-
-			if (prop.match(/float/i))
-				prop = "float";
-
-			prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase();
-			var cur = document.defaultView.getComputedStyle(elem, null);
-
-			if ( cur && !color(elem) )
-				ret = cur.getPropertyValue(prop);
-
-			// If the element isn't reporting its values properly in Safari
-			// then some display: none elements are involved
-			else {
-				// Locate all of the parent display: none elements
-				for ( var a = elem; a && color(a); a = a.parentNode )
-					stack.unshift(a);
-
-				// Go through and make them visible, but in reverse
-				// (It would be better if we knew the exact display type that they had)
-				for ( a = 0; a < stack.length; a++ )
-					if ( color(stack[a]) ) {
-						swap[a] = stack[a].style.display;
-						stack[a].style.display = "block";
-					}
-
-				// Since we flip the display style, we have to handle that
-				// one special, otherwise get the value
-				ret = prop == "display" && swap[stack.length-1] != null ?
-					"none" :
-					document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop) || "";
-
-				// Finally, revert the display styles back
-				for ( a = 0; a < swap.length; a++ )
-					if ( swap[a] != null )
-						stack[a].style.display = swap[a];
-			}
-
-			if ( prop == "opacity" && ret == "" )
-				ret = "1";
-
-		} else if (elem.currentStyle) {
-			var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});
-			ret = elem.currentStyle[prop] || elem.currentStyle[newProp];
-
-			// From the awesome hack by Dean Edwards
-			// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
-			// If we're not dealing with a regular pixel number
-			// but a number that has a weird ending, we need to convert it to pixels
-			if ( !/^\d+(px)?$/i.test(ret) && /^\d/.test(ret) ) {
-				var style = elem.style.left;
-				var runtimeStyle = elem.runtimeStyle.left;
-				elem.runtimeStyle.left = elem.currentStyle.left;
-				elem.style.left = ret || 0;
-				ret = elem.style.pixelLeft + "px";
-				elem.style.left = style;
-				elem.runtimeStyle.left = runtimeStyle;
-			}
-		}
-
-		return ret;
-	},
-	
-	clean: function(a, doc) {
-		var r = [];
-		doc = doc || document;
-
-		jQuery.each( a, function(i,arg){
-			if ( !arg ) return;
-
-			if ( arg.constructor == Number )
-				arg = arg.toString();
-			
-			// Convert html string into DOM nodes
-			if ( typeof arg == "string" ) {
-				// Fix "XHTML"-style tags in all browsers
-				arg = arg.replace(/(<(\w+)[^>]*?)\/>/g, function(m, all, tag){
-					return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)? m : all+"></"+tag+">";
-				});
-
-				// Trim whitespace, otherwise indexOf won't work as expected
-				var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = [];
-
-				var wrap =
-					// option or optgroup
-					!s.indexOf("<opt") &&
-					[1, "<select>", "</select>"] ||
-					
-					!s.indexOf("<leg") &&
-					[1, "<fieldset>", "</fieldset>"] ||
-					
-					s.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
-					[1, "<table>", "</table>"] ||
-					
-					!s.indexOf("<tr") &&
-					[2, "<table><tbody>", "</tbody></table>"] ||
-					
-				 	// <thead> matched above
-					(!s.indexOf("<td") || !s.indexOf("<th")) &&
-					[3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
-					
-					!s.indexOf("<col") &&
-					[2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] ||
-
-					// IE can't serialize <link> and <script> tags normally
-					jQuery.browser.msie &&
-					[1, "div<div>", "</div>"] ||
-					
-					[0,"",""];
-
-				// Go to html and back, then peel off extra wrappers
-				div.innerHTML = wrap[1] + arg + wrap[2];
-				
-				// Move to the right depth
-				while ( wrap[0]-- )
-					div = div.lastChild;
-				
-				// Remove IE's autoinserted <tbody> from table fragments
-				if ( jQuery.browser.msie ) {
-					
-					// String was a <table>, *may* have spurious <tbody>
-					if ( !s.indexOf("<table") && s.indexOf("<tbody") < 0 ) 
-						tb = div.firstChild && div.firstChild.childNodes;
-						
-					// String was a bare <thead> or <tfoot>
-					else if ( wrap[1] == "<table>" && s.indexOf("<tbody") < 0 )
-						tb = div.childNodes;
-
-					for ( var n = tb.length-1; n >= 0 ; --n )
-						if ( jQuery.nodeName(tb[n], "tbody") && !tb[n].childNodes.length )
-							tb[n].parentNode.removeChild(tb[n]);
-	
-					// IE completely kills leading whitespace when innerHTML is used	
-					if ( /^\s/.test(arg) )	
-						div.insertBefore( doc.createTextNode( arg.match(/^\s*/)[0] ), div.firstChild );
-
-				}
-				
-				arg = jQuery.makeArray( div.childNodes );
-			}
-
-			if ( 0 === arg.length && (!jQuery.nodeName(arg, "form") && !jQuery.nodeName(arg, "select")) )
-				return;
-
-			if ( arg[0] == undefined || jQuery.nodeName(arg, "form") || arg.options )
-				r.push( arg );
-			else
-				r = jQuery.merge( r, arg );
-
-		});
-
-		return r;
-	},
-	
-	attr: function(elem, name, value){
-		var fix = jQuery.isXMLDoc(elem) ? {} : jQuery.props;
-
-		// Safari mis-reports the default selected property of a hidden option
-		// Accessing the parent's selectedIndex property fixes it
-		if ( name == "selected" && jQuery.browser.safari )
-			elem.parentNode.selectedIndex;
-		
-		// Certain attributes only work when accessed via the old DOM 0 way
-		if ( fix[name] ) {
-			if ( value != undefined ) elem[fix[name]] = value;
-			return elem[fix[name]];
-		} else if ( jQuery.browser.msie && name == "style" )
-			return jQuery.attr( elem.style, "cssText", value );
-
-		else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName(elem, "form") && (name == "action" || name == "method") )
-			return elem.getAttributeNode(name).nodeValue;
-
-		// IE elem.getAttribute passes even for style
-		else if ( elem.tagName ) {
-
-			if ( value != undefined ) {
-				if ( name == "type" && jQuery.nodeName(elem,"input") && elem.parentNode )
-					throw "type property can't be changed";
-				elem.setAttribute( name, value );
-			}
-
-			if ( jQuery.browser.msie && /href|src/.test(name) && !jQuery.isXMLDoc(elem) ) 
-				return elem.getAttribute( name, 2 );
-
-			return elem.getAttribute( name );
-
-		// elem is actually elem.style ... set the style
-		} else {
-			// IE actually uses filters for opacity
-			if ( name == "opacity" && jQuery.browser.msie ) {
-				if ( value != undefined ) {
-					// IE has trouble with opacity if it does not have layout
-					// Force it by setting the zoom level
-					elem.zoom = 1; 
-	
-					// Set the alpha filter to set the opacity
-					elem.filter = (elem.filter || "").replace(/alpha\([^)]*\)/,"") +
-						(parseFloat(value).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
-				}
-	
-				return elem.filter ? 
-					(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100).toString() : "";
-			}
-			name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});
-			if ( value != undefined ) elem[name] = value;
-			return elem[name];
-		}
-	},
-	
-	trim: function(t){
-		return (t||"").replace(/^\s+|\s+$/g, "");
-	},
-
-	makeArray: function( a ) {
-		var r = [];
-
-		// Need to use typeof to fight Safari childNodes crashes
-		if ( typeof a != "array" )
-			for ( var i = 0, al = a.length; i < al; i++ )
-				r.push( a[i] );
-		else
-			r = a.slice( 0 );
-
-		return r;
-	},
-
-	inArray: function( b, a ) {
-		for ( var i = 0, al = a.length; i < al; i++ )
-			if ( a[i] == b )
-				return i;
-		return -1;
-	},
-
-	merge: function(first, second) {
-		// We have to loop this way because IE & Opera overwrite the length
-		// expando of getElementsByTagName
-
-		// Also, we need to make sure that the correct elements are being returned
-		// (IE returns comment nodes in a '*' query)
-		if ( jQuery.browser.msie ) {
-			for ( var i = 0; second[i]; i++ )
-				if ( second[i].nodeType != 8 )
-					first.push(second[i]);
-		} else
-			for ( var i = 0; second[i]; i++ )
-				first.push(second[i]);
-
-		return first;
-	},
-
-	unique: function(first) {
-		var r = [], done = {};
-
-		try {
-			for ( var i = 0, fl = first.length; i < fl; i++ ) {
-				var id = jQuery.data(first[i]);
-				if ( !done[id] ) {
-					done[id] = true;
-					r.push(first[i]);
-				}
-			}
-		} catch(e) {
-			r = first;
-		}
-
-		return r;
-	},
-
-	grep: function(elems, fn, inv) {
-		// If a string is passed in for the function, make a function
-		// for it (a handy shortcut)
-		if ( typeof fn == "string" )
-			fn = eval("false||function(a,i){return " + fn + "}");
-
-		var result = [];
-
-		// Go through the array, only saving the items
-		// that pass the validator function
-		for ( var i = 0, el = elems.length; i < el; i++ )
-			if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )
-				result.push( elems[i] );
-
-		return result;
-	},
-
-	map: function(elems, fn) {
-		// If a string is passed in for the function, make a function
-		// for it (a handy shortcut)
-		if ( typeof fn == "string" )
-			fn = eval("false||function(a){return " + fn + "}");
-
-		var result = [];
-
-		// Go through the array, translating each of the items to their
-		// new value (or values).
-		for ( var i = 0, el = elems.length; i < el; i++ ) {
-			var val = fn(elems[i],i);
-
-			if ( val !== null && val != undefined ) {
-				if ( val.constructor != Array ) val = [val];
-				result = result.concat( val );
-			}
-		}
-
-		return result;
-	}
-});
-
-var userAgent = navigator.userAgent.toLowerCase();
-
-// Figure out what browser is being used
-jQuery.browser = {
-	version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
-	safari: /webkit/.test(userAgent),
-	opera: /opera/.test(userAgent),
-	msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
-	mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
-};
-
-var styleFloat = jQuery.browser.msie ? "styleFloat" : "cssFloat";
-	
-jQuery.extend({
-	// Check to see if the W3C box model is being used
-	boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",
-	
-	styleFloat: jQuery.browser.msie ? "styleFloat" : "cssFloat",
-	
-	props: {
-		"for": "htmlFor",
-		"class": "className",
-		"float": styleFloat,
-		cssFloat: styleFloat,
-		styleFloat: styleFloat,
-		innerHTML: "innerHTML",
-		className: "className",
-		value: "value",
-		disabled: "disabled",
-		checked: "checked",
-		readonly: "readOnly",
-		selected: "selected",
-		maxlength: "maxLength"
-	}
-});
-
-jQuery.each({
-	parent: "a.parentNode",
-	parents: "jQuery.dir(a,'parentNode')",
-	next: "jQuery.nth(a,2,'nextSibling')",
-	prev: "jQuery.nth(a,2,'previousSibling')",
-	nextAll: "jQuery.dir(a,'nextSibling')",
-	prevAll: "jQuery.dir(a,'previousSibling')",
-	siblings: "jQuery.sibling(a.parentNode.firstChild,a)",
-	children: "jQuery.sibling(a.firstChild)",
-	contents: "jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"
-}, function(i,n){
-	jQuery.fn[ i ] = function(a) {
-		var ret = jQuery.map(this,n);
-		if ( a && typeof a == "string" )
-			ret = jQuery.multiFilter(a,ret);
-		return this.pushStack( jQuery.unique(ret) );
-	};
-});
-
-jQuery.each({
-	appendTo: "append",
-	prependTo: "prepend",
-	insertBefore: "before",
-	insertAfter: "after",
-	replaceAll: "replaceWith"
-}, function(i,n){
-	jQuery.fn[ i ] = function(){
-		var a = arguments;
-		return this.each(function(){
-			for ( var j = 0, al = a.length; j < al; j++ )
-				jQuery(a[j])[n]( this );
-		});
-	};
-});
-
-jQuery.each( {
-	removeAttr: function( key ) {
-		jQuery.attr( this, key, "" );
-		this.removeAttribute( key );
-	},
-	addClass: function(c){
-		jQuery.className.add(this,c);
-	},
-	removeClass: function(c){
-		jQuery.className.remove(this,c);
-	},
-	toggleClass: function( c ){
-		jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this, c);
-	},
-	remove: function(a){
-		if ( !a || jQuery.filter( a, [this] ).r.length ) {
-			jQuery.removeData( this );
-			this.parentNode.removeChild( this );
-		}
-	},
-	empty: function() {
-		// Clean up the cache
-		jQuery("*", this).each(function(){ jQuery.removeData(this); });
-
-		while ( this.firstChild )
-			this.removeChild( this.firstChild );
-	}
-}, function(i,n){
-	jQuery.fn[ i ] = function() {
-		return this.each( n, arguments );
-	};
-});
-
-jQuery.each( [ "Height", "Width" ], function(i,name){
-	var n = name.toLowerCase();
-	
-	jQuery.fn[ n ] = function(h) {
-		return this[0] == window ?
-			jQuery.browser.safari && self["inner" + name] ||
-			jQuery.boxModel && Math.max(document.documentElement["client" + name], document.body["client" + name]) ||
-			document.body["client" + name] :
-		
-			this[0] == document ?
-				Math.max( document.body["scroll" + name], document.body["offset" + name] ) :
-        
-				h == undefined ?
-					( this.length ? jQuery.css( this[0], n ) : null ) :
-					this.css( n, h.constructor == String ? h : h + "px" );
-	};
-});
-
-var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
-		"(?:[\\w*_-]|\\\\.)" :
-		"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
-	quickChild = new RegExp("^>\\s*(" + chars + "+)"),
-	quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
-	quickClass = new RegExp("^([#.]?)(" + chars + "*)");
-
-jQuery.extend({
-	expr: {
-		"": "m[2]=='*'||jQuery.nodeName(a,m[2])",
-		"#": "a.getAttribute('id')==m[2]",
-		":": {
-			// Position Checks
-			lt: "i<m[3]-0",
-			gt: "i>m[3]-0",
-			nth: "m[3]-0==i",
-			eq: "m[3]-0==i",
-			first: "i==0",
-			last: "i==r.length-1",
-			even: "i%2==0",
-			odd: "i%2",
-
-			// Child Checks
-			"first-child": "a.parentNode.getElementsByTagName('*')[0]==a",
-			"last-child": "jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a",
-			"only-child": "!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",
-
-			// Parent Checks
-			parent: "a.firstChild",
-			empty: "!a.firstChild",
-
-			// Text Check
-			contains: "(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",
-
-			// Visibility
-			visible: '"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',
-			hidden: '"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',
-
-			// Form attributes
-			enabled: "!a.disabled",
-			disabled: "a.disabled",
-			checked: "a.checked",
-			selected: "a.selected||jQuery.attr(a,'selected')",
-
-			// Form elements
-			text: "'text'==a.type",
-			radio: "'radio'==a.type",
-			checkbox: "'checkbox'==a.type",
-			file: "'file'==a.type",
-			password: "'password'==a.type",
-			submit: "'submit'==a.type",
-			image: "'image'==a.type",
-			reset: "'reset'==a.type",
-			button: '"button"==a.type||jQuery.nodeName(a,"button")',
-			input: "/input|select|textarea|button/i.test(a.nodeName)",
-
-			// :has()
-			has: "jQuery.find(m[3],a).length",
-
-			// :header
-			header: "/h\\d/i.test(a.nodeName)",
-
-			// :animated
-			animated: "jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"
-		}
-	},
-	
-	// The regular expressions that power the parsing engine
-	parse: [
-		// Match: [@value='test'], [@foo]
-		/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,
-
-		// Match: :contains('foo')
-		/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,
-
-		// Match: :even, :last-chlid, #id, .class
-		new RegExp("^([:.#]*)(" + chars + "+)")
-	],
-
-	multiFilter: function( expr, elems, not ) {
-		var old, cur = [];
-
-		while ( expr && expr != old ) {
-			old = expr;
-			var f = jQuery.filter( expr, elems, not );
-			expr = f.t.replace(/^\s*,\s*/, "" );
-			cur = not ? elems = f.r : jQuery.merge( cur, f.r );
-		}
-
-		return cur;
-	},
-
-	find: function( t, context ) {
-		// Quickly handle non-string expressions
-		if ( typeof t != "string" )
-			return [ t ];
-
-		// Make sure that the context is a DOM Element
-		if ( context && !context.nodeType )
-			context = null;
-
-		// Set the correct context (if none is provided)
-		context = context || document;
-
-		// Initialize the search
-		var ret = [context], done = [], last;
-
-		// Continue while a selector expression exists, and while
-		// we're no longer looping upon ourselves
-		while ( t && last != t ) {
-			var r = [];
-			last = t;
-
-			t = jQuery.trim(t);
-
-			var foundToken = false;
-
-			// An attempt at speeding up child selectors that
-			// point to a specific element tag
-			var re = quickChild;
-			var m = re.exec(t);
-
-			if ( m ) {
-				var nodeName = m[1].toUpperCase();
-
-				// Perform our own iteration and filter
-				for ( var i = 0; ret[i]; i++ )
-					for ( var c = ret[i].firstChild; c; c = c.nextSibling )
-						if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName.toUpperCase()) )
-							r.push( c );
-
-				ret = r;
-				t = t.replace( re, "" );
-				if ( t.indexOf(" ") == 0 ) continue;
-				foundToken = true;
-			} else {
-				re = /^([>+~])\s*(\w*)/i;
-
-				if ( (m = re.exec(t)) != null ) {
-					r = [];
-
-					var nodeName = m[2], merge = {};
-					m = m[1];
-
-					for ( var j = 0, rl = ret.length; j < rl; j++ ) {
-						var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
-						for ( ; n; n = n.nextSibling )
-							if ( n.nodeType == 1 ) {
-								var id = jQuery.data(n);
-
-								if ( m == "~" && merge[id] ) break;
-								
-								if (!nodeName || n.nodeName.toUpperCase() == nodeName.toUpperCase() ) {
-									if ( m == "~" ) merge[id] = true;
-									r.push( n );
-								}
-								
-								if ( m == "+" ) break;
-							}
-					}
-
-					ret = r;
-
-					// And remove the token
-					t = jQuery.trim( t.replace( re, "" ) );
-					foundToken = true;
-				}
-			}
-
-			// See if there's still an expression, and that we haven't already
-			// matched a token
-			if ( t && !foundToken ) {
-				// Handle multiple expressions
-				if ( !t.indexOf(",") ) {
-					// Clean the result set
-					if ( context == ret[0] ) ret.shift();
-
-					// Merge the result sets
-					done = jQuery.merge( done, ret );
-
-					// Reset the context
-					r = ret = [context];
-
-					// Touch up the selector string
-					t = " " + t.substr(1,t.length);
-
-				} else {
-					// Optimize for the case nodeName#idName
-					var re2 = quickID;
-					var m = re2.exec(t);
-					
-					// Re-organize the results, so that they're consistent
-					if ( m ) {
-					   m = [ 0, m[2], m[3], m[1] ];
-
-					} else {
-						// Otherwise, do a traditional filter check for
-						// ID, class, and element selectors
-						re2 = quickClass;
-						m = re2.exec(t);
-					}
-
-					m[2] = m[2].replace(/\\/g, "");
-
-					var elem = ret[ret.length-1];
-
-					// Try to do a global search by ID, where we can
-					if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
-						// Optimization for HTML document case
-						var oid = elem.getElementById(m[2]);
-						
-						// Do a quick check for the existence of the actual ID attribute
-						// to avoid selecting by the name attribute in IE
-						// also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
-						if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
-							oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
-
-						// Do a quick check for node name (where applicable) so
-						// that div#foo searches will be really fast
-						ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
-					} else {
-						// We need to find all descendant elements
-						for ( var i = 0; ret[i]; i++ ) {
-							// Grab the tag name being searched for
-							var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];
-
-							// Handle IE7 being really dumb about <object>s
-							if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
-								tag = "param";
-
-							r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
-						}
-
-						// It's faster to filter by class and be done with it
-						if ( m[1] == "." )
-							r = jQuery.classFilter( r, m[2] );
-
-						// Same with ID filtering
-						if ( m[1] == "#" ) {
-							var tmp = [];
-
-							// Try to find the element with the ID
-							for ( var i = 0; r[i]; i++ )
-								if ( r[i].getAttribute("id") == m[2] ) {
-									tmp = [ r[i] ];
-									break;
-								}
-
-							r = tmp;
-						}
-
-						ret = r;
-					}
-
-					t = t.replace( re2, "" );
-				}
-
-			}
-
-			// If a selector string still exists
-			if ( t ) {
-				// Attempt to filter it
-				var val = jQuery.filter(t,r);
-				ret = r = val.r;
-				t = jQuery.trim(val.t);
-			}
-		}
-
-		// An error occurred with the selector;
-		// just return an empty set instead
-		if ( t )
-			ret = [];
-
-		// Remove the root context
-		if ( ret && context == ret[0] )
-			ret.shift();
-
-		// And combine the results
-		done = jQuery.merge( done, ret );
-
-		return done;
-	},
-
-	classFilter: function(r,m,not){
-		m = " " + m + " ";
-		var tmp = [];
-		for ( var i = 0; r[i]; i++ ) {
-			var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
-			if ( !not && pass || not && !pass )
-				tmp.push( r[i] );
-		}
-		return tmp;
-	},
-
-	filter: function(t,r,not) {
-		var last;
-
-		// Look for common filter expressions
-		while ( t  && t != last ) {
-			last = t;
-
-			var p = jQuery.parse, m;
-
-			for ( var i = 0; p[i]; i++ ) {
-				m = p[i].exec( t );
-
-				if ( m ) {
-					// Remove what we just matched
-					t = t.substring( m[0].length );
-
-					m[2] = m[2].replace(/\\/g, "");
-					break;
-				}
-			}
-
-			if ( !m )
-				break;
-
-			// :not() is a special case that can be optimized by
-			// keeping it out of the expression list
-			if ( m[1] == ":" && m[2] == "not" )
-				r = jQuery.filter(m[3], r, true).r;
-
-			// We can get a big speed boost by filtering by class here
-			else if ( m[1] == "." )
-				r = jQuery.classFilter(r, m[2], not);
-
-			else if ( m[1] == "[" ) {
-				var tmp = [], type = m[3];
-				
-				for ( var i = 0, rl = r.length; i < rl; i++ ) {
-					var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
-					
-					if ( z == null || /href|src|selected/.test(m[2]) )
-						z = jQuery.attr(a,m[2]) || '';
-
-					if ( (type == "" && !!z ||
-						 type == "=" && z == m[5] ||
-						 type == "!=" && z != m[5] ||
-						 type == "^=" && z && !z.indexOf(m[5]) ||
-						 type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
-						 (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
-							tmp.push( a );
-				}
-				
-				r = tmp;
-
-			// We can get a speed boost by handling nth-child here
-			} else if ( m[1] == ":" && m[2] == "nth-child" ) {
-				var merge = {}, tmp = [],
-					test = /(\d*)n\+?(\d*)/.exec(
-						m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
-						!/\D/.test(m[3]) && "n+" + m[3] || m[3]),
-					first = (test[1] || 1) - 0, last = test[2] - 0;
-
-				for ( var i = 0, rl = r.length; i < rl; i++ ) {
-					var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);
-
-					if ( !merge[id] ) {
-						var c = 1;
-
-						for ( var n = parentNode.firstChild; n; n = n.nextSibling )
-							if ( n.nodeType == 1 )
-								n.nodeIndex = c++;
-
-						merge[id] = true;
-					}
-
-					var add = false;
-
-					if ( first == 1 ) {
-						if ( last == 0 || node.nodeIndex == last )
-							add = true;
-					} else if ( (node.nodeIndex + last) % first == 0 )
-						add = true;
-
-					if ( add ^ not )
-						tmp.push( node );
-				}
-
-				r = tmp;
-
-			// Otherwise, find the expression to execute
-			} else {
-				var f = jQuery.expr[m[1]];
-				if ( typeof f != "string" )
-					f = jQuery.expr[m[1]][m[2]];
-
-				// Build a custom macro to enclose it
-				f = eval("false||function(a,i){return " + f + "}");
-
-				// Execute it against the current filter
-				r = jQuery.grep( r, f, not );
-			}
-		}
-
-		// Return an array of filtered elements (r)
-		// and the modified expression string (t)
-		return { r: r, t: t };
-	},
-
-	dir: function( elem, dir ){
-		var matched = [];
-		var cur = elem[dir];
-		while ( cur && cur != document ) {
-			if ( cur.nodeType == 1 )
-				matched.push( cur );
-			cur = cur[dir];
-		}
-		return matched;
-	},
-	
-	nth: function(cur,result,dir,elem){
-		result = result || 1;
-		var num = 0;
-
-		for ( ; cur; cur = cur[dir] )
-			if ( cur.nodeType == 1 && ++num == result )
-				break;
-
-		return cur;
-	},
-	
-	sibling: function( n, elem ) {
-		var r = [];
-
-		for ( ; n; n = n.nextSibling ) {
-			if ( n.nodeType == 1 && (!elem || n != elem) )
-				r.push( n );
-		}
-
-		return r;
-	}
-});
-/*
- * A number of helper functions used for managing events.
- * Many of the ideas behind this code orignated from 
- * Dean Edwards' addEvent library.
- */
-jQuery.event = {
-
-	// Bind an event to an element
-	// Original by Dean Edwards
-	add: function(element, type, handler, data) {
-		// For whatever reason, IE has trouble passing the window object
-		// around, causing it to be cloned in the process
-		if ( jQuery.browser.msie && element.setInterval != undefined )
-			element = window;
-
-		// Make sure that the function being executed has a unique ID
-		if ( !handler.guid )
-			handler.guid = this.guid++;
-			
-		// if data is passed, bind to handler 
-		if( data != undefined ) { 
-        		// Create temporary function pointer to original handler 
-			var fn = handler; 
-
-			// Create unique handler function, wrapped around original handler 
-			handler = function() { 
-				// Pass arguments and context to original handler 
-				return fn.apply(this, arguments); 
-			};
-
-			// Store data in unique handler 
-			handler.data = data;
-
-			// Set the guid of unique handler to the same of original handler, so it can be removed 
-			handler.guid = fn.guid;
-		}
-
-		// Namespaced event handlers
-		var parts = type.split(".");
-		type = parts[0];
-		handler.type = parts[1];
-
-		// Init the element's event structure
-		var events = jQuery.data(element, "events") || jQuery.data(element, "events", {});
-		
-		var handle = jQuery.data(element, "handle", function(){
-			// returned undefined or false
-			var val;
-
-			// Handle the second event of a trigger and when
-			// an event is called after a page has unloaded
-			if ( typeof jQuery == "undefined" || jQuery.event.triggered )
-				return val;
-			
-			val = jQuery.event.handle.apply(element, arguments);
-			
-			return val;
-		});
-
-		// Get the current list of functions bound to this event
-		var handlers = events[type];
-
-		// Init the event handler queue
-		if (!handlers) {
-			handlers = events[type] = {};	
-			
-			// And bind the global event handler to the element
-			if (element.addEventListener)
-				element.addEventListener(type, handle, false);
-			else
-				element.attachEvent("on" + type, handle);
-		}
-
-		// Add the function to the element's handler list
-		handlers[handler.guid] = handler;
-
-		// Keep track of which events have been used, for global triggering
-		this.global[type] = true;
-	},
-
-	guid: 1,
-	global: {},
-
-	// Detach an event or set of events from an element
-	remove: function(element, type, handler) {
-		var events = jQuery.data(element, "events"), ret, index;
-
-		// Namespaced event handlers
-		if ( typeof type == "string" ) {
-			var parts = type.split(".");
-			type = parts[0];
-		}
-
-		if ( events ) {
-			// type is actually an event object here
-			if ( type && type.type ) {
-				handler = type.handler;
-				type = type.type;
-			}
-			
-			if ( !type ) {
-				for ( type in events )
-					this.remove( element, type );
-
-			} else if ( events[type] ) {
-				// remove the given handler for the given type
-				if ( handler )
-					delete events[type][handler.guid];
-				
-				// remove all handlers for the given type
-				else
-					for ( handler in events[type] )
-						// Handle the removal of namespaced events
-						if ( !parts[1] || events[type][handler].type == parts[1] )
-							delete events[type][handler];
-
-				// remove generic event handler if no more handlers exist
-				for ( ret in events[type] ) break;
-				if ( !ret ) {
-					if (element.removeEventListener)
-						element.removeEventListener(type, jQuery.data(element, "handle"), false);
-					else
-						element.detachEvent("on" + type, jQuery.data(element, "handle"));
-					ret = null;
-					delete events[type];
-				}
-			}
-
-			// Remove the expando if it's no longer used
-			for ( ret in events ) break;
-			if ( !ret ) {
-				jQuery.removeData( element, "events" );
-				jQuery.removeData( element, "handle" );
-			}
-		}
-	},
-
-	trigger: function(type, data, element, donative, extra) {
-		// Clone the incoming data, if any
-		data = jQuery.makeArray(data || []);
-
-		// Handle a global trigger
-		if ( !element ) {
-			// Only trigger if we've ever bound an event for it
-			if ( this.global[type] )
-				jQuery("*").add([window, document]).trigger(type, data);
-
-		// Handle triggering a single element
-		} else {
-			var val, ret, fn = jQuery.isFunction( element[ type ] || null ),
-				// Check to see if we need to provide a fake event, or not
-				evt = !data[0] || !data[0].preventDefault;
-			
-			// Pass along a fake event
-			if ( evt )
-				data.unshift( this.fix({ type: type, target: element }) );
-
-			// Enforce the right trigger type
-			data[0].type = type;
-
-			// Trigger the event
-			if ( jQuery.isFunction( jQuery.data(element, "handle") ) )
-				val = jQuery.data(element, "handle").apply( element, data );
-
-			// Handle triggering native .onfoo handlers
-			if ( !fn && element["on"+type] && element["on"+type].apply( element, data ) === false )
-				val = false;
-
-			// Extra functions don't get the custom event object
-			if ( evt )
-				data.shift();
-
-			// Handle triggering of extra function
-			if ( extra && extra.apply( element, data ) === false )
-				val = false;
-
-			// Trigger the native events (except for clicks on links)
-			if ( fn && donative !== false && val !== false && !(jQuery.nodeName(element, 'a') && type == "click") ) {
-				this.triggered = true;
-				element[ type ]();
-			}
-
-			this.triggered = false;
-		}
-
-		return val;
-	},
-
-	handle: function(event) {
-		// returned undefined or false
-		var val;
-
-		// Empty object is for triggered events with no data
-		event = jQuery.event.fix( event || window.event || {} ); 
-
-		// Namespaced event handlers
-		var parts = event.type.split(".");
-		event.type = parts[0];
-
-		var c = jQuery.data(this, "events") && jQuery.data(this, "events")[event.type], args = Array.prototype.slice.call( arguments, 1 );
-		args.unshift( event );
-
-		for ( var j in c ) {
-			// Pass in a reference to the handler function itself
-			// So that we can later remove it
-			args[0].handler = c[j];
-			args[0].data = c[j].data;
-
-			// Filter the functions by class
-			if ( !parts[1] || c[j].type == parts[1] ) {
-				var tmp = c[j].apply( this, args );
-
-				if ( val !== false )
-					val = tmp;
-
-				if ( tmp === false ) {
-					event.preventDefault();
-					event.stopPropagation();
-				}
-			}
-		}
-
-		// Clean up added properties in IE to prevent memory leak
-		if (jQuery.browser.msie)
-			event.target = event.preventDefault = event.stopPropagation =
-				event.handler = event.data = null;
-
-		return val;
-	},
-
-	fix: function(event) {
-		// store a copy of the original event object 
-		// and clone to set read-only properties
-		var originalEvent = event;
-		event = jQuery.extend({}, originalEvent);
-		
-		// add preventDefault and stopPropagation since 
-		// they will not work on the clone
-		event.preventDefault = function() {
-			// if preventDefault exists run it on the original event
-			if (originalEvent.preventDefault)
-				originalEvent.preventDefault();
-			// otherwise set the returnValue property of the original event to false (IE)
-			originalEvent.returnValue = false;
-		};
-		event.stopPropagation = function() {
-			// if stopPropagation exists run it on the original event
-			if (originalEvent.stopPropagation)
-				originalEvent.stopPropagation();
-			// otherwise set the cancelBubble property of the original event to true (IE)
-			originalEvent.cancelBubble = true;
-		};
-		
-		// Fix target property, if necessary
-		if ( !event.target && event.srcElement )
-			event.target = event.srcElement;
-				
-		// check if target is a textnode (safari)
-		if (jQuery.browser.safari && event.target.nodeType == 3)
-			event.target = originalEvent.target.parentNode;
-
-		// Add relatedTarget, if necessary
-		if ( !event.relatedTarget && event.fromElement )
-			event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
-
-		// Calculate pageX/Y if missing and clientX/Y available
-		if ( event.pageX == null && event.clientX != null ) {
-			var e = document.documentElement, b = document.body;
-			event.pageX = event.clientX + (e && e.scrollLeft || b.scrollLeft || 0);
-			event.pageY = event.clientY + (e && e.scrollTop || b.scrollTop || 0);
-		}
-			
-		// Add which for key events
-		if ( !event.which && (event.charCode || event.keyCode) )
-			event.which = event.charCode || event.keyCode;
-		
-		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
-		if ( !event.metaKey && event.ctrlKey )
-			event.metaKey = event.ctrlKey;
-
-		// Add which for click: 1 == left; 2 == middle; 3 == right
-		// Note: button is not normalized, so don't use it
-		if ( !event.which && event.button )
-			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
-			
-		return event;
-	}
-};
-
-jQuery.fn.extend({
-	bind: function( type, data, fn ) {
-		return type == "unload" ? this.one(type, data, fn) : this.each(function(){
-			jQuery.event.add( this, type, fn || data, fn && data );
-		});
-	},
-	
-	one: function( type, data, fn ) {
-		return this.each(function(){
-			jQuery.event.add( this, type, function(event) {
-				jQuery(this).unbind(event);
-				return (fn || data).apply( this, arguments);
-			}, fn && data);
-		});
-	},
-
-	unbind: function( type, fn ) {
-		return this.each(function(){
-			jQuery.event.remove( this, type, fn );
-		});
-	},
-
-	trigger: function( type, data, fn ) {
-		return this.each(function(){
-			jQuery.event.trigger( type, data, this, true, fn );
-		});
-	},
-
-	triggerHandler: function( type, data, fn ) {
-		if ( this[0] )
-			return jQuery.event.trigger( type, data, this[0], false, fn );
-	},
-
-	toggle: function() {
-		// Save reference to arguments for access in closure
-		var a = arguments;
-
-		return this.click(function(e) {
-			// Figure out which function to execute
-			this.lastToggle = 0 == this.lastToggle ? 1 : 0;
-			
-			// Make sure that clicks stop
-			e.preventDefault();
-			
-			// and execute the function
-			return a[this.lastToggle].apply( this, [e] ) || false;
-		});
-	},
-
-	hover: function(f,g) {
-		
-		// A private function for handling mouse 'hovering'
-		function handleHover(e) {
-			// Check if mouse(over|out) are still within the same parent element
-			var p = e.relatedTarget;
-	
-			// Traverse up the tree
-			while ( p && p != this ) try { p = p.parentNode; } catch(e) { p = this; };
-			
-			// If we actually just moused on to a sub-element, ignore it
-			if ( p == this ) return false;
-			
-			// Execute the right function
-			return (e.type == "mouseover" ? f : g).apply(this, [e]);
-		}
-		
-		// Bind the function to the two event listeners
-		return this.mouseover(handleHover).mouseout(handleHover);
-	},
-	
-	ready: function(f) {
-		// Attach the listeners
-		bindReady();
-
-		// If the DOM is already ready
-		if ( jQuery.isReady )
-			// Execute the function immediately
-			f.apply( document, [jQuery] );
-			
-		// Otherwise, remember the function for later
-		else
-			// Add the function to the wait list
-			jQuery.readyList.push( function() { return f.apply(this, [jQuery]); } );
-	
-		return this;
-	}
-});
-
-jQuery.extend({
-	/*
-	 * All the code that makes DOM Ready work nicely.
-	 */
-	isReady: false,
-	readyList: [],
-	
-	// Handle when the DOM is ready
-	ready: function() {
-		// Make sure that the DOM is not already loaded
-		if ( !jQuery.isReady ) {
-			// Remember that the DOM is ready
-			jQuery.isReady = true;
-			
-			// If there are functions bound, to execute
-			if ( jQuery.readyList ) {
-				// Execute all of them
-				jQuery.each( jQuery.readyList, function(){
-					this.apply( document );
-				});
-				
-				// Reset the list of functions
-				jQuery.readyList = null;
-			}
-			// Remove event listener to avoid memory leak
-			if ( jQuery.browser.mozilla || jQuery.browser.opera )
-				document.removeEventListener( "DOMContentLoaded", jQuery.ready, false );
-			
-			// Remove script element used by IE hack
-			if( !window.frames.length ) // don't remove if frames are present (#1187)
-				jQuery(window).load(function(){ jQuery("#__ie_init").remove(); });
-		}
-	}
-});
-
-jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
-	"mousedown,mouseup,mousemove,mouseover,mouseout,change,select," + 
-	"submit,keydown,keypress,keyup,error").split(","), function(i,o){
-	
-	// Handle event binding
-	jQuery.fn[o] = function(f){
-		return f ? this.bind(o, f) : this.trigger(o);
-	};
-});
-
-var readyBound = false;
-
-function bindReady(){
-	if ( readyBound ) return;
-	readyBound = true;
-
-	// If Mozilla is used
-	if ( jQuery.browser.mozilla || jQuery.browser.opera )
-		// Use the handy event callback
-		document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
-	
-	// If IE is used, use the excellent hack by Matthias Miller
-	// http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited
-	else if ( jQuery.browser.msie ) {
-	
-		// Only works if you document.write() it
-		document.write("<scr" + "ipt id=__ie_init defer=true " + 
-			"src=//:><\/script>");
-	
-		// Use the defer script hack
-		var script = document.getElementById("__ie_init");
-		
-		// script does not exist if jQuery is loaded dynamically
-		if ( script ) 
-			script.onreadystatechange = function() {
-				if ( this.readyState != "complete" ) return;
-				jQuery.ready();
-			};
-	
-		// Clear from memory
-		script = null;
-	
-	// If Safari  is used
-	} else if ( jQuery.browser.safari )
-		// Continually check to see if the document.readyState is valid
-		jQuery.safariTimer = setInterval(function(){
-			// loaded and complete are both valid states
-			if ( document.readyState == "loaded" || 
-				document.readyState == "complete" ) {
-	
-				// If either one are found, remove the timer
-				clearInterval( jQuery.safariTimer );
-				jQuery.safariTimer = null;
-	
-				// and execute any waiting functions
-				jQuery.ready();
-			}
-		}, 10); 
-
-	// A fallback to window.onload, that will always work
-	jQuery.event.add( window, "load", jQuery.ready );
-}
-jQuery.fn.extend({
-	load: function( url, params, callback ) {
-		if ( jQuery.isFunction( url ) )
-			return this.bind("load", url);
-
-		var off = url.indexOf(" ");
-		if ( off >= 0 ) {
-			var selector = url.slice(off, url.length);
-			url = url.slice(0, off);
-		}
-
-		callback = callback || function(){};
-
-		// Default to a GET request
-		var type = "GET";
-
-		// If the second parameter was provided
-		if ( params )
-			// If it's a function
-			if ( jQuery.isFunction( params ) ) {
-				// We assume that it's the callback
-				callback = params;
-				params = null;
-
-			// Otherwise, build a param string
-			} else {
-				params = jQuery.param( params );
-				type = "POST";
-			}
-
-		var self = this;
-
-		// Request the remote document
-		jQuery.ajax({
-			url: url,
-			type: type,
-			data: params,
-			complete: function(res, status){
-				// If successful, inject the HTML into all the matched elements
-				if ( status == "success" || status == "notmodified" )
-					// See if a selector was specified
-					self.html( selector ?
-						// Create a dummy div to hold the results
-						jQuery("<div/>")
-							// inject the contents of the document in, removing the scripts
-							// to avoid any 'Permission Denied' errors in IE
-							.append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
-
-							// Locate the specified elements
-							.find(selector) :
-
-						// If not, just inject the full result
-						res.responseText );
-
-				// Add delay to account for Safari's delay in globalEval
-				setTimeout(function(){
-					self.each( callback, [res.responseText, status, res] );
-				}, 13);
-			}
-		});
-		return this;
-	},
-
-	serialize: function() {
-		return jQuery.param(this.serializeArray());
-	},
-	serializeArray: function() {
-		return this.map(function(){
-			return jQuery.nodeName(this, "form") ?
-				jQuery.makeArray(this.elements) : this;
-		})
-		.filter(function(){
-			return this.name && !this.disabled && 
-				(this.checked || /select|textarea/i.test(this.nodeName) || 
-					/text|hidden|password/i.test(this.type));
-		})
-		.map(function(i, elem){
-			var val = jQuery(this).val();
-			return val == null ? null :
-				val.constructor == Array ?
-					jQuery.map( val, function(val, i){
-						return {name: elem.name, value: val};
-					}) :
-					{name: elem.name, value: val};
-		}).get();
-	}
-});
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
-	jQuery.fn[o] = function(f){
-		return this.bind(o, f);
-	};
-});
-
-var jsc = (new Date).getTime();
-
-jQuery.extend({
-	get: function( url, data, callback, type ) {
-		// shift arguments if data argument was ommited
-		if ( jQuery.isFunction( data ) ) {
-			callback = data;
-			data = null;
-		}
-		
-		return jQuery.ajax({
-			type: "GET",
-			url: url,
-			data: data,
-			success: callback,
-			dataType: type
-		});
-	},
-
-	getScript: function( url, callback ) {
-		return jQuery.get(url, null, callback, "script");
-	},
-
-	getJSON: function( url, data, callback ) {
-		return jQuery.get(url, data, callback, "json");
-	},
-
-	post: function( url, data, callback, type ) {
-		if ( jQuery.isFunction( data ) ) {
-			callback = data;
-			data = {};
-		}
-
-		return jQuery.ajax({
-			type: "POST",
-			url: url,
-			data: data,
-			success: callback,
-			dataType: type
-		});
-	},
-
-	ajaxSetup: function( settings ) {
-		jQuery.extend( jQuery.ajaxSettings, settings );
-	},
-
-	ajaxSettings: {
-		global: true,
-		type: "GET",
-		timeout: 0,
-		contentType: "application/x-www-form-urlencoded",
-		processData: true,
-		async: true,
-		data: null
-	},
-	
-	// Last-Modified header cache for next request
-	lastModified: {},
-
-	ajax: function( s ) {
-		var jsonp, jsre = /=(\?|%3F)/g, status, data;
-
-		// Extend the settings, but re-extend 's' so that it can be
-		// checked again later (in the test suite, specifically)
-		s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
-
-		// convert data if not already a string
-		if ( s.data && s.processData && typeof s.data != "string" )
-			s.data = jQuery.param(s.data);
-
-		// Handle JSONP Parameter Callbacks
-		if ( s.dataType == "jsonp" ) {
-			if ( s.type.toLowerCase() == "get" ) {
-				if ( !s.url.match(jsre) )
-					s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
-			} else if ( !s.data || !s.data.match(jsre) )
-				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
-			s.dataType = "json";
-		}
-
-		// Build temporary JSONP function
-		if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
-			jsonp = "jsonp" + jsc++;
-
-			// Replace the =? sequence both in the query string and the data
-			if ( s.data )
-				s.data = s.data.replace(jsre, "=" + jsonp);
-			s.url = s.url.replace(jsre, "=" + jsonp);
-
-			// We need to make sure
-			// that a JSONP style response is executed properly
-			s.dataType = "script";
-
-			// Handle JSONP-style loading
-			window[ jsonp ] = function(tmp){
-				data = tmp;
-				success();
-				complete();
-				// Garbage collect
-				window[ jsonp ] = undefined;
-				try{ delete window[ jsonp ]; } catch(e){}
-			};
-		}
-
-		if ( s.dataType == "script" && s.cache == null )
-			s.cache = false;
-
-		if ( s.cache === false && s.type.toLowerCase() == "get" )
-			s.url += (s.url.match(/\?/) ? "&" : "?") + "_=" + (new Date()).getTime();
-
-		// If data is available, append data to url for get requests
-		if ( s.data && s.type.toLowerCase() == "get" ) {
-			s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
-
-			// IE likes to send both get and post data, prevent this
-			s.data = null;
-		}
-
-		// Watch for a new set of requests
-		if ( s.global && ! jQuery.active++ )
-			jQuery.event.trigger( "ajaxStart" );
-
-		// If we're requesting a remote document
-		// and trying to load JSON or Script
-		if ( !s.url.indexOf("http") && s.dataType == "script" ) {
-			var head = document.getElementsByTagName("head")[0];
-			var script = document.createElement("script");
-			script.src = s.url;
-
-			// Handle Script loading
-			if ( !jsonp && (s.success || s.complete) ) {
-				var done = false;
-
-				// Attach handlers for all browsers
-				script.onload = script.onreadystatechange = function(){
-					if ( !done && (!this.readyState || 
-							this.readyState == "loaded" || this.readyState == "complete") ) {
-						done = true;
-						success();
-						complete();
-						head.removeChild( script );
-					}
-				};
-			}
-
-			head.appendChild(script);
-
-			// We handle everything using the script element injection
-			return;
-		}
-
-		var requestDone = false;
-
-		// Create the request object; Microsoft failed to properly
-		// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
-		var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
-
-		// Open the socket
-		xml.open(s.type, s.url, s.async);
-
-		// Set the correct header, if data is being sent
-		if ( s.data )
-			xml.setRequestHeader("Content-Type", s.contentType);
-
-		// Set the If-Modified-Since header, if ifModified mode.
-		if ( s.ifModified )
-			xml.setRequestHeader("If-Modified-Since",
-				jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
-
-		// Set header so the called script knows that it's an XMLHttpRequest
-		xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
-
-		// Allow custom headers/mimetypes
-		if ( s.beforeSend )
-			s.beforeSend(xml);
-			
-		if ( s.global )
-		    jQuery.event.trigger("ajaxSend", [xml, s]);
-
-		// Wait for a response to come back
-		var onreadystatechange = function(isTimeout){
-			// The transfer is complete and the data is available, or the request timed out
-			if ( !requestDone && xml && (xml.readyState == 4 || isTimeout == "timeout") ) {
-				requestDone = true;
-				
-				// clear poll interval
-				if (ival) {
-					clearInterval(ival);
-					ival = null;
-				}
-				
-				status = isTimeout == "timeout" && "timeout" ||
-					!jQuery.httpSuccess( xml ) && "error" ||
-					s.ifModified && jQuery.httpNotModified( xml, s.url ) && "notmodified" ||
-					"success";
-
-				if ( status == "success" ) {
-					// Watch for, and catch, XML document parse errors
-					try {
-						// process the data (runs the xml through httpData regardless of callback)
-						data = jQuery.httpData( xml, s.dataType );
-					} catch(e) {
-						status = "parsererror";
-					}
-				}
-
-				// Make sure that the request was successful or notmodified
-				if ( status == "success" ) {
-					// Cache Last-Modified header, if ifModified mode.
-					var modRes;
-					try {
-						modRes = xml.getResponseHeader("Last-Modified");
-					} catch(e) {} // swallow exception thrown by FF if header is not available
-	
-					if ( s.ifModified && modRes )
-						jQuery.lastModified[s.url] = modRes;
-
-					// JSONP handles its own success callback
-					if ( !jsonp )
-						success();	
-				} else
-					jQuery.handleError(s, xml, status);
-
-				// Fire the complete handlers
-				complete();
-
-				// Stop memory leaks
-				if ( s.async )
-					xml = null;
-			}
-		};
-		
-		if ( s.async ) {
-			// don't attach the handler to the request, just poll it instead
-			var ival = setInterval(onreadystatechange, 13); 
-
-			// Timeout checker
-			if ( s.timeout > 0 )
-				setTimeout(function(){
-					// Check to see if the request is still happening
-					if ( xml ) {
-						// Cancel the request
-						xml.abort();
-	
-						if( !requestDone )
-							onreadystatechange( "timeout" );
-					}
-				}, s.timeout);
-		}
-			
-		// Send the data
-		try {
-			xml.send(s.data);
-		} catch(e) {
-			jQuery.handleError(s, xml, null, e);
-		}
-		
-		// firefox 1.5 doesn't fire statechange for sync requests
-		if ( !s.async )
-			onreadystatechange();
-		
-		// return XMLHttpRequest to allow aborting the request etc.
-		return xml;
-
-		function success(){
-			// If a local callback was specified, fire it and pass it the data
-			if ( s.success )
-				s.success( data, status );
-
-			// Fire the global callback
-			if ( s.global )
-				jQuery.event.trigger( "ajaxSuccess", [xml, s] );
-		}
-
-		function complete(){
-			// Process result
-			if ( s.complete )
-				s.complete(xml, status);
-
-			// The request was completed
-			if ( s.global )
-				jQuery.event.trigger( "ajaxComplete", [xml, s] );
-
-			// Handle the global AJAX counter
-			if ( s.global && ! --jQuery.active )
-				jQuery.event.trigger( "ajaxStop" );
-		}
-	},
-
-	handleError: function( s, xml, status, e ) {
-		// If a local callback was specified, fire it
-		if ( s.error ) s.error( xml, status, e );
-
-		// Fire the global callback
-		if ( s.global )
-			jQuery.event.trigger( "ajaxError", [xml, s, e] );
-	},
-
-	// Counter for holding the number of active queries
-	active: 0,
-
-	// Determines if an XMLHttpRequest was successful or not
-	httpSuccess: function( r ) {
-		try {
-			return !r.status && location.protocol == "file:" ||
-				( r.status >= 200 && r.status < 300 ) || r.status == 304 ||
-				jQuery.browser.safari && r.status == undefined;
-		} catch(e){}
-		return false;
-	},
-
-	// Determines if an XMLHttpRequest returns NotModified
-	httpNotModified: function( xml, url ) {
-		try {
-			var xmlRes = xml.getResponseHeader("Last-Modified");
-
-			// Firefox always returns 200. check Last-Modified date
-			return xml.status == 304 || xmlRes == jQuery.lastModified[url] ||
-				jQuery.browser.safari && xml.status == undefined;
-		} catch(e){}
-		return false;
-	},
-
-	httpData: function( r, type ) {
-		var ct = r.getResponseHeader("content-type");
-		var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0;
-		var data = xml ? r.responseXML : r.responseText;
-
-		if ( xml && data.documentElement.tagName == "parsererror" )
-			throw "parsererror";
-
-		// If the type is "script", eval it in global context
-		if ( type == "script" )
-			jQuery.globalEval( data );
-
-		// Get the JavaScript object, if JSON is used.
-		if ( type == "json" )
-			data = eval("(" + data + ")");
-
-		return data;
-	},
-
-	// Serialize an array of form elements or a set of
-	// key/values into a query string
-	param: function( a ) {
-		var s = [];
-
-		// If an array was passed in, assume that it is an array
-		// of form elements
-		if ( a.constructor == Array || a.jquery )
-			// Serialize the form elements
-			jQuery.each( a, function(){
-				s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) );
-			});
-
-		// Otherwise, assume that it's an object of key/value pairs
-		else
-			// Serialize the key/values
-			for ( var j in a )
-				// If the value is an array then the key names need to be repeated
-				if ( a[j] && a[j].constructor == Array )
-					jQuery.each( a[j], function(){
-						s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) );
-					});
-				else
-					s.push( encodeURIComponent(j) + "=" + encodeURIComponent( a[j] ) );
-
-		// Return the resulting serialization
-		return s.join("&").replace(/%20/g, "+");
-	}
-
-});
-jQuery.fn.extend({
-	show: function(speed,callback){
-		return speed ?
-			this.animate({
-				height: "show", width: "show", opacity: "show"
-			}, speed, callback) :
-			
-			this.filter(":hidden").each(function(){
-				this.style.display = this.oldblock ? this.oldblock : "";
-				if ( jQuery.css(this,"display") == "none" )
-					this.style.display = "block";
-			}).end();
-	},
-	
-	hide: function(speed,callback){
-		return speed ?
-			this.animate({
-				height: "hide", width: "hide", opacity: "hide"
-			}, speed, callback) :
-			
-			this.filter(":visible").each(function(){
-				this.oldblock = this.oldblock || jQuery.css(this,"display");
-				if ( this.oldblock == "none" )
-					this.oldblock = "block";
-				this.style.display = "none";
-			}).end();
-	},
-
-	// Save the old toggle function
-	_toggle: jQuery.fn.toggle,
-	
-	toggle: function( fn, fn2 ){
-		return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
-			this._toggle( fn, fn2 ) :
-			fn ?
-				this.animate({
-					height: "toggle", width: "toggle", opacity: "toggle"
-				}, fn, fn2) :
-				this.each(function(){
-					jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
-				});
-	},
-	
-	slideDown: function(speed,callback){
-		return this.animate({height: "show"}, speed, callback);
-	},
-	
-	slideUp: function(speed,callback){
-		return this.animate({height: "hide"}, speed, callback);
-	},
-
-	slideToggle: function(speed, callback){
-		return this.animate({height: "toggle"}, speed, callback);
-	},
-	
-	fadeIn: function(speed, callback){
-		return this.animate({opacity: "show"}, speed, callback);
-	},
-	
-	fadeOut: function(speed, callback){
-		return this.animate({opacity: "hide"}, speed, callback);
-	},
-	
-	fadeTo: function(speed,to,callback){
-		return this.animate({opacity: to}, speed, callback);
-	},
-	
-	animate: function( prop, speed, easing, callback ) {
-		var opt = jQuery.speed(speed, easing, callback);
-
-		return this[ opt.queue === false ? "each" : "queue" ](function(){
-			opt = jQuery.extend({}, opt);
-			var hidden = jQuery(this).is(":hidden"), self = this;
-			
-			for ( var p in prop ) {
-				if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
-					return jQuery.isFunction(opt.complete) && opt.complete.apply(this);
-
-				if ( p == "height" || p == "width" ) {
-					// Store display property
-					opt.display = jQuery.css(this, "display");
-
-					// Make sure that nothing sneaks out
-					opt.overflow = this.style.overflow;
-				}
-			}
-
-			if ( opt.overflow != null )
-				this.style.overflow = "hidden";
-
-			opt.curAnim = jQuery.extend({}, prop);
-			
-			jQuery.each( prop, function(name, val){
-				var e = new jQuery.fx( self, opt, name );
-
-				if ( /toggle|show|hide/.test(val) )
-					e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
-				else {
-					var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
-						start = e.cur(true) || 0;
-
-					if ( parts ) {
-						var end = parseFloat(parts[2]),
-							unit = parts[3] || "px";
-
-						// We need to compute starting value
-						if ( unit != "px" ) {
-							self.style[ name ] = (end || 1) + unit;
-							start = ((end || 1) / e.cur(true)) * start;
-							self.style[ name ] = start + unit;
-						}
-
-						// If a +=/-= token was provided, we're doing a relative animation
-						if ( parts[1] )
-							end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
-
-						e.custom( start, end, unit );
-					} else
-						e.custom( start, val, "" );
-				}
-			});
-
-			// For JS strict compliance
-			return true;
-		});
-	},
-	
-	queue: function(type, fn){
-		if ( jQuery.isFunction(type) ) {
-			fn = type;
-			type = "fx";
-		}
-
-		if ( !type || (typeof type == "string" && !fn) )
-			return queue( this[0], type );
-
-		return this.each(function(){
-			if ( fn.constructor == Array )
-				queue(this, type, fn);
-			else {
-				queue(this, type).push( fn );
-			
-				if ( queue(this, type).length == 1 )
-					fn.apply(this);
-			}
-		});
-	},
-
-	stop: function(){
-		var timers = jQuery.timers;
-
-		return this.each(function(){
-			for ( var i = 0; i < timers.length; i++ )
-				if ( timers[i].elem == this )
-					timers.splice(i--, 1);
-		}).dequeue();
-	}
-
-});
-
-var queue = function( elem, type, array ) {
-	if ( !elem )
-		return;
-
-	var q = jQuery.data( elem, type + "queue" );
-
-	if ( !q || array )
-		q = jQuery.data( elem, type + "queue", 
-			array ? jQuery.makeArray(array) : [] );
-
-	return q;
-};
-
-jQuery.fn.dequeue = function(type){
-	type = type || "fx";
-
-	return this.each(function(){
-		var q = queue(this, type);
-
-		q.shift();
-
-		if ( q.length )
-			q[0].apply( this );
-	});
-};
-
-jQuery.extend({
-	
-	speed: function(speed, easing, fn) {
-		var opt = speed && speed.constructor == Object ? speed : {
-			complete: fn || !fn && easing || 
-				jQuery.isFunction( speed ) && speed,
-			duration: speed,
-			easing: fn && easing || easing && easing.constructor != Function && easing
-		};
-
-		opt.duration = (opt.duration && opt.duration.constructor == Number ? 
-			opt.duration : 
-			{ slow: 600, fast: 200 }[opt.duration]) || 400;
-	
-		// Queueing
-		opt.old = opt.complete;
-		opt.complete = function(){
-			jQuery(this).dequeue();
-			if ( jQuery.isFunction( opt.old ) )
-				opt.old.apply( this );
-		};
-	
-		return opt;
-	},
-	
-	easing: {
-		linear: function( p, n, firstNum, diff ) {
-			return firstNum + diff * p;
-		},
-		swing: function( p, n, firstNum, diff ) {
-			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
-		}
-	},
-	
-	timers: [],
-
-	fx: function( elem, options, prop ){
-		this.options = options;
-		this.elem = elem;
-		this.prop = prop;
-
-		if ( !options.orig )
-			options.orig = {};
-	}
-
-});
-
-jQuery.fx.prototype = {
-
-	// Simple function for setting a style value
-	update: function(){
-		if ( this.options.step )
-			this.options.step.apply( this.elem, [ this.now, this ] );
-
-		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
-
-		// Set display property to block for height/width animations
-		if ( this.prop == "height" || this.prop == "width" )
-			this.elem.style.display = "block";
-	},
-
-	// Get the current size
-	cur: function(force){
-		if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null )
-			return this.elem[ this.prop ];
-
-		var r = parseFloat(jQuery.curCSS(this.elem, this.prop, force));
-		return r && r > -10000 ? r : parseFloat(jQuery.css(this.elem, this.prop)) || 0;
-	},
-
-	// Start an animation from one number to another
-	custom: function(from, to, unit){
-		this.startTime = (new Date()).getTime();
-		this.start = from;
-		this.end = to;
-		this.unit = unit || this.unit || "px";
-		this.now = this.start;
-		this.pos = this.state = 0;
-		this.update();
-
-		var self = this;
-		function t(){
-			return self.step();
-		}
-
-		t.elem = this.elem;
-
-		jQuery.timers.push(t);
-
-		if ( jQuery.timers.length == 1 ) {
-			var timer = setInterval(function(){
-				var timers = jQuery.timers;
-				
-				for ( var i = 0; i < timers.length; i++ )
-					if ( !timers[i]() )
-						timers.splice(i--, 1);
-
-				if ( !timers.length )
-					clearInterval( timer );
-			}, 13);
-		}
-	},
-
-	// Simple 'show' function
-	show: function(){
-		// Remember where we started, so that we can go back to it later
-		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
-		this.options.show = true;
-
-		// Begin the animation
-		this.custom(0, this.cur());
-
-		// Make sure that we start at a small width/height to avoid any
-		// flash of content
-		if ( this.prop == "width" || this.prop == "height" )
-			this.elem.style[this.prop] = "1px";
-		
-		// Start by showing the element
-		jQuery(this.elem).show();
-	},
-
-	// Simple 'hide' function
-	hide: function(){
-		// Remember where we started, so that we can go back to it later
-		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
-		this.options.hide = true;
-
-		// Begin the animation
-		this.custom(this.cur(), 0);
-	},
-
-	// Each step of an animation
-	step: function(){
-		var t = (new Date()).getTime();
-
-		if ( t > this.options.duration + this.startTime ) {
-			this.now = this.end;
-			this.pos = this.state = 1;
-			this.update();
-
-			this.options.curAnim[ this.prop ] = true;
-
-			var done = true;
-			for ( var i in this.options.curAnim )
-				if ( this.options.curAnim[i] !== true )
-					done = false;
-
-			if ( done ) {
-				if ( this.options.display != null ) {
-					// Reset the overflow
-					this.elem.style.overflow = this.options.overflow;
-				
-					// Reset the display
-					this.elem.style.display = this.options.display;
-					if ( jQuery.css(this.elem, "display") == "none" )
-						this.elem.style.display = "block";
-				}
-
-				// Hide the element if the "hide" operation was done
-				if ( this.options.hide )
-					this.elem.style.display = "none";
-
-				// Reset the properties, if the item has been hidden or shown
-				if ( this.options.hide || this.options.show )
-					for ( var p in this.options.curAnim )
-						jQuery.attr(this.elem.style, p, this.options.orig[p]);
-			}
-
-			// If a callback was provided, execute it
-			if ( done && jQuery.isFunction( this.options.complete ) )
-				// Execute the complete function
-				this.options.complete.apply( this.elem );
-
-			return false;
-		} else {
-			var n = t - this.startTime;
-			this.state = n / this.options.duration;
-
-			// Perform the easing function, defaults to swing
-			this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
-			this.now = this.start + ((this.end - this.start) * this.pos);
-
-			// Perform the next step of the animation
-			this.update();
-		}
-
-		return true;
-	}
-
-};
-
-jQuery.fx.step = {
-	scrollLeft: function(fx){
-		fx.elem.scrollLeft = fx.now;
-	},
-
-	scrollTop: function(fx){
-		fx.elem.scrollTop = fx.now;
-	},
-
-	opacity: function(fx){
-		jQuery.attr(fx.elem.style, "opacity", fx.now);
-	},
-
-	_default: function(fx){
-		fx.elem.style[ fx.prop ] = fx.now + fx.unit;
-	}
-};
-// The Offset Method
-// Originally By Brandon Aaron, part of the Dimension Plugin
-// http://jquery.com/plugins/project/dimensions
-jQuery.fn.offset = function() {
-	var left = 0, top = 0, elem = this[0], results;
-	
-	if ( elem ) with ( jQuery.browser ) {
-		var	absolute     = jQuery.css(elem, "position") == "absolute", 
-		    parent       = elem.parentNode, 
-		    offsetParent = elem.offsetParent, 
-		    doc          = elem.ownerDocument,
-		    safari2      = safari && parseInt(version) < 522;
-	
-		// Use getBoundingClientRect if available
-		if ( elem.getBoundingClientRect ) {
-			box = elem.getBoundingClientRect();
-		
-			// Add the document scroll offsets
-			add(
-				box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
-				box.top  + Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop)
-			);
-		
-			// IE adds the HTML element's border, by default it is medium which is 2px
-			// IE 6 and IE 7 quirks mode the border width is overwritable by the following css html { border: 0; }
-			// IE 7 standards mode, the border is always 2px
-			if ( msie ) {
-				var border = jQuery("html").css("borderWidth");
-				border = (border == "medium" || jQuery.boxModel && parseInt(version) >= 7) && 2 || border;
-				add( -border, -border );
-			}
-	
-		// Otherwise loop through the offsetParents and parentNodes
-		} else {
-		
-			// Initial element offsets
-			add( elem.offsetLeft, elem.offsetTop );
-		
-			// Get parent offsets
-			while ( offsetParent ) {
-				// Add offsetParent offsets
-				add( offsetParent.offsetLeft, offsetParent.offsetTop );
-			
-				// Mozilla and Safari > 2 does not include the border on offset parents
-				// However Mozilla adds the border for table cells
-				if ( mozilla && /^t[d|h]$/i.test(parent.tagName) || !safari2 )
-					border( offsetParent );
-				
-				// Safari <= 2 doubles body offsets with an absolutely positioned element or parent
-				if ( safari2 && !absolute && jQuery.css(offsetParent, "position") == "absolute" )
-					absolute = true;
-			
-				// Get next offsetParent
-				offsetParent = offsetParent.offsetParent;
-			}
-		
-			// Get parent scroll offsets
-			while ( parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
-				// Work around opera inline/table scrollLeft/Top bug
-				if ( !/^inline|table-row.*$/i.test(jQuery.css(parent, "display")) )
-					// Subtract parent scroll offsets
-					add( -parent.scrollLeft, -parent.scrollTop );
-			
-				// Mozilla does not add the border for a parent that has overflow != visible
-				if ( mozilla && jQuery.css(parent, "overflow") != "visible" )
-					border( parent );
-			
-				// Get next parent
-				parent = parent.parentNode;
-			}
-		
-			// Safari doubles body offsets with an absolutely positioned element or parent
-			if ( safari2 && absolute )
-				add( -doc.body.offsetLeft, -doc.body.offsetTop );
-		}
-
-		// Return an object with top and left properties
-		results = { top: top, left: left };
-	}
-
-	return results;
-
-	function border(elem) {
-		add( jQuery.css(elem, "borderLeftWidth"), jQuery.css(elem, "borderTopWidth") );
-	}
-
-	function add(l, t) {
-		left += parseInt(l) || 0;
-		top += parseInt(t) || 0;
-	}
-};
-})();
--- a/web/support/jquery-min.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
- * jQuery 1.2.1 - New Wave Javascript
- *
- * Copyright (c) 2007 John Resig (jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
- * $Rev: 3353 $
- */
-(function(){if(typeof jQuery!="undefined")var _jQuery=jQuery;var jQuery=window.jQuery=function(selector,context){return this instanceof jQuery?this.init(selector,context):new jQuery(selector,context);};if(typeof $!="undefined")var _$=$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(typeof selector=="string"){var m=quickExpr.exec(selector);if(m&&(m[1]||!context)){if(m[1])selector=jQuery.clean([m[1]],context);else{var tmp=document.getElementById(m[3]);if(tmp)if(tmp.id!=m[3])return jQuery().find(selector);else{this[0]=tmp;this.length=1;return this;}else
-selector=[];}}else
-return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.1",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(a){var ret=jQuery(a);ret.prevObject=this;return ret;},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this;},each:function(fn,args){return jQuery.each(this,fn,args);},index:function(obj){var pos=-1;this.each(function(i){if(this==obj)pos=i;});return pos;},attr:function(key,value,type){var obj=key;if(key.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],key)||undefined;else{obj={};obj[key]=value;}return this.each(function(index){for(var prop in obj)jQuery.attr(type?this.style:this,prop,jQuery.prop(this,obj[prop],type,index,prop));});},css:function(key,value){return this.attr(key,value,"curCSS");},text:function(e){if(typeof e!="object"&&e!=null)return this.empty().append(document.createTextNode(e));var t="";jQuery.each(e||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)t+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return t;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,1,function(a){this.appendChild(a);});},prepend:function(){return this.domManip(arguments,true,-1,function(a){this.insertBefore(a,this.firstChild);});},before:function(){return this.domManip(arguments,false,1,function(a){this.parentNode.insertBefore(a,this);});},after:function(){return this.domManip(arguments,false,-1,function(a){this.parentNode.insertBefore(a,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(t){var data=jQuery.map(this,function(a){return jQuery.find(t,a);});return this.pushStack(/[^+>] [^+>]/.test(t)||t.indexOf("..")>-1?jQuery.unique(data):data);},clone:function(events){var ret=this.map(function(){return this.outerHTML?jQuery(this.outerHTML)[0]:this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(t){return this.pushStack(jQuery.isFunction(t)&&jQuery.grep(this,function(el,index){return t.apply(el,[index]);})||jQuery.multiFilter(t,this));},not:function(t){return this.pushStack(t.constructor==String&&jQuery.multiFilter(t,this,true)||jQuery.grep(this,function(a){return(t.constructor==Array||t.jquery)?jQuery.inArray(a,t)<0:a!=t;}));},add:function(t){return this.pushStack(jQuery.merge(this.get(),t.constructor==String?jQuery(t).get():t.length!=undefined&&(!t.nodeName||jQuery.nodeName(t,"form"))?t:[t]));},is:function(expr){return expr?jQuery.multiFilter(expr,this).length>0:false;},hasClass:function(expr){return this.is("."+expr);},val:function(val){if(val==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,a=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){var val=jQuery.browser.msie&&!option.attributes["value"].specified?option.text:option.value;if(one)return val;a.push(val);}}return a;}else
-return this[0].value.replace(/\r/g,"");}}else
-return this.each(function(){if(val.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,val)>=0||jQuery.inArray(this.name,val)>=0);else if(jQuery.nodeName(this,"select")){var tmp=val.constructor==Array?val:[val];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,tmp)>=0||jQuery.inArray(this.text,tmp)>=0);});if(!tmp.length)this.selectedIndex=-1;}else
-this.value=val;});},html:function(val){return val==undefined?(this.length?this[0].innerHTML:null):this.empty().append(val);},replaceWith:function(val){return this.after(val).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(fn){return this.pushStack(jQuery.map(this,function(elem,i){return fn.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},domManip:function(args,table,dir,fn){var clone=this.length>1,a;return this.each(function(){if(!a){a=jQuery.clean(args,this.ownerDocument);if(dir<0)a.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(a[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(document.createElement("tbody"));jQuery.each(a,function(){var elem=clone?this.cloneNode(true):this;if(!evalScript(0,elem))fn.call(obj,elem);});});}};function evalScript(i,elem){var script=jQuery.nodeName(elem,"script");if(script){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
-jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}else if(elem.nodeType==1)jQuery("script",elem).each(evalScript);return script;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},a=1,al=arguments.length,deep=false;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};}if(al==1){target=this;a=0;}var prop;for(;a<al;a++)if((prop=arguments[a])!=null)for(var i in prop){if(target==prop[i])continue;if(deep&&typeof prop[i]=='object'&&target[i])jQuery.extend(target[i],prop[i]);else if(prop[i]!=undefined)target[i]=prop[i];}return target;};var expando="jQuery"+(new Date()).getTime(),uuid=0,win={};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/function/i.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){if(window.execScript)window.execScript(data);else if(jQuery.browser.safari)window.setTimeout(data,0);else
-eval.call(window,data);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?win:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!=undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?win:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(obj,fn,args){if(args){if(obj.length==undefined)for(var i in obj)fn.apply(obj[i],args);else
-for(var i=0,ol=obj.length;i<ol;i++)if(fn.apply(obj[i],args)===false)break;}else{if(obj.length==undefined)for(var i in obj)fn.call(obj[i],i,obj[i]);else
-for(var i=0,ol=obj.length,val=obj[0];i<ol&&fn.call(val,i,val)!==false;val=obj[++i]){}}return obj;},prop:function(elem,value,type,index,prop){if(jQuery.isFunction(value))value=value.call(elem,[index]);var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i;return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(prop)?value+"px":value;},className:{add:function(elem,c){jQuery.each((c||"").split(/\s+/),function(i,cur){if(!jQuery.className.has(elem.className,cur))elem.className+=(elem.className?" ":"")+cur;});},remove:function(elem,c){elem.className=c!=undefined?jQuery.grep(elem.className.split(/\s+/),function(cur){return!jQuery.className.has(c,cur);}).join(" "):"";},has:function(t,c){return jQuery.inArray(c,(t.className||t).toString().split(/\s+/))>-1;}},swap:function(e,o,f){for(var i in o){e.style["old"+i]=e.style[i];e.style[i]=o[i];}f.apply(e,[]);for(var i in o)e.style[i]=e.style["old"+i];},css:function(e,p){if(p=="height"||p=="width"){var old={},oHeight,oWidth,d=["Top","Bottom","Right","Left"];jQuery.each(d,function(){old["padding"+this]=0;old["border"+this+"Width"]=0;});jQuery.swap(e,old,function(){if(jQuery(e).is(':visible')){oHeight=e.offsetHeight;oWidth=e.offsetWidth;}else{e=jQuery(e.cloneNode(true)).find(":radio").removeAttr("checked").end().css({visibility:"hidden",position:"absolute",display:"block",right:"0",left:"0"}).appendTo(e.parentNode)[0];var parPos=jQuery.css(e.parentNode,"position")||"static";if(parPos=="static")e.parentNode.style.position="relative";oHeight=e.clientHeight;oWidth=e.clientWidth;if(parPos=="static")e.parentNode.style.position="static";e.parentNode.removeChild(e);}});return p=="height"?oHeight:oWidth;}return jQuery.curCSS(e,p);},curCSS:function(elem,prop,force){var ret,stack=[],swap=[];function color(a){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(a,null);return!ret||ret.getPropertyValue("color")=="";}if(prop=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(prop.match(/float/i))prop=styleFloat;if(!force&&elem.style[prop])ret=elem.style[prop];else if(document.defaultView&&document.defaultView.getComputedStyle){if(prop.match(/float/i))prop="float";prop=prop.replace(/([A-Z])/g,"-$1").toLowerCase();var cur=document.defaultView.getComputedStyle(elem,null);if(cur&&!color(elem))ret=cur.getPropertyValue(prop);else{for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(a=0;a<stack.length;a++)if(color(stack[a])){swap[a]=stack[a].style.display;stack[a].style.display="block";}ret=prop=="display"&&swap[stack.length-1]!=null?"none":document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop)||"";for(a=0;a<swap.length;a++)if(swap[a]!=null)stack[a].style.display=swap[a];}if(prop=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var newProp=prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});ret=elem.currentStyle[prop]||elem.currentStyle[newProp];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var style=elem.style.left;var runtimeStyle=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;elem.style.left=ret||0;ret=elem.style.pixelLeft+"px";elem.style.left=style;elem.runtimeStyle.left=runtimeStyle;}}return ret;},clean:function(a,doc){var r=[];doc=doc||document;jQuery.each(a,function(i,arg){if(!arg)return;if(arg.constructor==Number)arg=arg.toString();if(typeof arg=="string"){arg=arg.replace(/(<(\w+)[^>]*?)\/>/g,function(m,all,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)?m:all+"></"+tag+">";});var s=jQuery.trim(arg).toLowerCase(),div=doc.createElement("div"),tb=[];var wrap=!s.indexOf("<opt")&&[1,"<select>","</select>"]||!s.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||s.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!s.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!s.indexOf("<td")||!s.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!s.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+arg+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){if(!s.indexOf("<table")&&s.indexOf("<tbody")<0)tb=div.firstChild&&div.firstChild.childNodes;else if(wrap[1]=="<table>"&&s.indexOf("<tbody")<0)tb=div.childNodes;for(var n=tb.length-1;n>=0;--n)if(jQuery.nodeName(tb[n],"tbody")&&!tb[n].childNodes.length)tb[n].parentNode.removeChild(tb[n]);if(/^\s/.test(arg))div.insertBefore(doc.createTextNode(arg.match(/^\s*/)[0]),div.firstChild);}arg=jQuery.makeArray(div.childNodes);}if(0===arg.length&&(!jQuery.nodeName(arg,"form")&&!jQuery.nodeName(arg,"select")))return;if(arg[0]==undefined||jQuery.nodeName(arg,"form")||arg.options)r.push(arg);else
-r=jQuery.merge(r,arg);});return r;},attr:function(elem,name,value){var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(t){return(t||"").replace(/^\s+|\s+$/g,"");},makeArray:function(a){var r=[];if(typeof a!="array")for(var i=0,al=a.length;i<al;i++)r.push(a[i]);else
-r=a.slice(0);return r;},inArray:function(b,a){for(var i=0,al=a.length;i<al;i++)if(a[i]==b)return i;return-1;},merge:function(first,second){if(jQuery.browser.msie){for(var i=0;second[i];i++)if(second[i].nodeType!=8)first.push(second[i]);}else
-for(var i=0;second[i];i++)first.push(second[i]);return first;},unique:function(first){var r=[],done={};try{for(var i=0,fl=first.length;i<fl;i++){var id=jQuery.data(first[i]);if(!done[id]){done[id]=true;r.push(first[i]);}}}catch(e){r=first;}return r;},grep:function(elems,fn,inv){if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++)if(!inv&&fn(elems[i],i)||inv&&!fn(elems[i],i))result.push(elems[i]);return result;},map:function(elems,fn){if(typeof fn=="string")fn=eval("false||function(a){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++){var val=fn(elems[i],i);if(val!==null&&val!=undefined){if(val.constructor!=Array)val=[val];result=result.concat(val);}}return result;}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",styleFloat:jQuery.browser.msie?"styleFloat":"cssFloat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,innerHTML:"innerHTML",className:"className",value:"value",disabled:"disabled",checked:"checked",readonly:"readOnly",selected:"selected",maxlength:"maxLength"}});jQuery.each({parent:"a.parentNode",parents:"jQuery.dir(a,'parentNode')",next:"jQuery.nth(a,2,'nextSibling')",prev:"jQuery.nth(a,2,'previousSibling')",nextAll:"jQuery.dir(a,'nextSibling')",prevAll:"jQuery.dir(a,'previousSibling')",siblings:"jQuery.sibling(a.parentNode.firstChild,a)",children:"jQuery.sibling(a.firstChild)",contents:"jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"},function(i,n){jQuery.fn[i]=function(a){var ret=jQuery.map(this,n);if(a&&typeof a=="string")ret=jQuery.multiFilter(a,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(i,n){jQuery.fn[i]=function(){var a=arguments;return this.each(function(){for(var j=0,al=a.length;j<al;j++)jQuery(a[j])[n](this);});};});jQuery.each({removeAttr:function(key){jQuery.attr(this,key,"");this.removeAttribute(key);},addClass:function(c){jQuery.className.add(this,c);},removeClass:function(c){jQuery.className.remove(this,c);},toggleClass:function(c){jQuery.className[jQuery.className.has(this,c)?"remove":"add"](this,c);},remove:function(a){if(!a||jQuery.filter(a,[this]).r.length){jQuery.removeData(this);this.parentNode.removeChild(this);}},empty:function(){jQuery("*",this).each(function(){jQuery.removeData(this);});while(this.firstChild)this.removeChild(this.firstChild);}},function(i,n){jQuery.fn[i]=function(){return this.each(n,arguments);};});jQuery.each(["Height","Width"],function(i,name){var n=name.toLowerCase();jQuery.fn[n]=function(h){return this[0]==window?jQuery.browser.safari&&self["inner"+name]||jQuery.boxModel&&Math.max(document.documentElement["client"+name],document.body["client"+name])||document.body["client"+name]:this[0]==document?Math.max(document.body["scroll"+name],document.body["offset"+name]):h==undefined?(this.length?jQuery.css(this[0],n):null):this.css(n,h.constructor==String?h:h+"px");};});var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":"m[2]=='*'||jQuery.nodeName(a,m[2])","#":"a.getAttribute('id')==m[2]",":":{lt:"i<m[3]-0",gt:"i>m[3]-0",nth:"m[3]-0==i",eq:"m[3]-0==i",first:"i==0",last:"i==r.length-1",even:"i%2==0",odd:"i%2","first-child":"a.parentNode.getElementsByTagName('*')[0]==a","last-child":"jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a","only-child":"!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",parent:"a.firstChild",empty:"!a.firstChild",contains:"(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",visible:'"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',hidden:'"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',enabled:"!a.disabled",disabled:"a.disabled",checked:"a.checked",selected:"a.selected||jQuery.attr(a,'selected')",text:"'text'==a.type",radio:"'radio'==a.type",checkbox:"'checkbox'==a.type",file:"'file'==a.type",password:"'password'==a.type",submit:"'submit'==a.type",image:"'image'==a.type",reset:"'reset'==a.type",button:'"button"==a.type||jQuery.nodeName(a,"button")',input:"/input|select|textarea|button/i.test(a.nodeName)",has:"jQuery.find(m[3],a).length",header:"/h\\d/i.test(a.nodeName)",animated:"jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&!context.nodeType)context=null;context=context||document;var ret=[context],done=[],last;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){var nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName.toUpperCase()))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var nodeName=m[2],merge={};m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName.toUpperCase()){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=jQuery.filter(m[3],r,true).r;else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(\d*)n\+?(\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"n+"+m[3]||m[3]),first=(test[1]||1)-0,last=test[2]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==1){if(last==0||node.nodeIndex==last)add=true;}else if((node.nodeIndex+last)%first==0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var f=jQuery.expr[m[1]];if(typeof f!="string")f=jQuery.expr[m[1]][m[2]];f=eval("false||function(a,i){return "+f+"}");r=jQuery.grep(r,f,not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(element,type,handler,data){if(jQuery.browser.msie&&element.setInterval!=undefined)element=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var parts=type.split(".");type=parts[0];handler.type=parts[1];var events=jQuery.data(element,"events")||jQuery.data(element,"events",{});var handle=jQuery.data(element,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(element,arguments);return val;});var handlers=events[type];if(!handlers){handlers=events[type]={};if(element.addEventListener)element.addEventListener(type,handle,false);else
-element.attachEvent("on"+type,handle);}handlers[handler.guid]=handler;this.global[type]=true;},guid:1,global:{},remove:function(element,type,handler){var events=jQuery.data(element,"events"),ret,index;if(typeof type=="string"){var parts=type.split(".");type=parts[0];}if(events){if(type&&type.type){handler=type.handler;type=type.type;}if(!type){for(type in events)this.remove(element,type);}else if(events[type]){if(handler)delete events[type][handler.guid];else
-for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(element.removeEventListener)element.removeEventListener(type,jQuery.data(element,"handle"),false);else
-element.detachEvent("on"+type,jQuery.data(element,"handle"));ret=null;delete events[type];}}for(ret in events)break;if(!ret){jQuery.removeData(element,"events");jQuery.removeData(element,"handle");}}},trigger:function(type,data,element,donative,extra){data=jQuery.makeArray(data||[]);if(!element){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{var val,ret,fn=jQuery.isFunction(element[type]||null),evt=!data[0]||!data[0].preventDefault;if(evt)data.unshift(this.fix({type:type,target:element}));data[0].type=type;if(jQuery.isFunction(jQuery.data(element,"handle")))val=jQuery.data(element,"handle").apply(element,data);if(!fn&&element["on"+type]&&element["on"+type].apply(element,data)===false)val=false;if(evt)data.shift();if(extra&&extra.apply(element,data)===false)val=false;if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(element,'a')&&type=="click")){this.triggered=true;element[type]();}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var c=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in c){args[0].handler=c[j];args[0].data=c[j].data;if(!parts[1]||c[j].type==parts[1]){var tmp=c[j].apply(this,args);if(val!==false)val=tmp;if(tmp===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target&&event.srcElement)event.target=event.srcElement;if(jQuery.browser.safari&&event.target.nodeType==3)event.target=originalEvent.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var e=document.documentElement,b=document.body;event.pageX=event.clientX+(e&&e.scrollLeft||b.scrollLeft||0);event.pageY=event.clientY+(e&&e.scrollTop||b.scrollTop||0);}if(!event.which&&(event.charCode||event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(){var a=arguments;return this.click(function(e){this.lastToggle=0==this.lastToggle?1:0;e.preventDefault();return a[this.lastToggle].apply(this,[e])||false;});},hover:function(f,g){function handleHover(e){var p=e.relatedTarget;while(p&&p!=this)try{p=p.parentNode;}catch(e){p=this;};if(p==this)return false;return(e.type=="mouseover"?f:g).apply(this,[e]);}return this.mouseover(handleHover).mouseout(handleHover);},ready:function(f){bindReady();if(jQuery.isReady)f.apply(document,[jQuery]);else
-jQuery.readyList.push(function(){return f.apply(this,[jQuery]);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}if(jQuery.browser.mozilla||jQuery.browser.opera)document.removeEventListener("DOMContentLoaded",jQuery.ready,false);if(!window.frames.length)jQuery(window).load(function(){jQuery("#__ie_init").remove();});}}});jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,o){jQuery.fn[o]=function(f){return f?this.bind(o,f):this.trigger(o);};});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(jQuery.browser.mozilla||jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);else if(jQuery.browser.msie){document.write("<scr"+"ipt id=__ie_init defer=true "+"src=//:><\/script>");var script=document.getElementById("__ie_init");if(script)script.onreadystatechange=function(){if(this.readyState!="complete")return;jQuery.ready();};script=null;}else if(jQuery.browser.safari)jQuery.safariTimer=setInterval(function(){if(document.readyState=="loaded"||document.readyState=="complete"){clearInterval(jQuery.safariTimer);jQuery.safariTimer=null;jQuery.ready();}},10);jQuery.event.add(window,"load",jQuery.ready);}jQuery.fn.extend({load:function(url,params,callback){if(jQuery.isFunction(url))return this.bind("load",url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);setTimeout(function(){self.each(callback,[res.responseText,status,res]);},13);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null},lastModified:{},ajax:function(s){var jsonp,jsre=/=(\?|%3F)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=s.data.replace(jsre,"="+jsonp);s.url=s.url.replace(jsre,"="+jsonp);s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get")s.url+=(s.url.match(/\?/)?"&":"?")+"_="+(new Date()).getTime();if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if(!s.url.indexOf("http")&&s.dataType=="script"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(!jsonp&&(s.success||s.complete)){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async);if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
-jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();return xml;function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
-for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
-s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock?this.oldblock:"";if(jQuery.css(this,"display")=="none")this.style.display="block";}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");if(this.oldblock=="none")this.oldblock="block";this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var opt=jQuery.speed(speed,easing,callback);return this[opt.queue===false?"each":"queue"](function(){opt=jQuery.extend({},opt);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
-e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(){var timers=jQuery.timers;return this.each(function(){for(var i=0;i<timers.length;i++)if(timers[i].elem==this)timers.splice(i--,1);}).dequeue();}});var queue=function(elem,type,array){if(!elem)return;var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.curCSS(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.css(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(){return self.step();}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timers.length==1){var timer=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length)clearInterval(timer);},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(){var t=(new Date()).getTime();if(t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var absolute=jQuery.css(elem,"position")=="absolute",parent=elem.parentNode,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522;if(elem.getBoundingClientRect){box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));if(msie){var border=jQuery("html").css("borderWidth");border=(border=="medium"||jQuery.boxModel&&parseInt(version)>=7)&&2||border;add(-border,-border);}}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&/^t[d|h]$/i.test(parent.tagName)||!safari2)border(offsetParent);if(safari2&&!absolute&&jQuery.css(offsetParent,"position")=="absolute")absolute=true;offsetParent=offsetParent.offsetParent;}while(parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table-row.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if(safari2&&absolute)add(-doc.body.offsetLeft,-doc.body.offsetTop);}results={top:top,left:left};}return results;function border(elem){add(jQuery.css(elem,"borderLeftWidth"),jQuery.css(elem,"borderTopWidth"));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}};})();
\ No newline at end of file
--- a/web/support/jquery.js	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2992 +0,0 @@
-(function(){
-/*
- * jQuery 1.2.1 - New Wave Javascript
- *
- * Copyright (c) 2007 John Resig (jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
- * $Rev: 3353 $
- */
-
-// Map over jQuery in case of overwrite
-if ( typeof jQuery != "undefined" )
-	var _jQuery = jQuery;
-
-var jQuery = window.jQuery = function(selector, context) {
-	// If the context is a namespace object, return a new object
-	return this instanceof jQuery ?
-		this.init(selector, context) :
-		new jQuery(selector, context);
-};
-
-// Map over the $ in case of overwrite
-if ( typeof $ != "undefined" )
-	var _$ = $;
-	
-// Map the jQuery namespace to the '$' one
-window.$ = jQuery;
-
-var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;
-
-jQuery.fn = jQuery.prototype = {
-	init: function(selector, context) {
-		// Make sure that a selection was provided
-		selector = selector || document;
-
-		// Handle HTML strings
-		if ( typeof selector  == "string" ) {
-			var m = quickExpr.exec(selector);
-			if ( m && (m[1] || !context) ) {
-				// HANDLE: $(html) -> $(array)
-				if ( m[1] )
-					selector = jQuery.clean( [ m[1] ], context );
-
-				// HANDLE: $("#id")
-				else {
-					var tmp = document.getElementById( m[3] );
-					if ( tmp )
-						// Handle the case where IE and Opera return items
-						// by name instead of ID
-						if ( tmp.id != m[3] )
-							return jQuery().find( selector );
-						else {
-							this[0] = tmp;
-							this.length = 1;
-							return this;
-						}
-					else
-						selector = [];
-				}
-
-			// HANDLE: $(expr)
-			} else
-				return new jQuery( context ).find( selector );
-
-		// HANDLE: $(function)
-		// Shortcut for document ready
-		} else if ( jQuery.isFunction(selector) )
-			return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( selector );
-
-		return this.setArray(
-			// HANDLE: $(array)
-			selector.constructor == Array && selector ||
-
-			// HANDLE: $(arraylike)
-			// Watch for when an array-like object is passed as the selector
-			(selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) ||
-
-			// HANDLE: $(*)
-			[ selector ] );
-	},
-	
-	jquery: "1.2.1",
-
-	size: function() {
-		return this.length;
-	},
-	
-	length: 0,
-
-	get: function( num ) {
-		return num == undefined ?
-
-			// Return a 'clean' array
-			jQuery.makeArray( this ) :
-
-			// Return just the object
-			this[num];
-	},
-	
-	pushStack: function( a ) {
-		var ret = jQuery(a);
-		ret.prevObject = this;
-		return ret;
-	},
-	
-	setArray: function( a ) {
-		this.length = 0;
-		Array.prototype.push.apply( this, a );
-		return this;
-	},
-
-	each: function( fn, args ) {
-		return jQuery.each( this, fn, args );
-	},
-
-	index: function( obj ) {
-		var pos = -1;
-		this.each(function(i){
-			if ( this == obj ) pos = i;
-		});
-		return pos;
-	},
-
-	attr: function( key, value, type ) {
-		var obj = key;
-		
-		// Look for the case where we're accessing a style value
-		if ( key.constructor == String )
-			if ( value == undefined )
-				return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined;
-			else {
-				obj = {};
-				obj[ key ] = value;
-			}
-		
-		// Check to see if we're setting style values
-		return this.each(function(index){
-			// Set all the styles
-			for ( var prop in obj )
-				jQuery.attr(
-					type ? this.style : this,
-					prop, jQuery.prop(this, obj[prop], type, index, prop)
-				);
-		});
-	},
-
-	css: function( key, value ) {
-		return this.attr( key, value, "curCSS" );
-	},
-
-	text: function(e) {
-		if ( typeof e != "object" && e != null )
-			return this.empty().append( document.createTextNode( e ) );
-
-		var t = "";
-		jQuery.each( e || this, function(){
-			jQuery.each( this.childNodes, function(){
-				if ( this.nodeType != 8 )
-					t += this.nodeType != 1 ?
-						this.nodeValue : jQuery.fn.text([ this ]);
-			});
-		});
-		return t;
-	},
-
-	wrapAll: function(html) {
-		if ( this[0] )
-			// The elements to wrap the target around
-			jQuery(html, this[0].ownerDocument)
-				.clone()
-				.insertBefore(this[0])
-				.map(function(){
-					var elem = this;
-					while ( elem.firstChild )
-						elem = elem.firstChild;
-					return elem;
-				})
-				.append(this);
-
-		return this;
-	},
-
-	wrapInner: function(html) {
-		return this.each(function(){
-			jQuery(this).contents().wrapAll(html);
-		});
-	},
-
-	wrap: function(html) {
-		return this.each(function(){
-			jQuery(this).wrapAll(html);
-		});
-	},
-
-	append: function() {
-		return this.domManip(arguments, true, 1, function(a){
-			this.appendChild( a );
-		});
-	},
-
-	prepend: function() {
-		return this.domManip(arguments, true, -1, function(a){
-			this.insertBefore( a, this.firstChild );
-		});
-	},
-	
-	before: function() {
-		return this.domManip(arguments, false, 1, function(a){
-			this.parentNode.insertBefore( a, this );
-		});
-	},
-
-	after: function() {
-		return this.domManip(arguments, false, -1, function(a){
-			this.parentNode.insertBefore( a, this.nextSibling );
-		});
-	},
-
-	end: function() {
-		return this.prevObject || jQuery([]);
-	},
-
-	find: function(t) {
-		var data = jQuery.map(this, function(a){ return jQuery.find(t,a); });
-		return this.pushStack( /[^+>] [^+>]/.test( t ) || t.indexOf("..") > -1 ?
-			jQuery.unique( data ) : data );
-	},
-
-	clone: function(events) {
-		// Do the clone
-		var ret = this.map(function(){
-			return this.outerHTML ? jQuery(this.outerHTML)[0] : this.cloneNode(true);
-		});
-
-		// Need to set the expando to null on the cloned set if it exists
-		// removeData doesn't work here, IE removes it from the original as well
-		// this is primarily for IE but the data expando shouldn't be copied over in any browser
-		var clone = ret.find("*").andSelf().each(function(){
-			if ( this[ expando ] != undefined )
-				this[ expando ] = null;
-		});
-		
-		// Copy the events from the original to the clone
-		if (events === true)
-			this.find("*").andSelf().each(function(i) {
-				var events = jQuery.data(this, "events");
-				for ( var type in events )
-					for ( var handler in events[type] )
-						jQuery.event.add(clone[i], type, events[type][handler], events[type][handler].data);
-			});
-
-		// Return the cloned set
-		return ret;
-	},
-
-	filter: function(t) {
-		return this.pushStack(
-			jQuery.isFunction( t ) &&
-			jQuery.grep(this, function(el, index){
-				return t.apply(el, [index]);
-			}) ||
-
-			jQuery.multiFilter(t,this) );
-	},
-
-	not: function(t) {
-		return this.pushStack(
-			t.constructor == String &&
-			jQuery.multiFilter(t, this, true) ||
-
-			jQuery.grep(this, function(a) {
-				return ( t.constructor == Array || t.jquery )
-					? jQuery.inArray( a, t ) < 0
-					: a != t;
-			})
-		);
-	},
-
-	add: function(t) {
-		return this.pushStack( jQuery.merge(
-			this.get(),
-			t.constructor == String ?
-				jQuery(t).get() :
-				t.length != undefined && (!t.nodeName || jQuery.nodeName(t, "form")) ?
-					t : [t] )
-		);
-	},
-
-	is: function(expr) {
-		return expr ? jQuery.multiFilter(expr,this).length > 0 : false;
-	},
-
-	hasClass: function(expr) {
-		return this.is("." + expr);
-	},
-	
-	val: function( val ) {
-		if ( val == undefined ) {
-			if ( this.length ) {
-				var elem = this[0];
-		    	
-				// We need to handle select boxes special
-				if ( jQuery.nodeName(elem, "select") ) {
-					var index = elem.selectedIndex,
-						a = [],
-						options = elem.options,
-						one = elem.type == "select-one";
-					
-					// Nothing was selected
-					if ( index < 0 )
-						return null;
-
-					// Loop through all the selected options
-					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
-						var option = options[i];
-						if ( option.selected ) {
-							// Get the specifc value for the option
-							var val = jQuery.browser.msie && !option.attributes["value"].specified ? option.text : option.value;
-							
-							// We don't need an array for one selects
-							if ( one )
-								return val;
-							
-							// Multi-Selects return an array
-							a.push(val);
-						}
-					}
-					
-					return a;
-					
-				// Everything else, we just grab the value
-				} else
-					return this[0].value.replace(/\r/g, "");
-			}
-		} else
-			return this.each(function(){
-				if ( val.constructor == Array && /radio|checkbox/.test(this.type) )
-					this.checked = (jQuery.inArray(this.value, val) >= 0 ||
-						jQuery.inArray(this.name, val) >= 0);
-				else if ( jQuery.nodeName(this, "select") ) {
-					var tmp = val.constructor == Array ? val : [val];
-
-					jQuery("option", this).each(function(){
-						this.selected = (jQuery.inArray(this.value, tmp) >= 0 ||
-						jQuery.inArray(this.text, tmp) >= 0);
-					});
-
-					if ( !tmp.length )
-						this.selectedIndex = -1;
-				} else
-					this.value = val;
-			});
-	},
-	
-	html: function( val ) {
-		return val == undefined ?
-			( this.length ? this[0].innerHTML : null ) :
-			this.empty().append( val );
-	},
-
-	replaceWith: function( val ) {
-		return this.after( val ).remove();
-	},
-
-	eq: function(i){
-		return this.slice(i, i+1);
-	},
-
-	slice: function() {
-		return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
-	},
-
-	map: function(fn) {
-		return this.pushStack(jQuery.map( this, function(elem,i){
-			return fn.call( elem, i, elem );
-		}));
-	},
-
-	andSelf: function() {
-		return this.add( this.prevObject );
-	},
-	
-	domManip: function(args, table, dir, fn) {
-		var clone = this.length > 1, a; 
-
-		return this.each(function(){
-			if ( !a ) {
-				a = jQuery.clean(args, this.ownerDocument);
-				if ( dir < 0 )
-					a.reverse();
-			}
-
-			var obj = this;
-
-			if ( table && jQuery.nodeName(this, "table") && jQuery.nodeName(a[0], "tr") )
-				obj = this.getElementsByTagName("tbody")[0] || this.appendChild(document.createElement("tbody"));
-
-			jQuery.each( a, function(){
-				var elem = clone ? this.cloneNode(true) : this;
-				if ( !evalScript(0, elem) )
-					fn.call( obj, elem );
-			});
-		});
-	}
-};
-
-function evalScript(i, elem){
-	var script = jQuery.nodeName(elem, "script");
-
-	if ( script ) {
-		if ( elem.src )
-			jQuery.ajax({ url: elem.src, async: false, dataType: "script" });
-		else
-			jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
-	
-		if ( elem.parentNode )
-			elem.parentNode.removeChild(elem);
-
-	} else if ( elem.nodeType == 1 )
-    jQuery("script", elem).each(evalScript);
-
-	return script;
-}
-
-jQuery.extend = jQuery.fn.extend = function() {
-	// copy reference to target object
-	var target = arguments[0] || {}, a = 1, al = arguments.length, deep = false;
-
-	// Handle a deep copy situation
-	if ( target.constructor == Boolean ) {
-		deep = target;
-		target = arguments[1] || {};
-	}
-
-	// extend jQuery itself if only one argument is passed
-	if ( al == 1 ) {
-		target = this;
-		a = 0;
-	}
-
-	var prop;
-
-	for ( ; a < al; a++ )
-		// Only deal with non-null/undefined values
-		if ( (prop = arguments[a]) != null )
-			// Extend the base object
-			for ( var i in prop ) {
-				// Prevent never-ending loop
-				if ( target == prop[i] )
-					continue;
-
-				// Recurse if we're merging object values
-				if ( deep && typeof prop[i] == 'object' && target[i] )
-					jQuery.extend( target[i], prop[i] );
-
-				// Don't bring in undefined values
-				else if ( prop[i] != undefined )
-					target[i] = prop[i];
-			}
-
-	// Return the modified object
-	return target;
-};
-
-var expando = "jQuery" + (new Date()).getTime(), uuid = 0, win = {};
-
-jQuery.extend({
-	noConflict: function(deep) {
-		window.$ = _$;
-		if ( deep )
-			window.jQuery = _jQuery;
-		return jQuery;
-	},
-
-	// This may seem like some crazy code, but trust me when I say that this
-	// is the only cross-browser way to do this. --John
-	isFunction: function( fn ) {
-		return !!fn && typeof fn != "string" && !fn.nodeName && 
-			fn.constructor != Array && /function/i.test( fn + "" );
-	},
-	
-	// check if an element is in a XML document
-	isXMLDoc: function(elem) {
-		return elem.documentElement && !elem.body ||
-			elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
-	},
-
-	// Evalulates a script in a global context
-	// Evaluates Async. in Safari 2 :-(
-	globalEval: function( data ) {
-		data = jQuery.trim( data );
-		if ( data ) {
-			if ( window.execScript )
-				window.execScript( data );
-			else if ( jQuery.browser.safari )
-				// safari doesn't provide a synchronous global eval
-				window.setTimeout( data, 0 );
-			else
-				eval.call( window, data );
-		}
-	},
-
-	nodeName: function( elem, name ) {
-		return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
-	},
-	
-	cache: {},
-	
-	data: function( elem, name, data ) {
-		elem = elem == window ? win : elem;
-
-		var id = elem[ expando ];
-
-		// Compute a unique ID for the element
-		if ( !id ) 
-			id = elem[ expando ] = ++uuid;
-
-		// Only generate the data cache if we're
-		// trying to access or manipulate it
-		if ( name && !jQuery.cache[ id ] )
-			jQuery.cache[ id ] = {};
-		
-		// Prevent overriding the named cache with undefined values
-		if ( data != undefined )
-			jQuery.cache[ id ][ name ] = data;
-		
-		// Return the named cache data, or the ID for the element	
-		return name ? jQuery.cache[ id ][ name ] : id;
-	},
-	
-	removeData: function( elem, name ) {
-		elem = elem == window ? win : elem;
-
-		var id = elem[ expando ];
-
-		// If we want to remove a specific section of the element's data
-		if ( name ) {
-			if ( jQuery.cache[ id ] ) {
-				// Remove the section of cache data
-				delete jQuery.cache[ id ][ name ];
-
-				// If we've removed all the data, remove the element's cache
-				name = "";
-				for ( name in jQuery.cache[ id ] ) break;
-				if ( !name )
-					jQuery.removeData( elem );
-			}
-
-		// Otherwise, we want to remove all of the element's data
-		} else {
-			// Clean up the element expando
-			try {
-				delete elem[ expando ];
-			} catch(e){
-				// IE has trouble directly removing the expando
-				// but it's ok with using removeAttribute
-				if ( elem.removeAttribute )
-					elem.removeAttribute( expando );
-			}
-
-			// Completely remove the data cache
-			delete jQuery.cache[ id ];
-		}
-	},
-
-	// args is for internal usage only
-	each: function( obj, fn, args ) {
-		if ( args ) {
-			if ( obj.length == undefined )
-				for ( var i in obj )
-					fn.apply( obj[i], args );
-			else
-				for ( var i = 0, ol = obj.length; i < ol; i++ )
-					if ( fn.apply( obj[i], args ) === false ) break;
-
-		// A special, fast, case for the most common use of each
-		} else {
-			if ( obj.length == undefined )
-				for ( var i in obj )
-					fn.call( obj[i], i, obj[i] );
-			else
-				for ( var i = 0, ol = obj.length, val = obj[0]; 
-					i < ol && fn.call(val,i,val) !== false; val = obj[++i] ){}
-		}
-
-		return obj;
-	},
-	
-	prop: function(elem, value, type, index, prop){
-			// Handle executable functions
-			if ( jQuery.isFunction( value ) )
-				value = value.call( elem, [index] );
-				
-			// exclude the following css properties to add px
-			var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
-
-			// Handle passing in a number to a CSS property
-			return value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) ?
-				value + "px" :
-				value;
-	},
-
-	className: {
-		// internal only, use addClass("class")
-		add: function( elem, c ){
-			jQuery.each( (c || "").split(/\s+/), function(i, cur){
-				if ( !jQuery.className.has( elem.className, cur ) )
-					elem.className += ( elem.className ? " " : "" ) + cur;
-			});
-		},
-
-		// internal only, use removeClass("class")
-		remove: function( elem, c ){
-			elem.className = c != undefined ?
-				jQuery.grep( elem.className.split(/\s+/), function(cur){
-					return !jQuery.className.has( c, cur );	
-				}).join(" ") : "";
-		},
-
-		// internal only, use is(".class")
-		has: function( t, c ) {
-			return jQuery.inArray( c, (t.className || t).toString().split(/\s+/) ) > -1;
-		}
-	},
-
-	swap: function(e,o,f) {
-		for ( var i in o ) {
-			e.style["old"+i] = e.style[i];
-			e.style[i] = o[i];
-		}
-		f.apply( e, [] );
-		for ( var i in o )
-			e.style[i] = e.style["old"+i];
-	},
-
-	css: function(e,p) {
-		if ( p == "height" || p == "width" ) {
-			var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"];
-
-			jQuery.each( d, function(){
-				old["padding" + this] = 0;
-				old["border" + this + "Width"] = 0;
-			});
-
-			jQuery.swap( e, old, function() {
-				if ( jQuery(e).is(':visible') ) {
-					oHeight = e.offsetHeight;
-					oWidth = e.offsetWidth;
-				} else {
-					e = jQuery(e.cloneNode(true))
-						.find(":radio").removeAttr("checked").end()
-						.css({
-							visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0"
-						}).appendTo(e.parentNode)[0];
-
-					var parPos = jQuery.css(e.parentNode,"position") || "static";
-					if ( parPos == "static" )
-						e.parentNode.style.position = "relative";
-
-					oHeight = e.clientHeight;
-					oWidth = e.clientWidth;
-
-					if ( parPos == "static" )
-						e.parentNode.style.position = "static";
-
-					e.parentNode.removeChild(e);
-				}
-			});
-
-			return p == "height" ? oHeight : oWidth;
-		}
-
-		return jQuery.curCSS( e, p );
-	},
-
-	curCSS: function(elem, prop, force) {
-		var ret, stack = [], swap = [];
-
-		// A helper method for determining if an element's values are broken
-		function color(a){
-			if ( !jQuery.browser.safari )
-				return false;
-
-			var ret = document.defaultView.getComputedStyle(a,null);
-			return !ret || ret.getPropertyValue("color") == "";
-		}
-
-		if (prop == "opacity" && jQuery.browser.msie) {
-			ret = jQuery.attr(elem.style, "opacity");
-			return ret == "" ? "1" : ret;
-		}
-		
-		if (prop.match(/float/i))
-			prop = styleFloat;
-
-		if (!force && elem.style[prop])
-			ret = elem.style[prop];
-
-		else if (document.defaultView && document.defaultView.getComputedStyle) {
-
-			if (prop.match(/float/i))
-				prop = "float";
-
-			prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase();
-			var cur = document.defaultView.getComputedStyle(elem, null);
-
-			if ( cur && !color(elem) )
-				ret = cur.getPropertyValue(prop);
-
-			// If the element isn't reporting its values properly in Safari
-			// then some display: none elements are involved
-			else {
-				// Locate all of the parent display: none elements
-				for ( var a = elem; a && color(a); a = a.parentNode )
-					stack.unshift(a);
-
-				// Go through and make them visible, but in reverse
-				// (It would be better if we knew the exact display type that they had)
-				for ( a = 0; a < stack.length; a++ )
-					if ( color(stack[a]) ) {
-						swap[a] = stack[a].style.display;
-						stack[a].style.display = "block";
-					}
-
-				// Since we flip the display style, we have to handle that
-				// one special, otherwise get the value
-				ret = prop == "display" && swap[stack.length-1] != null ?
-					"none" :
-					document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop) || "";
-
-				// Finally, revert the display styles back
-				for ( a = 0; a < swap.length; a++ )
-					if ( swap[a] != null )
-						stack[a].style.display = swap[a];
-			}
-
-			if ( prop == "opacity" && ret == "" )
-				ret = "1";
-
-		} else if (elem.currentStyle) {
-			var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});
-			ret = elem.currentStyle[prop] || elem.currentStyle[newProp];
-
-			// From the awesome hack by Dean Edwards
-			// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
-			// If we're not dealing with a regular pixel number
-			// but a number that has a weird ending, we need to convert it to pixels
-			if ( !/^\d+(px)?$/i.test(ret) && /^\d/.test(ret) ) {
-				var style = elem.style.left;
-				var runtimeStyle = elem.runtimeStyle.left;
-				elem.runtimeStyle.left = elem.currentStyle.left;
-				elem.style.left = ret || 0;
-				ret = elem.style.pixelLeft + "px";
-				elem.style.left = style;
-				elem.runtimeStyle.left = runtimeStyle;
-			}
-		}
-
-		return ret;
-	},
-	
-	clean: function(a, doc) {
-		var r = [];
-		doc = doc || document;
-
-		jQuery.each( a, function(i,arg){
-			if ( !arg ) return;
-
-			if ( arg.constructor == Number )
-				arg = arg.toString();
-			
-			// Convert html string into DOM nodes
-			if ( typeof arg == "string" ) {
-				// Fix "XHTML"-style tags in all browsers
-				arg = arg.replace(/(<(\w+)[^>]*?)\/>/g, function(m, all, tag){
-					return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)? m : all+"></"+tag+">";
-				});
-
-				// Trim whitespace, otherwise indexOf won't work as expected
-				var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = [];
-
-				var wrap =
-					// option or optgroup
-					!s.indexOf("<opt") &&
-					[1, "<select>", "</select>"] ||
-					
-					!s.indexOf("<leg") &&
-					[1, "<fieldset>", "</fieldset>"] ||
-					
-					s.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
-					[1, "<table>", "</table>"] ||
-					
-					!s.indexOf("<tr") &&
-					[2, "<table><tbody>", "</tbody></table>"] ||
-					
-				 	// <thead> matched above
-					(!s.indexOf("<td") || !s.indexOf("<th")) &&
-					[3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
-					
-					!s.indexOf("<col") &&
-					[2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] ||
-
-					// IE can't serialize <link> and <script> tags normally
-					jQuery.browser.msie &&
-					[1, "div<div>", "</div>"] ||
-					
-					[0,"",""];
-
-				// Go to html and back, then peel off extra wrappers
-				div.innerHTML = wrap[1] + arg + wrap[2];
-				
-				// Move to the right depth
-				while ( wrap[0]-- )
-					div = div.lastChild;
-				
-				// Remove IE's autoinserted <tbody> from table fragments
-				if ( jQuery.browser.msie ) {
-					
-					// String was a <table>, *may* have spurious <tbody>
-					if ( !s.indexOf("<table") && s.indexOf("<tbody") < 0 ) 
-						tb = div.firstChild && div.firstChild.childNodes;
-						
-					// String was a bare <thead> or <tfoot>
-					else if ( wrap[1] == "<table>" && s.indexOf("<tbody") < 0 )
-						tb = div.childNodes;
-
-					for ( var n = tb.length-1; n >= 0 ; --n )
-						if ( jQuery.nodeName(tb[n], "tbody") && !tb[n].childNodes.length )
-							tb[n].parentNode.removeChild(tb[n]);
-	
-					// IE completely kills leading whitespace when innerHTML is used	
-					if ( /^\s/.test(arg) )	
-						div.insertBefore( doc.createTextNode( arg.match(/^\s*/)[0] ), div.firstChild );
-
-				}
-				
-				arg = jQuery.makeArray( div.childNodes );
-			}
-
-			if ( 0 === arg.length && (!jQuery.nodeName(arg, "form") && !jQuery.nodeName(arg, "select")) )
-				return;
-
-			if ( arg[0] == undefined || jQuery.nodeName(arg, "form") || arg.options )
-				r.push( arg );
-			else
-				r = jQuery.merge( r, arg );
-
-		});
-
-		return r;
-	},
-	
-	attr: function(elem, name, value){
-		var fix = jQuery.isXMLDoc(elem) ? {} : jQuery.props;
-
-		// Safari mis-reports the default selected property of a hidden option
-		// Accessing the parent's selectedIndex property fixes it
-		if ( name == "selected" && jQuery.browser.safari )
-			elem.parentNode.selectedIndex;
-		
-		// Certain attributes only work when accessed via the old DOM 0 way
-		if ( fix[name] ) {
-			if ( value != undefined ) elem[fix[name]] = value;
-			return elem[fix[name]];
-		} else if ( jQuery.browser.msie && name == "style" )
-			return jQuery.attr( elem.style, "cssText", value );
-
-		else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName(elem, "form") && (name == "action" || name == "method") )
-			return elem.getAttributeNode(name).nodeValue;
-
-		// IE elem.getAttribute passes even for style
-		else if ( elem.tagName ) {
-
-			if ( value != undefined ) {
-				if ( name == "type" && jQuery.nodeName(elem,"input") && elem.parentNode )
-					throw "type property can't be changed";
-				elem.setAttribute( name, value );
-			}
-
-			if ( jQuery.browser.msie && /href|src/.test(name) && !jQuery.isXMLDoc(elem) ) 
-				return elem.getAttribute( name, 2 );
-
-			return elem.getAttribute( name );
-
-		// elem is actually elem.style ... set the style
-		} else {
-			// IE actually uses filters for opacity
-			if ( name == "opacity" && jQuery.browser.msie ) {
-				if ( value != undefined ) {
-					// IE has trouble with opacity if it does not have layout
-					// Force it by setting the zoom level
-					elem.zoom = 1; 
-	
-					// Set the alpha filter to set the opacity
-					elem.filter = (elem.filter || "").replace(/alpha\([^)]*\)/,"") +
-						(parseFloat(value).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
-				}
-	
-				return elem.filter ? 
-					(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100).toString() : "";
-			}
-			name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});
-			if ( value != undefined ) elem[name] = value;
-			return elem[name];
-		}
-	},
-	
-	trim: function(t){
-		return (t||"").replace(/^\s+|\s+$/g, "");
-	},
-
-	makeArray: function( a ) {
-		var r = [];
-
-		// Need to use typeof to fight Safari childNodes crashes
-		if ( typeof a != "array" )
-			for ( var i = 0, al = a.length; i < al; i++ )
-				r.push( a[i] );
-		else
-			r = a.slice( 0 );
-
-		return r;
-	},
-
-	inArray: function( b, a ) {
-		for ( var i = 0, al = a.length; i < al; i++ )
-			if ( a[i] == b )
-				return i;
-		return -1;
-	},
-
-	merge: function(first, second) {
-		// We have to loop this way because IE & Opera overwrite the length
-		// expando of getElementsByTagName
-
-		// Also, we need to make sure that the correct elements are being returned
-		// (IE returns comment nodes in a '*' query)
-		if ( jQuery.browser.msie ) {
-			for ( var i = 0; second[i]; i++ )
-				if ( second[i].nodeType != 8 )
-					first.push(second[i]);
-		} else
-			for ( var i = 0; second[i]; i++ )
-				first.push(second[i]);
-
-		return first;
-	},
-
-	unique: function(first) {
-		var r = [], done = {};
-
-		try {
-			for ( var i = 0, fl = first.length; i < fl; i++ ) {
-				var id = jQuery.data(first[i]);
-				if ( !done[id] ) {
-					done[id] = true;
-					r.push(first[i]);
-				}
-			}
-		} catch(e) {
-			r = first;
-		}
-
-		return r;
-	},
-
-	grep: function(elems, fn, inv) {
-		// If a string is passed in for the function, make a function
-		// for it (a handy shortcut)
-		if ( typeof fn == "string" )
-			fn = eval("false||function(a,i){return " + fn + "}");
-
-		var result = [];
-
-		// Go through the array, only saving the items
-		// that pass the validator function
-		for ( var i = 0, el = elems.length; i < el; i++ )
-			if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )
-				result.push( elems[i] );
-
-		return result;
-	},
-
-	map: function(elems, fn) {
-		// If a string is passed in for the function, make a function
-		// for it (a handy shortcut)
-		if ( typeof fn == "string" )
-			fn = eval("false||function(a){return " + fn + "}");
-
-		var result = [];
-
-		// Go through the array, translating each of the items to their
-		// new value (or values).
-		for ( var i = 0, el = elems.length; i < el; i++ ) {
-			var val = fn(elems[i],i);
-
-			if ( val !== null && val != undefined ) {
-				if ( val.constructor != Array ) val = [val];
-				result = result.concat( val );
-			}
-		}
-
-		return result;
-	}
-});
-
-var userAgent = navigator.userAgent.toLowerCase();
-
-// Figure out what browser is being used
-jQuery.browser = {
-	version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
-	safari: /webkit/.test(userAgent),
-	opera: /opera/.test(userAgent),
-	msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
-	mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
-};
-
-var styleFloat = jQuery.browser.msie ? "styleFloat" : "cssFloat";
-	
-jQuery.extend({
-	// Check to see if the W3C box model is being used
-	boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",
-	
-	styleFloat: jQuery.browser.msie ? "styleFloat" : "cssFloat",
-	
-	props: {
-		"for": "htmlFor",
-		"class": "className",
-		"float": styleFloat,
-		cssFloat: styleFloat,
-		styleFloat: styleFloat,
-		innerHTML: "innerHTML",
-		className: "className",
-		value: "value",
-		disabled: "disabled",
-		checked: "checked",
-		readonly: "readOnly",
-		selected: "selected",
-		maxlength: "maxLength"
-	}
-});
-
-jQuery.each({
-	parent: "a.parentNode",
-	parents: "jQuery.dir(a,'parentNode')",
-	next: "jQuery.nth(a,2,'nextSibling')",
-	prev: "jQuery.nth(a,2,'previousSibling')",
-	nextAll: "jQuery.dir(a,'nextSibling')",
-	prevAll: "jQuery.dir(a,'previousSibling')",
-	siblings: "jQuery.sibling(a.parentNode.firstChild,a)",
-	children: "jQuery.sibling(a.firstChild)",
-	contents: "jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"
-}, function(i,n){
-	jQuery.fn[ i ] = function(a) {
-		var ret = jQuery.map(this,n);
-		if ( a && typeof a == "string" )
-			ret = jQuery.multiFilter(a,ret);
-		return this.pushStack( jQuery.unique(ret) );
-	};
-});
-
-jQuery.each({
-	appendTo: "append",
-	prependTo: "prepend",
-	insertBefore: "before",
-	insertAfter: "after",
-	replaceAll: "replaceWith"
-}, function(i,n){
-	jQuery.fn[ i ] = function(){
-		var a = arguments;
-		return this.each(function(){
-			for ( var j = 0, al = a.length; j < al; j++ )
-				jQuery(a[j])[n]( this );
-		});
-	};
-});
-
-jQuery.each( {
-	removeAttr: function( key ) {
-		jQuery.attr( this, key, "" );
-		this.removeAttribute( key );
-	},
-	addClass: function(c){
-		jQuery.className.add(this,c);
-	},
-	removeClass: function(c){
-		jQuery.className.remove(this,c);
-	},
-	toggleClass: function( c ){
-		jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this, c);
-	},
-	remove: function(a){
-		if ( !a || jQuery.filter( a, [this] ).r.length ) {
-			jQuery.removeData( this );
-			this.parentNode.removeChild( this );
-		}
-	},
-	empty: function() {
-		// Clean up the cache
-		jQuery("*", this).each(function(){ jQuery.removeData(this); });
-
-		while ( this.firstChild )
-			this.removeChild( this.firstChild );
-	}
-}, function(i,n){
-	jQuery.fn[ i ] = function() {
-		return this.each( n, arguments );
-	};
-});
-
-jQuery.each( [ "Height", "Width" ], function(i,name){
-	var n = name.toLowerCase();
-	
-	jQuery.fn[ n ] = function(h) {
-		return this[0] == window ?
-			jQuery.browser.safari && self["inner" + name] ||
-			jQuery.boxModel && Math.max(document.documentElement["client" + name], document.body["client" + name]) ||
-			document.body["client" + name] :
-		
-			this[0] == document ?
-				Math.max( document.body["scroll" + name], document.body["offset" + name] ) :
-        
-				h == undefined ?
-					( this.length ? jQuery.css( this[0], n ) : null ) :
-					this.css( n, h.constructor == String ? h : h + "px" );
-	};
-});
-
-var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
-		"(?:[\\w*_-]|\\\\.)" :
-		"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
-	quickChild = new RegExp("^>\\s*(" + chars + "+)"),
-	quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
-	quickClass = new RegExp("^([#.]?)(" + chars + "*)");
-
-jQuery.extend({
-	expr: {
-		"": "m[2]=='*'||jQuery.nodeName(a,m[2])",
-		"#": "a.getAttribute('id')==m[2]",
-		":": {
-			// Position Checks
-			lt: "i<m[3]-0",
-			gt: "i>m[3]-0",
-			nth: "m[3]-0==i",
-			eq: "m[3]-0==i",
-			first: "i==0",
-			last: "i==r.length-1",
-			even: "i%2==0",
-			odd: "i%2",
-
-			// Child Checks
-			"first-child": "a.parentNode.getElementsByTagName('*')[0]==a",
-			"last-child": "jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a",
-			"only-child": "!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",
-
-			// Parent Checks
-			parent: "a.firstChild",
-			empty: "!a.firstChild",
-
-			// Text Check
-			contains: "(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",
-
-			// Visibility
-			visible: '"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',
-			hidden: '"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',
-
-			// Form attributes
-			enabled: "!a.disabled",
-			disabled: "a.disabled",
-			checked: "a.checked",
-			selected: "a.selected||jQuery.attr(a,'selected')",
-
-			// Form elements
-			text: "'text'==a.type",
-			radio: "'radio'==a.type",
-			checkbox: "'checkbox'==a.type",
-			file: "'file'==a.type",
-			password: "'password'==a.type",
-			submit: "'submit'==a.type",
-			image: "'image'==a.type",
-			reset: "'reset'==a.type",
-			button: '"button"==a.type||jQuery.nodeName(a,"button")',
-			input: "/input|select|textarea|button/i.test(a.nodeName)",
-
-			// :has()
-			has: "jQuery.find(m[3],a).length",
-
-			// :header
-			header: "/h\\d/i.test(a.nodeName)",
-
-			// :animated
-			animated: "jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"
-		}
-	},
-	
-	// The regular expressions that power the parsing engine
-	parse: [
-		// Match: [@value='test'], [@foo]
-		/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,
-
-		// Match: :contains('foo')
-		/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,
-
-		// Match: :even, :last-chlid, #id, .class
-		new RegExp("^([:.#]*)(" + chars + "+)")
-	],
-
-	multiFilter: function( expr, elems, not ) {
-		var old, cur = [];
-
-		while ( expr && expr != old ) {
-			old = expr;
-			var f = jQuery.filter( expr, elems, not );
-			expr = f.t.replace(/^\s*,\s*/, "" );
-			cur = not ? elems = f.r : jQuery.merge( cur, f.r );
-		}
-
-		return cur;
-	},
-
-	find: function( t, context ) {
-		// Quickly handle non-string expressions
-		if ( typeof t != "string" )
-			return [ t ];
-
-		// Make sure that the context is a DOM Element
-		if ( context && !context.nodeType )
-			context = null;
-
-		// Set the correct context (if none is provided)
-		context = context || document;
-
-		// Initialize the search
-		var ret = [context], done = [], last;
-
-		// Continue while a selector expression exists, and while
-		// we're no longer looping upon ourselves
-		while ( t && last != t ) {
-			var r = [];
-			last = t;
-
-			t = jQuery.trim(t);
-
-			var foundToken = false;
-
-			// An attempt at speeding up child selectors that
-			// point to a specific element tag
-			var re = quickChild;
-			var m = re.exec(t);
-
-			if ( m ) {
-				var nodeName = m[1].toUpperCase();
-
-				// Perform our own iteration and filter
-				for ( var i = 0; ret[i]; i++ )
-					for ( var c = ret[i].firstChild; c; c = c.nextSibling )
-						if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName.toUpperCase()) )
-							r.push( c );
-
-				ret = r;
-				t = t.replace( re, "" );
-				if ( t.indexOf(" ") == 0 ) continue;
-				foundToken = true;
-			} else {
-				re = /^([>+~])\s*(\w*)/i;
-
-				if ( (m = re.exec(t)) != null ) {
-					r = [];
-
-					var nodeName = m[2], merge = {};
-					m = m[1];
-
-					for ( var j = 0, rl = ret.length; j < rl; j++ ) {
-						var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
-						for ( ; n; n = n.nextSibling )
-							if ( n.nodeType == 1 ) {
-								var id = jQuery.data(n);
-
-								if ( m == "~" && merge[id] ) break;
-								
-								if (!nodeName || n.nodeName.toUpperCase() == nodeName.toUpperCase() ) {
-									if ( m == "~" ) merge[id] = true;
-									r.push( n );
-								}
-								
-								if ( m == "+" ) break;
-							}
-					}
-
-					ret = r;
-
-					// And remove the token
-					t = jQuery.trim( t.replace( re, "" ) );
-					foundToken = true;
-				}
-			}
-
-			// See if there's still an expression, and that we haven't already
-			// matched a token
-			if ( t && !foundToken ) {
-				// Handle multiple expressions
-				if ( !t.indexOf(",") ) {
-					// Clean the result set
-					if ( context == ret[0] ) ret.shift();
-
-					// Merge the result sets
-					done = jQuery.merge( done, ret );
-
-					// Reset the context
-					r = ret = [context];
-
-					// Touch up the selector string
-					t = " " + t.substr(1,t.length);
-
-				} else {
-					// Optimize for the case nodeName#idName
-					var re2 = quickID;
-					var m = re2.exec(t);
-					
-					// Re-organize the results, so that they're consistent
-					if ( m ) {
-					   m = [ 0, m[2], m[3], m[1] ];
-
-					} else {
-						// Otherwise, do a traditional filter check for
-						// ID, class, and element selectors
-						re2 = quickClass;
-						m = re2.exec(t);
-					}
-
-					m[2] = m[2].replace(/\\/g, "");
-
-					var elem = ret[ret.length-1];
-
-					// Try to do a global search by ID, where we can
-					if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
-						// Optimization for HTML document case
-						var oid = elem.getElementById(m[2]);
-						
-						// Do a quick check for the existence of the actual ID attribute
-						// to avoid selecting by the name attribute in IE
-						// also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
-						if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
-							oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
-
-						// Do a quick check for node name (where applicable) so
-						// that div#foo searches will be really fast
-						ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
-					} else {
-						// We need to find all descendant elements
-						for ( var i = 0; ret[i]; i++ ) {
-							// Grab the tag name being searched for
-							var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];
-
-							// Handle IE7 being really dumb about <object>s
-							if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
-								tag = "param";
-
-							r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
-						}
-
-						// It's faster to filter by class and be done with it
-						if ( m[1] == "." )
-							r = jQuery.classFilter( r, m[2] );
-
-						// Same with ID filtering
-						if ( m[1] == "#" ) {
-							var tmp = [];
-
-							// Try to find the element with the ID
-							for ( var i = 0; r[i]; i++ )
-								if ( r[i].getAttribute("id") == m[2] ) {
-									tmp = [ r[i] ];
-									break;
-								}
-
-							r = tmp;
-						}
-
-						ret = r;
-					}
-
-					t = t.replace( re2, "" );
-				}
-
-			}
-
-			// If a selector string still exists
-			if ( t ) {
-				// Attempt to filter it
-				var val = jQuery.filter(t,r);
-				ret = r = val.r;
-				t = jQuery.trim(val.t);
-			}
-		}
-
-		// An error occurred with the selector;
-		// just return an empty set instead
-		if ( t )
-			ret = [];
-
-		// Remove the root context
-		if ( ret && context == ret[0] )
-			ret.shift();
-
-		// And combine the results
-		done = jQuery.merge( done, ret );
-
-		return done;
-	},
-
-	classFilter: function(r,m,not){
-		m = " " + m + " ";
-		var tmp = [];
-		for ( var i = 0; r[i]; i++ ) {
-			var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
-			if ( !not && pass || not && !pass )
-				tmp.push( r[i] );
-		}
-		return tmp;
-	},
-
-	filter: function(t,r,not) {
-		var last;
-
-		// Look for common filter expressions
-		while ( t  && t != last ) {
-			last = t;
-
-			var p = jQuery.parse, m;
-
-			for ( var i = 0; p[i]; i++ ) {
-				m = p[i].exec( t );
-
-				if ( m ) {
-					// Remove what we just matched
-					t = t.substring( m[0].length );
-
-					m[2] = m[2].replace(/\\/g, "");
-					break;
-				}
-			}
-
-			if ( !m )
-				break;
-
-			// :not() is a special case that can be optimized by
-			// keeping it out of the expression list
-			if ( m[1] == ":" && m[2] == "not" )
-				r = jQuery.filter(m[3], r, true).r;
-
-			// We can get a big speed boost by filtering by class here
-			else if ( m[1] == "." )
-				r = jQuery.classFilter(r, m[2], not);
-
-			else if ( m[1] == "[" ) {
-				var tmp = [], type = m[3];
-				
-				for ( var i = 0, rl = r.length; i < rl; i++ ) {
-					var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
-					
-					if ( z == null || /href|src|selected/.test(m[2]) )
-						z = jQuery.attr(a,m[2]) || '';
-
-					if ( (type == "" && !!z ||
-						 type == "=" && z == m[5] ||
-						 type == "!=" && z != m[5] ||
-						 type == "^=" && z && !z.indexOf(m[5]) ||
-						 type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
-						 (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
-							tmp.push( a );
-				}
-				
-				r = tmp;
-
-			// We can get a speed boost by handling nth-child here
-			} else if ( m[1] == ":" && m[2] == "nth-child" ) {
-				var merge = {}, tmp = [],
-					test = /(\d*)n\+?(\d*)/.exec(
-						m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
-						!/\D/.test(m[3]) && "n+" + m[3] || m[3]),
-					first = (test[1] || 1) - 0, last = test[2] - 0;
-
-				for ( var i = 0, rl = r.length; i < rl; i++ ) {
-					var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);
-
-					if ( !merge[id] ) {
-						var c = 1;
-
-						for ( var n = parentNode.firstChild; n; n = n.nextSibling )
-							if ( n.nodeType == 1 )
-								n.nodeIndex = c++;
-
-						merge[id] = true;
-					}
-
-					var add = false;
-
-					if ( first == 1 ) {
-						if ( last == 0 || node.nodeIndex == last )
-							add = true;
-					} else if ( (node.nodeIndex + last) % first == 0 )
-						add = true;
-
-					if ( add ^ not )
-						tmp.push( node );
-				}
-
-				r = tmp;
-
-			// Otherwise, find the expression to execute
-			} else {
-				var f = jQuery.expr[m[1]];
-				if ( typeof f != "string" )
-					f = jQuery.expr[m[1]][m[2]];
-
-				// Build a custom macro to enclose it
-				f = eval("false||function(a,i){return " + f + "}");
-
-				// Execute it against the current filter
-				r = jQuery.grep( r, f, not );
-			}
-		}
-
-		// Return an array of filtered elements (r)
-		// and the modified expression string (t)
-		return { r: r, t: t };
-	},
-
-	dir: function( elem, dir ){
-		var matched = [];
-		var cur = elem[dir];
-		while ( cur && cur != document ) {
-			if ( cur.nodeType == 1 )
-				matched.push( cur );
-			cur = cur[dir];
-		}
-		return matched;
-	},
-	
-	nth: function(cur,result,dir,elem){
-		result = result || 1;
-		var num = 0;
-
-		for ( ; cur; cur = cur[dir] )
-			if ( cur.nodeType == 1 && ++num == result )
-				break;
-
-		return cur;
-	},
-	
-	sibling: function( n, elem ) {
-		var r = [];
-
-		for ( ; n; n = n.nextSibling ) {
-			if ( n.nodeType == 1 && (!elem || n != elem) )
-				r.push( n );
-		}
-
-		return r;
-	}
-});
-/*
- * A number of helper functions used for managing events.
- * Many of the ideas behind this code orignated from 
- * Dean Edwards' addEvent library.
- */
-jQuery.event = {
-
-	// Bind an event to an element
-	// Original by Dean Edwards
-	add: function(element, type, handler, data) {
-		// For whatever reason, IE has trouble passing the window object
-		// around, causing it to be cloned in the process
-		if ( jQuery.browser.msie && element.setInterval != undefined )
-			element = window;
-
-		// Make sure that the function being executed has a unique ID
-		if ( !handler.guid )
-			handler.guid = this.guid++;
-			
-		// if data is passed, bind to handler 
-		if( data != undefined ) { 
-        		// Create temporary function pointer to original handler 
-			var fn = handler; 
-
-			// Create unique handler function, wrapped around original handler 
-			handler = function() { 
-				// Pass arguments and context to original handler 
-				return fn.apply(this, arguments); 
-			};
-
-			// Store data in unique handler 
-			handler.data = data;
-
-			// Set the guid of unique handler to the same of original handler, so it can be removed 
-			handler.guid = fn.guid;
-		}
-
-		// Namespaced event handlers
-		var parts = type.split(".");
-		type = parts[0];
-		handler.type = parts[1];
-
-		// Init the element's event structure
-		var events = jQuery.data(element, "events") || jQuery.data(element, "events", {});
-		
-		var handle = jQuery.data(element, "handle", function(){
-			// returned undefined or false
-			var val;
-
-			// Handle the second event of a trigger and when
-			// an event is called after a page has unloaded
-			if ( typeof jQuery == "undefined" || jQuery.event.triggered )
-				return val;
-			
-			val = jQuery.event.handle.apply(element, arguments);
-			
-			return val;
-		});
-
-		// Get the current list of functions bound to this event
-		var handlers = events[type];
-
-		// Init the event handler queue
-		if (!handlers) {
-			handlers = events[type] = {};	
-			
-			// And bind the global event handler to the element
-			if (element.addEventListener)
-				element.addEventListener(type, handle, false);
-			else
-				element.attachEvent("on" + type, handle);
-		}
-
-		// Add the function to the element's handler list
-		handlers[handler.guid] = handler;
-
-		// Keep track of which events have been used, for global triggering
-		this.global[type] = true;
-	},
-
-	guid: 1,
-	global: {},
-
-	// Detach an event or set of events from an element
-	remove: function(element, type, handler) {
-		var events = jQuery.data(element, "events"), ret, index;
-
-		// Namespaced event handlers
-		if ( typeof type == "string" ) {
-			var parts = type.split(".");
-			type = parts[0];
-		}
-
-		if ( events ) {
-			// type is actually an event object here
-			if ( type && type.type ) {
-				handler = type.handler;
-				type = type.type;
-			}
-			
-			if ( !type ) {
-				for ( type in events )
-					this.remove( element, type );
-
-			} else if ( events[type] ) {
-				// remove the given handler for the given type
-				if ( handler )
-					delete events[type][handler.guid];
-				
-				// remove all handlers for the given type
-				else
-					for ( handler in events[type] )
-						// Handle the removal of namespaced events
-						if ( !parts[1] || events[type][handler].type == parts[1] )
-							delete events[type][handler];
-
-				// remove generic event handler if no more handlers exist
-				for ( ret in events[type] ) break;
-				if ( !ret ) {
-					if (element.removeEventListener)
-						element.removeEventListener(type, jQuery.data(element, "handle"), false);
-					else
-						element.detachEvent("on" + type, jQuery.data(element, "handle"));
-					ret = null;
-					delete events[type];
-				}
-			}
-
-			// Remove the expando if it's no longer used
-			for ( ret in events ) break;
-			if ( !ret ) {
-				jQuery.removeData( element, "events" );
-				jQuery.removeData( element, "handle" );
-			}
-		}
-	},
-
-	trigger: function(type, data, element, donative, extra) {
-		// Clone the incoming data, if any
-		data = jQuery.makeArray(data || []);
-
-		// Handle a global trigger
-		if ( !element ) {
-			// Only trigger if we've ever bound an event for it
-			if ( this.global[type] )
-				jQuery("*").add([window, document]).trigger(type, data);
-
-		// Handle triggering a single element
-		} else {
-			var val, ret, fn = jQuery.isFunction( element[ type ] || null ),
-				// Check to see if we need to provide a fake event, or not
-				evt = !data[0] || !data[0].preventDefault;
-			
-			// Pass along a fake event
-			if ( evt )
-				data.unshift( this.fix({ type: type, target: element }) );
-
-			// Enforce the right trigger type
-			data[0].type = type;
-
-			// Trigger the event
-			if ( jQuery.isFunction( jQuery.data(element, "handle") ) )
-				val = jQuery.data(element, "handle").apply( element, data );
-
-			// Handle triggering native .onfoo handlers
-			if ( !fn && element["on"+type] && element["on"+type].apply( element, data ) === false )
-				val = false;
-
-			// Extra functions don't get the custom event object
-			if ( evt )
-				data.shift();
-
-			// Handle triggering of extra function
-			if ( extra && extra.apply( element, data ) === false )
-				val = false;
-
-			// Trigger the native events (except for clicks on links)
-			if ( fn && donative !== false && val !== false && !(jQuery.nodeName(element, 'a') && type == "click") ) {
-				this.triggered = true;
-				element[ type ]();
-			}
-
-			this.triggered = false;
-		}
-
-		return val;
-	},
-
-	handle: function(event) {
-		// returned undefined or false
-		var val;
-
-		// Empty object is for triggered events with no data
-		event = jQuery.event.fix( event || window.event || {} ); 
-
-		// Namespaced event handlers
-		var parts = event.type.split(".");
-		event.type = parts[0];
-
-		var c = jQuery.data(this, "events") && jQuery.data(this, "events")[event.type], args = Array.prototype.slice.call( arguments, 1 );
-		args.unshift( event );
-
-		for ( var j in c ) {
-			// Pass in a reference to the handler function itself
-			// So that we can later remove it
-			args[0].handler = c[j];
-			args[0].data = c[j].data;
-
-			// Filter the functions by class
-			if ( !parts[1] || c[j].type == parts[1] ) {
-				var tmp = c[j].apply( this, args );
-
-				if ( val !== false )
-					val = tmp;
-
-				if ( tmp === false ) {
-					event.preventDefault();
-					event.stopPropagation();
-				}
-			}
-		}
-
-		// Clean up added properties in IE to prevent memory leak
-		if (jQuery.browser.msie)
-			event.target = event.preventDefault = event.stopPropagation =
-				event.handler = event.data = null;
-
-		return val;
-	},
-
-	fix: function(event) {
-		// store a copy of the original event object 
-		// and clone to set read-only properties
-		var originalEvent = event;
-		event = jQuery.extend({}, originalEvent);
-		
-		// add preventDefault and stopPropagation since 
-		// they will not work on the clone
-		event.preventDefault = function() {
-			// if preventDefault exists run it on the original event
-			if (originalEvent.preventDefault)
-				originalEvent.preventDefault();
-			// otherwise set the returnValue property of the original event to false (IE)
-			originalEvent.returnValue = false;
-		};
-		event.stopPropagation = function() {
-			// if stopPropagation exists run it on the original event
-			if (originalEvent.stopPropagation)
-				originalEvent.stopPropagation();
-			// otherwise set the cancelBubble property of the original event to true (IE)
-			originalEvent.cancelBubble = true;
-		};
-		
-		// Fix target property, if necessary
-		if ( !event.target && event.srcElement )
-			event.target = event.srcElement;
-				
-		// check if target is a textnode (safari)
-		if (jQuery.browser.safari && event.target.nodeType == 3)
-			event.target = originalEvent.target.parentNode;
-
-		// Add relatedTarget, if necessary
-		if ( !event.relatedTarget && event.fromElement )
-			event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
-
-		// Calculate pageX/Y if missing and clientX/Y available
-		if ( event.pageX == null && event.clientX != null ) {
-			var e = document.documentElement, b = document.body;
-			event.pageX = event.clientX + (e && e.scrollLeft || b.scrollLeft || 0);
-			event.pageY = event.clientY + (e && e.scrollTop || b.scrollTop || 0);
-		}
-			
-		// Add which for key events
-		if ( !event.which && (event.charCode || event.keyCode) )
-			event.which = event.charCode || event.keyCode;
-		
-		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
-		if ( !event.metaKey && event.ctrlKey )
-			event.metaKey = event.ctrlKey;
-
-		// Add which for click: 1 == left; 2 == middle; 3 == right
-		// Note: button is not normalized, so don't use it
-		if ( !event.which && event.button )
-			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
-			
-		return event;
-	}
-};
-
-jQuery.fn.extend({
-	bind: function( type, data, fn ) {
-		return type == "unload" ? this.one(type, data, fn) : this.each(function(){
-			jQuery.event.add( this, type, fn || data, fn && data );
-		});
-	},
-	
-	one: function( type, data, fn ) {
-		return this.each(function(){
-			jQuery.event.add( this, type, function(event) {
-				jQuery(this).unbind(event);
-				return (fn || data).apply( this, arguments);
-			}, fn && data);
-		});
-	},
-
-	unbind: function( type, fn ) {
-		return this.each(function(){
-			jQuery.event.remove( this, type, fn );
-		});
-	},
-
-	trigger: function( type, data, fn ) {
-		return this.each(function(){
-			jQuery.event.trigger( type, data, this, true, fn );
-		});
-	},
-
-	triggerHandler: function( type, data, fn ) {
-		if ( this[0] )
-			return jQuery.event.trigger( type, data, this[0], false, fn );
-	},
-
-	toggle: function() {
-		// Save reference to arguments for access in closure
-		var a = arguments;
-
-		return this.click(function(e) {
-			// Figure out which function to execute
-			this.lastToggle = 0 == this.lastToggle ? 1 : 0;
-			
-			// Make sure that clicks stop
-			e.preventDefault();
-			
-			// and execute the function
-			return a[this.lastToggle].apply( this, [e] ) || false;
-		});
-	},
-
-	hover: function(f,g) {
-		
-		// A private function for handling mouse 'hovering'
-		function handleHover(e) {
-			// Check if mouse(over|out) are still within the same parent element
-			var p = e.relatedTarget;
-	
-			// Traverse up the tree
-			while ( p && p != this ) try { p = p.parentNode; } catch(e) { p = this; };
-			
-			// If we actually just moused on to a sub-element, ignore it
-			if ( p == this ) return false;
-			
-			// Execute the right function
-			return (e.type == "mouseover" ? f : g).apply(this, [e]);
-		}
-		
-		// Bind the function to the two event listeners
-		return this.mouseover(handleHover).mouseout(handleHover);
-	},
-	
-	ready: function(f) {
-		// Attach the listeners
-		bindReady();
-
-		// If the DOM is already ready
-		if ( jQuery.isReady )
-			// Execute the function immediately
-			f.apply( document, [jQuery] );
-			
-		// Otherwise, remember the function for later
-		else
-			// Add the function to the wait list
-			jQuery.readyList.push( function() { return f.apply(this, [jQuery]); } );
-	
-		return this;
-	}
-});
-
-jQuery.extend({
-	/*
-	 * All the code that makes DOM Ready work nicely.
-	 */
-	isReady: false,
-	readyList: [],
-	
-	// Handle when the DOM is ready
-	ready: function() {
-		// Make sure that the DOM is not already loaded
-		if ( !jQuery.isReady ) {
-			// Remember that the DOM is ready
-			jQuery.isReady = true;
-			
-			// If there are functions bound, to execute
-			if ( jQuery.readyList ) {
-				// Execute all of them
-				jQuery.each( jQuery.readyList, function(){
-					this.apply( document );
-				});
-				
-				// Reset the list of functions
-				jQuery.readyList = null;
-			}
-			// Remove event listener to avoid memory leak
-			if ( jQuery.browser.mozilla || jQuery.browser.opera )
-				document.removeEventListener( "DOMContentLoaded", jQuery.ready, false );
-			
-			// Remove script element used by IE hack
-			if( !window.frames.length ) // don't remove if frames are present (#1187)
-				jQuery(window).load(function(){ jQuery("#__ie_init").remove(); });
-		}
-	}
-});
-
-jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
-	"mousedown,mouseup,mousemove,mouseover,mouseout,change,select," + 
-	"submit,keydown,keypress,keyup,error").split(","), function(i,o){
-	
-	// Handle event binding
-	jQuery.fn[o] = function(f){
-		return f ? this.bind(o, f) : this.trigger(o);
-	};
-});
-
-var readyBound = false;
-
-function bindReady(){
-	if ( readyBound ) return;
-	readyBound = true;
-
-	// If Mozilla is used
-	if ( jQuery.browser.mozilla || jQuery.browser.opera )
-		// Use the handy event callback
-		document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
-	
-	// If IE is used, use the excellent hack by Matthias Miller
-	// http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited
-	else if ( jQuery.browser.msie ) {
-	
-		// Only works if you document.write() it
-		document.write("<scr" + "ipt id=__ie_init defer=true " + 
-			"src=//:><\/script>");
-	
-		// Use the defer script hack
-		var script = document.getElementById("__ie_init");
-		
-		// script does not exist if jQuery is loaded dynamically
-		if ( script ) 
-			script.onreadystatechange = function() {
-				if ( this.readyState != "complete" ) return;
-				jQuery.ready();
-			};
-	
-		// Clear from memory
-		script = null;
-	
-	// If Safari  is used
-	} else if ( jQuery.browser.safari )
-		// Continually check to see if the document.readyState is valid
-		jQuery.safariTimer = setInterval(function(){
-			// loaded and complete are both valid states
-			if ( document.readyState == "loaded" || 
-				document.readyState == "complete" ) {
-	
-				// If either one are found, remove the timer
-				clearInterval( jQuery.safariTimer );
-				jQuery.safariTimer = null;
-	
-				// and execute any waiting functions
-				jQuery.ready();
-			}
-		}, 10); 
-
-	// A fallback to window.onload, that will always work
-	jQuery.event.add( window, "load", jQuery.ready );
-}
-jQuery.fn.extend({
-	load: function( url, params, callback ) {
-		if ( jQuery.isFunction( url ) )
-			return this.bind("load", url);
-
-		var off = url.indexOf(" ");
-		if ( off >= 0 ) {
-			var selector = url.slice(off, url.length);
-			url = url.slice(0, off);
-		}
-
-		callback = callback || function(){};
-
-		// Default to a GET request
-		var type = "GET";
-
-		// If the second parameter was provided
-		if ( params )
-			// If it's a function
-			if ( jQuery.isFunction( params ) ) {
-				// We assume that it's the callback
-				callback = params;
-				params = null;
-
-			// Otherwise, build a param string
-			} else {
-				params = jQuery.param( params );
-				type = "POST";
-			}
-
-		var self = this;
-
-		// Request the remote document
-		jQuery.ajax({
-			url: url,
-			type: type,
-			data: params,
-			complete: function(res, status){
-				// If successful, inject the HTML into all the matched elements
-				if ( status == "success" || status == "notmodified" )
-					// See if a selector was specified
-					self.html( selector ?
-						// Create a dummy div to hold the results
-						jQuery("<div/>")
-							// inject the contents of the document in, removing the scripts
-							// to avoid any 'Permission Denied' errors in IE
-							.append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
-
-							// Locate the specified elements
-							.find(selector) :
-
-						// If not, just inject the full result
-						res.responseText );
-
-				// Add delay to account for Safari's delay in globalEval
-				setTimeout(function(){
-					self.each( callback, [res.responseText, status, res] );
-				}, 13);
-			}
-		});
-		return this;
-	},
-
-	serialize: function() {
-		return jQuery.param(this.serializeArray());
-	},
-	serializeArray: function() {
-		return this.map(function(){
-			return jQuery.nodeName(this, "form") ?
-				jQuery.makeArray(this.elements) : this;
-		})
-		.filter(function(){
-			return this.name && !this.disabled && 
-				(this.checked || /select|textarea/i.test(this.nodeName) || 
-					/text|hidden|password/i.test(this.type));
-		})
-		.map(function(i, elem){
-			var val = jQuery(this).val();
-			return val == null ? null :
-				val.constructor == Array ?
-					jQuery.map( val, function(val, i){
-						return {name: elem.name, value: val};
-					}) :
-					{name: elem.name, value: val};
-		}).get();
-	}
-});
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
-	jQuery.fn[o] = function(f){
-		return this.bind(o, f);
-	};
-});
-
-var jsc = (new Date).getTime();
-
-jQuery.extend({
-	get: function( url, data, callback, type ) {
-		// shift arguments if data argument was ommited
-		if ( jQuery.isFunction( data ) ) {
-			callback = data;
-			data = null;
-		}
-		
-		return jQuery.ajax({
-			type: "GET",
-			url: url,
-			data: data,
-			success: callback,
-			dataType: type
-		});
-	},
-
-	getScript: function( url, callback ) {
-		return jQuery.get(url, null, callback, "script");
-	},
-
-	getJSON: function( url, data, callback ) {
-		return jQuery.get(url, data, callback, "json");
-	},
-
-	post: function( url, data, callback, type ) {
-		if ( jQuery.isFunction( data ) ) {
-			callback = data;
-			data = {};
-		}
-
-		return jQuery.ajax({
-			type: "POST",
-			url: url,
-			data: data,
-			success: callback,
-			dataType: type
-		});
-	},
-
-	ajaxSetup: function( settings ) {
-		jQuery.extend( jQuery.ajaxSettings, settings );
-	},
-
-	ajaxSettings: {
-		global: true,
-		type: "GET",
-		timeout: 0,
-		contentType: "application/x-www-form-urlencoded",
-		processData: true,
-		async: true,
-		data: null
-	},
-	
-	// Last-Modified header cache for next request
-	lastModified: {},
-
-	ajax: function( s ) {
-		var jsonp, jsre = /=(\?|%3F)/g, status, data;
-
-		// Extend the settings, but re-extend 's' so that it can be
-		// checked again later (in the test suite, specifically)
-		s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
-
-		// convert data if not already a string
-		if ( s.data && s.processData && typeof s.data != "string" )
-			s.data = jQuery.param(s.data);
-
-		// Handle JSONP Parameter Callbacks
-		if ( s.dataType == "jsonp" ) {
-			if ( s.type.toLowerCase() == "get" ) {
-				if ( !s.url.match(jsre) )
-					s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
-			} else if ( !s.data || !s.data.match(jsre) )
-				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
-			s.dataType = "json";
-		}
-
-		// Build temporary JSONP function
-		if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
-			jsonp = "jsonp" + jsc++;
-
-			// Replace the =? sequence both in the query string and the data
-			if ( s.data )
-				s.data = s.data.replace(jsre, "=" + jsonp);
-			s.url = s.url.replace(jsre, "=" + jsonp);
-
-			// We need to make sure
-			// that a JSONP style response is executed properly
-			s.dataType = "script";
-
-			// Handle JSONP-style loading
-			window[ jsonp ] = function(tmp){
-				data = tmp;
-				success();
-				complete();
-				// Garbage collect
-				window[ jsonp ] = undefined;
-				try{ delete window[ jsonp ]; } catch(e){}
-			};
-		}
-
-		if ( s.dataType == "script" && s.cache == null )
-			s.cache = false;
-
-		if ( s.cache === false && s.type.toLowerCase() == "get" )
-			s.url += (s.url.match(/\?/) ? "&" : "?") + "_=" + (new Date()).getTime();
-
-		// If data is available, append data to url for get requests
-		if ( s.data && s.type.toLowerCase() == "get" ) {
-			s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
-
-			// IE likes to send both get and post data, prevent this
-			s.data = null;
-		}
-
-		// Watch for a new set of requests
-		if ( s.global && ! jQuery.active++ )
-			jQuery.event.trigger( "ajaxStart" );
-
-		// If we're requesting a remote document
-		// and trying to load JSON or Script
-		if ( !s.url.indexOf("http") && s.dataType == "script" ) {
-			var head = document.getElementsByTagName("head")[0];
-			var script = document.createElement("script");
-			script.src = s.url;
-
-			// Handle Script loading
-			if ( !jsonp && (s.success || s.complete) ) {
-				var done = false;
-
-				// Attach handlers for all browsers
-				script.onload = script.onreadystatechange = function(){
-					if ( !done && (!this.readyState || 
-							this.readyState == "loaded" || this.readyState == "complete") ) {
-						done = true;
-						success();
-						complete();
-						head.removeChild( script );
-					}
-				};
-			}
-
-			head.appendChild(script);
-
-			// We handle everything using the script element injection
-			return;
-		}
-
-		var requestDone = false;
-
-		// Create the request object; Microsoft failed to properly
-		// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
-		var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
-
-		// Open the socket
-		xml.open(s.type, s.url, s.async);
-
-		// Set the correct header, if data is being sent
-		if ( s.data )
-			xml.setRequestHeader("Content-Type", s.contentType);
-
-		// Set the If-Modified-Since header, if ifModified mode.
-		if ( s.ifModified )
-			xml.setRequestHeader("If-Modified-Since",
-				jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
-
-		// Set header so the called script knows that it's an XMLHttpRequest
-		xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
-
-		// Allow custom headers/mimetypes
-		if ( s.beforeSend )
-			s.beforeSend(xml);
-			
-		if ( s.global )
-		    jQuery.event.trigger("ajaxSend", [xml, s]);
-
-		// Wait for a response to come back
-		var onreadystatechange = function(isTimeout){
-			// The transfer is complete and the data is available, or the request timed out
-			if ( !requestDone && xml && (xml.readyState == 4 || isTimeout == "timeout") ) {
-				requestDone = true;
-				
-				// clear poll interval
-				if (ival) {
-					clearInterval(ival);
-					ival = null;
-				}
-				
-				status = isTimeout == "timeout" && "timeout" ||
-					!jQuery.httpSuccess( xml ) && "error" ||
-					s.ifModified && jQuery.httpNotModified( xml, s.url ) && "notmodified" ||
-					"success";
-
-				if ( status == "success" ) {
-					// Watch for, and catch, XML document parse errors
-					try {
-						// process the data (runs the xml through httpData regardless of callback)
-						data = jQuery.httpData( xml, s.dataType );
-					} catch(e) {
-						status = "parsererror";
-					}
-				}
-
-				// Make sure that the request was successful or notmodified
-				if ( status == "success" ) {
-					// Cache Last-Modified header, if ifModified mode.
-					var modRes;
-					try {
-						modRes = xml.getResponseHeader("Last-Modified");
-					} catch(e) {} // swallow exception thrown by FF if header is not available
-	
-					if ( s.ifModified && modRes )
-						jQuery.lastModified[s.url] = modRes;
-
-					// JSONP handles its own success callback
-					if ( !jsonp )
-						success();	
-				} else
-					jQuery.handleError(s, xml, status);
-
-				// Fire the complete handlers
-				complete();
-
-				// Stop memory leaks
-				if ( s.async )
-					xml = null;
-			}
-		};
-		
-		if ( s.async ) {
-			// don't attach the handler to the request, just poll it instead
-			var ival = setInterval(onreadystatechange, 13); 
-
-			// Timeout checker
-			if ( s.timeout > 0 )
-				setTimeout(function(){
-					// Check to see if the request is still happening
-					if ( xml ) {
-						// Cancel the request
-						xml.abort();
-	
-						if( !requestDone )
-							onreadystatechange( "timeout" );
-					}
-				}, s.timeout);
-		}
-			
-		// Send the data
-		try {
-			xml.send(s.data);
-		} catch(e) {
-			jQuery.handleError(s, xml, null, e);
-		}
-		
-		// firefox 1.5 doesn't fire statechange for sync requests
-		if ( !s.async )
-			onreadystatechange();
-		
-		// return XMLHttpRequest to allow aborting the request etc.
-		return xml;
-
-		function success(){
-			// If a local callback was specified, fire it and pass it the data
-			if ( s.success )
-				s.success( data, status );
-
-			// Fire the global callback
-			if ( s.global )
-				jQuery.event.trigger( "ajaxSuccess", [xml, s] );
-		}
-
-		function complete(){
-			// Process result
-			if ( s.complete )
-				s.complete(xml, status);
-
-			// The request was completed
-			if ( s.global )
-				jQuery.event.trigger( "ajaxComplete", [xml, s] );
-
-			// Handle the global AJAX counter
-			if ( s.global && ! --jQuery.active )
-				jQuery.event.trigger( "ajaxStop" );
-		}
-	},
-
-	handleError: function( s, xml, status, e ) {
-		// If a local callback was specified, fire it
-		if ( s.error ) s.error( xml, status, e );
-
-		// Fire the global callback
-		if ( s.global )
-			jQuery.event.trigger( "ajaxError", [xml, s, e] );
-	},
-
-	// Counter for holding the number of active queries
-	active: 0,
-
-	// Determines if an XMLHttpRequest was successful or not
-	httpSuccess: function( r ) {
-		try {
-			return !r.status && location.protocol == "file:" ||
-				( r.status >= 200 && r.status < 300 ) || r.status == 304 ||
-				jQuery.browser.safari && r.status == undefined;
-		} catch(e){}
-		return false;
-	},
-
-	// Determines if an XMLHttpRequest returns NotModified
-	httpNotModified: function( xml, url ) {
-		try {
-			var xmlRes = xml.getResponseHeader("Last-Modified");
-
-			// Firefox always returns 200. check Last-Modified date
-			return xml.status == 304 || xmlRes == jQuery.lastModified[url] ||
-				jQuery.browser.safari && xml.status == undefined;
-		} catch(e){}
-		return false;
-	},
-
-	httpData: function( r, type ) {
-		var ct = r.getResponseHeader("content-type");
-		var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0;
-		var data = xml ? r.responseXML : r.responseText;
-
-		if ( xml && data.documentElement.tagName == "parsererror" )
-			throw "parsererror";
-
-		// If the type is "script", eval it in global context
-		if ( type == "script" )
-			jQuery.globalEval( data );
-
-		// Get the JavaScript object, if JSON is used.
-		if ( type == "json" )
-			data = eval("(" + data + ")");
-
-		return data;
-	},
-
-	// Serialize an array of form elements or a set of
-	// key/values into a query string
-	param: function( a ) {
-		var s = [];
-
-		// If an array was passed in, assume that it is an array
-		// of form elements
-		if ( a.constructor == Array || a.jquery )
-			// Serialize the form elements
-			jQuery.each( a, function(){
-				s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) );
-			});
-
-		// Otherwise, assume that it's an object of key/value pairs
-		else
-			// Serialize the key/values
-			for ( var j in a )
-				// If the value is an array then the key names need to be repeated
-				if ( a[j] && a[j].constructor == Array )
-					jQuery.each( a[j], function(){
-						s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) );
-					});
-				else
-					s.push( encodeURIComponent(j) + "=" + encodeURIComponent( a[j] ) );
-
-		// Return the resulting serialization
-		return s.join("&").replace(/%20/g, "+");
-	}
-
-});
-jQuery.fn.extend({
-	show: function(speed,callback){
-		return speed ?
-			this.animate({
-				height: "show", width: "show", opacity: "show"
-			}, speed, callback) :
-			
-			this.filter(":hidden").each(function(){
-				this.style.display = this.oldblock ? this.oldblock : "";
-				if ( jQuery.css(this,"display") == "none" )
-					this.style.display = "block";
-			}).end();
-	},
-	
-	hide: function(speed,callback){
-		return speed ?
-			this.animate({
-				height: "hide", width: "hide", opacity: "hide"
-			}, speed, callback) :
-			
-			this.filter(":visible").each(function(){
-				this.oldblock = this.oldblock || jQuery.css(this,"display");
-				if ( this.oldblock == "none" )
-					this.oldblock = "block";
-				this.style.display = "none";
-			}).end();
-	},
-
-	// Save the old toggle function
-	_toggle: jQuery.fn.toggle,
-	
-	toggle: function( fn, fn2 ){
-		return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
-			this._toggle( fn, fn2 ) :
-			fn ?
-				this.animate({
-					height: "toggle", width: "toggle", opacity: "toggle"
-				}, fn, fn2) :
-				this.each(function(){
-					jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
-				});
-	},
-	
-	slideDown: function(speed,callback){
-		return this.animate({height: "show"}, speed, callback);
-	},
-	
-	slideUp: function(speed,callback){
-		return this.animate({height: "hide"}, speed, callback);
-	},
-
-	slideToggle: function(speed, callback){
-		return this.animate({height: "toggle"}, speed, callback);
-	},
-	
-	fadeIn: function(speed, callback){
-		return this.animate({opacity: "show"}, speed, callback);
-	},
-	
-	fadeOut: function(speed, callback){
-		return this.animate({opacity: "hide"}, speed, callback);
-	},
-	
-	fadeTo: function(speed,to,callback){
-		return this.animate({opacity: to}, speed, callback);
-	},
-	
-	animate: function( prop, speed, easing, callback ) {
-		var opt = jQuery.speed(speed, easing, callback);
-
-		return this[ opt.queue === false ? "each" : "queue" ](function(){
-			opt = jQuery.extend({}, opt);
-			var hidden = jQuery(this).is(":hidden"), self = this;
-			
-			for ( var p in prop ) {
-				if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
-					return jQuery.isFunction(opt.complete) && opt.complete.apply(this);
-
-				if ( p == "height" || p == "width" ) {
-					// Store display property
-					opt.display = jQuery.css(this, "display");
-
-					// Make sure that nothing sneaks out
-					opt.overflow = this.style.overflow;
-				}
-			}
-
-			if ( opt.overflow != null )
-				this.style.overflow = "hidden";
-
-			opt.curAnim = jQuery.extend({}, prop);
-			
-			jQuery.each( prop, function(name, val){
-				var e = new jQuery.fx( self, opt, name );
-
-				if ( /toggle|show|hide/.test(val) )
-					e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
-				else {
-					var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
-						start = e.cur(true) || 0;
-
-					if ( parts ) {
-						var end = parseFloat(parts[2]),
-							unit = parts[3] || "px";
-
-						// We need to compute starting value
-						if ( unit != "px" ) {
-							self.style[ name ] = (end || 1) + unit;
-							start = ((end || 1) / e.cur(true)) * start;
-							self.style[ name ] = start + unit;
-						}
-
-						// If a +=/-= token was provided, we're doing a relative animation
-						if ( parts[1] )
-							end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
-
-						e.custom( start, end, unit );
-					} else
-						e.custom( start, val, "" );
-				}
-			});
-
-			// For JS strict compliance
-			return true;
-		});
-	},
-	
-	queue: function(type, fn){
-		if ( jQuery.isFunction(type) ) {
-			fn = type;
-			type = "fx";
-		}
-
-		if ( !type || (typeof type == "string" && !fn) )
-			return queue( this[0], type );
-
-		return this.each(function(){
-			if ( fn.constructor == Array )
-				queue(this, type, fn);
-			else {
-				queue(this, type).push( fn );
-			
-				if ( queue(this, type).length == 1 )
-					fn.apply(this);
-			}
-		});
-	},
-
-	stop: function(){
-		var timers = jQuery.timers;
-
-		return this.each(function(){
-			for ( var i = 0; i < timers.length; i++ )
-				if ( timers[i].elem == this )
-					timers.splice(i--, 1);
-		}).dequeue();
-	}
-
-});
-
-var queue = function( elem, type, array ) {
-	if ( !elem )
-		return;
-
-	var q = jQuery.data( elem, type + "queue" );
-
-	if ( !q || array )
-		q = jQuery.data( elem, type + "queue", 
-			array ? jQuery.makeArray(array) : [] );
-
-	return q;
-};
-
-jQuery.fn.dequeue = function(type){
-	type = type || "fx";
-
-	return this.each(function(){
-		var q = queue(this, type);
-
-		q.shift();
-
-		if ( q.length )
-			q[0].apply( this );
-	});
-};
-
-jQuery.extend({
-	
-	speed: function(speed, easing, fn) {
-		var opt = speed && speed.constructor == Object ? speed : {
-			complete: fn || !fn && easing || 
-				jQuery.isFunction( speed ) && speed,
-			duration: speed,
-			easing: fn && easing || easing && easing.constructor != Function && easing
-		};
-
-		opt.duration = (opt.duration && opt.duration.constructor == Number ? 
-			opt.duration : 
-			{ slow: 600, fast: 200 }[opt.duration]) || 400;
-	
-		// Queueing
-		opt.old = opt.complete;
-		opt.complete = function(){
-			jQuery(this).dequeue();
-			if ( jQuery.isFunction( opt.old ) )
-				opt.old.apply( this );
-		};
-	
-		return opt;
-	},
-	
-	easing: {
-		linear: function( p, n, firstNum, diff ) {
-			return firstNum + diff * p;
-		},
-		swing: function( p, n, firstNum, diff ) {
-			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
-		}
-	},
-	
-	timers: [],
-
-	fx: function( elem, options, prop ){
-		this.options = options;
-		this.elem = elem;
-		this.prop = prop;
-
-		if ( !options.orig )
-			options.orig = {};
-	}
-
-});
-
-jQuery.fx.prototype = {
-
-	// Simple function for setting a style value
-	update: function(){
-		if ( this.options.step )
-			this.options.step.apply( this.elem, [ this.now, this ] );
-
-		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
-
-		// Set display property to block for height/width animations
-		if ( this.prop == "height" || this.prop == "width" )
-			this.elem.style.display = "block";
-	},
-
-	// Get the current size
-	cur: function(force){
-		if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null )
-			return this.elem[ this.prop ];
-
-		var r = parseFloat(jQuery.curCSS(this.elem, this.prop, force));
-		return r && r > -10000 ? r : parseFloat(jQuery.css(this.elem, this.prop)) || 0;
-	},
-
-	// Start an animation from one number to another
-	custom: function(from, to, unit){
-		this.startTime = (new Date()).getTime();
-		this.start = from;
-		this.end = to;
-		this.unit = unit || this.unit || "px";
-		this.now = this.start;
-		this.pos = this.state = 0;
-		this.update();
-
-		var self = this;
-		function t(){
-			return self.step();
-		}
-
-		t.elem = this.elem;
-
-		jQuery.timers.push(t);
-
-		if ( jQuery.timers.length == 1 ) {
-			var timer = setInterval(function(){
-				var timers = jQuery.timers;
-				
-				for ( var i = 0; i < timers.length; i++ )
-					if ( !timers[i]() )
-						timers.splice(i--, 1);
-
-				if ( !timers.length )
-					clearInterval( timer );
-			}, 13);
-		}
-	},
-
-	// Simple 'show' function
-	show: function(){
-		// Remember where we started, so that we can go back to it later
-		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
-		this.options.show = true;
-
-		// Begin the animation
-		this.custom(0, this.cur());
-
-		// Make sure that we start at a small width/height to avoid any
-		// flash of content
-		if ( this.prop == "width" || this.prop == "height" )
-			this.elem.style[this.prop] = "1px";
-		
-		// Start by showing the element
-		jQuery(this.elem).show();
-	},
-
-	// Simple 'hide' function
-	hide: function(){
-		// Remember where we started, so that we can go back to it later
-		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
-		this.options.hide = true;
-
-		// Begin the animation
-		this.custom(this.cur(), 0);
-	},
-
-	// Each step of an animation
-	step: function(){
-		var t = (new Date()).getTime();
-
-		if ( t > this.options.duration + this.startTime ) {
-			this.now = this.end;
-			this.pos = this.state = 1;
-			this.update();
-
-			this.options.curAnim[ this.prop ] = true;
-
-			var done = true;
-			for ( var i in this.options.curAnim )
-				if ( this.options.curAnim[i] !== true )
-					done = false;
-
-			if ( done ) {
-				if ( this.options.display != null ) {
-					// Reset the overflow
-					this.elem.style.overflow = this.options.overflow;
-				
-					// Reset the display
-					this.elem.style.display = this.options.display;
-					if ( jQuery.css(this.elem, "display") == "none" )
-						this.elem.style.display = "block";
-				}
-
-				// Hide the element if the "hide" operation was done
-				if ( this.options.hide )
-					this.elem.style.display = "none";
-
-				// Reset the properties, if the item has been hidden or shown
-				if ( this.options.hide || this.options.show )
-					for ( var p in this.options.curAnim )
-						jQuery.attr(this.elem.style, p, this.options.orig[p]);
-			}
-
-			// If a callback was provided, execute it
-			if ( done && jQuery.isFunction( this.options.complete ) )
-				// Execute the complete function
-				this.options.complete.apply( this.elem );
-
-			return false;
-		} else {
-			var n = t - this.startTime;
-			this.state = n / this.options.duration;
-
-			// Perform the easing function, defaults to swing
-			this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
-			this.now = this.start + ((this.end - this.start) * this.pos);
-
-			// Perform the next step of the animation
-			this.update();
-		}
-
-		return true;
-	}
-
-};
-
-jQuery.fx.step = {
-	scrollLeft: function(fx){
-		fx.elem.scrollLeft = fx.now;
-	},
-
-	scrollTop: function(fx){
-		fx.elem.scrollTop = fx.now;
-	},
-
-	opacity: function(fx){
-		jQuery.attr(fx.elem.style, "opacity", fx.now);
-	},
-
-	_default: function(fx){
-		fx.elem.style[ fx.prop ] = fx.now + fx.unit;
-	}
-};
-// The Offset Method
-// Originally By Brandon Aaron, part of the Dimension Plugin
-// http://jquery.com/plugins/project/dimensions
-jQuery.fn.offset = function() {
-	var left = 0, top = 0, elem = this[0], results;
-	
-	if ( elem ) with ( jQuery.browser ) {
-		var	absolute     = jQuery.css(elem, "position") == "absolute", 
-		    parent       = elem.parentNode, 
-		    offsetParent = elem.offsetParent, 
-		    doc          = elem.ownerDocument,
-		    safari2      = safari && parseInt(version) < 522;
-	
-		// Use getBoundingClientRect if available
-		if ( elem.getBoundingClientRect ) {
-			box = elem.getBoundingClientRect();
-		
-			// Add the document scroll offsets
-			add(
-				box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
-				box.top  + Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop)
-			);
-		
-			// IE adds the HTML element's border, by default it is medium which is 2px
-			// IE 6 and IE 7 quirks mode the border width is overwritable by the following css html { border: 0; }
-			// IE 7 standards mode, the border is always 2px
-			if ( msie ) {
-				var border = jQuery("html").css("borderWidth");
-				border = (border == "medium" || jQuery.boxModel && parseInt(version) >= 7) && 2 || border;
-				add( -border, -border );
-			}
-	
-		// Otherwise loop through the offsetParents and parentNodes
-		} else {
-		
-			// Initial element offsets
-			add( elem.offsetLeft, elem.offsetTop );
-		
-			// Get parent offsets
-			while ( offsetParent ) {
-				// Add offsetParent offsets
-				add( offsetParent.offsetLeft, offsetParent.offsetTop );
-			
-				// Mozilla and Safari > 2 does not include the border on offset parents
-				// However Mozilla adds the border for table cells
-				if ( mozilla && /^t[d|h]$/i.test(parent.tagName) || !safari2 )
-					border( offsetParent );
-				
-				// Safari <= 2 doubles body offsets with an absolutely positioned element or parent
-				if ( safari2 && !absolute && jQuery.css(offsetParent, "position") == "absolute" )
-					absolute = true;
-			
-				// Get next offsetParent
-				offsetParent = offsetParent.offsetParent;
-			}
-		
-			// Get parent scroll offsets
-			while ( parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
-				// Work around opera inline/table scrollLeft/Top bug
-				if ( !/^inline|table-row.*$/i.test(jQuery.css(parent, "display")) )
-					// Subtract parent scroll offsets
-					add( -parent.scrollLeft, -parent.scrollTop );
-			
-				// Mozilla does not add the border for a parent that has overflow != visible
-				if ( mozilla && jQuery.css(parent, "overflow") != "visible" )
-					border( parent );
-			
-				// Get next parent
-				parent = parent.parentNode;
-			}
-		
-			// Safari doubles body offsets with an absolutely positioned element or parent
-			if ( safari2 && absolute )
-				add( -doc.body.offsetLeft, -doc.body.offsetTop );
-		}
-
-		// Return an object with top and left properties
-		results = { top: top, left: left };
-	}
-
-	return results;
-
-	function border(elem) {
-		add( jQuery.css(elem, "borderLeftWidth"), jQuery.css(elem, "borderTopWidth") );
-	}
-
-	function add(l, t) {
-		left += parseInt(l) || 0;
-		top += parseInt(t) || 0;
-	}
-};
-})();
--- a/web/support/styles.css	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
-body {
-  background: #F2F1F0;
-  font-family: verdana,sans-serif;
-}
-
-.navheader, .book, .preface, .chapter, .appendix, .bibliography, .navfooter, .basetemplate {
-  width: 50em;
-  margin-left: auto;
-  margin-right: auto;
-}
-
-a.commenttoggle:hover, a.commenttoggle:active {
-  opacity: 0.7;
-}
-
-.book, .preface, .chapter, .appendix, .bibliography, .basetemplate {
-  background: white;
-  padding: 2em;
-}
-
-h1 {
-  margin-top: 1.5em;
-}
-
-span.beta {
-  font-size: 80%;
-  font-style: italic;
-  opacity: 0.4;
-}
-
-h2, h3 {
-  margin-top: 2em;
-}
-
-h1, h2, h3 {
-  font-family: georgia,serif;
-  font-weight: normal;
-  margin-bottom: 0.5em;
-}
-
-h1.booktitle {
-  margin-bottom: 0px;
-}
-
-h2.booktitle {
-  text-align: center;
-}
-
-h2.booktitle > a {
-  color: black;
-}
-
-.authors {
-  font-size: 80%;
-  opacity: 0.55;
-  padding-left: 0.5em;
-}
-
-div.note th, div.tip th, div.warning th {
-  font-family: georgia,serif;
-  font-weight: normal;
-  font-size: 110%;
-}
-
-div.navheader th, div.navfooter td {
-  font-family: georgia,serif;
-}
-
-div.navheader th {
-  opacity: 0;
-  font-size: 0;
-}
-
-pre.screen {
-  background-image: url(/support/icons/shell.png);
-}
-
-pre.programlisting {
-  background-image: url(/support/icons/source.png);
-}
-
-pre.programlisting, pre.screen, p.remark {
-  border-style: solid;
-  border-width: 1px;
-  font-size: medium;
-  padding: 1em;
-  background-repeat: no-repeat;
-  background-position: 10px 10px;
-  padding-left: 70px;
-}
-
-strong.command, code, pre, span.type {
-  font-family: monospace;
-  font-weight: normal;
-}
-
-strong.userinput > code {
-  font-weight: bolder;
-  color: #303030;
-}
-
-div.toc > p {
-  opacity: 0.35;
-  font-family: georgia,serif;
-  cursor: pointer;
-}
-
-div.toc b {
-  font-weight: normal;
-  font-size: large;
-}
-
-ul.booktoc {
-  padding-left: 0px;
-  list-style-type: none;
-}
-
-.booktoc > li {
-  padding: 0.5em;
-}
-
-.chapinfo {
-  float: right;
-  color: #a0a0a0;
-}
-
-.unpublished {
-  color: #a0a0a0;
-}
-
-.chapinfo img {
-  vertical-align: -35%;
-  border: 0px;
-}
-
-.zebra_b {
-  background: #f4f4f4;
-}
-
-.book .titlepage {
-  display: none;
-}
-
-.chapter div.toc > dl {
-  display: none;
-}
-
-pre.programlisting, pre.screen, p.remark {
-  overflow: hidden;
-}
-
-p.remark {
-  background-image: url(/support/icons/remark.png);
-}
-
-div.warning, p.remark {
-  background-color: #FFEFE8;
-  border-color: #e0a8a0;
-}
-
-span.remark {
-  font-style: normal;
-  color: #707070;
-}
-
-.screen {
-  background: #e7ffc7 none repeat scroll 0% 50%;
-  border-color: #94DA3A;
-}
-
-.programlisting {
-  background: #F0F4FF none repeat scroll 0% 50%;
-  border-color: #B4BAEA;
-}
-
-.prompt {
-  color: #448844;
-}
-
-div.note, div.tip {
-  background: #ffffc9;
-  border-color: #B4BAEA;
-}
-
-div.note, div.warning, div.tip {
-  border-style: solid;
-  border-width: 1px;
-  padding: 1em;
-}
-
-.note .title {
-  font-size: 90%;
-}
-
-.comment {
-  font-size: 80%;
-}
-
-div.comment, div.new_comment {
-  padding: 0.5em;
-  margin: 0.5em;
-  margin-left: 2em;
-  border-style: solid;
-  border-width: 1px;
-  border-color: #aaaaff;
-}
-
-div.comment {
-  background: #eeeeff;
-}
-
-div.new_comment {
-  background: #d0d0ff;
-}
-
-.commenttoggle {
-  opacity: 0.35;
-}
-
-.comment_help {
-  font-size: 80%;
-}
-
-.comment_header {
-  opacity: 0.75;
-}
-
-.comment_id {
-  float: right;
-  opacity: 0.3;
-  font-size: 60%;
-}
-
-.comment_name {
-  font-weight: bolder;
-}
-
-.comment_reviewed {
-  color: darkgreen;
-  margin-left: 1em;
-  font-style: italic;
-}
-
-.comment_date {
-  opacity: 0.75;
-}
-
-.comment_thanks {
-  color: darkblue;
-  margin-left: 1em;
-  font-style: italic;
-  font-weight: bolder;
-}
-
-.comment_error {
-  padding-left: 1em;
-  font-weight: bolder;
-  font-size: 80%;
-  color: darkred;
-}
-
-.hgbookfooter {
-  width: 60em;
-  margin-left: auto;
-  margin-right: auto;
-  margin-top: 2em;
-  padding: 2em;
-  margin-bottom: 2em;
-  font-size: 80%;
-  color: #727272;
-  border-top: 1px solid grey;
-}
-
-.hgbookfooter a {
-  color: #5555ff;
-}
-
-.hgbookfooter a:visited {
-  opacity: 0.7;
-}
-
-.hgbookfooter img {
-  vertical-align: -45%;
-}
-
-table.equation a.commenttoggle {
-  text-align: right;
-  display: block;
-}
-
-div.comment, div.new_comment, form.comment {
-  text-align: left;
-}
--- a/web/support/styles/styles.css	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
-body {
-  background: #F2F1F0;
-  font-family: verdana,sans-serif;
-}
-
-.navheader, .book, .preface, .chapter, .appendix, .bibliography, .navfooter, .basetemplate {
-  width: 50em;
-  margin-left: auto;
-  margin-right: auto;
-}
-
-a.commenttoggle:hover, a.commenttoggle:active {
-  opacity: 0.7;
-}
-
-.book, .preface, .chapter, .appendix, .bibliography, .basetemplate {
-  background: white;
-  padding: 2em;
-}
-
-h1 {
-  margin-top: 1.5em;
-}
-
-span.beta {
-  font-size: 80%;
-  font-style: italic;
-  opacity: 0.4;
-}
-
-h2, h3 {
-  margin-top: 2em;
-}
-
-h1, h2, h3 {
-  font-family: georgia,serif;
-  font-weight: normal;
-  margin-bottom: 0.5em;
-}
-
-h1.booktitle {
-  margin-bottom: 0px;
-}
-
-h2.booktitle {
-  text-align: center;
-}
-
-h2.booktitle > a {
-  color: black;
-}
-
-.authors {
-  font-size: 80%;
-  opacity: 0.55;
-  padding-left: 0.5em;
-}
-
-div.note th, div.tip th, div.warning th {
-  font-family: georgia,serif;
-  font-weight: normal;
-  font-size: 110%;
-}
-
-div.navheader th, div.navfooter td {
-  font-family: georgia,serif;
-}
-
-div.navheader th {
-  opacity: 0;
-  font-size: 0;
-}
-
-pre.screen {
-  background-image: url(/support/icons/shell.png);
-}
-
-pre.programlisting {
-  background-image: url(/support/icons/source.png);
-}
-
-pre.programlisting, pre.screen, p.remark {
-  border-style: solid;
-  border-width: 1px;
-  font-size: medium;
-  padding: 1em;
-  background-repeat: no-repeat;
-  background-position: 10px 10px;
-  padding-left: 70px;
-}
-
-strong.command, code, pre, span.type {
-  font-family: monospace;
-  font-weight: normal;
-}
-
-strong.userinput > code {
-  font-weight: bolder;
-  color: #303030;
-}
-
-div.toc > p {
-  opacity: 0.35;
-  font-family: georgia,serif;
-  cursor: pointer;
-}
-
-div.toc b {
-  font-weight: normal;
-  font-size: large;
-}
-
-ul.booktoc {
-  padding-left: 0px;
-  list-style-type: none;
-}
-
-.booktoc > li {
-  padding: 0.5em;
-}
-
-.chapinfo {
-  float: right;
-  color: #a0a0a0;
-}
-
-.unpublished {
-  color: #a0a0a0;
-}
-
-.chapinfo img {
-  vertical-align: -35%;
-  border: 0px;
-}
-
-.zebra_b {
-  background: #f4f4f4;
-}
-
-.book .titlepage {
-  display: none;
-}
-
-.chapter div.toc > dl {
-  display: none;
-}
-
-pre.programlisting, pre.screen, p.remark {
-  overflow: hidden;
-}
-
-p.remark {
-  background-image: url(/support/icons/remark.png);
-}
-
-div.warning, p.remark {
-  background-color: #FFEFE8;
-  border-color: #e0a8a0;
-}
-
-span.remark {
-  font-style: normal;
-  color: #707070;
-}
-
-.screen {
-  background: #e7ffc7 none repeat scroll 0% 50%;
-  border-color: #94DA3A;
-}
-
-.programlisting {
-  background: #F0F4FF none repeat scroll 0% 50%;
-  border-color: #B4BAEA;
-}
-
-.prompt {
-  color: #448844;
-}
-
-div.note, div.tip {
-  background: #ffffc9;
-  border-color: #B4BAEA;
-}
-
-div.note, div.warning, div.tip {
-  border-style: solid;
-  border-width: 1px;
-  padding: 1em;
-}
-
-.note .title {
-  font-size: 90%;
-}
-
-.comment {
-  font-size: 80%;
-}
-
-div.comment, div.new_comment {
-  padding: 0.5em;
-  margin: 0.5em;
-  margin-left: 2em;
-  border-style: solid;
-  border-width: 1px;
-  border-color: #aaaaff;
-}
-
-div.comment {
-  background: #eeeeff;
-}
-
-div.new_comment {
-  background: #d0d0ff;
-}
-
-.commenttoggle {
-  opacity: 0.35;
-}
-
-.comment_help {
-  font-size: 80%;
-}
-
-.comment_header {
-  opacity: 0.75;
-}
-
-.comment_id {
-  float: right;
-  opacity: 0.3;
-  font-size: 60%;
-}
-
-.comment_name {
-  font-weight: bolder;
-}
-
-.comment_reviewed {
-  color: darkgreen;
-  margin-left: 1em;
-  font-style: italic;
-}
-
-.comment_date {
-  opacity: 0.75;
-}
-
-.comment_thanks {
-  color: darkblue;
-  margin-left: 1em;
-  font-style: italic;
-  font-weight: bolder;
-}
-
-.comment_error {
-  padding-left: 1em;
-  font-weight: bolder;
-  font-size: 80%;
-  color: darkred;
-}
-
-.hgbookfooter {
-  width: 60em;
-  margin-left: auto;
-  margin-right: auto;
-  margin-top: 2em;
-  padding: 2em;
-  margin-bottom: 2em;
-  font-size: 80%;
-  color: #727272;
-  border-top: 1px solid grey;
-}
-
-.hgbookfooter a {
-  color: #5555ff;
-}
-
-.hgbookfooter a:visited {
-  opacity: 0.7;
-}
-
-.hgbookfooter img {
-  vertical-align: -45%;
-}
-
-table.equation a.commenttoggle {
-  text-align: right;
-  display: block;
-}
-
-div.comment, div.new_comment, form.comment {
-  text-align: left;
-}
--- a/web/texpand.py	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-#!/usr/bin/env python
-#
-# Use Django's template machinery to expand static web pages.  First
-# tries the default template path for a particular installation, then
-# looks for templates in the filesystem.
-
-import sys
-sys.path.append('/home/amit/hgbook-alqua/web/hgbook')
-import hgbook
-from django.template import Context, TemplateDoesNotExist
-from django.template.loader import get_template, get_template_from_string
-from django.core.management import setup_environ
-import hgbook.settings as settings
-
-
-setup_environ(settings)
-c = Context()
-
-if len(sys.argv) == 2:
-    in_name = sys.argv[1]
-    out_name = 'stdout'
-    out_fp = sys.stdout
-elif len(sys.argv) == 3:
-    in_name = sys.argv[1]
-    out_name = sys.argv[2]
-    out_fp = None
-else:
-    print >> sys.stderr, 'Usage: %s template-file [output-file]'
-    sys.exit(1)
-    
-try:
-    t = get_template(in_name)
-except TemplateDoesNotExist:
-    t = get_template_from_string(open(in_name).read(), name=in_name)
-if out_fp is None:
-    out_fp = open(out_name, 'w')
-out_fp.write(t.render(c))
-out_fp.close()
--- a/web/texpand.py~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-#
-# Use Django's template machinery to expand static web pages.  First
-# tries the default template path for a particular installation, then
-# looks for templates in the filesystem.
-
-import sys
-sys.path.append('/home/amit/hgbook-alqua/web/hgbook')
-from django.template import Context, TemplateDoesNotExist
-from django.template.loader import get_template, get_template_from_string
-from django.core.management import setup_environ
-import hgbook.settings as settings
-
-
-setup_environ(settings)
-c = Context()
-
-if len(sys.argv) == 2:
-    in_name = sys.argv[1]
-    out_name = 'stdout'
-    out_fp = sys.stdout
-elif len(sys.argv) == 3:
-    in_name = sys.argv[1]
-    out_name = sys.argv[2]
-    out_fp = None
-else:
-    print >> sys.stderr, 'Usage: %s template-file [output-file]'
-    sys.exit(1)
-    
-try:
-    t = get_template(in_name)
-except TemplateDoesNotExist:
-    t = get_template_from_string(open(in_name).read(), name=in_name)
-if out_fp is None:
-    out_fp = open(out_name, 'w')
-out_fp.write(t.render(c))
-out_fp.close()