├── .gitignore ├── CJKpunct.sty ├── Makefile ├── README.md ├── b.texi ├── bashref.pdf ├── bashref.tex ├── bashref.texi ├── bashref_en.pdf ├── box_forbid.jpg ├── box_info.jpg ├── box_lib.jpg ├── box_ref.jpg ├── box_tip.jpg ├── box_try.jpg ├── case.sh ├── case.tex ├── cd.sh ├── cd.tex ├── frontcover.png ├── frontcover.psd ├── frontcover.xcf ├── geofuture.png ├── geofuture_h.png ├── inputrc.sh ├── inputrc.tex ├── irc.sh ├── irc.tex ├── prompt.sh ├── prompt.tex ├── select.sh ├── select.tex ├── shelltype.sh ├── shelltype.tex └── vimrc /.gitignore: -------------------------------------------------------------------------------- 1 | missfont.log 2 | *log 3 | bashref.cst 4 | bashref.faq 5 | bashref.idx 6 | bashref.ilg 7 | bashref.ind 8 | bashref.line 9 | bashref.out 10 | bashref.toc 11 | -------------------------------------------------------------------------------- /CJKpunct.sty: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `CJKpunct.sty', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% CJKpunct.dtx (with options: `CJKpunct') 8 | %% 9 | %% Version 4.8.2 (06-May-2009) 10 | %% 11 | %% This is the file CJKpunct.sty for the CJK package 12 | %% 13 | %% Authors: 14 | %% Linbo Zhang (zlb@lsec.cc.ac.cn) 15 | %% Wenchang Sun (sunwch@nankai.edu.cn) 16 | %% 17 | %% 18 | \def\fileversion{4.8.2} 19 | \def\filedate{2009/05/06} 20 | \ProvidesPackage{CJKpunct}[\filedate\space\fileversion] 21 | \endlinechar \m@ne 22 | 23 | \newif\if@CJKpunct 24 | \newif\if@CJKpunct@dokerning 25 | \newcount\CJKpunct@cnta 26 | \newcount\CJKpunct@cntb 27 | \newcount\CJKpunct@cntc 28 | \newcount\CJKpunct@cntd 29 | \newcount\CJKpunct@cnte 30 | \let\CJKo@testLastCJK\CJK@testLastCJK 31 | \def\CJKpunct@testLastCJK{ 32 | \global\CJK@false 33 | \global\edef\CJKpunct@lastkern{\number\lastkern}} 34 | 35 | \let\CJKo@testLastKern\CJK@testLastKern 36 | \def\CJKpunct@testLastKern{ 37 | \global\CJK@false} 38 | 39 | \let\CJKo@testPrePunct\CJK@testPrePunct 40 | \let\CJKo@testPostPunct\CJK@testPostPunct 41 | \def\CJKpunct@testPrePunct#1#2#3{} 42 | \def\CJKpunct@testPostPunct#1#2#3{} 43 | 44 | \let\CJKo@nobreakglue\CJK@nobreakglue 45 | 46 | \let\CJKosymbol\CJKsymbol 47 | \def\CJKpunct@CJKsymbol#1{ 48 | {{{ 49 | \ifnum\CJKpunct@lastkern>0\relax 50 | \ifnum\CJKpunct@lastcharclass=0\relax 51 | \CJKglue 52 | \else 53 | \CJKpunct@ULspecials 54 | \fi 55 | \fi 56 | \CJKosymbol{#1} 57 | \gdef\CJKpunct@lastcharclass{0}}}}} 58 | 59 | \def\CJKpunct@lastcharclass{0} 60 | \def\CJKpunct@lastkern{0} 61 | \let\CJKopunctsymbol\CJKpunctsymbol 62 | \def\CJKpunct@CJKpunctsymbol#1{ 63 | \CJKpunct@setfamily 64 | \CJKpunct@setmarginkerning 65 | \edef\CJKpunct@currentpunct{\CJK@plane/\the#1} 66 | \ifcsname CJKpunct@\CJK@enc @\CJKpunct@currentpunct\endcsname 67 | \edef\CJKpunct@currentcharclass{ 68 | \csname CJKpunct@\CJK@enc @\CJKpunct@currentpunct\endcsname} 69 | {{{% We need three braces for CJKulem to work 70 | \@CJKpunctfalse 71 | \ifnum\CJKpunct@lastkern>0\relax 72 | \ifnum\CJKpunct@lastcharclass>0\relax 73 | \unkern 74 | \unkern 75 | \ifnum\CJKpunct@punctstyle>0\relax 76 | \@CJKpuncttrue 77 | \else 78 | \ifcsname CJKpunct@specialpunct\CJK@enc \CJKpunct@currentpunct\endcsname 79 | \@CJKpuncttrue 80 | \fi 81 | \fi 82 | \fi 83 | \fi 84 | \if@CJKpunct 85 | \CJKpunct@unskip 86 | \CJKpunct@setkern{\CJKpunct@lastpunct}{\CJKpunct@currentpunct} 87 | \kern \csname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family 88 | @kern\CJKpunct@lastpunct @\CJKpunct@currentpunct\endcsname 89 | \CJKpunct@nobreak 90 | \else 91 | \CJKpunct@ULspecials 92 | \ifnum\CJKpunct@currentcharclass=1\relax 93 | \hskip \csname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family 94 | @lglue@\CJKpunct@currentpunct\endcsname plus 0.1em minus 0.1 em 95 | \else 96 | \ifcsname CJKpunct@specialpunct\CJK@enc \CJKpunct@currentpunct\endcsname 97 | \CJKglue % breakable 98 | \else 99 | \nobreak 100 | \fi 101 | \fi 102 | \fi 103 | \global\edef\CJKpunct@lastpunct{\CJKpunct@currentpunct} 104 | 105 | \vrule width \csname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family 106 | @lrule@\CJKpunct@currentpunct\endcsname depth \z@ height \z@ 107 | 108 | \CJKopunctsymbol{#1} 109 | \vrule width \csname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family 110 | @rrule@\CJKpunct@currentpunct\endcsname depth \z@ height \z@ 111 | 112 | \ifnum\CJKpunct@currentcharclass=2\relax 113 | \hskip \csname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family 114 | @rglue@\CJKpunct@currentpunct\endcsname plus 0.1em minus 0.1 em 115 | \fi 116 | \global\let\CJKpunct@lastcharclass\CJKpunct@currentcharclass}}} 117 | \else 118 | \CJKsymbol{#1} 119 | \global\def\CJKpunct@lastcharclass{0} 120 | \fi} 121 | \def\CJKpunct@setfamily{ 122 | \ifcsname \CJK@enc @\CJK@family @\f@series @\f@shape\endcsname 123 | \global\edef\CJKpunct@family{\csname \CJK@enc @\CJK@family @\f@series @\f@shape\endcsname} 124 | \else 125 | \edef\CJKpunct@family{\CJK@family} 126 | \fi} 127 | 128 | \def\CJKpunctmapfamily#1#2#3#4#5{ 129 | \expandafter\edef\csname #1@#2@#3@#4\endcsname{#5}} 130 | 131 | \def\CJKpunct@plainpunctsymbol#1#2{ 132 | \CJKpunctsymbol{#2}} 133 | \def\CJKpunct@setmarginkerning{ 134 | \ifcsname CJKpunct @\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family\endcsname 135 | \else 136 | \expandafter\gdef\csname CJKpunct @\CJKpunct@punctstyle @\CJK@enc 137 | @\CJKpunct@family\endcsname{} 138 | \ifcsname CJKpunct@\CJKpunct@family @spaces\endcsname 139 | \PackageInfo{CJKpunct}{use punctuation spaces for family '\CJKpunct@family' 140 | \space with punctstyle (\CJKpunct@currentpunctstyle)}\relax 141 | \edef\CJKpunct@spaces{\csname CJKpunct@\CJKpunct@family @spaces\endcsname} 142 | \else 143 | \ifcsname CJKpunct@spaces@\CJKpunct@family\endcsname 144 | \else 145 | \PackageInfo{CJKpunct}{punctuation spaces for family '\CJKpunct@family' do not exist. 146 | \space Use family 'def' instead.}\relax 147 | \global\expandafter\def\csname CJKpunct@spaces@\CJKpunct@family\endcsname{} 148 | \fi 149 | \edef\CJKpunct@spaces{\csname CJKpunct@def@spaces\endcsname} 150 | \fi 151 | \CJKpunct@cnta=0\relax 152 | \expandafter\CJKpunct@@setmarginkerning\CJKpunct@spaces 153 | \fi} 154 | 155 | \def\CJKpunct@@setmarginkerning#1,#2,{ 156 | \edef\CJKpunct@temp{#1} 157 | \ifx\CJKpunct@temp\@empty 158 | \def\CJKpunct@temp{} 159 | \else 160 | \def\CJKpunct@temp{\CJKpunct@@setmarginkerning} 161 | \ifnum\CJKpunct@cnta<12 162 | \def\CJKpunct@lr{l} 163 | \else 164 | \def\CJKpunct@lr{r} 165 | \fi 166 | \edef\CJKpunct@encpn{\csname CJKpunct@pn@\CJK@enc @\the\CJKpunct@cnta\endcsname} 167 | \if l\CJKpunct@lr 168 | \expandafter\gdef\csname CJKpunct@\CJK@enc @\CJKpunct@encpn\endcsname{1} 169 | \else 170 | \expandafter\gdef\csname CJKpunct@\CJK@enc @\CJKpunct@encpn\endcsname{2} 171 | \fi 172 | 173 | \@CJKpunct@dokerningtrue 174 | \ifnum\CJKpunct@punctstyle=\CJKpunct@ps@plain\relax 175 | \@CJKpunct@dokerningfalse 176 | \else 177 | \ifcsname CJKpunct@specialpunct\CJK@enc\CJKpunct@encpn\endcsname 178 | \@CJKpunct@dokerningfalse 179 | \fi 180 | \fi 181 | 182 | \ifnum\CJKpunct@punctstyle=\CJKpunct@ps@banjiao 183 | \def\CJKpunct@sidespaces{12} 184 | \else 185 | \def\CJKpunct@sidespaces{15} 186 | \fi 187 | 188 | \ifnum\CJKpunct@cnta=12\relax 189 | {\CJKpunct@cntb=#1\relax 190 | \advance\CJKpunct@cntb #2\relax 191 | \advance\CJKpunct@cntb 2\relax 192 | \CJKpunct@numtostring{\CJKpunct@cntb} 193 | \edef\CJKpunct@temp{\csname CJKpunct@pn@\CJK@enc @12\endcsname} 194 | \CJKpunct@cntc=0\relax 195 | \loop 196 | \global\expandafter\edef\csname CJKpunct\CJKpunct@punctstyle 197 | @\CJK@enc @\CJKpunct@family @kern\CJKpunct@temp @\CJKpunct@temp\endcsname{ 198 | -0.\CJKpunct@decimal em} 199 | \advance \CJKpunct@cntc 1\relax 200 | \ifnum\CJKpunct@cntc<6\repeat} 201 | \fi 202 | \if@CJKpunct@dokerning 203 | \CJKpunct@cntb=#1\relax 204 | \advance\CJKpunct@cntb -\CJKpunct@sidespaces\relax 205 | \ifnum\CJKpunct@cntb<0\relax 206 | \CJKpunct@cntb=0\relax 207 | \fi 208 | \CJKpunct@cntc=#2\relax 209 | \advance\CJKpunct@cntc -\CJKpunct@sidespaces\relax 210 | \ifnum\CJKpunct@cntc<0\relax 211 | \CJKpunct@cntc=0\relax 212 | \fi 213 | 214 | \CJKpunct@cntd=\CJKpunct@cntb 215 | \advance\CJKpunct@cntd\CJKpunct@cntc\relax 216 | 217 | \ifcase\CJKpunct@punctstyle 218 | % hangmobanjiao 219 | \or % quanjiao 220 | \or % banjiao 221 | \advance\CJKpunct@cntd -50\relax 222 | \or % kaiming 223 | \ifcsname CJKpunct@kaiming\CJK@enc\CJKpunct@encpn\endcsname 224 | \else 225 | \advance\CJKpunct@cntd -50\relax 226 | \fi 227 | \or %CCT 228 | \advance\CJKpunct@cntd -20\relax 229 | \fi 230 | \CJKpunct@cnte=\CJKpunct@cntd 231 | \ifnum\CJKpunct@cntd<0\relax 232 | \CJKpunct@cntd=0\relax 233 | \fi 234 | \else 235 | \CJKpunct@cntb=0\relax 236 | \CJKpunct@cntc=0\relax 237 | \CJKpunct@cntd=0\relax 238 | \CJKpunct@cnte=0\relax 239 | \fi 240 | \CJKpunct@numtostring{\CJKpunct@cntb} 241 | \global\expandafter\edef\csname CJKpunct\CJKpunct@punctstyle 242 | @\CJK@enc @\CJKpunct@family @lrule@\CJKpunct@encpn\endcsname{ 243 | -0.\CJKpunct@decimal em} 244 | \CJKpunct@numtostring{\CJKpunct@cntc} 245 | \global\expandafter\edef\csname CJKpunct\CJKpunct@punctstyle 246 | @\CJK@enc @\CJKpunct@family @rrule@\CJKpunct@encpn\endcsname{ 247 | -0.\CJKpunct@decimal em} 248 | \CJKpunct@numtostring{\CJKpunct@cntd} 249 | \global\expandafter\edef\csname CJKpunct\CJKpunct@punctstyle 250 | @\CJK@enc @\CJKpunct@family @\CJKpunct@lr glue@\CJKpunct@encpn\endcsname{ 251 | 0.\CJKpunct@decimal em} 252 | \global\expandafter\edef\csname CJKpunct\CJKpunct@punctstyle 253 | @\CJK@enc @\CJKpunct@family @\CJKpunct@lr oglue@\CJKpunct@encpn\endcsname{ 254 | \the\CJKpunct@cnte} 255 | \fi 256 | \advance \CJKpunct@cnta 1\relax 257 | \CJKpunct@temp} 258 | 259 | \def\CJKpunct@numtostring#1{ 260 | \edef\CJKpunct@decimal{\the#1} 261 | \ifnum\CJKpunct@decimal<10\relax 262 | \edef\CJKpunct@decimal{0\CJKpunct@decimal} 263 | \fi} 264 | \def\CJKpunct@setkern#1#2{ 265 | \ifcsname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family @kern#1@#2\endcsname 266 | \else 267 | \CJKpunct@cnta=0\relax 268 | \ifcsname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family @roglue@#1\endcsname 269 | \advance\CJKpunct@cnta\csname 270 | CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family @roglue@#1\endcsname 271 | \fi 272 | \ifcsname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family @loglue@#2\endcsname 273 | \advance\CJKpunct@cnta\csname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family 274 | @loglue@#2\endcsname 275 | \fi 276 | \relax 277 | \ifcase\CJKpunct@punctstyle 278 | % hangmobanjiao 279 | \or % quanjiao 280 | \advance\CJKpunct@cnta -50\relax 281 | \or % banjiao 282 | \or % kaiming 283 | \ifcsname CJKpunct@kaiming#1\endcsname 284 | \ifcsname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family @loglue@#2\endcsname 285 | \advance\CJKpunct@cnta -50\relax 286 | \fi 287 | \fi 288 | \fi 289 | \ifnum\CJKpunct@cnta<0\relax 290 | \CJKpunct@cnta=0\relax 291 | \fi 292 | \CJKpunct@numtostring{\CJKpunct@cnta} 293 | \global\expandafter\edef\csname 294 | CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family @kern#1@#2\endcsname{ 295 | 0.\CJKpunct@decimal em} 296 | \fi} 297 | 298 | \let\CJKpunct@unskip\unskip 299 | \def\CJKpunct@UL@unskip{ 300 | \ifcsname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family 301 | @rglue@\CJKpunct@lastpunct\endcsname 302 | \hskip -\csname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family 303 | @rglue@\CJKpunct@lastpunct\endcsname \relax 304 | \fi} 305 | 306 | \@ifundefined{UL@hskip}{\let\UL@hskip\relax}{} 307 | 308 | \def\CJKpunct@punctUL@group{ 309 | \ifx\hskip\UL@hskip 310 | \egroup 311 | \UL@stop 312 | \UL@start 313 | \bgroup 314 | \fi} 315 | 316 | \def\CJKpunct@ULspecials{} 317 | 318 | \AtBeginDocument{ 319 | \ifcsname UL@hook\endcsname 320 | \addto@hook\UL@hook{\let\CJK@ignorespaces\ignorespaces 321 | \let\CJKpunct@unskip\CJKpunct@UL@unskip 322 | \let\CJKpunct@ULspecials\CJKpunct@punctUL@group} 323 | \fi} 324 | \def\CJKpunctallowbreakbetweenpuncts{ 325 | \def\CJKpunct@nobreak{ 326 | \ifnum\CJKpunct@lastcharclass=2 327 | \hskip 0pt 328 | \fi}} 329 | 330 | \def\CJKpunctnobreakbetweenpuncts{ 331 | \let\CJKpunct@nobreak\nobreak} 332 | \CJKpunctnobreakbetweenpuncts 333 | \def\CJKpunctstyle#1{ 334 | \ifcsname CJKpunct@ps@#1\endcsname 335 | \edef\CJKpunct@currentpunctstyle{#1} 336 | \edef\CJKpunct@punctstyle{\csname CJKpunct@ps@#1\endcsname} 337 | \ifnum\CJKpunct@punctstyle=\CJKpunct@ps@plain\relax 338 | \CJKpunctallowbreakbetweenpuncts 339 | \let\CJK@testLastCJK\CJKo@testLastCJK 340 | \let\CJK@testLastKern\CJKo@testLastKern 341 | \let\CJK@testPrePunct\CJKo@testPrePunct 342 | \let\CJK@testPostPunct\CJKo@testPostPunct 343 | \let\CJKpunct@punctsymbol\CJKpunct@plainpunctsymbol 344 | \let\CJKsymbol\CJKosymbol 345 | \let\CJKpunctsymbol\CJKopunctsymbol 346 | \let\CJK@nobreakglue\CJKo@nobreakglue 347 | \let\CJKpunct@utfsymbol\CJKpunct@utfbsymbol 348 | \else 349 | \let\CJK@testLastCJK\CJKpunct@testLastCJK 350 | \let\CJK@testLastKern\CJKpunct@testLastKern 351 | \let\CJK@testPrePunct\CJKpunct@testPrePunct 352 | \let\CJK@testPostPunct\CJKpunct@testPostPunct 353 | \let\CJKpunct@punctsymbol\CJKpunct@@punctsymbol 354 | \let\CJKsymbol\CJKpunct@CJKsymbol 355 | \let\CJKpunctsymbol\CJKpunct@CJKpunctsymbol 356 | \let\CJK@nobreakglue\relax 357 | \let\CJKpunct@utfsymbol\CJKpunct@utfasymbol 358 | \fi 359 | \else 360 | \PackageWarning{CJKpunct}{Punctstyle #1\space is not defined.}\relax 361 | \fi} 362 | 363 | \let\punctstyle\CJKpunctstyle 364 | \def\CJKpunct@ps@hangmobanjiao{0} 365 | \def\CJKpunct@ps@marginkerning{0} 366 | \def\CJKpunct@ps@quanjiao{1} 367 | \def\CJKpunct@ps@fullwidth{1} 368 | \def\CJKpunct@ps@banjiao{2} 369 | \def\CJKpunct@ps@halfwidth{2} 370 | \def\CJKpunct@ps@kaiming{3} 371 | \def\CJKpunct@ps@mixedwidth{3} 372 | \def\CJKpunct@ps@CCT{4} 373 | \def\CJKpunct@ps@plain{5} 374 | \AtBeginDocument{\punctstyle{quanjiao}} 375 | 376 | \def\CJKplainout{\punctstyle{plain}} 377 | \let\CJKnormalout\relax 378 | \def\CJKpunctsetkern#1#2#3{ 379 | \CJKpunct@setplanenumber{#1} 380 | \edef\CJKpunct@pna{\CJKpunct@char@pn} 381 | \CJKpunct@setplanenumber{#2} 382 | \edef\CJKpunct@pnb{\CJKpunct@char@pn} 383 | \global\expandafter\edef\csname CJKpunct\CJKpunct@punctstyle 384 | @\CJK@enc @\CJKpunct@family @kern\CJKpunct@pna @\CJKpunct@pnb\endcsname{ 385 | #3}} 386 | 387 | \def\CJKpunct@setplanenumber#1{{ 388 | \def\CJK@testPrePunct##1##2##3{ 389 | \global\edef\CJKpunct@charplane{\CJK@plane} 390 | \global\edef\CJKpunct@charnumber{\the\@tempcnta}} 391 | \savebox\voidb@x{#1} 392 | \global\edef\CJKpunct@char@pn{\CJKpunct@charplane/\CJKpunct@charnumber}}} 393 | 394 | \def\CJKpunct@punctlist#1{ 395 | \CJKpunct@cnta=0\relax 396 | \def\CJKpunct@enc{#1} 397 | \CJKpunct@setpunctfamilynumber} 398 | 399 | \def\CJKpunct@setpunctfamilynumber#1,{ 400 | \edef\CJKpunct@temp{#1} 401 | \ifx\CJKpunct@temp\@empty 402 | \def\CJKpunct@temp{} 403 | \else 404 | \expandafter\def\csname CJKpunct@pn@\CJKpunct@enc @\the\CJKpunct@cnta\endcsname{#1} 405 | \advance \CJKpunct@cnta 1\relax 406 | \def\CJKpunct@temp{\CJKpunct@setpunctfamilynumber} 407 | \fi 408 | \CJKpunct@temp} 409 | 410 | \CJKpunct@punctlist{C70}20/24,20/28,30/12,30/14,30/20,ff/8,ff/59,ff/91,% 411 | 30/8,30/10,30/22,30/16,% 412 | 20/20,20/38,30/1,30/2,ff/12,ff/14,ff/26,ff/27,ff/1,ff/31,ff/5,30/21,ff/9,% 413 | ff/61,ff/93,30/9,30/11,30/23,30/17,20/25,20/29,30/13,30/15,, 414 | 415 | \CJKpunct@punctlist{C10}01/13,01/15,01/23,01/25,01/17,01/195,01/246,02/22,01/19,% 416 | 01/21,01/27,01/29,% 417 | 01/9,01/12,01/1,01/2,01/199,01/201,01/213,01/214,01/188,01/218,01/192,01/18,% 418 | 01/196,01/248,02/24,01/20,01/22,01/28,01/30,01/14,01/16,01/24,01/26,, 419 | 420 | \CJKpunct@punctlist{C19}25/45,25/47,25/55,25/57,25/49,26/163,26/214,26/246,25/51,% 421 | 25/53,25/59,25/61,% 422 | 25/41,25/44,25/33,25/34,26/167,26/169,26/181,26/182,26/156,26/186,26/160,% 423 | 25/50,26/164,26/216,26/248,25/52,25/54,25/60,25/62,25/46,25/48,25/56,25/58,, 424 | 425 | \def\CJKpunct@totalpuncts{35} 426 | \ifcsname DeclareUnicodeCharacter\endcsname 427 | \DeclareUnicodeCharacter{2018}{\CJKpunct@utfsymbol{"80}{"98}} 428 | \DeclareUnicodeCharacter{2019}{\CJKpunct@utfsymbol{"80}{"99}} 429 | \DeclareUnicodeCharacter{201C}{\CJKpunct@utfsymbol{"80}{"9C}} 430 | \DeclareUnicodeCharacter{201D}{\CJKpunct@utfsymbol{"80}{"9D}} 431 | \DeclareUnicodeCharacter{2014}{\CJKpunct@utfsymbol{"80}{"94}} 432 | \DeclareUnicodeCharacter{2026}{\CJKpunct@utfsymbol{"80}{"A6}} 433 | \fi 434 | \def\CJKpunct@utfasymbol#1#2{ 435 | \CJK@punctchar{\CJK@uniPunct}{0}{#1}{#2}} 436 | \def\CJKpunct@utfbsymbol#1#2{ 437 | \ifnum #2=148 438 | \textemdash 439 | \else 440 | \ifnum #2=166 441 | \textellipsis 442 | \else 443 | \ifnum #2=152 444 | \textquoteleft 445 | \else 446 | \ifnum #2=153 447 | \textquoteright 448 | \else 449 | \ifnum #2=156 450 | \textquotedblleft 451 | \else 452 | \ifnum #2=157 453 | \textquotedblright 454 | \fi 455 | \fi 456 | \fi 457 | \fi 458 | \fi 459 | \fi} 460 | \def\CJKpunct@setspecialpunct#1#2{ 461 | \expandafter\def\csname CJKpunct@specialpunct#1#2\endcsname{}} 462 | \CJKpunct@setspecialpunct{C70}{20/20} 463 | \CJKpunct@setspecialpunct{C70}{20/38} 464 | \CJKpunct@setspecialpunct{C19}{25/41} 465 | \CJKpunct@setspecialpunct{C19}{25/44} 466 | \CJKpunct@setspecialpunct{C10}{01/9} 467 | \CJKpunct@setspecialpunct{C10}{01/12} 468 | \def\CJKpunct@setkaimingpunct#1#2{ 469 | \expandafter\def\csname CJKpunct@kaiming#1#2\endcsname{}} 470 | \CJKpunct@setkaimingpunct{C70}{30/02} 471 | \CJKpunct@setkaimingpunct{C70}{ff/1} 472 | \CJKpunct@setkaimingpunct{C70}{ff/31} 473 | \CJKpunct@setkaimingpunct{C19}{25/34} 474 | \CJKpunct@setkaimingpunct{C19}{26/156} 475 | \CJKpunct@setkaimingpunct{C19}{26/186} 476 | \CJKpunct@setkaimingpunct{C10}{01/2} 477 | \CJKpunct@setkaimingpunct{C10}{01/188} 478 | \CJKpunct@setkaimingpunct{C10}{01/218} 479 | \def\CJKpunct@def@spaces{69,18,60,6,63,2,63,3,69,8,69,6,69,1,39,% 480 | 37,63,4,56,2,63,5,63,6,6,6,12,11,23,50,24,54,16,71,20,69,12,76,13,% 481 | 74,26,61,3,50,3,4,8,69,6,69,2,69,38,39,4,62,2,55,5,62,7,62,16,71,9,% 482 | 58,3,62,3,62,,,} 483 | 484 | \IfFileExists{CJKpunct.spa}{\input{CJKpunct.spa}}{} 485 | 486 | \endlinechar `\^^M 487 | 488 | \endinput 489 | %% 490 | %% End of file `CJKpunct.sty'. 491 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | targets = bashref 2 | note_pic = $(wildcard box_*.jpg) 3 | misc_pic = $(wildcard *.png) 4 | sh = $(wildcard *.sh) 5 | tex = $(addsuffix .tex, $(basename $(wildcard *.sh))) 6 | 7 | .PHONY: all clean delete $(targets) 8 | all: $(targets) 9 | 10 | $(targets): %: %.pdf 11 | $(tex): %.tex: %.sh 12 | $(ind): %.ind: %.idx 13 | 14 | %.pdf: $(misc_pic) $(note_pic) 15 | 16 | %.pdf: %.tex $(tex) test 17 | [ -s $*.idx ] && makeindex $*.idx 18 | pdflatex $< 19 | 20 | test: $(addsuffix .tex, $(targets)) $(tex) $(ind) 21 | pdflatex $? 22 | 23 | $(tex): %.tex: %.sh vimrc 24 | vim -n -i NONE $< -c 'source vimrc' > /dev/null 2>&1 25 | 26 | clean: 27 | $(RM) $(filter-out %.tex %.pdf, $(wildcard $(addsuffix .*, $(targets)))) 28 | $(RM) $(filter-out %.sh, $(wildcard $(addsuffix .*, $(basename $(wildcard *.sh))))) 29 | $(RM) $(wildcard *.log) 30 | 31 | delete: 32 | $(RM) $(addsuffix .pdf, $(targets)) 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | bashdoc 2 | ======= 3 | 4 | Bash Reference Manual in Chinese 5 | Bash 中文文档。 6 | 7 | 自从第一版问世以后,陆续有很多热心的网友向我提出笔误的地方,在此诚挚的向他们表示感谢。我会尽快更正并发布新版本。 8 | 9 | 该文档需要 LaTeX 编译。建议下载 CTexLive 。如果不想自己编译,可以直接下载库中的 PDF 文件。 10 | 11 | -------------------------------------------------------------------------------- /bashref.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JerryFleming/bashdoc/HEAD/bashref.pdf -------------------------------------------------------------------------------- /bashref_en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JerryFleming/bashdoc/HEAD/bashref_en.pdf -------------------------------------------------------------------------------- /box_forbid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JerryFleming/bashdoc/HEAD/box_forbid.jpg -------------------------------------------------------------------------------- /box_info.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JerryFleming/bashdoc/HEAD/box_info.jpg -------------------------------------------------------------------------------- /box_lib.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JerryFleming/bashdoc/HEAD/box_lib.jpg -------------------------------------------------------------------------------- /box_ref.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JerryFleming/bashdoc/HEAD/box_ref.jpg -------------------------------------------------------------------------------- /box_tip.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JerryFleming/bashdoc/HEAD/box_tip.jpg -------------------------------------------------------------------------------- /box_try.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JerryFleming/bashdoc/HEAD/box_try.jpg -------------------------------------------------------------------------------- /case.sh: -------------------------------------------------------------------------------- 1 | echo -n "请输入一个动物的名称:" 2 | read ANIMAL 3 | echo -n "$ANIMAL有" 4 | case $ANIMAL in 5 | ( 马 | 狗 | 猫 ) echo -n "四";; 6 | 人 | 袋鼠 ) echo -n "两";; 7 | *) echo -n "末知数目的";; 8 | esac 9 | echo "腿。" 10 | -------------------------------------------------------------------------------- /case.tex: -------------------------------------------------------------------------------- 1 | \codelnr{1\ }\codeStatement{echo} \codeSpecial{-n} \codeStatement{"}\codeSpecial{请输入一个动物的名称:}\codeStatement{"}\\ 2 | \codelnr{2\ }\codeStatement{read} ANIMAL\\ 3 | \codelnr{3\ }\codeStatement{echo} \codeSpecial{-n} \codeStatement{"}\codePreProc{\$ANIMAL}\codeSpecial{有}\codeStatement{"}\\ 4 | \codelnr{4\ }\codeStatement{case} \codePreProc{\$ANIMAL} \codeStatement{in}\\ 5 | \codelnr{5\ }\tab{}\codeStatement{(} \codeSpecial{马} \codeStatement{|} \codeSpecial{狗} \codeStatement{|} \codeSpecial{猫} \codeStatement{)} \codeStatement{echo} -n \codeStatement{"}\codeSpecial{四}\codeStatement{"}\codeStatement{;;}\\ 6 | \codelnr{6\ }\tab{}\codeSpecial{人} \codeStatement{|} \codeSpecial{袋鼠} \codeStatement{)} \codeStatement{echo} -n \codeStatement{"}\codeSpecial{两}\codeStatement{"}\codeStatement{;;}\\ 7 | \codelnr{7\ }\tab{}*\codeStatement{)} \codeStatement{echo} -n \codeStatement{"}\codeSpecial{末知数目的}\codeStatement{"}\codeStatement{;;}\\ 8 | \codelnr{8\ }\codeStatement{esac}\\ 9 | \codelnr{9\ }\codeStatement{echo} \codeStatement{"}\codeSpecial{腿。}\codeStatement{"} 10 | -------------------------------------------------------------------------------- /cd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 改进 Bash 中的 cd 命令。 4 | # 另请参见 dirs,popd 和 pushd 命令。 5 | # 作者 Jerry Fleming ,2009 年 8 月 6 | 7 | cd() 8 | { 9 | if [[ $1 =~ ^([+-])([0-9]*)$ ]] 10 | then 11 | CDR=$( expr $CDR ${BASH_REMATCH[1]} ${BASH_REMATCH[2]:-1} ) 12 | [[ $CDR -lt 1 ]] && CDR=1 13 | [[ $CDR -gt ${#CDP[@]} ]] && CDR=${#CDP[@]} 14 | I=$(($CDR-1)) 15 | builtin cd ${CDP[$I]} 16 | elif [[ $1 =~ ^[+][+]([0-9]*)$ ]] 17 | then 18 | CDR=${BASH_REMATCH[1]:-1} 19 | [[ $CDR -lt 1 ]] && CDR=1 20 | [[ $CDR -gt ${#CDP[@]} ]] && CDR=${#CDP[@]} 21 | I=$(($CDR-1)) 22 | builtin cd ${CDP[$I]} 23 | elif [[ $1 == -i ]] 24 | then 25 | unset CDP 26 | CDP[0]=$PWD 27 | CDR=1 28 | elif [[ $1 == -l ]] 29 | then 30 | I=0 31 | for item in ${CDP[@]} 32 | do 33 | I=$(($I+1)) 34 | echo -n [$I] 35 | if [[ $I -eq $CDR ]] 36 | then 37 | echo -n '*' 38 | else 39 | echo -n ' ' 40 | fi 41 | echo -n ' ' 42 | echo $item 43 | done 44 | else 45 | builtin cd $@ 46 | CDP[$CDR]=$PWD 47 | CDR=$(($CDR + 1)) 48 | fi 49 | } 50 | -------------------------------------------------------------------------------- /cd.tex: -------------------------------------------------------------------------------- 1 | \codelnr{\ 1\ }\codeComment{\#!/bin/bash}\\ 2 | \codelnr{\ 2\ }\\ 3 | \codelnr{\ 3\ }\codeComment{\# 改进 Bash 中的 cd 命令。}\\ 4 | \codelnr{\ 4\ }\codeComment{\# 另请参见 dirs,popd 和 pushd 命令。}\\ 5 | \codelnr{\ 5\ }\codeComment{\# 作者 Jerry Fleming ,2009 年 8 月}\\ 6 | \codelnr{\ 6\ }\\ 7 | \codelnr{\ 7\ }\codeStatement{cd}\codePreProc{()}\\ 8 | \codelnr{\ 8\ }\codeSpecial{\{}\\ 9 | \codelnr{\ 9\ }\tab{}\codeStatement{if }\codeSpecial{[[} \codePreProc{\$1} \codeStatement{=}\textasciitilde{} \textasciicircum{}(\codeStatement{[}+-\codeStatement{]})(\codeStatement{[}\codeConstant{0-9}\codeStatement{]}*)\$ \codeSpecial{]]}\\ 10 | \codelnr{10\ }\tab{}\codeStatement{then}\\ 11 | \codelnr{11\ }\tab{}\tab{}\codeIdentifier{CDR}=\codePreProc{\$(}\codeSpecial{ }\codeStatement{expr}\codeSpecial{ }\codePreProc{\$CDR}\codeSpecial{ }\codePreProc{\$\{}\codePreProc{BASH\_REMATCH}\codePreProc{[}\codeConstant{1}\codePreProc{]}\codePreProc{\}}\codeSpecial{ }\codePreProc{\$\{}\codePreProc{BASH\_REMATCH}\codePreProc{[}\codeConstant{2}\codePreProc{]}\codeStatement{:-}1\codePreProc{\}}\codeSpecial{ }\codePreProc{)}\\ 12 | \codelnr{12\ }\tab{}\tab{}\codeSpecial{[[} \codePreProc{\$CDR} \codeStatement{-lt} \codeConstant{1} \codeSpecial{]]} \codeStatement{\&\&} \codeIdentifier{CDR}=\codeConstant{1}\\ 13 | \codelnr{13\ }\tab{}\tab{}\codeSpecial{[[} \codePreProc{\$CDR} \codeStatement{-gt} \codePreProc{\$\{\#}\codePreProc{CDP}\codePreProc{[}@\codePreProc{]}\codePreProc{\}} \codeSpecial{]]} \codeStatement{\&\&} \codeIdentifier{CDR}=\codePreProc{\$\{\#}\codePreProc{CDP}\codePreProc{[}@\codePreProc{]}\codePreProc{\}}\\ 14 | \codelnr{14\ }\tab{}\tab{}\codeIdentifier{I}=\codePreProc{\$((}\codePreProc{\$CDR}\codeConstant{-1}\codePreProc{))}\\ 15 | \codelnr{15\ }\tab{}\tab{}\codeStatement{builtin} \codeStatement{cd} \codePreProc{\$\{}\codePreProc{CDP}\codePreProc{[}\codePreProc{\$I}\codePreProc{]}\codePreProc{\}}\\ 16 | \codelnr{16\ }\tab{}\codeStatement{elif} \codeSpecial{[[} \codePreProc{\$1} \codeStatement{=}\textasciitilde{} \textasciicircum{}\codeStatement{[}+\codeStatement{][}+\codeStatement{]}(\codeStatement{[}\codeConstant{0-9}\codeStatement{]}*)\$ \codeSpecial{]]}\\ 17 | \codelnr{17\ }\tab{}\codeStatement{then}\\ 18 | \codelnr{18\ }\tab{}\tab{}\codeIdentifier{CDR}=\codePreProc{\$\{}\codePreProc{BASH\_REMATCH}\codePreProc{[}\codeConstant{1}\codePreProc{]}\codeStatement{:-}1\codePreProc{\}}\\ 19 | \codelnr{19\ }\tab{}\tab{}\codeSpecial{[[} \codePreProc{\$CDR} \codeStatement{-lt} \codeConstant{1} \codeSpecial{]]} \codeStatement{\&\&} \codeIdentifier{CDR}=\codeConstant{1}\\ 20 | \codelnr{20\ }\tab{}\tab{}\codeSpecial{[[} \codePreProc{\$CDR} \codeStatement{-gt} \codePreProc{\$\{\#}\codePreProc{CDP}\codePreProc{[}@\codePreProc{]}\codePreProc{\}} \codeSpecial{]]} \codeStatement{\&\&} \codeIdentifier{CDR}=\codePreProc{\$\{\#}\codePreProc{CDP}\codePreProc{[}@\codePreProc{]}\codePreProc{\}}\\ 21 | \codelnr{21\ }\tab{}\tab{}\codeIdentifier{I}=\codePreProc{\$((}\codePreProc{\$CDR}\codeConstant{-1}\codePreProc{))}\\ 22 | \codelnr{22\ }\tab{}\tab{}\codeStatement{builtin} \codeStatement{cd} \codePreProc{\$\{}\codePreProc{CDP}\codePreProc{[}\codePreProc{\$I}\codePreProc{]}\codePreProc{\}}\\ 23 | \codelnr{23\ }\tab{}\codeStatement{elif} \codeSpecial{[[} \codePreProc{\$1} \codeStatement{==} \codeStatement{-i} \codeSpecial{]]}\\ 24 | \codelnr{24\ }\tab{}\codeStatement{then}\\ 25 | \codelnr{25\ }\tab{}\tab{}\codeStatement{unset} CDP\\ 26 | \codelnr{26\ }\tab{}\tab{}CDP\codeStatement{[}\codeConstant{0}\codeStatement{]}\codeStatement{=}\codePreProc{\$PWD}\\ 27 | \codelnr{27\ }\tab{}\tab{}\codeIdentifier{CDR}=\codeConstant{1}\\ 28 | \codelnr{28\ }\tab{}\codeStatement{elif} \codeSpecial{[[} \codePreProc{\$1} \codeStatement{==} \codeStatement{-l} \codeSpecial{]]}\\ 29 | \codelnr{29\ }\tab{}\codeStatement{then}\\ 30 | \codelnr{30\ }\tab{}\tab{}\codeIdentifier{I}=\codeConstant{0}\\ 31 | \codelnr{31\ }\tab{}\tab{}\codeStatement{for }item \codeStatement{in} \codePreProc{\$\{}\codePreProc{CDP}\codePreProc{[}@\codePreProc{]}\codePreProc{\}}\\ 32 | \codelnr{32\ }\tab{}\tab{}\codeStatement{do}\\ 33 | \codelnr{33\ }\tab{}\tab{}\tab{}\codeIdentifier{I}=\codePreProc{\$((}\codePreProc{\$I}\codeSpecial{+}\codeConstant{1}\codePreProc{))}\\ 34 | \codelnr{34\ }\tab{}\tab{}\tab{}\codeStatement{echo} \codeStatement{-n} \codeStatement{[}\codePreProc{\$I}\codeStatement{]}\\ 35 | \codelnr{35\ }\tab{}\tab{}\tab{}\codeStatement{if }\codeSpecial{[[} \codePreProc{\$I} \codeStatement{-eq} \codePreProc{\$CDR} \codeSpecial{]]}\\ 36 | \codelnr{36\ }\tab{}\tab{}\tab{}\codeStatement{then}\\ 37 | \codelnr{37\ }\tab{}\tab{}\tab{}\tab{}\codeStatement{echo} \codeStatement{-n} \codeStatement{\char13{}}\codeConstant{*}\codeStatement{\char13{}}\\ 38 | \codelnr{38\ }\tab{}\tab{}\tab{}\codeStatement{else}\\ 39 | \codelnr{39\ }\tab{}\tab{}\tab{}\tab{}\codeStatement{echo} \codeStatement{-n} \codeStatement{\char13{}}\codeConstant{ }\codeStatement{\char13{}}\\ 40 | \codelnr{40\ }\tab{}\tab{}\tab{}\codeStatement{fi}\\ 41 | \codelnr{41\ }\tab{}\tab{}\tab{}\codeStatement{echo} \codeStatement{-n} \codeStatement{\char13{}}\codeConstant{ }\codeStatement{\char13{}}\\ 42 | \codelnr{42\ }\tab{}\tab{}\tab{}\codeStatement{echo} \codePreProc{\$item}\\ 43 | \codelnr{43\ }\tab{}\tab{}\codeStatement{done}\\ 44 | \codelnr{44\ }\tab{}\codeStatement{else}\\ 45 | \codelnr{45\ }\tab{}\tab{}\codeStatement{builtin} \codeStatement{cd} \codePreProc{\$@}\\ 46 | \codelnr{46\ }\tab{}\tab{}CDP\codeStatement{[}\codePreProc{\$CDR}\codeStatement{]}\codeStatement{=}\codePreProc{\$PWD}\\ 47 | \codelnr{47\ }\tab{}\tab{}\codeIdentifier{CDR}=\codePreProc{\$((}\codePreProc{\$CDR}\codeSpecial{ + }\codeConstant{1}\codePreProc{))}\\ 48 | \codelnr{48\ }\tab{}\codeStatement{fi}\\ 49 | \codelnr{49\ }\codeSpecial{\}} 50 | -------------------------------------------------------------------------------- /frontcover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JerryFleming/bashdoc/HEAD/frontcover.png -------------------------------------------------------------------------------- /frontcover.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JerryFleming/bashdoc/HEAD/frontcover.psd -------------------------------------------------------------------------------- /frontcover.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JerryFleming/bashdoc/HEAD/frontcover.xcf -------------------------------------------------------------------------------- /geofuture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JerryFleming/bashdoc/HEAD/geofuture.png -------------------------------------------------------------------------------- /geofuture_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JerryFleming/bashdoc/HEAD/geofuture_h.png -------------------------------------------------------------------------------- /inputrc.sh: -------------------------------------------------------------------------------- 1 | # vim:filetype=readline 2 | # 3 | # 本文件控制所有使用 readline 库的程序的行输入行为。 4 | # 这些程序包括 FTP,Bash 和 GDB。 5 | # 6 | # 可以用 C-x C-r 命令重新加载该文件。 7 | # 以 '#' 开头的行是注释。 8 | # 9 | # 首先,包含 /etc/Inputrc 中的任何系统绑定和变量。 10 | $include /etc/Inputrc 11 | # 12 | # 设置 emacs 风格的绑定。 13 | set editing-mode emacs 14 | 15 | $if mode=emacs 16 | Meta-Control-h: backward-kill-word 命令后面的文本会被忽略掉 17 | # 18 | # 小键盘上的方向键 19 | # 20 | #"\M-OD": backward-char 21 | #"\M-OC": forward-char 22 | #"\M-OA": previous-history 23 | #"\M-OB": next-history 24 | # 25 | # ANSI 模式的方向键 26 | # 27 | "\M-[D": backward-char 28 | "\M-[C": forward-char 29 | "\M-[A": previous-history 30 | "\M-[B": next-history 31 | # 32 | # 八位小键盘上的方向键 33 | # 34 | #"\M-\C-OD": backward-char 35 | #"\M-\C-OC": forward-char 36 | #"\M-\C-OA": previous-history 37 | #"\M-\C-OB": next-history 38 | # 39 | # 八位 ANSI 模式的方向键 40 | # 41 | #"\M-\C-[D": backward-char 42 | #"\M-\C-[C": forward-char 43 | #"\M-\C-[A": previous-history 44 | #"\M-\C-[B": next-history 45 | C-q: quoted-insert 46 | $endif 47 | 48 | # 旧式的绑定。这恰好也是默认的。 49 | TAB: complete 50 | # 便于 shell 交互的宏。 51 | 52 | $if Bash 53 | # 编辑 PATH 路径 54 | "\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f" 55 | # 准备输入引用的单词:插入引号的开始和结束,然后移到开始引号的后面。 56 | "\C-x\"": "\"\"\C-b" 57 | # 插入反斜杠(测试反斜杠转义序列和宏)。 58 | "\C-x\\": "\\" 59 | # 用引号引用当前或前一个单词。 60 | "\C-xq": "\eb\"\ef\"" 61 | # 绑定刷新本行的命令;这原来是没有绑定的。 62 | "\C-xr": redraw-current-line 63 | # 编辑本行中的变量。 64 | "\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y=" 65 | $endif 66 | 67 | # 如果可以响铃就使用 68 | set bell-style visible 69 | # 读取输入时不要把字符截成 7 位。 70 | set input-meta on 71 | # 允许插入 iso-latin1 字符,而不是把它们变成 Meta 化的序列。 72 | set convert-meta off 73 | # 直接显示八位的字符,而不是把它们当成 Meta 化的字符来显示。 74 | set output-meta on 75 | # 如果可以补全的项目超过 150 条,询问用户是否要显示全部。 76 | set completion-query-items 150 77 | 78 | # 用于 FTP 79 | $if Ftp 80 | "\C-xg": "get \M-?" 81 | "\C-xt": "put \M-?" 82 | "\M-.": yank-last-arg 83 | $endif 84 | -------------------------------------------------------------------------------- /inputrc.tex: -------------------------------------------------------------------------------- 1 | \codelnr{\ 1\ }\codeComment{\# vim:filetype=readline}\\ 2 | \codelnr{\ 2\ }\codeComment{\#}\\ 3 | \codelnr{\ 3\ }\codeComment{\# 本文件控制所有使用 readline 库的程序的行输入行为。}\\ 4 | \codelnr{\ 4\ }\codeComment{\# 这些程序包括 FTP,Bash 和 GDB。}\\ 5 | \codelnr{\ 5\ }\codeComment{\#}\\ 6 | \codelnr{\ 6\ }\codeComment{\# 可以用 C-x C-r 命令重新加载该文件。}\\ 7 | \codelnr{\ 7\ }\codeComment{\# 以 \char13{}\#\char13{} 开头的行是注释。}\\ 8 | \codelnr{\ 8\ }\codeComment{\#}\\ 9 | \codelnr{\ 9\ }\codeComment{\# 首先,包含 /etc/Inputrc 中的任何系统绑定和变量。}\\ 10 | \codelnr{10\ }\codePreProc{\$include} /etc/Inputrc\\ 11 | \codelnr{11\ }\codeComment{\#}\\ 12 | \codelnr{12\ }\codeComment{\# 设置 emacs 风格的绑定。}\\ 13 | \codelnr{13\ }\codeStatement{set} \codeType{editing-mode} \codeConstant{emacs}\\ 14 | \codelnr{14\ }\\ 15 | \codelnr{15\ }\codeStatement{\$if} \codeType{mode}=\codeConstant{emacs}\\ 16 | \codelnr{16\ }\codeConstant{Meta-Control-h}\codeStatement{:} \codeType{backward-kill-word} 命令后面的文本会被忽略掉\\ 17 | \codelnr{17\ }\codeComment{\#}\\ 18 | \codelnr{18\ }\codeComment{\# 小键盘上的方向键}\\ 19 | \codelnr{19\ }\codeComment{\#}\\ 20 | \codelnr{20\ }\codeComment{\#"\textbackslash{}M-OD":\tab{}\tab{}backward-char}\\ 21 | \codelnr{21\ }\codeComment{\#"\textbackslash{}M-OC":\tab{}\tab{}forward-char}\\ 22 | \codelnr{22\ }\codeComment{\#"\textbackslash{}M-OA":\tab{}\tab{}previous-history}\\ 23 | \codelnr{23\ }\codeComment{\#"\textbackslash{}M-OB":\tab{}\tab{}next-history}\\ 24 | \codelnr{24\ }\codeComment{\#}\\ 25 | \codelnr{25\ }\codeComment{\# ANSI 模式的方向键}\\ 26 | \codelnr{26\ }\codeComment{\#}\\ 27 | \codelnr{27\ }\codeConstant{"}\codeSpecial{\textbackslash{}M-}\codeConstant{[D"}\codeStatement{:}\tab{}\tab{}\codeType{backward-char}\\ 28 | \codelnr{28\ }\codeConstant{"}\codeSpecial{\textbackslash{}M-}\codeConstant{[C"}\codeStatement{:}\tab{}\tab{}\codeType{forward-char}\\ 29 | \codelnr{29\ }\codeConstant{"}\codeSpecial{\textbackslash{}M-}\codeConstant{[A"}\codeStatement{:}\tab{}\tab{}\codeType{previous-history}\\ 30 | \codelnr{30\ }\codeConstant{"}\codeSpecial{\textbackslash{}M-}\codeConstant{[B"}\codeStatement{:}\tab{}\tab{}\codeType{next-history}\\ 31 | \codelnr{31\ }\codeComment{\#}\\ 32 | \codelnr{32\ }\codeComment{\# 八位小键盘上的方向键}\\ 33 | \codelnr{33\ }\codeComment{\#}\\ 34 | \codelnr{34\ }\codeComment{\#"\textbackslash{}M-\textbackslash{}C-OD":\tab{} backward-char}\\ 35 | \codelnr{35\ }\codeComment{\#"\textbackslash{}M-\textbackslash{}C-OC":\tab{} forward-char}\\ 36 | \codelnr{36\ }\codeComment{\#"\textbackslash{}M-\textbackslash{}C-OA":\tab{} previous-history}\\ 37 | \codelnr{37\ }\codeComment{\#"\textbackslash{}M-\textbackslash{}C-OB":\tab{} next-history}\\ 38 | \codelnr{38\ }\codeComment{\#}\\ 39 | \codelnr{39\ }\codeComment{\# 八位 ANSI 模式的方向键 }\\ 40 | \codelnr{40\ }\codeComment{\#}\\ 41 | \codelnr{41\ }\codeComment{\#"\textbackslash{}M-\textbackslash{}C-[D":\tab{} backward-char}\\ 42 | \codelnr{42\ }\codeComment{\#"\textbackslash{}M-\textbackslash{}C-[C":\tab{} forward-char}\\ 43 | \codelnr{43\ }\codeComment{\#"\textbackslash{}M-\textbackslash{}C-[A":\tab{} previous-history}\\ 44 | \codelnr{44\ }\codeComment{\#"\textbackslash{}M-\textbackslash{}C-[B":\tab{} next-history}\\ 45 | \codelnr{45\ }\codeConstant{C-q}\codeStatement{:} \codeType{quoted-insert}\\ 46 | \codelnr{46\ }\codeStatement{\$endif}\\ 47 | \codelnr{47\ }\\ 48 | \codelnr{48\ }\codeComment{\# 旧式的绑定。这恰好也是默认的。}\\ 49 | \codelnr{49\ }\codeSpecial{TAB}\codeStatement{:} \codeType{complete}\\ 50 | \codelnr{50\ }\codeComment{\# 便于 shell 交互的宏。}\\ 51 | \codelnr{51\ }\\ 52 | \codelnr{52\ }\codeStatement{\$if} Bash\\ 53 | \codelnr{53\ }\codeComment{\# 编辑 PATH 路径}\\ 54 | \codelnr{54\ }\codeConstant{"}\codeSpecial{\textbackslash{}C-}\codeConstant{xp"}\codeStatement{:} "PATH=\$\{PATH\}\textbackslash{}e\textbackslash{}C-e\textbackslash{}C-a\textbackslash{}ef\textbackslash{}C-f"\\ 55 | \codelnr{55\ }\codeComment{\# 准备输入引用的单词:插入引号的开始和结束,然后移到开始引号的后面。}\\ 56 | \codelnr{56\ }\codeConstant{"}\codeSpecial{\textbackslash{}C-}\codeConstant{x}\codeSpecial{\textbackslash{}"}\codeConstant{"}\codeStatement{:} "\textbackslash{}"\textbackslash{}"\textbackslash{}C-b"\\ 57 | \codelnr{57\ }\codeComment{\# 插入反斜杠(测试反斜杠转义序列和宏)。}\\ 58 | \codelnr{58\ }\codeConstant{"}\codeSpecial{\textbackslash{}C-}\codeConstant{x}\codeSpecial{\textbackslash{}\textbackslash{}}\codeConstant{"}\codeStatement{:} "\textbackslash{}\textbackslash{}"\\ 59 | \codelnr{59\ }\codeComment{\# 用引号引用当前或前一个单词。}\\ 60 | \codelnr{60\ }\codeConstant{"}\codeSpecial{\textbackslash{}C-}\codeConstant{xq"}\codeStatement{:} "\textbackslash{}eb\textbackslash{}"\textbackslash{}ef\textbackslash{}""\\ 61 | \codelnr{61\ }\codeComment{\# 绑定刷新本行的命令;这原来是没有绑定的。}\\ 62 | \codelnr{62\ }\codeConstant{"}\codeSpecial{\textbackslash{}C-}\codeConstant{xr"}\codeStatement{:} \codeType{redraw-current-line}\\ 63 | \codelnr{63\ }\codeComment{\# 编辑本行中的变量。}\\ 64 | \codelnr{64\ }\codeConstant{"}\codeSpecial{\textbackslash{}M-\textbackslash{}C-}\codeConstant{v"}\codeStatement{:} "\textbackslash{}C-a\textbackslash{}C-k\$\textbackslash{}C-y\textbackslash{}M-\textbackslash{}C-e\textbackslash{}C-a\textbackslash{}C-y="\\ 65 | \codelnr{65\ }\codeStatement{\$endif}\\ 66 | \codelnr{66\ }\\ 67 | \codelnr{67\ }\codeComment{\# 如果可以响铃就使用}\\ 68 | \codelnr{68\ }\codeStatement{set} \codeType{bell-style} \codeConstant{visible}\\ 69 | \codelnr{69\ }\codeComment{\# 读取输入时不要把字符截成 7 位。}\\ 70 | \codelnr{70\ }\codeStatement{set} \codeType{input-meta} \codeConstant{on}\\ 71 | \codelnr{71\ }\codeComment{\# 允许插入 iso-latin1 字符,而不是把它们变成 Meta 化的序列。}\\ 72 | \codelnr{72\ }\codeStatement{set} \codeType{convert-meta} \codeConstant{off}\\ 73 | \codelnr{73\ }\codeComment{\# 直接显示八位的字符,而不是把它们当成 Meta 化的字符来显示。}\\ 74 | \codelnr{74\ }\codeStatement{set} \codeType{output-meta} \codeConstant{on}\\ 75 | \codelnr{75\ }\codeComment{\# 如果可以补全的项目超过 150 条,询问用户是否要显示全部。}\\ 76 | \codelnr{76\ }\codeStatement{set} \codeType{completion-query-items} \codeConstant{150}\\ 77 | \codelnr{77\ }\\ 78 | \codelnr{78\ }\codeComment{\# 用于 FTP}\\ 79 | \codelnr{79\ }\codeStatement{\$if} Ftp\\ 80 | \codelnr{80\ }\codeConstant{"}\codeSpecial{\textbackslash{}C-}\codeConstant{xg"}\codeStatement{:} "get \textbackslash{}M-?"\\ 81 | \codelnr{81\ }\codeConstant{"}\codeSpecial{\textbackslash{}C-}\codeConstant{xt"}\codeStatement{:} "put \textbackslash{}M-?"\\ 82 | \codelnr{82\ }\codeConstant{"}\codeSpecial{\textbackslash{}M-}\codeConstant{."}\codeStatement{:} \codeType{yank-last-arg}\\ 83 | \codelnr{83\ }\codeStatement{\$endif} 84 | -------------------------------------------------------------------------------- /irc.sh: -------------------------------------------------------------------------------- 1 | if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi 2 | -------------------------------------------------------------------------------- /irc.tex: -------------------------------------------------------------------------------- 1 | \codelnr{1\ }\codeStatement{if }\codeStatement{[} \codeStatement{-n} \codeStatement{"}\codePreProc{\$BASH\_ENV}\codeStatement{"} \codeStatement{]}\codeStatement{;} \codeStatement{then}\codeStatement{ . }\codeStatement{"}\codePreProc{\$BASH\_ENV}\codeStatement{";} \codeStatement{fi} 2 | -------------------------------------------------------------------------------- /prompt.sh: -------------------------------------------------------------------------------- 1 | CL="\[\e[0m\]" 2 | GREEN="$CL\[\e[0;32m\]" 3 | BGREEN="$CL\[\e[0;32;1m\]" 4 | XORG="$CL\[\e[0;36m\]" 5 | XRED="$CL\[\e[0;35m\]" 6 | BRED="$CL\[\e[0;35;1m\]" 7 | ORG="$CL\[\e[0;33m\]" 8 | DARK_GRAY="$CL\[\e[1;30m\]" 9 | CYAN="$CL\[\e[1;36m\]" 10 | BLUE="$CL\[\e[1;34m\]" 11 | 12 | # 为了显示方便,下面一行用命令替换进行赋值。实际使用时应该用单引号。 13 | PROMPT_COMMAND=$( 14 | echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007" 15 | NTTY=$(tty | cut -d"/" -f3-4) 16 | LS=$(ls | wc -l) 17 | LSA=$(ls -a | wc -l) 18 | 19 | L1a="$BLUE[$BGREEN\u$GREEN@\h:$NTTY\s$BLUE]$BLUE" 20 | L1b="$ORG\t$BLUE" 21 | L1c="$BLUE<$BRED\w$BLUE>$BLUE" 22 | L1d="($XRED$LS/$LSA$BLUE)$BLUE" 23 | L2="$CYAN\\\$$CL" 24 | export PS1="$L1a-$L1b-$L1c-$L1d-\n$L2 " 25 | #export PS1="[\u@\h:$NTTY\s]-\t-<\w:$LS/$LSA>-\n\\$ " 26 | history -a 27 | ) 28 | # 实际使用时,上面一行也应该改成单引号 29 | -------------------------------------------------------------------------------- /prompt.tex: -------------------------------------------------------------------------------- 1 | \codelnr{\ 1\ }\codeIdentifier{CL}=\codeStatement{"}\codeConstant{\textbackslash{}[}\codeSpecial{\textbackslash{}e}\codeConstant{[0m\textbackslash{}]}\codeStatement{"}\\ 2 | \codelnr{\ 2\ }\codeIdentifier{GREEN}=\codeStatement{"}\codePreProc{\$CL}\codeConstant{\textbackslash{}[}\codeSpecial{\textbackslash{}e}\codeConstant{[0;32m\textbackslash{}]}\codeStatement{"}\\ 3 | \codelnr{\ 3\ }\codeIdentifier{BGREEN}=\codeStatement{"}\codePreProc{\$CL}\codeConstant{\textbackslash{}[}\codeSpecial{\textbackslash{}e}\codeConstant{[0;32;1m\textbackslash{}]}\codeStatement{"}\\ 4 | \codelnr{\ 4\ }\codeIdentifier{XORG}=\codeStatement{"}\codePreProc{\$CL}\codeConstant{\textbackslash{}[}\codeSpecial{\textbackslash{}e}\codeConstant{[0;36m\textbackslash{}]}\codeStatement{"}\\ 5 | \codelnr{\ 5\ }\codeIdentifier{XRED}=\codeStatement{"}\codePreProc{\$CL}\codeConstant{\textbackslash{}[}\codeSpecial{\textbackslash{}e}\codeConstant{[0;35m\textbackslash{}]}\codeStatement{"}\\ 6 | \codelnr{\ 6\ }\codeIdentifier{BRED}=\codeStatement{"}\codePreProc{\$CL}\codeConstant{\textbackslash{}[}\codeSpecial{\textbackslash{}e}\codeConstant{[0;35;1m\textbackslash{}]}\codeStatement{"}\\ 7 | \codelnr{\ 7\ }\codeIdentifier{ORG}=\codeStatement{"}\codePreProc{\$CL}\codeConstant{\textbackslash{}[}\codeSpecial{\textbackslash{}e}\codeConstant{[0;33m\textbackslash{}]}\codeStatement{"}\\ 8 | \codelnr{\ 8\ }\codeIdentifier{DARK\_GRAY}=\codeStatement{"}\codePreProc{\$CL}\codeConstant{\textbackslash{}[}\codeSpecial{\textbackslash{}e}\codeConstant{[1;30m\textbackslash{}]}\codeStatement{"}\\ 9 | \codelnr{\ 9\ }\codeIdentifier{CYAN}=\codeStatement{"}\codePreProc{\$CL}\codeConstant{\textbackslash{}[}\codeSpecial{\textbackslash{}e}\codeConstant{[1;36m\textbackslash{}]}\codeStatement{"}\\ 10 | \codelnr{10\ }\codeIdentifier{BLUE}=\codeStatement{"}\codePreProc{\$CL}\codeConstant{\textbackslash{}[}\codeSpecial{\textbackslash{}e}\codeConstant{[1;34m\textbackslash{}]}\codeStatement{"}\\ 11 | \codelnr{11\ }\\ 12 | \codelnr{12\ }\codeComment{\# 为了显示方便,下面一行用命令替换进行赋值。实际使用时应该用单引号。}\\ 13 | \codelnr{13\ }\codeIdentifier{PROMPT\_COMMAND}=\codePreProc{\$(}\\ 14 | \codelnr{14\ }\codeSpecial{\tab{}}\codeStatement{echo}\codeSpecial{ -ne }\codeStatement{"}\codeSpecial{\textbackslash{}033}\codeConstant{]0;}\codePreProc{\$\{}\codePreProc{USER}\codePreProc{\}}\codeConstant{@}\codePreProc{\$\{}\codePreProc{HOSTNAME}\codePreProc{\}}\codeConstant{: }\codePreProc{\$\{}\codePreProc{PWD}\codePreProc{\}}\codeSpecial{\textbackslash{}007}\codeStatement{"}\\ 15 | \codelnr{15\ }\codeSpecial{\tab{}}\codeIdentifier{NTTY}=\codeSpecial{\$}\codeStatement{(}\codeStatement{tty}\codeSpecial{ }\codeStatement{|}\codeSpecial{ }\codeStatement{cut}\codeSpecial{ -d}\codeStatement{"}\codeConstant{/}\codeStatement{"}\codeSpecial{ -f3}\codeConstant{-4}\codeStatement{)}\\ 16 | \codelnr{16\ }\codeSpecial{\tab{}}\codeIdentifier{LS}=\codeSpecial{\$}\codeStatement{(}\codeStatement{ls}\codeSpecial{ }\codeStatement{|}\codeSpecial{ }\codeStatement{wc}\codeSpecial{ -l}\codeStatement{)}\\ 17 | \codelnr{17\ }\codeSpecial{\tab{}}\codeIdentifier{LSA}=\codeSpecial{\$}\codeStatement{(}\codeStatement{ls}\codeSpecial{ -a }\codeStatement{|}\codeSpecial{ }\codeStatement{wc}\codeSpecial{ -l}\codeStatement{)}\\ 18 | \codelnr{18\ }\\ 19 | \codelnr{19\ }\codeSpecial{\tab{}}\codeIdentifier{L1a}=\codeStatement{"}\codePreProc{\$BLUE}\codeConstant{[}\codePreProc{\$BGREEN}\codeConstant{\textbackslash{}u}\codePreProc{\$GREEN}\codeConstant{@\textbackslash{}h:}\codePreProc{\$NTTY}\codeConstant{\textbackslash{}s}\codePreProc{\$BLUE}\codeConstant{]}\codePreProc{\$BLUE}\codeStatement{"}\\ 20 | \codelnr{20\ }\codeSpecial{\tab{}}\codeIdentifier{L1b}=\codeStatement{"}\codePreProc{\$ORG}\codeSpecial{\textbackslash{}t}\codePreProc{\$BLUE}\codeStatement{"}\\ 21 | \codelnr{21\ }\codeSpecial{\tab{}}\codeIdentifier{L1c}=\codeStatement{"}\codePreProc{\$BLUE}\codeConstant{<}\codePreProc{\$BRED}\codeConstant{\textbackslash{}w}\codePreProc{\$BLUE}\codeConstant{>}\codePreProc{\$BLUE}\codeStatement{"}\\ 22 | \codelnr{22\ }\codeSpecial{\tab{}}\codeIdentifier{L1d}=\codeStatement{"}\codeConstant{(}\codePreProc{\$XRED\$LS}\codeConstant{/}\codePreProc{\$LSA\$BLUE}\codeConstant{)}\codePreProc{\$BLUE}\codeStatement{"}\\ 23 | \codelnr{23\ }\codeSpecial{\tab{}}\codeIdentifier{L2}=\codeStatement{"}\codePreProc{\$CYAN}\codeSpecial{\textbackslash{}\textbackslash{}\textbackslash{}\$}\codePreProc{\$CL}\codeStatement{"}\\ 24 | \codelnr{24\ }\codeSpecial{\tab{}}\codeStatement{export}\codeSpecial{ }\codePreProc{PS1}\codeStatement{="}\codePreProc{\$L1a}\codeConstant{-}\codePreProc{\$L1b}\codeConstant{-}\codePreProc{\$L1c}\codeConstant{-}\codePreProc{\$L1d}\codeConstant{-}\codeSpecial{\textbackslash{}n}\codePreProc{\$L2}\codeConstant{ }\codeStatement{"}\\ 25 | \codelnr{25\ }\codeSpecial{\tab{}\#}\codeStatement{export}\codeSpecial{ }\codePreProc{PS1}\codeStatement{="}\codeConstant{[\textbackslash{}u@\textbackslash{}h:}\codePreProc{\$NTTY}\codeConstant{\textbackslash{}s]-}\codeSpecial{\textbackslash{}t}\codeConstant{-<\textbackslash{}w:}\codePreProc{\$LS}\codeConstant{/}\codePreProc{\$LSA}\codeConstant{>-}\codeSpecial{\textbackslash{}n}\codeSpecial{\textbackslash{}\textbackslash{}}\codeConstant{\$ }\codeStatement{"}\\ 26 | \codelnr{26\ }\codeSpecial{\tab{}}\codeStatement{history}\codeSpecial{ -a}\\ 27 | \codelnr{27\ }\codePreProc{)}\\ 28 | \codelnr{28\ }\codeComment{\# 实际使用时,上面一行也应该改成单引号} 29 | -------------------------------------------------------------------------------- /select.sh: -------------------------------------------------------------------------------- 1 | select fname in *; 2 | do 3 | echo you picked $fname \($REPLY\) 4 | break; 5 | done 6 | -------------------------------------------------------------------------------- /select.tex: -------------------------------------------------------------------------------- 1 | \codelnr{1\ }\codeStatement{select }fname \codeStatement{in} *;\\ 2 | \codelnr{2\ }\codeStatement{do}\\ 3 | \codelnr{3\ }\tab{}\codeStatement{echo} you picked \codePreProc{\$fname} \codeSpecial{\textbackslash{}(}\codePreProc{\$REPLY}\codeSpecial{\textbackslash{})}\\ 4 | \codelnr{4\ }\tab{}\codeStatement{break}\codeStatement{;}\\ 5 | \codelnr{5\ }\codeStatement{done} 6 | -------------------------------------------------------------------------------- /shelltype.sh: -------------------------------------------------------------------------------- 1 | # 第一种方法 2 | case "$-" in 3 | *i*) 4 | echo 这个是交互式的 shell。 5 | ;; 6 | *) 7 | echo 这个不是交互式的 shell。 8 | ;; 9 | esac 10 | 11 | # 第二种方法 12 | if [ -z "$PS1" ]; then 13 | echo 这个不是交互式的 shell。 14 | else 15 | echo 这个是交互式的 shell。 16 | fi 17 | -------------------------------------------------------------------------------- /shelltype.tex: -------------------------------------------------------------------------------- 1 | \codelnr{\ 1\ }\codeComment{\# 第一种方法}\\ 2 | \codelnr{\ 2\ }\codeStatement{case} \codeStatement{"}\codePreProc{\$-}\codeStatement{"} \codeStatement{in}\\ 3 | \codelnr{\ 3\ }\tab{}*i*\codeStatement{)}\\ 4 | \codelnr{\ 4\ }\tab{}\tab{}\codeStatement{echo} 这个是交互式的 shell。\\ 5 | \codelnr{\ 5\ }\tab{}\tab{}\codeStatement{;;}\\ 6 | \codelnr{\ 6\ }\tab{}*\codeStatement{)}\\ 7 | \codelnr{\ 7\ }\tab{}\tab{}\codeStatement{echo} 这个不是交互式的 shell。\\ 8 | \codelnr{\ 8\ }\tab{}\tab{}\codeStatement{;;}\\ 9 | \codelnr{\ 9\ }\codeStatement{esac}\\ 10 | \codelnr{10\ }\\ 11 | \codelnr{11\ }\codeComment{\# 第二种方法}\\ 12 | \codelnr{12\ }\codeStatement{if }\codeStatement{[} \codeStatement{-z} \codeStatement{"}\codePreProc{\$PS1}\codeStatement{"} \codeStatement{]}\codeStatement{;} \codeStatement{then}\\ 13 | \codelnr{13\ }\tab{}\codeStatement{echo} 这个不是交互式的 shell。\\ 14 | \codelnr{14\ }\codeStatement{else}\\ 15 | \codelnr{15\ }\tab{}\codeStatement{echo} 这个是交互式的 shell。\\ 16 | \codelnr{16\ }\codeStatement{fi} 17 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | let html_use_css = 1 2 | let html_output_xhtml = 1 3 | let html_whole_filler=1 4 | let use_xhtml = 1 5 | let html_use_encoding = 'utf-8' 6 | 7 | set number 8 | set wrap 9 | set tabstop=4 10 | set shiftwidth=4 11 | set textwidth=72 12 | set syntax 13 | set noexpandtab 14 | 15 | colorscheme delek 16 | 17 | source /usr/share/vim/vim72/syntax/2html.vim 18 | 19 | " the rest line will insert new backslashes, so the original have to be marked 20 | " dirrerently 21 | %s/\\/\\textbackslashes/g 22 | %s/{\|}\|_/\\&/g 23 | %s@\#@\\#@g 24 | %s@%@\\%@g 25 | %s@\$@\\$@g 26 | %s/ /\\tab{}/g 27 | %s/\^/\\textasciicircum{}/g 28 | %s/\~/\\textasciitilde{}/g 29 | %s@&@\\\&@g 30 | %s@>@>@g 31 | %s@<@<@g 32 | %s/"/"/g 33 | %s@'@\\char13{}@g 34 | %s@\(.\{-\}\)@\\code\1{\2}@g 35 | %s@\(codelnr{\)\([0-9 ]\+ \)}@\=submatch(1).substitute(submatch(2),' ', '\\\\ ', 'g').'}'@g 36 | %s/textbackslashes/textbackslash{}/g 37 | /^
/+1mark a
38 | /^<\/pre>/-1mark b
39 | 0,'b-1s@$@\\\\@g
40 | 'a,'bwrite! %:.:r:r.tex
41 | qall!
42 | 


--------------------------------------------------------------------------------