From: A.Raman@massey.ac.nz (Anand V Raman)
Subject: Indhist (shar) part 3 of 4
Organization: Massey University Computer Centre
Date: Sun, 4 Oct 92 04:23:43 GMT

# --- Cut here and throw this line away --- Indhist part 3 of 4 begins ---
X int argc;
X char **argv;
X {
X    char buf[32];
X    
X    (void) srandom(time((time_t *) 0) * getpid());
X    if (argc > 1 && *argv[1] >= '0' && *argv[1] <= '9')
X       (void) sprintf(buf, "%ld\n", random() % (atol(argv[1]) + 1));
X    else
X       (void) sprintf(buf, "%ld\n", random());
X    (void) printf("%s", buf);
X    return 0;
X }
X                 
End of random.c
echo Extracting readme.1st 1>&2
sed 's/^X //' >readme.1st <<'End of readme.1st' && chmod 644 readme.1st
X # readme.1st, Introduction and Preliminary notes on Indhist
X # anand v raman, 30 Aug 1992
X 
X                           Welcome to Indhist
X                           ~~~~~~~~~~~~~~~~~~
X 
X                               DEDICATION
X                               ~~~~~~~~~~
X    I would like to dedicate Indhist to the memory of my grandfather,
X          Sri S.K. Srinivasan, who kept his word and never died.
X                                  
X 
X    The purpose  of Indhist is not  to glorify Indian heritage beyond
X    recognition.  Nor is it  to  encourage a certain kind of arrogant
X    chauvinism.  On the contrary, it is to show that the great Indian
X    civilization, like the Chinese  and Ethiopian  before it,  was no
X    more  profound a civilization than  any  other, and certainly not
X    any more than the mighty European, but on the other hand, no less
X                                either.
X 
X 
X UNPACKING INDHIST
X -----------------
X 
X When you unpack the shell archive, you should find the following
X files in it:
X 
X 0. Indhist1.0/readme.1st    : This file
X 1. Indhist1.0/readme.2nd    : Essay 1
X 2. Indhist1.0/readme.3rd    : Essay 2
X 
X 3. Indhist1.0/INSTALL       : Makes the binaries, installs, etc.
X 4. Indhist1.0/Indhist       : Executable + Database
X 5. Indhist1.0/fifo          : Shell script for a named pipe
X 6. Indhist1.0/Indhist.8     : Indhist manual page
X 
X 7. Indhist1.0/random.c      : C program to generate a random number
X 8. Indhist1.0/getopt.c      : C program to parse options to shell script
X 
X INSTALLATION NOTES:
X -------------------
X 
X After  unpacking Indhist and  verifying its contents,   you are almost
X ready to go.   If everything went well,  you should find  a  directory
X called Indhist1.0   in  your current  directory.   Change    into that
X directory and type  INSTALL   (all   upper case)  and answer  the  few
X questions it asks you.  INSTALL will place  all the requisite binaries
X in the right  places for you.  The manual page will  not be installed.
X You must do that yourself.  (If you can handle shell scripts, it might
X help to  look into INSTALL to  see if you  need to tailor  it a little
X before you run it.  Strictly speaking this shouldn't be necessary.)
X 
X When INSTALL completes, you are ready to use Indhist or fifo.  You may
X want to read the Manual page on them before you start.   If your pager
X cannot detect nroff documents and automatically  invoke nroff for you,
X you may have to type
X 
X nroff -man Indhist.8 | more
X 
X Also read the section in this document on troubleshooting  Indhist for
X most of the common problems you could encounter.
X 
X HOW TO USE INDHIST AND FIFO
X ---------------------------
X 
X When Indhist is run, it prints a random record from  its database (See
X the manual page on Indhist for  more details on  this).  In that sense
X it functions somewhat  similar to the program  fortune (ucb).  You can
X include  a call to  Indhist from  within  your  .login  script, so one
X random record is printed out every  time you login or alternatively in
X your .logout  so you can  read  it while  logging  out.  You  can even
X include a call to Indhist in both .login and .logout if you love India
X so much, but be careful not to be mistaken for a chauvinist.
X 
X Using fifo, you  can create named pipes on  the filesystem.  Then each
X time the named  pipe is opened, it  delivers a new record.  Your named
X pipe could be called .plan and placed in your home directory,  so each
X time someone fingers you it prints a new record (Note that some finger
X daemons are clever enough to  not look at  .plans that are fifos),  or
X you could call  your  fifo .signature.   This is strongly discouraged.
X Most mailers and  news posters  implicitly append this  file to  *any*
X posting you make  so you could   end  up posting a note  about  Indian
X history  to  soc.culture.brazil,   or     what's  even    worse,    to
X comp.unix.wizards.
X 
X To save you flames, I'd suggest  you stay away  from calling your fifo
X .signature.   The default   name  for  the fifo is .signature.indhist.
X This works just as  well and most editors  allow  you to include files
X within  other files.  Since you  have  to  edit Mail and News articles
X before posting them, it is just one small step to  append this file to
X the end of your article before you send it off.  This way you even get
X to  know which record you're tagging  on to your   signature.  Beware!
X some records in Indhist are over  20 lines in  length, so if you let a
X program handle the record insertion independently, you could be flamed
X for posting a signature that is many times bigger than what you had to
X say in  your article.   If this  doesn't suit you because  you usually
X mail or post off the fly using cat |, then you probably don't care too
X much for fellow net users anyway, so a few flames won't bother you.
X 
X I've  noticed that emacs seems  to   include 0  bytes   when  you  try
X inserting a fifo into  your document.  This can  be bypassed, however.
X You can run the Indhist or fifo command within  an inferior  shell and
X include  its   contents into  the   emacs  buffer.  To do   this, type
X M-x shell-command.  Then type in either one of:
X 
X Indhist
X fifo
X cat .signature.indhist    (if the fifo already exists)
X 
X Then you can  yank the contents  of the buffer  *Shell Command Output*
X into  your current buffer.  The  emacs manual will tell  you how to do
X that.
X 
X TROUBLESHOOTING:
X ----------------
X 
X 1. Indhist
X 
X I'm assuming that you have sh(1) sed(1) and expr(1) which are all part
X of a basic  UNIX  distribution  on  your system.   If  you don't, then
X there's  no use  going any further,  Indhist simply won't run.  If you
X do, there's no reason why  Indhist won't work.  However,  to be on the
X safe side, maybe  you can check  the permissions on the script Indhist
X and  whether Indhist  is in a   directory that is  part  of  your PATH
X environment variable.
X 
X -   1.a) Indhist prints less than random records:
X 
X If you find that that the records that Indhist prints are more or less
X sequentially selected from the  database, (In practice there's  no way
X of finding  this  out  unless  you  keep  running  Indhist    in rapid
X succession continuously, which is strongly  discouraged) then probably
X the random command  must  be  failing for some  reason; the script has
X been   using    expr(1) which yields less   than   random numbers.  It
X shouldn't really matter as long as you abide by my suggestions and use
X Indhist sparingly.  But  if you  want  really random  records and want
X them soon after each  other, then you  must look  at  fixing the small
X random binary, the details of which I won't go into here.
X 
X 2. fifo
X 
X Fifo is a slightly larger script  than  Indhist.  So  it is likely you
X may encounter some   more problems  with  it.  For  a start, you  must
X ensure  that you have the following  programs  if fifo  is to function
X properly:
X 
X 1. getopt       (also supplied with this package)
X 2. test
X 3. cat
X 4. mknod
X 5. true
X 6. echo
X 
X Now, if you don't have getopt on your system, you could compile up the
X Public domain one which I picked up from  an anonymous ftp site and am
X distributing with this package.  It is  by Rich Salz of Mirror Systems
X (rs@mirror.tmc.com).  If you like, you may even write your own or pick
X up one from your  favorite ftp site.   It should be compiled and  made
X available  from  a directory in  your PATH.   If  you  used INSTALL to
X install Indhist,  you shouldn't need  to worry  about this as  it will
X ensure you have a working copy of getopt.
X 
X -   2.a) Catting fifo sometimes prints more than one record:
X 
X If  this happens,  then  edit the  file   fifo and uncomment the  line
X containing the sleep near the very  end  of the script.  That will fix
X it.
X 
X -   2.b) I've got my fifo set up, but catting it just seems to hang:
X 
X Remember that fifos  are almost the same as  pipes.  You cannot  write
X into a fifo on one machine and try to read what  you  wrote on another
X machine where the fifo is made available via NFS.  In order  to read a
X fifo that had  just been written  into, you   must  have performed the
X write on the same machine you are reading the fifo from.
X 
X If that's not why the cat hangs, then you must make sure  you have the
X fifo process in  your background.  To  check this, type  ps -x.  On my
X system the ps output looks like this:
X 
X   PID TT STAT   TIME COMMAND
X  6717 p0 I      0:04 -tcsh (tcsh)
X  6990 p0 S      0:00 sh fifo -df
X  6995 p0 S      0:00 sh fifo -df
X  7005 p0 R      0:00 ps -x
X 
X If you don't   see the two  lines  showing your  fifo processes,  then
X they're probably dead, which explains why  your  named pipe is silent.
X Maybe someone (a superuser) killed your daemon's when you were out, or
X your .logout is setup  to automatically kill  all your  processes when
X you log out. In any case you can get it going again by typing fifo -df
X 
X -   2.c) finger seems to ignore my .plan file set up to be a fifo
X 
X Finger(1) could ignore   the .plan file and  keep  printing "No plan."
X under two  circumstances.  The first  is if your .plan is inaccessible
X to the world.  Check  the permissions on the  .plan file and your home
X directory.  "ls -ld . .plan" should print something like:
X 
X drwxr-x--x 26 ARaman       1536 Jun  2 18:09 .
X prw-r--r--  1 ARaman          0 Jun  2 17:32 .plan
X 
X In most  cases, this can  be fixed by just setting  the  mode on these
X files using chmod(1).  Try typing "chmod 751 ." and "chmod 644 .plan".
X That  should fix  it.  If it  doesn't, then  it  is probable  that the
X finger(1)  daemon on your system requires  .plan to be a regular file.
X You can  check this out quickly by   creating a regular file  for your
X .plan with the same permissions as your  fifo and then running finger.
X There's nothing much you can do if this is the case.
X 
X -   2.d) Inappropriate error messages are printed when fifo is run:
X 
X Sometimes, meaningless  error  messages have been   seen to occur when
X running  fifo.    Most   commonly  these   are stty  complaints  about
X unsupported  operations  etc.  Vijay Rangarajan  (vijay@ncsa.uiuc.edu)
X has traced these  problems to  being  caused by /usr/ucb/which (called
X near the very beginning of fifo) that sources your  ~/.cshrc file.  If
X this happens, the fix he suggests is that  you move your stty settings
X from your .cshrc file into your .login file.
X 
X -   2.e) fifo -d keeps printing `cat' error messages:
X 
X Remember that fifos don't get along too well with  NFS.  What's worse,
X some cats don't return proper  exit statii to  their shells when their
X writes  fail.  I know this  happens at least on  our  Pyramid.  So the
X only way you can sometimes tell if fifo has gone bonkers is if you see
X a recurrent message on your screen that goes
X 
X cat: output write error
X .
X .
X .
X 
X when fifo is operating as a daemon.   This  only happens  if fifos are
X not supported across your NFS and the directory you chose to keep your
X fifo happens to  be NFS mounted from  some other hetergenous host.   I
X haven't been able to fix this problem, but I managed to get  a  cat in
X the pipeline so if something goes wrong, at least the cat will squeal.
X The only  thing you can do  if this  happens is to get the  pid of the
X fifo process and kill it.  You probably want to do this in a hurry, so
X remember that ps(1) usually won't  show up daemon processes.  You must
X specify the -x switch to  ps(1).  This means  you  can't run the fifo,
X but you still have Indhist.  Alternatively, you could try  making your
X fifo on a locally mounted disk.
X 
X Also,  I don't  detach the daemon from the  control tty.  I thought of
X supplying another binary that  does  the ioctl call  to do  this,  but
X realized it wasn't  worth the  trouble.  Most  of us   aren't  running
X /bin/sh anyway, so keyboard   signals don't  get propagated  to  child
X processes.
X 
X HOW TO GET THE MOST OUT OF INDHIST:
X -----------------------------------
X 
X The following tips may be helpful in  prolonging the enjoyment you get
X out of Indhist.
X 
X  * Please read the essays  distributed along with Indhist.   They reflect
X    some  of the sentiments which have  directly gone into the  making  of
X    Indhist.  However, remember that Indhist will still be useful  even if
X    you don't agree with these essays.
X 
X  * Never print more than a few records a day.
X 
X  * Never open the data file and read its contents.
X 
X  * Don't use records from Indhist in your signatures for articles or mail
X    not related to Indian culture.
X 
X  * Don't edit Indhist to doctor any of the records.
X 
X HOW TO CONTRIBUTE:
X ------------------
X 
X You can contribute to Indhist in various ways.  The first of these, of
X course, is to popularize it among your Indian  friends, especially the
X younger  ones who   have prematurely   lost   touch  with the   Indian
X civilization, and get them to use it.
X 
X Also:
X 
X 1)  You can help  add to the  existing database in Indhist.  Since I'm
X volunteering to distribute  the package, you  can mail me the records,
X and if the record  seems appropriate  enough  to go into the database,
X I'll  make  sure it is  put   in and your  name  added to the  list of
X contributors.   You  should  get  a  general   feel  of what  kind  of
X historical  notes I hope  to  include in Indhist after  a few weeks of
X using it.  Generally,    I place   a  greater   value  in   historical
X observations  about  a  country by  a   person  not also of that  same
X country.  This  is not  because they  may  be any more    objective or
X accurate, but  because such observations are  usually easier to defend
X against a charge  of `delusions of  grandeur.'   That is why I haven't
X included any  observations  regarding India  from Basham, although his
X book abounds with many of them.
X 
X 2) You can help port the  program to environments it currently doesn't
X run on.  You  can  perhaps  write a PC  version of Indhist, (I realize
X that fifos cannot be implemented on the PC)
X 
X 3) Arrange  for Indhist to be made  available  via anonymous ftp.  You
X must provide me with  some publically readable  disk space I can write
X the latest versions into.
X 
X 4) Suggest improvements to Indhist and give me some feedback about it.
X 
X 5) Notify me of any bugs you happen to discover in Indhist.  (It seems
X in ancient India, if  a chemist should discover  a new poison, he will
X be punished for it unless he also discovers an antidote. I won't be so
X demanding.  I'll be happy if  you can just notify  me of the bugs, but
X happier if you fix them and send me the fixes.)
X 
X 6) Send little  notes  of appreciation to  the people  in  the list of
X contributors when the  list has grown  longer, assuming of course, you
X like certain aspects of Indhist.
X 
X LIST OF CONTRIBUTORS:
X ---------------------
X 
X Programs:
X ~~~~~~~~~
X Indhist (Unix shell script)     anand v raman (A.Raman@massey.ac.nz)
X fifo    (Unix shell script)     anand v raman (A.Raman@massey.ac.nz)
X indhist (PC executable)         any takers?
X indhist (VMS executable)        any takers?
X getopt  (Unix binary)           Rich Salz (rs@mirror.tmc.com)
X random  (Unix binary)           anand v raman (A.Raman@massey.ac.nz)
X 
X Essays:
X ~~~~~~~
X         1) I really dread the day we Indians turn out to be like the Chinese
X                 - anand v raman (A.Raman@massey.ac.nz)
X         2) The problem of the destitute East
X                 - anand v raman (A.Raman@massey.ac.nz)
X 
X Databases:
X ~~~~~~~~~~
X Indhist (Indian History):
X 
X         Records 0-51 (McCrindle's translations)
X            - anand v raman (A.Raman@massey.ac.nz)
X 
X Acknowledgements:
X ~~~~~~~~~~~~~~~~~
X I would  like to extend  my sincere gratitude  to the following people
X who volunteered  to test out Indhist  and its essays at various stages
X of their development:
X 
X Vijay Rangarajan           (vijay@ncsa.uiuc.edu)
X Sri Vidya                  (vidya@toru.isor.vuw.ac.nz)
X Shankar Vaidya Nathan      (shankarv@microsoft.com)
X Sree Kumar                 (kumar@csc.wcc.govt.nz)
X 
X Thanks are also due  to  everybody who  encouraged the  development of
X this project.  My not mentioning them here individually is  solely due
X to space restrictions  and   in   no way  belittles  their    valuable
X contribution to Indhist.   I also  hope that  none  will  be the least
X inclined to attribute the bugs  in Indhist to those whose  help I have
X acknowledged.
End of readme.1st
echo Extracting readme.2nd 1>&2
sed 's/^X //' >readme.2nd <<'End of readme.2nd' && chmod 644 readme.2nd
X Subject: The value of History in successful assimilation
X Keywords: Civilizations, History, India, China.
X 
X            I dread the day we Indians become like the Chinese
X            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
X 
X Yes!  I really  dread  the  day that we turn out  to be like the Chinese -
X With a  rich culture and  a  great civilization  truly behind us - totally
X ignorant of either.  Robert Temple, who summarized  the pioneering work of
X Prof. Joseph  Neehdam in his  book "Chinese Genius"  talks about a  Jesuit
X Missionary  who visited  China  and was  able to confound  and  amaze  the
X Chinese with a  mechanical   clock,  thus `enlightening' them   about  the
X superiority of Western Civilization [1]. Temple says, further,  that it is
X indeed a  pity that the  Chinese who originally invented mechanical clocks
X had to put up with this kind of intimidation.
X 
X Initially, I found this hard to believe.  Coming  from  India, I was under
X the opinion that national chauvinism is an  integral  part of  any culture
X and  that knowledge about one's `glorious'  past never tends to  fade.  On
X the contrary, I thought, it only tends to keep increasing and become rigid
X with time, often  including even fictitious  events. But after talking  to
X some of  my Chinese  friends, I  find that  this sad fact  is indeed true.
X Perhaps it  is because they are  culturally restrained from  blowing their
X own horns; but that is now irrelevant.  Somehow, an ignorance of their own
X achievements has been forced upon them.
X 
X We Indians can,  of course, sit back  in dispassionate tranquility and nod
X our heads to all this, thinking that we are in some  way immune to such an
X affliction.  But it is happening right  now, before  our very eyes. In his
X book "The Time Machine,"  Wells writes about the eventual  degeneration of
X human beings into two major classes -  The fair  Elo, who while possessing
X exterior beauty are   inwardly naive,  wanting  in  self  confidence   and
X intellectually near   empty, and the gruesome Morlocks   who, on the other
X hand,  are ghastly  in  nature and   bankrupt  in ethics, but  possess the
X intelligence necessary to drive the rest  of the world into subordination.
X Now it  is a fact  that Wells  was rather well  versed  with the annals of
X Indian history;  he  is even known  to  have  admitted  being enamoured by
X Asoka's   magnanimity  [2]. But  whether he    intended  his story   to be
X metaphorical or not,  it certainly seems  to map  rather  cleanly into the
X Indian situation today.
X 
X Two major  classes of Indians  are seen to  be emerging.  One   is the the
X arrogant  type  which  is deliberately blind  to the achievements of other
X societies, particularly the European (for we must not forget that although
X India, Egypt, Greece  and China have  reached pinnacles earlier  on, it is
X predominantly the European achievements of this age that offer us food for
X thought, comfort, luxury and nutrition), and consequently attacks anything
X European  with  a malignant hatred  and unfounded vengeance.  The other is
X the apologetic breed which feels more contempt and disgust towards his own
X land than can even be expected of an inimical foreigner.
X 
X The  objective variety which  can appreciate Shakespeare,   Mozart or Kant
X just  as much as  it delights in Kalidasa,  Thyagaraja or Sankara is  fast
X dying out.  I don't know to what we can attribute this loss. But  I cannot
X help observing that perhaps  this is the  natural process of  decay of any
X civilization.  Personally (Note, this is purely my personal opinion, yours
X may differ), I don't believe in resurrection, whether of Humans, Cattle or
X Cultures.  Civilizations, like people,  are perishable, and must decay one
X day [3].  Only one thing endures - and that is  Change; Only one  thing is
X immortal - and that is Mortality.
X 
X The message of the Gita which echoes that thought  is still as profound as
X it was a thousand years  ago.  Every  minute of   his life, Man  sees  his
X fellow  creatures  dying around him.   Yet,  enveloped by  some  kind of a
X conceited ignorance, he thinks that he alone is going to  live on forever.
X How true that is!  Not only does Man think he is himself immortal, he even
X suffers from the delusion that things that please him are everlasting too.
X The Buddha, if he existed today, would probably berate  us for complaining
X about the sad state of our civilization.   For how can  one expect lasting
X comfort  from  the perishable?  Or expect   anything  of this earth  to be
X everlasting?   In the words of Marco   Pallis, "...deification of race, or
X the nation, now so prevalent  in many Western countries,  is a serious and
X destructive form of  idolatry.  To read  eternal  qualities into things so
X utterly temporal is a symptom of low intellectuality." [4]
X 
X Indeed,
X 
X           The earth, the oceans, and the gods themselves
X           Must perish, how should not the world
X           Of mortals, light as froth, obey the law
X           Of universal death and perish too?  [5]
X 
X One can  only blame oneself for  expecting  permanency in the impermanent.
X Thus do we Indians join with Nachiketa in his plea for the imperishable to
X Yama:
X 
X           Ephemeral things, that which is a mortal's, O Endmaker!
X           Even the vigour of all the powers - they fade away. [6]
X 
X Perhaps this is  an  appropriate point to reiterate   my earlier statement
X that   this is purely my   personal  opinion.    I  happen to believe that
X civilizations do have finite lives and that it is only fair to the rest of
X the world that the Indian civilization, having had its share of  glory and
X arrogance once, must  lapse into senility like  the Chinese and eventually
X into decadence and depravity  like the Ethiopian.   I will attempt  a more
X involved justification of  this  claim in the  following  essay.    But  I
X realize that your opinion on this subject may still differ.   So if you do
X disagree on  this  point,  I must warn you  not to read  ahead, as this is
X quite a fundamental premise I am making in this  argument.  You are likely
X to disagree with the entire essay.
X 
X Now, when a cell finds itself in a dying tissue, it has  two options.  One
X is to  die with the  tissue  pretending to die   an honorable death.   The
X other, of course, is to undergo a transplantation and  assimilate in a new
X tissue.  Should the first option be chosen, then I think it is  within the
X entitlement of the  cell to make its  own  demise less painful.   For that
X purpose, a knowledge  of the history of its  tissue might help.   The cell
X can die in a make-believe world it  creates for itself, under the illusion
X it is still in a healthy tissue.
X 
X If the second option is chosen, then a transfusion must be performed.  The
X cell must  be surgically  removed  and replaced in a  fresh, young tissue.
X However, as  Schrodinger  notes in  his    book "Mind  and Matter,"   this
X transfusion is a tricky  process [7]. It must be  carried out with a great
X deal of care.  We do not wish to lose that glorious heritage behind us, at
X least not till  the assimilation is  complete.   We must not lose sight of
X the past and  proceed blindly  looking only to  the  future.  That is  not
X prudent. A  wise man  knows just as much how  many miles he has covered on
X his journey, as how many more are still  left to  be.  Again History comes
X in useful in helping retain our identity,  should a need arise to manifest
X it, until the assimilation is complete.
# --- Cut here and throw this line away --- Indhist part 3 of 4 ends ---
Xref: sparky soc.history:8801 soc.culture.celtic:6532 sci.archaeology:2580