home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: Tape Archive
(archive/tar).
You can browse this item here: bash-112.tar
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Tape Archive (archive/tar)
| magic
| Supported |
100%
| file
| POSIX tar archive
| default
| |
99%
| file
| POSIX tar archive, directory bash-1.12, mode 000666 , uid 000000 , gid 000000 , size 00000000000 , seconds 00000000000
| default
| |
98%
| file
| data
| default
| |
62%
| TrID
| TAR - Tape ARchive (POSIX)
| default
| |
37%
| TrID
| TAR - Tape ARchive (directory)
| default
| |
100%
| lsar
| Tar
| default
| |
100%
| gt2
| TAR Archiv gefunden (Auflistung ist deaktiviert)
| default
| |
100%
| disktype
| POSIX tar archive
| default
| |
100%
| detectItEasy
| Archive: tar
| default
| |
100%
| binwalkID
| POSIX tar archive, owner user name: "2"
| default
| |
100%
| xdgMime
| application/x-tar
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 62 61 73 68 2d 31 2e 31 | 32 00 00 00 00 00 00 00 |bash-1.1|2.......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 30 30 30 36 | 36 36 20 00 30 30 30 30 |....0006|66 .0000|
|00000070| 30 30 20 00 30 30 30 30 | 30 30 20 00 30 30 30 30 |00 .0000|00 .0000|
|00000080| 30 30 30 30 30 30 30 20 | 30 30 30 30 30 30 30 30 |0000000 |00000000|
|00000090| 30 30 30 20 30 31 30 34 | 30 33 20 00 35 00 00 00 |000 0104|03 .5...|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 75 73 74 61 72 00 30 | 30 00 00 00 00 00 00 00 |.ustar.0|0.......|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 30 30 30 30 30 30 20 |........|.000000 |
|00000150| 00 30 30 30 30 30 30 20 | 00 00 00 00 00 00 00 00 |.000000 |........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 62 61 73 68 2d 31 2e 31 | 32 2f 2e 62 75 69 6c 64 |bash-1.1|2/.build|
|00000210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 30 30 30 36 | 36 36 20 00 30 30 30 30 |....0006|66 .0000|
|00000270| 30 30 20 00 30 30 30 30 | 30 30 20 00 30 30 30 30 |00 .0000|00 .0000|
|00000280| 30 30 30 30 30 30 33 20 | 30 35 33 33 37 32 37 31 |0000003 |05337271|
|00000290| 36 35 35 20 30 31 31 36 | 33 32 20 00 30 00 00 00 |655 0116|32 .0...|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 75 73 74 61 72 00 30 | 30 00 00 00 00 00 00 00 |.ustar.0|0.......|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 30 30 30 30 30 30 20 |........|.000000 |
|00000350| 00 30 30 30 30 30 30 20 | 00 00 00 00 00 00 00 00 |.000000 |........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 30 0d 0a 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |0.......|........|
|00000410| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000470| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000480| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000490| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000500| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000580| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000600| 62 61 73 68 2d 31 2e 31 | 32 2f 2e 64 69 73 74 72 |bash-1.1|2/.distr|
|00000610| 69 62 75 74 69 6f 6e 00 | 00 00 00 00 00 00 00 00 |ibution.|........|
|00000620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000660| 00 00 00 00 30 30 30 36 | 36 36 20 00 30 30 30 30 |....0006|66 .0000|
|00000670| 30 30 20 00 30 30 30 30 | 30 30 20 00 30 30 30 30 |00 .0000|00 .0000|
|00000680| 30 30 30 30 30 30 35 20 | 30 35 31 33 33 34 30 37 |0000005 |05133407|
|00000690| 32 37 37 20 30 31 33 32 | 34 37 20 00 30 00 00 00 |277 0132|47 .0...|
|000006a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000700| 00 75 73 74 61 72 00 30 | 30 00 00 00 00 00 00 00 |.ustar.0|0.......|
|00000710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000740| 00 00 00 00 00 00 00 00 | 00 30 30 30 30 30 30 20 |........|.000000 |
|00000750| 00 30 30 30 30 30 30 20 | 00 00 00 00 00 00 00 00 |.000000 |........|
|00000760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000800| 31 2e 31 32 0a 00 00 00 | 00 00 00 00 00 00 00 00 |1.12....|........|
|00000810| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000880| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000890| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000900| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a00| 62 61 73 68 2d 31 2e 31 | 32 2f 61 6c 69 61 73 2e |bash-1.1|2/alias.|
|00000a10| 63 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |c.......|........|
|00000a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a60| 00 00 00 00 30 30 30 36 | 36 36 20 00 30 30 30 30 |....0006|66 .0000|
|00000a70| 30 30 20 00 30 30 30 30 | 30 30 20 00 30 30 30 30 |00 .0000|00 .0000|
|00000a80| 30 30 32 37 32 31 37 20 | 30 35 30 33 35 36 35 37 |0027217 |05035657|
|00000a90| 33 34 30 20 30 31 32 30 | 30 31 20 00 30 00 00 00 |340 0120|01 .0...|
|00000aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b00| 00 75 73 74 61 72 00 30 | 30 00 00 00 00 00 00 00 |.ustar.0|0.......|
|00000b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b40| 00 00 00 00 00 00 00 00 | 00 30 30 30 30 30 30 20 |........|.000000 |
|00000b50| 00 30 30 30 30 30 30 20 | 00 00 00 00 00 00 00 00 |.000000 |........|
|00000b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c00| 2f 2a 20 61 6c 69 61 73 | 2e 63 20 2d 2d 20 4e 6f |/* alias|.c -- No|
|00000c10| 74 20 61 20 66 75 6c 6c | 20 61 6c 69 61 73 2c 20 |t a full| alias, |
|00000c20| 62 75 74 20 6a 75 73 74 | 20 74 68 65 20 6b 69 6e |but just| the kin|
|00000c30| 64 20 74 68 61 74 20 77 | 65 20 75 73 65 20 69 6e |d that w|e use in|
|00000c40| 20 74 68 65 0a 20 20 20 | 73 68 65 6c 6c 2e 20 20 | the. |shell. |
|00000c50| 43 73 68 20 73 74 79 6c | 65 20 61 6c 69 61 73 20 |Csh styl|e alias |
|00000c60| 69 73 20 73 6f 6d 65 77 | 68 65 72 65 20 65 6c 73 |is somew|here els|
|00000c70| 65 20 28 60 6f 76 65 72 | 20 74 68 65 72 65 2c 20 |e (`over| there, |
|00000c80| 69 6e 20 61 20 62 6f 78 | 27 29 2e 20 2a 2f 0a 0a |in a box|'). */..|
|00000c90| 2f 2a 20 43 6f 70 79 72 | 69 67 68 74 20 28 43 29 |/* Copyr|ight (C)|
|00000ca0| 20 31 39 38 37 2c 31 39 | 39 31 20 46 72 65 65 20 | 1987,19|91 Free |
|00000cb0| 53 6f 66 74 77 61 72 65 | 20 46 6f 75 6e 64 61 74 |Software| Foundat|
|00000cc0| 69 6f 6e 2c 20 49 6e 63 | 2e 0a 0a 20 20 20 54 68 |ion, Inc|... Th|
|00000cd0| 69 73 20 66 69 6c 65 20 | 69 73 20 70 61 72 74 20 |is file |is part |
|00000ce0| 6f 66 20 47 4e 55 20 42 | 61 73 68 2c 20 74 68 65 |of GNU B|ash, the|
|00000cf0| 20 42 6f 75 72 6e 65 20 | 41 67 61 69 6e 20 53 48 | Bourne |Again SH|
|00000d00| 65 6c 6c 2e 0a 0a 20 20 | 20 42 61 73 68 20 69 73 |ell... | Bash is|
|00000d10| 20 66 72 65 65 20 73 6f | 66 74 77 61 72 65 3b 20 | free so|ftware; |
|00000d20| 79 6f 75 20 63 61 6e 20 | 72 65 64 69 73 74 72 69 |you can |redistri|
|00000d30| 62 75 74 65 20 69 74 20 | 61 6e 64 2f 6f 72 20 6d |bute it |and/or m|
|00000d40| 6f 64 69 66 79 20 69 74 | 0a 20 20 20 75 6e 64 65 |odify it|. unde|
|00000d50| 72 20 74 68 65 20 74 65 | 72 6d 73 20 6f 66 20 74 |r the te|rms of t|
|00000d60| 68 65 20 47 4e 55 20 47 | 65 6e 65 72 61 6c 20 50 |he GNU G|eneral P|
|00000d70| 75 62 6c 69 63 20 4c 69 | 63 65 6e 73 65 20 61 73 |ublic Li|cense as|
|00000d80| 20 70 75 62 6c 69 73 68 | 65 64 20 62 79 0a 20 20 | publish|ed by. |
|00000d90| 20 74 68 65 20 46 72 65 | 65 20 53 6f 66 74 77 61 | the Fre|e Softwa|
|00000da0| 72 65 20 46 6f 75 6e 64 | 61 74 69 6f 6e 3b 20 65 |re Found|ation; e|
|00000db0| 69 74 68 65 72 20 76 65 | 72 73 69 6f 6e 20 31 2c |ither ve|rsion 1,|
|00000dc0| 20 6f 72 20 28 61 74 20 | 79 6f 75 72 20 6f 70 74 | or (at |your opt|
|00000dd0| 69 6f 6e 29 0a 20 20 20 | 61 6e 79 20 6c 61 74 65 |ion). |any late|
|00000de0| 72 20 76 65 72 73 69 6f | 6e 2e 0a 0a 20 20 20 42 |r versio|n... B|
|00000df0| 61 73 68 20 69 73 20 64 | 69 73 74 72 69 62 75 74 |ash is d|istribut|
|00000e00| 65 64 20 69 6e 20 74 68 | 65 20 68 6f 70 65 20 74 |ed in th|e hope t|
|00000e10| 68 61 74 20 69 74 20 77 | 69 6c 6c 20 62 65 20 75 |hat it w|ill be u|
|00000e20| 73 65 66 75 6c 2c 20 62 | 75 74 20 57 49 54 48 4f |seful, b|ut WITHO|
|00000e30| 55 54 0a 20 20 20 41 4e | 59 20 57 41 52 52 41 4e |UT. AN|Y WARRAN|
|00000e40| 54 59 3b 20 77 69 74 68 | 6f 75 74 20 65 76 65 6e |TY; with|out even|
|00000e50| 20 74 68 65 20 69 6d 70 | 6c 69 65 64 20 77 61 72 | the imp|lied war|
|00000e60| 72 61 6e 74 79 20 6f 66 | 20 4d 45 52 43 48 41 4e |ranty of| MERCHAN|
|00000e70| 54 41 42 49 4c 49 54 59 | 0a 20 20 20 6f 72 20 46 |TABILITY|. or F|
|00000e80| 49 54 4e 45 53 53 20 46 | 4f 52 20 41 20 50 41 52 |ITNESS F|OR A PAR|
|00000e90| 54 49 43 55 4c 41 52 20 | 50 55 52 50 4f 53 45 2e |TICULAR |PURPOSE.|
|00000ea0| 20 20 53 65 65 20 74 68 | 65 20 47 4e 55 20 47 65 | See th|e GNU Ge|
|00000eb0| 6e 65 72 61 6c 20 50 75 | 62 6c 69 63 0a 20 20 20 |neral Pu|blic. |
|00000ec0| 4c 69 63 65 6e 73 65 20 | 66 6f 72 20 6d 6f 72 65 |License |for more|
|00000ed0| 20 64 65 74 61 69 6c 73 | 2e 0a 0a 20 20 20 59 6f | details|... Yo|
|00000ee0| 75 20 73 68 6f 75 6c 64 | 20 68 61 76 65 20 72 65 |u should| have re|
|00000ef0| 63 65 69 76 65 64 20 61 | 20 63 6f 70 79 20 6f 66 |ceived a| copy of|
|00000f00| 20 74 68 65 20 47 4e 55 | 20 47 65 6e 65 72 61 6c | the GNU| General|
|00000f10| 20 50 75 62 6c 69 63 20 | 4c 69 63 65 6e 73 65 0a | Public |License.|
|00000f20| 20 20 20 61 6c 6f 6e 67 | 20 77 69 74 68 20 42 61 | along| with Ba|
|00000f30| 73 68 3b 20 73 65 65 20 | 74 68 65 20 66 69 6c 65 |sh; see |the file|
|00000f40| 20 43 4f 50 59 49 4e 47 | 2e 20 20 49 66 20 6e 6f | COPYING|. If no|
|00000f50| 74 2c 20 77 72 69 74 65 | 20 74 6f 20 74 68 65 20 |t, write| to the |
|00000f60| 46 72 65 65 0a 20 20 20 | 53 6f 66 74 77 61 72 65 |Free. |Software|
|00000f70| 20 46 6f 75 6e 64 61 74 | 69 6f 6e 2c 20 36 37 35 | Foundat|ion, 675|
|00000f80| 20 4d 61 73 73 20 41 76 | 65 2c 20 43 61 6d 62 72 | Mass Av|e, Cambr|
|00000f90| 69 64 67 65 2c 20 4d 41 | 20 30 32 31 33 39 2c 20 |idge, MA| 02139, |
|00000fa0| 55 53 41 2e 20 2a 2f 0a | 0a 23 69 6e 63 6c 75 64 |USA. */.|.#includ|
|00000fb0| 65 20 3c 73 74 64 69 6f | 2e 68 3e 0a 23 69 6e 63 |e <stdio|.h>.#inc|
|00000fc0| 6c 75 64 65 20 22 63 6f | 6e 66 69 67 2e 68 22 0a |lude "co|nfig.h".|
|00000fd0| 23 69 6e 63 6c 75 64 65 | 20 22 67 65 6e 65 72 61 |#include| "genera|
|00000fe0| 6c 2e 68 22 0a 23 69 6e | 63 6c 75 64 65 20 22 61 |l.h".#in|clude "a|
|00000ff0| 6c 69 61 73 2e 68 22 0a | 0a 2f 2a 20 54 68 65 20 |lias.h".|./* The |
|00001000| 6e 75 6d 62 65 72 20 6f | 66 20 73 6c 6f 74 73 20 |number o|f slots |
|00001010| 74 6f 20 61 6c 6c 6f 63 | 61 74 65 20 77 68 65 6e |to alloc|ate when|
|00001020| 20 77 65 20 6e 65 65 64 | 20 6e 65 77 20 73 6c 6f | we need| new slo|
|00001030| 74 73 2e 20 2a 2f 0a 23 | 64 65 66 69 6e 65 20 61 |ts. */.#|define a|
|00001040| 6c 69 61 73 5f 6c 69 73 | 74 5f 67 72 6f 77 5f 61 |lias_lis|t_grow_a|
|00001050| 6d 6f 75 6e 74 20 35 30 | 0a 0a 2f 2a 20 4e 6f 6e |mount 50|../* Non|
|00001060| 2d 7a 65 72 6f 20 6d 65 | 61 6e 73 20 65 78 70 61 |-zero me|ans expa|
|00001070| 6e 64 20 61 6c 6c 20 77 | 6f 72 64 73 20 6f 6e 20 |nd all w|ords on |
|00001080| 74 68 65 20 6c 69 6e 65 | 2e 20 20 4f 74 68 65 72 |the line|. Other|
|00001090| 77 69 73 65 2c 20 65 78 | 70 61 6e 64 0a 20 20 20 |wise, ex|pand. |
|000010a0| 61 66 74 65 72 20 66 69 | 72 73 74 20 65 78 70 61 |after fi|rst expa|
|000010b0| 6e 73 69 6f 6e 20 69 66 | 20 74 68 65 20 65 78 70 |nsion if| the exp|
|000010c0| 61 6e 73 69 6f 6e 20 65 | 6e 64 73 20 69 6e 20 61 |ansion e|nds in a|
|000010d0| 20 73 70 61 63 65 2e 20 | 2a 2f 0a 69 6e 74 20 61 | space. |*/.int a|
|000010e0| 6c 69 61 73 5f 65 78 70 | 61 6e 64 5f 61 6c 6c 20 |lias_exp|and_all |
|000010f0| 3d 20 30 3b 0a 0a 2f 2a | 20 54 68 65 20 6c 69 73 |= 0;../*| The lis|
|00001100| 74 20 6f 66 20 61 6c 69 | 61 73 65 73 20 74 68 61 |t of ali|ases tha|
|00001110| 74 20 77 65 20 68 61 76 | 65 2e 20 2a 2f 0a 41 53 |t we hav|e. */.AS|
|00001120| 53 4f 43 20 2a 2a 61 6c | 69 61 73 65 73 20 3d 20 |SOC **al|iases = |
|00001130| 28 41 53 53 4f 43 20 2a | 2a 29 4e 55 4c 4c 3b 0a |(ASSOC *|*)NULL;.|
|00001140| 0a 2f 2a 20 54 68 65 20 | 6e 75 6d 62 65 72 20 6f |./* The |number o|
|00001150| 66 20 73 6c 6f 74 73 20 | 69 6e 20 74 68 65 20 61 |f slots |in the a|
|00001160| 62 6f 76 65 20 6c 69 73 | 74 2e 20 2a 2f 0a 73 74 |bove lis|t. */.st|
|00001170| 61 74 69 63 20 69 6e 74 | 20 61 6c 69 61 73 65 73 |atic int| aliases|
|00001180| 5f 73 69 7a 65 20 3d 20 | 30 3b 0a 0a 2f 2a 20 54 |_size = |0;../* T|
|00001190| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 61 6c 69 |he numbe|r of ali|
|000011a0| 61 73 65 73 20 74 68 61 | 74 20 61 72 65 20 69 6e |ases tha|t are in|
|000011b0| 20 65 78 69 73 74 65 6e | 63 65 2e 20 2a 2f 0a 73 | existen|ce. */.s|
|000011c0| 74 61 74 69 63 20 69 6e | 74 20 61 6c 69 61 73 65 |tatic in|t aliase|
|000011d0| 73 5f 6c 65 6e 67 74 68 | 20 3d 20 30 3b 0a 0a 2f |s_length| = 0;../|
|000011e0| 2a 20 54 68 65 20 6c 61 | 73 74 20 61 6c 69 61 73 |* The la|st alias|
|000011f0| 20 69 6e 64 65 78 20 66 | 6f 75 6e 64 20 77 69 74 | index f|ound wit|
|00001200| 68 20 66 69 6e 64 5f 61 | 6c 69 61 73 20 28 29 2e |h find_a|lias ().|
|00001210| 20 2a 2f 0a 73 74 61 74 | 69 63 20 69 6e 74 20 6c | */.stat|ic int l|
|00001220| 61 73 74 5f 61 6c 69 61 | 73 5f 69 6e 64 65 78 20 |ast_alia|s_index |
|00001230| 3d 20 30 3b 0a 0a 2f 2a | 20 53 63 61 6e 20 74 68 |= 0;../*| Scan th|
|00001240| 65 20 6c 69 73 74 20 6f | 66 20 61 6c 69 61 73 65 |e list o|f aliase|
|00001250| 73 20 6c 6f 6f 6b 69 6e | 67 20 66 6f 72 20 6f 6e |s lookin|g for on|
|00001260| 65 20 77 69 74 68 20 4e | 41 4d 45 2e 20 20 52 65 |e with N|AME. Re|
|00001270| 74 75 72 6e 20 4e 55 4c | 4c 0a 20 20 20 69 66 20 |turn NUL|L. if |
|00001280| 74 68 65 20 61 6c 69 61 | 73 20 64 6f 65 73 6e 27 |the alia|s doesn'|
|00001290| 74 20 65 78 69 73 74 2c | 20 65 6c 73 65 20 61 20 |t exist,| else a |
|000012a0| 70 6f 69 6e 74 65 72 20 | 74 6f 20 74 68 65 20 61 |pointer |to the a|
|000012b0| 73 73 6f 63 2e 20 2a 2f | 0a 41 53 53 4f 43 20 2a |ssoc. */|.ASSOC *|
|000012c0| 0a 66 69 6e 64 5f 61 6c | 69 61 73 20 28 6e 61 6d |.find_al|ias (nam|
|000012d0| 65 29 0a 20 20 20 20 20 | 63 68 61 72 20 2a 6e 61 |e). |char *na|
|000012e0| 6d 65 3b 0a 7b 0a 20 20 | 72 65 67 69 73 74 65 72 |me;.{. |register|
|000012f0| 20 69 6e 74 20 69 3b 0a | 0a 20 20 66 6f 72 20 28 | int i;.|. for (|
|00001300| 69 20 3d 20 30 3b 20 69 | 20 3c 20 61 6c 69 61 73 |i = 0; i| < alias|
|00001310| 65 73 5f 6c 65 6e 67 74 | 68 3b 20 69 2b 2b 29 0a |es_lengt|h; i++).|
|00001320| 20 20 20 20 69 66 20 28 | 53 54 52 45 51 20 28 6e | if (|STREQ (n|
|00001330| 61 6d 65 2c 20 61 6c 69 | 61 73 65 73 5b 69 5d 2d |ame, ali|ases[i]-|
|00001340| 3e 6e 61 6d 65 29 29 0a | 20 20 20 20 20 20 72 65 |>name)).| re|
|00001350| 74 75 72 6e 20 28 61 6c | 69 61 73 65 73 5b 6c 61 |turn (al|iases[la|
|00001360| 73 74 5f 61 6c 69 61 73 | 5f 69 6e 64 65 78 20 3d |st_alias|_index =|
|00001370| 20 69 5d 29 3b 0a 0a 20 | 20 72 65 74 75 72 6e 20 | i]);.. | return |
|00001380| 28 28 41 53 53 4f 43 20 | 2a 29 4e 55 4c 4c 29 3b |((ASSOC |*)NULL);|
|00001390| 0a 7d 0a 0a 2f 2a 20 52 | 65 74 75 72 6e 20 74 68 |.}../* R|eturn th|
|000013a0| 65 20 76 61 6c 75 65 20 | 6f 66 20 74 68 65 20 61 |e value |of the a|
|000013b0| 6c 69 61 73 20 66 6f 72 | 20 4e 41 4d 45 2c 20 6f |lias for| NAME, o|
|000013c0| 72 20 4e 55 4c 4c 20 69 | 66 20 74 68 65 72 65 20 |r NULL i|f there |
|000013d0| 69 73 20 6e 6f 6e 65 2e | 20 2a 2f 0a 63 68 61 72 |is none.| */.char|
|000013e0| 20 2a 0a 67 65 74 5f 61 | 6c 69 61 73 5f 76 61 6c | *.get_a|lias_val|
|000013f0| 75 65 20 28 6e 61 6d 65 | 29 0a 20 20 20 20 20 63 |ue (name|). c|
|00001400| 68 61 72 20 2a 6e 61 6d | 65 3b 0a 7b 0a 20 20 41 |har *nam|e;.{. A|
|00001410| 53 53 4f 43 20 2a 61 6c | 69 61 73 20 3d 20 66 69 |SSOC *al|ias = fi|
|00001420| 6e 64 5f 61 6c 69 61 73 | 20 28 6e 61 6d 65 29 3b |nd_alias| (name);|
|00001430| 0a 20 20 69 66 20 28 61 | 6c 69 61 73 29 0a 20 20 |. if (a|lias). |
|00001440| 20 20 72 65 74 75 72 6e | 20 28 61 6c 69 61 73 2d | return| (alias-|
|00001450| 3e 76 61 6c 75 65 29 3b | 0a 20 20 65 6c 73 65 0a |>value);|. else.|
|00001460| 20 20 20 20 72 65 74 75 | 72 6e 20 28 28 63 68 61 | retu|rn ((cha|
|00001470| 72 20 2a 29 4e 55 4c 4c | 29 3b 0a 7d 0a 0a 2f 2a |r *)NULL|);.}../*|
|00001480| 20 4d 61 6b 65 20 61 20 | 6e 65 77 20 61 6c 69 61 | Make a |new alia|
|00001490| 73 20 66 72 6f 6d 20 4e | 41 4d 45 20 61 6e 64 20 |s from N|AME and |
|000014a0| 56 41 4c 55 45 2e 20 20 | 49 66 20 4e 41 4d 45 20 |VALUE. |If NAME |
|000014b0| 63 61 6e 20 62 65 20 66 | 6f 75 6e 64 2c 0a 20 20 |can be f|ound,. |
|000014c0| 20 74 68 65 6e 20 72 65 | 70 6c 61 63 65 20 69 74 | then re|place it|
|000014d0| 73 20 76 61 6c 75 65 2e | 20 2a 2f 0a 76 6f 69 64 |s value.| */.void|
|000014e0| 0a 61 64 64 5f 61 6c 69 | 61 73 20 28 6e 61 6d 65 |.add_ali|as (name|
|000014f0| 2c 20 76 61 6c 75 65 29 | 0a 20 20 20 20 20 63 68 |, value)|. ch|
|00001500| 61 72 20 2a 6e 61 6d 65 | 2c 20 2a 76 61 6c 75 65 |ar *name|, *value|
|00001510| 3b 0a 7b 0a 20 20 41 53 | 53 4f 43 20 2a 74 65 6d |;.{. AS|SOC *tem|
|00001520| 70 20 3d 20 66 69 6e 64 | 5f 61 6c 69 61 73 20 28 |p = find|_alias (|
|00001530| 6e 61 6d 65 29 3b 0a 0a | 20 20 69 66 20 28 74 65 |name);..| if (te|
|00001540| 6d 70 29 0a 20 20 20 20 | 7b 0a 20 20 20 20 20 20 |mp). |{. |
|00001550| 66 72 65 65 20 28 74 65 | 6d 70 2d 3e 76 61 6c 75 |free (te|mp->valu|
|00001560| 65 29 3b 0a 20 20 20 20 | 20 20 74 65 6d 70 2d 3e |e);. | temp->|
|00001570| 76 61 6c 75 65 20 3d 20 | 73 61 76 65 73 74 72 69 |value = |savestri|
|00001580| 6e 67 20 28 76 61 6c 75 | 65 29 3b 0a 20 20 20 20 |ng (valu|e);. |
|00001590| 7d 0a 20 20 65 6c 73 65 | 0a 20 20 20 20 7b 0a 20 |}. else|. {. |
|000015a0| 20 20 20 20 20 74 65 6d | 70 20 3d 20 28 41 53 53 | tem|p = (ASS|
|000015b0| 4f 43 20 2a 29 78 6d 61 | 6c 6c 6f 63 20 28 73 69 |OC *)xma|lloc (si|
|000015c0| 7a 65 6f 66 20 28 41 53 | 53 4f 43 29 29 3b 0a 20 |zeof (AS|SOC));. |
|000015d0| 20 20 20 20 20 74 65 6d | 70 2d 3e 6e 61 6d 65 20 | tem|p->name |
|000015e0| 3d 20 73 61 76 65 73 74 | 72 69 6e 67 20 28 6e 61 |= savest|ring (na|
|000015f0| 6d 65 29 3b 0a 20 20 20 | 20 20 20 74 65 6d 70 2d |me);. | temp-|
|00001600| 3e 76 61 6c 75 65 20 3d | 20 73 61 76 65 73 74 72 |>value =| savestr|
|00001610| 69 6e 67 20 28 76 61 6c | 75 65 29 3b 0a 0a 20 20 |ing (val|ue);.. |
|00001620| 20 20 20 20 69 66 20 28 | 28 61 6c 69 61 73 65 73 | if (|(aliases|
|00001630| 5f 6c 65 6e 67 74 68 20 | 2b 20 31 29 20 3e 3d 20 |_length |+ 1) >= |
|00001640| 61 6c 69 61 73 65 73 5f | 73 69 7a 65 29 0a 09 7b |aliases_|size)..{|
|00001650| 0a 09 20 20 61 6c 69 61 | 73 65 73 20 3d 0a 09 20 |.. alia|ses =.. |
|00001660| 20 20 20 28 41 53 53 4f | 43 20 2a 2a 29 78 72 65 | (ASSO|C **)xre|
|00001670| 61 6c 6c 6f 63 20 28 61 | 6c 69 61 73 65 73 2c 0a |alloc (a|liases,.|
|00001680| 09 09 09 09 28 61 6c 69 | 61 73 65 73 5f 73 69 7a |....(ali|ases_siz|
|00001690| 65 20 2b 3d 20 61 6c 69 | 61 73 5f 6c 69 73 74 5f |e += ali|as_list_|
|000016a0| 67 72 6f 77 5f 61 6d 6f | 75 6e 74 29 0a 09 09 09 |grow_amo|unt)....|
|000016b0| 09 2a 20 73 69 7a 65 6f | 66 20 28 41 53 53 4f 43 |.* sizeo|f (ASSOC|
|000016c0| 20 2a 29 29 3b 0a 09 7d | 0a 20 20 20 20 20 20 61 | *));..}|. a|
|000016d0| 6c 69 61 73 65 73 5b 61 | 6c 69 61 73 65 73 5f 6c |liases[a|liases_l|
|000016e0| 65 6e 67 74 68 2b 2b 5d | 20 3d 20 74 65 6d 70 3b |ength++]| = temp;|
|000016f0| 0a 20 20 20 20 20 20 61 | 6c 69 61 73 65 73 5b 61 |. a|liases[a|
|00001700| 6c 69 61 73 65 73 5f 6c | 65 6e 67 74 68 5d 20 3d |liases_l|ength] =|
|00001710| 20 28 41 53 53 4f 43 20 | 2a 29 4e 55 4c 4c 3b 0a | (ASSOC |*)NULL;.|
|00001720| 20 20 20 20 7d 0a 7d 0a | 0a 2f 2a 20 52 65 6d 6f | }.}.|./* Remo|
|00001730| 76 65 20 74 68 65 20 61 | 6c 69 61 73 20 77 69 74 |ve the a|lias wit|
|00001740| 68 20 6e 61 6d 65 20 4e | 41 4d 45 20 66 72 6f 6d |h name N|AME from|
|00001750| 20 74 68 65 20 61 6c 69 | 61 73 20 6c 69 73 74 2e | the ali|as list.|
|00001760| 20 20 52 65 74 75 72 6e | 73 0a 20 20 20 74 68 65 | Return|s. the|
|00001770| 20 69 6e 64 65 78 20 6f | 66 20 74 68 65 20 72 65 | index o|f the re|
|00001780| 6d 6f 76 65 64 20 61 6c | 69 61 73 2c 20 6f 72 20 |moved al|ias, or |
|00001790| 2d 31 20 69 66 20 74 68 | 65 20 61 6c 69 61 73 20 |-1 if th|e alias |
|000017a0| 64 69 64 6e 27 74 20 65 | 78 69 73 74 2e 20 2a 2f |didn't e|xist. */|
|000017b0| 0a 69 6e 74 0a 72 65 6d | 6f 76 65 5f 61 6c 69 61 |.int.rem|ove_alia|
|000017c0| 73 20 28 6e 61 6d 65 29 | 0a 20 20 20 20 20 63 68 |s (name)|. ch|
|000017d0| 61 72 20 2a 6e 61 6d 65 | 3b 0a 7b 0a 20 20 72 65 |ar *name|;.{. re|
|000017e0| 67 69 73 74 65 72 20 69 | 6e 74 20 69 3b 0a 0a 20 |gister i|nt i;.. |
|000017f0| 20 69 66 20 28 21 66 69 | 6e 64 5f 61 6c 69 61 73 | if (!fi|nd_alias|
|00001800| 20 28 6e 61 6d 65 29 29 | 0a 20 20 20 20 72 65 74 | (name))|. ret|
|00001810| 75 72 6e 20 28 2d 31 29 | 3b 0a 0a 20 20 69 20 3d |urn (-1)|;.. i =|
|00001820| 20 6c 61 73 74 5f 61 6c | 69 61 73 5f 69 6e 64 65 | last_al|ias_inde|
|00001830| 78 3b 0a 20 20 66 72 65 | 65 20 28 61 6c 69 61 73 |x;. fre|e (alias|
|00001840| 65 73 5b 69 5d 2d 3e 6e | 61 6d 65 29 3b 0a 20 20 |es[i]->n|ame);. |
|00001850| 66 72 65 65 20 28 61 6c | 69 61 73 65 73 5b 69 5d |free (al|iases[i]|
|00001860| 2d 3e 76 61 6c 75 65 29 | 3b 0a 20 20 66 72 65 65 |->value)|;. free|
|00001870| 20 28 61 6c 69 61 73 65 | 73 5b 69 5d 29 3b 0a 0a | (aliase|s[i]);..|
|00001880| 20 20 66 6f 72 20 28 3b | 20 69 20 3c 20 61 6c 69 | for (;| i < ali|
|00001890| 61 73 65 73 5f 6c 65 6e | 67 74 68 3b 20 69 2b 2b |ases_len|gth; i++|
|000018a0| 29 0a 20 20 20 20 61 6c | 69 61 73 65 73 5b 69 5d |). al|iases[i]|
|000018b0| 20 3d 20 61 6c 69 61 73 | 65 73 5b 69 20 2b 20 31 | = alias|es[i + 1|
|000018c0| 5d 3b 0a 0a 20 20 61 6c | 69 61 73 65 73 5f 6c 65 |];.. al|iases_le|
|000018d0| 6e 67 74 68 2d 2d 3b 0a | 20 20 61 6c 69 61 73 65 |ngth--;.| aliase|
|000018e0| 73 5b 61 6c 69 61 73 65 | 73 5f 6c 65 6e 67 74 68 |s[aliase|s_length|
|000018f0| 5d 20 3d 20 28 41 53 53 | 4f 43 20 2a 29 4e 55 4c |] = (ASS|OC *)NUL|
|00001900| 4c 3b 0a 0a 20 20 72 65 | 74 75 72 6e 20 28 6c 61 |L;.. re|turn (la|
|00001910| 73 74 5f 61 6c 69 61 73 | 5f 69 6e 64 65 78 29 3b |st_alias|_index);|
|00001920| 0a 7d 0a 0a 2f 2a 20 44 | 65 6c 65 74 65 20 61 6c |.}../* D|elete al|
|00001930| 6c 20 61 6c 69 61 73 65 | 73 2e 20 2a 2f 0a 64 65 |l aliase|s. */.de|
|00001940| 6c 65 74 65 5f 61 6c 6c | 5f 61 6c 69 61 73 65 73 |lete_all|_aliases|
|00001950| 20 28 29 0a 7b 0a 20 20 | 72 65 67 69 73 74 65 72 | ().{. |register|
|00001960| 20 69 6e 74 20 69 3b 0a | 0a 20 20 66 6f 72 20 28 | int i;.|. for (|
|00001970| 69 20 3d 20 30 3b 20 69 | 20 3c 20 61 6c 69 61 73 |i = 0; i| < alias|
|00001980| 65 73 5f 6c 65 6e 67 74 | 68 3b 20 69 2b 2b 29 0a |es_lengt|h; i++).|
|00001990| 20 20 20 20 7b 0a 20 20 | 20 20 20 20 66 72 65 65 | {. | free|
|000019a0| 20 28 61 6c 69 61 73 65 | 73 5b 69 5d 2d 3e 6e 61 | (aliase|s[i]->na|
|000019b0| 6d 65 29 3b 0a 20 20 20 | 20 20 20 66 72 65 65 20 |me);. | free |
|000019c0| 28 61 6c 69 61 73 65 73 | 5b 69 5d 2d 3e 76 61 6c |(aliases|[i]->val|
|000019d0| 75 65 29 3b 0a 20 20 20 | 20 20 20 66 72 65 65 20 |ue);. | free |
|000019e0| 28 61 6c 69 61 73 65 73 | 5b 69 5d 29 3b 0a 20 20 |(aliases|[i]);. |
|000019f0| 20 20 20 20 61 6c 69 61 | 73 65 73 5b 69 5d 20 3d | alia|ses[i] =|
|00001a00| 20 28 41 53 53 4f 43 20 | 2a 29 4e 55 4c 4c 3b 0a | (ASSOC |*)NULL;.|
|00001a10| 20 20 20 20 7d 0a 0a 20 | 20 61 6c 69 61 73 65 73 | }.. | aliases|
|00001a20| 5f 6c 65 6e 67 74 68 20 | 3d 20 30 3b 0a 7d 0a 0a |_length |= 0;.}..|
|00001a30| 2f 2a 20 52 65 74 75 72 | 6e 20 6e 6f 6e 2d 7a 65 |/* Retur|n non-ze|
|00001a40| 72 6f 20 69 66 20 43 48 | 41 52 41 43 54 45 52 20 |ro if CH|ARACTER |
|00001a50| 69 73 20 61 20 6d 65 6d | 62 65 72 20 6f 66 20 74 |is a mem|ber of t|
|00001a60| 68 65 20 63 6c 61 73 73 | 20 6f 66 20 63 68 61 72 |he class| of char|
|00001a70| 61 63 74 65 72 73 0a 20 | 20 20 74 68 61 74 20 61 |acters. | that a|
|00001a80| 72 65 20 73 65 6c 66 2d | 64 65 6c 69 6d 69 74 69 |re self-|delimiti|
|00001a90| 6e 67 20 69 6e 20 74 68 | 65 20 73 68 65 6c 6c 20 |ng in th|e shell |
|00001aa0| 28 74 68 69 73 20 72 65 | 61 6c 6c 79 20 6d 65 61 |(this re|ally mea|
|00001ab0| 6e 73 20 74 68 61 74 20 | 74 68 65 73 65 0a 20 20 |ns that |these. |
|00001ac0| 20 63 68 61 72 61 63 74 | 65 72 73 20 64 65 6c 69 | charact|ers deli|
|00001ad0| 6d 69 74 20 74 6f 6b 65 | 6e 73 29 2e 20 2a 2f 0a |mit toke|ns). */.|
|00001ae0| 23 64 65 66 69 6e 65 20 | 73 65 6c 66 5f 64 65 6c |#define |self_del|
|00001af0| 69 6d 69 74 69 6e 67 28 | 63 68 61 72 61 63 74 65 |imiting(|characte|
|00001b00| 72 29 20 28 6d 65 6d 62 | 65 72 20 28 28 63 68 61 |r) (memb|er ((cha|
|00001b10| 72 61 63 74 65 72 29 2c | 20 22 20 5c 74 5c 6e 5c |racter),| " \t\n\|
|00001b20| 72 3b 7c 26 28 29 22 29 | 29 0a 0a 2f 2a 20 52 65 |r;|&()")|)../* Re|
|00001b30| 74 75 72 6e 20 6e 6f 6e | 2d 7a 65 72 6f 20 69 66 |turn non|-zero if|
|00001b40| 20 43 48 41 52 41 43 54 | 45 52 20 69 73 20 61 20 | CHARACT|ER is a |
|00001b50| 6d 65 6d 62 65 72 20 6f | 66 20 74 68 65 20 63 6c |member o|f the cl|
|00001b60| 61 73 73 20 6f 66 20 63 | 68 61 72 61 63 74 65 72 |ass of c|haracter|
|00001b70| 73 0a 20 20 20 74 68 61 | 74 20 64 65 6c 69 6d 69 |s. tha|t delimi|
|00001b80| 74 20 63 6f 6d 6d 61 6e | 64 73 20 69 6e 20 74 68 |t comman|ds in th|
|00001b90| 65 20 73 68 65 6c 6c 2e | 20 2a 2f 0a 23 64 65 66 |e shell.| */.#def|
|00001ba0| 69 6e 65 20 63 6f 6d 6d | 61 6e 64 5f 73 65 70 61 |ine comm|and_sepa|
|00001bb0| 72 61 74 6f 72 28 63 68 | 61 72 61 63 74 65 72 29 |rator(ch|aracter)|
|00001bc0| 20 28 6d 65 6d 62 65 72 | 20 28 28 63 68 61 72 61 | (member| ((chara|
|00001bd0| 63 74 65 72 29 2c 20 22 | 5c 72 5c 6e 3b 7c 26 28 |cter), "|\r\n;|&(|
|00001be0| 22 29 29 0a 0a 2f 2a 20 | 49 66 20 74 68 69 73 20 |"))../* |If this |
|00001bf0| 69 73 20 31 2c 20 77 65 | 20 61 72 65 20 63 68 65 |is 1, we| are che|
|00001c00| 63 6b 69 6e 67 20 74 68 | 65 20 6e 65 78 74 20 74 |cking th|e next t|
|00001c10| 6f 6b 65 6e 20 72 65 61 | 64 20 66 6f 72 20 61 6c |oken rea|d for al|
|00001c20| 69 61 73 20 65 78 70 61 | 6e 73 69 6f 6e 0a 20 20 |ias expa|nsion. |
|00001c30| 20 62 65 63 61 75 73 65 | 20 69 74 20 69 73 20 74 | because| it is t|
|00001c40| 68 65 20 66 69 72 73 74 | 20 77 6f 72 64 20 69 6e |he first| word in|
|00001c50| 20 61 20 63 6f 6d 6d 61 | 6e 64 2e 20 2a 2f 0a 73 | a comma|nd. */.s|
|00001c60| 74 61 74 69 63 20 69 6e | 74 20 63 6f 6d 6d 61 6e |tatic in|t comman|
|00001c70| 64 5f 77 6f 72 64 3b 0a | 0a 2f 2a 20 54 68 69 73 |d_word;.|./* This|
|00001c80| 20 69 73 20 66 6f 72 20 | 73 6b 69 70 70 69 6e 67 | is for |skipping|
|00001c90| 20 71 75 6f 74 65 64 20 | 73 74 72 69 6e 67 73 20 | quoted |strings |
|00001ca0| 69 6e 20 61 6c 69 61 73 | 20 65 78 70 61 6e 73 69 |in alias| expansi|
|00001cb0| 6f 6e 73 2e 20 2a 2f 0a | 23 64 65 66 69 6e 65 20 |ons. */.|#define |
|00001cc0| 71 75 6f 74 65 5f 63 68 | 61 72 28 63 29 20 20 28 |quote_ch|ar(c) (|
|00001cd0| 28 28 63 29 20 3d 3d 20 | 27 5c 27 27 29 20 7c 7c |((c) == |'\'') |||
|00001ce0| 20 28 28 63 29 20 3d 3d | 20 27 22 27 29 29 0a 0a | ((c) ==| '"'))..|
|00001cf0| 2f 2a 20 43 6f 6e 73 75 | 6d 65 20 61 20 71 75 6f |/* Consu|me a quo|
|00001d00| 74 65 64 20 73 74 72 69 | 6e 67 20 66 72 6f 6d 20 |ted stri|ng from |
|00001d10| 53 54 52 49 4e 47 2c 20 | 73 74 61 72 74 69 6e 67 |STRING, |starting|
|00001d20| 20 61 74 20 73 74 72 69 | 6e 67 5b 53 54 41 52 54 | at stri|ng[START|
|00001d30| 5d 20 28 73 6f 0a 20 20 | 20 73 74 72 69 6e 67 5b |] (so. | string[|
|00001d40| 53 54 41 52 54 5d 20 69 | 73 20 74 68 65 20 6f 70 |START] i|s the op|
|00001d50| 65 6e 69 6e 67 20 71 75 | 6f 74 65 20 63 68 61 72 |ening qu|ote char|
|00001d60| 61 63 74 65 72 29 2c 20 | 61 6e 64 20 72 65 74 75 |acter), |and retu|
|00001d70| 72 6e 20 74 68 65 20 69 | 6e 64 65 78 0a 20 20 20 |rn the i|ndex. |
|00001d80| 6f 66 20 74 68 65 20 63 | 6c 6f 73 69 6e 67 20 71 |of the c|losing q|
|00001d90| 75 6f 74 65 20 63 68 61 | 72 61 63 74 65 72 20 6d |uote cha|racter m|
|00001da0| 61 74 63 68 69 6e 67 20 | 74 68 65 20 6f 70 65 6e |atching |the open|
|00001db0| 69 6e 67 20 71 75 6f 74 | 65 20 63 68 61 72 61 63 |ing quot|e charac|
|00001dc0| 74 65 72 2e 0a 20 20 20 | 54 68 69 73 20 68 61 6e |ter.. |This han|
|00001dd0| 64 6c 65 73 20 73 69 6e | 67 6c 65 20 6d 61 74 63 |dles sin|gle matc|
|00001de0| 68 69 6e 67 20 70 61 69 | 72 73 20 6f 66 20 75 6e |hing pai|rs of un|
|00001df0| 71 75 6f 74 65 64 20 71 | 75 6f 74 65 73 3b 20 69 |quoted q|uotes; i|
|00001e00| 74 20 63 6f 75 6c 64 20 | 61 66 66 6f 72 64 0a 20 |t could |afford. |
|00001e10| 20 20 74 6f 20 62 65 20 | 61 20 6c 69 74 74 6c 65 | to be |a little|
|00001e20| 20 73 6d 61 72 74 65 72 | 2e 2e 2e 20 54 68 69 73 | smarter|... This|
|00001e30| 20 73 6b 69 70 73 20 77 | 6f 72 64 73 20 62 65 74 | skips w|ords bet|
|00001e40| 77 65 65 6e 20 62 61 6c | 61 6e 63 65 64 20 70 61 |ween bal|anced pa|
|00001e50| 69 72 73 20 6f 66 0a 20 | 20 20 71 75 6f 74 65 73 |irs of. | quotes|
|00001e60| 2c 20 77 6f 72 64 73 20 | 77 68 65 72 65 20 74 68 |, words |where th|
|00001e70| 65 20 66 69 72 73 74 20 | 63 68 61 72 61 63 74 65 |e first |characte|
|00001e80| 72 20 69 73 20 71 75 6f | 74 65 64 20 77 69 74 68 |r is quo|ted with|
|00001e90| 20 61 20 60 5c 27 2c 20 | 61 6e 64 20 6f 74 68 65 | a `\', |and othe|
|00001ea0| 72 0a 20 20 20 62 61 63 | 6b 73 6c 61 73 68 2d 65 |r. bac|kslash-e|
|00001eb0| 73 63 61 70 65 64 20 63 | 68 61 72 61 63 74 65 72 |scaped c|haracter|
|00001ec0| 73 2e 20 2a 2f 0a 0a 73 | 74 61 74 69 63 20 69 6e |s. */..s|tatic in|
|00001ed0| 74 0a 73 6b 69 70 71 75 | 6f 74 65 73 20 28 73 74 |t.skipqu|otes (st|
|00001ee0| 72 69 6e 67 2c 20 73 74 | 61 72 74 29 0a 20 20 20 |ring, st|art). |
|00001ef0| 20 20 63 68 61 72 20 2a | 73 74 72 69 6e 67 3b 0a | char *|string;.|
|00001f00| 20 20 20 20 20 69 6e 74 | 20 73 74 61 72 74 3b 0a | int| start;.|
|00001f10| 7b 0a 20 20 72 65 67 69 | 73 74 65 72 20 69 6e 74 |{. regi|ster int|
|00001f20| 20 69 3b 0a 20 20 69 6e | 74 20 64 65 6c 69 6d 69 | i;. in|t delimi|
|00001f30| 74 65 72 20 3d 20 73 74 | 72 69 6e 67 5b 73 74 61 |ter = st|ring[sta|
|00001f40| 72 74 5d 3b 0a 0a 20 20 | 2f 2a 20 69 20 73 74 61 |rt];.. |/* i sta|
|00001f50| 72 74 73 20 61 74 20 53 | 54 41 52 54 20 2b 20 31 |rts at S|TART + 1|
|00001f60| 20 62 65 63 61 75 73 65 | 20 73 74 72 69 6e 67 5b | because| string[|
|00001f70| 53 54 41 52 54 5d 20 69 | 73 20 74 68 65 20 6f 70 |START] i|s the op|
|00001f80| 65 6e 69 6e 67 20 71 75 | 6f 74 65 0a 20 20 20 20 |ening qu|ote. |
|00001f90| 20 63 68 61 72 61 63 74 | 65 72 2e 20 2a 2f 0a 20 | charact|er. */. |
|00001fa0| 20 66 6f 72 20 28 69 20 | 3d 20 73 74 61 72 74 20 | for (i |= start |
|00001fb0| 2b 20 31 20 3b 20 73 74 | 72 69 6e 67 5b 69 5d 20 |+ 1 ; st|ring[i] |
|00001fc0| 3b 20 69 2b 2b 29 0a 20 | 20 20 20 7b 0a 20 20 20 |; i++). | {. |
|00001fd0| 20 20 20 69 66 20 28 73 | 74 72 69 6e 67 5b 69 5d | if (s|tring[i]|
|00001fe0| 20 3d 3d 20 27 5c 5c 27 | 29 0a 09 7b 0a 09 20 20 | == '\\'|)..{.. |
|00001ff0| 69 2b 2b 3b 09 09 2f 2a | 20 73 6b 69 70 20 62 61 |i++;../*| skip ba|
|00002000| 63 6b 73 6c 61 73 68 2d | 71 75 6f 74 65 64 20 71 |ckslash-|quoted q|
|00002010| 75 6f 74 65 20 63 68 61 | 72 61 63 74 65 72 73 2c |uote cha|racters,|
|00002020| 20 74 6f 6f 20 2a 2f 0a | 09 20 20 63 6f 6e 74 69 | too */.|. conti|
|00002030| 6e 75 65 3b 0a 09 7d 0a | 0a 20 20 20 20 20 20 69 |nue;..}.|. i|
|00002040| 66 20 28 73 74 72 69 6e | 67 5b 69 5d 20 3d 3d 20 |f (strin|g[i] == |
|00002050| 64 65 6c 69 6d 69 74 65 | 72 29 0a 09 72 65 74 75 |delimite|r)..retu|
|00002060| 72 6e 20 69 3b 0a 20 20 | 20 20 7d 0a 20 20 72 65 |rn i;. | }. re|
|00002070| 74 75 72 6e 20 28 69 29 | 3b 0a 7d 0a 0a 2f 2a 20 |turn (i)|;.}../* |
|00002080| 53 6b 69 70 20 74 68 65 | 20 77 68 69 74 65 20 73 |Skip the| white s|
|00002090| 70 61 63 65 20 61 6e 64 | 20 61 6e 79 20 71 75 6f |pace and| any quo|
|000020a0| 74 65 64 20 63 68 61 72 | 61 63 74 65 72 73 20 69 |ted char|acters i|
|000020b0| 6e 20 53 54 52 49 4e 47 | 2c 20 73 74 61 72 74 69 |n STRING|, starti|
|000020c0| 6e 67 20 61 74 0a 20 20 | 20 53 54 41 52 54 2e 20 |ng at. | START. |
|000020d0| 20 52 65 74 75 72 6e 20 | 74 68 65 20 6e 65 77 20 | Return |the new |
|000020e0| 69 6e 64 65 78 20 69 6e | 74 6f 20 53 54 52 49 4e |index in|to STRIN|
|000020f0| 47 2c 20 61 66 74 65 72 | 20 7a 65 72 6f 20 6f 72 |G, after| zero or|
|00002100| 20 6d 6f 72 65 20 63 68 | 61 72 61 63 74 65 72 73 | more ch|aracters|
|00002110| 0a 20 20 20 68 61 76 65 | 20 62 65 65 6e 20 73 6b |. have| been sk|
|00002120| 69 70 70 65 64 2e 20 2a | 2f 0a 73 74 61 74 69 63 |ipped. *|/.static|
|00002130| 20 69 6e 74 0a 73 6b 69 | 70 77 73 20 28 73 74 72 | int.ski|pws (str|
|00002140| 69 6e 67 2c 20 73 74 61 | 72 74 29 0a 20 20 20 20 |ing, sta|rt). |
|00002150| 20 63 68 61 72 20 2a 73 | 74 72 69 6e 67 3b 0a 20 | char *s|tring;. |
|00002160| 20 20 20 20 69 6e 74 20 | 73 74 61 72 74 3b 0a 7b | int |start;.{|
|00002170| 0a 20 20 72 65 67 69 73 | 74 65 72 20 69 6e 74 20 |. regis|ter int |
|00002180| 69 20 3d 20 30 3b 0a 20 | 20 69 6e 74 20 70 61 73 |i = 0;. | int pas|
|00002190| 73 5f 6e 65 78 74 2c 20 | 62 61 63 6b 73 6c 61 73 |s_next, |backslas|
|000021a0| 68 5f 71 75 6f 74 65 64 | 5f 77 6f 72 64 2c 20 70 |h_quoted|_word, p|
|000021b0| 65 65 6b 63 3b 0a 0a 20 | 20 2f 2a 20 73 6b 69 70 |eekc;.. | /* skip|
|000021c0| 20 71 75 6f 74 65 64 20 | 73 74 72 69 6e 67 73 2c | quoted |strings,|
|000021d0| 20 69 6e 20 27 20 6f 72 | 20 22 2c 20 61 6e 64 20 | in ' or| ", and |
|000021e0| 77 6f 72 64 73 20 69 6e | 20 77 68 69 63 68 20 61 |words in| which a|
|000021f0| 20 63 68 61 72 61 63 74 | 65 72 20 69 73 20 71 75 | charact|er is qu|
|00002200| 6f 74 65 64 0a 20 20 20 | 20 20 77 69 74 68 20 61 |oted. | with a|
|00002210| 20 60 5c 27 2e 20 2a 2f | 0a 20 20 62 61 63 6b 73 | `\'. */|. backs|
|00002220| 6c 61 73 68 5f 71 75 6f | 74 65 64 5f 77 6f 72 64 |lash_quo|ted_word|
|00002230| 20 3d 20 70 61 73 73 5f | 6e 65 78 74 20 3d 20 30 | = pass_|next = 0|
|00002240| 3b 0a 0a 20 20 2f 2a 20 | 53 6b 69 70 20 6c 65 61 |;.. /* |Skip lea|
|00002250| 64 69 6e 67 20 77 68 69 | 74 65 73 70 61 63 65 20 |ding whi|tespace |
|00002260| 28 6f 72 20 73 65 70 61 | 72 61 74 6f 72 20 63 68 |(or sepa|rator ch|
|00002270| 61 72 61 63 74 65 72 73 | 29 2c 20 61 6e 64 20 71 |aracters|), and q|
|00002280| 75 6f 74 65 64 20 77 6f | 72 64 73 2e 0a 20 20 20 |uoted wo|rds.. |
|00002290| 20 20 42 75 74 20 73 61 | 76 65 20 69 74 20 69 6e | But sa|ve it in|
|000022a0| 20 74 68 65 20 6f 75 74 | 70 75 74 2e 20 20 2a 2f | the out|put. */|
|000022b0| 0a 0a 20 20 66 6f 72 20 | 28 69 20 3d 20 73 74 61 |.. for |(i = sta|
|000022c0| 72 74 3b 20 73 74 72 69 | 6e 67 5b 69 5d 3b 20 69 |rt; stri|ng[i]; i|
|000022d0| 2b 2b 29 0a 20 20 20 20 | 7b 0a 20 20 20 20 20 20 |++). |{. |
|000022e0| 69 66 20 28 70 61 73 73 | 5f 6e 65 78 74 29 0a 09 |if (pass|_next)..|
|000022f0| 7b 0a 09 20 20 70 61 73 | 73 5f 6e 65 78 74 20 3d |{.. pas|s_next =|
|00002300| 20 30 3b 0a 09 20 20 63 | 6f 6e 74 69 6e 75 65 3b | 0;.. c|ontinue;|
|00002310| 0a 09 7d 0a 0a 20 20 20 | 20 20 20 69 66 20 28 77 |..}.. | if (w|
|00002320| 68 69 74 65 73 70 61 63 | 65 20 28 73 74 72 69 6e |hitespac|e (strin|
|00002330| 67 5b 69 5d 29 29 0a 09 | 7b 0a 09 20 20 62 61 63 |g[i]))..|{.. bac|
|00002340| 6b 73 6c 61 73 68 5f 71 | 75 6f 74 65 64 5f 77 6f |kslash_q|uoted_wo|
|00002350| 72 64 20 3d 20 30 3b 20 | 2f 2a 20 77 65 20 61 72 |rd = 0; |/* we ar|
|00002360| 65 20 6e 6f 20 6c 6f 6e | 67 65 72 20 69 6e 20 61 |e no lon|ger in a|
|00002370| 20 62 61 63 6b 73 6c 61 | 73 68 2d 71 75 6f 74 65 | backsla|sh-quote|
|00002380| 64 20 77 6f 72 64 20 2a | 2f 0a 09 20 20 63 6f 6e |d word *|/.. con|
|00002390| 74 69 6e 75 65 3b 0a 09 | 7d 0a 0a 20 20 20 20 20 |tinue;..|}.. |
|000023a0| 20 69 66 20 28 73 74 72 | 69 6e 67 5b 69 5d 20 3d | if (str|ing[i] =|
|000023b0| 3d 20 27 5c 5c 27 29 0a | 09 7b 0a 09 20 20 70 65 |= '\\').|.{.. pe|
|000023c0| 65 6b 63 20 3d 20 73 74 | 72 69 6e 67 5b 69 2b 31 |ekc = st|ring[i+1|
|000023d0| 5d 3b 0a 09 20 20 69 66 | 20 28 69 73 6c 65 74 74 |];.. if| (islett|
|000023e0| 65 72 20 28 70 65 65 6b | 63 29 29 0a 09 20 20 20 |er (peek|c)).. |
|000023f0| 20 62 61 63 6b 73 6c 61 | 73 68 5f 71 75 6f 74 65 | backsla|sh_quote|
|00002400| 64 5f 77 6f 72 64 2b 2b | 3b 09 2f 2a 20 74 68 69 |d_word++|;./* thi|
|00002410| 73 20 69 73 20 61 20 62 | 61 63 6b 73 6c 61 73 68 |s is a b|ackslash|
|00002420| 2d 71 75 6f 74 65 64 20 | 77 6f 72 64 20 2a 2f 0a |-quoted |word */.|
|00002430| 09 20 20 65 6c 73 65 0a | 09 20 20 20 20 70 61 73 |. else.|. pas|
|00002440| 73 5f 6e 65 78 74 2b 2b | 3b 0a 09 20 20 63 6f 6e |s_next++|;.. con|
|00002450| 74 69 6e 75 65 3b 0a 09 | 7d 0a 0a 20 20 20 20 20 |tinue;..|}.. |
|00002460| 20 2f 2a 20 54 68 69 73 | 20 6f 6e 6c 79 20 68 61 | /* This| only ha|
|00002470| 6e 64 6c 65 73 20 73 69 | 6e 67 6c 65 20 70 61 69 |ndles si|ngle pai|
|00002480| 72 73 20 6f 66 20 6e 6f | 6e 2d 65 73 63 61 70 65 |rs of no|n-escape|
|00002490| 64 20 71 75 6f 74 65 73 | 2e 20 20 54 68 69 73 0a |d quotes|. This.|
|000024a0| 09 20 6f 76 65 72 6c 6f | 61 64 73 20 62 61 63 6b |. overlo|ads back|
|000024b0| 73 6c 61 73 68 5f 71 75 | 6f 74 65 64 5f 77 6f 72 |slash_qu|oted_wor|
|000024c0| 64 20 74 6f 20 61 6c 73 | 6f 20 6d 65 61 6e 20 74 |d to als|o mean t|
|000024d0| 68 61 74 20 61 20 77 6f | 72 64 20 6c 69 6b 65 0a |hat a wo|rd like.|
|000024e0| 09 20 22 22 66 20 69 73 | 20 62 65 69 6e 67 20 73 |. ""f is| being s|
|000024f0| 63 61 6e 6e 65 64 2c 20 | 73 6f 20 74 68 61 74 20 |canned, |so that |
|00002500| 74 68 65 20 71 75 6f 74 | 65 73 20 77 69 6c 6c 20 |the quot|es will |
|00002510| 69 6e 68 69 62 69 74 20 | 61 6e 79 20 65 78 70 61 |inhibit |any expa|
|00002520| 6e 73 69 6f 6e 0a 09 20 | 6f 66 20 74 68 65 20 77 |nsion.. |of the w|
|00002530| 6f 72 64 2e 20 2a 2f 0a | 20 20 20 20 20 20 69 66 |ord. */.| if|
|00002540| 20 28 71 75 6f 74 65 5f | 63 68 61 72 28 73 74 72 | (quote_|char(str|
|00002550| 69 6e 67 5b 69 5d 29 29 | 0a 09 7b 0a 09 20 20 69 |ing[i]))|..{.. i|
|00002560| 20 3d 20 73 6b 69 70 71 | 75 6f 74 65 73 20 28 73 | = skipq|uotes (s|
|00002570| 74 72 69 6e 67 2c 20 69 | 29 3b 0a 09 20 20 2f 2a |tring, i|);.. /*|
|00002580| 20 54 68 69 73 20 63 6f | 75 6c 64 20 62 65 20 61 | This co|uld be a|
|00002590| 20 6c 69 6e 65 20 74 68 | 61 74 20 63 6f 6e 74 61 | line th|at conta|
|000025a0| 69 6e 73 20 61 20 73 69 | 6e 67 6c 65 20 71 75 6f |ins a si|ngle quo|
|000025b0| 74 65 20 63 68 61 72 61 | 63 74 65 72 2c 0a 09 20 |te chara|cter,.. |
|000025c0| 20 20 20 20 69 6e 20 77 | 68 69 63 68 20 63 61 73 | in w|hich cas|
|000025d0| 65 20 73 6b 69 70 71 75 | 6f 74 65 73 20 28 29 20 |e skipqu|otes () |
|000025e0| 74 65 72 6d 69 6e 61 74 | 65 73 20 77 69 74 68 20 |terminat|es with |
|000025f0| 73 74 72 69 6e 67 5b 69 | 5d 20 3d 3d 20 27 5c 30 |string[i|] == '\0|
|00002600| 27 0a 09 20 20 20 20 20 | 28 74 68 65 20 65 6e 64 |'.. |(the end|
|00002610| 20 6f 66 20 74 68 65 20 | 73 74 72 69 6e 67 29 2e | of the |string).|
|00002620| 20 20 43 68 65 63 6b 20 | 66 6f 72 20 74 68 61 74 | Check |for that|
|00002630| 20 68 65 72 65 2e 20 2a | 2f 0a 09 20 20 69 66 20 | here. *|/.. if |
|00002640| 28 73 74 72 69 6e 67 5b | 69 5d 20 3d 3d 20 27 5c |(string[|i] == '\|
|00002650| 30 27 29 0a 09 20 20 20 | 20 62 72 65 61 6b 3b 0a |0').. | break;.|
|00002660| 0a 09 20 20 70 65 65 6b | 63 20 3d 20 73 74 72 69 |.. peek|c = stri|
|00002670| 6e 67 5b 69 20 2b 20 31 | 5d 3b 0a 09 20 20 69 66 |ng[i + 1|];.. if|
|00002680| 20 28 69 73 6c 65 74 74 | 65 72 20 28 70 65 65 6b | (islett|er (peek|
|00002690| 63 29 29 0a 09 20 20 20 | 20 62 61 63 6b 73 6c 61 |c)).. | backsla|
|000026a0| 73 68 5f 71 75 6f 74 65 | 64 5f 77 6f 72 64 2b 2b |sh_quote|d_word++|
|000026b0| 3b 0a 09 20 20 63 6f 6e | 74 69 6e 75 65 3b 0a 09 |;.. con|tinue;..|
|000026c0| 7d 0a 0a 20 20 20 20 20 | 20 2f 2a 20 49 66 20 77 |}.. | /* If w|
|000026d0| 65 27 72 65 20 69 6e 20 | 74 68 65 20 6d 69 64 64 |e're in |the midd|
|000026e0| 6c 65 20 6f 66 20 73 6f | 6d 65 20 6b 69 6e 64 20 |le of so|me kind |
|000026f0| 6f 66 20 71 75 6f 74 65 | 64 20 77 6f 72 64 2c 20 |of quote|d word, |
|00002700| 6c 65 74 20 69 74 0a 09 | 20 70 61 73 73 20 74 68 |let it..| pass th|
|00002710| 72 6f 75 67 68 2e 20 2a | 2f 0a 20 20 20 20 20 20 |rough. *|/. |
|00002720| 69 66 20 28 62 61 63 6b | 73 6c 61 73 68 5f 71 75 |if (back|slash_qu|
|00002730| 6f 74 65 64 5f 77 6f 72 | 64 29 0a 09 63 6f 6e 74 |oted_wor|d)..cont|
|00002740| 69 6e 75 65 3b 0a 0a 20 | 20 20 20 20 20 2f 2a 20 |inue;.. | /* |
|00002750| 49 66 20 74 68 69 73 20 | 63 68 61 72 61 63 74 65 |If this |characte|
|00002760| 72 20 69 73 20 61 20 73 | 68 65 6c 6c 20 63 6f 6d |r is a s|hell com|
|00002770| 6d 61 6e 64 20 73 65 70 | 61 72 61 74 6f 72 2c 20 |mand sep|arator, |
|00002780| 74 68 65 6e 20 73 65 74 | 20 61 20 68 69 6e 74 20 |then set| a hint |
|00002790| 66 6f 72 0a 09 20 61 6c | 69 61 73 5f 65 78 70 61 |for.. al|ias_expa|
|000027a0| 6e 64 20 74 68 61 74 20 | 74 68 65 20 6e 65 78 74 |nd that |the next|
|000027b0| 20 74 6f 6b 65 6e 20 69 | 73 20 74 68 65 20 66 69 | token i|s the fi|
|000027c0| 72 73 74 20 77 6f 72 64 | 20 69 6e 20 61 20 63 6f |rst word| in a co|
|000027d0| 6d 6d 61 6e 64 2e 20 2a | 2f 0a 0a 20 20 20 20 20 |mmand. *|/.. |
|000027e0| 20 69 66 20 28 63 6f 6d | 6d 61 6e 64 5f 73 65 70 | if (com|mand_sep|
|000027f0| 61 72 61 74 6f 72 20 28 | 73 74 72 69 6e 67 5b 69 |arator (|string[i|
|00002800| 5d 29 29 0a 09 7b 0a 09 | 20 20 63 6f 6d 6d 61 6e |]))..{..| comman|
|00002810| 64 5f 77 6f 72 64 2b 2b | 3b 0a 09 20 20 63 6f 6e |d_word++|;.. con|
|00002820| 74 69 6e 75 65 3b 0a 09 | 7d 0a 20 20 20 20 20 20 |tinue;..|}. |
|00002830| 62 72 65 61 6b 3b 0a 20 | 20 20 20 7d 0a 20 20 72 |break;. | }. r|
|00002840| 65 74 75 72 6e 20 28 69 | 29 3b 0a 7d 0a 0a 2f 2a |eturn (i|);.}../*|
|00002850| 20 43 68 61 72 61 63 74 | 65 72 73 20 74 68 61 74 | Charact|ers that|
|00002860| 20 6d 61 79 20 61 70 70 | 65 61 72 20 69 6e 20 61 | may app|ear in a|
|00002870| 20 74 6f 6b 65 6e 2e 20 | 20 42 61 73 69 63 61 6c | token. | Basical|
|00002880| 6c 79 2c 20 61 6e 79 74 | 68 69 6e 67 20 65 78 63 |ly, anyt|hing exc|
|00002890| 65 70 74 20 77 68 69 74 | 65 0a 20 20 20 73 70 61 |ept whit|e. spa|
|000028a0| 63 65 20 61 6e 64 20 61 | 20 74 6f 6b 65 6e 20 73 |ce and a| token s|
|000028b0| 65 70 61 72 61 74 6f 72 | 2e 20 2a 2f 0a 23 64 65 |eparator|. */.#de|
|000028c0| 66 69 6e 65 20 74 6f 6b | 65 6e 5f 63 68 61 72 28 |fine tok|en_char(|
|000028d0| 63 29 09 28 21 28 28 77 | 68 69 74 65 73 70 61 63 |c).(!((w|hitespac|
|000028e0| 65 20 28 73 74 72 69 6e | 67 5b 69 5d 29 20 7c 7c |e (strin|g[i]) |||
|000028f0| 20 73 65 6c 66 5f 64 65 | 6c 69 6d 69 74 69 6e 67 | self_de|limiting|
|00002900| 20 28 73 74 72 69 6e 67 | 5b 69 5d 29 29 29 29 0a | (string|[i])))).|
|00002910| 0a 2f 2a 20 52 65 61 64 | 20 66 72 6f 6d 20 53 54 |./* Read| from ST|
|00002920| 41 52 54 20 69 6e 20 53 | 54 52 49 4e 47 20 75 6e |ART in S|TRING un|
|00002930| 74 69 6c 20 74 68 65 20 | 6e 65 78 74 20 73 65 70 |til the |next sep|
|00002940| 61 72 61 74 6f 72 20 63 | 68 61 72 61 63 74 65 72 |arator c|haracter|
|00002950| 2c 20 61 6e 64 20 72 65 | 74 75 72 6e 0a 20 20 20 |, and re|turn. |
|00002960| 74 68 65 20 69 6e 64 65 | 78 20 6f 66 20 74 68 61 |the inde|x of tha|
|00002970| 74 20 73 65 70 61 72 61 | 74 6f 72 2e 20 20 53 6b |t separa|tor. Sk|
|00002980| 69 70 20 62 61 63 6b 73 | 6c 61 73 68 2d 71 75 6f |ip backs|lash-quo|
|00002990| 74 65 64 20 63 68 61 72 | 61 63 74 65 72 73 2e 20 |ted char|acters. |
|000029a0| 20 43 61 6c 6c 0a 20 20 | 20 73 6b 69 70 71 75 6f | Call. | skipquo|
|000029b0| 74 65 73 20 28 29 20 66 | 6f 72 20 71 75 6f 74 65 |tes () f|or quote|
|000029c0| 64 20 73 74 72 69 6e 67 | 73 20 69 6e 20 74 68 65 |d string|s in the|
|000029d0| 20 6d 69 64 64 6c 65 20 | 6f 72 20 61 74 20 74 68 | middle |or at th|
|000029e0| 65 20 65 6e 64 20 6f 66 | 20 74 6f 6b 65 6e 73 2c |e end of| tokens,|
|000029f0| 0a 20 20 20 73 6f 20 61 | 6c 6c 20 63 68 61 72 61 |. so a|ll chara|
|00002a00| 63 74 65 72 73 20 73 68 | 6f 77 20 75 70 20 28 65 |cters sh|ow up (e|
|00002a10| 2e 67 2e 20 66 6f 6f 27 | 27 20 61 6e 64 20 66 6f |.g. foo'|' and fo|
|00002a20| 6f 22 22 62 61 72 29 20 | 2a 2f 0a 73 74 61 74 69 |o""bar) |*/.stati|
|00002a30| 63 20 69 6e 74 0a 72 64 | 5f 74 6f 6b 65 6e 20 28 |c int.rd|_token (|
|00002a40| 73 74 72 69 6e 67 2c 20 | 73 74 61 72 74 29 0a 20 |string, |start). |
|00002a50| 20 20 20 20 63 68 61 72 | 20 2a 73 74 72 69 6e 67 | char| *string|
|00002a60| 3b 20 0a 20 20 20 20 20 | 69 6e 74 20 73 74 61 72 |; . |int star|
|00002a70| 74 3b 0a 7b 0a 20 20 72 | 65 67 69 73 74 65 72 20 |t;.{. r|egister |
|00002a80| 69 6e 74 20 69 3b 0a 0a | 20 20 2f 2a 20 46 72 6f |int i;..| /* Fro|
|00002a90| 6d 20 68 65 72 65 20 74 | 6f 20 6e 65 78 74 20 73 |m here t|o next s|
|00002aa0| 65 70 61 72 61 74 6f 72 | 20 63 68 61 72 61 63 74 |eparator| charact|
|00002ab0| 65 72 20 69 73 20 61 20 | 74 6f 6b 65 6e 2e 20 2a |er is a |token. *|
|00002ac0| 2f 0a 20 20 66 6f 72 20 | 28 69 20 3d 20 73 74 61 |/. for |(i = sta|
|00002ad0| 72 74 3b 20 73 74 72 69 | 6e 67 5b 69 5d 20 26 26 |rt; stri|ng[i] &&|
|00002ae0| 20 74 6f 6b 65 6e 5f 63 | 68 61 72 20 28 73 74 72 | token_c|har (str|
|00002af0| 69 6e 67 5b 69 5d 29 3b | 20 69 2b 2b 29 0a 20 20 |ing[i]);| i++). |
|00002b00| 20 20 7b 0a 20 20 20 20 | 20 20 69 66 20 28 73 74 | {. | if (st|
|00002b10| 72 69 6e 67 5b 69 5d 20 | 3d 3d 20 27 5c 5c 27 29 |ring[i] |== '\\')|
|00002b20| 0a 09 7b 0a 09 20 20 69 | 2b 2b 3b 09 2f 2a 20 73 |..{.. i|++;./* s|
|00002b30| 6b 69 70 20 62 61 63 6b | 73 6c 61 73 68 2d 65 73 |kip back|slash-es|
|00002b40| 63 61 70 65 64 20 63 68 | 61 72 61 63 74 65 72 20 |caped ch|aracter |
|00002b50| 2a 2f 0a 09 20 20 63 6f | 6e 74 69 6e 75 65 3b 0a |*/.. co|ntinue;.|
|00002b60| 09 7d 0a 0a 20 20 20 20 | 20 20 2f 2a 20 49 66 20 |.}.. | /* If |
|00002b70| 74 68 69 73 20 63 68 61 | 72 61 63 74 65 72 20 69 |this cha|racter i|
|00002b80| 73 20 61 20 71 75 6f 74 | 65 20 63 68 61 72 61 63 |s a quot|e charac|
|00002b90| 74 65 72 2c 20 77 65 20 | 77 61 6e 74 20 74 6f 20 |ter, we |want to |
|00002ba0| 63 61 6c 6c 20 73 6b 69 | 70 71 75 6f 74 65 73 0a |call ski|pquotes.|
|00002bb0| 09 20 74 6f 20 67 65 74 | 20 74 68 65 20 77 68 6f |. to get| the who|
|00002bc0| 6c 65 20 71 75 6f 74 65 | 64 20 70 6f 72 74 69 6f |le quote|d portio|
|00002bd0| 6e 20 61 73 20 70 61 72 | 74 20 6f 66 20 74 68 69 |n as par|t of thi|
|00002be0| 73 20 77 6f 72 64 2e 20 | 20 54 68 61 74 20 77 6f |s word. | That wo|
|00002bf0| 72 64 0a 09 20 77 69 6c | 6c 20 6e 6f 74 20 67 65 |rd.. wil|l not ge|
|00002c00| 6e 65 72 61 6c 6c 79 20 | 6d 61 74 63 68 20 61 6e |nerally |match an|
|00002c10| 20 61 6c 69 61 73 2c 20 | 65 76 65 6e 20 69 66 20 | alias, |even if |
|00002c20| 74 65 20 75 6e 71 75 6f | 74 65 64 20 77 6f 72 64 |te unquo|ted word|
|00002c30| 20 77 6f 75 6c 64 0a 09 | 20 68 61 76 65 2e 20 20 | would..| have. |
|00002c40| 54 68 65 20 70 72 65 73 | 65 6e 63 65 20 6f 66 20 |The pres|ence of |
|00002c50| 74 68 65 20 71 75 6f 74 | 65 73 20 69 6e 20 74 68 |the quot|es in th|
|00002c60| 65 20 74 6f 6b 65 6e 20 | 73 65 72 76 65 73 20 74 |e token |serves t|
|00002c70| 68 65 6e 20 74 6f 20 0a | 09 20 69 6e 68 69 62 69 |hen to .|. inhibi|
|00002c80| 74 20 65 78 70 61 6e 73 | 69 6f 6e 2e 20 2a 2f 0a |t expans|ion. */.|
|00002c90| 20 20 20 20 20 20 69 66 | 20 28 71 75 6f 74 65 5f | if| (quote_|
|00002ca0| 63 68 61 72 20 28 73 74 | 72 69 6e 67 5b 69 5d 29 |char (st|ring[i])|
|00002cb0| 29 0a 09 7b 0a 09 20 20 | 69 20 3d 20 73 6b 69 70 |)..{.. |i = skip|
|00002cc0| 71 75 6f 74 65 73 20 28 | 73 74 72 69 6e 67 2c 20 |quotes (|string, |
|00002cd0| 69 29 3b 0a 09 20 20 2f | 2a 20 4e 6f 77 20 73 74 |i);.. /|* Now st|
|00002ce0| 72 69 6e 67 5b 69 5d 20 | 69 73 20 74 68 65 20 6d |ring[i] |is the m|
|00002cf0| 61 74 63 68 69 6e 67 20 | 71 75 6f 74 65 20 63 68 |atching |quote ch|
|00002d00| 61 72 61 63 74 65 72 2c | 20 61 6e 64 20 74 68 65 |aracter,| and the|
|00002d10| 0a 09 20 20 20 20 20 71 | 75 6f 74 65 64 20 70 6f |.. q|uoted po|
|00002d20| 72 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 74 6f 6b |rtion of| the tok|
|00002d30| 65 6e 20 68 61 73 20 62 | 65 65 6e 20 73 63 61 6e |en has b|een scan|
|00002d40| 6e 65 64 2e 20 2a 2f 0a | 09 20 20 63 6f 6e 74 69 |ned. */.|. conti|
|00002d50| 6e 75 65 3b 0a 09 7d 0a | 20 20 20 20 7d 0a 20 20 |nue;..}.| }. |
|00002d60| 72 65 74 75 72 6e 20 28 | 69 29 3b 0a 7d 0a 0a 2f |return (|i);.}../|
|00002d70| 2a 20 52 65 74 75 72 6e | 20 61 20 6e 65 77 20 6c |* Return| a new l|
|00002d80| 69 6e 65 2c 20 77 69 74 | 68 20 61 6e 79 20 61 6c |ine, wit|h any al|
|00002d90| 69 61 73 65 73 20 73 75 | 62 73 74 69 74 75 74 65 |iases su|bstitute|
|00002da0| 64 2e 20 2a 2f 0a 63 68 | 61 72 20 2a 0a 61 6c 69 |d. */.ch|ar *.ali|
|00002db0| 61 73 5f 65 78 70 61 6e | 64 20 28 73 74 72 69 6e |as_expan|d (strin|
|00002dc0| 67 29 0a 20 20 20 20 20 | 63 68 61 72 20 2a 73 74 |g). |char *st|
|00002dd0| 72 69 6e 67 3b 0a 7b 0a | 20 20 69 6e 74 20 6c 69 |ring;.{.| int li|
|00002de0| 6e 65 5f 6c 65 6e 20 3d | 20 31 20 2b 20 73 74 72 |ne_len =| 1 + str|
|00002df0| 6c 65 6e 20 28 73 74 72 | 69 6e 67 29 3b 0a 20 20 |len (str|ing);. |
|00002e00| 63 68 61 72 20 2a 6c 69 | 6e 65 20 3d 20 28 63 68 |char *li|ne = (ch|
|00002e10| 61 72 20 2a 29 78 6d 61 | 6c 6c 6f 63 20 28 6c 69 |ar *)xma|lloc (li|
|00002e20| 6e 65 5f 6c 65 6e 29 3b | 0a 20 20 72 65 67 69 73 |ne_len);|. regis|
|00002e30| 74 65 72 20 69 6e 74 20 | 69 2c 20 6a 2c 20 73 74 |ter int |i, j, st|
|00002e40| 61 72 74 3b 0a 20 20 63 | 68 61 72 20 2a 74 6f 6b |art;. c|har *tok|
|00002e50| 65 6e 20 3d 20 28 63 68 | 61 72 20 2a 29 61 6c 6c |en = (ch|ar *)all|
|00002e60| 6f 63 61 20 28 6c 69 6e | 65 5f 6c 65 6e 29 3b 0a |oca (lin|e_len);.|
|00002e70| 20 20 69 6e 74 20 74 6c | 2c 20 72 65 61 6c 5f 73 | int tl|, real_s|
|00002e80| 74 61 72 74 2c 20 65 78 | 70 61 6e 64 5f 6e 65 78 |tart, ex|pand_nex|
|00002e90| 74 2c 20 65 78 70 61 6e | 64 5f 74 68 69 73 5f 74 |t, expan|d_this_t|
|00002ea0| 6f 6b 65 6e 3b 0a 20 20 | 41 53 53 4f 43 20 2a 61 |oken;. |ASSOC *a|
|00002eb0| 6c 69 61 73 3b 0a 0a 20 | 20 6c 69 6e 65 5b 30 5d |lias;.. | line[0]|
|00002ec0| 20 3d 20 69 20 3d 20 30 | 3b 0a 20 20 65 78 70 61 | = i = 0|;. expa|
|00002ed0| 6e 64 5f 6e 65 78 74 20 | 3d 20 30 3b 0a 20 20 63 |nd_next |= 0;. c|
|00002ee0| 6f 6d 6d 61 6e 64 5f 77 | 6f 72 64 20 3d 20 31 3b |ommand_w|ord = 1;|
|00002ef0| 20 2f 2a 20 69 6e 69 74 | 69 61 6c 69 7a 65 64 20 | /* init|ialized |
|00002f00| 74 6f 20 65 78 70 61 6e | 64 20 74 68 65 20 66 69 |to expan|d the fi|
|00002f10| 72 73 74 20 77 6f 72 64 | 20 6f 6e 20 74 68 65 20 |rst word| on the |
|00002f20| 6c 69 6e 65 20 2a 2f 0a | 0a 20 20 2f 2a 20 45 61 |line */.|. /* Ea|
|00002f30| 63 68 20 74 69 6d 65 20 | 74 68 72 6f 75 67 68 20 |ch time |through |
|00002f40| 74 68 65 20 6c 6f 6f 70 | 20 77 65 20 66 69 6e 64 |the loop| we find|
|00002f50| 20 74 68 65 20 6e 65 78 | 74 20 77 6f 72 64 20 69 | the nex|t word i|
|00002f60| 6e 20 6c 69 6e 65 2e 20 | 20 49 66 20 69 74 0a 20 |n line. | If it. |
|00002f70| 20 20 20 20 68 61 73 20 | 61 6e 20 61 6c 69 61 73 | has |an alias|
|00002f80| 2c 20 73 75 62 73 74 69 | 74 75 74 65 0a 20 20 20 |, substi|tute. |
|00002f90| 20 20 74 68 65 20 61 6c | 69 61 73 20 76 61 6c 75 | the al|ias valu|
|00002fa0| 65 2e 20 20 49 66 20 74 | 68 65 20 76 61 6c 75 65 |e. If t|he value|
|00002fb0| 20 65 6e 64 73 20 69 6e | 20 60 20 27 2c 20 74 68 | ends in| ` ', th|
|00002fc0| 65 6e 20 74 72 79 20 61 | 67 61 69 6e 0a 20 20 20 |en try a|gain. |
|00002fd0| 20 20 77 69 74 68 20 74 | 68 65 20 6e 65 78 74 20 | with t|he next |
|00002fe0| 77 6f 72 64 2e 20 20 45 | 6c 73 65 2c 20 69 66 20 |word. E|lse, if |
|00002ff0| 74 68 65 72 65 20 69 73 | 20 6e 6f 20 76 61 6c 75 |there is| no valu|
|00003000| 65 2c 20 6f 72 20 69 66 | 0a 20 20 20 20 20 74 68 |e, or if|. th|
|00003010| 65 20 76 61 6c 75 65 20 | 64 6f 65 73 20 6e 6f 74 |e value |does not|
|00003020| 20 65 6e 64 20 69 6e 20 | 73 70 61 63 65 2c 20 77 | end in |space, w|
|00003030| 65 20 61 72 65 20 64 6f | 6e 65 2e 20 2a 2f 0a 0a |e are do|ne. */..|
|00003040| 20 20 66 6f 72 20 28 3b | 3b 29 0a 20 20 20 20 7b | for (;|;). {|
|00003050| 0a 0a 20 20 20 20 20 20 | 74 6f 6b 65 6e 5b 30 5d |.. |token[0]|
|00003060| 20 3d 20 30 3b 0a 20 20 | 20 20 20 20 73 74 61 72 | = 0;. | star|
|00003070| 74 20 3d 20 69 3b 0a 0a | 20 20 20 20 20 20 2f 2a |t = i;..| /*|
|00003080| 20 53 6b 69 70 20 77 68 | 69 74 65 20 73 70 61 63 | Skip wh|ite spac|
|00003090| 65 20 61 6e 64 20 71 75 | 6f 74 65 64 20 63 68 61 |e and qu|oted cha|
|000030a0| 72 61 63 74 65 72 73 20 | 2a 2f 0a 20 20 20 20 20 |racters |*/. |
|000030b0| 20 69 20 3d 20 73 6b 69 | 70 77 73 20 28 73 74 72 | i = ski|pws (str|
|000030c0| 69 6e 67 2c 20 73 74 61 | 72 74 29 3b 0a 0a 20 20 |ing, sta|rt);.. |
|000030d0| 20 20 20 20 69 66 20 28 | 73 74 61 72 74 20 3d 3d | if (|start ==|
|000030e0| 20 69 20 26 26 20 73 74 | 72 69 6e 67 5b 69 5d 20 | i && st|ring[i] |
|000030f0| 3d 3d 20 27 5c 30 27 29 | 0a 09 72 65 74 75 72 6e |== '\0')|..return|
|00003100| 20 28 6c 69 6e 65 29 3b | 0a 0a 20 20 20 20 20 20 | (line);|.. |
|00003110| 2f 2a 20 63 6f 70 79 20 | 74 68 65 20 6a 75 73 74 |/* copy |the just|
|00003120| 2d 73 6b 69 70 70 65 64 | 20 63 68 61 72 61 63 74 |-skipped| charact|
|00003130| 65 72 73 20 69 6e 74 6f | 20 74 68 65 20 6f 75 74 |ers into| the out|
|00003140| 70 75 74 20 73 74 72 69 | 6e 67 2c 0a 09 20 65 78 |put stri|ng,.. ex|
|00003150| 70 61 6e 64 69 6e 67 20 | 69 74 20 69 66 20 74 68 |panding |it if th|
|00003160| 65 72 65 20 69 73 20 6e | 6f 74 20 65 6e 6f 75 67 |ere is n|ot enoug|
|00003170| 68 20 72 6f 6f 6d 2e 20 | 2a 2f 0a 20 20 20 20 20 |h room. |*/. |
|00003180| 20 6a 20 3d 20 73 74 72 | 6c 65 6e 20 28 6c 69 6e | j = str|len (lin|
|00003190| 65 29 3b 0a 20 20 20 20 | 20 20 74 6c 20 3d 20 69 |e);. | tl = i|
|000031a0| 20 2d 20 73 74 61 72 74 | 3b 09 2f 2a 20 6e 75 6d | - start|;./* num|
|000031b0| 62 65 72 20 6f 66 20 63 | 68 61 72 61 63 74 65 72 |ber of c|haracter|
|000031c0| 73 20 6a 75 73 74 20 73 | 6b 69 70 70 65 64 20 2a |s just s|kipped *|
|000031d0| 2f 0a 20 20 20 20 20 20 | 69 66 20 28 31 20 2b 20 |/. |if (1 + |
|000031e0| 6a 20 2b 20 74 6c 20 3e | 3d 20 6c 69 6e 65 5f 6c |j + tl >|= line_l|
|000031f0| 65 6e 29 0a 09 6c 69 6e | 65 20 3d 20 28 63 68 61 |en)..lin|e = (cha|
|00003200| 72 20 2a 29 78 72 65 61 | 6c 6c 6f 63 20 28 6c 69 |r *)xrea|lloc (li|
|00003210| 6e 65 2c 20 6c 69 6e 65 | 5f 6c 65 6e 20 2b 3d 20 |ne, line|_len += |
|00003220| 28 35 30 20 2b 20 74 6c | 29 29 3b 0a 20 20 20 20 |(50 + tl|));. |
|00003230| 20 20 73 74 72 6e 63 70 | 79 20 28 6c 69 6e 65 20 | strncp|y (line |
|00003240| 2b 20 6a 2c 20 73 74 72 | 69 6e 67 20 2b 20 73 74 |+ j, str|ing + st|
|00003250| 61 72 74 2c 20 74 6c 29 | 3b 0a 20 20 20 20 20 20 |art, tl)|;. |
|00003260| 6c 69 6e 65 5b 6a 20 2b | 20 74 6c 5d 20 3d 20 27 |line[j +| tl] = '|
|00003270| 5c 30 27 3b 0a 0a 20 20 | 20 20 20 20 72 65 61 6c |\0';.. | real|
|00003280| 5f 73 74 61 72 74 20 3d | 20 69 3b 0a 0a 20 20 20 |_start =| i;.. |
|00003290| 20 20 20 63 6f 6d 6d 61 | 6e 64 5f 77 6f 72 64 20 | comma|nd_word |
|000032a0| 3d 20 63 6f 6d 6d 61 6e | 64 5f 77 6f 72 64 20 7c |= comman|d_word ||
|000032b0| 7c 20 28 63 6f 6d 6d 61 | 6e 64 5f 73 65 70 61 72 || (comma|nd_separ|
|000032c0| 61 74 6f 72 20 28 73 74 | 72 69 6e 67 5b 69 5d 29 |ator (st|ring[i])|
|000032d0| 29 3b 0a 20 20 20 20 20 | 20 65 78 70 61 6e 64 5f |);. | expand_|
|000032e0| 74 68 69 73 5f 74 6f 6b | 65 6e 20 3d 20 28 63 6f |this_tok|en = (co|
|000032f0| 6d 6d 61 6e 64 5f 77 6f | 72 64 20 7c 7c 20 65 78 |mmand_wo|rd || ex|
|00003300| 70 61 6e 64 5f 6e 65 78 | 74 29 3b 0a 20 20 20 20 |pand_nex|t);. |
|00003310| 20 20 65 78 70 61 6e 64 | 5f 6e 65 78 74 20 3d 20 | expand|_next = |
|00003320| 30 3b 0a 0a 20 20 20 20 | 20 20 2f 2a 20 52 65 61 |0;.. | /* Rea|
|00003330| 64 20 74 68 65 20 6e 65 | 78 74 20 74 6f 6b 65 6e |d the ne|xt token|
|00003340| 2c 20 61 6e 64 20 63 6f | 70 79 20 69 74 20 69 6e |, and co|py it in|
|00003350| 74 6f 20 54 4f 4b 45 4e | 2e 20 2a 2f 0a 20 20 20 |to TOKEN|. */. |
|00003360| 20 20 20 73 74 61 72 74 | 20 3d 20 69 3b 0a 20 20 | start| = i;. |
|00003370| 20 20 20 20 69 20 3d 20 | 72 64 5f 74 6f 6b 65 6e | i = |rd_token|
|00003380| 20 28 73 74 72 69 6e 67 | 2c 20 73 74 61 72 74 29 | (string|, start)|
|00003390| 3b 0a 0a 20 20 20 20 20 | 20 74 6c 20 3d 20 69 20 |;.. | tl = i |
|000033a0| 2d 20 73 74 61 72 74 3b | 09 2f 2a 20 74 6f 6b 65 |- start;|./* toke|
|000033b0| 6e 20 6c 65 6e 67 74 68 | 20 2a 2f 0a 0a 20 20 20 |n length| */.. |
|000033c0| 20 20 20 2f 2a 20 49 66 | 20 74 6c 20 3d 3d 20 30 | /* If| tl == 0|
|000033d0| 2c 20 62 75 74 20 77 65 | 27 72 65 20 6e 6f 74 20 |, but we|'re not |
|000033e0| 61 74 20 74 68 65 20 65 | 6e 64 20 6f 66 20 74 68 |at the e|nd of th|
|000033f0| 65 20 73 74 72 69 6e 67 | 2c 20 74 68 65 6e 20 77 |e string|, then w|
|00003400| 65 20 68 61 76 65 20 61 | 0a 09 20 73 69 6e 67 6c |e have a|.. singl|
|00003410| 65 2d 63 68 61 72 61 63 | 74 65 72 20 74 6f 6b 65 |e-charac|ter toke|
|00003420| 6e 2c 20 70 72 6f 62 61 | 62 6c 79 20 61 20 64 65 |n, proba|bly a de|
|00003430| 6c 69 6d 69 74 65 72 20 | 2a 2f 0a 20 20 20 20 20 |limiter |*/. |
|00003440| 20 69 66 20 28 74 6c 20 | 3d 3d 20 30 20 26 26 20 | if (tl |== 0 && |
|00003450| 73 74 72 69 6e 67 5b 69 | 5d 20 21 3d 20 27 5c 30 |string[i|] != '\0|
|00003460| 27 29 0a 09 7b 0a 09 20 | 20 74 6c 20 3d 20 31 3b |')..{.. | tl = 1;|
|00003470| 0a 09 20 20 69 2b 2b 3b | 09 09 2f 2a 20 6d 6f 76 |.. i++;|../* mov|
|00003480| 65 20 70 61 73 74 20 69 | 74 20 2a 2f 0a 09 7d 0a |e past i|t */..}.|
|00003490| 0a 20 20 20 20 20 20 73 | 74 72 6e 63 70 79 20 28 |. s|trncpy (|
|000034a0| 74 6f 6b 65 6e 2c 20 73 | 74 72 69 6e 67 20 2b 20 |token, s|tring + |
|000034b0| 73 74 61 72 74 2c 20 74 | 6c 29 3b 0a 20 20 20 20 |start, t|l);. |
|000034c0| 20 20 74 6f 6b 65 6e 20 | 5b 74 6c 5d 20 3d 20 27 | token |[tl] = '|
|000034d0| 5c 30 27 3b 0a 0a 20 20 | 20 20 20 20 2f 2a 20 49 |\0';.. | /* I|
|000034e0| 66 20 74 68 65 72 65 20 | 69 73 20 61 20 62 61 63 |f there |is a bac|
|000034f0| 6b 73 6c 61 73 68 2d 65 | 73 63 61 70 65 64 20 63 |kslash-e|scaped c|
|00003500| 68 61 72 61 63 74 65 72 | 20 71 75 6f 74 65 64 20 |haracter| quoted |
|00003510| 69 6e 20 54 4f 4b 45 4e | 2c 0a 09 20 74 68 65 6e |in TOKEN|,.. then|
|00003520| 20 77 65 20 64 6f 6e 27 | 74 20 64 6f 20 61 6c 69 | we don'|t do ali|
|00003530| 61 73 20 65 78 70 61 6e | 73 69 6f 6e 2e 20 20 54 |as expan|sion. T|
|00003540| 68 69 73 20 73 68 6f 75 | 6c 64 20 63 68 65 63 6b |his shou|ld check|
|00003550| 20 66 6f 72 20 61 6c 6c | 0a 09 20 6f 74 68 65 72 | for all|.. other|
|00003560| 20 71 75 6f 74 69 6e 67 | 20 63 68 61 72 61 63 74 | quoting| charact|
|00003570| 65 72 73 2c 20 74 6f 6f | 2e 20 2a 2f 0a 20 20 20 |ers, too|. */. |
|00003580| 20 20 20 69 66 20 28 69 | 6e 64 65 78 28 74 6f 6b | if (i|ndex(tok|
|00003590| 65 6e 2c 27 5c 5c 27 29 | 29 0a 09 65 78 70 61 6e |en,'\\')|)..expan|
|000035a0| 64 5f 74 68 69 73 5f 74 | 6f 6b 65 6e 20 3d 20 30 |d_this_t|oken = 0|
|000035b0| 3b 0a 0a 20 20 20 20 20 | 20 2f 2a 20 49 66 20 77 |;.. | /* If w|
|000035c0| 65 20 73 68 6f 75 6c 64 | 20 62 65 20 65 78 70 61 |e should| be expa|
|000035d0| 6e 64 69 6e 67 20 68 65 | 72 65 2c 20 69 66 20 77 |nding he|re, if w|
|000035e0| 65 20 61 72 65 20 65 78 | 70 61 6e 64 69 6e 67 20 |e are ex|panding |
|000035f0| 61 6c 6c 20 77 6f 72 64 | 73 2c 20 6f 72 20 69 66 |all word|s, or if|
|00003600| 0a 09 20 77 65 20 61 72 | 65 20 69 6e 20 61 20 6c |.. we ar|e in a l|
|00003610| 6f 63 61 74 69 6f 6e 20 | 69 6e 20 74 68 65 20 73 |ocation |in the s|
|00003620| 74 72 69 6e 67 20 77 68 | 65 72 65 20 61 6e 20 65 |tring wh|ere an e|
|00003630| 78 70 61 6e 73 69 6f 6e | 20 69 73 20 73 75 70 70 |xpansion| is supp|
|00003640| 6f 73 65 64 20 74 6f 0a | 09 20 74 61 6b 65 20 70 |osed to.|. take p|
|00003650| 6c 61 63 65 2c 20 73 65 | 65 20 69 66 20 74 68 69 |lace, se|e if thi|
|00003660| 73 20 77 6f 72 64 20 68 | 61 73 20 61 20 73 75 62 |s word h|as a sub|
|00003670| 73 74 69 74 75 74 69 6f | 6e 2e 20 20 49 66 20 69 |stitutio|n. If i|
|00003680| 74 20 64 6f 65 73 2c 20 | 74 68 65 6e 20 64 6f 0a |t does, |then do.|
|00003690| 09 20 74 68 65 20 65 78 | 70 61 6e 73 69 6f 6e 2e |. the ex|pansion.|
|000036a0| 20 20 4e 6f 74 65 20 74 | 68 61 74 20 77 65 20 64 | Note t|hat we d|
|000036b0| 65 66 65 72 20 74 68 65 | 20 61 6c 69 61 73 20 76 |efer the| alias v|
|000036c0| 61 6c 75 65 20 6c 6f 6f | 6b 75 70 20 75 6e 74 69 |alue loo|kup unti|
|000036d0| 6c 20 77 65 0a 09 20 61 | 72 65 20 73 75 72 65 20 |l we.. a|re sure |
|000036e0| 77 65 20 61 72 65 20 65 | 78 70 61 6e 64 69 6e 67 |we are e|xpanding|
|000036f0| 20 74 68 69 73 20 74 6f | 6b 65 6e 2e 20 2a 2f 0a | this to|ken. */.|
|00003700| 0a 20 20 20 20 20 20 69 | 66 20 28 28 74 6f 6b 65 |. i|f ((toke|
|00003710| 6e 5b 30 5d 29 20 26 26 | 0a 09 20 20 28 65 78 70 |n[0]) &&|.. (exp|
|00003720| 61 6e 64 5f 74 68 69 73 | 5f 74 6f 6b 65 6e 20 7c |and_this|_token ||
|00003730| 7c 20 61 6c 69 61 73 5f | 65 78 70 61 6e 64 5f 61 || alias_|expand_a|
|00003740| 6c 6c 29 20 26 26 0a 09 | 20 20 28 61 6c 69 61 73 |ll) &&..| (alias|
|00003750| 20 3d 20 66 69 6e 64 5f | 61 6c 69 61 73 20 28 74 | = find_|alias (t|
|00003760| 6f 6b 65 6e 29 29 29 0a | 09 7b 0a 09 20 20 63 68 |oken))).|.{.. ch|
|00003770| 61 72 20 2a 76 20 3d 20 | 61 6c 69 61 73 2d 3e 76 |ar *v = |alias->v|
|00003780| 61 6c 75 65 3b 0a 09 20 | 20 69 6e 74 20 6c 20 3d |alue;.. | int l =|
|00003790| 20 73 74 72 6c 65 6e 20 | 28 76 29 3b 0a 20 20 20 | strlen |(v);. |
|000037a0| 20 20 20 0a 09 20 20 2f | 2a 20 2b 33 20 62 65 63 | .. /|* +3 bec|
|000037b0| 61 75 73 65 20 77 65 20 | 70 6f 73 73 69 62 6c 79 |ause we |possibly|
|000037c0| 20 61 64 64 20 6f 6e 65 | 20 6d 6f 72 65 20 63 68 | add one| more ch|
|000037d0| 61 72 61 63 74 65 72 20 | 62 65 6c 6f 77 2e 20 2a |aracter |below. *|
|000037e0| 2f 0a 09 20 20 69 66 20 | 28 28 6c 20 2b 20 33 29 |/.. if |((l + 3)|
|000037f0| 20 3e 20 6c 69 6e 65 5f | 6c 65 6e 20 2d 20 73 74 | > line_|len - st|
|00003800| 72 6c 65 6e 20 28 6c 69 | 6e 65 29 29 0a 09 20 20 |rlen (li|ne)).. |
|00003810| 20 20 6c 69 6e 65 20 3d | 20 28 63 68 61 72 20 2a | line =| (char *|
|00003820| 29 78 72 65 61 6c 6c 6f | 63 20 28 6c 69 6e 65 2c |)xreallo|c (line,|
|00003830| 20 6c 69 6e 65 5f 6c 65 | 6e 20 2b 3d 20 28 35 30 | line_le|n += (50|
|00003840| 20 2b 20 6c 29 29 3b 0a | 0a 09 20 20 73 74 72 63 | + l));.|.. strc|
|00003850| 61 74 20 28 6c 69 6e 65 | 2c 20 76 29 3b 0a 0a 09 |at (line|, v);...|
|00003860| 20 20 69 66 20 28 28 65 | 78 70 61 6e 64 5f 74 68 | if ((e|xpand_th|
|00003870| 69 73 5f 74 6f 6b 65 6e | 20 26 26 20 6c 20 26 26 |is_token| && l &&|
|00003880| 20 77 68 69 74 65 73 70 | 61 63 65 20 28 76 5b 6c | whitesp|ace (v[l|
|00003890| 20 2d 20 31 5d 29 29 20 | 7c 7c 20 61 6c 69 61 73 | - 1])) ||| alias|
|000038a0| 5f 65 78 70 61 6e 64 5f | 61 6c 6c 29 0a 09 20 20 |_expand_|all).. |
|000038b0| 20 20 65 78 70 61 6e 64 | 5f 6e 65 78 74 20 3d 20 | expand|_next = |
|000038c0| 31 3b 0a 09 7d 0a 20 20 | 20 20 20 20 65 6c 73 65 |1;..}. | else|
|000038d0| 0a 09 7b 0a 09 20 20 69 | 6e 74 20 6c 6c 20 3d 20 |..{.. i|nt ll = |
|000038e0| 73 74 72 6c 65 6e 20 28 | 6c 69 6e 65 29 3b 0a 09 |strlen (|line);..|
|000038f0| 20 20 69 6e 74 20 74 6c | 20 3d 20 69 20 2d 20 72 | int tl| = i - r|
|00003900| 65 61 6c 5f 73 74 61 72 | 74 3b 20 2f 2a 20 74 6c |eal_star|t; /* tl|
|00003910| 20 3d 3d 20 73 74 72 6c | 65 6e 28 74 6f 6b 65 6e | == strl|en(token|
|00003920| 29 20 2a 2f 0a 0a 09 20 | 20 69 66 20 28 6c 6c 20 |) */... | if (ll |
|00003930| 2b 20 74 6c 20 2b 20 32 | 20 3e 20 6c 69 6e 65 5f |+ tl + 2| > line_|
|00003940| 6c 65 6e 29 0a 09 20 20 | 20 20 6c 69 6e 65 20 3d |len).. | line =|
|00003950| 20 28 63 68 61 72 20 2a | 29 78 72 65 61 6c 6c 6f | (char *|)xreallo|
|00003960| 63 20 28 6c 69 6e 65 2c | 20 6c 69 6e 65 5f 6c 65 |c (line,| line_le|
|00003970| 6e 20 2b 3d 20 35 30 20 | 2b 20 6c 6c 20 2b 20 74 |n += 50 |+ ll + t|
|00003980| 6c 29 3b 0a 0a 09 20 20 | 73 74 72 6e 63 70 79 20 |l);... |strncpy |
|00003990| 28 6c 69 6e 65 20 2b 20 | 6c 6c 2c 20 73 74 72 69 |(line + |ll, stri|
|000039a0| 6e 67 20 2b 20 72 65 61 | 6c 5f 73 74 61 72 74 2c |ng + rea|l_start,|
|000039b0| 20 74 6c 29 3b 0a 09 20 | 20 6c 69 6e 65 5b 6c 6c | tl);.. | line[ll|
|000039c0| 20 2b 20 74 6c 5d 20 3d | 20 27 5c 30 27 3b 0a 09 | + tl] =| '\0';..|
|000039d0| 7d 0a 20 20 20 20 20 20 | 63 6f 6d 6d 61 6e 64 5f |}. |command_|
|000039e0| 77 6f 72 64 20 3d 20 30 | 3b 0a 20 20 20 20 7d 0a |word = 0|;. }.|
|000039f0| 7d 0a 0a 63 68 61 72 20 | 2a 0a 61 6c 69 61 73 5f |}..char |*.alias_|
|00003a00| 65 78 70 61 6e 64 5f 77 | 6f 72 64 20 28 73 29 0a |expand_w|ord (s).|
|00003a10| 20 20 20 20 20 63 68 61 | 72 20 2a 73 3b 0a 7b 0a | cha|r *s;.{.|
|00003a20| 20 20 41 53 53 4f 43 20 | 2a 72 20 3d 20 66 69 6e | ASSOC |*r = fin|
|00003a30| 64 5f 61 6c 69 61 73 20 | 28 73 29 3b 0a 0a 20 20 |d_alias |(s);.. |
|00003a40| 69 66 20 28 72 29 0a 20 | 20 20 20 72 65 74 75 72 |if (r). | retur|
|00003a50| 6e 20 28 73 61 76 65 73 | 74 72 69 6e 67 20 28 72 |n (saves|tring (r|
|00003a60| 2d 3e 76 61 6c 75 65 29 | 29 3b 0a 20 20 65 6c 73 |->value)|);. els|
|00003a70| 65 0a 20 20 20 20 72 65 | 74 75 72 6e 20 28 28 63 |e. re|turn ((c|
|00003a80| 68 61 72 20 2a 29 4e 55 | 4c 4c 29 3b 0a 7d 0a 00 |har *)NU|LL);.}..|
|00003a90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003c00| 62 61 73 68 2d 31 2e 31 | 32 2f 61 6c 69 61 73 2e |bash-1.1|2/alias.|
|00003c10| 68 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |h.......|........|
|00003c20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003c60| 00 00 00 00 30 30 30 36 | 36 36 20 00 30 30 30 30 |....0006|66 .0000|
|00003c70| 30 30 20 00 30 30 30 30 | 30 30 20 00 30 30 30 30 |00 .0000|00 .0000|
|00003c80| 30 30 30 33 35 36 31 20 | 30 35 30 33 35 36 35 37 |0003561 |05035657|
|00003c90| 33 34 30 20 30 31 32 30 | 30 32 20 00 30 00 00 00 |340 0120|02 .0...|
|00003ca0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003cb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d00| 00 75 73 74 61 72 00 30 | 30 00 00 00 00 00 00 00 |.ustar.0|0.......|
|00003d10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d40| 00 00 00 00 00 00 00 00 | 00 30 30 30 30 30 30 20 |........|.000000 |
|00003d50| 00 30 30 30 30 30 30 20 | 00 00 00 00 00 00 00 00 |.000000 |........|
|00003d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003e00| 2f 2a 20 61 6c 69 61 73 | 2e 68 20 2d 2d 20 73 74 |/* alias|.h -- st|
|00003e10| 72 75 63 74 75 72 65 20 | 64 65 66 69 6e 69 74 69 |ructure |definiti|
|00003e20| 6f 6e 73 2e 20 2a 2f 0a | 0a 2f 2a 20 43 6f 70 79 |ons. */.|./* Copy|
|00003e30| 72 69 67 68 74 20 28 43 | 29 20 31 39 38 37 2c 31 |right (C|) 1987,1|
|00003e40| 39 39 31 20 46 72 65 65 | 20 53 6f 66 74 77 61 72 |991 Free| Softwar|
|00003e50| 65 20 46 6f 75 6e 64 61 | 74 69 6f 6e 2c 20 49 6e |e Founda|tion, In|
|00003e60| 63 2e 0a 0a 20 20 20 54 | 68 69 73 20 66 69 6c 65 |c... T|his file|
|00003e70| 20 69 73 20 70 61 72 74 | 20 6f 66 20 47 4e 55 20 | is part| of GNU |
|00003e80| 42 61 73 68 2c 20 74 68 | 65 20 42 6f 75 72 6e 65 |Bash, th|e Bourne|
|00003e90| 20 41 67 61 69 6e 20 53 | 48 65 6c 6c 2e 0a 0a 20 | Again S|Hell... |
|00003ea0| 20 20 42 61 73 68 20 69 | 73 20 66 72 65 65 20 73 | Bash i|s free s|
|00003eb0| 6f 66 74 77 61 72 65 3b | 20 79 6f 75 20 63 61 6e |oftware;| you can|
|00003ec0| 20 72 65 64 69 73 74 72 | 69 62 75 74 65 20 69 74 | redistr|ibute it|
|00003ed0| 20 61 6e 64 2f 6f 72 20 | 6d 6f 64 69 66 79 20 69 | and/or |modify i|
|00003ee0| 74 0a 20 20 20 75 6e 64 | 65 72 20 74 68 65 20 74 |t. und|er the t|
|00003ef0| 65 72 6d 73 20 6f 66 20 | 74 68 65 20 47 4e 55 20 |erms of |the GNU |
|00003f00| 47 65 6e 65 72 61 6c 20 | 50 75 62 6c 69 63 20 4c |General |Public L|
|00003f10| 69 63 65 6e 73 65 20 61 | 73 20 70 75 62 6c 69 73 |icense a|s publis|
|00003f20| 68 65 64 20 62 79 0a 20 | 20 20 74 68 65 20 46 72 |hed by. | the Fr|
|00003f30| 65 65 20 53 6f 66 74 77 | 61 72 65 20 46 6f 75 6e |ee Softw|are Foun|
|00003f40| 64 61 74 69 6f 6e 3b 20 | 65 69 74 68 65 72 20 76 |dation; |either v|
|00003f50| 65 72 73 69 6f 6e 20 31 | 2c 20 6f 72 20 28 61 74 |ersion 1|, or (at|
|00003f60| 20 79 6f 75 72 20 6f 70 | 74 69 6f 6e 29 0a 20 20 | your op|tion). |
|00003f70| 20 61 6e 79 20 6c 61 74 | 65 72 20 76 65 72 73 69 | any lat|er versi|
|00003f80| 6f 6e 2e 0a 0a 20 20 20 | 42 61 73 68 20 69 73 20 |on... |Bash is |
|00003f90| 64 69 73 74 72 69 62 75 | 74 65 64 20 69 6e 20 74 |distribu|ted in t|
|00003fa0| 68 65 20 68 6f 70 65 20 | 74 68 61 74 20 69 74 20 |he hope |that it |
|00003fb0| 77 69 6c 6c 20 62 65 20 | 75 73 65 66 75 6c 2c 20 |will be |useful, |
|00003fc0| 62 75 74 20 57 49 54 48 | 4f 55 54 0a 20 20 20 41 |but WITH|OUT. A|
|00003fd0| 4e 59 20 57 41 52 52 41 | 4e 54 59 3b 20 77 69 74 |NY WARRA|NTY; wit|
|00003fe0| 68 6f 75 74 20 65 76 65 | 6e 20 74 68 65 20 69 6d |hout eve|n the im|
|00003ff0| 70 6c 69 65 64 20 77 61 | 72 72 61 6e 74 79 20 6f |plied wa|rranty o|
|00004000| 66 20 4d 45 52 43 48 41 | 4e 54 41 42 49 4c 49 54 |f MERCHA|NTABILIT|
|00004010| 59 0a 20 20 20 6f 72 20 | 46 49 54 4e 45 53 53 20 |Y. or |FITNESS |
|00004020| 46 4f 52 20 41 20 50 41 | 52 54 49 43 55 4c 41 52 |FOR A PA|RTICULAR|
|00004030| 20 50 55 52 50 4f 53 45 | 2e 20 20 53 65 65 20 74 | PURPOSE|. See t|
|00004040| 68 65 20 47 4e 55 20 47 | 65 6e 65 72 61 6c 20 50 |he GNU G|eneral P|
|00004050| 75 62 6c 69 63 0a 20 20 | 20 4c 69 63 65 6e 73 65 |ublic. | License|
|00004060| 20 66 6f 72 20 6d 6f 72 | 65 20 64 65 74 61 69 6c | for mor|e detail|
|00004070| 73 2e 0a 0a 20 20 20 59 | 6f 75 20 73 68 6f 75 6c |s... Y|ou shoul|
|00004080| 64 20 68 61 76 65 20 72 | 65 63 65 69 76 65 64 20 |d have r|eceived |
|00004090| 61 20 63 6f 70 79 20 6f | 66 20 74 68 65 20 47 4e |a copy o|f the GN|
|000040a0| 55 20 47 65 6e 65 72 61 | 6c 20 50 75 62 6c 69 63 |U Genera|l Public|
|000040b0| 20 4c 69 63 65 6e 73 65 | 0a 20 20 20 61 6c 6f 6e | License|. alon|
|000040c0| 67 20 77 69 74 68 20 42 | 61 73 68 3b 20 73 65 65 |g with B|ash; see|
|000040d0| 20 74 68 65 20 66 69 6c | 65 20 43 4f 50 59 49 4e | the fil|e COPYIN|
|000040e0| 47 2e 20 20 49 66 20 6e | 6f 74 2c 20 77 72 69 74 |G. If n|ot, writ|
|000040f0| 65 20 74 6f 20 74 68 65 | 20 46 72 65 65 0a 20 20 |e to the| Free. |
|00004100| 20 53 6f 66 74 77 61 72 | 65 20 46 6f 75 6e 64 61 | Softwar|e Founda|
|00004110| 74 69 6f 6e 2c 20 36 37 | 35 20 4d 61 73 73 20 41 |tion, 67|5 Mass A|
|00004120| 76 65 2c 20 43 61 6d 62 | 72 69 64 67 65 2c 20 4d |ve, Camb|ridge, M|
|00004130| 41 20 30 32 31 33 39 2c | 20 55 53 41 2e 20 2a 2f |A 02139,| USA. */|
|00004140| 0a 0a 23 69 66 20 21 64 | 65 66 69 6e 65 64 20 28 |..#if !d|efined (|
|00004150| 5f 41 4c 49 41 53 5f 29 | 0a 23 64 65 66 69 6e 65 |_ALIAS_)|.#define|
|00004160| 20 5f 41 4c 49 41 53 5f | 0a 0a 65 78 74 65 72 6e | _ALIAS_|..extern|
|00004170| 20 63 68 61 72 20 2a 78 | 6d 61 6c 6c 6f 63 20 28 | char *x|malloc (|
|00004180| 29 2c 20 2a 6d 61 6c 6c | 6f 63 20 28 29 3b 0a 0a |), *mall|oc ();..|
|00004190| 23 69 66 6e 64 65 66 20 | 77 68 69 74 65 73 70 61 |#ifndef |whitespa|
|000041a0| 63 65 0a 23 64 65 66 69 | 6e 65 20 77 68 69 74 65 |ce.#defi|ne white|
|000041b0| 73 70 61 63 65 28 63 29 | 20 28 28 28 63 29 20 3d |space(c)| (((c) =|
|000041c0| 3d 20 27 20 27 29 20 7c | 7c 20 28 28 63 29 20 3d |= ' ') ||| ((c) =|
|000041d0| 3d 20 27 5c 74 27 29 29 | 0a 23 65 6e 64 69 66 0a |= '\t'))|.#endif.|
|000041e0| 0a 23 69 66 6e 64 65 66 | 20 73 61 76 65 73 74 72 |.#ifndef| savestr|
|000041f0| 69 6e 67 0a 23 64 65 66 | 69 6e 65 20 73 61 76 65 |ing.#def|ine save|
|00004200| 73 74 72 69 6e 67 28 78 | 29 20 28 63 68 61 72 20 |string(x|) (char |
|00004210| 2a 29 73 74 72 63 70 79 | 20 28 78 6d 61 6c 6c 6f |*)strcpy| (xmallo|
|00004220| 63 20 28 31 20 2b 20 73 | 74 72 6c 65 6e 20 28 78 |c (1 + s|trlen (x|
|00004230| 29 29 2c 20 28 78 29 29 | 0a 23 65 6e 64 69 66 0a |)), (x))|.#endif.|
|00004240| 0a 74 79 70 65 64 65 66 | 20 73 74 72 75 63 74 20 |.typedef| struct |
|00004250| 7b 0a 20 20 63 68 61 72 | 20 2a 6e 61 6d 65 3b 0a |{. char| *name;.|
|00004260| 20 20 63 68 61 72 20 2a | 76 61 6c 75 65 3b 0a 7d | char *|value;.}|
|00004270| 20 41 53 53 4f 43 3b 0a | 0a 23 69 66 6e 64 65 66 | ASSOC;.|.#ifndef|
|00004280| 20 4e 55 4c 4c 0a 23 64 | 65 66 69 6e 65 20 4e 55 | NULL.#d|efine NU|
|00004290| 4c 4c 20 30 78 30 0a 23 | 65 6e 64 69 66 0a 0a 2f |LL 0x0.#|endif../|
|000042a0| 2a 20 54 68 65 20 6c 69 | 73 74 20 6f 66 20 6b 6e |* The li|st of kn|
|000042b0| 6f 77 6e 20 61 6c 69 61 | 73 65 73 2e 20 2a 2f 0a |own alia|ses. */.|
|000042c0| 65 78 74 65 72 6e 20 41 | 53 53 4f 43 20 2a 2a 61 |extern A|SSOC **a|
|000042d0| 6c 69 61 73 65 73 3b 0a | 0a 2f 2a 20 53 63 61 6e |liases;.|./* Scan|
|000042e0| 20 74 68 65 20 6c 69 73 | 74 20 6f 66 20 61 6c 69 | the lis|t of ali|
|000042f0| 61 73 65 73 20 6c 6f 6f | 6b 69 6e 67 20 66 6f 72 |ases loo|king for|
|00004300| 20 6f 6e 65 20 77 69 74 | 68 20 4e 41 4d 45 2e 20 | one wit|h NAME. |
|00004310| 20 52 65 74 75 72 6e 20 | 4e 55 4c 4c 0a 20 20 20 | Return |NULL. |
|00004320| 69 66 20 74 68 65 20 61 | 6c 69 61 73 20 64 6f 65 |if the a|lias doe|
|00004330| 73 6e 27 74 20 65 78 69 | 73 74 2c 20 65 6c 73 65 |sn't exi|st, else|
|00004340| 20 61 20 70 6f 69 6e 74 | 65 72 20 74 6f 20 74 68 | a point|er to th|
|00004350| 65 20 61 73 73 6f 63 2e | 20 2a 2f 0a 65 78 74 65 |e assoc.| */.exte|
|00004360| 72 6e 20 41 53 53 4f 43 | 20 2a 66 69 6e 64 5f 61 |rn ASSOC| *find_a|
|00004370| 6c 69 61 73 20 28 29 3b | 0a 0a 2f 2a 20 52 65 74 |lias ();|../* Ret|
|00004380| 75 72 6e 20 74 68 65 20 | 76 61 6c 75 65 20 6f 66 |urn the |value of|
|00004390| 20 74 68 65 20 61 6c 69 | 61 73 20 66 6f 72 20 4e | the ali|as for N|
|000043a0| 41 4d 45 2c 20 6f 72 20 | 4e 55 4c 4c 20 69 66 20 |AME, or |NULL if |
|000043b0| 74 68 65 72 65 20 69 73 | 20 6e 6f 6e 65 2e 20 2a |there is| none. *|
|000043c0| 2f 0a 65 78 74 65 72 6e | 20 63 68 61 72 20 2a 67 |/.extern| char *g|
|000043d0| 65 74 5f 61 6c 69 61 73 | 5f 76 61 6c 75 65 20 28 |et_alias|_value (|
|000043e0| 29 3b 0a 0a 2f 2a 20 4d | 61 6b 65 20 61 20 6e 65 |);../* M|ake a ne|
|000043f0| 77 20 61 6c 69 61 73 20 | 66 72 6f 6d 20 4e 41 4d |w alias |from NAM|
|00004400| 45 20 61 6e 64 20 56 41 | 4c 55 45 2e 20 20 49 66 |E and VA|LUE. If|
|00004410| 20 4e 41 4d 45 20 63 61 | 6e 20 62 65 20 66 6f 75 | NAME ca|n be fou|
|00004420| 6e 64 2c 0a 20 20 20 74 | 68 65 6e 20 72 65 70 6c |nd,. t|hen repl|
|00004430| 61 63 65 20 69 74 73 20 | 76 61 6c 75 65 2e 20 2a |ace its |value. *|
|00004440| 2f 0a 65 78 74 65 72 6e | 20 76 6f 69 64 20 61 64 |/.extern| void ad|
|00004450| 64 5f 61 6c 69 61 73 20 | 28 29 3b 0a 0a 2f 2a 20 |d_alias |();../* |
|00004460| 52 65 6d 6f 76 65 20 74 | 68 65 20 61 6c 69 61 73 |Remove t|he alias|
|00004470| 20 77 69 74 68 20 6e 61 | 6d 65 20 4e 41 4d 45 20 | with na|me NAME |
|00004480| 66 72 6f 6d 20 74 68 65 | 20 61 6c 69 61 73 20 6c |from the| alias l|
|00004490| 69 73 74 2e 20 20 52 65 | 74 75 72 6e 73 0a 20 20 |ist. Re|turns. |
|000044a0| 20 74 68 65 20 69 6e 64 | 65 78 20 6f 66 20 74 68 | the ind|ex of th|
|000044b0| 65 20 72 65 6d 6f 76 65 | 64 20 61 6c 69 61 73 2c |e remove|d alias,|
|000044c0| 20 6f 72 20 2d 31 20 69 | 66 20 74 68 65 20 61 6c | or -1 i|f the al|
|000044d0| 69 61 73 20 64 69 64 6e | 27 74 20 65 78 69 73 74 |ias didn|'t exist|
|000044e0| 2e 20 2a 2f 0a 65 78 74 | 65 72 6e 20 69 6e 74 20 |. */.ext|ern int |
|000044f0| 72 65 6d 6f 76 65 5f 61 | 6c 69 61 73 20 28 29 3b |remove_a|lias ();|
|00004500| 0a 0a 2f 2a 20 52 65 74 | 75 72 6e 20 61 20 6e 65 |../* Ret|urn a ne|
|00004510| 77 20 6c 69 6e 65 2c 20 | 77 69 74 68 20 61 6e 79 |w line, |with any|
|00004520| 20 61 6c 69 61 73 65 73 | 20 73 75 62 73 74 69 74 | aliases| substit|
|00004530| 75 74 65 64 2e 20 2a 2f | 0a 65 78 74 65 72 6e 20 |uted. */|.extern |
|00004540| 63 68 61 72 20 2a 61 6c | 69 61 73 5f 73 75 62 73 |char *al|ias_subs|
|00004550| 74 69 74 75 74 65 20 28 | 29 3b 0a 0a 23 65 6e 64 |titute (|);..#end|
|00004560| 69 66 20 2f 2a 20 5f 41 | 4c 49 41 53 5f 20 2a 2f |if /* _A|LIAS_ */|
|00004570| 0a 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004580| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004600| 62 61 73 68 2d 31 2e 31 | 32 2f 62 61 64 2e 63 00 |bash-1.1|2/bad.c.|
|00004610| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004660| 00 00 00 00 30 30 30 36 | 36 36 20 00 30 30 30 30 |....0006|66 .0000|
|00004670| 30 30 20 00 30 30 30 30 | 30 30 20 00 30 30 30 30 |00 .0000|00 .0000|
|00004680| 30 30 30 30 30 31 37 20 | 30 35 34 31 30 32 36 35 |0000017 |05410265|
|00004690| 37 37 31 20 30 31 31 34 | 32 33 20 00 30 00 00 00 |771 0114|23 .0...|
|000046a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004700| 00 75 73 74 61 72 00 30 | 30 00 00 00 00 00 00 00 |.ustar.0|0.......|
|00004710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004740| 00 00 00 00 00 00 00 00 | 00 30 30 30 30 30 30 20 |........|.000000 |
|00004750| 00 30 30 30 30 30 30 20 | 00 00 00 00 00 00 00 00 |.000000 |........|
|00004760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004800| 6d 61 69 6e 28 29 0d 0a | 7b 20 0d 0a 7d 0d 0a 00 |main()..|{ ..}...|
|00004810| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004880| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004890| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004900| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a00| 62 61 73 68 2d 31 2e 31 | 32 2f 62 61 73 68 2e 73 |bash-1.1|2/bash.s|
|00004a10| 74 72 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |tr......|........|
|00004a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a60| 00 00 00 00 30 30 30 36 | 36 36 20 00 30 30 30 30 |....0006|66 .0000|
|00004a70| 30 30 20 00 30 30 30 30 | 30 30 20 00 30 30 30 30 |00 .0000|00 .0000|
|00004a80| 30 30 30 30 37 33 34 20 | 30 35 33 36 31 32 32 34 |0000734 |05361224|
|00004a90| 30 35 37 20 30 31 32 32 | 30 33 20 00 30 00 00 00 |057 0122|03 .0...|
|00004aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b00| 00 75 73 74 61 72 00 30 | 30 00 00 00 00 00 00 00 |.ustar.0|0.......|
|00004b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b40| 00 00 00 00 00 00 00 00 | 00 30 30 30 30 30 30 20 |........|.000000 |
|00004b50| 00 30 30 30 30 30 30 20 | 00 00 00 00 00 00 00 00 |.000000 |........|
|00004b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c00| 39 33 2d 30 34 2d 30 39 | 20 57 68 65 6e 20 73 74 |93-04-09| When st|
|00004c10| 61 72 74 69 6e 67 20 77 | 65 20 61 6e 64 20 67 69 |arting w|e and gi|
|00004c20| 76 69 6e 67 20 69 74 20 | 61 20 66 69 6c 65 20 6e |ving it |a file n|
|00004c30| 61 6d 65 20 74 6f 20 6f | 70 65 6e 2c 20 67 61 72 |ame to o|pen, gar|
|00004c40| 62 61 67 65 0d 0a 09 63 | 68 61 72 61 63 74 65 72 |bage...c|haracter|
|00004c50| 73 20 61 72 65 20 73 6f | 6d 65 74 69 6d 65 73 20 |s are so|metimes |
|00004c60| 70 75 74 20 69 6e 74 6f | 20 74 68 65 20 66 69 6c |put into| the fil|
|00004c70| 65 2e 20 20 49 74 20 73 | 65 65 6d 73 20 72 65 6c |e. It s|eems rel|
|00004c80| 61 74 65 64 20 74 6f 0d | 0a 09 63 6f 6d 6d 61 6e |ated to.|..comman|
|00004c90| 64 20 6c 69 6e 65 20 65 | 64 69 74 69 6e 67 2e 20 |d line e|diting. |
|00004ca0| 20 55 73 69 6e 67 20 74 | 68 65 20 21 20 66 65 61 | Using t|he ! fea|
|00004cb0| 74 75 72 65 20 77 69 6c | 6c 20 6f 66 74 65 6e 20 |ture wil|l often |
|00004cc0| 73 74 61 72 74 20 74 68 | 65 20 70 72 6f 62 6c 65 |start th|e proble|
|00004cd0| 6d 2e 0d 0a 09 41 6c 73 | 6f 2c 20 74 68 65 20 75 |m....Als|o, the u|
|00004ce0| 70 20 61 72 72 6f 77 20 | 6b 65 79 2e 0d 0a 0d 0a |p arrow |key.....|
|00004cf0| 39 33 2d 30 34 2d 30 39 | 20 62 61 73 68 20 69 73 |93-04-09| bash is|
|00004d00| 20 6e 6f 74 20 67 65 74 | 74 69 6e 67 20 74 68 65 | not get|ting the|
|00004d10| 20 72 65 74 75 72 6e 20 | 73 74 61 74 75 73 20 66 | return |status f|
|00004d20| 72 6f 6d 20 61 70 70 6c | 69 63 61 74 69 6f 6e 73 |rom appl|ications|
|00004d30| 20 74 68 61 74 0d 0a 09 | 69 74 20 73 74 61 72 74 | that...|it start|
|00004d40| 73 2e 20 20 4d 61 74 74 | 65 73 20 68 61 73 20 69 |s. Matt|es has i|
|00004d50| 6d 70 72 6f 76 69 73 65 | 64 20 61 20 66 6f 72 6b |mprovise|d a fork|
|00004d60| 28 29 20 63 61 6c 6c 20 | 77 68 69 63 68 20 77 69 |() call |which wi|
|00004d70| 6c 6c 20 73 74 61 72 74 | 20 61 20 6e 65 77 0d 0a |ll start| a new..|
|00004d80| 09 70 72 6f 63 65 73 73 | 2c 20 62 75 74 20 77 68 |.process|, but wh|
|00004d90| 65 6e 20 74 68 65 20 63 | 68 69 6c 64 20 65 78 65 |en the c|hild exe|
|00004da0| 63 28 29 27 73 2c 20 4f | 53 2f 32 20 77 69 6c 6c |c()'s, O|S/2 will|
|00004db0| 20 6e 6f 74 20 6c 65 74 | 20 74 68 65 0d 0a 09 70 | not let| the...p|
|00004dc0| 61 72 65 6e 74 20 67 65 | 74 20 74 68 65 20 72 65 |arent ge|t the re|
|00004dd0| 74 75 72 6e 20 63 6f 64 | 65 2e 0d 0a 00 00 00 00 |turn cod|e.......|
|00004de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e00| 62 61 73 68 2d 31 2e 31 | 32 2f 62 61 73 68 6c 69 |bash-1.1|2/bashli|
|00004e10| 6e 65 2e 63 00 00 00 00 | 00 00 00 00 00 00 00 00 |ne.c....|........|
|00004e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e60| 00 00 00 00 30 30 30 36 | 36 36 20 00 30 30 30 30 |....0006|66 .0000|
|00004e70| 30 30 20 00 30 30 30 30 | 30 30 20 00 30 30 30 30 |00 .0000|00 .0000|
|00004e80| 30 31 30 35 30 36 33 20 | 30 35 31 33 36 35 30 36 |0105063 |05136506|
|00004e90| 34 32 30 20 30 31 32 34 | 36 33 20 00 30 00 00 00 |420 0124|63 .0...|
|00004ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f00| 00 75 73 74 61 72 00 30 | 30 00 00 00 00 00 00 00 |.ustar.0|0.......|
|00004f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f40| 00 00 00 00 00 00 00 00 | 00 30 30 30 30 30 30 20 |........|.000000 |
|00004f50| 00 30 30 30 30 30 30 20 | 00 00 00 00 00 00 00 00 |.000000 |........|
|00004f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005000| 2f 2a 20 62 61 73 68 6c | 69 6e 65 2e 63 20 2d 2d |/* bashl|ine.c --|
|00005010| 20 42 61 73 68 27 73 20 | 69 6e 74 65 72 66 61 63 | Bash's |interfac|
|00005020| 65 20 74 6f 20 74 68 65 | 20 72 65 61 64 6c 69 6e |e to the| readlin|
|00005030| 65 20 6c 69 62 72 61 72 | 79 2e 20 2a 2f 0a 0a 2f |e librar|y. */../|
|00005040| 2a 20 43 6f 70 79 72 69 | 67 68 74 20 28 43 29 20 |* Copyri|ght (C) |
|00005050| 31 39 38 37 2c 31 39 39 | 31 20 46 72 65 65 20 53 |1987,199|1 Free S|
|00005060| 6f 66 74 77 61 72 65 20 | 46 6f 75 6e 64 61 74 69 |oftware |Foundati|
|00005070| 6f 6e 2c 20 49 6e 63 2e | 0a 0a 20 20 20 54 68 69 |on, Inc.|.. Thi|
|00005080| 73 20 66 69 6c 65 20 69 | 73 20 70 61 72 74 20 6f |s file i|s part o|
|00005090| 66 20 47 4e 55 20 42 61 | 73 68 2c 20 74 68 65 20 |f GNU Ba|sh, the |
|000050a0| 42 6f 75 72 6e 65 20 41 | 67 61 69 6e 20 53 48 65 |Bourne A|gain SHe|
|000050b0| 6c 6c 2e 0a 0a 20 20 20 | 42 61 73 68 20 69 73 20 |ll... |Bash is |
|000050c0| 66 72 65 65 20 73 6f 66 | 74 77 61 72 65 3b 20 79 |free sof|tware; y|
|000050d0| 6f 75 20 63 61 6e 20 72 | 65 64 69 73 74 72 69 62 |ou can r|edistrib|
|000050e0| 75 74 65 20 69 74 20 61 | 6e 64 2f 6f 72 20 6d 6f |ute it a|nd/or mo|
|000050f0| 64 69 66 79 20 69 74 0a | 20 20 20 75 6e 64 65 72 |dify it.| under|
|00005100| 20 74 68 65 20 74 65 72 | 6d 73 20 6f 66 20 74 68 | the ter|ms of th|
|00005110| 65 20 47 4e 55 20 47 65 | 6e 65 72 61 6c 20 50 75 |e GNU Ge|neral Pu|
|00005120| 62 6c 69 63 20 4c 69 63 | 65 6e 73 65 20 61 73 20 |blic Lic|ense as |
|00005130| 70 75 62 6c 69 73 68 65 | 64 20 62 79 0a 20 20 20 |publishe|d by. |
|00005140| 74 68 65 20 46 72 65 65 | 20 53 6f 66 74 77 61 72 |the Free| Softwar|
|00005150| 65 20 46 6f 75 6e 64 61 | 74 69 6f 6e 3b 20 65 69 |e Founda|tion; ei|
|00005160| 74 68 65 72 20 76 65 72 | 73 69 6f 6e 20 31 2c 20 |ther ver|sion 1, |
|00005170| 6f 72 20 28 61 74 20 79 | 6f 75 72 20 6f 70 74 69 |or (at y|our opti|
|00005180| 6f 6e 29 0a 20 20 20 61 | 6e 79 20 6c 61 74 65 72 |on). a|ny later|
|00005190| 20 76 65 72 73 69 6f 6e | 2e 0a 0a 20 20 20 42 61 | version|... Ba|
|000051a0| 73 68 20 69 73 20 64 69 | 73 74 72 69 62 75 74 65 |sh is di|stribute|
|000051b0| 64 20 69 6e 20 74 68 65 | 20 68 6f 70 65 20 74 68 |d in the| hope th|
|000051c0| 61 74 20 69 74 20 77 69 | 6c 6c 20 62 65 20 75 73 |at it wi|ll be us|
|000051d0| 65 66 75 6c 2c 20 62 75 | 74 20 57 49 54 48 4f 55 |eful, bu|t WITHOU|
|000051e0| 54 0a 20 20 20 41 4e 59 | 20 57 41 52 52 41 4e 54 |T. ANY| WARRANT|
|000051f0| 59 3b 20 77 69 74 68 6f | 75 74 20 65 76 65 6e 20 |Y; witho|ut even |
|00005200| 74 68 65 20 69 6d 70 6c | 69 65 64 20 77 61 72 72 |the impl|ied warr|
|00005210| 61 6e 74 79 20 6f 66 20 | 4d 45 52 43 48 41 4e 54 |anty of |MERCHANT|
|00005220| 41 42 49 4c 49 54 59 0a | 20 20 20 6f 72 20 46 49 |ABILITY.| or FI|
|00005230| 54 4e 45 53 53 20 46 4f | 52 20 41 20 50 41 52 54 |TNESS FO|R A PART|
|00005240| 49 43 55 4c 41 52 20 50 | 55 52 50 4f 53 45 2e 20 |ICULAR P|URPOSE. |
|00005250| 20 53 65 65 20 74 68 65 | 20 47 4e 55 20 47 65 6e | See the| GNU Gen|
|00005260| 65 72 61 6c 20 50 75 62 | 6c 69 63 0a 20 20 20 4c |eral Pub|lic. L|
|00005270| 69 63 65 6e 73 65 20 66 | 6f 72 20 6d 6f 72 65 20 |icense f|or more |
|00005280| 64 65 74 61 69 6c 73 2e | 0a 0a 20 20 20 59 6f 75 |details.|.. You|
|00005290| 20 73 68 6f 75 6c 64 20 | 68 61 76 65 20 72 65 63 | should |have rec|
|000052a0| 65 69 76 65 64 20 61 20 | 63 6f 70 79 20 6f 66 20 |eived a |copy of |
|000052b0| 74 68 65 20 47 4e 55 20 | 47 65 6e 65 72 61 6c 20 |the GNU |General |
|000052c0| 50 75 62 6c 69 63 20 4c | 69 63 65 6e 73 65 0a 20 |Public L|icense. |
|000052d0| 20 20 61 6c 6f 6e 67 20 | 77 69 74 68 20 42 61 73 | along |with Bas|
|000052e0| 68 3b 20 73 65 65 20 74 | 68 65 20 66 69 6c 65 20 |h; see t|he file |
|000052f0| 43 4f 50 59 49 4e 47 2e | 20 20 49 66 20 6e 6f 74 |COPYING.| If not|
|00005300| 2c 20 77 72 69 74 65 20 | 74 6f 20 74 68 65 20 46 |, write |to the F|
|00005310| 72 65 65 0a 20 20 20 53 | 6f 66 74 77 61 72 65 20 |ree. S|oftware |
|00005320| 46 6f 75 6e 64 61 74 69 | 6f 6e 2c 20 36 37 35 20 |Foundati|on, 675 |
|00005330| 4d 61 73 73 20 41 76 65 | 2c 20 43 61 6d 62 72 69 |Mass Ave|, Cambri|
|00005340| 64 67 65 2c 20 4d 41 20 | 30 32 31 33 39 2c 20 55 |dge, MA |02139, U|
|00005350| 53 41 2e 20 2a 2f 0a 0a | 23 69 6e 63 6c 75 64 65 |SA. */..|#include|
|00005360| 20 3c 73 74 64 69 6f 2e | 68 3e 0a 23 69 6e 63 6c | <stdio.|h>.#incl|
|00005370| 75 64 65 20 3c 72 65 61 | 64 6c 69 6e 65 2f 72 65 |ude <rea|dline/re|
|00005380| 61 64 6c 69 6e 65 2e 68 | 3e 0a 23 69 6e 63 6c 75 |adline.h|>.#inclu|
|00005390| 64 65 20 3c 72 65 61 64 | 6c 69 6e 65 2f 68 69 73 |de <read|line/his|
|000053a0| 74 6f 72 79 2e 68 3e 0a | 23 69 6e 63 6c 75 64 65 |tory.h>.|#include|
|000053b0| 20 22 73 68 65 6c 6c 2e | 68 22 0a 23 69 6e 63 6c | "shell.|h".#incl|
|000053c0| 75 64 65 20 22 62 75 69 | 6c 74 69 6e 73 2e 68 22 |ude "bui|ltins.h"|
|000053d0| 0a 0a 2f 2a 20 46 75 6e | 63 74 69 6f 6e 73 20 62 |../* Fun|ctions b|
|000053e0| 6f 75 6e 64 20 74 6f 20 | 6b 65 79 73 20 69 6e 20 |ound to |keys in |
|000053f0| 52 65 61 64 6c 69 6e 65 | 20 66 6f 72 20 42 61 73 |Readline| for Bas|
|00005400| 68 20 75 73 65 72 73 2e | 20 2a 2f 0a 73 74 61 74 |h users.| */.stat|
|00005410| 69 63 20 76 6f 69 64 0a | 20 20 73 68 65 6c 6c 5f |ic void.| shell_|
|00005420| 65 78 70 61 6e 64 5f 6c | 69 6e 65 20 28 29 2c 20 |expand_l|ine (), |
|00005430| 69 6e 73 65 72 74 5f 6c | 61 73 74 5f 61 72 67 20 |insert_l|ast_arg |
|00005440| 28 29 2c 20 64 69 73 70 | 6c 61 79 5f 73 68 65 6c |(), disp|lay_shel|
|00005450| 6c 5f 76 65 72 73 69 6f | 6e 20 28 29 2c 0a 20 20 |l_versio|n (),. |
|00005460| 6f 70 65 72 61 74 65 5f | 61 6e 64 5f 67 65 74 5f |operate_|and_get_|
|00005470| 6e 65 78 74 20 28 29 3b | 0a 0a 2f 2a 20 48 65 6c |next ();|../* Hel|
|00005480| 70 65 72 20 66 75 6e 63 | 74 69 6f 6e 73 20 66 6f |per func|tions fo|
|00005490| 72 20 52 65 61 64 6c 69 | 6e 65 2e 20 2a 2f 0a 73 |r Readli|ne. */.s|
|000054a0| 74 61 74 69 63 20 76 6f | 69 64 0a 20 20 62 61 73 |tatic vo|id. bas|
|000054b0| 68 5f 73 79 6d 62 6f 6c | 69 63 5f 6c 69 6e 6b 5f |h_symbol|ic_link_|
|000054c0| 68 6f 6f 6b 20 28 29 2c | 20 66 69 6c 65 6e 61 6d |hook (),| filenam|
|000054d0| 65 5f 63 6f 6d 70 6c 65 | 74 69 6f 6e 5f 69 67 6e |e_comple|tion_ign|
|000054e0| 6f 72 65 20 28 29 2c 20 | 62 61 73 68 5f 70 75 73 |ore (), |bash_pus|
|000054f0| 68 5f 6c 69 6e 65 20 28 | 29 3b 0a 0a 73 74 61 74 |h_line (|);..stat|
|00005500| 69 63 20 63 68 61 72 0a | 20 20 2a 2a 61 74 74 65 |ic char.| **atte|
|00005510| 6d 70 74 5f 73 68 65 6c | 6c 5f 63 6f 6d 70 6c 65 |mpt_shel|l_comple|
|00005520| 74 69 6f 6e 20 28 29 2c | 20 2a 76 61 72 69 61 62 |tion (),| *variab|
|00005530| 6c 65 5f 63 6f 6d 70 6c | 65 74 69 6f 6e 5f 66 75 |le_compl|etion_fu|
|00005540| 6e 63 74 69 6f 6e 20 28 | 29 2c 0a 20 20 2a 68 6f |nction (|),. *ho|
|00005550| 73 74 6e 61 6d 65 5f 63 | 6f 6d 70 6c 65 74 69 6f |stname_c|ompletio|
|00005560| 6e 5f 66 75 6e 63 74 69 | 6f 6e 20 28 29 2c 20 2a |n_functi|on (), *|
|00005570| 63 6f 6d 6d 61 6e 64 5f | 77 6f 72 64 5f 63 6f 6d |command_|word_com|
|00005580| 70 6c 65 74 69 6f 6e 5f | 66 75 6e 63 74 69 6f 6e |pletion_|function|
|00005590| 20 28 29 3b 0a 0a 73 74 | 61 74 69 63 20 76 6f 69 | ();..st|atic voi|
|000055a0| 64 0a 20 20 73 6e 61 72 | 66 5f 68 6f 73 74 73 5f |d. snar|f_hosts_|
|000055b0| 66 72 6f 6d 5f 66 69 6c | 65 20 28 29 2c 20 61 64 |from_fil|e (), ad|
|000055c0| 64 5f 68 6f 73 74 5f 6e | 61 6d 65 20 28 29 2c 20 |d_host_n|ame (), |
|000055d0| 73 6f 72 74 5f 68 6f 73 | 74 6e 61 6d 65 5f 6c 69 |sort_hos|tname_li|
|000055e0| 73 74 20 28 29 3b 0a 0a | 2f 2a 20 45 78 74 65 72 |st ();..|/* Exter|
|000055f0| 6e 61 6c 6c 79 20 64 65 | 66 69 6e 65 64 20 66 75 |nally de|fined fu|
|00005600| 6e 63 74 69 6f 6e 73 20 | 75 73 65 64 20 62 79 20 |nctions |used by |
|00005610| 74 68 69 73 20 66 69 6c | 65 2e 20 2a 2f 0a 65 78 |this fil|e. */.ex|
|00005620| 74 65 72 6e 20 63 68 61 | 72 0a 20 20 2a 67 65 74 |tern cha|r. *get|
|00005630| 5f 73 74 72 69 6e 67 5f | 76 61 6c 75 65 20 28 29 |_string_|value ()|
|00005640| 2c 20 2a 66 69 6c 65 6e | 61 6d 65 5f 63 6f 6d 70 |, *filen|ame_comp|
|00005650| 6c 65 74 69 6f 6e 5f 66 | 75 6e 63 74 69 6f 6e 20 |letion_f|unction |
|00005660| 28 29 2c 0a 20 20 2a 75 | 73 65 72 6e 61 6d 65 5f |(),. *u|sername_|
|00005670| 63 6f 6d 70 6c 65 74 69 | 6f 6e 5f 66 75 6e 63 74 |completi|on_funct|
|00005680| 69 6f 6e 20 28 29 3b 0a | 0a 65 78 74 65 72 6e 20 |ion ();.|.extern |
|00005690| 69 6e 74 20 73 68 6f 77 | 5f 73 68 65 6c 6c 5f 76 |int show|_shell_v|
|000056a0| 65 72 73 69 6f 6e 20 28 | 29 3b 0a 0a 23 64 65 66 |ersion (|);..#def|
|000056b0| 69 6e 65 20 44 59 4e 41 | 4d 49 43 5f 48 49 53 54 |ine DYNA|MIC_HIST|
|000056c0| 4f 52 59 5f 43 4f 4d 50 | 4c 45 54 49 4f 4e 0a 23 |ORY_COMP|LETION.#|
|000056d0| 69 66 20 64 65 66 69 6e | 65 64 20 28 44 59 4e 41 |if defin|ed (DYNA|
|000056e0| 4d 49 43 5f 48 49 53 54 | 4f 52 59 5f 43 4f 4d 50 |MIC_HIST|ORY_COMP|
|000056f0| 4c 45 54 49 4f 4e 29 0a | 73 74 61 74 69 63 20 76 |LETION).|static v|
|00005700| 6f 69 64 20 64 79 6e 61 | 6d 69 63 5f 63 6f 6d 70 |oid dyna|mic_comp|
|00005710| 6c 65 74 65 5f 68 69 73 | 74 6f 72 79 20 28 29 3b |lete_his|tory ();|
|00005720| 0a 23 65 6e 64 69 66 20 | 2f 2a 20 44 59 4e 41 4d |.#endif |/* DYNAM|
|00005730| 49 43 5f 48 49 53 54 4f | 52 59 5f 43 4f 4d 50 4c |IC_HISTO|RY_COMPL|
|00005740| 45 54 49 4f 4e 20 2a 2f | 0a 0a 2f 2a 20 53 50 45 |ETION */|../* SPE|
|00005750| 43 49 46 49 43 5f 43 4f | 4d 50 4c 45 54 49 4f 4e |CIFIC_CO|MPLETION|
|00005760| 5f 46 55 4e 43 54 49 4f | 4e 53 20 73 70 65 63 69 |_FUNCTIO|NS speci|
|00005770| 66 69 65 73 20 74 68 61 | 74 20 77 65 20 68 61 76 |fies tha|t we hav|
|00005780| 65 20 69 6e 64 69 76 69 | 64 75 61 6c 0a 20 20 20 |e indivi|dual. |
|00005790| 63 6f 6d 70 6c 65 74 69 | 6f 6e 20 66 75 6e 63 74 |completi|on funct|
|000057a0| 69 6f 6e 73 20 77 68 69 | 63 68 20 69 6e 64 69 63 |ions whi|ch indic|
|000057b0| 61 74 65 20 77 68 61 74 | 20 74 79 70 65 20 6f 66 |ate what| type of|
|000057c0| 20 63 6f 6d 70 6c 65 74 | 69 6f 6e 20 73 68 6f 75 | complet|ion shou|
|000057d0| 6c 64 20 62 65 0a 20 20 | 20 64 6f 6e 65 20 28 61 |ld be. | done (a|
|000057e0| 74 20 6f 72 20 62 65 66 | 6f 72 65 20 70 6f 69 6e |t or bef|ore poin|
|000057f0| 74 29 20 74 68 61 74 20 | 63 61 6e 20 62 65 20 62 |t) that |can be b|
|00005800| 6f 75 6e 64 20 74 6f 20 | 6b 65 79 20 73 65 71 75 |ound to |key sequ|
|00005810| 65 6e 63 65 73 20 77 69 | 74 68 0a 20 20 20 74 68 |ences wi|th. th|
|00005820| 65 20 72 65 61 64 6c 69 | 6e 65 20 6c 69 62 72 61 |e readli|ne libra|
|00005830| 72 79 2e 20 2a 2f 0a 23 | 64 65 66 69 6e 65 20 53 |ry. */.#|define S|
|00005840| 50 45 43 49 46 49 43 5f | 43 4f 4d 50 4c 45 54 49 |PECIFIC_|COMPLETI|
|00005850| 4f 4e 5f 46 55 4e 43 54 | 49 4f 4e 53 0a 0a 23 69 |ON_FUNCT|IONS..#i|
|00005860| 66 20 64 65 66 69 6e 65 | 64 20 28 53 50 45 43 49 |f define|d (SPECI|
|00005870| 46 49 43 5f 43 4f 4d 50 | 4c 45 54 49 4f 4e 5f 46 |FIC_COMP|LETION_F|
|00005880| 55 4e 43 54 49 4f 4e 53 | 29 0a 73 74 61 74 69 63 |UNCTIONS|).static|
|00005890| 20 76 6f 69 64 0a 20 20 | 62 61 73 68 5f 73 70 65 | void. |bash_spe|
|000058a0| 63 69 66 69 63 5f 63 6f | 6d 70 6c 65 74 69 6f 6e |cific_co|mpletion|
|000058b0| 20 28 29 2c 0a 20 20 62 | 61 73 68 5f 63 6f 6d 70 | (),. b|ash_comp|
|000058c0| 6c 65 74 65 5f 66 69 6c | 65 6e 61 6d 65 20 28 29 |lete_fil|ename ()|
|000058d0| 2c 20 62 61 73 68 5f 70 | 6f 73 73 69 62 6c 65 5f |, bash_p|ossible_|
|000058e0| 66 69 6c 65 6e 61 6d 65 | 5f 63 6f 6d 70 6c 65 74 |filename|_complet|
|000058f0| 69 6f 6e 73 20 28 29 2c | 0a 20 20 62 61 73 68 5f |ions (),|. bash_|
|00005900| 63 6f 6d 70 6c 65 74 65 | 5f 66 69 6c 65 6e 61 6d |complete|_filenam|
|00005910| 65 5f 69 6e 74 65 72 6e | 61 6c 20 28 29 2c 0a 20 |e_intern|al (),. |
|00005920| 20 62 61 73 68 5f 63 6f | 6d 70 6c 65 74 65 5f 75 | bash_co|mplete_u|
|00005930| 73 65 72 6e 61 6d 65 20 | 28 29 2c 20 62 61 73 68 |sername |(), bash|
|00005940| 5f 70 6f 73 73 69 62 6c | 65 5f 75 73 65 72 6e 61 |_possibl|e_userna|
|00005950| 6d 65 5f 63 6f 6d 70 6c | 65 74 69 6f 6e 73 20 28 |me_compl|etions (|
|00005960| 29 2c 0a 20 20 62 61 73 | 68 5f 63 6f 6d 70 6c 65 |),. bas|h_comple|
|00005970| 74 65 5f 75 73 65 72 6e | 61 6d 65 5f 69 6e 74 65 |te_usern|ame_inte|
|00005980| 72 6e 61 6c 20 28 29 2c | 0a 20 20 62 61 73 68 5f |rnal (),|. bash_|
|00005990| 63 6f 6d 70 6c 65 74 65 | 5f 68 6f 73 74 6e 61 6d |complete|_hostnam|
|000059a0| 65 20 28 29 2c 20 62 61 | 73 68 5f 70 6f 73 73 69 |e (), ba|sh_possi|
|000059b0| 62 6c 65 5f 68 6f 73 74 | 6e 61 6d 65 5f 63 6f 6d |ble_host|name_com|
|000059c0| 70 6c 65 74 69 6f 6e 73 | 20 28 29 2c 0a 20 20 62 |pletions| (),. b|
|000059d0| 61 73 68 5f 63 6f 6d 70 | 6c 65 74 65 5f 68 6f 73 |ash_comp|lete_hos|
|000059e0| 74 6e 61 6d 65 5f 69 6e | 74 65 72 6e 61 6c 20 28 |tname_in|ternal (|
|000059f0| 29 2c 0a 20 20 62 61 73 | 68 5f 63 6f 6d 70 6c 65 |),. bas|h_comple|
|00005a00| 74 65 5f 76 61 72 69 61 | 62 6c 65 20 28 29 2c 20 |te_varia|ble (), |
|00005a10| 62 61 73 68 5f 70 6f 73 | 73 69 62 6c 65 5f 76 61 |bash_pos|sible_va|
|00005a20| 72 69 61 62 6c 65 5f 63 | 6f 6d 70 6c 65 74 69 6f |riable_c|ompletio|
|00005a30| 6e 73 20 28 29 2c 0a 20 | 20 62 61 73 68 5f 63 6f |ns (),. | bash_co|
|00005a40| 6d 70 6c 65 74 65 5f 76 | 61 72 69 61 62 6c 65 5f |mplete_v|ariable_|
|00005a50| 69 6e 74 65 72 6e 61 6c | 20 28 29 2c 0a 20 20 62 |internal| (),. b|
|00005a60| 61 73 68 5f 63 6f 6d 70 | 6c 65 74 65 5f 63 6f 6d |ash_comp|lete_com|
|00005a70| 6d 61 6e 64 20 28 29 2c | 20 62 61 73 68 5f 70 6f |mand (),| bash_po|
|00005a80| 73 73 69 62 6c 65 5f 63 | 6f 6d 6d 61 6e 64 5f 63 |ssible_c|ommand_c|
|00005a90| 6f 6d 70 6c 65 74 69 6f | 6e 73 20 28 29 2c 0a 20 |ompletio|ns (),. |
|00005aa0| 20 62 61 73 68 5f 63 6f | 6d 70 6c 65 74 65 5f 63 | bash_co|mplete_c|
|00005ab0| 6f 6d 6d 61 6e 64 5f 69 | 6e 74 65 72 6e 61 6c 20 |ommand_i|nternal |
|00005ac0| 28 29 3b 0a 23 65 6e 64 | 69 66 20 2f 2a 20 53 50 |();.#end|if /* SP|
|00005ad0| 45 43 49 46 49 43 5f 43 | 4f 4d 50 4c 45 54 49 4f |ECIFIC_C|OMPLETIO|
|00005ae0| 4e 5f 46 55 4e 43 54 49 | 4f 4e 53 20 2a 2f 0a 0a |N_FUNCTI|ONS */..|
|00005af0| 2f 2a 20 4e 6f 6e 2d 7a | 65 72 6f 20 6f 6e 63 65 |/* Non-z|ero once|
|00005b00| 20 69 6e 69 74 61 6c 69 | 7a 65 5f 72 65 61 64 6c | initali|ze_readl|
|00005b10| 69 6e 65 20 28 29 20 68 | 61 73 20 62 65 65 6e 20 |ine () h|as been |
|00005b20| 63 61 6c 6c 65 64 2e 20 | 2a 2f 0a 69 6e 74 20 62 |called. |*/.int b|
|00005b30| 61 73 68 5f 72 65 61 64 | 6c 69 6e 65 5f 69 6e 69 |ash_read|line_ini|
|00005b40| 74 69 61 6c 69 7a 65 64 | 20 3d 20 30 3b 0a 0a 2f |tialized| = 0;../|
|00005b50| 2a 20 43 61 6c 6c 65 64 | 20 6f 6e 63 65 20 66 72 |* Called| once fr|
|00005b60| 6f 6d 20 70 61 72 73 65 | 2e 79 20 69 66 20 77 65 |om parse|.y if we|
|00005b70| 20 61 72 65 20 67 6f 69 | 6e 67 20 74 6f 20 75 73 | are goi|ng to us|
|00005b80| 65 20 72 65 61 64 6c 69 | 6e 65 2e 20 2a 2f 0a 69 |e readli|ne. */.i|
|00005b90| 6e 69 74 69 61 6c 69 7a | 65 5f 72 65 61 64 6c 69 |nitializ|e_readli|
|00005ba0| 6e 65 20 28 29 0a 7b 0a | 20 20 69 66 20 28 62 61 |ne ().{.| if (ba|
|00005bb0| 73 68 5f 72 65 61 64 6c | 69 6e 65 5f 69 6e 69 74 |sh_readl|ine_init|
|00005bc0| 69 61 6c 69 7a 65 64 29 | 0a 20 20 20 20 72 65 74 |ialized)|. ret|
|00005bd0| 75 72 6e 3b 0a 0a 20 20 | 72 6c 5f 74 65 72 6d 69 |urn;.. |rl_termi|
|00005be0| 6e 61 6c 5f 6e 61 6d 65 | 20 3d 20 67 65 74 5f 73 |nal_name| = get_s|
|00005bf0| 74 72 69 6e 67 5f 76 61 | 6c 75 65 20 28 22 54 45 |tring_va|lue ("TE|
|00005c00| 52 4d 22 29 3b 0a 20 20 | 72 6c 5f 69 6e 73 74 72 |RM");. |rl_instr|
|00005c10| 65 61 6d 20 3d 20 73 74 | 64 69 6e 2c 20 72 6c 5f |eam = st|din, rl_|
|00005c20| 6f 75 74 73 74 72 65 61 | 6d 20 3d 20 73 74 64 65 |outstrea|m = stde|
|00005c30| 72 72 3b 0a 20 20 72 6c | 5f 73 70 65 63 69 61 6c |rr;. rl|_special|
|00005c40| 5f 70 72 65 66 69 78 65 | 73 20 3d 20 22 24 40 25 |_prefixe|s = "$@%|
|00005c50| 22 3b 0a 0a 20 20 2f 2a | 20 41 6c 6c 6f 77 20 63 |";.. /*| Allow c|
|00005c60| 6f 6e 64 69 74 69 6f 6e | 61 6c 20 70 61 72 73 69 |ondition|al parsi|
|00005c70| 6e 67 20 6f 66 20 74 68 | 65 20 7e 2f 2e 69 6e 70 |ng of th|e ~/.inp|
|00005c80| 75 74 72 63 20 66 69 6c | 65 2e 20 2a 2f 0a 20 20 |utrc fil|e. */. |
|00005c90| 72 6c 5f 72 65 61 64 6c | 69 6e 65 5f 6e 61 6d 65 |rl_readl|ine_name|
|00005ca0| 20 3d 20 22 42 61 73 68 | 22 3b 0a 0a 20 20 2f 2a | = "Bash|";.. /*|
|00005cb0| 20 42 69 6e 64 20 75 70 | 20 6f 75 72 20 73 70 65 | Bind up| our spe|
|00005cc0| 63 69 61 6c 20 73 68 65 | 6c 6c 20 66 75 6e 63 74 |cial she|ll funct|
|00005cd0| 69 6f 6e 73 2e 20 2a 2f | 0a 20 20 72 6c 5f 61 64 |ions. */|. rl_ad|
|00005ce0| 64 5f 64 65 66 75 6e 0a | 20 20 20 20 28 22 73 68 |d_defun.| ("sh|
|00005cf0| 65 6c 6c 2d 65 78 70 61 | 6e 64 2d 6c 69 6e 65 22 |ell-expa|nd-line"|
|00005d00| 2c 20 28 46 75 6e 63 74 | 69 6f 6e 20 2a 29 73 68 |, (Funct|ion *)sh|
|00005d10| 65 6c 6c 5f 65 78 70 61 | 6e 64 5f 6c 69 6e 65 2c |ell_expa|nd_line,|
|00005d20| 20 4d 45 54 41 28 43 54 | 52 4c 28 27 45 27 29 29 | META(CT|RL('E'))|
|00005d30| 29 3b 0a 0a 20 20 72 6c | 5f 61 64 64 5f 64 65 66 |);.. rl|_add_def|
|00005d40| 75 6e 0a 20 20 20 20 28 | 22 69 6e 73 65 72 74 2d |un. (|"insert-|
|00005d50| 6c 61 73 74 2d 61 72 67 | 75 6d 65 6e 74 22 2c 20 |last-arg|ument", |
|00005d60| 28 46 75 6e 63 74 69 6f | 6e 20 2a 29 69 6e 73 65 |(Functio|n *)inse|
|00005d70| 72 74 5f 6c 61 73 74 5f | 61 72 67 2c 20 4d 45 54 |rt_last_|arg, MET|
|00005d80| 41 28 27 2e 27 29 29 3b | 0a 0a 20 20 72 6c 5f 62 |A('.'));|.. rl_b|
|00005d90| 69 6e 64 5f 6b 65 79 20 | 28 4d 45 54 41 28 27 5f |ind_key |(META('_|
|00005da0| 27 29 2c 20 28 46 75 6e | 63 74 69 6f 6e 20 2a 29 |'), (Fun|ction *)|
|00005db0| 69 6e 73 65 72 74 5f 6c | 61 73 74 5f 61 72 67 29 |insert_l|ast_arg)|
|00005dc0| 3b 0a 0a 20 20 72 6c 5f | 61 64 64 5f 64 65 66 75 |;.. rl_|add_defu|
|00005dd0| 6e 0a 20 20 20 20 28 22 | 6f 70 65 72 61 74 65 2d |n. ("|operate-|
|00005de0| 61 6e 64 2d 67 65 74 2d | 6e 65 78 74 22 2c 20 28 |and-get-|next", (|
|00005df0| 46 75 6e 63 74 69 6f 6e | 20 2a 29 6f 70 65 72 61 |Function| *)opera|
|00005e00| 74 65 5f 61 6e 64 5f 67 | 65 74 5f 6e 65 78 74 2c |te_and_g|et_next,|
|00005e10| 20 43 54 52 4c 28 27 4f | 27 29 29 3b 0a 0a 20 20 | CTRL('O|'));.. |
|00005e20| 72 6c 5f 61 64 64 5f 64 | 65 66 75 6e 0a 20 20 20 |rl_add_d|efun. |
|00005e30| 20 28 22 64 69 73 70 6c | 61 79 2d 73 68 65 6c 6c | ("displ|ay-shell|
|00005e40| 2d 76 65 72 73 69 6f 6e | 22 2c 20 28 46 75 6e 63 |-version|", (Func|
|00005e50| 74 69 6f 6e 20 2a 29 64 | 69 73 70 6c 61 79 5f 73 |tion *)d|isplay_s|
|00005e60| 68 65 6c 6c 5f 76 65 72 | 73 69 6f 6e 2c 20 2d 31 |hell_ver|sion, -1|
|00005e70| 29 3b 0a 0a 20 20 72 6c | 5f 62 69 6e 64 5f 6b 65 |);.. rl|_bind_ke|
|00005e80| 79 5f 69 6e 5f 6d 61 70 | 0a 20 20 20 20 28 43 54 |y_in_map|. (CT|
|00005e90| 52 4c 20 28 27 56 27 29 | 2c 20 28 46 75 6e 63 74 |RL ('V')|, (Funct|
|00005ea0| 69 6f 6e 20 2a 29 64 69 | 73 70 6c 61 79 5f 73 68 |ion *)di|splay_sh|
|00005eb0| 65 6c 6c 5f 76 65 72 73 | 69 6f 6e 2c 20 65 6d 61 |ell_vers|ion, ema|
|00005ec0| 63 73 5f 63 74 6c 78 5f | 6b 65 79 6d 61 70 29 3b |cs_ctlx_|keymap);|
|00005ed0| 0a 0a 20 20 2f 2a 20 49 | 6e 20 42 61 73 68 2c 20 |.. /* I|n Bash, |
|00005ee0| 74 68 65 20 75 73 65 72 | 20 63 61 6e 20 73 77 69 |the user| can swi|
|00005ef0| 74 63 68 20 65 64 69 74 | 69 6e 67 20 6d 6f 64 65 |tch edit|ing mode|
|00005f00| 73 20 77 69 74 68 20 22 | 73 65 74 20 2d 6f 20 5b |s with "|set -o [|
|00005f10| 76 69 20 65 6d 61 63 73 | 5d 22 2c 0a 20 20 20 20 |vi emacs|]",. |
|00005f20| 20 73 6f 20 69 74 20 69 | 73 20 6e 6f 74 20 6e 65 | so it i|s not ne|
|00005f30| 63 65 73 73 61 72 79 20 | 74 6f 20 61 6c 6c 6f 77 |cessary |to allow|
|00005f40| 20 43 2d 4d 2d 6a 20 66 | 6f 72 20 63 6f 6e 74 65 | C-M-j f|or conte|
|00005f50| 78 74 20 73 77 69 74 63 | 68 69 6e 67 2e 20 20 54 |xt switc|hing. T|
|00005f60| 75 72 6e 0a 20 20 20 20 | 20 6f 66 66 20 74 68 69 |urn. | off thi|
|00005f70| 73 20 6f 63 63 61 73 69 | 6f 6e 61 6c 6c 79 20 63 |s occasi|onally c|
|00005f80| 6f 6e 66 75 73 69 6e 67 | 20 62 65 68 61 76 69 6f |onfusing| behavio|
|00005f90| 75 72 2e 20 2a 2f 0a 20 | 20 72 6c 5f 75 6e 62 69 |ur. */. | rl_unbi|
|00005fa0| 6e 64 5f 6b 65 79 5f 69 | 6e 5f 6d 61 70 20 28 43 |nd_key_i|n_map (C|
|00005fb0| 54 52 4c 28 27 4a 27 29 | 2c 20 65 6d 61 63 73 5f |TRL('J')|, emacs_|
|00005fc0| 6d 65 74 61 5f 6b 65 79 | 6d 61 70 29 3b 0a 0a 23 |meta_key|map);..#|
|00005fd0| 69 66 64 65 66 20 53 50 | 45 43 49 46 49 43 5f 43 |ifdef SP|ECIFIC_C|
|00005fe0| 4f 4d 50 4c 45 54 49 4f | 4e 5f 46 55 4e 43 54 49 |OMPLETIO|N_FUNCTI|
|00005ff0| 4f 4e 53 0a 20 20 72 6c | 5f 61 64 64 5f 64 65 66 |ONS. rl|_add_def|
|00006000| 75 6e 20 28 22 63 6f 6d | 70 6c 65 74 65 2d 66 69 |un ("com|plete-fi|
|00006010| 6c 65 6e 61 6d 65 22 2c | 20 62 61 73 68 5f 63 6f |lename",| bash_co|
|00006020| 6d 70 6c 65 74 65 5f 66 | 69 6c 65 6e 61 6d 65 2c |mplete_f|ilename,|
|00006030| 20 4d 45 54 41 28 27 2f | 27 29 29 3b 0a 20 20 72 | META('/|'));. r|
|00006040| 6c 5f 61 64 64 5f 64 65 | 66 75 6e 20 28 22 70 6f |l_add_de|fun ("po|
|00006050| 73 73 69 62 6c 65 2d 66 | 69 6c 65 6e 61 6d 65 2d |ssible-f|ilename-|
|00006060| 63 6f 6d 70 6c 65 74 69 | 6f 6e 73 22 2c 0a 09 09 |completi|ons",...|
|00006070| 62 61 73 68 5f 70 6f 73 | 73 69 62 6c 65 5f 66 69 |bash_pos|sible_fi|
|00006080| 6c 65 6e 61 6d 65 5f 63 | 6f 6d 70 6c 65 74 69 6f |lename_c|ompletio|
|00006090| 6e 73 2c 20 2d 31 29 3b | 0a 20 20 72 6c 5f 62 69 |ns, -1);|. rl_bi|
|000060a0| 6e 64 5f 6b 65 79 5f 69 | 6e 5f 6d 61 70 20 28 27 |nd_key_i|n_map ('|
|000060b0| 2f 27 2c 20 62 61 73 68 | 5f 70 6f 73 73 69 62 6c |/', bash|_possibl|
|000060c0| 65 5f 66 69 6c 65 6e 61 | 6d 65 5f 63 6f 6d 70 6c |e_filena|me_compl|
|000060d0| 65 74 69 6f 6e 73 2c 0a | 09 09 20 20 20 20 20 20 |etions,.|.. |
|000060e0| 65 6d 61 63 73 5f 63 74 | 6c 78 5f 6b 65 79 6d 61 |emacs_ct|lx_keyma|
|000060f0| 70 29 3b 0a 0a 20 20 72 | 6c 5f 61 64 64 5f 64 65 |p);.. r|l_add_de|
|00006100| 66 75 6e 20 28 22 63 6f | 6d 70 6c 65 74 65 2d 75 |fun ("co|mplete-u|
|00006110| 73 65 72 6e 61 6d 65 22 | 2c 20 62 61 73 68 5f 63 |sername"|, bash_c|
|00006120| 6f 6d 70 6c 65 74 65 5f | 75 73 65 72 6e 61 6d 65 |omplete_|username|
|00006130| 2c 20 4d 45 54 41 28 27 | 7e 27 29 29 3b 0a 20 20 |, META('|~'));. |
|00006140| 72 6c 5f 61 64 64 5f 64 | 65 66 75 6e 20 28 22 70 |rl_add_d|efun ("p|
|00006150| 6f 73 73 69 62 6c 65 2d | 75 73 65 72 6e 61 6d 65 |ossible-|username|
|00006160| 2d 63 6f 6d 70 6c 65 74 | 69 6f 6e 73 22 2c 0a 09 |-complet|ions",..|
|00006170| 09 62 61 73 68 5f 70 6f | 73 73 69 62 6c 65 5f 75 |.bash_po|ssible_u|
|00006180| 73 65 72 6e 61 6d 65 5f | 63 6f 6d 70 6c 65 74 69 |sername_|completi|
|00006190| 6f 6e 73 2c 20 2d 31 29 | 3b 0a 20 20 72 6c 5f 62 |ons, -1)|;. rl_b|
|000061a0| 69 6e 64 5f 6b 65 79 5f | 69 6e 5f 6d 61 70 20 28 |ind_key_|in_map (|
|000061b0| 27 7e 27 2c 20 62 61 73 | 68 5f 70 6f 73 73 69 62 |'~', bas|h_possib|
|000061c0| 6c 65 5f 75 73 65 72 6e | 61 6d 65 5f 63 6f 6d 70 |le_usern|ame_comp|
|000061d0| 6c 65 74 69 6f 6e 73 2c | 0a 09 09 20 20 20 20 20 |letions,|... |
|000061e0| 20 65 6d 61 63 73 5f 63 | 74 6c 78 5f 6b 65 79 6d | emacs_c|tlx_keym|
|000061f0| 61 70 29 3b 0a 0a 20 20 | 72 6c 5f 61 64 64 5f 64 |ap);.. |rl_add_d|
|00006200| 65 66 75 6e 20 28 22 63 | 6f 6d 70 6c 65 74 65 2d |efun ("c|omplete-|
|00006210| 68 6f 73 74 6e 61 6d 65 | 22 2c 20 62 61 73 68 5f |hostname|", bash_|
|00006220| 63 6f 6d 70 6c 65 74 65 | 5f 68 6f 73 74 6e 61 6d |complete|_hostnam|
|00006230| 65 2c 20 4d 45 54 41 28 | 27 40 27 29 29 3b 0a 20 |e, META(|'@'));. |
|00006240| 20 72 6c 5f 61 64 64 5f | 64 65 66 75 6e 20 28 22 | rl_add_|defun ("|
|00006250| 70 6f 73 73 69 62 6c 65 | 2d 68 6f 73 74 6e 61 6d |possible|-hostnam|
|00006260| 65 2d 63 6f 6d 70 6c 65 | 74 69 6f 6e 73 22 2c 0a |e-comple|tions",.|
|00006270| 09 09 62 61 73 68 5f 70 | 6f 73 73 69 62 6c 65 5f |..bash_p|ossible_|
|00006280| 68 6f 73 74 6e 61 6d 65 | 5f 63 6f 6d 70 6c 65 74 |hostname|_complet|
|00006290| 69 6f 6e 73 2c 20 2d 31 | 29 3b 0a 20 20 72 6c 5f |ions, -1|);. rl_|
|000062a0| 62 69 6e 64 5f 6b 65 79 | 5f 69 6e 5f 6d 61 70 20 |bind_key|_in_map |
|000062b0| 28 27 40 27 2c 20 62 61 | 73 68 5f 70 6f 73 73 69 |('@', ba|sh_possi|
|000062c0| 62 6c 65 5f 68 6f 73 74 | 6e 61 6d 65 5f 63 6f 6d |ble_host|name_com|
|000062d0| 70 6c 65 74 69 6f 6e 73 | 2c 0a 09 09 20 20 20 20 |pletions|,... |
|000062e0| 20 20 65 6d 61 63 73 5f | 63 74 6c 78 5f 6b 65 79 | emacs_|ctlx_key|
|000062f0| 6d 61 70 29 3b 0a 0a 20 | 20 72 6c 5f 61 64 64 5f |map);.. | rl_add_|
|00006300| 64 65 66 75 6e 20 28 22 | 63 6f 6d 70 6c 65 74 65 |defun ("|complete|
|00006310| 2d 76 61 72 69 61 62 6c | 65 22 2c 20 62 61 73 68 |-variabl|e", bash|
|00006320| 5f 63 6f 6d 70 6c 65 74 | 65 5f 76 61 72 69 61 62 |_complet|e_variab|
|00006330| 6c 65 2c 20 4d 45 54 41 | 28 27 24 27 29 29 3b 0a |le, META|('$'));.|
|00006340| 20 20 72 6c 5f 61 64 64 | 5f 64 65 66 75 6e 20 28 | rl_add|_defun (|
|00006350| 22 70 6f 73 73 69 62 6c | 65 2d 76 61 72 69 61 62 |"possibl|e-variab|
|00006360| 6c 65 2d 63 6f 6d 70 6c | 65 74 69 6f 6e 73 22 2c |le-compl|etions",|
|00006370| 0a 09 09 62 61 73 68 5f | 70 6f 73 73 69 62 6c 65 |...bash_|possible|
|00006380| 5f 76 61 72 69 61 62 6c | 65 5f 63 6f 6d 70 6c 65 |_variabl|e_comple|
|00006390| 74 69 6f 6e 73 2c 20 2d | 31 29 3b 0a 20 20 72 6c |tions, -|1);. rl|
|000063a0| 5f 62 69 6e 64 5f 6b 65 | 79 5f 69 6e 5f 6d 61 70 |_bind_ke|y_in_map|
|000063b0| 20 28 27 24 27 2c 20 62 | 61 73 68 5f 70 6f 73 73 | ('$', b|ash_poss|
|000063c0| 69 62 6c 65 5f 76 61 72 | 69 61 62 6c 65 5f 63 6f |ible_var|iable_co|
|000063d0| 6d 70 6c 65 74 69 6f 6e | 73 2c 0a 09 09 20 20 20 |mpletion|s,... |
|000063e0| 20 20 20 65 6d 61 63 73 | 5f 63 74 6c 78 5f 6b 65 | emacs|_ctlx_ke|
|000063f0| 79 6d 61 70 29 3b 0a 0a | 20 20 72 6c 5f 61 64 64 |ymap);..| rl_add|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.