home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
509.lha
/
CShell_v5.13
/
tips.doc
< prev
Wrap
Text File
|
1991-05-06
|
3KB
|
112 lines
Some good ideas:
EDITING
The very common situation:
$ mkdir documents
$ cd documents
can be abbreviated to:
$ mk documents
$ [CTRL-T] (inserts all but first word of previous line)
Also very common:
$ mv document document1
$ mv document[CTRL-P]1
The CTRL-P function duplicates the previous word on the command line
You might have wondered what CTRL-N (leave current line) is good for.
Assume, for example, you just typed
$ rm dh1:graphics/lo-res/gorilla
when it comes to your mind that would prefer to keep a copy of that pic on
diskette. Many would now delete this command line. Being a smart guy, you
do the following:
$ [CTRL-N] (leaves this command line alone)
$ co[CTRL-T] df0:
$ [Up-Arrow][Up-Arrow] (gets back the command line you left)
In case you don't know what history completion is:
$ search *.c *.h makefile foobar
$ ram:
$ dir
$ rm tmpfile
Now if want to repeat the search command, enter
$ se[Shift-Up-Arrow]
which brings up the the last command that started with 'se'.
If you want to delete the file
$ rm dh2:comm/uucp/mail/junk/409
and you're far away from that directory, enter
$ ju[ESC-c]409 (enters the resulting path of cd ju)
The same function is also usable for 'cd'. Assume you have several 'junk'
directories:
$ ju[ESC-c][CTRL-R][CTRL-R][CTRL-R]
Like this you'll cycle through the junk directories. When you've got the
right one, press enter.
Assume there are the files comm1.c, comm2.c, and comm3.c as well as their
corresponding .o files. You want comm3.c:
$ co[Shift-Tab]1[Tab]
Of course this is more useful with longer file names.
You can tab file name expand any patterns, not only abbreviations. Assume
you want to delete all .c files in the current directory but the last:
$ rm *.c[ESC-Tab][CTRL-W]
In addition, you get to see all the files once again before deleting them.
Next one: You have entered:
$ dir
$ foreach i ( *.c ) "e >>ram:temp $i
$ more ram:temp
and you would like to execute the same three statements again, enter:
$ [Up-Arrow][Up-Arrow][Up-Arrow][ESC-Return][CTRL-R][CTRL-R]
I know that the editing is not very user friendly. This is because it's
quite hard and troublesome to get raw keycodes from the console, and it's
impossible to get them from a VT200 terminal. Therefore I had to stick
with CTRL and ESC combinations. Once you have learnt them (some of them are
similar to EMACS), you can save lots of typing.
COMMANDS
My advice here is clear: Use aliases, aliases, aliases. In order to be
able to create them as quickly as possible, create an alias (e.g. 'le')
that edits your login file, plus another one (e.g. 'lx'), that re-executes
it. My login contains almost only aliases, everthing else I've put in
'firstlogin.sh'.
If you don't like the default options of one command, you can add more of
them using an alias:
$ alias dir "dir -q
From now on, blocks will no longer be displayed in 'dir'.
If your aliases have arguments, e.g.
$ alias sc "search *.c
problems arise when you try to specify options. e.g. case sensitivity:
$ sc -c "hello world
this will obviously not work. That's what @pickopts is good for:
$ alias sc "%a search @pickopts( $a ) *.c @pickargs( $a )
Once you have more aliases, it is useful to keep them sorted. You might
also document them: Create a file 'aliases.doc', and perform
$ set _man aliases.doc csh.doc
That way, you can document them in a separate file.