Thanks for this post. I was about to suggest to (mostly) forget about TSO OMVS 
and start logging in via ssh. You've taken the burden off me :-)


>To edit your command history, press esc-k.  Press additional k keys to get
>older commands. After you have the command you want, you will be in vi edit
>mode. After editing, press enter to submit.



May I add to the above? No matter whether you've setup to use emacs or vi as 
your shell command line editor, the following apploes to shell command line 
editing (I hope it really applies equally to emacs, since I only ever use vi).


Whenever the shell presents you the command prompt, think of it as if you were 
editing the .sh_history file, and are about to add a new line to the end of the 
file. You are in input mode. Whatever you type will be in that line. Hitting 
the enter key will a) terminate that line and b) have the shell process that 
command line.


Hitting ESC while at the shell prompt (remember you're in input mode) will take 
you out of input mode. Vi calls this new mode the "command mode". Keys you type 
will be interpreted as editor commands, while the current file in the editor is 
still the .sh_history line. You now move up in this file with "k" and down with 
"j". So this positions your "one line window view" (the command line) in the 
file.


Once you see the command you've been looking for, hit enter to re-run it as if 
it had just been entered (see above), or, use any editor command to move around 
on the command line ("h" for one character to the left, "l" for on to the 
right), or any editor command to start changing that line ("i" for insert 
before the cursor, "a" for insert after).


There is a notable difference between command line editing and file editing. 
Hitting enter whil in insert mode starts a new line in the later case. In the 
former case it has the shell execute the command. So there is no need to ESCape 
from insert mode into command mode, once you're done with command line editing, 
torun the command.


Finally, don't be afraind from learing that bit of vi Kirk suggested. I'm an 
old MVS guy and I did it when vi became available on MVS (OS/390 V1.x). I've 
never regretted.




--
Peter Hunkeler



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to