Recent Notes

Displaying keyword search results 31 - 36
Created by Dr. Xi on September 29, 2008 23:05:12    Last update: September 29, 2008 23:06:16
These variables are set or used by the Unix shell to modify its behavior. Variable Description ENV=file Name of script that gets executed at startup; Usually, ENV=$HOME/.kshrc FCEDIT=file Editor used by fc (fix command) command. If $FCEDIT is not defined, use $EDITOR, otherwise use the default (vi or ed). FPATH=dirs Directories to search for function definitions; undefined functions are set via typeset -fu . FPATH is searched when these functions are first referenced. HISTFILE=file File in which to store command history. Default is $HOME/.sh_history for Korn shell, $HOME/.bash_history for Bash. If not set, history is lost after logout. HISTSIZE=n Max number of commands to keep in history. HOME=dir Home directory; set by login from passwd file. IFS='chars' Internal field separators. Default is space, tab, and...
Created by Dr. Xi on September 25, 2008 23:16:04    Last update: September 25, 2008 23:16:04
In Perl, you can use the global hash %ENV to get and set environment variables. For example, you may want to add your home directory to PATH in order to start an executable in the directory. #!/usr/bin/perl $ENV{'PATH'} = '/bin:/usr/b...
Created by Dr. Xi on September 15, 2008 18:19:44    Last update: September 15, 2008 18:19:44
Some Ant built-in properties: Property Description basedir the absolute path of the project's basedir (as set with the basedir attribute of <project>). ant.file the absolute path of the buildfile. ant.version the version of Ant the name of the project that is currently executing. It is set in the name attribute of <project>. the JVM version Ant detected; currently it can hold the values "1.2", "1.3", "1.4" and "1.5". ant.home home directory of Ant In addition, Ant provides access to all system properties as if they had been defined using a <property> task. For example, ${} expands to the name of the operating system.
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/ ... Python script: import time, os from os.path import basename ...
Created by Dr. Xi on October 07, 2007 20:54:21    Last update: October 07, 2007 21:49:14
import os # test file exist os.path.... However, os.access tests access with the real uid/gid, not the effective uid/gid. It is intended to be used by setuid apps that need to test whether the real user id has the desired access. The most direct way to see if you can do a certain operation on a file is to simply try it. If you get an error, then you can't do it. You can catch the exception and handle it appropriately.
Created by Dr. Xi on May 01, 2007 02:52:21    Last update: May 01, 2007 02:52:21
To make a tar file out of all the Java sources under ./path/to/directory/: find ./path/to/directory/ -name '*.java' | tar...
Previous  1 2 3 4 Next