Change/Check
your Term Type Quick
For users of /bin/sh or /bin/ksh, functions provide quick, portable alternatives to aliases and shell scripts. Functions also allow you to change environment variables in your current shell quickly and easily. One of the most common changes you may make is to your
TERM variable, especially if you dial into a modem from
T() {
Put this in either your .profile or /etc/profile (so all logins get it). Type "T" alone tells you the term type, while type "T newterm" ("T ansi", for example) will show you what your TERM was and now is. Caveats to remember: functions do not carry over to sub-shells, so if you shell out of an application the function will not be available. Functions run before any commands in the PATH with the same name, so if there were a /usr/local/bin/T, the function T would run first unless you call "/usr/local/bin/T" directly. Functions are often used in shell scripts to organize and replicate certain steps, but they are not limited to scripts. This is just one example of how functions can be used. The nice thing about functions is that they are portable between Bourne shell and Korn shell (and their derivatives).
Have a Unix Problem
Unix Books :-
Return to : - Unix System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|