1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328
|
_B_A_S_H___B_U_I_L_T_I_N_S(1) General Commands Manual _B_A_S_H___B_U_I_L_T_I_N_S(1)
NNAAMMEE
:, ., [, alias, bg, bind, break, builtin, caller, cd, command, compgen,
complete, compopt, continue, declare, dirs, disown, echo, enable, eval,
exec, exit, export, false, fc, fg, getopts, hash, help, history, jobs,
kill, let, local, logout, mapfile, popd, printf, pushd, pwd, read,
readarray, readonly, return, set, shift, shopt, source, suspend, test,
times, trap, true, type, typeset, ulimit, umask, unalias, unset, wait -
bash built-in commands, see bbaasshh(1)
BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
Unless otherwise noted, each builtin command documented in this section
as accepting options preceded by -- accepts ---- to signify the end of the
options. The ::, ttrruuee, ffaallssee, and tteesstt/[[ builtins do not accept options
and do not treat ---- specially. The eexxiitt, llooggoouutt, rreettuurrnn, bbrreeaakk, ccoonn--
ttiinnuuee, lleett, and sshhiifftt builtins accept and process arguments beginning
with -- without requiring ----. Other builtins that accept arguments but
are not specified as accepting options interpret arguments beginning
with -- as invalid options and require ---- to prevent this interpreta-
tion.
:: [_a_r_g_u_m_e_n_t_s]
No effect; the command does nothing beyond expanding _a_r_g_u_m_e_n_t_s
and performing any specified redirections. The return status is
zero.
.. [--pp _p_a_t_h] _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s]
ssoouurrccee [--pp _p_a_t_h] _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s]
The .. command (ssoouurrccee) reads and execute commands from _f_i_l_e_n_a_m_e
in the current shell environment and returns the exit status of
the last command executed from _f_i_l_e_n_a_m_e.
If _f_i_l_e_n_a_m_e does not contain a slash, .. searches for it. If the
--pp option is supplied, .. treats _p_a_t_h as a colon-separated list
of directories in which to find _f_i_l_e_n_a_m_e; otherwise, .. uses the
entries in PPAATTHH to find the directory containing _f_i_l_e_n_a_m_e.
_f_i_l_e_n_a_m_e does not need to be executable. When bbaasshh is not in
posix mode, it searches the current directory if _f_i_l_e_n_a_m_e is not
found in PPAATTHH, but does not search the current directory if --pp
is supplied. If the ssoouurrcceeppaatthh option to the sshhoopptt builtin com-
mand is turned off, .. does not search PPAATTHH.
If any _a_r_g_u_m_e_n_t_s are supplied, they become the positional para-
meters when _f_i_l_e_n_a_m_e is executed. Otherwise the positional pa-
rameters are unchanged.
If the --TT option is enabled, .. inherits any trap on DDEEBBUUGG; if it
is not, any DDEEBBUUGG trap string is saved and restored around the
call to .., and .. unsets the DDEEBBUUGG trap while it executes. If --TT
is not set, and the sourced file changes the DDEEBBUUGG trap, the new
value persists after .. completes. The return status is the sta-
tus of the last command executed from _f_i_l_e_n_a_m_e (0 if no commands
are executed), and non-zero if _f_i_l_e_n_a_m_e is not found or cannot
be read.
aalliiaass [--pp] [_n_a_m_e[=_v_a_l_u_e] ...]
With no arguments or with the --pp option, aalliiaass prints the list
of aliases in the form aalliiaass _n_a_m_e=_v_a_l_u_e on standard output.
When arguments are supplied, define an alias for each _n_a_m_e whose
_v_a_l_u_e is given. A trailing space in _v_a_l_u_e causes the next word
to be checked for alias substitution when the alias is expanded
during command parsing. For each _n_a_m_e in the argument list for
which no _v_a_l_u_e is supplied, print the name and value of the
alias _n_a_m_e. aalliiaass returns true unless a _n_a_m_e is given (without
a corresponding =_v_a_l_u_e) for which no alias has been defined.
bbgg [_j_o_b_s_p_e_c ...]
Resume each suspended job _j_o_b_s_p_e_c in the background, as if it
had been started with &&. If _j_o_b_s_p_e_c is not present, the shell
uses its notion of the _c_u_r_r_e_n_t _j_o_b. bbgg _j_o_b_s_p_e_c returns 0 unless
run when job control is disabled or, when run with job control
enabled, any specified _j_o_b_s_p_e_c was not found or was started
without job control.
bbiinndd [--mm _k_e_y_m_a_p] [--llssvvSSVVXX]
bbiinndd [--mm _k_e_y_m_a_p] [--qq _f_u_n_c_t_i_o_n] [--uu _f_u_n_c_t_i_o_n] [--rr _k_e_y_s_e_q]
bbiinndd [--mm _k_e_y_m_a_p] --ff _f_i_l_e_n_a_m_e
bbiinndd [--mm _k_e_y_m_a_p] --xx _k_e_y_s_e_q[:] _s_h_e_l_l_-_c_o_m_m_a_n_d
bbiinndd [--mm _k_e_y_m_a_p] _k_e_y_s_e_q:_f_u_n_c_t_i_o_n_-_n_a_m_e
bbiinndd [--mm _k_e_y_m_a_p] --pp|--PP [_r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d]
bbiinndd [--mm _k_e_y_m_a_p] _k_e_y_s_e_q:_r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d
bbiinndd _r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d_-_l_i_n_e
Display current rreeaaddlliinnee key and function bindings, bind a key
sequence to a rreeaaddlliinnee function or macro or to a shell command,
or set a rreeaaddlliinnee variable. Each non-option argument is a key
binding or command as it would appear in a rreeaaddlliinnee initializa-
tion file such as _._i_n_p_u_t_r_c, but each binding or command must be
passed as a separate argument; e.g., \C-x\C-r:
re-read-init-file. In the following descriptions, output avail-
able to be re-read is formatted as commands that would appear in
a rreeaaddlliinnee initialization file or that would be supplied as in-
dividual arguments to a bbiinndd command. Options, if supplied,
have the following meanings:
--mm _k_e_y_m_a_p
Use _k_e_y_m_a_p as the keymap to be affected by the subsequent
bindings. Acceptable _k_e_y_m_a_p names are _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_-
_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_, _v_i_-_c_o_m_m_a_n_d,
and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d (_v_i_-_m_o_v_e
is also a synonym); _e_m_a_c_s is equivalent to _e_m_a_c_s_-_s_t_a_n_-
_d_a_r_d.
--ll List the names of all rreeaaddlliinnee functions.
--pp Display rreeaaddlliinnee function names and bindings in such a
way that they can be used as an argument to a subsequent
bbiinndd command or in a rreeaaddlliinnee initialization file. If
arguments remain after option processing, bbiinndd treats
them as rreeaaddlliinnee command names and restricts output to
those names.
--PP List current rreeaaddlliinnee function names and bindings. If
arguments remain after option processing, bbiinndd treats
them as rreeaaddlliinnee command names and restricts output to
those names.
--ss Display rreeaaddlliinnee key sequences bound to macros and the
strings they output in such a way that they can be used
as an argument to a subsequent bbiinndd command or in a rreeaadd--
lliinnee initialization file.
--SS Display rreeaaddlliinnee key sequences bound to macros and the
strings they output.
--vv Display rreeaaddlliinnee variable names and values in such a way
that they can be used as an argument to a subsequent bbiinndd
command or in a rreeaaddlliinnee initialization file.
--VV List current rreeaaddlliinnee variable names and values.
--ff _f_i_l_e_n_a_m_e
Read key bindings from _f_i_l_e_n_a_m_e.
--qq _f_u_n_c_t_i_o_n
Display key sequences that invoke the named rreeaaddlliinnee
_f_u_n_c_t_i_o_n.
--uu _f_u_n_c_t_i_o_n
Unbind all key sequences bound to the named rreeaaddlliinnee
_f_u_n_c_t_i_o_n.
--rr _k_e_y_s_e_q
Remove any current binding for _k_e_y_s_e_q.
--xx _k_e_y_s_e_q[[:: ]]_s_h_e_l_l_-_c_o_m_m_a_n_d
Cause _s_h_e_l_l_-_c_o_m_m_a_n_d to be executed whenever _k_e_y_s_e_q is en-
tered. The separator between _k_e_y_s_e_q and _s_h_e_l_l_-_c_o_m_m_a_n_d is
either whitespace or a colon optionally followed by
whitespace. If the separator is whitespace, _s_h_e_l_l_-_c_o_m_-
_m_a_n_d must be enclosed in double quotes and rreeaaddlliinnee ex-
pands any of its special backslash-escapes in _s_h_e_l_l_-_c_o_m_-
_m_a_n_d before saving it. If the separator is a colon, any
enclosing double quotes are optional, and rreeaaddlliinnee does
not expand the command string before saving it. Since
the entire key binding expression must be a single argu-
ment, it should be enclosed in single quotes. When
_s_h_e_l_l_-_c_o_m_m_a_n_d is executed, the shell sets the RREEAADD--
LLIINNEE__LLIINNEE variable to the contents of the rreeaaddlliinnee line
buffer and the RREEAADDLLIINNEE__PPOOIINNTT and RREEAADDLLIINNEE__MMAARRKK variables
to the current location of the insertion point and the
saved insertion point (the mark), respectively. The
shell assigns any numeric argument the user supplied to
the RREEAADDLLIINNEE__AARRGGUUMMEENNTT variable. If there was no argu-
ment, that variable is not set. If the executed command
changes the value of any of RREEAADDLLIINNEE__LLIINNEE, RREEAADD--
LLIINNEE__PPOOIINNTT, or RREEAADDLLIINNEE__MMAARRKK, those new values will be
reflected in the editing state.
--XX List all key sequences bound to shell commands and the
associated commands in a format that can be reused as an
argument to a subsequent bbiinndd command.
The return value is 0 unless an unrecognized option is supplied
or an error occurred.
bbrreeaakk [_n]
Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is
specified, bbrreeaakk exits _n enclosing loops. _n must be >= 1. If _n
is greater than the number of enclosing loops, all enclosing
loops are exited. The return value is 0 unless _n is not greater
than or equal to 1.
bbuuiillttiinn _s_h_e_l_l_-_b_u_i_l_t_i_n [_a_r_g_u_m_e_n_t_s]
Execute the specified shell builtin _s_h_e_l_l_-_b_u_i_l_t_i_n, passing it
_a_r_g_u_m_e_n_t_s, and return its exit status. This is useful when
defining a function whose name is the same as a shell builtin,
retaining the functionality of the builtin within the function.
The ccdd builtin is commonly redefined this way. The return sta-
tus is false if _s_h_e_l_l_-_b_u_i_l_t_i_n is not a shell builtin command.
ccaalllleerr [_e_x_p_r]
Returns the context of any active subroutine call (a shell func-
tion or a script executed with the .. or ssoouurrccee builtins).
Without _e_x_p_r, ccaalllleerr displays the line number and source file-
name of the current subroutine call. If a non-negative integer
is supplied as _e_x_p_r, ccaalllleerr displays the line number, subroutine
name, and source file corresponding to that position in the cur-
rent execution call stack. This extra information may be used,
for example, to print a stack trace. The current frame is frame
0.
The return value is 0 unless the shell is not executing a sub-
routine call or _e_x_p_r does not correspond to a valid position in
the call stack.
ccdd [--LL] [--@@] [_d_i_r]
ccdd --PP [--ee] [--@@] [_d_i_r]
Change the current directory to _d_i_r. if _d_i_r is not supplied,
the value of the HHOOMMEE shell variable is used as _d_i_r. The vari-
able CCDDPPAATTHH exists, and _d_i_r does not begin with a slash (/), ccdd
uses it as a search path: the shell searches each directory name
in CCDDPPAATTHH for _d_i_r. Alternative directory names in CCDDPPAATTHH are
separated by a colon (:). A null directory name in CCDDPPAATTHH is
the same as the current directory, i.e.,
The --PP option causes ccdd to use the physical directory structure
by resolving symbolic links while traversing _d_i_r and before pro-
cessing instances of _._. in _d_i_r (see also the --PP option to the
sseett builtin command).
The --LL option forces ccdd to follow symbolic links by resolving
the link after processing instances of _._. in _d_i_r. If _._. appears
in _d_i_r, ccdd processes it by removing the immediately previous
pathname component from _d_i_r, back to a slash or the beginning of
_d_i_r, and verifying that the portion of _d_i_r it has processed to
that point is still a valid directory name after removing the
pathname component. If it is not a valid directory name, ccdd re-
turns a non-zero status. If neither --LL nor --PP is supplied, ccdd
behaves as if --LL had been supplied.
If the --ee option is supplied with --PP, and ccdd cannot successfully
determine the current working directory after a successful di-
rectory change, it returns a non-zero status.
On systems that support it, the --@@ option presents the extended
attributes associated with a file as a directory.
An argument of -- is converted to $$OOLLDDPPWWDD before attempting the
directory change.
If ccdd uses a non-empty directory name from CCDDPPAATTHH, or if -- is
the first argument, and the directory change is successful, ccdd
writes the absolute pathname of the new working directory to the
standard output.
If the directory change is successful, ccdd sets the value of the
PPWWDD environment variable to the new directory name, and sets the
OOLLDDPPWWDD environment variable to the value of the current working
directory before the change.
The return value is true if the directory was successfully
changed; false otherwise.
ccoommmmaanndd [--ppVVvv] _c_o_m_m_a_n_d [_a_r_g ...]
The ccoommmmaanndd builtin runs _c_o_m_m_a_n_d with _a_r_g_s suppressing the nor-
mal shell function lookup for _c_o_m_m_a_n_d. Only builtin commands or
commands found in the PPAATTHH named _c_o_m_m_a_n_d are executed. If the
--pp option is supplied, the search for _c_o_m_m_a_n_d is performed using
a default value for PPAATTHH that is guaranteed to find all of the
standard utilities.
If either the --VV or --vv option is supplied, ccoommmmaanndd prints a de-
scription of _c_o_m_m_a_n_d. The --vv option displays a single word in-
dicating the command or filename used to invoke _c_o_m_m_a_n_d; the --VV
option produces a more verbose description.
If the --VV or --vv option is supplied, the exit status is zero if
_c_o_m_m_a_n_d was found, and non-zero if not. If neither option is
supplied and an error occurred or _c_o_m_m_a_n_d cannot be found, the
exit status is 127. Otherwise, the exit status of the ccoommmmaanndd
builtin is the exit status of _c_o_m_m_a_n_d.
ccoommppggeenn [--VV _v_a_r_n_a_m_e] [_o_p_t_i_o_n] [_w_o_r_d]
Generate possible completion matches for _w_o_r_d according to the
_o_p_t_i_o_ns, which may be any option accepted by the ccoommpplleettee
builtin with the exceptions of --pp, --rr, --DD, --EE, and --II, and write
the matches to the standard output.
If the --VV option is supplied, ccoommppggeenn stores the generated com-
pletions into the indexed array variable _v_a_r_n_a_m_e instead of
writing them to the standard output.
When using the --FF or --CC options, the various shell variables set
by the programmable completion facilities, while available, will
not have useful values.
The matches will be generated in the same way as if the program-
mable completion code had generated them directly from a comple-
tion specification with the same flags. If _w_o_r_d is specified,
only those completions matching _w_o_r_d will be displayed or
stored.
The return value is true unless an invalid option is supplied,
or no matches were generated.
ccoommpplleettee [--aabbccddeeffggjjkkssuuvv] [--oo _c_o_m_p_-_o_p_t_i_o_n] [--DDEEII] [--AA _a_c_t_i_o_n]
[--GG _g_l_o_b_p_a_t] [--WW _w_o_r_d_l_i_s_t] [--FF _f_u_n_c_t_i_o_n] [--CC _c_o_m_m_a_n_d]
[--XX _f_i_l_t_e_r_p_a_t] [--PP _p_r_e_f_i_x] [--SS _s_u_f_f_i_x] _n_a_m_e [_n_a_m_e ...]
ccoommpplleettee --pprr [--DDEEII] [_n_a_m_e ...]
Specify how arguments to each _n_a_m_e should be completed.
If the --pp option is supplied, or if no options or _n_a_m_es are sup-
plied, print existing completion specifications in a way that
allows them to be reused as input. The --rr option removes a com-
pletion specification for each _n_a_m_e, or, if no _n_a_m_es are sup-
plied, all completion specifications.
The --DD option indicates that other supplied options and actions
should apply to the command completion; that is, completion at-
tempted on a command for which no completion has previously been
defined. The --EE option indicates that other supplied options
and actions should apply to command completion; that is, comple-
tion attempted on a blank line. The --II option indicates that
other supplied options and actions should apply to completion on
the initial non-assignment word on the line, or after a command
delimiter such as ;; or ||, which is usually command name comple-
tion. If multiple options are supplied, the --DD option takes
precedence over --EE, and both take precedence over --II. If any of
--DD, --EE, or --II are supplied, any other _n_a_m_e arguments are ig-
nored; these completions only apply to the case specified by the
option.
The process of applying these completion specifications when at-
tempting word completion is described in _b_a_s_h(1).
Other options, if specified, have the following meanings. The
arguments to the --GG, --WW, and --XX options (and, if necessary, the
--PP and --SS options) should be quoted to protect them from expan-
sion before the ccoommpplleettee builtin is invoked.
--oo _c_o_m_p_-_o_p_t_i_o_n
The _c_o_m_p_-_o_p_t_i_o_n controls several aspects of the comp-
spec's behavior beyond the simple generation of comple-
tions. _c_o_m_p_-_o_p_t_i_o_n may be one of:
bbaasshhddeeffaauulltt
Perform the rest of the default bbaasshh completions
if the compspec generates no matches.
ddeeffaauulltt Use rreeaaddlliinnee's default filename completion if
the compspec generates no matches.
ddiirrnnaammeess
Perform directory name completion if the comp-
spec generates no matches.
ffiilleennaammeess
Tell rreeaaddlliinnee that the compspec generates file-
names, so it can perform any filename-specific
processing (such as adding a slash to directory
names, quoting special characters, or suppress-
ing trailing spaces). This is intended to be
used with shell functions.
ffuullllqquuoottee
Tell rreeaaddlliinnee to quote all the completed words
even if they are not filenames.
nnooqquuoottee Tell rreeaaddlliinnee not to quote the completed words
if they are filenames (quoting filenames is the
default).
nnoossoorrtt Tell rreeaaddlliinnee not to sort the list of possible
completions alphabetically.
nnoossppaaccee Tell rreeaaddlliinnee not to append a space (the de-
fault) to words completed at the end of the
line.
pplluussddiirrss
After generating any matches defined by the
compspec, attempt directory name completion and
add any matches to the results of the other ac-
tions.
--AA _a_c_t_i_o_n
The _a_c_t_i_o_n may be one of the following to generate a
list of possible completions:
aalliiaass Alias names. May also be specified as --aa.
aarrrraayyvvaarr
Array variable names.
bbiinnddiinngg RReeaaddlliinnee key binding names.
bbuuiillttiinn Names of shell builtin commands. May also be
specified as --bb.
ccoommmmaanndd Command names. May also be specified as --cc.
ddiirreeccttoorryy
Directory names. May also be specified as --dd.
ddiissaabblleedd
Names of disabled shell builtins.
eennaabblleedd Names of enabled shell builtins.
eexxppoorrtt Names of exported shell variables. May also be
specified as --ee.
ffiillee File and directory names, similar to rreeaaddlliinnee's
filename completion. May also be specified as
--ff.
ffuunnccttiioonn
Names of shell functions.
ggrroouupp Group names. May also be specified as --gg.
hheellppttooppiicc
Help topics as accepted by the hheellpp builtin.
hhoossttnnaammee
Hostnames, as taken from the file specified by
the HHOOSSTTFFIILLEE shell variable.
jjoobb Job names, if job control is active. May also
be specified as --jj.
kkeeyywwoorrdd Shell reserved words. May also be specified as
--kk.
rruunnnniinngg Names of running jobs, if job control is active.
sseerrvviiccee Service names. May also be specified as --ss.
sseettoopptt Valid arguments for the --oo option to the sseett
builtin.
sshhoopptt Shell option names as accepted by the sshhoopptt
builtin.
ssiiggnnaall Signal names.
ssttooppppeedd Names of stopped jobs, if job control is active.
uusseerr User names. May also be specified as --uu.
vvaarriiaabbllee
Names of all shell variables. May also be spec-
ified as --vv.
--CC _c_o_m_m_a_n_d
_c_o_m_m_a_n_d is executed in a subshell environment, and its
output is used as the possible completions. Arguments
are passed as with the --FF option.
--FF _f_u_n_c_t_i_o_n
The shell function _f_u_n_c_t_i_o_n is executed in the current
shell environment. When the function is executed, the
first argument ($$11) is the name of the command whose ar-
guments are being completed, the second argument ($$22) is
the word being completed, and the third argument ($$33) is
the word preceding the word being completed on the cur-
rent command line. When _f_u_n_c_t_i_o_n finishes, programmable
completion retrieves the possible completions from the
value of the CCOOMMPPRREEPPLLYY array variable.
--GG _g_l_o_b_p_a_t
Expand the pathname expansion pattern _g_l_o_b_p_a_t to gener-
ate the possible completions.
--PP _p_r_e_f_i_x
Add _p_r_e_f_i_x to the beginning of each possible completion
after all other options have been applied.
--SS _s_u_f_f_i_x
Append _s_u_f_f_i_x to each possible completion after all
other options have been applied.
--WW _w_o_r_d_l_i_s_t
Split the _w_o_r_d_l_i_s_t using the characters in the IIFFSS spe-
cial variable as delimiters, and expand each resulting
word. Shell quoting is honored within _w_o_r_d_l_i_s_t, in or-
der to provide a mechanism for the words to contain
shell metacharacters or characters in the value of IIFFSS.
The possible completions are the members of the resul-
tant list which match a prefix of the word being com-
pleted.
--XX _f_i_l_t_e_r_p_a_t
_f_i_l_t_e_r_p_a_t is a pattern as used for pathname expansion.
It is applied to the list of possible completions gener-
ated by the preceding options and arguments, and each
completion matching _f_i_l_t_e_r_p_a_t is removed from the list.
A leading !! in _f_i_l_t_e_r_p_a_t negates the pattern; in this
case, any completion not matching _f_i_l_t_e_r_p_a_t is removed.
The return value is true unless an invalid option is supplied,
an option other than --pp, --rr, --DD, --EE, or --II is supplied without a
_n_a_m_e argument, an attempt is made to remove a completion speci-
fication for a _n_a_m_e for which no specification exists, or an er-
ror occurs adding a completion specification.
ccoommppoopptt [--oo _o_p_t_i_o_n] [--DDEEII] [++oo _o_p_t_i_o_n] [_n_a_m_e]
Modify completion options for each _n_a_m_e according to the _o_p_-
_t_i_o_ns, or for the currently-executing completion if no _n_a_m_es are
supplied. If no _o_p_t_i_o_ns are supplied, display the completion
options for each _n_a_m_e or the current completion. The possible
values of _o_p_t_i_o_n are those valid for the ccoommpplleettee builtin de-
scribed above.
The --DD option indicates that other supplied options should apply
to the command completion; the --EE option indicates that other
supplied options should apply to command completion; and the --II
option indicates that other supplied options should apply to
completion on the initial word on the line. These are deter-
mined in the same way as the ccoommpplleettee builtin.
If multiple options are supplied, the --DD option takes precedence
over --EE, and both take precedence over --II.
The return value is true unless an invalid option is supplied,
an attempt is made to modify the options for a _n_a_m_e for which no
completion specification exists, or an output error occurs.
ccoonnttiinnuuee [_n]
ccoonnttiinnuuee resumes the next iteration of the enclosing ffoorr, wwhhiillee,
uunnttiill, or sseelleecctt loop. If _n is specified, bbaasshh resumes the _nth
enclosing loop. _n must be >= 1. If _n is greater than the num-
ber of enclosing loops, the shell resumes the last enclosing
loop (the loop). The return value is 0 unless _n is not greater
than or equal to 1.
ddeeccllaarree [--aaAAffFFggiiIIllnnrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...]
ttyyppeesseett [--aaAAffFFggiiIIllnnrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...]
Declare variables and/or give them attributes. If no _n_a_m_es are
given then display the values of variables or functions. The --pp
option will display the attributes and values of each _n_a_m_e.
When --pp is used with _n_a_m_e arguments, additional options, other
than --ff and --FF, are ignored.
When --pp is supplied without _n_a_m_e arguments, ddeeccllaarree will display
the attributes and values of all variables having the attributes
specified by the additional options. If no other options are
supplied with --pp, ddeeccllaarree will display the attributes and values
of all shell variables. The --ff option restricts the display to
shell functions.
The --FF option inhibits the display of function definitions; only
the function name and attributes are printed. If the eexxttddeebbuugg
shell option is enabled using sshhoopptt, the source file name and
line number where each _n_a_m_e is defined are displayed as well.
The --FF option implies --ff.
The --gg option forces variables to be created or modified at the
global scope, even when ddeeccllaarree is executed in a shell function.
It is ignored when ddeeccllaarree is not executed in a shell function.
The --II option causes local variables to inherit the attributes
(except the _n_a_m_e_r_e_f attribute) and value of any existing vari-
able with the same _n_a_m_e at a surrounding scope. If there is no
existing variable, the local variable is initially unset.
The following options can be used to restrict output to vari-
ables with the specified attribute or to give variables attrib-
utes:
--aa Each _n_a_m_e is an indexed array variable (see AArrrraayyss in
_b_a_s_h(1)).
--AA Each _n_a_m_e is an associative array variable (see AArrrraayyss in
_b_a_s_h(1)).
--ff Each _n_a_m_e refers to a shell function.
--ii The variable is treated as an integer; arithmetic evalua-
tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h(1)) is performed
when the variable is assigned a value.
--ll When the variable is assigned a value, all upper-case
characters are converted to lower-case. The upper-case
attribute is disabled.
--nn Give each _n_a_m_e the _n_a_m_e_r_e_f attribute, making it a name
reference to another variable. That other variable is
defined by the value of _n_a_m_e. All references, assign-
ments, and attribute modifications to _n_a_m_e, except those
using or changing the --nn attribute itself, are performed
on the variable referenced by _n_a_m_e's value. The nameref
attribute cannot be applied to array variables.
--rr Make _n_a_m_es readonly. These names cannot then be assigned
values by subsequent assignment statements or unset.
--tt Give each _n_a_m_e the _t_r_a_c_e attribute. Traced functions in-
herit the DDEEBBUUGG and RREETTUURRNN traps from the calling shell.
The trace attribute has no special meaning for variables.
--uu When the variable is assigned a value, all lower-case
characters are converted to upper-case. The lower-case
attribute is disabled.
--xx Mark each _n_a_m_e for export to subsequent commands via the
environment.
Using instead of turns off the specified attribute instead, with
the exceptions that ++aa and ++AA may not be used to destroy array
variables and ++rr will not remove the readonly attribute.
When used in a function, ddeeccllaarree and ttyyppeesseett make each _n_a_m_e lo-
cal, as with the llooccaall command, unless the --gg option is sup-
plied. If a variable name is followed by =_v_a_l_u_e, the value of
the variable is set to _v_a_l_u_e. When using --aa or --AA and the com-
pound assignment syntax to create array variables, additional
attributes do not take effect until subsequent assignments.
The return value is 0 unless an invalid option is encountered,
an attempt is made to define a function using an attempt is made
to assign a value to a readonly variable, an attempt is made to
assign a value to an array variable without using the compound
assignment syntax (see AArrrraayyss in _b_a_s_h(1)), one of the _n_a_m_e_s is
not a valid shell variable name, an attempt is made to turn off
readonly status for a readonly variable, an attempt is made to
turn off array status for an array variable, or an attempt is
made to display a non-existent function with --ff.
ddiirrss [[--ccllppvv]] [[++_n]] [[--_n]]
Without options, display the list of currently remembered direc-
tories. The default display is on a single line with directory
names separated by spaces. Directories are added to the list
with the ppuusshhdd command; the ppooppdd command removes entries from
the list. The current directory is always the first directory
in the stack.
Options, if supplied, have the following meanings:
--cc Clears the directory stack by deleting all of the en-
tries.
--ll Produces a listing using full pathnames; the default
listing format uses a tilde to denote the home directory.
--pp Print the directory stack with one entry per line.
--vv Print the directory stack with one entry per line, pre-
fixing each entry with its index in the stack.
++_n Displays the _nth entry counting from the left of the list
shown by ddiirrss when invoked without options, starting with
zero.
--_n Displays the _nth entry counting from the right of the
list shown by ddiirrss when invoked without options, starting
with zero.
The return value is 0 unless an invalid option is supplied or _n
indexes beyond the end of the directory stack.
ddiissoowwnn [--aarr] [--hh] [_i_d ...]
Without options, remove each _i_d from the table of active jobs.
Each _i_d may be a job specification _j_o_b_s_p_e_c or a process ID _p_i_d;
if _i_d is a _p_i_d, ddiissoowwnn uses the job containing _p_i_d as _j_o_b_s_p_e_c.
If the --hh option is supplied, ddiissoowwnn does not remove the jobs
corresponding to each _i_d from the jobs table, but rather marks
them so the shell does not send SSIIGGHHUUPP to the job if the shell
receives a SSIIGGHHUUPP.
If no _i_d is supplied, the --aa option means to remove or mark all
jobs; the --rr option without an _i_d argument removes or marks run-
ning jobs. If no _i_d is supplied, and neither the --aa nor the --rr
option is supplied, ddiissoowwnn removes or marks the current job.
The return value is 0 unless an _i_d does not specify a valid job.
eecchhoo [--nneeEE] [_a_r_g ...]
Output the _a_r_gs, separated by spaces, followed by a newline.
The return status is 0 unless a write error occurs. If --nn is
specified, the trailing newline is not printed.
If the --ee option is given, eecchhoo interprets the following back-
slash-escaped characters. The --EE option disables interpretation
of these escape characters, even on systems where they are in-
terpreted by default. The xxppgg__eecchhoo shell option determines
whether or not eecchhoo interprets any options and expands these es-
cape characters. eecchhoo does not interpret ---- to mean the end of
options.
eecchhoo interprets the following escape sequences:
\\aa alert (bell)
\\bb backspace
\\cc suppress further output
\\ee
\\EE an escape character
\\ff form feed
\\nn new line
\\rr carriage return
\\tt horizontal tab
\\vv vertical tab
\\\\ backslash
\\00_n_n_n The eight-bit character whose value is the octal value
_n_n_n (zero to three octal digits).
\\xx_H_H The eight-bit character whose value is the hexadecimal
value _H_H (one or two hex digits).
\\uu_H_H_H_H The Unicode (ISO/IEC 10646) character whose value is the
hexadecimal value _H_H_H_H (one to four hex digits).
\\UU_H_H_H_H_H_H_H_H
The Unicode (ISO/IEC 10646) character whose value is the
hexadecimal value _H_H_H_H_H_H_H_H (one to eight hex digits).
eecchhoo writes any unrecognized backslash-escaped characters un-
changed.
eennaabbllee [--aa] [--ddnnppss] [--ff _f_i_l_e_n_a_m_e] [_n_a_m_e ...]
Enable and disable builtin shell commands. Disabling a builtin
allows an executable file which has the same name as a shell
builtin to be executed without specifying a full pathname, even
though the shell normally searches for builtins before files.
If --nn is supplied, each _n_a_m_e is disabled; otherwise, _n_a_m_es are
enabled. For example, to use the tteesstt binary found using PPAATTHH
instead of the shell builtin version, run
If no _n_a_m_e arguments are supplied, or if the --pp option is sup-
plied, print a list of shell builtins. With no other option ar-
guments, the list consists of all enabled shell builtins. If --nn
is supplied, print only disabled builtins. If --aa is supplied,
the list printed includes all builtins, with an indication of
whether or not each is enabled. The --ss option means to restrict
the output to the POSIX _s_p_e_c_i_a_l builtins.
The --ff option means to load the new builtin command _n_a_m_e from
shared object _f_i_l_e_n_a_m_e, on systems that support dynamic loading.
If _f_i_l_e_n_a_m_e does not contain a slash, BBaasshh will use the value of
the BBAASSHH__LLOOAADDAABBLLEESS__PPAATTHH variable as a colon-separated list of
directories in which to search for _f_i_l_e_n_a_m_e. The default for
BBAASSHH__LLOOAADDAABBLLEESS__PPAATTHH is system-dependent, and may include to
force a search of the current directory. The --dd option will
delete a builtin previously loaded with --ff. If _-_s is used with
_-_f, the new builtin becomes a POSIX special builtin.
If no options are supplied and a _n_a_m_e is not a shell builtin,
eennaabbllee will attempt to load _n_a_m_e from a shared object named
_n_a_m_e, as if the command were
The return value is 0 unless a _n_a_m_e is not a shell builtin or
there is an error loading a new builtin from a shared object.
eevvaall [_a_r_g ...]
Concatenate the _a_r_gs together into a single command, separating
them with spaces. BBaasshh then reads and execute this command, and
returns its exit status as the return status of eevvaall. If there
are no _a_r_g_s, or only null arguments, eevvaall returns 0.
eexxeecc [--ccll] [--aa _n_a_m_e] [_c_o_m_m_a_n_d [_a_r_g_u_m_e_n_t_s]]
If _c_o_m_m_a_n_d is specified, it replaces the shell without creating
a new process. _c_o_m_m_a_n_d cannot be a shell builtin or function.
The _a_r_g_u_m_e_n_t_s become the arguments to _c_o_m_m_a_n_d. If the --ll option
is supplied, the shell places a dash at the beginning of the ze-
roth argument passed to _c_o_m_m_a_n_d. This is what _l_o_g_i_n(1) does.
The --cc option causes _c_o_m_m_a_n_d to be executed with an empty envi-
ronment. If --aa is supplied, the shell passes _n_a_m_e as the zeroth
argument to the executed command.
If _c_o_m_m_a_n_d cannot be executed for some reason, a non-interactive
shell exits, unless the eexxeeccffaaiill shell option is enabled. In
that case, it returns a non-zero status. An interactive shell
returns a non-zero status if the file cannot be executed. A
subshell exits unconditionally if eexxeecc fails.
If _c_o_m_m_a_n_d is not specified, any redirections take effect in the
current shell, and the return status is 0. If there is a redi-
rection error, the return status is 1.
eexxiitt [_n]
Cause the shell to exit with a status of _n. If _n is omitted,
the exit status is that of the last command executed. Any trap
on EEXXIITT is executed before the shell terminates.
eexxppoorrtt [--ffnn] [_n_a_m_e[=_v_a_l_u_e]] ...
eexxppoorrtt --pp [[--ff]]
The supplied _n_a_m_e_s are marked for automatic export to the envi-
ronment of subsequently executed commands. If the --ff option is
given, the _n_a_m_e_s refer to functions.
The --nn option unexports, or removes the export attribute, from
each _n_a_m_e. If no _n_a_m_e_s are given, or if only the --pp option is
supplied, eexxppoorrtt displays a list of names of all exported vari-
ables on the standard output. Using --pp and --ff together displays
exported functions. The --pp option displays output in a form
that may be reused as input.
eexxppoorrtt allows the value of a variable to be set when it is ex-
ported or unexported by following the variable name with =_v_a_l_u_e.
This sets the value of the variable to _v_a_l_u_e while modifying the
export attribute. eexxppoorrtt returns an exit status of 0 unless an
invalid option is encountered, one of the _n_a_m_e_s is not a valid
shell variable name, or --ff is supplied with a _n_a_m_e that is not a
function.
ffaallssee Does nothing; returns a non-zero status.
ffcc [--ee _e_n_a_m_e] [--llnnrr] [_f_i_r_s_t] [_l_a_s_t]
ffcc --ss [_p_a_t=_r_e_p] [_c_m_d]
The first form selects a range of commands from _f_i_r_s_t to _l_a_s_t
from the history list and displays or edits and re-executes
them. _F_i_r_s_t and _l_a_s_t may be specified as a string (to locate
the last command beginning with that string) or as a number (an
index into the history list, where a negative number is used as
an offset from the current command number).
When listing, a _f_i_r_s_t or _l_a_s_t of 0 is equivalent to -1 and -0 is
equivalent to the current command (usually the ffcc command); oth-
erwise 0 is equivalent to -1 and -0 is invalid. If _l_a_s_t is not
specified, it is set to the current command for listing (so that
prints the last 10 commands) and to _f_i_r_s_t otherwise. If _f_i_r_s_t
is not specified, it is set to the previous command for editing
and -16 for listing.
If the --ll option is supplied, the commands are listed on the
standard output. The --nn option suppresses the command numbers
when listing. The --rr option reverses the order of the commands.
Otherwise, ffcc invokes the editor named by _e_n_a_m_e on a file con-
taining those commands. If _e_n_a_m_e is not supplied, ffcc uses the
value of the FFCCEEDDIITT variable, and the value of EEDDIITTOORR if FFCCEEDDIITT
is not set. If neither variable is set, ffcc uses _v_i_. When edit-
ing is complete, ffcc reads the file containing the edited com-
mands and echoes and executes them.
In the second form, ffcc re-executes _c_o_m_m_a_n_d after replacing each
instance of _p_a_t with _r_e_p. _C_o_m_m_a_n_d is interpreted the same as
_f_i_r_s_t above.
A useful alias to use with ffcc is so that typing runs the last
command beginning with and typing re-executes the last command.
If the first form is used, the return value is zero unless an
invalid option is encountered or _f_i_r_s_t or _l_a_s_t specify history
lines out of range. When editing and re-executing a file of
commands, the return value is the value of the last command exe-
cuted or failure if an error occurs with the temporary file. If
the second form is used, the return status is that of the re-ex-
ecuted command, unless _c_m_d does not specify a valid history en-
try, in which case ffcc returns a non-zero status.
ffgg [_j_o_b_s_p_e_c]
Resume _j_o_b_s_p_e_c in the foreground, and make it the current job.
If _j_o_b_s_p_e_c is not present, ffgg uses the shell's notion of the
_c_u_r_r_e_n_t _j_o_b. The return value is that of the command placed
into the foreground, or failure if run when job control is dis-
abled or, when run with job control enabled, if _j_o_b_s_p_e_c does not
specify a valid job or _j_o_b_s_p_e_c specifies a job that was started
without job control.
ggeettooppttss _o_p_t_s_t_r_i_n_g _n_a_m_e [_a_r_g ...]
ggeettooppttss is used by shell scripts and functions to parse posi-
tional parameters and obtain options and their arguments. _o_p_t_-
_s_t_r_i_n_g contains the option characters to be recognized; if a
character is followed by a colon, the option is expected to have
an argument, which should be separated from it by white space.
The colon and question mark characters may not be used as option
characters.
Each time it is invoked, ggeettooppttss places the next option in the
shell variable _n_a_m_e, initializing _n_a_m_e if it does not exist, and
the index of the next argument to be processed into the variable
OOPPTTIINNDD. OOPPTTIINNDD is initialized to 1 each time the shell or a
shell script is invoked. When an option requires an argument,
ggeettooppttss places that argument into the variable OOPPTTAARRGG.
The shell does not reset OOPPTTIINNDD automatically; it must be manu-
ally reset between multiple calls to ggeettooppttss within the same
shell invocation to use a new set of parameters.
When it reaches the end of options, ggeettooppttss exits with a return
value greater than zero. OOPPTTIINNDD is set to the index of the
first non-option argument, and _n_a_m_e is set to ?.
ggeettooppttss normally parses the positional parameters, but if more
arguments are supplied as _a_r_g values, ggeettooppttss parses those in-
stead.
ggeettooppttss can report errors in two ways. If the first character
of _o_p_t_s_t_r_i_n_g is a colon, ggeettooppttss uses _s_i_l_e_n_t error reporting.
In normal operation, ggeettooppttss prints diagnostic messages when it
encounters invalid options or missing option arguments. If the
variable OOPPTTEERRRR is set to 0, ggeettooppttss does not display any error
messages, even if the first character of _o_p_t_s_t_r_i_n_g is not a
colon.
If ggeettooppttss detects an invalid option, it places ? into _n_a_m_e and,
if not silent, prints an error message and unsets OOPPTTAARRGG. If
ggeettooppttss is silent, it assigns the option character found to OOPP--
TTAARRGG and does not print a diagnostic message.
If a required argument is not found, and ggeettooppttss is not silent,
it sets the value of _n_a_m_e to a question mark (??), unsets OOPPTTAARRGG,
and prints a diagnostic message. If ggeettooppttss is silent, it sets
the value of _n_a_m_e to a colon (::) and sets OOPPTTAARRGG to the option
character found.
ggeettooppttss returns true if an option, specified or unspecified, is
found. It returns false if the end of options is encountered or
an error occurs.
hhaasshh [--llrr] [--pp _f_i_l_e_n_a_m_e] [--ddtt] [_n_a_m_e]
Each time hhaasshh is invoked, it remembers the full pathname of the
command _n_a_m_e as determined by searching the directories in
$$PPAATTHH. Any previously-remembered pathname associated with _n_a_m_e
is discarded. If the --pp option is supplied, hhaasshh uses _f_i_l_e_n_a_m_e
as the full pathname of the command.
The --rr option causes the shell to forget all remembered loca-
tions. Assigning to the PPAATTHH variable also clears all hashed
filenames. The --dd option causes the shell to forget the remem-
bered location of each _n_a_m_e.
If the --tt option is supplied, hhaasshh prints the full pathname cor-
responding to each _n_a_m_e. If multiple _n_a_m_e arguments are sup-
plied with --tt, hhaasshh prints the _n_a_m_e before the corresponding
hashed full pathname. The --ll option displays output in a format
that may be reused as input.
If no arguments are given, or if only --ll is supplied, hhaasshh
prints information about remembered commands. The --tt, --dd, and
--pp options (the options that act on the _n_a_m_e arguments) are mu-
tually exclusive. Only one will be active. If more than one is
supplied, --tt has higher priority than --pp, and both have higher
priority than --dd.
The return status is zero unless a _n_a_m_e is not found or an in-
valid option is supplied.
hheellpp [--ddmmss] [_p_a_t_t_e_r_n]
Display helpful information about builtin commands. If _p_a_t_t_e_r_n
is specified, hheellpp gives detailed help on all commands matching
_p_a_t_t_e_r_n as described below; otherwise it displays a list of all
the builtins and shell compound commands.
Options, if supplied, have the follow meanings:
--dd Display a short description of each _p_a_t_t_e_r_n
--mm Display the description of each _p_a_t_t_e_r_n in a manpage-like
format
--ss Display only a short usage synopsis for each _p_a_t_t_e_r_n
If _p_a_t_t_e_r_n contains pattern matching characters (see PPaatttteerrnn
MMaattcchhiinngg above) it's treated as a shell pattern and hheellpp prints
the description of each help topic matching _p_a_t_t_e_r_n.
If not, and _p_a_t_t_e_r_n exactly matches the name of a help topic,
hheellpp prints the description associated with that topic. Other-
wise, hheellpp performs prefix matching and prints the descriptions
of all matching help topics.
The return status is 0 unless no command matches _p_a_t_t_e_r_n.
hhiissttoorryy [[_n]]
hhiissttoorryy --cc
hhiissttoorryy --dd _o_f_f_s_e_t
hhiissttoorryy --dd _s_t_a_r_t-_e_n_d
hhiissttoorryy --aannrrww [_f_i_l_e_n_a_m_e]
hhiissttoorryy --pp _a_r_g [_a_r_g ...]
hhiissttoorryy --ss _a_r_g [_a_r_g ...]
With no options, display the command history list with numbers.
Entries prefixed with a ** have been modified. An argument of _n
lists only the last _n entries. If the shell variable HHIISSTTTTIIMMEE--
FFOORRMMAATT is set and not null, it is used as a format string for
_s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis-
played history entry. If hhiissttoorryy uses HHIISSTTTTIIMMEEFFOORRMMAATT, it does
not print an intervening space between the formatted time stamp
and the history entry.
If _f_i_l_e_n_a_m_e is supplied, hhiissttoorryy uses it as the name of the his-
tory file; if not, it uses the value of HHIISSTTFFIILLEE. If _f_i_l_e_n_a_m_e
is not supplied and HHIISSTTFFIILLEE is unset or null, the --aa,, --nn,, --rr,,
and --ww options have no effect.
Options, if supplied, have the following meanings:
--cc Clear the history list by deleting all the entries. This
can be used with the other options to replace the history
list.
--dd _o_f_f_s_e_t
Delete the history entry at position _o_f_f_s_e_t. If _o_f_f_s_e_t
is negative, it is interpreted as relative to one greater
than the last history position, so negative indices count
back from the end of the history, and an index of -1
refers to the current hhiissttoorryy --dd command.
--dd _s_t_a_r_t-_e_n_d
Delete the range of history entries between positions
_s_t_a_r_t and _e_n_d, inclusive. Positive and negative values
for _s_t_a_r_t and _e_n_d are interpreted as described above.
--aa Append the history lines to the history file. These are
history lines entered since the beginning of the current
bbaasshh session, but not already appended to the history
file.
--nn Read the history lines not already read from the history
file and add them to the current history list. These are
lines appended to the history file since the beginning of
the current bbaasshh session.
--rr Read the history file and append its contents to the cur-
rent history list.
--ww Write the current history list to the history file, over-
writing the history file.
--pp Perform history substitution on the following _a_r_g_s and
display the result on the standard output, without stor-
ing the results in the history list. Each _a_r_g must be
quoted to disable normal history expansion.
--ss Store the _a_r_g_s in the history list as a single entry.
The last command in the history list is removed before
adding the _a_r_g_s.
If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, hhiissttoorryy writes the time
stamp information associated with each history entry to the his-
tory file, marked with the history comment character as de-
scribed above. When the history file is read, lines beginning
with the history comment character followed immediately by a
digit are interpreted as timestamps for the following history
entry.
The return value is 0 unless an invalid option is encountered,
an error occurs while reading or writing the history file, an
invalid _o_f_f_s_e_t or range is supplied as an argument to --dd, or the
history expansion supplied as an argument to --pp fails.
jjoobbss [--llnnpprrss] [ _j_o_b_s_p_e_c ... ]
jjoobbss --xx _c_o_m_m_a_n_d [ _a_r_g_s ... ]
The first form lists the active jobs. The options have the fol-
lowing meanings:
--ll List process IDs in addition to the normal information.
--nn Display information only about jobs that have changed
status since the user was last notified of their status.
--pp List only the process ID of the job's process group
leader.
--rr Display only running jobs.
--ss Display only stopped jobs.
If _j_o_b_s_p_e_c is supplied, jjoobbss restricts output to information
about that job. The return status is 0 unless an invalid option
is encountered or an invalid _j_o_b_s_p_e_c is supplied.
If the --xx option is supplied, jjoobbss replaces any _j_o_b_s_p_e_c found in
_c_o_m_m_a_n_d or _a_r_g_s with the corresponding process group ID, and ex-
ecutes _c_o_m_m_a_n_d, passing it _a_r_g_s, returning its exit status.
kkiillll [--ss _s_i_g_s_p_e_c | --nn _s_i_g_n_u_m | --_s_i_g_s_p_e_c] _i_d [ ... ]
kkiillll --ll|--LL [_s_i_g_s_p_e_c | _e_x_i_t___s_t_a_t_u_s]
Send the signal specified by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes
named by each _i_d. Each _i_d may be a job specification _j_o_b_s_p_e_c or
a process ID _p_i_d. _s_i_g_s_p_e_c is either a case-insensitive signal
name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or a sig-
nal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not sup-
plied, then kkiillll sends SSIIGGTTEERRMM.
The --ll option lists the signal names. If any arguments are sup-
plied when --ll is given, kkiillll lists the names of the signals cor-
responding to the arguments, and the return status is 0. The
_e_x_i_t___s_t_a_t_u_s argument to --ll is a number specifying either a sig-
nal number or the exit status of a process terminated by a sig-
nal; if it is supplied, kkiillll prints the name of the signal that
caused the process to terminate. kkiillll assumes that process exit
statuses are greater than 128; anything less than that is a sig-
nal number. The --LL option is equivalent to --ll.
kkiillll returns true if at least one signal was successfully sent,
or false if an error occurs or an invalid option is encountered.
lleett _a_r_g [_a_r_g ...]
Each _a_r_g is evaluated as an arithmetic expression (see AARRIITTHH--
MMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h(1)). If the last _a_r_g evaluates to 0,
lleett returns 1; otherwise lleett returns 0.
llooccaall [_o_p_t_i_o_n] [_n_a_m_e[=_v_a_l_u_e] ... | - ]
For each argument, create a local variable named _n_a_m_e and assign
it _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted by ddee--
ccllaarree. When llooccaall is used within a function, it causes the
variable _n_a_m_e to have a visible scope restricted to that func-
tion and its children. It is an error to use llooccaall when not
within a function.
If _n_a_m_e is -, it makes the set of shell options local to the
function in which llooccaall is invoked: any shell options changed
using the sseett builtin inside the function after the call to lloo--
ccaall are restored to their original values when the function re-
turns. The restore is performed as if a series of sseett commands
were executed to restore the values that were in place before
the function.
With no operands, llooccaall writes a list of local variables to the
standard output.
The return status is 0 unless llooccaall is used outside a function,
an invalid _n_a_m_e is supplied, or _n_a_m_e is a readonly variable.
llooggoouutt [[_n]]
Exit a login shell, returning a status of _n to the shell's par-
ent.
mmaappffiillee [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC
_c_a_l_l_b_a_c_k] [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y]
rreeaaddaarrrraayy [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC
_c_a_l_l_b_a_c_k] [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y]
Read lines from the standard input, or from file descriptor _f_d
if the --uu option is supplied, into the indexed array variable
_a_r_r_a_y. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if
supplied, have the following meanings:
--dd Use the first character of _d_e_l_i_m to terminate each input
line, rather than newline. If _d_e_l_i_m is the empty string,
mmaappffiillee will terminate a line when it reads a NUL charac-
ter.
--nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, copy all lines.
--OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default
index is 0.
--ss Discard the first _c_o_u_n_t lines read.
--tt Remove a trailing _d_e_l_i_m (default newline) from each line
read.
--uu Read lines from file descriptor _f_d instead of the stan-
dard input.
--CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The
--cc option specifies _q_u_a_n_t_u_m.
--cc Specify the number of lines read between each call to
_c_a_l_l_b_a_c_k.
If --CC is specified without --cc, the default quantum is 5000.
When _c_a_l_l_b_a_c_k is evaluated, it is supplied the index of the next
array element to be assigned and the line to be assigned to that
element as additional arguments. _c_a_l_l_b_a_c_k is evaluated after
the line is read but before the array element is assigned.
If not supplied with an explicit origin, mmaappffiillee will clear _a_r_-
_r_a_y before assigning to it.
mmaappffiillee returns zero unless an invalid option or option argument
is supplied, _a_r_r_a_y is invalid or unassignable, or if _a_r_r_a_y is
not an indexed array.
ppooppdd [-nn] [+_n] [-_n]
Remove entries from the directory stack. The elements are num-
bered from 0 starting at the first directory listed by ddiirrss, so
ppooppdd is equivalent to With no arguments, ppooppdd removes the top
directory from the stack, and changes to the new top directory.
Arguments, if supplied, have the following meanings:
--nn Suppress the normal change of directory when removing di-
rectories from the stack, only manipulate the stack.
++_n Remove the _nth entry counting from the left of the list
shown by ddiirrss, starting with zero, from the stack. For
example: removes the first directory, the second.
--_n Remove the _nth entry counting from the right of the list
shown by ddiirrss, starting with zero. For example: removes
the last directory, the next to last.
If the top element of the directory stack is modified, and the
_-_n option was not supplied, ppooppdd uses the ccdd builtin to change
to the directory at the top of the stack. If the ccdd fails, ppooppdd
returns a non-zero value.
Otherwise, ppooppdd returns false if an invalid option is supplied,
the directory stack is empty, or _n specifies a non-existent di-
rectory stack entry.
If the ppooppdd command is successful, bbaasshh runs ddiirrss to show the
final contents of the directory stack, and the return status is
0.
pprriinnttff [--vv _v_a_r] _f_o_r_m_a_t [_a_r_g_u_m_e_n_t_s]
Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the
control of the _f_o_r_m_a_t. The --vv option assigns the output to the
variable _v_a_r rather than printing it to the standard output.
The _f_o_r_m_a_t is a character string which contains three types of
objects: plain characters, which are simply copied to standard
output, character escape sequences, which are converted and
copied to the standard output, and format specifications, each
of which causes printing of the next successive _a_r_g_u_m_e_n_t. In
addition to the standard _p_r_i_n_t_f(3) format characters ccCCssSS--
nnddiioouuxxXXeeEEffFFggGGaaAA, pprriinnttff interprets the following additional for-
mat specifiers:
%%bb causes pprriinnttff to expand backslash escape sequences in the
corresponding _a_r_g_u_m_e_n_t in the same way as eecchhoo --ee.
%%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a
format that can be reused as shell input. %%qq and %%QQ use
the $$ quoting style if any characters in the argument
string require it, and backslash quoting otherwise. If
the format string uses the _p_r_i_n_t_f alternate form, these
two formats quote the argument string using single
quotes.
%%QQ like %%qq, but applies any supplied precision to the _a_r_g_u_-
_m_e_n_t before quoting it.
%%((_d_a_t_e_f_m_t))TT
causes pprriinnttff to output the date-time string resulting
from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3).
The corresponding _a_r_g_u_m_e_n_t is an integer representing the
number of seconds since the epoch. This format specifier
recognizes two special argument values: -1 represents the
current time, and -2 represents the time the shell was
invoked. If no argument is specified, conversion behaves
as if -1 had been supplied. This is an exception to the
usual pprriinnttff behavior.
The %b, %q, and %T format specifiers all use the field width and
precision arguments from the format specification and write that
many bytes from (or use that wide a field for) the expanded ar-
gument, which usually contains more characters than the origi-
nal.
The %n format specifier accepts a corresponding argument that is
treated as a shell variable name.
The %s and %c format specifiers accept an l (long) modifier,
which forces them to convert the argument string to a wide-char-
acter string and apply any supplied field width and precision in
terms of characters, not bytes. The %S and %C format specifiers
are equivalent to %ls and %lc, respectively.
Arguments to non-string format specifiers are treated as C con-
stants, except that a leading plus or minus sign is allowed, and
if the leading character is a single or double quote, the value
is the numeric value of the following character, using the cur-
rent locale.
The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_-
_m_e_n_t_s. If the _f_o_r_m_a_t requires more _a_r_g_u_m_e_n_t_s than are supplied,
the extra format specifications behave as if a zero value or
null string, as appropriate, had been supplied. The return
value is zero on success, non-zero if an invalid option is sup-
plied or a write or assignment error occurs.
ppuusshhdd [--nn] [+_n] [-_n]
ppuusshhdd [--nn] [_d_i_r]
Add a directory to the top of the directory stack, or rotate the
stack, making the new top of the stack the current working di-
rectory. With no arguments, ppuusshhdd exchanges the top two ele-
ments of the directory stack. Arguments, if supplied, have the
following meanings:
--nn Suppress the normal change of directory when rotating or
adding directories to the stack, only manipulate the
stack.
++_n Rotate the stack so that the _nth directory (counting from
the left of the list shown by ddiirrss, starting with zero)
is at the top.
--_n Rotates the stack so that the _nth directory (counting
from the right of the list shown by ddiirrss, starting with
zero) is at the top.
_d_i_r Adds _d_i_r to the directory stack at the top.
After the stack has been modified, if the --nn option was not sup-
plied, ppuusshhdd uses the ccdd builtin to change to the directory at
the top of the stack. If the ccdd fails, ppuusshhdd returns a non-zero
value.
Otherwise, if no arguments are supplied, ppuusshhdd returns zero un-
less the directory stack is empty. When rotating the directory
stack, ppuusshhdd returns zero unless the directory stack is empty or
_n specifies a non-existent directory stack element.
If the ppuusshhdd command is successful, bbaasshh runs ddiirrss to show the
final contents of the directory stack.
ppwwdd [--LLPP]
Print the absolute pathname of the current working directory.
The pathname printed contains no symbolic links if the --PP option
is supplied or the --oo pphhyyssiiccaall option to the sseett builtin command
is enabled. If the --LL option is used, the pathname printed may
contain symbolic links. The return status is 0 unless an error
occurs while reading the name of the current directory or an in-
valid option is supplied.
rreeaadd [--EEeerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [--ii _t_e_x_t] [--nn _n_c_h_a_r_s] [--NN _n_c_h_a_r_s]
[--pp _p_r_o_m_p_t] [--tt _t_i_m_e_o_u_t] [--uu _f_d] [_n_a_m_e ...]
Read one line from the standard input, or from the file descrip-
tor _f_d supplied as an argument to the --uu option, split it into
words as described in _b_a_s_h (1) under WWoorrdd SSpplliittttiinngg, and assign
the first word to the first _n_a_m_e, the second word to the second
_n_a_m_e, and so on. If there are more words than names, the re-
maining words and their intervening delimiters are assigned to
the last _n_a_m_e. If there are fewer words read from the input
stream than names, the remaining names are assigned empty val-
ues. The characters in the value of the IIFFSS variable are used
to split the line into words using the same rules the shell uses
for expansion (described in _b_a_s_h (1) under WWoorrdd SSpplliittttiinngg). The
backslash character (\\) removes any special meaning for the next
character read and is used for line continuation.
Options, if supplied, have the following meanings:
--aa _a_n_a_m_e
The words are assigned to sequential indices of the array
variable _a_n_a_m_e, starting at 0. _a_n_a_m_e is unset before any
new values are assigned. Other _n_a_m_e arguments are ig-
nored.
--dd _d_e_l_i_m
The first character of _d_e_l_i_m terminates the input line,
rather than newline. If _d_e_l_i_m is the empty string, rreeaadd
will terminate a line when it reads a NUL character.
--ee If the standard input is coming from a terminal, rreeaadd
uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h(1)) to obtain the
line. RReeaaddlliinnee uses the current (or default, if line
editing was not previously active) editing settings, but
uses rreeaaddlliinnee's default filename completion.
--EE If the standard input is coming from a terminal, rreeaadd
uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h(1)) to obtain the
line. RReeaaddlliinnee uses the current (or default, if line
editing was not previously active) editing settings, but
uses bash's default completion, including programmable
completion.
--ii _t_e_x_t
If rreeaaddlliinnee is being used to read the line, rreeaadd places
_t_e_x_t into the editing buffer before editing begins.
--nn _n_c_h_a_r_s
rreeaadd returns after reading _n_c_h_a_r_s characters rather than
waiting for a complete line of input, unless it encoun-
ters EOF or rreeaadd times out, but honors a delimiter if it
reads fewer than _n_c_h_a_r_s characters before the delimiter.
--NN _n_c_h_a_r_s
rreeaadd returns after reading exactly _n_c_h_a_r_s characters
rather than waiting for a complete line of input, unless
it encounters EOF or rreeaadd times out. Any delimiter char-
acters in the input are not treated specially and do not
cause rreeaadd to return until it has read _n_c_h_a_r_s characters.
The result is not split on the characters in IIFFSS; the in-
tent is that the variable is assigned exactly the charac-
ters read (with the exception of backslash; see the --rr
option below).
--pp _p_r_o_m_p_t
Display _p_r_o_m_p_t on standard error, without a trailing new-
line, before attempting to read any input, but only if
input is coming from a terminal.
--rr Backslash does not act as an escape character. The back-
slash is considered to be part of the line. In particu-
lar, a backslash-newline pair may not then be used as a
line continuation.
--ss Silent mode. If input is coming from a terminal, charac-
ters are not echoed.
--tt _t_i_m_e_o_u_t
Cause rreeaadd to time out and return failure if it does not
read a complete line of input (or a specified number of
characters) within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a
decimal number with a fractional portion following the
decimal point. This option is only effective if rreeaadd is
reading input from a terminal, pipe, or other special
file; it has no effect when reading from regular files.
If rreeaadd times out, it saves any partial input read into
the specified variable _n_a_m_e, and the exit status is
greater than 128. If _t_i_m_e_o_u_t is 0, rreeaadd returns immedi-
ately, without trying to read any data. In this case,
the exit status is 0 if input is available on the speci-
fied file descriptor, or the read will return EOF, non-
zero otherwise.
--uu _f_d Read input from file descriptor _f_d instead of the stan-
dard input.
Other than the case where _d_e_l_i_m is the empty string, rreeaadd ig-
nores any NUL characters in the input.
If no _n_a_m_e_s are supplied, rreeaadd assigns the line read, without
the ending delimiter but otherwise unmodified, to the variable
RREEPPLLYY.
The exit status is zero, unless end-of-file is encountered, rreeaadd
times out (in which case the status is greater than 128), a
variable assignment error (such as assigning to a readonly vari-
able) occurs, or an invalid file descriptor is supplied as the
argument to --uu.
rreeaaddoonnllyy [--aaAAff] [--pp] [_n_a_m_e[=_w_o_r_d] ...]
The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s
may not be changed by subsequent assignment or unset. If the --ff
option is supplied, each _n_a_m_e refers to a shell function. The
--aa option restricts the variables to indexed arrays; the --AA op-
tion restricts the variables to associative arrays. If both op-
tions are supplied, --AA takes precedence. If no _n_a_m_e arguments
are supplied, or if the --pp option is supplied, print a list of
all readonly names. The other options may be used to restrict
the output to a subset of the set of readonly names. The --pp op-
tion displays output in a format that may be reused as input.
rreeaaddoonnllyy allows the value of a variable to be set at the same
time the readonly attribute is changed by following the variable
name with =_v_a_l_u_e. This sets the value of the variable is to
_v_a_l_u_e while modifying the readonly attribute.
The return status is 0 unless an invalid option is encountered,
one of the _n_a_m_e_s is not a valid shell variable name, or --ff is
supplied with a _n_a_m_e that is not a function.
rreettuurrnn [_n]
Stop executing a shell function or sourced file and return the
value specified by _n to its caller. If _n is omitted, the return
status is that of the last command executed. If rreettuurrnn is exe-
cuted by a trap handler, the last command used to determine the
status is the last command executed before the trap handler. If
rreettuurrnn is executed during a DDEEBBUUGG trap, the last command used to
determine the status is the last command executed by the trap
handler before rreettuurrnn was invoked.
When rreettuurrnn is used to terminate execution of a script being ex-
ecuted by the .. (ssoouurrccee) command, it causes the shell to stop
executing that script and return either _n or the exit status of
the last command executed within the script as the exit status
of the script. If _n is supplied, the return value is its least
significant 8 bits.
Any command associated with the RREETTUURRNN trap is executed before
execution resumes after the function or script.
The return status is non-zero if rreettuurrnn is supplied a non-nu-
meric argument, or is used outside a function and not during ex-
ecution of a script by .. or ssoouurrccee.
sseett [--aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [--oo _o_p_t_i_o_n_-_n_a_m_e] [----] [--] [_a_r_g ...]
sseett [++aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [++oo _o_p_t_i_o_n_-_n_a_m_e] [----] [--] [_a_r_g ...]
sseett --oo
sseett ++oo Without options, display the name and value of each shell vari-
able in a format that can be reused as input for setting or re-
setting the currently-set variables. Read-only variables cannot
be reset. In posix mode, only shell variables are listed. The
output is sorted according to the current locale. When options
are specified, they set or unset shell attributes. Any argu-
ments remaining after option processing are treated as values
for the positional parameters and are assigned, in order, to $$11,
$$22, ..., $$_n. Options, if specified, have the following mean-
ings:
--aa Each variable or function that is created or modified is
given the export attribute and marked for export to the
environment of subsequent commands.
--bb Report the status of terminated background jobs immedi-
ately, rather than before the next primary prompt or af-
ter a foreground command terminates. This is effective
only when job control is enabled.
--ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a
single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _l_i_s_t, or a _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d
(see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h(1)), exits with a non-zero
status. The shell does not exit if the command that
fails is part of the command list immediately following
a wwhhiillee or uunnttiill reserved word, part of the test follow-
ing the iiff or eelliiff reserved words, part of any command
executed in a &&&& or |||| list except the command following
the final &&&& or ||||, any command in a pipeline but the
last (subject to the state of the ppiippeeffaaiill shell op-
tion), or if the command's return value is being in-
verted with !!. If a compound command other than a sub-
shell returns a non-zero status because a command failed
while --ee was being ignored, the shell does not exit. A
trap on EERRRR, if set, is executed before the shell exits.
This option applies to the shell environment and each
subshell environment separately (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN
EENNVVIIRROONNMMEENNTT in _b_a_s_h(1)), and may cause subshells to exit
before executing all the commands in the subshell.
If a compound command or shell function executes in a
context where --ee is being ignored, none of the commands
executed within the compound command or function body
will be affected by the --ee setting, even if --ee is set
and a command returns a failure status. If a compound
command or shell function sets --ee while executing in a
context where --ee is ignored, that setting will not have
any effect until the compound command or the command
containing the function call completes.
--ff Disable pathname expansion.
--hh Remember the location of commands as they are looked up
for execution. This is enabled by default.
--kk All arguments in the form of assignment statements are
placed in the environment for a command, not just those
that precede the command name.
--mm Monitor mode. Job control is enabled. This option is
on by default for interactive shells on systems that
support it (see JJOOBB CCOONNTTRROOLL in _b_a_s_h(1)). All processes
run in a separate process group. When a background job
completes, the shell prints a line containing its exit
status.
--nn Read commands but do not execute them. This may be used
to check a shell script for syntax errors. This is ig-
nored by interactive shells.
--oo _o_p_t_i_o_n_-_n_a_m_e
The _o_p_t_i_o_n_-_n_a_m_e can be one of the following:
aalllleexxppoorrtt
Same as --aa.
bbrraacceeeexxppaanndd
Same as --BB.
eemmaaccss Use an emacs-style command line editing inter-
face. This is enabled by default when the shell
is interactive, unless the shell is started with
the ----nnooeeddiittiinngg option. This also affects the
editing interface used for rreeaadd --ee.
eerrrreexxiitt Same as --ee.
eerrrrttrraaccee
Same as --EE.
ffuunnccttrraaccee
Same as --TT.
hhaasshhaallll Same as --hh.
hhiisstteexxppaanndd
Same as --HH.
hhiissttoorryy Enable command history, as described in _b_a_s_h(1)
under HHIISSTTOORRYY. This option is on by default in
interactive shells.
iiggnnoorreeeeooff
The effect is as if the shell command had been
executed (see SShheellll VVaarriiaabblleess in _b_a_s_h(1)).
kkeeyywwoorrdd Same as --kk.
mmoonniittoorr Same as --mm.
nnoocclloobbbbeerr
Same as --CC.
nnooeexxeecc Same as --nn.
nnoogglloobb Same as --ff.
nnoolloogg Currently ignored.
nnoottiiffyy Same as --bb.
nnoouunnsseett Same as --uu.
oonneeccmmdd Same as --tt.
pphhyyssiiccaall
Same as --PP.
ppiippeeffaaiill
If set, the return value of a pipeline is the
value of the last (rightmost) command to exit
with a non-zero status, or zero if all commands
in the pipeline exit successfully. This option
is disabled by default.
ppoossiixx Enable posix mode; change the behavior of bbaasshh
where the default operation differs from the
POSIX standard to match the standard. See SSEEEE
AALLSSOO in _b_a_s_h(1) for a reference to a document
that details how posix mode affects bash's be-
havior.
pprriivviilleeggeedd
Same as --pp.
vveerrbboossee Same as --vv.
vvii Use a vi-style command line editing interface.
This also affects the editing interface used for
rreeaadd --ee.
xxttrraaccee Same as --xx.
If --oo is supplied with no _o_p_t_i_o_n_-_n_a_m_e, sseett prints the
current shell option settings. If ++oo is supplied with
no _o_p_t_i_o_n_-_n_a_m_e, sseett prints a series of sseett commands to
recreate the current option settings on the standard
output.
--pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the shell does
not read the $$EENNVV and $$BBAASSHH__EENNVV files, shell functions
are not inherited from the environment, and the SSHHEELL--
LLOOPPTTSS, BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if
they appear in the environment, are ignored. If the
shell is started with the effective user (group) id not
equal to the real user (group) id, and the --pp option is
not supplied, these actions are taken and the effective
user id is set to the real user id. If the --pp option is
supplied at startup, the effective user id is not reset.
Turning this option off causes the effective user and
group ids to be set to the real user and group ids.
--rr Enable restricted shell mode. This option cannot be un-
set once it has been set.
--tt Exit after reading and executing one command.
--uu Treat unset variables and parameters other than the spe-
cial parameters and or array variables subscripted with
or as an error when performing parameter expansion. If
expansion is attempted on an unset variable or parame-
ter, the shell prints an error message, and, if not in-
teractive, exits with a non-zero status.
--vv Print shell input lines as they are read.
--xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee
command, sseelleecctt command, or arithmetic ffoorr command, dis-
play the expanded value of PPSS44, followed by the command
and its expanded arguments or associated word list, to
the standard error.
--BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn
in _b_a_s_h(1)). This is on by default.
--CC If set, bbaasshh does not overwrite an existing file with
the >>, >>&&, and <<>> redirection operators. Using the
redirection operator >>|| instead of >> will override this
and force the creation of an output file.
--EE If set, any trap on EERRRR is inherited by shell functions,
command substitutions, and commands executed in a sub-
shell environment. The EERRRR trap is normally not inher-
ited in such cases.
--HH Enable !! style history substitution. This option is on
by default when the shell is interactive.
--PP If set, the shell does not resolve symbolic links when
executing commands such as ccdd that change the current
working directory. It uses the physical directory
structure instead. By default, bbaasshh follows the logical
chain of directories when performing commands which
change the current directory.
--TT If set, any traps on DDEEBBUUGG and RREETTUURRNN are inherited by
shell functions, command substitutions, and commands ex-
ecuted in a subshell environment. The DDEEBBUUGG and RREETTUURRNN
traps are normally not inherited in such cases.
---- If no arguments follow this option, unset the positional
parameters. Otherwise, set the positional parameters to
the _a_r_gs, even if some of them begin with a --.
-- Signal the end of options, and assign all remaining _a_r_gs
to the positional parameters. The --xx and --vv options are
turned off. If there are no _a_r_gs, the positional para-
meters remain unchanged.
The options are off by default unless otherwise noted. Using +
rather than - causes these options to be turned off. The op-
tions can also be specified as arguments to an invocation of the
shell. The current set of options may be found in $$--. The re-
turn status is always zero unless an invalid option is encoun-
tered.
sshhiifftt [_n]
Rename positional parameters from _n+1 ... to $$11 ........ Parameters
represented by the numbers $$## down to $$##-_n+1 are unset. _n must
be a non-negative number less than or equal to $$##. If _n is 0,
no parameters are changed. If _n is not given, it is assumed to
be 1. If _n is greater than $$##, the positional parameters are
not changed. The return status is greater than zero if _n is
greater than $$## or less than zero; otherwise 0.
sshhoopptt [--ppqqssuu] [--oo] [_o_p_t_n_a_m_e ...]
Toggle the values of settings controlling optional shell behav-
ior. The settings can be either those listed below, or, if the
--oo option is used, those available with the --oo option to the sseett
builtin command.
With no options, or with the --pp option, display a list of all
settable options, with an indication of whether or not each is
set; if any _o_p_t_n_a_m_e_s are supplied, the output is restricted to
those options. The --pp option displays output in a form that may
be reused as input.
Other options have the following meanings:
--ss Enable (set) each _o_p_t_n_a_m_e.
--uu Disable (unset) each _o_p_t_n_a_m_e.
--qq Suppresses normal output (quiet mode); the return status
indicates whether the _o_p_t_n_a_m_e is set or unset. If multi-
ple _o_p_t_n_a_m_e arguments are supplied with --qq, the return
status is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero oth-
erwise.
--oo Restricts the values of _o_p_t_n_a_m_e to be those defined for
the --oo option to the sseett builtin.
If either --ss or --uu is used with no _o_p_t_n_a_m_e arguments, sshhoopptt
shows only those options which are set or unset, respectively.
Unless otherwise noted, the sshhoopptt options are disabled (unset)
by default.
The return status when listing options is zero if all _o_p_t_n_a_m_e_s
are enabled, non-zero otherwise. When setting or unsetting op-
tions, the return status is zero unless an _o_p_t_n_a_m_e is not a
valid shell option.
The list of sshhoopptt options is:
aarrrraayy__eexxppaanndd__oonnccee
If set, the shell suppresses multiple evaluation of as-
sociative and indexed array subscripts during arithmetic
expression evaluation, while executing builtins that can
perform variable assignments, and while executing
builtins that perform array dereferencing.
aassssoocc__eexxppaanndd__oonnccee
Deprecated; a synonym for aarrrraayy__eexxppaanndd__oonnccee.
aauuttooccdd If set, a command name that is the name of a directory
is executed as if it were the argument to the ccdd com-
mand. This option is only used by interactive shells.
bbaasshh__ssoouurrccee__ffuullllppaatthh
If set, filenames added to the BBAASSHH__SSOOUURRCCEE array vari-
able are converted to full pathnames (see SShheellll VVaarrii--
aabblleess above).
ccddaabbllee__vvaarrss
If set, an argument to the ccdd builtin command that is
not a directory is assumed to be the name of a variable
whose value is the directory to change to.
ccddssppeellll If set, the ccdd command attempts to correct minor errors
in the spelling of a directory component. Minor errors
include transposed characters, a missing character, and
one extra character. If ccdd corrects the directory name,
it prints the corrected filename, and the command pro-
ceeds. This option is only used by interactive shells.
cchheecckkhhaasshh
If set, bbaasshh checks that a command found in the hash ta-
ble exists before trying to execute it. If a hashed
command no longer exists, bbaasshh performs a normal path
search.
cchheecckkjjoobbss
If set, bbaasshh lists the status of any stopped and running
jobs before exiting an interactive shell. If any jobs
are running, bbaasshh defers the exit until a second exit is
attempted without an intervening command (see JJOOBB CCOONN--
TTRROOLL in _b_a_s_h(1)). The shell always postpones exiting if
any jobs are stopped.
cchheecckkwwiinnssiizzee
If set, bbaasshh checks the window size after each external
(non-builtin) command and, if necessary, updates the
values of LLIINNEESS and CCOOLLUUMMNNSS, using the file descriptor
associated with the standard error if it is a terminal.
This option is enabled by default.
ccmmddhhiisstt If set, bbaasshh attempts to save all lines of a multiple-
line command in the same history entry. This allows
easy re-editing of multi-line commands. This option is
enabled by default, but only has an effect if command
history is enabled, as described in _b_a_s_h(1) under HHIISS--
TTOORRYY.
ccoommppaatt3311
ccoommppaatt3322
ccoommppaatt4400
ccoommppaatt4411
ccoommppaatt4422
ccoommppaatt4433
ccoommppaatt4444
These control aspects of the shell's compatibility mode
(see SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE in _b_a_s_h(1)).
ccoommpplleettee__ffuullllqquuoottee
If set, bbaasshh quotes all shell metacharacters in file-
names and directory names when performing completion.
If not set, bbaasshh removes metacharacters such as the dol-
lar sign from the set of characters that will be quoted
in completed filenames when these metacharacters appear
in shell variable references in words to be completed.
This means that dollar signs in variable names that ex-
pand to directories will not be quoted; however, any
dollar signs appearing in filenames will not be quoted,
either. This is active only when bash is using back-
slashes to quote completed filenames. This variable is
set by default, which is the default bash behavior in
versions through 4.2.
ddiirreexxppaanndd
If set, bbaasshh replaces directory names with the results
of word expansion when performing filename completion.
This changes the contents of the rreeaaddlliinnee editing
buffer. If not set, bbaasshh attempts to preserve what the
user typed.
ddiirrssppeellll
If set, bbaasshh attempts spelling correction on directory
names during word completion if the directory name ini-
tially supplied does not exist.
ddoottgglloobb If set, bbaasshh includes filenames beginning with a in the
results of pathname expansion. The filenames _. and _._.
must always be matched explicitly, even if ddoottgglloobb is
set.
eexxeeccffaaiill
If set, a non-interactive shell will not exit if it can-
not execute the file specified as an argument to the
eexxeecc builtin. An interactive shell does not exit if
eexxeecc fails.
eexxppaanndd__aalliiaasseess
If set, aliases are expanded as described in _b_a_s_h(1) un-
der AALLIIAASSEESS. This option is enabled by default for in-
teractive shells.
eexxttddeebbuugg
If set at shell invocation, or in a shell startup file,
arrange to execute the debugger profile before the shell
starts, identical to the ----ddeebbuuggggeerr option. If set af-
ter invocation, behavior intended for use by debuggers
is enabled:
11.. The --FF option to the ddeeccllaarree builtin displays the
source file name and line number corresponding to
each function name supplied as an argument.
22.. If the command run by the DDEEBBUUGG trap returns a
non-zero value, the next command is skipped and
not executed.
33.. If the command run by the DDEEBBUUGG trap returns a
value of 2, and the shell is executing in a sub-
routine (a shell function or a shell script exe-
cuted by the .. or ssoouurrccee builtins), the shell
simulates a call to rreettuurrnn.
44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described
in their descriptions in _b_a_s_h(1)).
55.. Function tracing is enabled: command substitu-
tion, shell functions, and subshells invoked with
(( _c_o_m_m_a_n_d )) inherit the DDEEBBUUGG and RREETTUURRNN traps.
66.. Error tracing is enabled: command substitution,
shell functions, and subshells invoked with ((
_c_o_m_m_a_n_d )) inherit the EERRRR trap.
eexxttgglloobb If set, enable the extended pattern matching features
described in _b_a_s_h(1) under PPaatthhnnaammee EExxppaannssiioonn.
eexxttqquuoottee
If set, $$_s_t_r_i_n_g and $$_s_t_r_i_n_g quoting is performed within
$${{_p_a_r_a_m_e_t_e_r}} expansions enclosed in double quotes. This
option is enabled by default.
ffaaiillgglloobb
If set, patterns which fail to match filenames during
pathname expansion result in an expansion error.
ffoorrccee__ffiiggnnoorree
If set, the suffixes specified by the FFIIGGNNOORREE shell
variable cause words to be ignored when performing word
completion even if the ignored words are the only possi-
ble completions. See SShheellll VVaarriiaabblleess in _b_a_s_h(1) for a
description of FFIIGGNNOORREE. This option is enabled by de-
fault.
gglloobbaasscciiiirraannggeess
If set, range expressions used in pattern matching
bracket expressions (see PPaatttteerrnn MMaattcchhiinngg in _b_a_s_h(1))
behave as if in the traditional C locale when performing
comparisons. That is, pattern matching does not take
the current locale's collating sequence into account, so
bb will not collate between AA and BB, and upper-case and
lower-case ASCII characters will collate together.
gglloobbsskkiippddoottss
If set, pathname expansion will never match the file-
names _. and _._. even if the pattern begins with a This
option is enabled by default.
gglloobbssttaarr
If set, the pattern **** used in a pathname expansion con-
text will match all files and zero or more directories
and subdirectories. If the pattern is followed by a //,
only directories and subdirectories match.
ggnnuu__eerrrrffmmtt
If set, shell error messages are written in the standard
GNU error message format.
hhiissttaappppeenndd
If set, the history list is appended to the file named
by the value of the HHIISSTTFFIILLEE variable when the shell ex-
its, rather than overwriting the file.
hhiissttrreeeeddiitt
If set, and rreeaaddlliinnee is being used, the user is given
the opportunity to re-edit a failed history substitu-
tion.
hhiissttvveerriiffyy
If set, and rreeaaddlliinnee is being used, the results of his-
tory substitution are not immediately passed to the
shell parser. Instead, the resulting line is loaded
into the rreeaaddlliinnee editing buffer, allowing further modi-
fication.
hhoossttccoommpplleettee
If set, and rreeaaddlliinnee is being used, bbaasshh will attempt to
perform hostname completion when a word containing a @@
is being completed (see CCoommpplleettiinngg under RREEAADDLLIINNEE in
_b_a_s_h(1)). This is enabled by default.
hhuuppoonneexxiitt
If set, bbaasshh will send SSIIGGHHUUPP to all jobs when an inter-
active login shell exits.
iinnhheerriitt__eerrrreexxiitt
If set, command substitution inherits the value of the
eerrrreexxiitt option, instead of unsetting it in the subshell
environment. This option is enabled when posix mode is
enabled.
iinntteerraaccttiivvee__ccoommmmeennttss
In an interactive shell, a word beginning with ## causes
that word and all remaining characters on that line to
be ignored, as in a non-interactive shell (see CCOOMMMMEENNTTSS
in _b_a_s_h(1)). This option is enabled by default.
llaassttppiippee
If set, and job control is not active, the shell runs
the last command of a pipeline not executed in the back-
ground in the current shell environment.
lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line
commands are saved to the history with embedded newlines
rather than using semicolon separators where possible.
llooccaallvvaarr__iinnhheerriitt
If set, local variables inherit the value and attributes
of a variable of the same name that exists at a previous
scope before any new value is assigned. The nameref at-
tribute is not inherited.
llooccaallvvaarr__uunnsseett
If set, calling uunnsseett on local variables in previous
function scopes marks them so subsequent lookups find
them unset until that function returns. This is identi-
cal to the behavior of unsetting local variables at the
current function scope.
llooggiinn__sshheellll
The shell sets this option if it is started as a login
shell (see IINNVVOOCCAATTIIOONN in _b_a_s_h(1)). The value may not be
changed.
mmaaiillwwaarrnn
If set, and a file that bbaasshh is checking for mail has
been accessed since the last time it was checked, bbaasshh
displays the message
nnoo__eemmppttyy__ccmmdd__ccoommpplleettiioonn
If set, and rreeaaddlliinnee is being used, bbaasshh does not search
PPAATTHH for possible completions when completion is at-
tempted on an empty line.
nnooccaasseegglloobb
If set, bbaasshh matches filenames in a case-insensitive
fashion when performing pathname expansion (see PPaatthhnnaammee
EExxppaannssiioonn in _b_a_s_h(1)).
nnooccaasseemmaattcchh
If set, bbaasshh matches patterns in a case-insensitive
fashion when performing matching while executing ccaassee or
[[[[ conditional commands, when performing pattern substi-
tution word expansions, or when filtering possible com-
pletions as part of programmable completion.
nnooeexxppaanndd__ttrraannssllaattiioonn
If set, bbaasshh encloses the translated results of $$...
quoting in single quotes instead of double quotes. If
the string is not translated, this has no effect.
nnuullllgglloobb
If set, pathname expansion patterns which match no files
(see PPaatthhnnaammee EExxppaannssiioonn in _b_a_s_h(1)) expand to nothing
and are removed, rather than expanding to themselves.
ppaattssuubb__rreeppllaacceemmeenntt
If set, bbaasshh expands occurrences of && in the replacement
string of pattern substitution to the text matched by
the pattern, as described under PPaarraammeetteerr EExxppaannssiioonn in
_b_a_s_h(1). This option is enabled by default.
pprrooggccoommpp
If set, enable the programmable completion facilities
(see PPrrooggrraammmmaabbllee CCoommpplleettiioonn in _b_a_s_h(1)). This option
is enabled by default.
pprrooggccoommpp__aalliiaass
If set, and programmable completion is enabled, bbaasshh
treats a command name that doesn't have any completions
as a possible alias and attempts alias expansion. If it
has an alias, bbaasshh attempts programmable completion us-
ing the command word resulting from the expanded alias.
pprroommppttvvaarrss
If set, prompt strings undergo parameter expansion, com-
mand substitution, arithmetic expansion, and quote re-
moval after being expanded as described in PPRROOMMPPTTIINNGG in
_b_a_s_h(1). This option is enabled by default.
rreessttrriicctteedd__sshheellll
The shell sets this option if it is started in re-
stricted mode (see RREESSTTRRIICCTTEEDD SSHHEELLLL in _b_a_s_h(1)). The
value may not be changed. This is not reset when the
startup files are executed, allowing the startup files
to discover whether or not a shell is restricted.
sshhiifftt__vveerrbboossee
If set, the sshhiifftt builtin prints an error message when
the shift count exceeds the number of positional parame-
ters.
ssoouurrcceeppaatthh
If set, the .. (ssoouurrccee) builtin uses the value of PPAATTHH to
find the directory containing the file supplied as an
argument when the --pp option is not supplied. This op-
tion is enabled by default.
vvaarrrreeddiirr__cclloossee
If set, the shell automatically closes file descriptors
assigned using the _{_v_a_r_n_a_m_e_} redirection syntax (see
RREEDDIIRREECCTTIIOONN in _b_a_s_h(1)) instead of leaving them open
when the command completes.
xxppgg__eecchhoo
If set, the eecchhoo builtin expands backslash-escape se-
quences by default. If the ppoossiixx shell option is also
enabled, eecchhoo does not interpret any options.
ssuussppeenndd [--ff]
Suspend the execution of this shell until it receives a SSIIGGCCOONNTT
signal. A login shell, or a shell without job control enabled,
cannot be suspended; the --ff option will override this and force
the suspension. The return status is 0 unless the shell is a
login shell or job control is not enabled and --ff is not sup-
plied.
tteesstt _e_x_p_r
[[ _e_x_p_r ]]
Return a status of 0 (true) or 1 (false) depending on the evalu-
ation of the conditional expression _e_x_p_r. Each operator and
operand must be a separate argument. Expressions are composed
of the primaries described in _b_a_s_h(1) under CCOONNDDIITTIIOONNAALL EEXXPPRREESS--
SSIIOONNSS. tteesstt does not accept any options, nor does it accept and
ignore an argument of ---- as signifying the end of options.
Expressions may be combined using the following operators,
listed in decreasing order of precedence. The evaluation de-
pends on the number of arguments; see below. tteesstt uses operator
precedence when there are five or more arguments.
!! _e_x_p_r True if _e_x_p_r is false.
(( _e_x_p_r ))
Returns the value of _e_x_p_r. This may be used to override
normal operator precedence.
_e_x_p_r_1 -aa _e_x_p_r_2
True if both _e_x_p_r_1 and _e_x_p_r_2 are true.
_e_x_p_r_1 -oo _e_x_p_r_2
True if either _e_x_p_r_1 or _e_x_p_r_2 is true.
tteesstt and [[ evaluate conditional expressions using a set of rules
based on the number of arguments.
0 arguments
The expression is false.
1 argument
The expression is true if and only if the argument is not
null.
2 arguments
If the first argument is !!, the expression is true if and
only if the second argument is null. If the first argu-
ment is one of the unary conditional operators listed in
_b_a_s_h(1) under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is
true if the unary test is true. If the first argument is
not a valid unary conditional operator, the expression is
false.
3 arguments
The following conditions are applied in the order listed.
If the second argument is one of the binary conditional
operators listed in _b_a_s_h(1) under CCOONNDDIITTIIOONNAALL EEXXPPRREESS--
SSIIOONNSS, the result of the expression is the result of the
binary test using the first and third arguments as
operands. The --aa and --oo operators are considered binary
operators when there are three arguments. If the first
argument is !!, the value is the negation of the two-argu-
ment test using the second and third arguments. If the
first argument is exactly (( and the third argument is ex-
actly )), the result is the one-argument test of the sec-
ond argument. Otherwise, the expression is false.
4 arguments
The following conditions are applied in the order listed.
If the first argument is !!, the result is the negation of
the three-argument expression composed of the remaining
arguments. If the first argument is exactly (( and the
fourth argument is exactly )), the result is the two-argu-
ment test of the second and third arguments. Otherwise,
the expression is parsed and evaluated according to
precedence using the rules listed above.
5 or more arguments
The expression is parsed and evaluated according to
precedence using the rules listed above.
When the shell is in posix mode, or if the expression is part of
the [[[[ command, the << and >> operators sort using the current lo-
cale. If the shell is not in posix mode, the tteesstt and [[ com-
mands sort lexicographically using ASCII ordering.
The historical operator-precedence parsing with 4 or more argu-
ments can lead to ambiguities when it encounters strings that
look like primaries. The POSIX standard has deprecated the --aa
and --oo primaries and enclosing expressions within parentheses.
Scripts should no longer use them. It's much more reliable to
restrict test invocations to a single primary, and to replace
uses of --aa and --oo with the shell's &&&& and |||| list operators.
ttiimmeess Print the accumulated user and system times for the shell and
for processes run from the shell. The return status is 0.
ttrraapp [--llppPP] [[_a_c_t_i_o_n] _s_i_g_s_p_e_c ...]
The _a_c_t_i_o_n is a command that is read and executed when the shell
receives any of the signals _s_i_g_s_p_e_c. If _a_c_t_i_o_n is absent (and
there is a single _s_i_g_s_p_e_c) or --, each specified _s_i_g_s_p_e_c is reset
to the value it had when the shell was started. If _a_c_t_i_o_n is
the null string the signal specified by each _s_i_g_s_p_e_c is ignored
by the shell and by the commands it invokes.
If no arguments are supplied, ttrraapp displays the actions associ-
ated with each trapped signal as a set of ttrraapp commands that can
be reused as shell input to restore the current signal disposi-
tions. If --pp is given, and _a_c_t_i_o_n is not present, then ttrraapp
displays the actions associated with each _s_i_g_s_p_e_c or, if none
are supplied, for all trapped signals, as a set of ttrraapp commands
that can be reused as shell input to restore the current signal
dispositions. The --PP option behaves similarly, but displays
only the actions associated with each _s_i_g_s_p_e_c argument. --PP re-
quires at least one _s_i_g_s_p_e_c argument. The --PP or --pp options may
be used in a subshell environment (e.g., command substitution)
and, as long as they are used before ttrraapp is used to change a
signal's handling, will display the state of its parent's traps.
The --ll option prints a list of signal names and their corre-
sponding numbers. Each _s_i_g_s_p_e_c is either a signal name defined
in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are case insen-
sitive and the SSIIGG prefix is optional. If --ll is supplied with
no _s_i_g_s_p_e_c arguments, it prints a list of valid signal names.
If a _s_i_g_s_p_e_c is EEXXIITT (0), _a_c_t_i_o_n is executed on exit from the
shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, _a_c_t_i_o_n is executed before every
_s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command, _s_e_l_e_c_t command, ((
arithmetic command, [[ conditional command, arithmetic _f_o_r com-
mand, and before the first command executes in a shell function
(see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h(1)). Refer to the description of the
eexxttddeebbuugg shell option (see sshhoopptt in _b_a_s_h(1)) for details of its
effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is RREETTUURRNN, _a_c_t_i_o_n is ex-
ecuted each time a shell function or a script executed with the
.. or ssoouurrccee builtins finishes executing.
If a _s_i_g_s_p_e_c is EERRRR, _a_c_t_i_o_n is executed whenever a pipeline
(which may consist of a single simple command), a list, or a
compound command returns a non-zero exit status, subject to the
following conditions. The EERRRR trap is not executed if the
failed command is part of the command list immediately following
a wwhhiillee or uunnttiill reserved word, part of the test in an _i_f state-
ment, part of a command executed in a &&&& or |||| list except the
command following the final &&&& or ||||, any command in a pipeline
but the last (subject to the state of the ppiippeeffaaiill shell op-
tion), or if the command's return value is being inverted using
!!. These are the same conditions obeyed by the eerrrreexxiitt (--ee) op-
tion.
When the shell is not interactive, signals ignored upon entry to
the shell cannot be trapped or reset. Interactive shells permit
trapping signals ignored on entry. Trapped signals that are not
being ignored are reset to their original values in a subshell
or subshell environment when one is created. The return status
is false if any _s_i_g_s_p_e_c is invalid; otherwise ttrraapp returns true.
ttrruuee Does nothing, returns a 0 status.
ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...]
Indicate how each _n_a_m_e would be interpreted if used as a command
name.
If the --tt option is used, ttyyppee prints a string which is one of
_a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or _f_i_l_e if _n_a_m_e is an alias,
shell reserved word, function, builtin, or executable file, re-
spectively. If the _n_a_m_e is not found, ttyyppee prints nothing and
returns a non-zero exit status.
If the --pp option is used, ttyyppee either returns the pathname of
the executable file that would be found by searching $$PPAATTHH for
_n_a_m_e or nothing if would not return _f_i_l_e. The --PP option forces
a PPAATTHH search for each _n_a_m_e, even if would not return _f_i_l_e. If
_n_a_m_e is present in the table of hashed commands, --pp and --PP print
the hashed value, which is not necessarily the file that appears
first in PPAATTHH.
If the --aa option is used, ttyyppee prints all of the places that
contain a command named _n_a_m_e. This includes aliases, reserved
words, functions, and builtins, but the path search options (--pp
and --PP) can be supplied to restrict the output to executable
files. ttyyppee does not consult the table of hashed commands when
using --aa with --pp, and only performs a PPAATTHH search for _n_a_m_e.
The --ff option suppresses shell function lookup, as with the ccoomm--
mmaanndd builtin. ttyyppee returns true if all of the arguments are
found, false if any are not found.
uulliimmiitt [--HHSS] --aa
uulliimmiitt [--HHSS] [--bbccddeeffiikkllmmnnppqqrrssttuuvvxxPPRRTT [_l_i_m_i_t]]
Provides control over the resources available to the shell and
to processes it starts, on systems that allow such control.
The --HH and --SS options specify whether the hard or soft limit is
set for the given resource. A hard limit cannot be increased by
a non-root user once it is set; a soft limit may be increased up
to the value of the hard limit. If neither --HH nor --SS is speci-
fied, uulliimmiitt sets both the soft and hard limits.
The value of _l_i_m_i_t can be a number in the unit specified for the
resource or one of the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd,
which stand for the current hard limit, the current soft limit,
and no limit, respectively. If _l_i_m_i_t is omitted, uulliimmiitt prints
the current value of the soft limit of the resource, unless the
--HH option is given. When more than one resource is specified,
the limit name and unit, if appropriate, are printed before the
value. Other options are interpreted as follows:
--aa Report all current limits; no limits are set.
--bb The maximum socket buffer size.
--cc The maximum size of core files created.
--dd The maximum size of a process's data segment.
--ee The maximum scheduling priority (
--ff The maximum size of files written by the shell and its
children.
--ii The maximum number of pending signals.
--kk The maximum number of kqueues that may be allocated.
--ll The maximum size that may be locked into memory.
--mm The maximum resident set size (many systems do not honor
this limit).
--nn The maximum number of open file descriptors (most systems
do not allow this value to be set).
--pp The pipe size in 512-byte blocks (this may not be set).
--qq The maximum number of bytes in POSIX message queues.
--rr The maximum real-time scheduling priority.
--ss The maximum stack size.
--tt The maximum amount of cpu time in seconds.
--uu The maximum number of processes available to a single
user.
--vv The maximum amount of virtual memory available to the
shell and, on some systems, to its children.
--xx The maximum number of file locks.
--PP The maximum number of pseudoterminals.
--RR The maximum time a real-time process can run before
blocking, in microseconds.
--TT The maximum number of threads.
If _l_i_m_i_t is supplied, and the --aa option is not used, _l_i_m_i_t is
the new value of the specified resource. If no option is sup-
plied, then --ff is assumed.
Values are in 1024-byte increments, except for --tt, which is in
seconds; --RR, which is in microseconds; --pp, which is in units of
512-byte blocks; --PP, --TT, --bb, --kk, --nn, and --uu, which are unscaled
values; and, when in posix mode, --cc and --ff, which are in
512-byte increments. The return status is 0 unless an invalid
option or argument is supplied, or an error occurs while setting
a new limit.
uummaasskk [--pp] [--SS] [_m_o_d_e]
Set the user file-creation mask to _m_o_d_e. If _m_o_d_e begins with a
digit, it is interpreted as an octal number; otherwise it is in-
terpreted as a symbolic mode mask similar to that accepted by
_c_h_m_o_d(1). If _m_o_d_e is omitted, uummaasskk prints the current value of
the mask. The --SS option without a _m_o_d_e argument prints the mask
in a symbolic format; the default output is an octal number. If
the --pp option is supplied, and _m_o_d_e is omitted, the output is in
a form that may be reused as input. The return status is zero
if the mode was successfully changed or if no _m_o_d_e argument was
supplied, and non-zero otherwise.
uunnaalliiaass [-aa] [_n_a_m_e ...]
Remove each _n_a_m_e from the list of defined aliases. If --aa is
supplied, remove all alias definitions. The return value is
true unless a supplied _n_a_m_e is not a defined alias.
uunnsseett [-ffvv] [-nn] [_n_a_m_e ...]
For each _n_a_m_e, remove the corresponding variable or function.
If the --vv option is given, each _n_a_m_e refers to a shell variable,
and that variable is removed. If --ff is specified, each _n_a_m_e
refers to a shell function, and the function definition is re-
moved. If the --nn option is supplied, and _n_a_m_e is a variable
with the _n_a_m_e_r_e_f attribute, _n_a_m_e will be unset rather than the
variable it references. --nn has no effect if the --ff option is
supplied. Read-only variables and functions may not be unset.
When variables or functions are removed, they are also removed
from the environment passed to subsequent commands. If no op-
tions are supplied, each _n_a_m_e refers to a variable; if there is
no variable by that name, a function with that name, if any, is
unset. Some shell variables may not be unset. If any of
BBAASSHH__AALLIIAASSEESS, BBAASSHH__AARRGGVV00, BBAASSHH__CCMMDDSS, BBAASSHH__CCOOMMMMAANNDD, BBAASSHH__SSUUBB--
SSHHEELLLL, BBAASSHHPPIIDD, CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE,
EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCCNNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECC--
OONNDDSS, or SSRRAANNDDOOMM are unset, they lose their special properties,
even if they are subsequently reset. The exit status is true
unless a _n_a_m_e is readonly or may not be unset.
wwaaiitt [--ffnn] [--pp _v_a_r_n_a_m_e] [_i_d ...]
Wait for each specified child process _i_d and return the termina-
tion status of the last _i_d. Each _i_d may be a process ID _p_i_d or
a job specification _j_o_b_s_p_e_c; if a jobspec is supplied, wwaaiitt
waits for all processes in the job.
If no options or _i_ds are supplied, wwaaiitt waits for all running
background jobs and the last-executed process substitution, if
its process id is the same as $$!!, and the return status is zero.
If the --nn option is supplied, wwaaiitt waits for any one of the
given _i_ds or, if no _i_ds are supplied, any job or process substi-
tution, to complete and returns its exit status. If none of the
supplied _i_ds is a child of the shell, or if no _i_ds are supplied
and the shell has no unwaited-for children, the exit status is
127.
If the --pp option is supplied, wwaaiitt assigns the process or job
identifier of the job for which the exit status is returned to
the variable _v_a_r_n_a_m_e named by the option argument. The vari-
able, which cannot be readonly, will be unset initially, before
any assignment. This is useful only when used with the --nn op-
tion.
Supplying the --ff option, when job control is enabled, forces
wwaaiitt to wait for each _i_d to terminate before returning its sta-
tus, instead of returning when it changes status.
If none of the _i_ds specify one of the shell's active child
processes, the return status is 127. If wwaaiitt is interrupted by
a signal, any _v_a_r_n_a_m_e will remain unset, and the return status
will be greater than 128, as described under SSIIGGNNAALLSS in _b_a_s_h(1).
Otherwise, the return status is the exit status of the last _i_d.
SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE
Bash-4.0 introduced the concept of a _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci-
fied as a set of options to the shopt builtin (ccoommppaatt3311, ccoommppaatt3322, ccoomm--
ppaatt4400, ccoommppaatt4411, and so on). There is only one current compatibility
level -- each option is mutually exclusive. The compatibility level is
intended to allow users to select behavior from previous versions that
is incompatible with newer versions while they migrate scripts to use
current features and behavior. It's intended to be a temporary solu-
tion.
This section does not mention behavior that is standard for a particu-
lar version (e.g., setting ccoommppaatt3322 means that quoting the right hand
side of the regexp matching operator quotes special regexp characters
in the word, which is default behavior in bash-3.2 and subsequent ver-
sions).
If a user enables, say, ccoommppaatt3322, it may affect the behavior of other
compatibility levels up to and including the current compatibility
level. The idea is that each compatibility level controls behavior
that changed in that version of bbaasshh, but that behavior may have been
present in earlier versions. For instance, the change to use locale-
based comparisons with the [[[[ command came in bash-4.1, and earlier
versions used ASCII-based comparisons, so enabling ccoommppaatt3322 will enable
ASCII-based comparisons as well. That granularity may not be suffi-
cient for all uses, and as a result users should employ compatibility
levels carefully. Read the documentation for a particular feature to
find out the current behavior.
Bash-4.3 introduced a new shell variable: BBAASSHH__CCOOMMPPAATT. The value as-
signed to this variable (a decimal version number like 4.2, or an inte-
ger corresponding to the ccoommppaatt_N_N option, like 42) determines the com-
patibility level.
Starting with bash-4.4, bbaasshh began deprecating older compatibility lev-
els. Eventually, the options will be removed in favor of BBAASSHH__CCOOMMPPAATT.
Bash-5.0 was the final version for which there was an individual shopt
option for the previous version. BBAASSHH__CCOOMMPPAATT is the only mechanism to
control the compatibility level in versions newer than bash-5.0.
The following table describes the behavior changes controlled by each
compatibility level setting. The ccoommppaatt_N_N tag is used as shorthand for
setting the compatibility level to _N_N using one of the following mecha-
nisms. For versions prior to bash-5.0, the compatibility level may be
set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and
later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re-
quired for bash-5.1 and later versions.
ccoommppaatt3311
+o Quoting the rhs of the [[[[ command's regexp matching oper-
ator (=) has no special effect.
ccoommppaatt3322
+o The << and >> operators to the [[[[ command do not consider
the current locale when comparing strings; they use ASCII
ordering.
ccoommppaatt4400
+o The << and >> operators to the [[[[ command do not consider
the current locale when comparing strings; they use ASCII
ordering. BBaasshh versions prior to bash-4.1 use ASCII col-
lation and _s_t_r_c_m_p(3); bash-4.1 and later use the current
locale's collation sequence and _s_t_r_c_o_l_l(3).
ccoommppaatt4411
+o In posix mode, ttiimmee may be followed by options and still
be recognized as a reserved word (this is POSIX interpre-
tation 267).
+o In _p_o_s_i_x mode, the parser requires that an even number of
single quotes occur in the _w_o_r_d portion of a double-
quoted parameter expansion and treats them specially, so
that characters within the single quotes are considered
quoted (this is POSIX interpretation 221).
ccoommppaatt4422
+o The replacement string in double-quoted pattern substitu-
tion does not undergo quote removal, as it does in ver-
sions after bash-4.2.
+o In posix mode, single quotes are considered special when
expanding the _w_o_r_d portion of a double-quoted parameter
expansion and can be used to quote a closing brace or
other special character (this is part of POSIX interpre-
tation 221); in later versions, single quotes are not
special within double-quoted word expansions.
ccoommppaatt4433
+o Word expansion errors are considered non-fatal errors
that cause the current command to fail, even in posix
mode (the default behavior is to make them fatal errors
that cause the shell to exit).
+o When executing a shell function, the loop state
(while/until/etc.) is not reset, so bbrreeaakk or ccoonnttiinnuuee in
that function will break or continue loops in the calling
context. Bash-4.4 and later reset the loop state to pre-
vent this.
ccoommppaatt4444
+o The shell sets up the values used by BBAASSHH__AARRGGVV and
BBAASSHH__AARRGGCC so they can expand to the shell's positional
parameters even if extended debugging mode is not en-
abled.
+o A subshell inherits loops from its parent context, so
bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit.
Bash-5.0 and later reset the loop state to prevent the
exit
+o Variable assignments preceding builtins like eexxppoorrtt and
rreeaaddoonnllyy that set attributes continue to affect variables
with the same name in the calling environment even if the
shell is not in posix mode.
ccoommppaatt5500
+o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro-
duce slightly more randomness. If the shell compatibil-
ity level is set to 50 or lower, it reverts to the method
from bash-5.0 and previous versions, so seeding the ran-
dom number generator by assigning a value to RRAANNDDOOMM will
produce the same sequence as in bash-5.0.
+o If the command hash table is empty, bash versions prior
to bash-5.1 printed an informational message to that ef-
fect, even when producing output that can be reused as
input. Bash-5.1 suppresses that message when the --ll op-
tion is supplied.
ccoommppaatt5511
+o The uunnsseett builtin treats attempts to unset array sub-
scripts @@ and ** differently depending on whether the ar-
ray is indexed or associative, and differently than in
previous versions.
+o Arithmetic commands ( ((((...)))) ) and the expressions in an
arithmetic for statement can be expanded more than once.
+o Expressions used as arguments to arithmetic operators in
the [[[[ conditional command can be expanded more than
once.
+o The expressions in substring parameter brace expansion
can be expanded more than once.
+o The expressions in the $$((((...)))) word expansion can be ex-
panded more than once.
+o Arithmetic expressions used as indexed array subscripts
can be expanded more than once.
+o tteesstt --vv, when given an argument of AA[[@@]], where AA is an
existing associative array, will return true if the array
has any set elements. Bash-5.2 will look for and report
on a key named @@.
+o The ${_p_a_r_a_m_e_t_e_r[[::]]==_v_a_l_u_e} word expansion will return
_v_a_l_u_e, before any variable-specific transformations have
been performed (e.g., converting to lowercase). Bash-5.2
will return the final value assigned to the variable.
+o Parsing command substitutions will behave as if extended
globbing (see the description of the sshhoopptt builtin above)
is enabled, so that parsing a command substitution con-
taining an extglob pattern (say, as part of a shell func-
tion) will not fail. This assumes the intent is to en-
able extglob before the command is executed and word ex-
pansions are performed. It will fail at word expansion
time if extglob hasn't been enabled by the time the com-
mand is executed.
ccoommppaatt5522
+o The tteesstt builtin uses its historical algorithm to parse
parenthesized subexpressions when given five or more ar-
guments.
+o If the --pp or --PP option is supplied to the bbiinndd builtin,
bbiinndd treats any arguments remaining after option process-
ing as bindable command names, and displays any key se-
quences bound to those commands, instead of treating the
arguments as key sequences to bind.
SSEEEE AALLSSOO
bash(1), sh(1)
GNU Bash 5.2 2023 January 27 _B_A_S_H___B_U_I_L_T_I_N_S(1)
|