Operating System - HP-UX
1830066 Members
17477 Online
109998 Solutions
New Discussion

the r "repeat" command ..

 
SOLVED
Go to solution
someone_4
Honored Contributor

the r "repeat" command ..

Hello everyone ..
by accident I typed
#r
and it repeats the last command that I typed. I started to play around with it and
#r 1
repeats the fist command in the .sh_history file.
#r 3
repeats the 3rd command and so on.
I was wondering if anyone had more info about the r command. There are no man pages about it.

Richard
4 REPLIES 4
Sanjay_6
Honored Contributor
Solution

Re: the r "repeat" command ..

Hi Richard,

"r" is an alias. Do a "man fc" which is the original command. r aliases to fc -e

Hope this helps.

Regds
Helen French
Honored Contributor

Re: the r "repeat" command ..

Hi Richard,

There will be an alias set to 'r'. Check it by using:

# alias

It will be something like

r='fc -e -'

HTH,
Shiju
Life is a promise, fulfill it!
Helen French
Honored Contributor

Re: the r "repeat" command ..

Hi,

Again do a 'man fc' that will tell you why you have got the last command.

HTH,
Shiju
Life is a promise, fulfill it!
harry d brown jr
Honored Contributor

Re: the r "repeat" command ..

man ksh:

For example, if r is aliased to fc -e -,typing r bad=good c re-executes the most recent command that starts with the letter c and replaces the first occurrence of the string bad with the string good.

live free or die
harry
Live Free or Die