|
|
1.1 ! root 1: .TH = 1 ! 2: .CT 1 shell ! 3: .SH NAME ! 4: =, ==, =p, ==p \- redo previous shell command ! 5: .SH SYNOPSIS ! 6: .B = ! 7: [ ! 8: .I pattern ! 9: ] ! 10: [ ! 11: .I substitution ... ! 12: ] ! 13: .br ! 14: .B == ! 15: [ ! 16: .I pattern ! 17: ] ! 18: [ ! 19: .I substitution ... ! 20: ] ! 21: .br ! 22: .B =p ! 23: [ ! 24: .I pattern ! 25: ] ! 26: [ ! 27: .I substitution ... ! 28: ] ! 29: .br ! 30: .B ==p ! 31: [ ! 32: .I pattern ! 33: ] ! 34: [ ! 35: .I substitution ... ! 36: ] ! 37: .SH DESCRIPTION ! 38: The ! 39: .I = ! 40: command provides a simple history mechanism for the shell, ! 41: .IR sh (1). ! 42: The environment variable ! 43: .BR HISTORY , ! 44: if set, ! 45: names a file to which ! 46: the shell appends the text of each command before execution. ! 47: .I = ! 48: searches the history file for the most recent ! 49: command that matches the ! 50: .I pattern, ! 51: performs the ! 52: .IR substitutions, ! 53: and executes it. ! 54: The ! 55: .I pattern ! 56: must agree with an initial substring of the original ! 57: command except for variations in spacing. ! 58: If no ! 59: .I pattern ! 60: is specified, the most recent command is selected. ! 61: If no ! 62: substitution ! 63: is specified, the command is executed without modification. ! 64: .PP ! 65: .PP ! 66: Substitutions have the form ! 67: .IP ! 68: .IB old = new ! 69: .LP ! 70: specifying that the string ! 71: .I old ! 72: in the command is to be replaced by ! 73: .I new. ! 74: Substitutions are made in order ! 75: and operate on the first match. ! 76: .PP ! 77: The ! 78: .I == ! 79: command is identical to ! 80: .IR = , ! 81: but allows the substituted command to be edited before running. ! 82: The command is printed, ! 83: and a modification request is read from the terminal. ! 84: Generally each character in the request specifies how to ! 85: modify the character immediately above it: ! 86: .TP ! 87: .B # ! 88: Delete the character. ! 89: .PD 0 ! 90: .TP ! 91: .B % ! 92: Replace the character with a space. ! 93: .TP ! 94: .B ^ ! 95: Insert the rest of the request line before the character. ! 96: .TP ! 97: .B $ ! 98: Replace the characters in the command from this position on ! 99: with the rest of the request line. ! 100: .IP "space or tab" ! 101: Leave the character(s) unchanged. ! 102: .TP ! 103: .B = ! 104: Must be the first and only edit character. ! 105: Back up to the next most recent ! 106: match in the history file ! 107: and try again. ! 108: .IP "any other" ! 109: This character replaces the one above it. ! 110: .PD ! 111: .PP ! 112: If the request line is longer than the command, ! 113: the overhang is appended to the command. ! 114: .PP ! 115: .I =p ! 116: and ! 117: .I ==p ! 118: behave like ! 119: .I = ! 120: and ! 121: .IR == , ! 122: except that they print the command on ! 123: their standard output instead of executing it.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.