summaryrefslogtreecommitdiff
path: root/xed.1
blob: 92323e92b3c15788ccbffc528e2772632b72d69b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
.TH xed 1
.SH NAME
xed \- CURSES based hex/ASCII file editor
.SH SYNOPSIS
.B xed
[
.B \-x
] 
[
.B \-i
] 
[
.B \-r
] 
[
.B \-c
] 
[
.B \-R
] 
.I filename
.SH DESCRIPTION
.B xed
edits
.I filename
allowing individual bytes to be altered, either as hex or as ASCII.
.SH OPTIONS
.B xed
accepts these switches
.TP
.B \-x
Edit the file directly, rather than a memory based copy.  Certain commands are
disabled if this switch is provided (see USAGE).
.TP
.B \-i
Start off in insert mode.
.TP
.B \-r
Start off in regular expression search mode.
.TP
.B \-c
Start off in case insensitive search mode.
.TP
.B \-R
Switch on read only mode (note this mode cannot be toggled whilst in
.B xed
).
.SH USAGE
.B xed
is a simple hex and ASCII based file editor.  The display is made up of a
banner, which describes the file being editted; the size of the file (in hex);
the cursor position within the file (in hex); whether you are operating in
overtype or insert mode; whether you are in simple string or regular 
expression search mode and the case sensitivity of the search.
.LP
Below the banner is the editting area, with the file offset and hex listing on 
the left, and the ASCII on the right.
.LP
.B xed
operates within two modes when editting; hex and ASCII.  Below are
the key commands valid in each mode.  Note that all the editting, saving and
undo keys are ignored in read-only mode.
.TP
HEX MODE
.TP 
Cursors keys
Move around file
.TP
h j k l
As above
.TP
< , ^B
Move back one page
.TP
> . ^F
Move forward one page
.TP
s
Save file (not valid in \-x mode)
.TP
TAB
Switch to ASCII mode
.TP
$
Move to the end of the file
.TP
^
Move to the beginning of the file
.TP
+
Jump to a specified address  (Note this address defaults to decimal, but an hex
address can be entered by prefixing the number with '0x', and an octal address
by prefixing with '0')
.TP
R
Restore byte from last saved/initial version (not valid in \-x mode)
.TP
q Q ^C
Quit
.TP
1-9 a-f A-F
Enter Hex value
.TP
^A
Switch between overtype/insert (not valid in \-x mode)
.TP
^T
Switch between normal/regular expression search mode
.TP
^K
Switch between case sensitive/insensitive search mode
.TP
BS DEL
Cancel after first hex digit is entered
.TP
x
Delete character at cursor (not valid in \-x mode)
.TP
/
Search.  In regular expression mode this will treat the file as a set of 
text lines, each line terminated with a newline or NULL.
.TP
n
Search next.  Note that this will perform the last search, regardless of any
mode change to/from regular expression mode, though it will take account of
changes to case sensitivity.
.TP
^R
Redraw screen
.TP
ASCII MODE
.TP
Cursor keys
Move around file
.TP
^H ^J ^K ^L
As above
.TP
^B
Move back one page
.TP
^F
Move forward one page
.TP
TAB
Switch to HEX mode
.TP
^A
Switch between overtype/insert (not valid in \-x mode)
.TP
^X
Delete character at cursor (not valid in \-x mode)
.TP
^R
Redraw screen
.TP
^C
Quit
.SH ENVIRONMENT
xed will process these environment variables if present
.TP
XEDARG
Allows default arguments to be definied in the environment.  If this is set
then invoking
.B xed
will be the same as invoking
.B xed $XEDARG <arglist>
.SH SEE ALSO
.BR od (1)
.BR grep (1)
.BR curses (3)
.BR regexp (3)
.SH DIAGNOSTICS
The diagnostics produced by
.B xed
are intended to be self-explanatory.
.SH NOTES 
Version 2.0 of
.B xed
includes these additions and fixes over 1.7 :
.TP
o
Drastically tidied up code to enter the 1990's at least.
.SH BUGS
.TP
o
Even though the input routine tries it's best to mask them, pressing certain
control keys (function keys, etc) while
.B xed
is waiting for the second hex digit when editting can send a string of
unexpected commands to
.B xed.
This may result in your file being accidentally editted and saved.
.TP
o
The display is half-inverted and sometimes corrupts on some HP-UX systems.  This
is a bug in their curses implementation.