Various scripts that may be useful
These are free to use, but please acknowledge the source
Some of thes scripts were written to work with HP-UX, and some with Solaris. Some contain code for both. If you improve on them, please email me a copy. Note that some of these use 'awk' which is equivalent to 'nawk' on many systems. If 'awk' is not 'nawk' on your system, you may have to replace 'awk' with 'nawk'. They are not intended to be polished examples.
No responsibility is taken - use at your own risk.
All respond to an argument of '-h' with a help message. These entries are raw text rather than HTML files so that they can be saved and used as is rather than having to edit out the tags. Netscape sees them as text. Other browsers may object to the lack of HTML tags.
adjtime Nudges system time forwards or backwards by seconds or minutes rather than setting to an actual time.
cmt Compares trees for existence/non-existence of files, file dates, owners etc. Does not compare file contents.
crontest Allows editing of a 'crontab' file and re-submits with the time set to one minute hence. Helps testing of 'crontab' entries. Use with care.
datediff Computes the number of days between two supplied dates. Simplistic. See '-h' help.
discs On Solaris only, lists the logical volume and device names making up each mount point. Uses 'metastat', hence Solaris only. I have an HP version when I can find it.
display Hunts back up the process tree for a process with a '-display' argument. Outputs a line which, when 'exec'd by a shell, sets the DISPLAY variable. Output suitable for $SHELL unless -sh|-ksh|-csh specified. Useful when an xterm knows its display, but the shell in it has its DISPLAY variable reset wrongly by a .profile.
mdiff Shows which pairs taken from a set of files are equal and which are not. Will show the differences if asked.
mping Pings a range of IP addresses to determine which ones respond. Contains a control to limit the number of pings active at any one time to 10
nxt Stores its arguments away in a file, and when called without arguments, returns the next on the list. A sort of ordered to-do list with one word items.
path Searches the PATH directories for files named the same as the arguments. If none are found or '-f' given, files that are superstrings of the arguments are listed. Rather like 'which' but lists all occurances on PATH. Useful when you can't remember the name of a command but know it contains 'xyz'.
scriptscan Scans a script counting various punctuation types. Can show quote imbalance etc.
today Outputs command strings that when 'eval'd set shell variables according to the date. Can also handle yesterday and last working day (skips weekends but not other holidays).
manage Helps manage a network of Unix boxes. Lets you maintain a local directory tree where each directory is named after some data item (such as /etc/passwd or the memory size) from a host, with the values in files named by the hostnames. e.g. file etc.passwd/zaphod contains a copy of /etc/passwd from the host 'zaphod', and memory/zaphod would contain "512Mb" if 'zaphod' had that memory size. 'manage' works with the dataset appropriate to the current working directory when the command is issued. Files such as /etc/passwd are handled directly. Other files that are in different locations on different OS's (such as cron.allow) or contain data that has to be extracted by command are handled by plugin ksh functions. In many cases the remote files may be reloaded from the local copy. Many functions are included. It is most useful if user and root equivalence (possibly by .rhosts) is allowed. 'manage' has a built-in self editor function that allows new data sets to be added easily. Datset directories may contain '.[a-zA-Z]*' files to control which OS types a dataset is relevant to, and the need for root access to read or write that data. If root equivalence from the managing node is available.
Some documentation is available from the -h option.
Last updated 12th January 2000
|