"Linux Gazette...making Linux just a little less scary! "More 2¢ Tips!Send Linux Tips and Tricks to [email protected].
Contents:
|
Another XTerm Titlebar Trick
Date: Wed, 2 Oct 1996 16:11:35 -0700 (PDT) I have a quick stupid shell script to change the titlebar on the fly: #!/bin/bash echo "]0;$1"where the ^[ is done in Emacs by typing C-q Esc and the ^G is done by typing C-q C-g, or in vi by typing C-v instead of C-q before each control sequence. Then you type: linux$ titlebar "string for window title"Where "titlebar" is the name of your shell script. Dumb, simple, but easy to use... Jonathan Gross Specialized Systems Consultants, 206-782-7733 "A jewel mine of courtesies and a living casket of diplomacy"
|
File Decompressing
Date: Fri, 27 Sep 1996 08:32:37 +0200 (MET DST) Hi there: Here is a script I wrote two years ago, but I think it can be useful for everybody. It can also help in learning shell script programming. The function of this script is to help ppl decompressing compressed files with tar, gzip, compress, arj, zip, etc, and any combination of these compression tools. Just type "gus filename" and the script will call the necessary decompression program.
Thanx in advance, ------------ 8< --------- 8< ---------- 8< ----------- 8< ------------ #!/bin/sh # If you are under ULTRIX use /bin/sh5 instead of /bin/sh (too buggy) ################################################################################ # @(#)gus,v 2.8 11/22/1994 (c) XaBier Vazquez Gallardo
|
Quick Tips from JohnDate: Tue, 08 Oct 1996 08:18:39 -0500 (CDT)From: John M. Fisk [email protected] I recently ran across a "Quick Tip" that might be useful to anyone using the BASH shell. There's a rarely mentioned but very useful feature that's included with it: an online help function that describes all of its built-in functions. To use it you simply invoke it as: % help <builtin>and it displays a brief usage message. To get a listing of all of the topics that are available, simply type in: % helpThis displays a listing of all of BASH's builtin functions. So, for example, if you were interesting in using the "getopts" builtin in order to parse command line options for a shell script, you'd invoke the help function as: % help getoptswhich prints a helpful summary of the function and its invocation. The other thing I recently ran across was the use of the "$()" construct in BASH shell programming. When I first started learning shell programming the construct which I'd seen used for command substitution was something like: DATE=`date + "%A %B %C"`which assigned the output of the date command to the variable DATE. I recently read that this has been deprecated and the accepted construct now for command substitution is the use of the dollar sign and parentheses. The above statement should now be written as: DATE=$(date + "%A %B %C")which has the same effect. This works under both BASH and the Korn shell (I'm not sure if this also works with C-shell derivatives). ____________________________________________________________John M. Fisk
|
Two Tips for the Price of One
Date: Fri, 4 Oct 1996 18:28:05 -0500 (CDT) Just looking at your $0.02 tips and I had some $0.01 tips to add. I liked the perl trick for removing Control-M characters so I made it an alias in my .cshrc file (for the tcsh shell): alias tu "perl -pi.bak -e 's/\r//g;' \!^"Now type "tu filelist" to run the above command. (tu stands for to Unix) Another $0.01 tip: When I used the xterm title bar thingy and I was at a VT, the escape characters would just cause the Linux terminal to beep at me. I now have this in my .cshrc (for the tcsh shell): if ($TERM == "xterm") then alias precmd 'echo -n "\033]2;"`whoami`":"`pwd`"\007"' endifThis puts my login_name:directory in my title bar, but not when I go to a Linux VT. +--------------------------------------------------------------------+ | David Ishee [email protected] | | Mechanical Engineering Senior | | Mississippi State University OS/2 and Linux user | +------------- http://www2.msstate.edu/~dmi1/index.html -------------+
|
The Ultimate Emacs Control M TrickDate: Thu, 3 Oct 1996 10:19:24 -0700From: Rick Bronson [email protected] Hi, Here is the ultimate Emacs Control M Trick: Put the following line in your .emacs file: (require 'dos-mode)and have dos-mode.el, which for me is in ~/lisp/dos-mode.el, some where in your path by putting the following line in your .emacs file: (setq load-path (append load-path (list "/home/rick/lisp")))That's it! Now you can edit native DOS files without having to do any conversion at all. You won't see any ^M stuff in the DOS files, they are removed for you. You can cut and paste between DOS and UNIX buffers and the ^M stuff is handled automatically. dos-mode.el is available in /[email protected]:/pub/gnu/emacs/elisp-archive/modes as dos-mode.el.Z _ | | / /__ .------------------------------------------------------------._______/ (___) | Rick Bronson [email protected] Tel 541-465-9008 _o_ | (___) | Invivo Research http://www.efn.org/~rick \|/ |_______ (___) | 745 Foothill Drive "Onde esta dinheiro?" `---' | \_(___) | Eugene, OR 97405-4651 -- Gal Costa Disk | Golf| `------------------------------------------------------------'
|
VI TrickDate: Sat, 26 Oct 1996 05:11:34 -0500From: John R. Potter [email protected] I thought you might be interested in my favorite vi trick, which is not a vi trick at all. I spend a lot of time in vi edit sessions, usually with two files open moving data between them using the named buffers. Often someone will come in with a 'brush fire' that needs immediate attention and I really don't want to quit my edit session and lose my buffers. So I put it to sleep with Control Z. You can start up another vi edit session, complete with named buffers and everything. They are two complete separate sessions with no ties between them. When the fire is under control you can bring back the original session with 'fg'. I know this is a very simple thing, but for a long time I didn't know you could do it so I would quit the original session. - John Potter
|
XDM ReplacementDate: Thu, 03 Oct 1996 23:26:00 -0400From: Jim Nicholson [email protected]
I'm not sure how well known it is in the Linux community, but Pierre
Ficheux ([email protected]) has written a replacement for the
XDM logon dialog that lets you set up icons for users - sort of like
what you can do on an SGI machine. The file can be had via
ftp://ftp.ibp.fr/pub/linux/tsx-11/sources/usr.bin.X11/xdm-photo-1.1.tar.gz;
more info is available on Pierre's web site
http://alienor.fr/~pierre/index_us.html - Jim Nicholson
This page maintained by the Editor of Linux Gazette,
[email protected]
|