----------------------- example in bash -------------------------------- klim@moose:~/tmp> cat sum-num.sh #!/bin/bash <----- program starts <-- sum=0 <-- while read arg; do <-- sum=`expr $sum + $arg` <-- done <-- <-- echo "The sum is $sum" <----- program ends klim@moose:~/tmp> cat N 123 <----- input data 22 <-- 3 <-- 3 <-- 322 <-- klim@moose:~/tmp> ./sum-num.sh < N <--- run the program The sum is 473 <--- the answer klim@moose:~/tmp> bash -x sum-num.sh < N <--- run the program again + sum=0 <--- the detail scenario + read arg <-- ++ expr 0 + 123 <-- + sum=123 <-- + read arg <-- ++ expr 123 + 22 <-- + sum=145 <-- + read arg <-- ++ expr 145 + 3 <-- + sum=148 <-- + read arg <-- ++ expr 148 + 3 <-- + sum=151 <-- + read arg <-- ++ expr 151 + 322 <-- + sum=473 <-- + read arg <-- + echo 'The sum is 473' <-- The sum is 473 <-- klim@moose:~/tmp> ----------------------- note in python -------------------------------- --- xxxxxx.py : the python source --- --- xxxxxx.pyc: the compiled python code --- --- xxxxxx.pyo: the compiled python code with optimization --- -------------------------------------------------------------------------- klim@moose:/usr/lib/python2.6> ls BaseHTTPServer.py fractions.py* quopri.pyc BaseHTTPServer.pyc fractions.pyc quopri.pyo BaseHTTPServer.pyo fractions.pyo random.py Bastion.py ftplib.py random.pyc Bastion.pyc ftplib.pyc random.pyo Bastion.pyo ftplib.pyo re.py .............. .............. formatter.pyo pydoc_topics.py zipfile.py fpformat.py pydoc_topics.pyc zipfile.pyc fpformat.pyc pydoc_topics.pyo zipfile.pyo fpformat.pyo quopri.py* klim@moose:/usr/lib/python2.6>