[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shell under emacs

Robert D. Crawford a écrit :
> "mooncar@libero.it" <mooncar@libero.it> writes:
>>Hi!  I have installed emacs with speech support,now it works well,but
>>the boy who is using that tells me he needs to use the command M-x
>>shell, in emacs.  Is it possible to recall the commands that he have
>>just issued, like in the linux shell out of emacs?now he must re-type
>>the commands...  I have tryied to find a solution but I don't use that
>>program-I only installed and tryied if it's working- so if someone can
>>help...  thanks in advance, veronica
> In shell mode, you can move point around in the buffer.  You can go to
> any previous line and hit return at the end of the command line to
> re-execute the command.
> Alternatively, you can look at the bash man page to see what switch is
> needed in the definition of the command prompt to give the number of the
> command in history.  Then, if you know that 3 commands ago you used the
> same command that you need now, you can look at what the command number
> is in your prompt, subtract 3 and use !command-number (that is,
> ecxclamation point followed by the command number).

In bash, there exist some shortcuts as the following ones :
run "my_previous_command" with the same arguments as it used at its last 

run the last command again with the same arguments

run the penultimate command  (command 3 if you launch the 5th command)

> One other solution is to use the history command to get a list of the
> previous 500 commands.  pipe this through grep to search for a
> particular string.

You also can use the emacs mode under bash to search a previous command 
invocation with any pattern introduced by C-r that you can repeat (or 
modify) again with C-r until you get the searched string.


To unsubscribe from the emacspeak list or change your address on the
emacspeak list send mail to "emacspeak-request@cs.vassar.edu" with a
subject of "unsubscribe" or "help"

Emacspeak Files | Subscribe | Unsubscribe | Search