Recent Notes

Displaying keyword search results 1 - 3
Created by Dr. Xi on December 04, 2009 04:33:05    Last update: December 04, 2009 04:33:05
Variable Meaning $_ The default or implicit variable. @_ Within a subroutine the array @_ contains the parameters passed to that subroutine. $a, $b Special package variables when using sort() $<digit> Contains the subpattern from the corresponding set of capturing parentheses from the last pattern match, not counting patterns matched in nested blocks that have been exited already. $. Current line number for the last filehandle accessed. $/ The input record separator, newline by default. $| If set to nonzero, forces a flush right away and after every write or print on the currently selected output channel. Default is 0 (regardless of whether the channel is really buffered by the system or not; $| tells you only whether you've asked Perl explicitly to flush after...
Created by Dr. Xi on September 29, 2008 23:03:40    Last update: September 29, 2008 23:04:08
Variables set automatically by shell: Variable Description $# Number of command-line arguments. $- Options currently in effect (arguments supplied to sh or to set). $? Exit value of last executed command. $$ Process number of current process. $! Process number of last background command. $0 First word; that is, command name. $n Individual arguments on command line (positional parameters). The Bourne shell allows only nine parameters to be referenced directly (n = 1-9); the Korn shell allows n to be greater than 9 if specified as ${n}. $* All arguments on command line ("$1 $2..."). $@ All arguments on command line, individually quoted ("$1" "$2" ...). Variables set automatically by Korn shell: Variable Description ERRNO Error number of last system call that failed. LINENO Current...
Created by Dr. Xi on December 12, 2007 20:30:01    Last update: December 12, 2007 20:32:23
This is a script to tail a log file through the web browser. It uses AJAX, apache web server, mod_python, UNIX utilities tail (requires the --lines switch) and wc . The log file may reside on the web server or any other host accessible from the web server through SSH. Although it's written in python, it should be easy to port to other languages such as Perl. Apache httpd.conf : LoadModule python_module modules/mod_python.so ... Python script: import time, os from os.path import basename ...