diff --git a/data/factoids b/data/factoids index 06951f58..e2794869 100644 --- a/data/factoids +++ b/data/factoids @@ -4,12 +4,12 @@ action: the unary boolean not operator created_on: 1104600621 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1442010781.94147 +last_referenced_on: 1445516719.27966 noembed: 1 owner: Major-Willard rate_limit: 15 -ref_count: 139 -ref_user: jd_1!~jd1@unaffiliated/jd1 +ref_count: 141 +ref_user: rm-r!~rm-rf@unaffiliated/rm-r type: text @@ -41,37 +41,38 @@ type: text action: true created_on: 1270856176 enabled: 1 -last_referenced_in: #pbot2 -last_referenced_on: 1408886621.32058 +last_referenced_in: gorroth +last_referenced_on: 1445119047.37537 owner: pragma_ rate_limit: 15 -ref_count: 4 -ref_user: OldDog!~Le@ip-83-134-247-209.dsl.scarlet.be +ref_count: 5 +ref_user: gorroth!~pi@unaffiliated/gorroth type: text <"> action: the character that begins and terminates a string literal created_on: 1106527346 enabled: 1 -last_referenced_in: radialneon -last_referenced_on: 1436826916.91905 +last_referenced_in: gorroth +last_referenced_on: 1445119084.54369 noembed: 1 owner: Major-Willard rate_limit: 15 -ref_count: 5 -ref_user: radialneon!~radialneo@187.59.143.241 +ref_count: 6 +ref_user: gorroth!~pi@unaffiliated/gorroth type: text <#> action: used to commence a preprocessor directive (include, define, undef, ifdef, ifndef, pragma) and as the stringization operator (#x). created_on: 1197579677 enabled: 1 -last_referenced_in: yar| -last_referenced_on: 1441021189.59948 +last_referenced_in: gorroth +last_referenced_on: 1445119103.26576 +noembed: 1 owner: Auris- rate_limit: 15 -ref_count: 11 -ref_user: yar|!~yarl_@unaffiliated/y4r1 +ref_count: 12 +ref_user: gorroth!~pi@unaffiliated/gorroth type: text <##> @@ -90,35 +91,37 @@ type: text action: /say ##c is for discussion involving the C programming language itself. We do not deal with the whole range of the spectrum. libgtk may be written in C, but this is hardly the proper channel for GTK-related questions. Try #gtk. Likewise, makefiles and autotools: #devtools, assembly: #asm, Xlib: #xlib, C++: #c++, and so on. created_on: 1245454768 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1440036423.64174 +last_referenced_in: fluter +last_referenced_on: 1445940926.52987 +noembed: 1 owner: anttil rate_limit: 15 -ref_count: 28 -ref_user: Mode!~izabera@unaffiliated/izabera +ref_count: 29 +ref_user: fluter!~fluter@fedora/fluter type: text <#c> action: /call ##c created_on: 1109029677 enabled: 1 -last_referenced_on: 1376070654.17013 +last_referenced_in: fluter +last_referenced_on: 1445940926.51094 owner: pragma_ rate_limit: 15 -ref_count: 27 -ref_user: oleo!~oleo@xdsl-78-35-151-71.netcologne.de +ref_count: 28 +ref_user: fluter!~fluter@fedora/fluter type: text <#c++> action: not ##C - down the hall, down the stairs, next to the boiler-room - across from ##C-sharp. (##objc is behind the boilers - be careful). created_on: 1278891031.30827 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1316287773.02247 +last_referenced_in: fluter +last_referenced_on: 1445940937.10026 owner: PoppaVic rate_limit: 15 -ref_count: 22 -ref_user: PoppaVic +ref_count: 23 +ref_user: fluter!~fluter@fedora/fluter type: text <$> @@ -139,6 +142,7 @@ created_on: 1106531636 enabled: 1 last_referenced_in: ##c last_referenced_on: 1435929441.56942 +noembed: 1 owner: Major-Willard rate_limit: 15 ref_count: 7 @@ -149,10 +153,12 @@ type: text action: digraph alternative for # created_on: 1104401858 enabled: 1 +last_referenced_in: fluter +last_referenced_on: 1445940947.26815 owner: twkm rate_limit: 15 -ref_count: 0 -ref_user: nobody +ref_count: 1 +ref_user: fluter!~fluter@fedora/fluter type: text <%:%:> @@ -179,12 +185,12 @@ type: text action: a candide extension written by Wulf created_on: 1331879495.431 enabled: 1 -last_referenced_in: wlhlm -last_referenced_on: 1374272008.66831 +last_referenced_in: fluter +last_referenced_on: 1445940784.89189 owner: pragma_ rate_limit: 15 -ref_count: 1 -ref_user: wlhlm +ref_count: 2 +ref_user: fluter!~fluter@fedora/fluter type: text <%d> @@ -242,6 +248,7 @@ edited_on: 1385023744.37752 enabled: 1 last_referenced_in: edk last_referenced_on: 1425930396.32489 +noembed: 1 owner: Major-Willard rate_limit: 15 ref_count: 21 @@ -350,6 +357,7 @@ created_on: 1104600319 enabled: 1 last_referenced_in: ##c last_referenced_on: 1441639325.31001 +noembed: 1 owner: Major-Willard rate_limit: 15 ref_count: 33 @@ -382,6 +390,7 @@ created_on: 1104595760 enabled: 1 last_referenced_in: ##c last_referenced_on: 1360739839.26402 +noembed: 1 owner: Major-Willard rate_limit: 15 ref_count: 9 @@ -414,13 +423,13 @@ type: text action: the sequence operator. It is also used to separate syntactic elements of: function arguments in a function call, declarators (in declarations of the same type), formal parameters in function declarations, enumeration elements, and initializers. created_on: 1107316491 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1441844157.70765 +last_referenced_in: edk +last_referenced_on: 1442796360.19679 noembed: 1 owner: prec rate_limit: 15 -ref_count: 61 -ref_user: kuldeepdhaka!~kuldeepdh@unaffiliated/kuldeepdhaka +ref_count: 65 +ref_user: edk!~edk@spy/edk0 type: text <-> @@ -462,12 +471,12 @@ type: text action: the operator that dereferences a pointer to permit access to a structure/union member. The expressions (x->y) and ((*x).y) are equivalent. created_on: 1104601334 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1424716312.44614 +last_referenced_in: #cjeopardy +last_referenced_on: 1443613620.76421 owner: Major-Willard rate_limit: 15 -ref_count: 32 -ref_user: cousteau!~cousteau@80.174.59.26.dyn.user.ono.com +ref_count: 33 +ref_user: danielcamiel!~danielcam@unaffiliated/danielcamiel type: text <-Wall> @@ -537,21 +546,25 @@ action: an ellipsis; used to mark a function or macro as variadic. variadic mac created_on: 1106943402 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1422219155.15185 +last_referenced_on: 1442549206.41276 +noembed: 1 owner: prec rate_limit: 15 -ref_count: 25 -ref_user: Wulf!~Wulf@unaffiliated/wulf +ref_count: 26 +ref_user: sm0ke!~sm0ke@unaffiliated/sm0ke type: text action: the division binary operator created_on: 1104600246 enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1443152700.58633 +noembed: 1 owner: Major-Willard rate_limit: 15 -ref_count: 0 -ref_user: nobody +ref_count: 1 +ref_user: CaZe!~caze@unaffiliated/caze type: text @@ -965,12 +978,12 @@ type: text action: an integer constant expression, with type int and a negative value, that is returned by several functions to indicate end-of-file (ISO/IEC 9899:1999 7.19.1p3). It is NOT a char. It is NOT a byte that is stored at the end of every file. created_on: 1104596552 enabled: 1 -last_referenced_in: kate -last_referenced_on: 1420241637.48904 +last_referenced_in: ##c +last_referenced_on: 1444355375.81766 owner: infobahn rate_limit: 15 -ref_count: 65 -ref_user: kate!~kate@unaffiliated/kate +ref_count: 66 +ref_user: Wulf!~Wulf@unaffiliated/wulf type: text @@ -997,12 +1010,12 @@ type: text action: "C - A Reference Manual" by Harbison & Steele; a reference for C on par with K&R - http://www.amazon.com/Reference-Manual-Samuel-P-Harbison/dp/013089592X created_on: 1109636091 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1441369337.33844 +last_referenced_in: #pbot2-test +last_referenced_on: 1444473879.04541 owner: heina rate_limit: 15 -ref_count: 245 -ref_user: chrs_!chris@2600:3c03::f03c:91ff:fe73:e436 +ref_count: 248 +ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos type: text @@ -1034,23 +1047,23 @@ edited_by: edk!~edk@spy/edk0 edited_on: 1440984429.23248 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1442211949.238 +last_referenced_on: 1446032358.99582 owner: Chris rate_limit: 15 -ref_count: 723 -ref_user: Trigraph!Trigraph@unaffiliated/trigraph +ref_count: 764 +ref_user: Chris!sid107964@spy/chris type: text action: a compiler infrastructure written in C++ -- http://llvm.org/ created_on: 1330538578.87232 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1330598898.54294 +last_referenced_in: pessimist +last_referenced_on: 1445454142.52538 owner: meta-coder rate_limit: 15 -ref_count: 4 -ref_user: meta-physicist +ref_count: 5 +ref_user: Pessimist!Pessimist@gateway/shell/bnc4free/x-awwgjmvdgdiowvaf type: text @@ -1101,12 +1114,12 @@ created_on: 1104596262 edited_by: Maxdamantus!~Maxdamant@2001:470:f078::dead:beef:cafe edited_on: 1385023435.5819 enabled: 1 -last_referenced_in: caze -last_referenced_on: 1440506019.53027 +last_referenced_in: pksadiq`` +last_referenced_on: 1445912722.94778 owner: Major-Willard rate_limit: 15 -ref_count: 88 -ref_user: CaZe!~caze@unaffiliated/caze +ref_count: 90 +ref_user: pksadiq``!~user@106.208.143.222 type: text @@ -1189,12 +1202,12 @@ created_on: 1297808324.11723 edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos edited_on: 1416015925.73025 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1440897161.69988 +last_referenced_in: pksadiq +last_referenced_on: 1445524859.40213 owner: pragma_ rate_limit: 15 -ref_count: 124 -ref_user: ^python111!~^python11@93-138-46-134.adsl.net.t-com.hr +ref_count: 136 +ref_user: pksadiq!~user@106.208.91.188 type: text @@ -1285,6 +1298,7 @@ created_on: 1104595483 enabled: 1 last_referenced_in: pragma- last_referenced_on: 1413819317.3714 +noembed: 1 owner: Major-Willard rate_limit: 15 ref_count: 22 @@ -1440,10 +1454,10 @@ edited_by: fstd!~fstd@unaffiliated/fisted edited_on: 1402587387.03456 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1431902389.97737 +last_referenced_on: 1442598697.39451 owner: guidj0s rate_limit: 15 -ref_count: 17 +ref_count: 18 ref_user: fstd!~fstd@unaffiliated/fisted type: text @@ -1534,23 +1548,23 @@ edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos edited_on: 1391698886.77113 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1442132256.92511 +last_referenced_on: 1444096889.7801 owner: prec rate_limit: 15 -ref_count: 201 -ref_user: Pessimist!Pessimist@gateway/shell/bnc4free/x-bxdxfwqfjqokkovn +ref_count: 204 +ref_user: fluter!~fluter@fedora/fluter type: text action: /say A bit is a unit of data storage large enough to hold an object that may have one of two values. It need not be possible to express the address of each individual bit of an object. created_on: 1288301601.60807 enabled: 1 -last_referenced_in: yar| -last_referenced_on: 1441021077.36056 +last_referenced_in: #pbot2 +last_referenced_on: 1442820686.77801 owner: s00p rate_limit: 15 -ref_count: 8 -ref_user: yar|!~yarl_@unaffiliated/y4r1 +ref_count: 9 +ref_user: fluter!~fluter@fedora/fluter type: text @@ -1586,12 +1600,12 @@ created_on: 1179504776 edited_by: edk!edk@unaffiliated/edk edited_on: 1386199674.16276 enabled: 1 -last_referenced_in: edk -last_referenced_on: 1440670254.79343 +last_referenced_in: ##c +last_referenced_on: 1445274310.59416 owner: pragma_ rate_limit: 15 -ref_count: 1000 -ref_user: edk!~edk@spy/edk0 +ref_count: 1002 +ref_user: marchelzo!~marchelzo@unaffiliated/marchelzo type: text @@ -1601,23 +1615,23 @@ edited_by: edk!edk@unaffiliated/edk edited_on: 1387226590.5671 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1441738960.09678 +last_referenced_on: 1444609178.05157 owner: twkm rate_limit: 15 -ref_count: 788 -ref_user: o11c!~ben@unaffiliated/o11c +ref_count: 800 +ref_user: anonnumberanon!~anonnumbe@unaffiliated/anonnumberanon type: text action: /say See 'bcsllc-steve' created_on: 1312778587.71828 enabled: 1 -last_referenced_in: thoughtso -last_referenced_on: 1400028665.26014 +last_referenced_in: ##c +last_referenced_on: 1442362853.14148 owner: s00p rate_limit: 15 -ref_count: 5 -ref_user: thoughtso!~ergo@198-178-127-20.static.hvvc.us +ref_count: 6 +ref_user: Boohbah!boobah@gateway/shell/anapnea.net/x-djbrudfrqmdljbpl type: text @@ -1676,25 +1690,25 @@ type: text action: /say C is a low level language designed to make assembly "easier", useful for device drivers or operating systems. Thusly, one has to maintain buffers, memory, and various low level information. C is not meant to be used for everyday applications, a common misconception. created_on: 1108006206 enabled: 1 -last_referenced_in: #pbot2 -last_referenced_on: 1439778099.46629 +last_referenced_in: ##c +last_referenced_on: 1446217533.08954 noembed: 1 owner: pragma rate_limit: 15 -ref_count: 356 -ref_user: beco!~beco@unaffiliated/beco +ref_count: 360 +ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos type: text action: /say C++ is not C, try ##c++ created_on: 1108585029 enabled: 1 -last_referenced_in: nchambers -last_referenced_on: 1441886396.31989 +last_referenced_in: pragma- +last_referenced_on: 1444664942.78171 owner: NeverDream rate_limit: 15 -ref_count: 104 -ref_user: nchambers!nchambers@compilerdev.net +ref_count: 106 +ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos type: text @@ -1734,23 +1748,23 @@ action: /say C Aphorism 1: The questioner's first description of the problem/que created_on: 1379514943.76622 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1437271070.38957 +last_referenced_on: 1446086036.28073 owner: pragma-!~chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 45 -ref_user: CaZe!~caze@unaffiliated/caze +ref_count: 47 +ref_user: fstd!~fstd@unaffiliated/fisted type: text action: /say C Aphorism 10: The newbie will not accept the answer you give, no matter how right it is. created_on: 1379515492.13583 enabled: 1 -last_referenced_in: mcudev -last_referenced_on: 1426100335.13097 +last_referenced_in: ##c +last_referenced_on: 1446037464.03851 owner: pragma-!~chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 9 -ref_user: mcudev!~mcudev@c-98-245-27-233.hsd1.co.comcast.net +ref_count: 10 +ref_user: marchelzo!~marchelzo@unaffiliated/marchelzo type: text @@ -1759,11 +1773,11 @@ action_with_args: /call c11std created_on: 1325645454.02711 enabled: 1 last_referenced_in: love4boobies -last_referenced_on: 1442024869.1974 +last_referenced_on: 1446133747.24133 owner: pragma_ rate_limit: 15 -ref_count: 134 -ref_user: Love4Boobies!bc1ab93a@gateway/web/freenode/ip.188.26.185.58 +ref_count: 151 +ref_user: Love4Boobies!bc1a81ce@gateway/web/freenode/ip.188.26.129.206 type: text @@ -1830,15 +1844,17 @@ ref_user: mcudev!~mcudev@c-98-245-27-233.hsd1.co.comcast.net type: text -action: /say C1X/C11 draft: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf - C1X Charter: http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1250.pdf - C1X Overview: http://en.wikipedia.org/wiki/C1X - Changes from C99: http://en.wikipedia.org/wiki/C1X#Changes_from_C99 - C Overview: http://en.wikipedia.org/wiki/C_programming +action: /say C1X/C11 draft: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf - C1X Charter: http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1250.pdf - C1X Overview: http://en.wikipedia.org/wiki/C1X - Changes from C99: http://en.wikipedia.org/wiki/C1X#Changes_from_C99 - C Overview: http://en.wikipedia.org/wiki/C_programming - HTML version: http://port70.net/~nsz/c/c11/n1570.html created_on: 1296116263.83864 +edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos +edited_on: 1444922031.64937 enabled: 1 last_referenced_in: love4boobies -last_referenced_on: 1442024869.20658 +last_referenced_on: 1446133747.25326 owner: pragma_ rate_limit: 15 -ref_count: 142 -ref_user: Love4Boobies!bc1ab93a@gateway/web/freenode/ip.188.26.185.58 +ref_count: 154 +ref_user: Love4Boobies!bc1a81ce@gateway/web/freenode/ip.188.26.129.206 type: text @@ -1858,11 +1874,11 @@ action: /say C Aphorism 2: All examples given by the questioner will be incomple created_on: 1379515096.85361 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1440586818.47116 +last_referenced_on: 1444791433.66264 owner: pragma-!~chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 23 -ref_user: profess!~profess@unaffiliated/csddesk +ref_count: 24 +ref_user: fstd!~fstd@unaffiliated/fisted type: text @@ -1881,12 +1897,12 @@ type: text action: /say C Aphorism 3: The questioner will not read and apply the answers they are given but will instead continue to practice c1 and c2. created_on: 1379515146.48668 enabled: 1 -last_referenced_in: mcudev -last_referenced_on: 1426100275.98724 +last_referenced_in: ##c +last_referenced_on: 1446037483.36558 owner: pragma-!~chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 13 -ref_user: mcudev!~mcudev@c-98-245-27-233.hsd1.co.comcast.net +ref_count: 14 +ref_user: marchelzo!~marchelzo@unaffiliated/marchelzo type: text @@ -1943,12 +1959,12 @@ created_on: 1379515421.00964 edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos edited_on: 1379516015.189 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1437058977.36536 +last_referenced_in: o11c +last_referenced_on: 1442544332.27899 owner: pragma-!~chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 20 -ref_user: Chris!~chris@spy/chris +ref_count: 21 +ref_user: o11c!~ben@unaffiliated/o11c type: text @@ -2033,16 +2049,18 @@ ref_user: pragma_ type: text -action: /say C99 + TC1,2,3 working paper: http://open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf - C99 Overview: http://en.wikipedia.org/wiki/C99 - Changes from C89/C90: http://home.datacomm.ch/t_wolf/tw/c/c9x_changes.html - C Overview: http://en.wikipedia.org/wiki/C_programming +action: /say C99 + TC1,2,3 working paper: http://open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf - C99 Overview: http://en.wikipedia.org/wiki/C99 - Changes from C89/C90: http://home.datacomm.ch/t_wolf/tw/c/c9x_changes.html - C Overview: http://en.wikipedia.org/wiki/C_programming - HTML version: http://port70.net/~nsz/c/c99/n1256.html action_with_args: /call c99std created_on: 1325645512.48533 +edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos +edited_on: 1444922070.63688 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1442243869.10929 +last_referenced_in: #pbot2-test +last_referenced_on: 1446132825.78786 owner: pragma_ rate_limit: 15 -ref_count: 142 -ref_user: rooftopjoe!bc1ab93a@gateway/web/freenode/ip.188.26.185.58 +ref_count: 148 +ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos type: text @@ -2188,13 +2206,13 @@ type: text action: /call cdecl cast created_on: 1191042665 enabled: 1 -last_referenced_in: pragma- -last_referenced_on: 1441736995.78339 +last_referenced_in: glauxosdever +last_referenced_on: 1444070209.89571 noembed: 1 owner: pragma_ rate_limit: 0 -ref_count: 110 -ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +ref_count: 112 +ref_user: glauxosdever!~alex@ppp-94-66-60-12.home.otenet.gr type: text @@ -2225,11 +2243,12 @@ type: text action: /call unbufferedgetc created_on: 1323059652.74141 enabled: 1 -last_referenced_on: 1427878672.03116 +last_referenced_in: fluter +last_referenced_on: 1445941048.90095 owner: pragma_ rate_limit: 15 -ref_count: 6 -ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +ref_count: 7 +ref_user: fluter!~fluter@fedora/fluter type: text @@ -2295,12 +2314,12 @@ type: text action: /say char is required to be able to represent (at least) the values inclusively between -127 and 127 (signed char), or 0 and 255 (unsigned char). The representation chosen is implementation-defined, meaning some compilers will treat a char as signed, others unsigned. sizeof (char) is always 1. See also: CHAR_BIT, CHAR_MIN, CHAR_MAX and byte created_on: 1288191355.84716 enabled: 1 -last_referenced_in: trigraph -last_referenced_on: 1442223582.30951 +last_referenced_in: ##c +last_referenced_on: 1445957402.35438 owner: s00p rate_limit: 15 -ref_count: 144 -ref_user: Trigraph!Trigraph@unaffiliated/trigraph +ref_count: 146 +ref_user: elosz!82f5cd07@gateway/web/freenode/ip.130.245.205.7 type: text @@ -2319,12 +2338,12 @@ type: text action: /say Check: A unit testing framework for C: http://check.sourceforge.net/ created_on: 1350619625.88407 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1439530763.00858 +last_referenced_in: b3h3m0th +last_referenced_on: 1446194318.35418 owner: pragma- rate_limit: 15 -ref_count: 12 -ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +ref_count: 13 +ref_user: b3h3m0th!uid26288@gateway/web/irccloud.com/x-lndljwmvpssztodr type: text @@ -2461,12 +2480,12 @@ type: text action: /call itworks created_on: 1347152111.48147 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1429058549.03692 +last_referenced_in: fluter +last_referenced_on: 1445941128.29417 owner: pragma- rate_limit: 15 -ref_count: 14 -ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +ref_count: 16 +ref_user: fluter!~fluter@fedora/fluter type: text @@ -2474,11 +2493,11 @@ action: http://publications.gbdirect.co.uk/c_book/chapter8/const_and_volatile.ht created_on: 1107648578 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1441734588.3708 +last_referenced_on: 1444506063.59414 owner: prec rate_limit: 15 -ref_count: 50 -ref_user: doppel!~doppel@ip68-96-169-47.lv.lv.cox.net +ref_count: 51 +ref_user: marchelzo!~marchelzo@unaffiliated/marchelzo type: text @@ -2496,15 +2515,17 @@ ref_user: fstd!~fstd@unaffiliated/fisted type: text -action: /say Understanding integer conversion/promotion rules: https://www.securecoding.cert.org/confluence/display/seccode/INT02-C.+Understand+integer+conversion+rules +action: /say Understanding integer conversion/promotion rules: https://www.securecoding.cert.org/confluence/display/c/INT02-C.+Understand+integer+conversion+rules created_on: 1353362078.88439 +edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos +edited_on: 1443195397.4132 enabled: 1 -last_referenced_in: phao -last_referenced_on: 1420170403.90372 +last_referenced_in: ##c +last_referenced_on: 1443195369.21684 owner: pragma- rate_limit: 15 -ref_count: 7 -ref_user: phao!~phao@189-105-162-229.user.veloxzone.com.br +ref_count: 10 +ref_user: fstd!~fstd@unaffiliated/fisted type: text @@ -2524,11 +2545,11 @@ action: /say Co-routines in C, using Duff's Device: http://www.chiark.greenend.o created_on: 1296848475.53312 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1306528859.43795 +last_referenced_on: 1442362878.28475 owner: pragma_ rate_limit: 15 -ref_count: 1 -ref_user: pragma_ +ref_count: 2 +ref_user: doppel!~doppel@ip68-96-169-47.lv.lv.cox.net type: text @@ -2619,12 +2640,12 @@ type: text action: /call std created_on: 1344698408.76136 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1440469339.54572 +last_referenced_in: xupicor +last_referenced_on: 1445496573.12792 owner: pragma- rate_limit: 15 -ref_count: 263 -ref_user: CaZe!~caze@unaffiliated/caze +ref_count: 265 +ref_user: xupicor!xupicor@shell.bshellz.net type: text @@ -2710,11 +2731,11 @@ edited_by: fstd!~fstd@unaffiliated/fisted edited_on: 1441482977.91293 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1441908765.09058 +last_referenced_on: 1445298791.45325 owner: doppel!~doppel@ip68-96-169-47.lv.lv.cox.net rate_limit: 15 -ref_count: 5 -ref_user: doppel!~doppel@ip68-96-169-47.lv.lv.cox.net +ref_count: 7 +ref_user: doppel!~doppel@ip68-96-235-191.lv.lv.cox.net type: text @@ -2794,23 +2815,23 @@ edited_by: edk!edk@unaffiliated/edk edited_on: 1381856673.68233 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1441678188.92453 +last_referenced_on: 1445610264.90422 owner: infobahn rate_limit: 15 -ref_count: 807 -ref_user: marchelzo!~marchelzo@unaffiliated/marchelzo +ref_count: 813 +ref_user: edk!~edk@spy/edk0 type: text action: /say When taking input for type double you need to use lf format specifier in the scanf statement. But when you are outputting a double you use f format specifier in the printf statements. created_on: 1195072541 enabled: 1 -last_referenced_in: marchelzo_ -last_referenced_on: 1439131683.85854 +last_referenced_in: cousteau +last_referenced_on: 1446036187.73133 owner: pragma_ rate_limit: 15 -ref_count: 57 -ref_user: marchelzo_!~marchelzo@unaffiliated/marchelzo/x-2669545 +ref_count: 58 +ref_user: cousteau!~cousteau@138.100.74.81 type: text @@ -2870,16 +2891,31 @@ ref_count: 1 ref_user: cousteau type: text + +action: /say When reading The C Programming Language, 2nd edition, by Kernighan and Ritchie, make sure you check the errata as well: http://www.iso-9899.info/2ediffs.html +created_on: 1442833162.77336 +edited_by: edk!~edk@spy/edk0 +edited_on: 1443094614.81712 +enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1445182703.48004 +owner: cousteau!~cousteau@138.100.74.81 +rate_limit: 15 +ref_count: 4 +ref_user: cousteau!~cousteau@30.103.132.37.dynamic.jazztel.es +type: text + action: library error macro, #include The macro designates a modifiable int object that is asigned a value greater than zero on certain library errors. see http://www.iso-9899.info/man?strerror created_on: 1104386234 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1321816840.22383 +last_referenced_on: 1442360110.99208 +noembed: 1 owner: defrost rate_limit: 15 -ref_count: 1 -ref_user: mithridates +ref_count: 3 +ref_user: fstd!~fstd@unaffiliated/fisted type: text @@ -2904,10 +2940,10 @@ edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos edited_on: 1375298950.23921 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1439322465.08415 +last_referenced_on: 1442899323.06432 owner: nitrix!~nitrix@unaffiliated/nitrix rate_limit: 15 -ref_count: 12 +ref_count: 13 ref_user: nitrix!~nitrix@unaffiliated/nitrix type: text @@ -3008,12 +3044,12 @@ type: text action: /call floating created_on: 1346323300.76691 enabled: 1 -last_referenced_in: marchelzo_ -last_referenced_on: 1440630033.33102 +last_referenced_in: ##c +last_referenced_on: 1446047680.23704 owner: pragma- rate_limit: 15 -ref_count: 56 -ref_user: marchelzo_!~marchelzo@unaffiliated/marchelzo/x-2669545 +ref_count: 57 +ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos type: text @@ -3027,6 +3063,19 @@ ref_count: 1 ref_user: fizzie!fis@unaffiliated/fizzie type: text + +action: the channel idiot. +created_on: 1445923912.49544 +enabled: 1 +last_referenced_in: pksadiq` +last_referenced_on: 1445926534.33482 +locked: 1 +owner: pragma-!~chaos@unaffiliated/pragmatic-chaos +rate_limit: 15 +ref_count: 3 +ref_user: pksadiq`!~user@106.208.62.84 +type: text + action: /say ##c focuses on C. Discuss offtopic things elsewhere. created_on: 1414405845.15381 @@ -3168,11 +3217,11 @@ action: very bad. It cannot be told the size of the buffer to read in, therefor created_on: 1108103139 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1441374701.06244 +last_referenced_on: 1446000200.71277 owner: pragma_ rate_limit: 15 -ref_count: 100 -ref_user: cousteau!~cousteau@138.100.74.81 +ref_count: 102 +ref_user: fluter!~fluter@fedora/fluter type: text @@ -3202,11 +3251,11 @@ action: /say There is no "global" scope in C. There are four kinds of scopes: fu created_on: 1271966015 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1436235113.35509 +last_referenced_on: 1445530350.83981 owner: n00p rate_limit: 15 -ref_count: 82 -ref_user: marchelzo_!~marchelzo@hlfxns016cw-156057132245.dhcp-dynamic.FibreOp.ns.bellaliant.net +ref_count: 86 +ref_user: Pessimist!Pessimist@gateway/shell/bnc4free/x-awwgjmvdgdiowvaf type: text @@ -3333,10 +3382,10 @@ action: a particular set of software, running in a particular translation enviro created_on: 1106459085 enabled: 1 last_referenced_in: nitrix -last_referenced_on: 1402154062.94677 +last_referenced_on: 1444453759.74515 owner: pragma_ rate_limit: 15 -ref_count: 6 +ref_count: 7 ref_user: nitrix!~nitrix@unaffiliated/nitrix type: text @@ -3380,12 +3429,12 @@ type: text action: a signed integer data type, at least 16 bits wide, which must be able to represent (at least) all the numbers in the range -32767 to +32767. Its lowest value, INT_MIN, and highest value, INT_MAX, are defined in created_on: 1104595147 enabled: 1 -last_referenced_in: pragma- -last_referenced_on: 1439816526.30807 +last_referenced_in: arm9 +last_referenced_on: 1442948432.46975 owner: infobahn rate_limit: 15 -ref_count: 247 -ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +ref_count: 251 +ref_user: ARM9!~ARM9@46-236-101-61.customer.t3.se type: text @@ -3462,12 +3511,12 @@ type: text action: /call k&r created_on: 1347136234.94889 enabled: 1 -last_referenced_in: detergnet -last_referenced_on: 1441882942.7122 +last_referenced_in: ##c +last_referenced_on: 1445463144.07303 owner: pragma- rate_limit: 15 -ref_count: 26 -ref_user: detergnet!~msb@unaffiliated/detergnet +ref_count: 33 +ref_user: Boohbah_!boobah@gateway/shell/anapnea.net/x-ftfzqezsiomlcfvi type: text @@ -3475,11 +3524,11 @@ action: /say Chapter 1: A Tutorial Introduction; Exercise 1-1. Run the ‘‘hel created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1441138671.77387 +last_referenced_on: 1445594142.64663 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 3 -ref_user: MethylatorX!~Methylato@41.238.133.230 +ref_count: 6 +ref_user: sonro!~sonro@host109-150-97-218.range109-150.btcentralplus.com type: text @@ -3487,23 +3536,23 @@ action: /say Chapter 1: A Tutorial Introduction; Exercise 1-10. Write a program created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1439239829.2101 +last_referenced_on: 1445704725.05284 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 3 -ref_user: marchelzo!~marchelzo@216.83.6.45 +ref_count: 7 +ref_user: sonro!~sonro@host109-150-97-218.range109-150.btcentralplus.com type: text action: /say Chapter 1: A Tutorial Introduction; Exercise 1-11. How would you test the word count program? What kinds of input are most likely to uncover bugs if there are any? created_on: 1436132320.52224 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1439346772.98521 +last_referenced_in: jchapman27 +last_referenced_on: 1445569009.05874 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 1 -ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +ref_count: 11 +ref_user: jchapman27!~Zuroxx@host-128-227-216-237.xlate.ufl.edu type: text @@ -3511,11 +3560,11 @@ action: /say Chapter 1: A Tutorial Introduction; Exercise 1-12. Write a program created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1441150739.80289 +last_referenced_on: 1445599977.79251 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 3 -ref_user: marchelzo_!~marchelzo@unaffiliated/marchelzo/x-2669545 +ref_count: 6 +ref_user: jim!~jim@unaffiliated/jim type: text @@ -3523,23 +3572,23 @@ action: /say Chapter 1: A Tutorial Introduction; Exercise 1-13. Write a program created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1440883665.63293 +last_referenced_on: 1445687114.85773 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 16 -ref_user: MethylatorX!~Methylato@41.43.24.99 +ref_count: 20 +ref_user: Wulf!~Wulf@unaffiliated/wulf type: text action: /say Chapter 1: A Tutorial Introduction; Exercise 1-14. Write a program to print a histogram of the frequencies of different characters in its input. created_on: 1436132320.52224 enabled: 1 -last_referenced_in: edk -last_referenced_on: 1440945033.60275 +last_referenced_in: ##c +last_referenced_on: 1445618137.18999 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 6 -ref_user: edk!~edk@spy/edk0 +ref_count: 9 +ref_user: sonro!~sonro@host109-150-97-218.range109-150.btcentralplus.com type: text @@ -3573,11 +3622,11 @@ action: /say Chapter 1: A Tutorial Introduction; Exercise 1-17. Write a program created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1438389950.94494 +last_referenced_on: 1445875106.88927 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 10 -ref_user: X-Scale!gbabios@193.126.189.56 +ref_count: 11 +ref_user: sonro!~sonro@host109-150-97-218.range109-150.btcentralplus.com type: text @@ -3585,11 +3634,11 @@ action: /say Chapter 1: A Tutorial Introduction; Exercise 1-18. Write a program created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1441068831.05195 +last_referenced_on: 1445886431.43247 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 22 -ref_user: apokatastasis!~void@r75-110-115-225.rmntcmtc02.rcmtnc.ab.dh.suddenlink.net +ref_count: 32 +ref_user: perks!~perks@static-108-54-254-164.nycmny.fios.verizon.net type: text @@ -3597,11 +3646,11 @@ action: /say Chapter 1: A Tutorial Introduction; Exercise 1-19. Write a function created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1442032555.20227 +last_referenced_on: 1445560713.94908 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 11 -ref_user: CaZe!~caze@unaffiliated/caze +ref_count: 13 +ref_user: marchelzo!~marchelzo@unaffiliated/marchelzo type: text @@ -3609,23 +3658,23 @@ action: /say Chapter 1: A Tutorial Introduction; Exercise 1-2. Experiment to fin created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1438425159.32769 +last_referenced_on: 1445372671.21167 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 3 -ref_user: kate!~kate@unaffiliated/kate +ref_count: 5 +ref_user: cousteau!~cousteau@30.103.132.37.dynamic.jazztel.es type: text action: /say Chapter 1: A Tutorial Introduction; Exercise 1-20. Write a program detab that replaces tabs in the input with the proper number of blanks to space to the next tab stop. Assume a fixed set of tab stops, say every n columns. Should n be a variable or a symbolic parameter? created_on: 1436132320.52224 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1440627407.24743 +last_referenced_in: lens +last_referenced_on: 1445642548.14077 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 1 -ref_user: jd1!~jd1@unaffiliated/jd1 +ref_count: 5 +ref_user: lens!~lens@freebsd/lover/lens type: text @@ -3676,12 +3725,12 @@ type: text action: /say Chapter 1: A Tutorial Introduction; Exercise 1-3. Modify the temperature conversion program to print a heading above the table. created_on: 1436132320.52224 enabled: 1 -last_referenced_in: dydzio -last_referenced_on: 1437760606.22269 +last_referenced_in: ##c +last_referenced_on: 1444457544.95148 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 3 -ref_user: Dydzio!~Dydzio@unaffiliated/dydzio +ref_count: 4 +ref_user: jim!~jim@unaffiliated/jim type: text @@ -3706,38 +3755,64 @@ ref_count: 0 ref_user: nobody type: text + +action: /say Chapter 1: A Tutorial Introduction; Exercise 1-6. Verify that the expression getchar() != EOF is 0 or 1. +created_on: 1442279238.77698 +enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1442287717.49121 +owner: pragma-!~chaos@unaffiliated/pragmatic-chaos +rate_limit: 15 +ref_count: 2 +ref_user: CaZe!~caze@unaffiliated/caze +type: text + action: /say Chapter 1: A Tutorial Introduction; Exercise 1-7. Write a program to print the value of EOF. created_on: 1436132320.52224 enabled: 1 -last_referenced_in: marchelzo -last_referenced_on: 1439307740.38925 +last_referenced_in: ##c +last_referenced_on: 1445517509.75244 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 1 -ref_user: marchelzo!~marchelzo@216.83.6.45 +ref_count: 2 +ref_user: schquid!~schquid@unaffiliated/schquid type: text action: /say Chapter 1: A Tutorial Introduction; Exercise 1-8. Write a program to count blanks, tabs, and newlines. created_on: 1436132320.52224 enabled: 1 -last_referenced_in: profess -last_referenced_on: 1440545557.64765 +last_referenced_in: ##c +last_referenced_on: 1445621417.81174 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 1 -ref_user: profess!~profess@unaffiliated/csddesk +ref_count: 5 +ref_user: Sicelo!Sicelo@unaffiliated/sicelo type: text action: /say Chapter 1: A Tutorial Introduction; Exercise 1-9. Write a program to copy its input to its output, replacing each string of one or more blanks by a single blank. created_on: 1436132320.52224 enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1445625677.58884 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 0 -ref_user: nobody +ref_count: 2 +ref_user: Sicelo!Sicelo@unaffiliated/sicelo +type: text + + +action: /call k&r +created_on: 1445463607.69615 +enabled: 1 +last_referenced_in: jchapman27 +last_referenced_on: 1445569025.83572 +owner: edk!~edk@spy/edk0 +rate_limit: 15 +ref_count: 1 +ref_user: jchapman27!~Zuroxx@host-128-227-216-237.xlate.ufl.edu type: text @@ -3745,21 +3820,23 @@ action: /say Chapter 2: Types, Operators and Expressions; Exercise 2-1. Write a created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1439876969.11303 +last_referenced_on: 1445820317.25238 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 2 -ref_user: tcmitchell!~quassel@ec2-52-3-178-31.compute-1.amazonaws.com +ref_count: 6 +ref_user: pksadiq!~user@106.208.117.219 type: text action: /say Chapter 2: Types, Operators and Expressions; Exercise 2-10. Rewrite the function lower, which converts upper case letters to lower case, with a conditional expression instead of if-else. created_on: 1436132320.52224 enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1443891625.33312 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 0 -ref_user: nobody +ref_count: 2 +ref_user: schquid!~schquid@unaffiliated/schquid type: text @@ -3768,22 +3845,24 @@ created_on: 1436132320.52224 edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos edited_on: 1436245803.73035 enabled: 1 -last_referenced_in: tommyc -last_referenced_on: 1438049244.22175 +last_referenced_in: ##c +last_referenced_on: 1445958294.78366 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 1 -ref_user: TommyC!~TommyC@unaffiliated/sepulchralbloom +ref_count: 3 +ref_user: fstd!~fstd@unaffiliated/fisted type: text action: /say Chapter 2: Types, Operators and Expressions; Exercise 2-3. Write a function htoi(s), which converts a string of hexadecimal digits (including an optional 0x or 0X) into its equivalent integer value. The allowable digits are 0 through 9, a through f, and A through F. created_on: 1436132320.52224 enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1443181104.11369 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 0 -ref_user: nobody +ref_count: 2 +ref_user: anonnumberanon!~anonnumbe@unaffiliated/anonnumberanon type: text @@ -3813,21 +3892,23 @@ action: /say Chapter 2: Types, Operators and Expressions; Exercise 2-6. Write a created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1441596079.83663 +last_referenced_on: 1443726331.94481 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 2 -ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +ref_count: 9 +ref_user: anonnumberanon!~anonnumbe@unaffiliated/anonnumberanon type: text action: /say Chapter 2: Types, Operators and Expressions; Exercise 2-7. Write a function invert(x,p,n) that returns x with the n bits that begin at position p inverted (i.e., 1 changed into 0 and vice versa), leaving the others unchanged. created_on: 1436132320.52224 enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1443714168.10692 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 0 -ref_user: nobody +ref_count: 1 +ref_user: anonnumberanon!~anonnumbe@unaffiliated/anonnumberanon type: text @@ -3835,23 +3916,23 @@ action: /say Chapter 2: Types, Operators and Expressions; Exercise 2-8. Write a created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1440445748.45548 +last_referenced_on: 1443728960.29898 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 1 -ref_user: marchelzo!~marchelzo@216.83.6.45 +ref_count: 3 +ref_user: anonnumberanon!~anonnumbe@unaffiliated/anonnumberanon type: text action: /say Chapter 2: Types, Operators and Expressions; Exercise 2-9. In a two’s complement number system, x &= (x-1) deletes the rightmost 1-bit x. Explain why. Use this observation to write a faster version of bitcount. created_on: 1436132320.52224 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1437103330.68384 +last_referenced_in: kkri +last_referenced_on: 1446058220.7151 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 1 -ref_user: lens!~lens@freebsd/lover/lens +ref_count: 4 +ref_user: kkri!~kkri@x4d044096.dyn.telefonica.de type: text @@ -3859,11 +3940,11 @@ action: /say Chapter 3: Control Flow; Exercise 3-1. Our binary search makes two created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1441653316.38909 +last_referenced_on: 1443921526.76845 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 1 -ref_user: tcmitchell!~quassel@ec2-52-3-178-31.compute-1.amazonaws.com +ref_count: 3 +ref_user: anonnumberanon!~anonnumbe@unaffiliated/anonnumberanon type: text @@ -3883,11 +3964,11 @@ action: /say Chapter 3: Control Flow; Exercise 3-3. Write a function expand(s1,s created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1436217119.65813 +last_referenced_on: 1444203443.07004 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 1 -ref_user: lens!~lens@freebsd/lover/lens +ref_count: 3 +ref_user: schquid!~schquid@unaffiliated/schquid type: text @@ -3903,13 +3984,17 @@ ref_user: marchelzo!~marchelzo@216.83.6.45 type: text -action: /say Chapter 3: Control Flow; Exercise 3-5. Write the function itob(n,s,b) that converts the integer n into a base b character representation in the string s. In particular, itob(n,s,16) formats s as a hexadecimal integer in s. +action: /say Chapter 3: Control Flow; Exercise 3-5. Write the function itob(n,s,b) that converts the integer n into a base b character representation in the string s. In particular, itob(n,s,16) formats n as a hexadecimal integer in s. created_on: 1436132320.52224 +edited_by: marchelzo!~marchelzo@unaffiliated/marchelzo +edited_on: 1444362173.09691 enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1444460210.62205 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 0 -ref_user: nobody +ref_count: 3 +ref_user: Wulf!~Wulf@unaffiliated/wulf type: text @@ -3927,11 +4012,11 @@ action: /say Chapter 4: Functions and Program Structure; Exercise 4-1. Write the created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1436132731.429 +last_referenced_on: 1444788581.98524 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 1 -ref_user: gl!~p@hack.tf +ref_count: 4 +ref_user: apokatastasis!~void@r75-110-115-225.rmntcmtc02.rcmtnc.ab.dh.suddenlink.net type: text @@ -4004,10 +4089,12 @@ type: text action: /say Chapter 4: Functions and Program Structure; Exercise 4-3. Given the basic framework, it’s straightforward to extend the calculator. Add the modulus (%) operator and provisions for negative numbers. created_on: 1436132320.52224 enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1445059389.73775 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 0 -ref_user: nobody +ref_count: 1 +ref_user: anonnumberanon!~anonnumbe@unaffiliated/anonnumberanon type: text @@ -4015,11 +4102,11 @@ action: /say Chapter 4: Functions and Program Structure; Exercise 4-4. Add the c created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1437585531.66216 +last_referenced_on: 1445139294.9957 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 1 -ref_user: thomas_d!~thomas_d@unaffiliated/thomas-d/x-6984210 +ref_count: 2 +ref_user: marchelzo!~marchelzo@unaffiliated/marchelzo type: text @@ -4071,23 +4158,23 @@ action: /say Chapter 4: Functions and Program Structure; Exercise 4-9. Our getch created_on: 1436132320.52224 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1437767543.64525 +last_referenced_on: 1446154026.56302 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 2 -ref_user: thomas_d!~thomas_d@unaffiliated/thomas-d/x-6984210 +ref_count: 3 +ref_user: marchelzo!~marchelzo@unaffiliated/marchelzo type: text action: /say Chapter 5: Pointers and Arrays; Exercise 5-1. As written, getint treats a + or - not followed by a digit as a valid representation of zero. Fix it to push such a character back on the input. created_on: 1436132320.52224 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1441859435.5812 +last_referenced_in: xguest144 +last_referenced_on: 1444196491.82115 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 2 -ref_user: lald!~frank@unaffiliated/liveandletdie +ref_count: 3 +ref_user: xguest144!~user@93.177.55.112 type: text @@ -4104,12 +4191,12 @@ type: text action: /say Chapter 5: Pointers and Arrays; Exercise 5-11. Modify the program entab and detab (written as exercises in Chapter 1) to accept a list of tab stops as arguments. Use the default tab settings if there are no arguments. created_on: 1436132320.52224 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1441884350.82978 +last_referenced_in: xguest144 +last_referenced_on: 1444196573.99089 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 1 -ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +ref_count: 2 +ref_user: xguest144!~user@93.177.55.112 type: text @@ -4170,10 +4257,12 @@ type: text action: /say Chapter 5: Pointers and Arrays; Exercise 5-17. Add a field-searching capability, so sorting may bee done on fields within lines, each field sorted according to an independent set of options. (The index for this book was sorted with -df for the index category and -n for the page numbers.) created_on: 1436132320.52224 enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1445908815.78887 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 0 -ref_user: nobody +ref_count: 1 +ref_user: X-Scale!~gbabios@2001:0:53aa:64c:0:386:fa61:d82b type: text @@ -4190,12 +4279,12 @@ type: text action: /say Chapter 5: Pointers and Arrays; Exercise 5-19. Modify undcl so that it does not add redundant parentheses to declarations. created_on: 1436132320.52224 enabled: 1 -last_referenced_in: profess -last_referenced_on: 1440903289.5712 +last_referenced_in: xguest144 +last_referenced_on: 1444196694.03397 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 1 -ref_user: profess!~profess@unaffiliated/csddesk +ref_count: 2 +ref_user: xguest144!~user@93.177.55.112 type: text @@ -4212,12 +4301,12 @@ type: text action: /say Chapter 5: Pointers and Arrays; Exercise 5-20. Expand dcl to handle declarations with function argument types, qualifiers like const, and so on. created_on: 1436132320.52224 enabled: 1 -last_referenced_in: profess -last_referenced_on: 1440903281.32169 +last_referenced_in: xguest144 +last_referenced_on: 1444196678.56906 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 2 -ref_user: profess!~profess@unaffiliated/csddesk +ref_count: 4 +ref_user: xguest144!~user@93.177.55.112 type: text @@ -4264,10 +4353,12 @@ type: text action: /say Chapter 5: Pointers and Arrays; Exercise 5-7. Rewrite readlines to store lines in an array supplied by main, rather than calling alloc to maintain storage. How much faster is the program? created_on: 1436132320.52224 enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1443877957.6342 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 0 -ref_user: nobody +ref_count: 2 +ref_user: thomas_d!~thomas_d@unaffiliated/thomas-d/x-6984210 type: text @@ -4344,10 +4435,12 @@ type: text action: /say Chapter 6: Structures; Exercise 6-6. Implement a simple version of the #define processor (i.e., no arguments) suitable for use with C programs, based on the routines of this section. You may also find getch and ungetch helpful. created_on: 1436132320.52224 enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1443631520.27406 owner: pragma-!chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 0 -ref_user: nobody +ref_count: 1 +ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos type: text @@ -4536,22 +4629,24 @@ created_on: 1436235395.83959 edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos edited_on: 1436236393.26433 enabled: 1 +last_referenced_in: edk +last_referenced_on: 1446056913.33695 owner: pragma-!~chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 0 -ref_user: nobody +ref_count: 1 +ref_user: edk!~edk@spy/edk0 type: text action: /say No refunds. created_on: 1385866053.26907 enabled: 1 -last_referenced_in: #cjeopardy -last_referenced_on: 1423083167.37253 +last_referenced_in: fluter +last_referenced_on: 1445941228.36753 owner: addatoo!~daem0n@c-98-204-134-144.hsd1.md.comcast.net rate_limit: 15 -ref_count: 6 -ref_user: centrinia!~centrinia@107-208-218-105.lightspeed.tukrga.sbcglobal.net +ref_count: 7 +ref_user: fluter!~fluter@fedora/fluter type: text @@ -4561,11 +4656,11 @@ edited_by: Chris!~chris@spy/chris edited_on: 1436939211.27023 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1436938640.37833 +last_referenced_on: 1446051594.74365 owner: pragma-!~chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 64 -ref_user: kerio!kerio@duckbot.xd.cm +ref_count: 72 +ref_user: cousteau!~cousteau@138.100.74.81 type: text @@ -4665,12 +4760,12 @@ type: text action: /say long long long is too long for candide created_on: 1412837217.23202 enabled: 1 -last_referenced_in: pragma- -last_referenced_on: 1412837220.85746 +last_referenced_in: fluter +last_referenced_on: 1445941238.34386 owner: pragma-!~chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 1 -ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +ref_count: 2 +ref_user: fluter!~fluter@fedora/fluter type: text @@ -4679,12 +4774,12 @@ created_on: 1251745741 edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos edited_on: 1376673682.36927 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1419283941.77758 +last_referenced_in: pksadiq +last_referenced_on: 1445690716.1405 owner: Wulf_ rate_limit: 15 -ref_count: 9 -ref_user: cousteau!~cousteau@31.4.239.57 +ref_count: 11 +ref_user: pksadiq!~user@106.208.32.137 type: text @@ -4701,12 +4796,12 @@ type: text action: int main(int argc, char *argv[]); or int main(int argc, char **argv); or int main(void); or some other implementation-defined prototype; See also ''argc'' and ''argv''; the standard entry point to C programs created_on: 1104231974 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1441828322.17098 +last_referenced_in: #cjeopardy +last_referenced_on: 1443769391.7015 owner: twkm rate_limit: 15 -ref_count: 103 -ref_user: Wulf!~Wulf@unaffiliated/wulf +ref_count: 104 +ref_user: danielcamiel!~danielcam@unaffiliated/danielcamiel type: text @@ -4724,11 +4819,11 @@ action: /call dontcastmalloc created_on: 1280342692.40847 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1441678188.9225 +last_referenced_on: 1445031105.90697 owner: PoppaVic rate_limit: 15 -ref_count: 143 -ref_user: marchelzo!~marchelzo@unaffiliated/marchelzo +ref_count: 146 +ref_user: masoudd!~masoudd@95.82.17.130 type: text @@ -4887,18 +4982,18 @@ ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos type: text -action: /say That is not a C issue. This channel exists for discussion of the Standard C Language itself; not tools such as Makefiles, IDEs, compilers (see ##workingset for these things) or random libraries (including OS-specific ones such as POSIX or Windows; see ##posix or #winapi). For general-purpose C discussion, join ##c-general. +action: /say That is not a C issue. This channel exists for discussion of the Standard C Language itself; not tools such as Makefiles, IDEs, compilers (see ##workingset for these things) or random libraries (including OS-specific ones such as POSIX or Windows; see ##posix or #winapi). created_on: 1273154639 edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos -edited_on: 1415795438.90268 +edited_on: 1444820315.40329 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1442202594.34063 -noembed: 1 +last_referenced_in: profess +last_referenced_on: 1445903403.93176 +noembed: 0 owner: n00p -rate_limit: 15 -ref_count: 450 -ref_user: fluter!~fluter@fedora/fluter +rate_limit: 300 +ref_count: 476 +ref_user: profess!~profess@unaffiliated/csddesk type: text @@ -4987,18 +5082,6 @@ ref_count: 2 ref_user: jd1!~jd1@192.55.55.39 type: text - -action: /call 8ball -created_on: 1323990515.89827 -enabled: 1 -last_referenced_in: fluter -last_referenced_on: 1442241441.22319 -owner: pragma_ -rate_limit: 15 -ref_count: 70 -ref_user: fluter!~fluter@fedora/fluter -type: text - action: /say If you cannot/will not buy k&r2 go here at least, then quit pissing and moaning. http://publications.gbdirect.co.uk/c_book/ created_on: 1175854606 @@ -5091,10 +5174,10 @@ action: /call paren created_on: 1390001510.89311 enabled: 1 last_referenced_in: fizzie -last_referenced_on: 1441789856.46022 +last_referenced_on: 1445082749.66953 owner: pragma-!~chaos@unaffiliated/pragmatic-chaos rate_limit: 0 -ref_count: 79 +ref_count: 87 ref_user: fizzie!fis@unaffiliated/fizzie type: text @@ -5144,18 +5227,6 @@ ref_count: 0 ref_user: nobody type: text - -action: That is not a C issue. This channel exists for discussion of the Standard C Language itself (pick a standard); not tools such as Makefiles, IDEs, compilers (see ##workingset for these things) or random libraries (including OS-specific ones such as POSIX or Windows; see ##posix or #winapi), nor for support for a particular piece of software. -created_on: 1413580139.73987 -enabled: 1 -last_referenced_in: poppavic -last_referenced_on: 1413662900.87714 -owner: PoppaVic!~pops@unaffiliated/poppavic -rate_limit: 15 -ref_count: 2 -ref_user: PoppaVic!~pops@unaffiliated/poppavic -type: text - action: that a relatively new addition to created_on: 1378500398.88576 @@ -5183,11 +5254,12 @@ action: /call binky created_on: 1391698826.9491 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1442132256.92328 +last_referenced_on: 1444096889.77796 +noembed: 1 owner: pragma-!~chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 16 -ref_user: Pessimist!Pessimist@gateway/shell/bnc4free/x-bxdxfwqfjqokkovn +ref_count: 18 +ref_user: fluter!~fluter@fedora/fluter type: text @@ -5251,12 +5323,12 @@ type: text action: /say HTML conversions of C standards: http://port70.net/~nsz/c/ created_on: 1393744235.24115 enabled: 1 -last_referenced_in: pragma- -last_referenced_on: 1421891409.99848 +last_referenced_in: o11c +last_referenced_on: 1442364547.49426 owner: pragma-!~chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 5 -ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +ref_count: 6 +ref_user: o11c!~ben@unaffiliated/o11c type: text @@ -5347,11 +5419,12 @@ type: text action: /call conversions created_on: 1353362093.29351 enabled: 1 -last_referenced_on: 1420170403.89839 +last_referenced_in: ##c +last_referenced_on: 1443195369.21408 owner: pragma- rate_limit: 15 -ref_count: 5 -ref_user: phao!~phao@189-105-162-229.user.veloxzone.com.br +ref_count: 8 +ref_user: fstd!~fstd@unaffiliated/fisted type: text @@ -5406,12 +5479,12 @@ type: text action: / qsort() sorts an array of data, #include , void qsort(void *base, size_t nelems, size_t elsize, int (*compar)(const void *, const void *)); returns nothing, see http://www.iso-9899.info/man?qsort created_on: 1104399031 enabled: 1 -last_referenced_in: unbroken -last_referenced_on: 1426661996.97657 +last_referenced_in: ##c +last_referenced_on: 1442292578.42988 owner: twkm rate_limit: 15 -ref_count: 6 -ref_user: unbroken!~uuhimhere@113.210.137.52 +ref_count: 7 +ref_user: fluter!~fluter@fedora/fluter type: text @@ -5474,10 +5547,12 @@ type: text action: /say http://ramblings.implicit.net/posts/2014/4/19/the-confusion-between-pointers-and-arrays created_on: 1436508740.81919 enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1445522922.31916 owner: marchelzo_!~marchelzo@unaffiliated/marchelzo/x-2669545 rate_limit: 15 -ref_count: 0 -ref_user: nobody +ref_count: 3 +ref_user: edk!~edk@spy/edk0 type: text @@ -5540,10 +5615,12 @@ type: text action: /say http://ramblings.implicit.net/posts/2014/5/3/do-not-trust-random-websites-about-c created_on: 1436508435.54129 enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1445274520.4998 owner: marchelzo_!~marchelzo@unaffiliated/marchelzo/x-2669545 rate_limit: 15 -ref_count: 0 -ref_user: nobody +ref_count: 2 +ref_user: marchelzo!~marchelzo@unaffiliated/marchelzo type: text @@ -5563,10 +5640,10 @@ action: /call $krexercises created_on: 1436235414.71845 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1440079279.49621 +last_referenced_on: 1443631520.26584 owner: pragma-!~chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 14 +ref_count: 15 ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos type: text @@ -5598,12 +5675,12 @@ type: text action: http://www.iso-9899.info/wiki/Why_not_realloc created_on: 1254955396 enabled: 1 -last_referenced_in: dorp -last_referenced_on: 1437237969.05781 +last_referenced_in: ##c +last_referenced_on: 1445516908.82417 owner: Chris rate_limit: 15 -ref_count: 47 -ref_user: dorp!~dorp@bzq-84-111-138-241.red.bezeqint.net +ref_count: 48 +ref_user: gl!~p@hack.tf type: text @@ -5723,10 +5800,10 @@ action: /say Days since our last accident: 0 created_on: 1387390927.47967 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1435209509.75602 +last_referenced_on: 1443917886.85369 owner: nitrix!~nitrix@unaffiliated/nitrix rate_limit: 15 -ref_count: 23 +ref_count: 24 ref_user: fstd!~fstd@unaffiliated/fisted type: text @@ -5833,11 +5910,11 @@ edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos edited_on: 1379289170.20916 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1441366119.99442 +last_referenced_on: 1446065273.17743 owner: Major-Willard rate_limit: 15 -ref_count: 455 -ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +ref_count: 460 +ref_user: rob``!~rob@rmartinjak.de type: text @@ -5867,23 +5944,23 @@ action: /say Please avoid Herbert Schildt's C books. See http://www.seebs.net/c created_on: 1277949707.2979 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1438020804.57264 +last_referenced_on: 1442736990.81833 owner: pragma_ rate_limit: 15 -ref_count: 20 -ref_user: cousteau!~cousteau@138.100.74.81 +ref_count: 21 +ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos type: text action: /call global created_on: 1323918650.46918 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1432067205.12956 +last_referenced_in: jd_1 +last_referenced_on: 1443638463.12414 owner: pragma_ rate_limit: 15 -ref_count: 12 -ref_user: doppel!~doppel@ip68-96-169-47.lv.lv.cox.net +ref_count: 14 +ref_user: jd_1!jd1@unaffiliated/jd1 type: text @@ -6059,11 +6136,11 @@ action: /say Learning how to effectively ask questions is beneficial for all. Se created_on: 1376746747.12143 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1428875607.69541 +last_referenced_on: 1445018208.26358 owner: boru!~boru@unaffiliated/boru rate_limit: 15 -ref_count: 9 -ref_user: edk!edk@spy/edk0 +ref_count: 10 +ref_user: edk!~edk@spy/edk0 type: text @@ -6081,11 +6158,11 @@ action: http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html created_on: 1316837035.42207 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1440186198.55041 +last_referenced_on: 1445463917.51559 owner: Wulf rate_limit: 15 -ref_count: 20 -ref_user: doppel!~doppel@ip68-96-169-47.lv.lv.cox.net +ref_count: 21 +ref_user: ghobadimhd!~ghobadimh@46.62.148.79 type: text @@ -6152,12 +6229,12 @@ created_on: 1249578326 edited_by: edk!~edk@spy/edk0 edited_on: 1435278588.66322 enabled: 1 -last_referenced_in: profess -last_referenced_on: 1441803124.95005 +last_referenced_in: #pbot2 +last_referenced_on: 1445739954.99894 owner: kate` rate_limit: 15 -ref_count: 585 -ref_user: profess!~profess@unaffiliated/csddesk +ref_count: 587 +ref_user: fluter!~fluter@fedora/fluter type: text @@ -6189,12 +6266,12 @@ action: /say For a list of links to C standards, use the `standard` factoid; for action_with_args: /say Standard C has no notion of '$args', so you must be talking about some specific OS, library, tool, implementation, architecture, et cetera. These are beyond the scope of this channel, which focuses on Standard C. created_on: 1360056405.36738 enabled: 1 -last_referenced_in: refx_ -last_referenced_on: 1441191177.55693 +last_referenced_in: #pbot2 +last_referenced_on: 1445739934.40618 owner: pragma- rate_limit: 15 -ref_count: 312 -ref_user: refx_!~refx_@178.62.229.14 +ref_count: 315 +ref_user: fluter!~fluter@fedora/fluter type: text @@ -6303,12 +6380,12 @@ type: text action: a reserved file-scope identifier prefix when followed by a lowercase letter created_on: 1104399552 enabled: 1 -last_referenced_in: #cjeopardy -last_referenced_on: 1420549759.46157 +last_referenced_in: ##c +last_referenced_on: 1442477710.51726 owner: prec rate_limit: 15 -ref_count: 9 -ref_user: rob``!~rob@rmartinjak.de +ref_count: 10 +ref_user: sm0ke!~sm0ke@unaffiliated/sm0ke type: text @@ -6327,24 +6404,24 @@ type: text action: /say IT CAN ALL GO WRONG! created_on: 1288807630.54684 enabled: 1 -last_referenced_in: maxxe -last_referenced_on: 1434254496.53941 +last_referenced_in: pksadiq +last_referenced_on: 1445783498.30195 owner: pragma_ rate_limit: 15 -ref_count: 14 -ref_user: maxxe!~maxxe@unaffiliated/maxxe +ref_count: 15 +ref_user: pksadiq!~user@106.208.181.83 type: text action: /say A "string" is a contiguous sequence of characters terminated by and including the first null character; http://www.iso-9899.info/wiki/String created_on: 1179262366 enabled: 1 -last_referenced_in: profess -last_referenced_on: 1441803571.89075 +last_referenced_in: ##c +last_referenced_on: 1445758640.21642 owner: kate` rate_limit: 15 -ref_count: 113 -ref_user: profess!~profess@unaffiliated/csddesk +ref_count: 115 +ref_user: Wulf!~Wulf@unaffiliated/wulf type: text @@ -6591,11 +6668,11 @@ edited_by: edk!~edk@spy/edk0 edited_on: 1441696508.08881 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1441696026.2788 +last_referenced_on: 1445963511.29869 owner: ouah rate_limit: 15 -ref_count: 41 -ref_user: edk!~edk@spy/edk0 +ref_count: 42 +ref_user: fstd!~fstd@unaffiliated/fisted type: text @@ -6605,11 +6682,11 @@ edited_by: nitrix!~nitrix@unaffiliated/nitrix edited_on: 1402177800.48179 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1442076587.95332 +last_referenced_on: 1445828894.74093 owner: Spark rate_limit: 15 -ref_count: 121 -ref_user: Pessimist!Pessimist@gateway/shell/bnc4free/x-bxdxfwqfjqokkovn +ref_count: 126 +ref_user: m0shbear!~011899988@servbox.moshbear.net type: text @@ -6638,12 +6715,12 @@ type: text action: /say Top 10 beginner mistakes: http://www.andromeda.com/people/ddyer/topten.html (Bonus: find the mistakes within the mistakes!) created_on: 1193812563 enabled: 1 -last_referenced_in: pragma- -last_referenced_on: 1384450771.63236 +last_referenced_in: o11c +last_referenced_on: 1442544338.43885 owner: pragma_ rate_limit: 15 -ref_count: 29 -ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +ref_count: 30 +ref_user: o11c!~ben@unaffiliated/o11c type: text @@ -6734,12 +6811,12 @@ created_on: 1383136612.29563 edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos edited_on: 1383136647.79051 enabled: 1 -last_referenced_in: nitrix -last_referenced_on: 1441345075.13155 +last_referenced_in: glauxosdever +last_referenced_on: 1444070240.08304 owner: pragma-!~chaos@unaffiliated/pragmatic-chaos rate_limit: 15 -ref_count: 23 -ref_user: nitrix!~nitrix@unaffiliated/nitrix +ref_count: 24 +ref_user: glauxosdever!~alex@ppp-94-66-60-12.home.otenet.gr type: text @@ -6804,12 +6881,12 @@ type: text action: a qualifier for integer data types, which renders them incapable of representing negative numbers but increases the number of positive values they can represent. created_on: 1104595343 enabled: 1 -last_referenced_in: ##c -last_referenced_on: 1442089790.48174 +last_referenced_in: caze +last_referenced_on: 1442295889.34948 owner: infobahn rate_limit: 15 -ref_count: 22 -ref_user: dogbert2!~dogbert2@ip-64-134-160-99.public.wayport.net +ref_count: 23 +ref_user: CaZe!~caze@unaffiliated/caze type: text @@ -6840,12 +6917,12 @@ type: text action: a variable length array: an array data structure of automatic storage duration whose length is determined at run time (instead of at compile time). Example: void voo(int n) { float arr[n]; } created_on: 1241436478 enabled: 1 -last_referenced_in: #cjeopardy -last_referenced_on: 1432969991.18535 +last_referenced_in: ##c +last_referenced_on: 1442259946.78467 owner: Wulf_ rate_limit: 15 -ref_count: 25 -ref_user: zyxwvuts!~zyxwvuts@c220-239-46-46.eburwd6.vic.optusnet.com.au +ref_count: 26 +ref_user: jd_1!jd1@unaffiliated/jd1 type: text @@ -6880,12 +6957,12 @@ created_on: 1440522891.09036 edited_by: edk!~edk@spy/edk0 edited_on: 1440523076.63991 enabled: 1 -last_referenced_in: #pbot2 -last_referenced_on: 1440793614.01322 +last_referenced_in: ##c +last_referenced_on: 1445295169.61372 owner: edk!~edk@spy/edk0 rate_limit: 15 -ref_count: 8 -ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +ref_count: 9 +ref_user: m0shbear!~011899988@servbox.moshbear.net type: text @@ -6968,6 +7045,18 @@ ref_count: 1 ref_user: Wulf type: text + +action: /call toolchain +created_on: 1442509527.0591 +enabled: 1 +last_referenced_in: fizzie +last_referenced_on: 1445443989.23512 +owner: edk!~edk@spy/edk0 +rate_limit: 15 +ref_count: 2 +ref_user: fizzie!fis@unaffiliated/fizzie +type: text + action: /say The X is stupid problem: You want to do X, but don't know how. Therefore, X is stupid. created_on: 1410157333.66139 @@ -8574,12 +8663,12 @@ type: text action: /say How to disable line-buffering with termios/cbreak: http://shtrom.ssji.net/skb/getc.html and http://c-faq.com/osdep/cbreak.html created_on: 1106032892 enabled: 1 -last_referenced_in: pragma- -last_referenced_on: 1434482919.78455 +last_referenced_in: fluter +last_referenced_on: 1445941048.9145 owner: pragma_ rate_limit: 15 -ref_count: 27 -ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +ref_count: 29 +ref_user: fluter!~fluter@fedora/fluter type: text @@ -8598,11 +8687,11 @@ action: /call unp1 created_on: 1269767264 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1437647144.37884 +last_referenced_on: 1444401717.92506 owner: pragma_ rate_limit: 15 -ref_count: 68 -ref_user: kate!~kate@unaffiliated/kate +ref_count: 69 +ref_user: Wulf!~Wulf@unaffiliated/wulf type: text @@ -8610,11 +8699,11 @@ action: Unix Network Programming Vol I: http://www.unpbook.com/ created_on: 1195011079 enabled: 1 last_referenced_in: ##c -last_referenced_on: 1437647144.38915 +last_referenced_on: 1444401717.93916 owner: pragma_ rate_limit: 15 -ref_count: 153 -ref_user: kate!~kate@unaffiliated/kate +ref_count: 154 +ref_user: Wulf!~Wulf@unaffiliated/wulf type: text @@ -8629,7 +8718,15754 @@ ref_count: 25 ref_user: Dianora type: text +[#bash] + +action: /say event not found -- These errors only happen in *interactive* shells when you run commands with ! in them with history expansion enabled. Run set +o histexpand (set +H) to disable it,and put it in your ~/.bashrc to disable it in future shell sessions, too. Regardless, it won't affect scripts. +created_on: 1396365868 +enabled: 1 +noembed: 1 +owner: pgas +rate_limit: 10 +ref_count: 252 +ref_user: nobody +type: text + + +action: /call ! +created_on: 1280253840 +enabled: 1 +last_referenced_in: #pbot2-test +last_referenced_on: 1443840539.48509 +owner: greycat +rate_limit: 10 +ref_count: 3 +ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +type: text + + +action: /say In addition to having exec permission, the top of a script MUST have a #! line, called 'shebang' or 'hashbang'. It tells the kernel what program to run your script with. Make sure you adjust it to match where the appropriate version of Bash is installed on your system;. If your system does not have bash installed at /bin/bash you will likely have to adjust any scripts you receive. +created_on: 1421865429 +enabled: 1 +owner: kurahaupo1 +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say help set http://www.bash-hackers.org/wiki/doku.php?id=commands:builtin:set -- set +H is useful; -evx are very good for debugging. +created_on: 1190290306 +enabled: 1 +owner: karolisl +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + +<"> +action: /call UMQ +created_on: 1265219092 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 246 +ref_user: nobody +type: text + +<"`> +action: /say cmd1 "`cmd2 \"$1\"`" -- An expression that has never been written in the history of mankind; because that would be correct; and those that don't know enough to not use backticks also by necessity don't know how to quote. +created_on: 1360239652 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + +<#> +action: /say Either a comment, or in parameter expansion a count of something. ${#x} is the number of characters in $x. ${#x[@]} is the number of elements in the array 'x', and $# is the number of positional parameters. +created_on: 1184617884 +enabled: 1 +noembed: 1 +owner: kojiro +rate_limit: 10 +ref_count: 28 +ref_user: nobody +type: text + +<#!> +action: /call hashbang +created_on: 1251729845 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 80 +ref_user: nobody +type: text + +<#!binbash> +action: /say Use "!#/usr/bin/env bash" - it is more portable and will probably do what the user wants in a modified envrioment +created_on: 1284484161 +enabled: 1 +owner: variable +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + +<$> +action: /say In bash, $ means "Expand". It is NOT part of your variable name! You can expand "$variable" content, "$(command)" output or "$((arithmetic))" results. +created_on: 1254899939 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 53 +ref_user: nobody +type: text + +<$!> +action: /say $! expands to the process ID of the most recently executed background (asynchronous) command. +created_on: 1207111794 +enabled: 1 +owner: yitz +rate_limit: 10 +ref_count: 98 +ref_user: nobody +type: text + +<$"> +action: /say Bash supports $"..." quoting syntax for locale-specific translation. If the current locale is C or POSIX, the dollar sign is ignored. If the string is translated and replaced, the replacement is double-quoted. See http://mywiki.wooledge.org/BashFAQ/098 +created_on: 1291049946 +enabled: 1 +last_referenced_in: #pbot2-test +last_referenced_on: 1443840588.78843 +owner: geirha +rate_limit: 10 +ref_count: 57 +ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +type: text + +<$""> +action: /call $" +created_on: 1246686694 +enabled: 1 +last_referenced_in: #pbot2-test +last_referenced_on: 1443840588.77678 +owner: lhunath +rate_limit: 10 +ref_count: 2 +ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +type: text + +<$#> +action: /say $# expands to the number of arguments, not counting $0. +created_on: 1307345061 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 75 +ref_user: nobody +type: text + +<$$> +action: /say $$ expands to the PID of the shell. In a ( ) subshell, it expands to the process ID of the original shell, not the subshell. (Bash 4.0 and above have BASHPID for that.) +created_on: 1350055625 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 46 +ref_user: nobody +type: text + +<$'> +action: /say bash has a special form of quoting, $'string' in which backslash-character combinations are expanded. For example, IFS=$' \t\n' or echo $'It\'s embedded!' http://mywiki.wooledge.org/Quotes +created_on: 1386859414 +enabled: 1 +owner: BlastHardcheese +rate_limit: 10 +ref_count: 227 +ref_user: nobody +type: text + +<$''> +action: /call $' +created_on: 1404223310 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 18 +ref_user: nobody +type: text + +<$(> +action: /say Command Substitution: "$(cmd "foo bar")" causes the command 'cmd' to be executed with the argument 'foo bar' and "$(..)" will be replaced by the *output*. See http://mywiki.wooledge.org/BashFAQ/002 and http://mywiki.wooledge.org/CommandSubstitution +created_on: 1416561675 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 290 +ref_user: nobody +type: text + +<$((> +action: /say $((...)) is an arithmetic substitution. After doing the arithmetic, the whole thing is replaced by the value of the expression. See . +created_on: 1283616383 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 91 +ref_user: nobody +type: text + +<$(($> +action: /say # six=1+5 nine=8+1; echo $(($six * $nine)) vs $((six * nine)) +created_on: 1423497033 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + +<$()> +action: /call $( +created_on: 1373554250 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 131 +ref_user: nobody +type: text + +<$(<> +action: /say The command substitution $(cat file) can be replaced by the equivalent but faster $(< file). +created_on: 1228996478 +enabled: 1 +owner: iasc +rate_limit: 10 +ref_count: 79 +ref_user: nobody +type: text + +<$(echo> +action: /say $(echo ...) and echo $(...) are both pointless. Drop the echo and $(), just write ...: rm "$(echo myfile)" -> rm myfile --- echo "$(df -h)" -> df -h; http://www.iki.fi/era/unix/award.html#echo +created_on: 1423731482 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 33 +ref_user: nobody +type: text + +<$*> +action: /call $@ +created_on: 1305275487 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 204 +ref_user: nobody +type: text + +<$-> +action: /say $- expands to the current option flags as specified upon invocation, by the set builtin command, or those set by the shell itself (such as the -i option). +created_on: 1296939190 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 42 +ref_user: nobody +type: text + +<$0> +action: /say $0 is like argv[0] in C. It's whatever the caller decides to put there. You can't rely on it. See http://mywiki.wooledge.org/BashFAQ/028 and http://www.bash-hackers.org/wiki/doku.php/scripting/posparams#the_first_argument +created_on: 1280242031 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 159 +ref_user: nobody +type: text + +<$1> +action: /say Positional parameters by example: echo "First parameter is $1, second is $2. You supplied $# of them. They will now all be copied to /tmp."; cp "$@" /tmp; +created_on: 1285668282 +enabled: 1 +owner: koala_man +rate_limit: 10 +ref_count: 35 +ref_user: nobody +type: text + +<$?> +action: /say The special parameter ? (expanded by $?) holds the exit status of the last synchronous command. +created_on: 1390142801 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 213 +ref_user: nobody +type: text + +<$@> +action: /say The difference between $@ and $*: Without quotes (don't do this!), there is no difference. With double quotes, "$@" expands to each positional parameter as its own argument: "$1" "$2" ..., while "$*" expands to the single argument "$1c$2c...", where 'c' is the first character of IFS. You almost always want "$@" (QUOTED!). The same goes for arrays: "${array[@]}". +created_on: 1409667154 +enabled: 1 +owner: [arx] +rate_limit: 10 +ref_count: 514 +ref_user: nobody +type: text + +<$[> +action: /say $[...] is an obsolete, deprecated syntax for math. Don't use it. Use $((...)) instead. +created_on: 1294676904 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 72 +ref_user: nobody +type: text + +<$_> +action: /say "$_" expands to the last argument to the previous command, after expansion (man bash, Special Parameters) +created_on: 1303506465 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 56 +ref_user: nobody +type: text + +<$dayjob> +action: /say DAYJOB is a built-in variable for #bash, and is therefore capitalized +created_on: 1390438745 +enabled: 1 +owner: kurahaupo +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + +<$grep> +action: /say ''GREP="/usr/bin/grep -i"; $GREP $FILE'' -- Do NOT put command names or options in variables. Doing so is dangerous and buggy. Variables are containers for DATA. Either inline the command completely or use a *function* instead. http://mywiki.wooledge.org/BashFAQ/050 +created_on: 1405542319 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 12 +ref_user: nobody +type: text + +<$n> +action: /say http://bash-hackers.org/wiki/doku.php/scripting/posparams +created_on: 1231071212 +enabled: 1 +owner: shaiguitar +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + +<$shell> +action: /say The SHELL environment variable is normally set to the login shell specified in the passwd database (/etc/passwd) when you log in. It does NOT reflect what shell you're currently in. For that, try: ps -p $$ +created_on: 1396820717 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + +<$tmp> +action: /say Avoid short and meaningless variable names. Use your variable names to communicate what they hold: the more your naming says, the better your code reads. $file, not $f. $remoteHost, not $h. One convention is to use singular words for regular variables, plural for arrays and the first letter of the array for indexes in that array (eg. for f in "${!files[@]}" / for file in "${files[@]}"). +created_on: 1376535238 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + +<$var> +action: /say $var is NOT a variable. var is a variable and $var is the EXPANSION of that variable. bash replaces it by the contents of the variable var. +created_on: 1209547390 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 7 +ref_user: nobody +type: text + +<${> +action: /say Without curly braces parameter expansions refer to the longest valid variable name or shortest positional parameter. "${var}bar" expands the parameter named "var" while "$varbar" expands "varbar". "$123" references argv[1] and "${123}" references argv[123]. Braces are requried for parameters > 9, special PEs, and array expansions: ${10}, ${var##pat}, ${arr[5]}. BRACES AREN'T A SUBSTITUTE FOR QUOTES! +created_on: 1423925089 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 220 +ref_user: nobody +type: text + +<${!> +action: /say See !faq 6 for indirect variables, or !faq 5 for listing array indices. +created_on: 1425074604 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 16 +ref_user: nobody +type: text + +<${#> +action: /say see !faq length for variables and !faq 5 for array varibles +created_on: 1261337435 +enabled: 1 +owner: irc2samus +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + +<${$> +action: /say The correct syntax for parameter expansion is ${varMODIFIER} not ${$varMODIFIER}. Remove that second $. +created_on: 1179319977 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 10 +ref_user: nobody +type: text + +<${${> +action: /say ${x}, ${x%y}, ${x:y:z}, ... are parameter expansions. x needs to be a parameter. you can't 'nest' them like ${${x#y}%z} because ${x#y} is an expansion (a string), not a parameter. +created_on: 1283757338 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + +<${}> +action: /call ${ +created_on: 1287148365 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 36 +ref_user: nobody +type: text + +<&> +action: /say If you put the control operator & at the end of a command, e.g. ''command args &'', the shell executes the command in the background in a subshell. The shell does not wait for the command to finish, and the return status is 0. Pid of the last backgrounded command is available via the special variable $! +created_on: 1272476781 +enabled: 1 +owner: ferret +rate_limit: 10 +ref_count: 149 +ref_user: nobody +type: text + +<&&> +action: /call || +created_on: 1372353346 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 115 +ref_user: nobody +type: text + +<&&:> +action: /say cmd && : prevents set -e from killing the shell, and keeps intact the exit code of cmd +created_on: 1441042578 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + +<&&if> +action: /say Beware: ''a && b || c'' is NOT THE SAME as ''if a; then b; else c; fi''. The former will run 'c' if EITHER 'a' or 'b' fails. The if will run 'c' ONLY if 'a' fails. +created_on: 1375297234 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + +<&&||> +action: /say foo && bar || baz is not equivalent to 'if foo; then bar; else baz; fi'. In the former case, baz will happen if *either* foo *or* bar return false. In the latter case, baz will only trigger if foo returns false, regardless of the exit code for bar. See http://mywiki.wooledge.org/BashPitfalls +created_on: 1276419923 +enabled: 1 +owner: \amethyst +rate_limit: 10 +ref_count: 48 +ref_user: nobody +type: text + +<&;> +action: /say '&;' is always wrong. So is '& ;'. If you want to run things in the background in a compact one-liner, omit the ';' entirely and simply use '&' between commands. for f in ./*; do my_command "$f" & done - see http://mywiki.wooledge.org/BashPitfalls#pf21 +created_on: 1397244466 +enabled: 1 +owner: fr33load3r +rate_limit: 10 +ref_count: 94 +ref_user: nobody +type: text + +<&>> +action: /say &> is a bash-specific feature. «&>file» is equivalent to «>file 2>&1». There is no &>> until Bash4. Use «>>file 2>&1» instead. We recommend not using &> or &>> in scripts, because it will break some valid scripts (see !badredir), and is an unintuitive syntax for beginners. +created_on: 1432128216 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 75 +ref_user: nobody +type: text + +<&>>> +action: /say ''&>file'' is equivalent to ''>file 2>&1'' and is bash/ksh specific. In bash 4, there is also ''&>>file''. For portability, it is a good idea to just write it out fully. +created_on: 1426602961 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 14 +ref_user: nobody +type: text + +<'> +action: /say Single quotes (') cause everything between them to be taken literally by bash. If you want to embed a ' inside a '...', write it as the four characters, '\'': echo 'It'\''s a blast!' +created_on: 1277222888 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 243 +ref_user: nobody +type: text + +<''> +action: /say '' is preferred for quoting code in #bash, because it has no semantic meaning for the shell; someone can copy-and-paste ''foo'' or the contents within, and the meaning to the shell is the same either way. +created_on: 1357254500 +enabled: 1 +owner: nDuff +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + +<(> +action: /call () +created_on: 1357143428 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 92 +ref_user: nobody +type: text + +<((> +action: /say ((...)) is an arithmetic command, which returns an exit status of 0 if the expression is nonzero, or 1 if the expression is zero. Also used as a synonym for "let", if side effects (assignments) are needed. See . +created_on: 1293585738 +enabled: 1 +owner: prince_jammys +rate_limit: 10 +ref_count: 358 +ref_user: nobody +type: text + +<()> +action: /say Commands ran inside parenthesis are executed in a subshell. Useful for cd'ing into a directory without needing to figure out how to back out. See http://mywiki.wooledge.org/SubShell +created_on: 1357143415 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 45 +ref_user: nobody +type: text + +<(.)(.)bang> +action: /say http://homepages.cwi.nl/~aeb/std/shebang/ +created_on: 1168017697 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + +<**> +action: /call globstar +created_on: 1254155054 +enabled: 1 +owner: \amethyst +rate_limit: 10 +ref_count: 24 +ref_user: nobody +type: text + +<-> +action: /say Tools generally consider an argument that begins with a - as an option. To pass a filename that begins with a -, prefix it with its path: rm ./-foo. Also: rm -- -foo (see !--). - alone can also mean stdin. +created_on: 1379918390 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 28 +ref_user: nobody +type: text + +<--> +action: /say The special option -- means "end of options" to every POSIX command except echo and test. E.g., mv -- *.png /somedir # see also http://wiki.bash-hackers.org/dict/terms/end_of_options +created_on: 1316030679 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 148 +ref_user: nobody +type: text + +<-9> +action: /say Do NOT use SIGKILL (kill -9) to terminate processes. All processes will terminate in response to the default SIGTERM. If they don't terminate instantly, that's because they're busy cleaning up. If you interrupt them, you break them. See http://stackoverflow.com/a/690631/347411 +created_on: 1384960490 +enabled: 1 +noembed: 1 +owner: lhunath +rate_limit: 10 +ref_count: 76 +ref_user: nobody +type: text + +<-c> +action: /say bash -c 'bash commands to execute' "$0" "$1" "$2" ... Since "$0" is typically unused, it is often set it to something arbitrary like _ +created_on: 1254411920 +enabled: 1 +owner: \amethyst +rate_limit: 10 +ref_count: 12 +ref_user: nobody +type: text + +<-e> +action: /call set-e +created_on: 1319454580 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 70 +ref_user: nobody +type: text + +<-exec_> +action: /say find ... -exec sh -c 'blah "$1"' _ {} \; # When invoked with -c, any POSIX shell (including bash) uses the first positional parameter as "$0". '_' is a dummy value, so the passed filename becomes "$1". it could be anything. of course "$0" could be used, but when using -exec {} +, "$@" does not include "$0" +created_on: 1331919289 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + +<-f> +action: /say Do you actually need that -f in that command? If there a reason you are using it? Or is it just there because of habit? Do you actually know what the -f does and do you even want it there? +created_on: 1430612710 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + +<-nt> +action: /say [ f1 -nt f2 ] True if file1 is newer (mtime) than file2 *or* if file1 exists and file2 does not. +created_on: 1182378035 +enabled: 1 +owner: redduck666 +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + +<-r> +action: /say Always use read with the -r option, otherwise backslashes are special. http://wiki.bash-hackers.org/commands/builtin/read#read_without_-r +created_on: 1410998544 +enabled: 1 +owner: Riviera +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + +<-u> +action: /call set-u +created_on: 1408798435 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + +<-x> +action: /call set-x +created_on: 1434697012 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 409 +ref_user: nobody +type: text + +<08> +action: /call august +created_on: 1312544942 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + +<10q> +action: /say Isn't anyone going to thank me for all my hard work? +created_on: 1299792689 +enabled: 1 +owner: kwtm +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + +<1line> +action: /call in1line +created_on: 1407527470 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 22 +ref_user: nobody +type: text + +<256colormap> +action: /say E=echo\ ;P=printf\ ;M=$'\e[0m';a(){ $P"\e[38;5;2${z}5;48;5;${1}m %4d $M" $1;};Z=$E$M;for i in 16 93 160;do ((r=(n=\!n)*2-1));for((x=0;x<6;x++,i+=r)) do for((j=0;L=(i+(R=(j/6?17-j:j))*6),z=(R%6>1?3:5),j<12;j++))do a $L;done;$E;done;done;z=5;for i in {0..23};do a $[i+232];((i==11))&&$Z;done;for i in {0..15};do ((i==8||\!i))&&$P'\n%*s' 12;a $i;done;$E +created_on: 1420424787 +enabled: 1 +owner: i336_ +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + +<2>&1> +action: /say Making sense of the copy descriptor operator: http://wiki.bash-hackers.org/scripting/copydescriptor +created_on: 1271714518 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 76 +ref_user: nobody +type: text + +<2d> +action: /say Bash doesn't support multi-dimensional arrays. Common substitutes are: 1. directories, eg. firstName=$(<~/.myscript/names/first/"$person"); 2. shared indexes, eg. name="${firstNames[person]} ${lastNames[person]}"; 3. merge in associative key, eg. declare -A names=( ["0-first"]=John ["0-last"]=Doe ["1-first"]=Jane ["1-last"]=Doe ); 4. primes, eg. names[i*29 + j*31]=value +created_on: 1392997002 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + +<2like> +action: /say !1 but without backslash interpretation or stripping of leading/trailing spaces: while read -r; do my-command "$REPLY"; done +action: /say Step 1: Figure out want you want to do. Step 2: Do it. The first step is the hard part. +created_on: 1188812922 +enabled: 1 +owner: ivazquez +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + +<42> +action: /say 6 times 9 +created_on: 1426270480 +enabled: 1 +noembed: 1 +owner: izabera +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + +<80> +action: /say The 80-character limit is mostly pointless nowadays, except for in specific circumstances. +created_on: 1318952897 +enabled: 1 +noembed: 1 +owner: neurolysis +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + +<8601> +action: /say https://xkcd.com/1179/ +created_on: 1371021179 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + +<99.9%> +action: /say http://dilbert.com/fast/2008-05-08 +created_on: 1398725722 +enabled: 1 +owner: [arx] +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + +<:> +action: /say : is a builtin identical to the true builtin; they do nothing and have an exit status of 0 +created_on: 1270345566 +enabled: 1 +last_referenced_in: perks +last_referenced_on: 1445880202.47768 +owner: yitz_ +rate_limit: 10 +ref_count: 94 +ref_user: perks!~perks@static-108-54-254-164.nycmny.fios.verizon.net +type: text + +<:)> +action: /say This character sequence causes greycat to smile. Use with caution. +created_on: 1303248798 +enabled: 1 +owner: kwtm +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + +<:-> +action: /say ${parameter:-word} Use Default Values. If parameter is unset or null, the expansion of word is substituted. +created_on: 1409271629 +enabled: 1 +owner: koala_man +rate_limit: 10 +ref_count: 11 +ref_user: nobody +type: text + +<:=> +action: /say ${parameter:=word} Assign Default Values. If parameter is unset or null, the expansion of word is assigned to parameter. +created_on: 1407542483 +enabled: 1 +owner: koala_man +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + +<;> +action: /say The ";" character is used to separate between commands. It does the (almost) exact same thing that does in a shell or a newline in a script. +created_on: 1426717129 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + +<;&> +action: /call ;; +created_on: 1338252255 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 17 +ref_user: nobody +type: text + +<;;> +action: /say ;; signifies the end of a case list. ;& makes it fall through to the next list. ;;& makes it fall through to the next list if the pattern matches. +created_on: 1338252194 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + +<;;&> +action: /call ;; +created_on: 1338252260 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + +<<> +action: /call redir +created_on: 1236006930 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 55 +ref_user: nobody +type: text + +<<(> +action: /say Process Substitution: <(command) or >(command) is replaced by a FIFO or /dev/fd/* entry. Basically shorthand for setting up a named pipe. See . Example: diff -u <(sort file1) <(sort file2) +created_on: 1403286314 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 357 +ref_user: nobody +type: text + +<<()> +action: /say Process Substitution >(command ...) or <(...) is replaced by a temporary filename. Writing or reading that file causes bytes to get piped to the command inside. Often used in combination with file redirection: cmd1 2> >(cmd2). See http://mywiki.wooledge.org/ProcessSubstitution http://mywiki.wooledge.org/BashFAQ/024 +created_on: 1376318052 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 81 +ref_user: nobody +type: text + +<<<> +action: /say Here documents. cat < +action: /call <<() +created_on: 1395865286 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + +<<<()> +action: /say command < <(othercommand) # Same thing as ''othercommand | command'' but without subshelling 'command'. Uses file redirection (<) to redirect a file created by process substitution (<()). The space between < and <(..) is important to avoid ambiguity (is it a heredoc, is it a redirected PS?). +created_on: 1395865667 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + +<<<-> +action: /say Indented Here documents. Here documents started with <<- will ignore preceding tabs on each line, allowing you to indent your here documents nicely. Refer to << for general information on Here documents. Note that only TABs will work - spaces will not. Some editors can replace the TAB character with spaces, so be careful. +created_on: 1426300221 +enabled: 1 +owner: llua +rate_limit: 10 +ref_count: 71 +ref_user: nobody +type: text + +<<<<> +action: /say Here strings. Similar to here documents: The word after <<< and a newline are passed to the standard input of a command. Syntax: ''command <<< "some sentence"'' (Like ''echo "some sentence" | command'', but without the overhead of the subshell) +created_on: 1228905237 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 277 +ref_user: nobody +type: text + +<<<<$(> +action: /say <<<"$(command)" is pointless. It creates multiple temp files, requires the entire command to run before passing it to stdin, and removes trailing newlines from the command's output. Without the quotes, it's even worse; wordsplitting occurs and all whitespace gets squeezed to single spaces. Process substition was created for doing this efficiently and correctly. See http://mywiki.wooledge.org/ProcessSubstitution +created_on: 1333171490 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 19 +ref_user: nobody +type: text + +<<>> +action: /say <>foo is the same as 0<>foo. To redirect both stdin and stdout to the same file, you need <>foo >&0 +created_on: 1440948454 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + +<<|>bang> +action: /say http://en.wikipedia.org/wiki/Shebang_%28Unix%29 +created_on: 1168017759 +enabled: 1 +owner: VImtermute +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + +<=> +action: /call assignment +created_on: 1326989443 +enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1443847029.61552 +noembed: 1 +owner: greycat +rate_limit: 10 +ref_count: 58 +ref_user: letsfindout!~letsfindo@cpe-76-89-236-90.socal.res.rr.com +type: text + +<=$?> +action: /say If you're using $? and not immediately assigning it to a variable, you're DoingItWrong. Either you're testing it immediately (in which case you don't need $? at all, see ![$? ) or else you're doing something else and then using it, in which case the value of $? will be changed before you use it. +created_on: 1422998875 +enabled: 1 +owner: kurahaupo +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + +<==> +action: /say The == operator is used to test numbers for equality in ((arithmetic expressions)). In BASH and ksh it is the same as = in [[ ]]. It should not be used in the POSIX / Bourne compatible test or [ ], as this will not work in other shells. +created_on: 1285106199 +enabled: 1 +noembed: 1 +owner: ferret +rate_limit: 10 +ref_count: 46 +ref_user: nobody +type: text + +<>> +action: /say Use > to write redirect STDOUT to a file: ls > myFileList. See !redir +created_on: 1222624666 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 96 +ref_user: nobody +type: text + +<>&> +action: /say >&word where word is a number or - is FD duplication or closing. A plain >& or >&word (word not numeric or -) is just like &> -- cmd >& file is equivalent to cmd >file 2>&1 but the former is bash- and csh-only. +created_on: 1319317790 +enabled: 1 +owner: greycat|home +rate_limit: 10 +ref_count: 16 +ref_user: nobody +type: text + +<>(> +action: /call <( +created_on: 1236007616 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 73 +ref_user: nobody +type: text + +<>()> +action: /call >( +created_on: 1285771573 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 20 +ref_user: nobody +type: text + +<>>> +action: /say Use >> to append to a file and prevent the original contents from being erased. See !redir +created_on: 1222624659 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 69 +ref_user: nobody +type: text + +<>sed> +action: /say Ask in #sed. +created_on: 1200547743 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 7 +ref_user: nobody +type: text + +<>|> +action: /say Redirect stdout, like > but ignores noclobber (set -C). See http://wiki.bash-hackers.org/syntax/redirection +created_on: 1423467671 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say A question mark indicates a sentence is a question. When you see a sentence directed at you terminated with this symbol, somebody has asked you a question and is waiting for you to answer it. +created_on: 1402671387 +enabled: 1 +last_referenced_in: deadsoul +last_referenced_on: 1446177502.40201 +noembed: 1 +owner: lhunath +rate_limit: 10 +ref_count: 19 +ref_user: DeaDSouL!~deadsoul@94.29.129.54 +type: text + +<@> +action: /say The positional parameters can be used like a named array, sort of. "$@" is just like "${array[@]}". PE works too: "${@:2}", or "${@:(-1)}", or "${@/#-/}", etc. However, you can't set or unset single positional params. +created_on: 1303392666 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 63 +ref_user: nobody +type: text + +<[> +action: /say [ or test is the POSIX test command. It can do simple tests on files and strings. In bash, you should use the more powerful [[ instead and ban [ for sake of consistency. [[ can do pattern matching, is faster and safer to use. http://mywiki.wooledge.org/BashGuide/TestsAndConditionals http://mywiki.wooledge.org/BashFAQ/031 +created_on: 1393469285 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 358 +ref_user: nobody +type: text + +<[$?> +action: /say Don't do this: ``mycommand; if [ $? -eq 0 ]'' -- You're running the [ command and checking its exit code to test whether "mycommand"'s exit code is 0. That's a pointless operation, test mycommand directly: ``if mycommand'' +created_on: 1403808404 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 145 +ref_user: nobody +type: text + +<[-a> +action: /say The classic test command's -a and -o operators, as well as controlling precedence using ( and ) cause many problems and ambiguities, are not portable, and are unsafe with user input. They are all marked as obsolescent by POSIX. If coding for Bash, Ksh, or Zsh, [[ is *highly* preferred over [. See: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html#tag_20_128_16 +created_on: 1331097167 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 30 +ref_user: nobody +type: text + +<[-o> +action: /call [-a +created_on: 1347065450 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 8 +ref_user: nobody +type: text + +<[:> +action: /say Character classes like [a-z] or [A-Z0-9] may behave strangely in non-POSIX locales. If you want your script to work locale-wise, use [[:lower:]] or [[:upper:][:digit:]] instead. Remember to always quote your character classes, as they may be expanded by the shell as file globs. See also !locale +created_on: 1289302978 +enabled: 1 +owner: cthuluh +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + +<[<> +action: /say to get STRING comparison you must escape the < in [ a \< b ] otherwise "< b" is intrepreted as a redirection from the file "b". There is no problem with [[ a < b ]]. The same applies to [ a \> b ] +created_on: 1182865801 +enabled: 1 +owner: redduck666 +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + +<[[> +action: /say [[ is a bash keyword similar to (but more powerful than) the [ command. See and . Unless you're writing for POSIX sh, we recommend [[. +created_on: 1273072403 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 752 +ref_user: nobody +type: text + +<[[$?> +action: /call [$? +created_on: 1332920944 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 13 +ref_user: nobody +type: text + +<[vs[[> +action: /say '[', also known as 'test' is the POSIX variant of [[. [ does NOT support ==, =~, &&, ||, glob pattern matching; unquoted > and < will do file redirection instead of comparison, etc. See http://mywiki.wooledge.org/BashFAQ/031 +created_on: 1244096499 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + +<\0> +action: /say ASCII zero, the null byte, aka 'NUL' is the best delimiter for lists of strings (eg. file names). However, there isn't much you can do with it in portable scripts. Bash can read null-byte delimited input with "while IFS= read -d ''; do ... ". Bash cannot store or pass a null byte as parameter. *Unportable* versions of the following utilities can work with NULs: find, sort, xargs, and sed. +created_on: 1216931860 +enabled: 1 +owner: prince_jammys +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + +<\<> +action: /say The symbols \< and \> respectively match the empty string at the beginning and end of a word. +created_on: 1387543772 +enabled: 1 +owner: juanmabc +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + +<\<\>> +action: /say The symbols \< and \> respectively match the empty string at the beginning and end of a word. +created_on: 1387543789 +enabled: 1 +owner: juanmabc +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + +<\>> +action: /say The symbols \< and \> respectively match the empty string at the beginning and end of a word. +created_on: 1387543778 +enabled: 1 +owner: juanmabc +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + +<\r> +action: /call cr +created_on: 1318766724 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 23 +ref_user: nobody +type: text + +<\w> +action: /call prompt +created_on: 1300816057 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + +<]> +action: /call [ +created_on: 1236007699 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + +<]]> +action: /call [[ +created_on: 1236007711 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + +<^$()> +action: /say You do not need $() to "run stuff". $(command); $(command); $(command) is just plain WRONG. Bash runs every line as a command. $() is ONLY used to capture the OUTPUT of the command and INLINE it (expand it in-place). Use command; command; command instead. +created_on: 1298537848 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + +<^c> +action: /say Bash 4.0 started echoing ^C when you press SIGINT in editing mode, which is very annoying. To revert to previous behavior in bash 4.1: echo 'set echo-control-characters off' >> ~/.inputrc # (No known way to fix it in bash 4.0.) +created_on: 1290030096 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + +<^m> +action: /call cr +created_on: 1424745181 +enabled: 1 +owner: BlastHardcheese +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + +<_> +action: /say The parameter _ is often used as a dummy variable in read commands to discard unwanted fields. It should not be used this way in portable scripts due to known conflicting usages in several common shells. See also: $_ +created_on: 1407970806 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 42 +ref_user: nobody +type: text + +<_matrix_> +action: /say Follow the white rabbit... +created_on: 1188335214 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + +<`> +action: /say The backquote (`) is used in the old-style command substitution, e.g. foo=`command`. The foo=$(command) syntax is recommended instead. Backslash handling inside $() is less surprising, and $() is easier to nest. See http://mywiki.wooledge.org/BashFAQ/082 +created_on: 1309376538 +enabled: 1 +last_referenced_in: fizzie +last_referenced_on: 1445905590.16706 +owner: greycat +rate_limit: 10 +ref_count: 739 +ref_user: fizzie!fis@unaffiliated/fizzie +type: text + +<``> +action: /call ` +created_on: 1269959359 +enabled: 1 +last_referenced_in: fizzie +last_referenced_on: 1445905590.15712 +owner: pgas +rate_limit: 10 +ref_count: 19 +ref_user: fizzie!fis@unaffiliated/fizzie +type: text + +<`echo> +action: /call $(echo +created_on: 1381432831 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 15 +ref_user: nobody +type: text + +<`irc> +action: /say DO NOT use back ticks as "irc markup". They are _syntax_, and using them as such can do nothing except lead to confusion +created_on: 1339015429 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 13 +ref_user: nobody +type: text + + +action: /say http://bash-hackers.org/wiki/doku.php/bash4#associative_arrays +created_on: 1270921370 +enabled: 1 +owner: bronze +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /call greybot +created_on: 1342211697 +enabled: 1 +owner: sjohnson +rate_limit: 10 +ref_count: 26 +ref_user: nobody +type: text + + +action: /say The infamous "Advanced" Bash Scripting Guide should be avoided unless you know how to filter out the junk. It will teach you to write bugs, not scripts. In that light, the BashGuide was written: http://mywiki.wooledge.org/BashGuide +created_on: 1274126057 +enabled: 1 +last_referenced_in: #cjeopardy +last_referenced_on: 1445717882.74384 +owner: TheBonsai +rate_limit: 10 +ref_count: 3 +ref_user: jim!~jim@unaffiliated/jim +type: text + + +action: /say # abspath()(p=$1/; [[ $p = /* ]] || p=$PWD/$p; while [[ $p = */@(..|.|)/* ]]; do p=${p//\/.\//\/} p=${p//\/\//\/} p=${p/#\/..\//\/} p=${p/\/+([!\/])\/..\//\/}; done; [[ $p = / ]] || p=${p%/}; printf %s\\n "$p"); abspath a/b//c/./d/../e +created_on: 1418429757 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + + +action: /say kojiro's abusing the bot again +created_on: 1332368767 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say >>>Your ad here!<<< +created_on: 1235330535 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say adu(1) - a date utility - source code at http://twkm.freeshell.org/adu.tar.Z +created_on: 1213292230 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + + +action: /say You are? Good then could you fix the bugs in bash? You know the list of course, since you *are* advanced. Thanks for your help. Oh and edit the wiki! :D +created_on: 1181274380 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /call away +created_on: 1332432221 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say !ah +created_on: 1431289268 +enabled: 1 +owner: strayPuppy +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say An alias is a small in-line command name text replacement. They are not commands and cannot take arguments. Only use aliases for expanding things like default command switches: alias l='ls -l'. For everything else, use a function instead: del() { mv -i "$@" ~/.trash; } +created_on: 1427822613 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 353 +ref_user: nobody +type: text + + +action: /say Aliases suck. They don't work in scripts. They can't take arguments. They have special evil magical powers that break all expectations. See http://mywiki.wooledge.org/BashFAQ/080 for starters. +created_on: 1280234894 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 22 +ref_user: nobody +type: text + + +action: /say 3# for _ in $(echo <(: {1..26})); do printf \\"$(printf %o $((128-${_##*/})))"; done; echo +created_on: 1431989300 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say In X-windows, AltGr is a notional key which can be bound to a regular key on a keyboard, so you can use that key somewhat like a "shift" key to access additional symbols such as ¬ ¥ ÷ ¿ ½ €. Usually it is bound to one of the "windows" or "alt" keys. +created_on: 1383888104 +enabled: 1 +owner: kurahaupo +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Ambiguity is bad! It makes bad... stuff... happen! Badly! +created_on: 1156190461 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say "older, or emotionally damaged brains that have trouble dealing with the evolving nature of language and communication will condemn new constructs as evidence of incompetence. All it really means is they are slowly fading from relevance." +created_on: 1204210924 +enabled: 1 +owner: savetheWorld +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say "Anarchists are those who advocate the absence of the state, arguing that __common sense__ would allow for people to come together in agreement to form a functional society" -- http://en.wikipedia.org/wiki/Anarchy#Anarchism +created_on: 1181111829 +enabled: 1 +owner: r00t +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say Try faq foo and bar aka faq 79 +created_on: 1284688041 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say Yes, there's always another way. Write a script that produces random output and performs random file deletions/creations/renamings, and run it repeatedly until it produces the desired outcome. +created_on: 1197467386 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /call vt100 +created_on: 1236006955 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 11 +ref_user: nobody +type: text + + +action: /say If we're asking you questions, it's not to intentionally annoy or delay you. We're trying to find the best answer to your problem. Want a good solution? Patiently answer each of them to the best of your ability. +created_on: 1329900503 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + + +action: /say http://mikeash.com/getting_answers.html "Most of the time you'll be talking to people who know more about the subject at hand than you do (that's why you came to them for help in the first place, remember). As such, it pays to at least entertain the possibility that they know what they're talking about." Read the link and bear in mind we deal with that shit day in, day out. +created_on: 1183679425 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 30 +ref_user: nobody +type: text + + +action: /say zzZZzz. what who huh? oh... Yay. zzZZzz +created_on: 1260825218 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say Advanced Programming in the Unix Environment, by W. Richard Stevens, recently edited and revised by Stephen A. Rago. +created_on: 1182811478 +enabled: 1 +owner: wonderfrog +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say Archlinux is usually taken as a l33t distro but the truth is that anyone who manages a rcfile is l33t-enough to deal with it :) +created_on: 1217270636 +enabled: 1 +owner: Samus_ +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say "(arg: N)" (N is any number) is what you get in emacs mode when you press ESC and then type a number. The NEXT thing you press after the number will be repeated N times. Silly emacs. +created_on: 1280926535 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /call argmax +created_on: 1369946112 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say The kernel constant ARG_MAX defines the maximum number of bytes that can be passed to exec(3). On Linux since libc 2.8, this value is determined dynamically based upon the system, and is not hardcoded. # http://www.in-ulm.de/~mascheck/various/argmax/ +created_on: 1362210137 +enabled: 1 +owner: cdown +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /call arguments +created_on: 1280443518 +enabled: 1 +last_referenced_in: #pbot2-test +last_referenced_on: 1443919243.4761 +noembed: 1 +owner: lhunath +rate_limit: 10 +ref_count: 212 +ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +type: text + + +action: /say Understanding Arguments and Word Splitting: http://mywiki.wooledge.org/Arguments +created_on: 1280443509 +enabled: 1 +last_referenced_in: #pbot2-test +last_referenced_on: 1443919243.49179 +owner: lhunath +rate_limit: 10 +ref_count: 148 +ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos +type: text + + +action: /say Add 7 to a variable: let a+=7; ((a+=7)); a=$((a+7)); See http://wooledge.org/mywiki/ArithmeticExpression +created_on: 1211897084 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 69 +ref_user: nobody +type: text + + +action: /call math +created_on: 1332853588 +enabled: 1 +owner: koala_man +rate_limit: 10 +ref_count: 12 +ref_user: nobody +type: text + + +action: /say An array maps numbers to strings. Bash 4 also has associative arrays (maps strings to strings). http://mywiki.wooledge.org/BashSheet#Arrays http://mywiki.wooledge.org/BashFAQ/005 http://wiki.bash-hackers.org/syntax/arrays +created_on: 1333507216 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 385 +ref_user: nobody +type: text + + +action: /call array +created_on: 1326838472 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 320 +ref_user: nobody +type: text + + +action: /say Indexed array assignment evaluation order: https://gist.github.com/ormaaj/4942297#file-output +created_on: 1361171698 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 7 +ref_user: nobody +type: text + + +action: /say http://wooledge.org/mywiki/BashFAQ/071 -- How do I convert an ASCII character to its decimal (or hexadecimal) value and back? +created_on: 1214104718 +enabled: 1 +owner: savetheWorld +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say "Ash" is ambiguous. It is a name shared by a huge family of Bourne-like shells. See: http://www.in-ulm.de/~mascheck/various/ash/ . Currently maintained examples include Dash and Busybox's ash (go to #uclibc for the latter). +created_on: 1355640304 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 7 +ref_user: nobody +type: text + + +action: /say If you have a question, please just ask it. Don't look for topic experts. Don't ask to ask. Don't PM! Don't ask if people are awake, or in the mood to help. Just ask the question straight out, and be patient waiting for an answer. http://mywiki.wooledge.org/NetEtiquette +created_on: 1326464553 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 465 +ref_user: nobody +type: text + + +action: /say http://i.qkme.me/3qt516.jpg +created_on: 1411213457 +enabled: 1 +owner: Riviera +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say To assign to a variable, use varname=value . Do not include spaces around the '=', and do not write $varname on the left hand side. +created_on: 1324498191 +enabled: 1 +last_referenced_in: ##c +last_referenced_on: 1443847029.63302 +owner: greycat +rate_limit: 10 +ref_count: 192 +ref_user: letsfindout!~letsfindo@cpe-76-89-236-90.socal.res.rr.com +type: text + + +action: /say Associative Arrays map strings to strings (Bash 4): http://mywiki.wooledge.org/BashGuide/Arrays#Associative_Arrays +created_on: 1264431009 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 43 +ref_user: nobody +type: text + + +action: /say "Assume makes an 'ass' of 'u' and 'me'" +created_on: 1181068753 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say To attach files to email in a script, use mutt or nail. If you are on a piece of shit legacy machine and have to use mail/mailx, see http://www.shelldorado.com/articles/mailattachments.html +created_on: 1262799276 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say August is the month when all your scripts break because you placed $(date +%m) in a variable and tried to do arithmetic with it, without removing the leading zeros. 08 is considered octal. Use $((10#$month)) to force decimal, or strip the zero. +created_on: 1283434611 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 203 +ref_user: nobody +type: text + + +action: /say Authentication is ENTIRELY a function of the application or system to which you are authenticating. THERE IS NO GENERAL WORKAROUND. If you are authenticating to MySQL, ask #mysql. If you want to automate ssh, see http://mywiki.wooledge.org/BashFAQ/069 . If you want to set users' passwords, see http://mywiki.wooledge.org/BashFAQ/078 . +created_on: 1302640271 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /call auth +created_on: 1325621809 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say autocd moves to directories automatically without having to prepend them with ''cd'', it's available from bash4+. +created_on: 1360045685 +enabled: 1 +owner: cdown +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /call expect +created_on: 1314085075 +enabled: 1 +owner: neurolysis +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say http://git.savannah.gnu.org/cgit/bash.git/tree/examples/functions/autoload.v3?h=devel +created_on: 1359430419 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say We don't care about every trip to the potty that you make. Do not announce your aways publically. See http://sackheads.org/~bnaylor/spew/away_msgs.html +created_on: 1203498387 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 27 +ref_user: nobody +type: text + + +action: /say Check the topic of #awk and also http://www.grymoire.com/Unix/Awk.html -- awk questions belong to #awk. Note: If you are piping through more than one (grep|sed|awk), you're likely doing it wrong. +created_on: 1251905329 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say The correct way to get a shell variable into awk is with awk's -v flag, not by putting the $var into the awk code. var=foo; awk -v name="$var" 'BEGIN{print "Hello " name}' +created_on: 1397111810 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say To inject data into an awk script, pass the option -v "var=$data" and use var inside your awk code. +created_on: 1348086109 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /call awkvars +created_on: 1309881022 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say Set an awk variable: awk ... -v foo="$bar" ... '$0 ~ foo' +created_on: 1309272711 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say The questioner will never tell you what they are really doing the first time they ask. +created_on: 1185921061 +enabled: 1 +owner: savetheWorld +rate_limit: 10 +ref_count: 44 +ref_user: nobody +type: text + + +action: /say bashphorism 1: the questioner's first description of the problem/question will be misleading. +created_on: 1176858420 +enabled: 1 +owner: savetheWorld +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /call b1 +created_on: 1236007767 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 96 +ref_user: nobody +type: text + + +action: /say Please apply (( % 10 )) to the bashphorism value. +created_on: 1215703933 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 67 +ref_user: nobody +type: text + + +action: /say all logic is deniable; however, some logic will *plonk* you if you deny it. +created_on: 1260306478 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 69 +ref_user: nobody +type: text + + +action: /say everyone ignores greycat when he is right. When he is wrong, it is !b1. +created_on: 1280173179 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 65 +ref_user: nobody +type: text + + +action: /say the newbie doesn't actually know what he's asking. If he did, he wouldn't need to ask. +created_on: 1280173410 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 74 +ref_user: nobody +type: text + + +action: /say The more advanced you are, the more likely you are to be overcomplicating it. +created_on: 1285786355 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 73 +ref_user: nobody +type: text + + +action: /say The more of a beginner you are, the more likely you are overcomplicating it. +created_on: 1388781119 +enabled: 1 +owner: sjohnson +rate_limit: 10 +ref_count: 70 +ref_user: nobody +type: text + + +action: /say A newbie comes to #bash to get his script confirmed. He leaves disappointed. +created_on: 1285863530 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 75 +ref_user: nobody +type: text + + +action: /say The newbie will not accept the answer you give, no matter how right it is. +created_on: 1290530096 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 78 +ref_user: nobody +type: text + + +action: /say The newbie is a bloody loon. +created_on: 1296243905 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 80 +ref_user: nobody +type: text + + +action: /say bashphorism 2: The questioner will keep changing the question until it drives the helpers in the channel insane. +created_on: 1240408805 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 392 +ref_user: nobody +type: text + + +action: /say The newbie will always have some excuse for doing it wrong. +created_on: 1305128785 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 110 +ref_user: nobody +type: text + + +action: /say If^H^HWhen the newbie's question is ambiguous, the proper interpretation will be whichever one makes the problem the hardest to solve. +created_on: 1344895585 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 83 +ref_user: nobody +type: text + + +action: /say The newcomer will abuse the bot's factoid triggers for their own entertainment until someone gets annoyed enough to ask them to message it privately instead. +created_on: 1379448117 +enabled: 1 +owner: sjohnson +rate_limit: 10 +ref_count: 45 +ref_user: nobody +type: text + + +action: /say Everyone is a newcomer. +created_on: 1379448119 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 43 +ref_user: nobody +type: text + + +action: /say The newcomer will address greybot as if it were human. +created_on: 1379706520 +enabled: 1 +owner: sjohnson +rate_limit: 10 +ref_count: 65 +ref_user: nobody +type: text + + +action: /say The newbie won't accept any answer that uses practical or standard tools. +created_on: 1407526571 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 30 +ref_user: nobody +type: text + + +action: /say The newbie will not TELL you about this restriction until you have wasted half an hour. +created_on: 1407526587 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 23 +ref_user: nobody +type: text + + +action: /say The newbie will lie. +created_on: 1409962279 +enabled: 1 +owner: emg +rate_limit: 10 +ref_count: 26 +ref_user: nobody +type: text + + +action: /say When the full horror of the newbie's true goal is revealed, the newbie will try to restate the goal to trick you into answering. Newbies are stupid. +created_on: 1430415368 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 10 +ref_user: nobody +type: text + + +action: /say It's always git. Or python virtualenv. Or docker. One of those pieces of shit. ALWAYS. +created_on: 1433357263 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 20 +ref_user: nobody +type: text + + +action: /say "Offtopicness will continue until someone asks a bash question that falls under bashphorisms 1 and/or 2, and greycat gets pissed off." +created_on: 1182437202 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 220 +ref_user: nobody +type: text + + +action: /say They won't show you the homework assignment. That would make it too easy. +created_on: 1432834287 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 14 +ref_user: nobody +type: text + + +action: /say Your teacher is a fucking idiot. +created_on: 1434733675 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + + +action: /say The more horrifyingly wrong a proposed solution is, the more likely it will be used. +created_on: 1440096222 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 7 +ref_user: nobody +type: text + + +action: /say The newbie cannot explain what he is doing, or why. He will show you incomprehensible, nonworking code instead. What? You can't read his mind?! +created_on: 1440796033 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say Bashphorism 4:The questioner will not read and apply the answers he is given but will instead continue to practice b1 and b2 +created_on: 1198084639 +enabled: 1 +owner: savetheWorld +rate_limit: 10 +ref_count: 196 +ref_user: nobody +type: text + + +action: /say "The ignorant will continually mis-educate the other noobies" +created_on: 1199115081 +enabled: 1 +owner: savetheWorld +rate_limit: 10 +ref_count: 176 +ref_user: nobody +type: text + + +action: /say When given a choice of solutions, the newbie will always choose the wrong one. +created_on: 1241809164 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 220 +ref_user: nobody +type: text + + +action: /say The newbie will always find a reason to say, "It doesn't work." +created_on: 1241809395 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 129 +ref_user: nobody +type: text + + +action: /say If you don't know to whom the bashphorism's referring, it's you. +created_on: 1241809592 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 110 +ref_user: nobody +type: text + + +action: /say b85397236519 has been replaced by q2 +created_on: 1259001231 +enabled: 1 +owner: bronze +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say All examples given by the questioner will be broken, misleading, wrong, incomplete, and/or not representative of the actual question. +created_on: 1336763935 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 189 +ref_user: nobody +type: text + + +action: /say Bashphorism OMEGA Some people just have to be killed. +created_on: 1254409454 +enabled: 1 +owner: bronze +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /call away +created_on: 1280520801 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say Something happens while you code, read the backlog. +created_on: 1372632544 +enabled: 1 +owner: juanmabc +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say http://wiki.bash-hackers.org/commands/builtin/caller +created_on: 1326000436 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say Just restore from your backups. +created_on: 1181268993 +enabled: 1 +owner: redondos +rate_limit: 10 +ref_count: 13 +ref_user: nobody +type: text + + +action: /say 'tac < file | tail | tac # TAOMBWTDI "there's always one more bad way to do it." ' +created_on: 1264443630 +enabled: 1 +owner: bronze +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say http://www.vidarholen.net/contents/comics/comic03.png +created_on: 1328006988 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say "i have amnesia" +created_on: 1351331952 +enabled: 1 +owner: sikilpaake +rate_limit: 10 +ref_count: 8 +ref_user: nobody +type: text + + +action: /say Its a bad idea to add code to a program that increases the size or complexity of the code but adds no functionality. Readability or "remember-ability" of longer command line options -might- qualify as additional functionality. Others may feel it doesn't. +created_on: 1316360844 +enabled: 1 +owner: HawkI +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say Your question is either using the wrong vocabulary or its form is confusing. We can't understand it well enough to help you. Can you rephrase the question and perhaps give more information about the scope and goal of what you are doing? Also try to use bash/*NIX specific names for things +created_on: 1170344040 +enabled: 1 +owner: bronze_0_1 +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say # for sh in {{b,d}a,k}sh; do printf '%-5s %s\n' "${sh}:" "$("$sh" -s /dev/null &>/dev/fd/3 echo bar; } 3>&1' +created_on: 1373863856 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 34 +ref_user: nobody +type: text + + +action: /say Be careful when using functions that use namerefs (typeset -n): https://gist.github.com/ormaaj/5682807 +created_on: 1369971604 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 7 +ref_user: nobody +type: text + + +action: /say Programs you shouldn't use: http://mywiki.wooledge.org/BadUtils +created_on: 1371187774 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 8 +ref_user: nobody +type: text + + +action: /say ? +created_on: 1185016116 +enabled: 1 +owner: syntux +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say basename(1) can strip the directory and extension from a path (directory/subdirectory/filename.extension -> filename.extension or filename). A parameter expansion can do it cleaner and *much* faster: "${path##*/}", "${path%.*}", at the cost of missing corner cases like path=/ +created_on: 1393460710 +enabled: 1 +owner: selk +rate_limit: 10 +ref_count: 277 +ref_user: nobody +type: text + + +action: /say The Bourne-Again Shell. Read the channel topic or type /msg greybot links for lots of links. +created_on: 1187715913 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say bash-code is not sh-code. If you want to limit yourself to POSIX-sh, set your hashbang to #!/bin/sh. If you want to use bash extensions, set it to #!/bin/bash or #!/usr/bin/env bash. +created_on: 1358261583 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say This #bash IRC channel is about the bash Unix shell, and is not affiliated with bash.org's quote database (QDB). Please don't fill our backlogs with nonsensical remarks. +created_on: 1179781485 +enabled: 1 +owner: redondos +rate_limit: 10 +ref_count: 16 +ref_user: nobody +type: text + + +action: /say Bash v4, a rough overview: http://bash-hackers.org/wiki/doku.php/bash4 +created_on: 1232108991 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say To install an up-to-date bash on OS X: ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" && brew install bash && sudo tee -a /etc/shells <<< '/usr/local/bin/bash' && chsh -s /usr/local/bin/bash +created_on: 1364661512 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say bashbug is a shell script to help the user compose and mail bug reports concerning bash in a standard format. +created_on: 1254366299 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say https://raw.githubusercontent.com/hannob/bashcheck/master/bashcheck +created_on: 1412016990 +enabled: 1 +owner: kerframil +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say Utilities for writing safe bash completion functions: http://to.lhunath.com/bashcomplib +created_on: 1426272410 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say The Bash Debugger Project is a gdb-style debugger for bash, available from http://bashdb.sourceforge.net/ +created_on: 1228944468 +enabled: 1 +owner: \amethyst +rate_limit: 10 +ref_count: 15 +ref_user: nobody +type: text + + +action: /say http://mywiki.wooledge.org/BashFAQ +created_on: 1277749997 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 25 +ref_user: nobody +type: text + + +action: /call guide +created_on: 1277749966 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say Bash is a shell. That's a program which can do simple math, logic, I/O and run other programs. It's NOT a terminal, it's not a kernel, it doesn't manage the system's authentication or environment, it's not your OS and it's not X, KDE or Gnome. +created_on: 1327145768 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 261 +ref_user: nobody +type: text + + +action: /say Learning bash / writing bash scripts is easier when not on drugs, so please don't come here while smoking joints +created_on: 1299271101 +enabled: 1 +owner: cthuluh +rate_limit: 10 +ref_count: 8 +ref_user: nobody +type: text + + +action: /say http://mywiki.wooledge.org/Bashism for a (partial!) list of bash-specific features, and how to emulate them in other shells +created_on: 1255720545 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 90 +ref_user: nobody +type: text + + +action: /say Convenience functions for use in bash scripts: http://to.lhunath.com/bashlib +created_on: 1347020894 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 75 +ref_user: nobody +type: text + + +action: /call b1 +created_on: 1236007781 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 18 +ref_user: nobody +type: text + + +action: /call b2 +created_on: 1236007790 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 18 +ref_user: nobody +type: text + + +action: /say There is no bashphorism 3. see corollary1.1 +created_on: 1175611154 +enabled: 1 +owner: bronze_0_1 +rate_limit: 10 +ref_count: 14 +ref_user: nobody +type: text + + +action: /say http://wiki.bash-hackers.org/misc/bashphorisms +created_on: 1417500623 +enabled: 1 +owner: llua +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Prepare literal data for injection into bash code: printf %q "$data". Eg. ssh host bash <<< "$(printf 'rm %q' "$localvar")" +created_on: 1330710330 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 23 +ref_user: nobody +type: text + + +action: /call dotfiles +created_on: 1303850848 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 53 +ref_user: nobody +type: text + + +action: /say Read the URL, then think about it some. Try some of the code out, and then ask when you hit an error. ;) +created_on: 1188188250 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Some Basics: http://bash-hackers.org/wiki/doku.php/scripting/basics +created_on: 1202156575 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + + +action: /say If by "batch" you mean Microsoft's COMMAND.COM or CMD.EXE shells, they are not supported here. Try ##windows. +created_on: 1279206473 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say bar +created_on: 1184660001 +enabled: 1 +owner: ximba +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say bash can do simple calculations itself: x=3; y=5; sum=$((x+y)) +created_on: 1379938270 +enabled: 1 +owner: Stummi +rate_limit: 10 +ref_count: 12 +ref_user: nobody +type: text + + +action: /say bronze_|| can't type +created_on: 1160146188 +enabled: 1 +owner: bronze_|| +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say http://en.wikipedia.org/wiki/Benevolent_Dictator_For_Life +created_on: 1251998921 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /call { +created_on: 1416605155 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say We are not your personal support. We are not here to write YOUR scripts for you. We are not here to weed out the bugs in YOUR program. If you can't figure it out without us holding your hand all the way, don't expect us to help. +created_on: 1315613956 +enabled: 1 +owner: neurolysis +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say http://mywiki.wooledge.org/BashBenchmark +created_on: 1297070650 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /call benchmarks +created_on: 1341102521 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + + +action: /say http://mywiki.wooledge.org/BashBenchmark +created_on: 1341102513 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say Bash Hackers Wiki -- http://bash-hackers.org/wiki +created_on: 1240374989 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say bongo +created_on: 1400474524 +enabled: 1 +owner: pancakes9 +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say Bint is "Bash lint", a conceptual tool which identifies certain types of scripting techniques that are considered bad or inefficient. It typically uses a list of rexes to identify problems, example grep "cat" < scriptfile will show all instances of cat in a file which are usually not needed in a script. +created_on: 1246977724 +enabled: 1 +owner: bronze +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say # 3>&1 2>/dev/null <$(echo $RANDOM >&3) +created_on: 1370211050 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 11 +ref_user: nobody +type: text + + +action: /say http://en.wikipedia.org/wiki/Bitwise_operation +created_on: 1217118563 +enabled: 1 +owner: ivazquez +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say http://www.in-ulm.de/~mascheck/various/shebang/#blankrequired +created_on: 1331126324 +enabled: 1 +owner: Riviera +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say http://xkcd.com/327/ ## http://mywiki.wooledge.org/BashWeaknesses ## Don't write database code in bash. Use perl, python, etc; any language with an appropriate library +created_on: 1372695978 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 27 +ref_user: nobody +type: text + + +action: /say http://xkcd.com/327/ +created_on: 1299465710 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say The unicode byte-order-mark determines the endianness of UTF-N files where N>8. http://unicode.org/faq/utf_bom.html#BOM +created_on: 1280760373 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /call books +created_on: 1385755131 +enabled: 1 +owner: sjohnson +rate_limit: 10 +ref_count: 11 +ref_user: nobody +type: text + + +action: /say Most of the published shell/bash books are relatively poor. They may have a few gems here and there, but they're few and far between. Try the BashGuide instead: http://mywiki.wooledge.org/BashGuide +created_on: 1312066290 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say Bash doesn't have boolean variables, but you can shanghai integers for this purpose, just like in C. first=1; errors=0; if ((first)); then ...; if ((! errors)); then ...; ((debug)) && log stuff +created_on: 1316118323 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 76 +ref_user: nobody +type: text + + +action: /call bool +created_on: 1342101076 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 26 +ref_user: nobody +type: text + + +action: /say I know I am, but what are you? +created_on: 1284497455 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 92 +ref_user: nobody +type: text + + +action: /say greybot supplies canned responses, factoids and FAQ links with "!". evalbot/shbot provide a command evaluation via "#" (and varieties). checkbot provides a syntax checker with the !check command. +created_on: 1426304530 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say :) +created_on: 1127849101 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 27 +ref_user: nobody +type: text + + +action: /say Instead of flooding the channel with unimportant bot evals, you can play with the bot at #evalbot, or /msg it privately. +created_on: 1352846521 +enabled: 1 +owner: sjohnson +rate_limit: 10 +ref_count: 20 +ref_user: nobody +type: text + + +action: /say The Bourne shell is the 'traditional' Unix shell from Seventh Edition (1979), now made obsolete by the Posix sh. Bourne shell is still present as /bin/sh or /usr/old/bin/sh on many Unix systems. See also 'heirloom' and http://www.in-ulm.de/~mascheck/bourne/ +created_on: 1243661196 +enabled: 1 +owner: \amethyst +rate_limit: 10 +ref_count: 10 +ref_user: nobody +type: text + + +action: /say # boxme() { width=72; printf -v line "%*s" "$width"; printf -v center "%s %$(( $(( width / 2 )) + $(( ${#1} / 2 )) ))s %$(( width - ( $(( ( width - 1 ) / 2 )) + $(( ${#1} / 2 )) ) ))s" \# "$1" \#; printf '%s\n' "# ${line// /=} #" "$center" "# ${line// /=} #"; }; boxme "I Love you 2 don't you know!" +created_on: 1427932988 +enabled: 1 +owner: Jetchisel +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say There are many solutions to each problem. For the simplest, fastest and best answer, explain the *bigger picture* in unambiguous English (forget your code). +created_on: 1294303315 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say Big Pipeline Of Death: if your command looks like this: command | grep | sed | awk | tr | ... YOU'RE DOING IT WRONG +created_on: 1419369773 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say Bot Query Syndrome -- If you see this, you're talking to the bot too much. +created_on: 1135568669 +enabled: 1 +owner: revdiablo +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /call { +created_on: 1338013806 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 30 +ref_user: nobody +type: text + + +action: /say Braces around variable names do not take the place of quotes, and are unnecessary unless the var name would otherwise be misread, eg "${size}Kb", or you are using arrays or parameter expansion like "${foo%.mp3}". mv ${file} ${newFile} is *unsafe* it should be mv "${file}" "${newFile}" or, more simply, mv "$file" "$newFile" +created_on: 1233518030 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 12 +ref_user: nobody +type: text + + +action: /say Basic Regular Expressions. See http://mywiki.wooledge.org/RegularExpression or (POSIX) http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03 +created_on: 1319484493 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say The GNU Bash refernce manual is available here: http://tiswww.case.edu/php/chet/bash/bashref.html (bash maintainer home dirs), and here: http://www.gnu.org/software/bash/manual/bashref.html (GNU web site). The first one has a slightly nicer format. These are not man pages. +created_on: 1256660353 +enabled: 1 +owner: bronze +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Your broken code doesn't actually tell us what you want to do. Please describe your input and your desired output in English, not code. +created_on: 1285335854 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say "Hey. Here's code that is broken and doesn't do what I want. Now, can you guess what it is that I do want? Hint: it has little to nothing to do with that code." +created_on: 1412834842 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say tty control character 008. used to reverse increment the carrier 1 character position horizontally. No vertical displacement. +created_on: 1333602739 +enabled: 1 +noembed: 1 +owner: savetheWorld +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say Use the bashbug script to report bugs. It sends reports to bug-bash@gnu.org. Bug fixes, answers to questions, and new release announcements are posted to the usenet group gnu.bash.bug. +created_on: 1185382590 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 8 +ref_user: nobody +type: text + + +action: /say Something is bugged if it has unexpected side effects (which can probably be abused). Just because code compiles/can be parsed and passes your tests does not make it bug-free. +created_on: 1308814679 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /call bug +created_on: 1261435129 +enabled: 1 +owner: tuxdev +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say Builtins are commands that are built into bash. You cannot run them from outside bash. They do not have man pages but are explained in man bash. They also have a help page: ''help [builtin-name]'' +created_on: 1211303613 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 27 +ref_user: nobody +type: text + + +action: /say #bash is not 4chan +created_on: 1263659529 +enabled: 1 +owner: bronze +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say We don't support busybox here -- go to #busybox for that +created_on: 1365613917 +enabled: 1 +owner: Riviera +rate_limit: 10 +ref_count: 37 +ref_user: nobody +type: text + + +action: /say "But..." If you knew all the answers you wouldn't be here asking questions! +created_on: 1266252897 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say http://xkcd.com/378/ +created_on: 1297367565 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 14 +ref_user: nobody +type: text + + +action: /say Bypassing security (eg. chmod -R 777 ., sudo !!) is not a fix. If it makes the problem go away, it's at most useful diagnostically. Figure out why your security is breaking your code and do it right. +created_on: 1386346889 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say == is not needed in [[ but it is in (( and it won't work in [ # Use ((..)) for C style arithmetic and flags (see /msg greybot math) # -a with [, && with [[. Don't use [ - see /msg greybot [[ - You don't need $ in (( unless you're doing complex !pe. +created_on: 1182555128 +enabled: 1 +noembed: 1 +owner: igli +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say for-loops: http://wiki.bash-hackers.org/syntax/ccmd/c_for +created_on: 1273934610 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say corollary1.1 the questioner's second description of the problem/question will also be misleading. +created_on: 1187630416 +enabled: 1 +owner: savetheWorld +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say corollary1.2 the questioner's third description of the problem will clarify two previous misdescribed elements of the problem, but will add two nnew irrelevant issues that will be even more difficult to unravel from the actual problem +created_on: 1190400694 +enabled: 1 +owner: savetheWorld +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say https://gist.github.com/4159235 +created_on: 1356847935 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say By convention, we capitalize environment variables (PAGER, EDITOR, ..) and internal shell variables (SHELL, BASH_VERSION, ..). All other variable names should be lower case. Remember that variable names are case-sensitive; this convention avoids accidentally overriding environmental and internal variables. +created_on: 1270763125 +enabled: 1 +owner: \amethyst +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /call varcap +created_on: 1272049125 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say # declare -A ops=( ['plus']=+ ['minus']=- ['times']=* ['divided-by']=/ ) ; opnames=( ${!ops[@]} ) ; a=$((RANDOM%256+1)) b=$((RANDOM%32+1)) opname=${opnames[RANDOM%${#opnames[@]}]} op=${ops[$opname]} ; declare -p ops opnames a b op opname ; read -p "What is $a $opname $b? " ans ; [[ $ans != *[^0-9]* ]] && (( ans==($a ${op:-,} $b) )) || exit +created_on: 1420411130 +enabled: 1 +owner: kurahaupo +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /call varcap +created_on: 1279161807 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 16 +ref_user: nobody +type: text + + +action: /say Cargo cult programming is copying pieces of code from other programs, without actually knowing what the code does. Subsequent debugging involves rearranging commands to minimize the number of error messages. +created_on: 1413157241 +enabled: 1 +owner: David-A +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say The case statement lets you match a word against several patterns and execute commands based on which one matches. See http://mywiki.wooledge.org/BashGuide/TestsAndConditionals#Choices and http://wiki.bash-hackers.org/syntax/ccmd/case and 'case word in' in man bash. +created_on: 1332449032 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say cat(1) is used to concatenate multiple files together. It should NOT be used to feed file data to processes. There are far better ways to achieve this. The application might take a file as argument (eg. grep ^foo file); or you might want to use file redirection (eg. read line < file). +created_on: 1179065193 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 111 +ref_user: nobody +type: text + + +action: /call greycatsgrey +created_on: 1412736847 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Never chdir in a script unless you check if it failed! cd $foo; bad. cd "$foo" || exit; good. See /msg greybot pitfalls +created_on: 1336476660 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 154 +ref_user: nobody +type: text + + +action: /say There are many tools to read/write CDs and DVDs in Unix: cdrtools, cdrkit, dvd+rw-tools, wodim, cdrskin, etc. Some are Linux only. Some are portable. Some work. Some don't. NONE of this is bash related. These are your Google keywords. Happy searching. +created_on: 1203433999 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say cd() { builtin cd "$@" && return; die 1 "Unable to cd to $@"; } (see !diefunc) +created_on: 1197142446 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say CDPATH lets you specify a location where bash will search for directories when 'cd'ing. Can be handy to build shortcuts or "portals" to deep places in your filesystem. See http://stackoverflow.com/questions/670488/#676753 +created_on: 1287658034 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + +
+action: /say center() { printf "%*s\n" $(( (COLUMNS+${#1}) /2 )) "$1"; } +created_on: 1436385890 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say http://forum.bash-hackers.org/index.php?topic=28.0 +created_on: 1178168329 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say C-style for loop: for (( expr; expr; expr )); do COMMANDS; done # Each expr is done in a math context. Example: for ((i=1; i<=n; i++)); do echo "$i"; done. Use in place of the non-working: for i in {1..$number} +created_on: 1386337777 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /call changes +created_on: 1393444316 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say "What bash version added feature X?" -- http://wiki.bash-hackers.org/scripting/bashchanges +created_on: 1393444270 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 8 +ref_user: nobody +type: text + + +action: /say #bash isn't really a channel enquiry service. Ask in #freenode and see /msg alis help +created_on: 1403278292 +enabled: 1 +owner: Riviera +rate_limit: 10 +ref_count: 22 +ref_user: nobody +type: text + + +action: /say Count how many times a character occurs in a string: strip everything else and count the length # v="abcaba"; v="${v//[!a]}"; echo "${#v}" +created_on: 1254500643 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + + +action: /say checkbot is an IRC frontend for !shellcheck. It responds to !check [url/snippet], and automatically to pastebin links with selected errors (/msg checkbot quiet). +created_on: 1417130945 +enabled: 1 +owner: koala_man +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say Saw a possible expansion syntax and don't know what it is? http://bash-hackers.org/wiki/doku.php?id=syntax:expansion:intro#overview +created_on: 1180189176 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say set -o pipefail; curl -s checkip.dyndns.org | xmllint --html --xpath 'substring-after(/html/body/text(), ": ")' - || echo $'\nOffline' +created_on: 1376202990 +enabled: 1 +last_referenced_in: jasondockers +last_referenced_on: 1445398731.48812 +owner: ormaaj +rate_limit: 10 +ref_count: 9 +ref_user: jasondockers!~cipher__@vpn-cuboulder29-196-dhcp.colorado.edu +type: text + + +action: /say Saw a specific PE syntax and don't know what it is? http://bash-hackers.org/wiki/doku.php?id=syntax:pe#overview +created_on: 1180185918 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say # ((RANDOM%2)) && echo 'Yay!' || echo '\o/' +created_on: 1404354665 +enabled: 1 +owner: David-A +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say A child process can not modify its parent's environment. See !faq change +created_on: 1269581536 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 11 +ref_user: nobody +type: text + + +action: /call relax +created_on: 1298913758 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say To recursively set different permissions for directories and files, use something like: find -type d -exec chmod 770 {} + -o -type f -exec chmod 660 {} + +created_on: 1290958866 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 11 +ref_user: nobody +type: text + + +action: /say You have a choice to make. There is the easy, buggy solution or you can do it right. If you're going to choose the former, do so for a reason that overrules the latter's many advantages, not "just cuz it doesnt matter if it sux". If right scares you, this is an *opportunity* to improve yourself. +created_on: 1384373795 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say The shell you pick for your shell script should be an intentional decision. http://mywiki.wooledge.org/BashGuide/Practices#Choose_Your_Shell +created_on: 1265079851 +enabled: 1 +owner: tuxdev +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say "Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?" - Brian Kernighan +created_on: 1316113525 +enabled: 1 +owner: neurolysis +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say http://stackoverflow.com/questions/749544/pipe-to-from-clipboard/750466#750466 +created_on: 1310248570 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Please tell us the exact command you typed (paste it into irc client) and the exact error message. +created_on: 1202614093 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 8 +ref_user: nobody +type: text + + +action: /say Command Substitution: $() and `` - http://bash-hackers.org/wiki/doku.php/syntax/expansion/cmdsubst +created_on: 1227909965 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say :@) +created_on: 1238351042 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say If you're showing me code, I'm going to assume the code is broken. If the code is broken, it doesn't do what you want to do. If it doesn't do what you want, it doesn't explain what you want, either. Use English, describe your goal, keep broken code to yourself. +created_on: 1433722235 +enabled: 1 +last_referenced_in: pksadiq +last_referenced_on: 1445744022.71922 +owner: yitz_ +rate_limit: 10 +ref_count: 38 +ref_user: pksadiq!~user@106.208.201.151 +type: text + + +action: /say code smell is any symptom in the source code of a program that possibly indicates a deeper problem http://en.wikipedia.org/wiki/Codesmell +created_on: 1351371028 +enabled: 1 +owner: sikilpaake +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say c[_] +created_on: 1425430452 +enabled: 1 +owner: Riviera +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say # ((RANDOM % 2)) && echo heads || echo tails +created_on: 1377819770 +enabled: 1 +owner: emg +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say Don't use things like \e[1;32m, they only work in some terminals. Use tput and see man terminfo instead. Eg. red=$(tput setaf 1); echo "hello ${red}world" # See http://mywiki.wooledge.org/BashFAQ/037 http://to.lhunath.com/bashlib#L204 +created_on: 1403808137 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 29 +ref_user: nobody +type: text + + +action: /say n=$(tput colors) sgr0=$(tput sgr0); for ((i=0;i +action: /say http://mywiki.wooledge.org/BashFAQ/037 -- How can I print text in various colors? +created_on: 1300055171 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 78 +ref_user: nobody +type: text + + +action: /say Remember, column can be used without -t. +created_on: 1413247168 +enabled: 1 +owner: mattcen +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say COLUMNS and LINES are set to reflect the terminal's size, but bash does not set these values by default; furthermore it does not export them. If you really need them to be correct and up-to-date, use shopt -s checkwinsize and export COLUMNS and/or LINES. See also http://mywiki.wooledge.org/BashFAQ/091 +created_on: 1235320659 +enabled: 1 +owner: prince_jammys +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say compare two sorted files line by line: useful for finding lines in one or both files. http://mywiki.wooledge.org/BashFAQ/036 +created_on: 1426437770 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 39 +ref_user: nobody +type: text + + +action: /say When overriding or wrapping a command with a shell function of the same name, you can use 'command foo' to invoke the base command: wget() { cd /foo/bar && command wget "$@"; } +created_on: 1370452486 +enabled: 1 +owner: koala_man +rate_limit: 10 +ref_count: 19 +ref_user: nobody +type: text + + +action: /say command_not_found_handle is a function you can define to handle mistyped or missing commands or whatever. Ubuntu uses it, maybe. +created_on: 1357337102 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Put comments in your scripts. Use them to explain your intent. This helps you and others understand what a section of code is supposed to be doing. Others will appreciate it, and you will, too, in a month. +created_on: 1401227531 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 12 +ref_user: nobody +type: text + + +action: /say Common pathname-related PE use: http://bash-hackers.org/wiki/doku.php?id=syntax:pe#common_use +created_on: 1192164658 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /call compiling +created_on: 1308162758 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 26 +ref_user: nobody +type: text + + +action: /say http://wooledge.org/mywiki/GreyCat/CompilingBad +created_on: 1233604608 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 23 +ref_user: nobody +type: text + + +action: /say Many of us in-channel do not use bash-completion (a separate piece of software). You might find this useful: http://www.debian-administration.org/articles/316 Also try #bash-completion in OFTC (irc.oftc.net). +created_on: 1390580985 +enabled: 1 +owner: Riviera +rate_limit: 10 +ref_count: 134 +ref_user: nobody +type: text + + +action: /say the completion facility is built-in, but it needs to be told the appropriate details for each command. The *package* called "bash-completion" is a grab-bag of such definitions, of rather varying quality. But you can simply put your own definitions in your .bashrc to override any faulty or missing ones +created_on: 1426445600 +enabled: 1 +owner: kurahaupo +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say Conditional Structures: http://mywiki.wooledge.org/BashGuide/TestsAndConditionals +created_on: 1262608971 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 47 +ref_user: nobody +type: text + + +action: /say If your script needs configuration, the way to do that in bash is to create a config file that adheres to bash syntax and source that file from the beginning of your script: source ~/.myscript.conf +created_on: 1305713687 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 21 +ref_user: nobody +type: text + + +action: /say confirm() { local ans IFS=; while read -rp "$1" -n1 ans; do printf '\n'; case $ans in [Yy]) return 0;; [Nn]) return 1;; esac; done; }; ## Usage: if confirm "Are you sure? "; then ... +created_on: 1429880418 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 17 +ref_user: nobody +type: text + + +action: /say Don't feed several arguments to a command by putting them all in one variable. Use an array, for example: myargs=( -arg1 -arg2 "arg 3" ), and expand them with COMMAND "${myargs[@]}". See http://wooledge.org/mywiki/BashFAQ/005 and !faq 50. +created_on: 1208187276 +enabled: 1 +owner: prince_jammys +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say the student is required to act upon the environment to both acquire and test new knowledge http://en.wikipedia.org/wiki/Constructivism_%28learning_theory%29 +created_on: 1351328189 +enabled: 1 +owner: sikilpaake +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say To check if a var contains a substring: var='something here'; if [[ $var = *thing* ]]; then echo "$var contains 'thing'"; fi - See http://mywiki.wooledge.org/BashFAQ/041 +created_on: 1332784198 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say http://wiki.bash-hackers.org/syntax/keywords/coproc +created_on: 1296981132 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 75 +ref_user: nobody +type: text + + +action: /say see !coproc +created_on: 1409155136 +enabled: 1 +owner: capt_mercaptan +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say "Don't copy paste commands with tabs in them" +created_on: 1351826354 +enabled: 1 +owner: tdignan +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say the questioner's second description of the problem/question will also be misleading. +created_on: 1158260361 +enabled: 1 +owner: bronze +rate_limit: 10 +ref_count: 11 +ref_user: nobody +type: text + + +action: /say Basic loops: Bash/Zsh/ksh93: «for ((i = 0; i < 10; i++)); do ...; done», For small constants: «for i in {0..9}; do ...; done» ksh: «i=0; while ((i++ < 10)); do ...; done», POSIX: «i=0; while [ "$i" -lt 10 ]; do ...; i=$((i + 1)); done» http://mywiki.wooledge.org/BashGuide/TestsAndConditionals#Conditional_Loops +created_on: 1420630073 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 128 +ref_user: nobody +type: text + + +action: /say NEEDS MORE COWBELL! +created_on: 1178928339 +enabled: 1 +owner: ivazquez +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say find . -name '*.txt' -print | cpio -o | gzip -9 > /backups/mybackup-$(date +%Y%m%d).cpio.gz # use -print0 and cpio -0 if your OS supports both of those +created_on: 1199977276 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + + +action: /say "cpio -p" is pass-through copying, used to duplicate a hierarchy. E.g., find . -name '*.txt' -print0 | cpio -pad -0 /destination +created_on: 1200330603 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say cat /etc/passwd | while read user ; do echo "$user" | grep "$user"; done +created_on: 1360657980 +enabled: 1 +owner: juanmabc +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Carriage Return (ASCII 13). Often represented by ^M or \r. CRs are found just before newlines in text files generated by DOS/Windows apps. You can see them with ''sed -n l''. See http://mywiki.wooledge.org/BashFAQ/052 to get rid of them. +created_on: 1428409910 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say The overwhelming majority of bash scripts, code, tutorials, and guides on the Internet are crap. Sturgeon was an optimist. +created_on: 1254164137 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 274 +ref_user: nobody +type: text + + +action: /say Half of all the crappy bash scripts and tutorials on the net are below the average crappiness +created_on: 1408106333 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say If you want to keep restarting an app automatically if it keeps crashing, please see http://mywiki.wooledge.org/ProcessManagement#How_can_I_check_to_see_if_my_game_server_is_still_running.3F__I.27ll_put_a_script_in_crontab.2C_and_if_it.27s_not_running.2C_I.27ll_restart_it... +created_on: 1310835827 +enabled: 1 +owner: kwtm2 +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say There is no thing like a "creation time" on a UNIX filesystem in general. Some filesystems may provide it, but you would need to ask in the channel of your operating system, how to retrieve that value then. +created_on: 1154364214 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Cron is used for scheduling recurring jobs. at(1) is used for scheduling one-time jobs. crontab -e, /etc/crontab or /etc/periodic are places where you can configure jobs. The most common problems with cron jobs include %'s in a crontab (escape, either with date +%%Y or date +\%Y), commands that rely on $DISPLAY, and having a different environment (eg. PATH/SHELL). See man 5 crontab. +created_on: 1424917934 +enabled: 1 +owner: Boobuigi +rate_limit: 10 +ref_count: 121 +ref_user: nobody +type: text + + +action: /say cron runs jobs with a minimal set of env vars. PATH may be as short as "/usr/bin:/bin". If your job uses commands from other directories, set a different PATH in your crontab or in the script. Also see !path and !crontab +created_on: 1366310195 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 14 +ref_user: nobody +type: text + + +action: /call cron +created_on: 1353923778 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 13 +ref_user: nobody +type: text + + +action: /say http://wooledge.org/~greg/crypt/ or see "man 3 crypt" +created_on: 1127151579 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /call $( +created_on: 1236006907 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 78 +ref_user: nobody +type: text + + +action: /say Please don't use command substitution to capture the output of echo (or printf). Just use whatever you want to pass to echo. Bad: var=$(echo "Hello") Good: var="Hello" Also: printf -v var "%s" "Hello" +created_on: 1302814076 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 11 +ref_user: nobody +type: text + + +action: /say http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/ http://www.grymoire.com/unix/CshTop10.txt http://www.grymoire.com/unix/Csh.html +created_on: 1389628104 +enabled: 1 +owner: Riviera +rate_limit: 10 +ref_count: 73 +ref_user: nobody +type: text + + +action: /say A csv file contains "Comma Separated Values". It represents records as lines and fields delimited by commas (though the delimiter can vary). Very simple CSV files can be parsed using a ''while IFS=, read -a fields'' loop. For more complete support, see , or the csvtool / csvkit commands. +created_on: 1422728000 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 48 +ref_user: nobody +type: text + + +action: /say http://ctags.sourceforge.net/ +created_on: 1374437989 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say ctime stands for "change time", not "creation time". Most file systems do NOT store a file's creation time at all. On those that do, you need nonstandard tools to retrieve it. Try "-newerBB" in GNU find for example. +created_on: 1415051759 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 60 +ref_user: nobody +type: text + + +action: /say A cue-seeker doesn't know the fundamentals of a subject, asks tedious questions to hide the scope of their ignorance, and tries to deduce, in vain, operative knowledge from the answers. +created_on: 1413157171 +enabled: 1 +owner: David-A +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say The Cult Of The Regex. This eldritch brotherhood is dedicated to the dogma that Every Problem Must Be Solved By A Regular Expression, Preferably A PCRE. They will invent ludicrous problems whose only feasible solution is a regular expression, driving all men mad. +created_on: 1290544154 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 65 +ref_user: nobody +type: text + + +action: /say start by reading http://curl.haxx.se/docs/httpscripting.html and join #curl +created_on: 1316155836 +enabled: 1 +owner: pgas +rate_limit: 10 +ref_count: 11 +ref_user: nobody +type: text + + +action: /say This is crap: curl www.site.com/script.sh | sh . See http://curlpipesh.tumblr.com/ for real world examples +created_on: 1420826121 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say better-informed agents find it extremely difficult to think about problems from the perspective of lesser-informed agents http://en.wikipedia.org/wiki/Curse_of_knowledge +created_on: 1351274922 +enabled: 1 +owner: sikilpaake +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say Consider using Parameter Expansions instead of cut(1). http://mywiki.wooledge.org/BashFAQ/100 +created_on: 1312915675 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 49 +ref_user: nobody +type: text + + +action: /say awk -v nl=42 '{a[FNR]=$0} FNR>nl{print a[FNR-nl];delete a[FNR-nl]}' # POSIX, prints all but the last nl lines of each file named as an argument, or stdin if none given +created_on: 1368986750 +enabled: 1 +owner: BlastHardcheese +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /call pm +created_on: 1236006974 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 32 +ref_user: nobody +type: text + + +action: /say DJB's suite of programs for managing services and logging: http://cr.yp.to/daemontools.html +created_on: 1237993692 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say You can detect a dangling symlink using [[ -L $foo && ! -e $foo ]] +created_on: 1241626882 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 7 +ref_user: nobody +type: text + + +action: /say dash is not bash. dash has a number of limitations. See https://wiki.ubuntu.com/DashAsBinSh +created_on: 1250632409 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 24 +ref_user: nobody +type: text + + +action: /say Show us the INPUT you're working with, and the OUTPUT that you want. Tell us where the INPUT is coming from (disk file, terminal input, curl URL). Tell us where you want the OUTPUT to go (disk file, stdout, terminal). +created_on: 1211485067 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 15 +ref_user: nobody +type: text + + +action: /say GNU date does math on dates and time, in english! example: date -d '+30 days' +%s calculates the new date of today plus 30 days, and "+%s" prints it in epoch-seconds +created_on: 1359556942 +enabled: 1 +owner: Bronze +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say Some variants of date(1) allow arithmetic. Examples: GNU: date -d "20120510 09:10 GMT +3 days -2 hours" BSD: date -j -v+3d -v-2H -f '%Y%m%d %H:%M %Z' "20120510 09:10 GMT" Busybox: date -d "@$(($(date +%s -D '%Y/%m/%d %H:%M' -d "2012/05/10 09:10") + 3 * (24 * 60 * 60) - 2 * (60 * 60)))" +created_on: 1363273491 +enabled: 1 +owner: Riviera +rate_limit: 10 +ref_count: 57 +ref_user: nobody +type: text + + +action: /say `date' can be a bit intimidating but don't let that scare you away :) It is flexible and useful for conversions; the syntax is a bitch but the examples in the info page are normally useful. +created_on: 1182684757 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + + +action: /say Calculating with dc - an introduction written by pgas: http://bash-hackers.org/wiki/doku.php/howto/calculate-dc +created_on: 1217000339 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 7 +ref_user: nobody +type: text + + +action: /say Don't do it in Bash -- another language or tool is almost certainly better suited for your problem. See http://mywiki.wooledge.org/BashWeaknesses +created_on: 1378038743 +enabled: 1 +owner: tyrmored +rate_limit: 10 +ref_count: 8 +ref_user: nobody +type: text + + +action: /say Define "Doesn't Work" +created_on: 1194096144 +enabled: 1 +owner: VImtermute +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Debugging requires a good dose of common sense. See http://mywiki.wooledge.org/BashGuide/Practices#Debugging for tips. +created_on: 1279209090 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /call debug +created_on: 1277921258 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 24 +ref_user: nobody +type: text + + +action: /say The "declare" command acts like "local" when used inside a function. declare -A is required for associative arrays. bash 4.2 adds declare -g to suppress the "local" thing. +created_on: 1312817311 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 29 +ref_user: nobody +type: text + + +action: /say "declare -n" looks like a great idea but it doesn't work. See http://mywiki.wooledge.org/BashFAQ/048 (under "The problem with bash's name references"). +created_on: 1437077834 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Setting a default value. : "${variable:=DEFAULT}" # The : is necessary. We want the side effects of the parameter expansion, but we don't want to *execute* its value as a command, so we put a null command in front. +created_on: 1356119031 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say Stop focusing on the solution and figure out the *problem* first. When doing so, do not involve ANY bash or other code, think purely in terms of what you have and what you want as a result. Explain it to us in sensible English. +created_on: 1287654214 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /call zombie +created_on: 1382460937 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say Use arrays to store a list of values, instead of using a single variable and relying on spaces (or other characters) as delimiters. In a string variable, there is no character you can safely use to separate filenames or arguments. See http://wooledge.org/mywiki/BashFAQ/005 and !faq 50. +created_on: 1208187482 +enabled: 1 +owner: prince_jammys +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say [[ $var != a || $var != b ]] is always true. Did you forget De Morgan's Laws? [[ ! ($var = a || $var = b) ]] <=> [[ $var != a && $var != b ]] +created_on: 1428507103 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 42 +ref_user: nobody +type: text + +
+action: /say Please be specific. http://mywiki.wooledge.org/NetEtiquette#Details_matter +created_on: 1405550567 +enabled: 1 +owner: emg +rate_limit: 10 +ref_count: 15 +ref_user: nobody +type: text + + +action: /say http://wooledge.org/mywiki/BashFAQ/094 (parsing df output) +created_on: 1224086615 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 21 +ref_user: nobody +type: text + + +action: /say function dfs { typeset x; for x; do if [[ -e $x ]]; then printf '%q\n' "$x"; [[ -d $x ]] && dfs "$x"/*; fi; done; }; +created_on: 1402580251 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say Dialog makes it easy to generate menus, progress bars and forms for your scripts. See dialog, xdialog, kdialog, gtkdialog, zenity and kommander. +created_on: 1186120657 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 50 +ref_user: nobody +type: text + + +action: /call doesntwork +created_on: 1236007814 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 18 +ref_user: nobody +type: text + + +action: /say mycommand || die "please install mycommand" # Using a custom 'die' function from http://mywiki.wooledge.org/BashFAQ/101 +created_on: 1371586473 +enabled: 1 +owner: koala_man +rate_limit: 10 +ref_count: 92 +ref_user: nobody +type: text + + +action: /say die() { local code=$1; shift; echo "$@" >&2; exit $code; } +created_on: 1197142116 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say See !faq 54 +created_on: 1270689147 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say dirname(1) removes the filename part of a pathname (/a/b/c -> /a/b). A parameter expansion can do it cleaner and *much* faster: "${path%/*}" +created_on: 1331328877 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 109 +ref_user: nobody +type: text + + +action: /say Disclaimer: I write code in IRC without testing it. Consider the code to be guidance and not working code. I didn't test the code and I'm not planning on running the code. If you want to run the code, do so at your own risk. Test it yourself. +created_on: 1434177317 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /call nohup +created_on: 1429824101 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say Distros are like religious sects. Once they defeat their external enemies, they turn on each other and become the Middle East. +created_on: 1187274939 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + +
+action: /say # bcdiv() { local n=$1 d=$2 scale=${3:-10} r="$(($1/$2)).";while ((scale-- > 0)) && ((n%=d,n*=10)); do r+="$((n/d))"; done; echo "${r%.}"; }; bcdiv 1 3 +created_on: 1417741922 +enabled: 1 +owner: mute +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say Do It Yourself! ;P We are not here to do your work for you, just to give you pointers on approaches you could consider, help with tricky syntax and encouragement ;-) +created_on: 1183049513 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say Dennis M. Ritchie +created_on: 1128437259 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Down, Not Across. +created_on: 1177338585 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 7 +ref_user: nobody +type: text + + +action: /say "can you give me an example of how to do that?" is often seen as an attempt to get others to write code for you so you can paste it into your work. +created_on: 1268070868 +enabled: 1 +owner: tobor +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /call hurts +created_on: 1402604047 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say "Doctor, doctor! It hurts when I do !" "Don't do that, then." +created_on: 1376365942 +enabled: 1 +owner: twb +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /call doesntwork +created_on: 1245987754 +enabled: 1 +owner: ferret +rate_limit: 10 +ref_count: 42 +ref_user: nobody +type: text + + +action: /say Saying something "doesn't work" helps neither you or us. Explain the result you *want* or *expect*, what you are *doing* and *how* it is failing. Copy/paste the commands you use and the errors they produce. Consider set -x to get more information on what is happening. +created_on: 1331462658 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 539 +ref_user: nobody +type: text + + +action: /say What I mean to say is: I want the computer to do X. I thought I told the computer to do X. However, it's clear I actually told the computer to do Y. Now I'm frusterated because the computer isn't doing X. Instead it is doing Y and I don't know what Y is. +created_on: 1432365213 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say Day 9. It's still doing Y, but I think I can lure it over to Z now. It's risky, and will use up the rest of my gnu-fu, but I'm out of options. Here goes nothing... +created_on: 1432365843 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say Day 10. Z is working, I did it! Unfortunately the joy was short lived. It is working too well. It's draining all the remaining energy. If I don't get it back to Y soon, this might be the last entry of the journal +created_on: 1432910231 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say Day 17. The scratching noices, I'm not sure when they started, but they're getting closer. I think Z is causing it, but I cannot be sure. I can't shake this feeling of someone watching me. I realize now, that I should've just showed the actual code and error messages right away. +created_on: 1433358110 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Having a Homer moment +created_on: 1316630987 +enabled: 1 +owner: HawkI_ +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say no, thanks +created_on: 1361455341 +enabled: 1 +owner: juanmabc +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say http://mywiki.wooledge.org/BashGuide/Practices#Don.27t_Ever_Do_These +created_on: 1309183269 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say everybody makes mistakes +created_on: 1417036790 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /call doesntwork +created_on: 1377193342 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /call cr +created_on: 1236007825 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /call source +created_on: 1259692066 +enabled: 1 +owner: irc2samus +rate_limit: 10 +ref_count: 14 +ref_user: nobody +type: text + + +action: /say .. refers to the parent directory. Relative pathnames like ../foo/bar cannot be converted into absolute pathnames in the general case -- see http://www.cs.bell-labs.com/sys/doc/lexnames.html to understand why. Also see http://wooledge.org/mywiki/BashFaq#faq28 +created_on: 1174421633 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 14 +ref_user: nobody +type: text + + +action: /say Set up your environment (PATH, LANG, EDITOR, ...) in ~/.bash_profile. Set up your bash shell (PS1, functions, shopts, ...) in ~/.bashrc. Then source .bashrc from .bash_profile. See . For GUI logins, SEE YOUR DOCUMENTATION or ask your OS channel because they're all different and we don't know. +created_on: 1396027067 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 691 +ref_user: nobody +type: text + + +action: /say dotglob, if set, makes bash include filenames beginning with a '.' (excluding . and ..) in the results of pathname expansion (shopt -s dotglob) +created_on: 1394214934 +enabled: 1 +owner: emg +rate_limit: 10 +ref_count: 88 +ref_user: nobody +type: text + + +action: /say /tmp/* /tmp/.[!.]* /tmp/..?* … That hard-to-remember glob for selecting /tmp/* ∪ /tmp/.* ∩ /tmp/{.,..} +created_on: 1401172448 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say The do-while loop: while cmd1; cmd2; ... cmdN; condition; do :; done +created_on: 1270688329 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 7 +ref_user: nobody +type: text + + +action: /say greybot attempts to conquer the world are not full, try #debian +created_on: 1340352839 +enabled: 1 +owner: juanmabc +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say Don't drink and root! +created_on: 1234217999 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say http://mywiki.wooledge.org/DontReadLinesWithFor +created_on: 1309287632 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 351 +ref_user: nobody +type: text + + +action: /say :;cd /bin;(head -c6288;read -N30;recode /64<<tr +action: /say du -sk "$@" | sort -n | awk -F '\t' -v OFS='\t' '{if ($1 > 1048576) $1 = sprintf("%.1fG",$1/1048576); else if ($1 > 1024) $1 = sprintf("%.1fM",$1/1024); else $1 = sprintf("%sK",$1)} 1' +created_on: 1343766563 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 22 +ref_user: nobody +type: text + + +action: /say "du -sh" gives you so-called "human-readable" output, but you can't SORT by that. Use "du -sk" to generate data you can sort by. If you need to convert that perfectly good machine-and-human-readable kilobyte data into "-h" format, use: awk '{if ($1>1024**2) $1=$1/1024**2 "G"; else if ($1>1024) $1=$1/1024 "M"; else $1=$1 "K"; print}' +created_on: 1204056231 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 14 +ref_user: nobody +type: text + + +action: /say Do What I Mean (not what I say). The holy grail of telepathic user interface technology. +created_on: 1172251143 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say "do-what-I-think" htf do we know what you're trying to do unless you explain it? If you can't describe your own problem, there is a very good chance that you don't understand it yourself yet. And understanding what your problem actually IS is mandatory, before you can solve it. +created_on: 1183048437 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say http://wooledge.org/mywiki/BashFAQ/050 -- I'm trying to put a command in a variable, but the complex cases always fail! +created_on: 1215800644 +enabled: 1 +owner: savetheWorld +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Yes. The car. +created_on: 1349364661 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say https://github.com/e36freak/templates/blob/master/options +created_on: 1354898008 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 16 +ref_user: nobody +type: text + + +action: /say https://github.com/e36freak/templates +created_on: 1344967785 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say echo outputs a string. echo has many portability problems, and should never be used with option flags. Consider printf instead: printf 'name: %s\n' "$name". http://wiki.bash-hackers.org/commands/builtin/echo | http://cfajohnson.com/shell/cus-faq.html#Q0b | http://www.in-ulm.de/~mascheck/various/echo+printf +created_on: 1395854084 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 507 +ref_user: nobody +type: text + + +action: /call echo` +created_on: 1329340646 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 20 +ref_user: nobody +type: text + + +action: /call $(echo +created_on: 1381432842 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 32 +ref_user: nobody +type: text + + +action: /call echo +created_on: 1348597136 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 56 +ref_user: nobody +type: text + + +action: /call echo +created_on: 1389862373 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 21 +ref_user: nobody +type: text + + +action: /call $(echo +created_on: 1381432874 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 29 +ref_user: nobody +type: text + + +action: /say ed is a command-based file editor. See http://wiki.bash-hackers.org/howto/edit-ed - http://sdf.lonestar.org/index.cgi?tutorials/ed - http://wolfram.schneider.org/bsd/7thEdManVol2/edtut/edtut.pdf +created_on: 1340539500 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /call man-ed +created_on: 1369875673 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + + +action: /say http://backreference.org/2011/01/29/in-place-editing-of-files/ +created_on: 1437753675 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say http://unix.stackexchange.com/a/4861/10762 +created_on: 1420566264 +enabled: 1 +owner: cdown +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /call man-ed +created_on: 1369875665 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 15 +ref_user: nobody +type: text + + +action: /say A healthy ego is essential. Please, however, do not let yours get in the way of us helping you. +created_on: 1183048838 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say You might consider describing the whole problem; perhaps we can suggest a more straightforward solution. +created_on: 1195832454 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say http://www.regular-expressions.info/email.html and http://xkcd.com/208/ and one that works for a lot but not all: '\b[[:alnum:]._%+-]+@[[:alnum:].-]+\.[[:alpha:]]{2,4}\b' +created_on: 1312558239 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 16 +ref_user: nobody +type: text + + +action: /say Validating an E-mail address against RFC822, or "Why regex is often NOT the answer": http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html +created_on: 1272660278 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 8 +ref_user: nobody +type: text + + +action: /say http://www.rentacoder.com/ +created_on: 1221042689 +enabled: 1 +owner: ivazquez +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say for f in ./*.mp3; do lame --decode "$f" "${f%.mp3}.wav"; done +created_on: 1267796287 +enabled: 1 +owner: koala_man +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say You don't have sed, awk, OR grep? Bend over, take your Linux On A Raggedy 5.25" Floppy With Bad Sectors "distribution", and embed it. +created_on: 1179860580 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 25 +ref_user: nobody +type: text + + +action: /say # rev() { sed -e 'G;:a' -e 's/\(.\)\(.*\n\)/\2\1/;ta' -e 's/.//' "$@";}; rev <<<$'foo\nbar baz' +created_on: 1408568448 +enabled: 1 +owner: emg +rate_limit: 10 +ref_count: 25 +ref_user: nobody +type: text + + +action: /say # rev() { cat "$@"|while IFS= read -r s;do paste <(eval printf '%d\\n' {1..${#s}}) <(sed 's/./&\n/g'<<<"$s")|sort -rn|awk -F'\t' '{printf$2}END{print""}';done;}; rev <<<$'foo\nbar baz' +created_on: 1379463531 +enabled: 1 +owner: emg +rate_limit: 10 +ref_count: 20 +ref_user: nobody +type: text + + +action: /say https://gist.githubusercontent.com/deepcube/32257879f19df9644ad1/raw/7f2a2503b3d188b449d61fbe8411f66f9ba0afc1/rev.c +created_on: 1428595192 +enabled: 1 +owner: emg +rate_limit: 10 +ref_count: 7 +ref_user: nobody +type: text + + +action: /say empty is a lightweight alternative to the ''expect'' tool for automating interactive programs: http://empty.sourceforge.net/ +created_on: 1365888099 +enabled: 1 +owner: Riviera +rate_limit: 10 +ref_count: 47 +ref_user: nobody +type: text + + +action: /say Por favor, aquí se habla inglés. +created_on: 1379471532 +enabled: 1 +owner: maroloccio +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say To URI encode or decode (using Perl): http://perldoc.perl.org/perlfaq9.html#How-do-I-decode-or-create-those-%-encodings-on-the-web? +created_on: 1278957632 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say Enter is not punctuation. Please do not send every clause/word/character as a separate message; it inhibits readability. +created_on: 1385947957 +enabled: 1 +last_referenced_in: fizzie +last_referenced_on: 1445041006.39872 +owner: twb +rate_limit: 10 +ref_count: 2 +ref_user: fizzie!fis@unaffiliated/fizzie +type: text + + +action: /say Bash has two types of variables. Shell Variables (foo=bar) live in the running shell and are copied to subshells. Environment Variables (export foo=bar) are special variables that live in a PROCESS and are copied to each new process it creates. They are used the same way but CREATED differently. Env vars are NOT system-wide or "shared" in any way. http://mywiki.wooledge.org/Environment +created_on: 1393436246 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 163 +ref_user: nobody +type: text + + +action: /say https://gist.github.com/kurahaupo/8130030 +created_on: 1388696907 +enabled: 1 +owner: kurahaupo +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say Each process has its own private variable space called the "environment". A child inherits a *copy* of the parent's. See http://mywiki.wooledge.org/Environment +created_on: 1327006539 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 58 +ref_user: nobody +type: text + + +action: /say https://gist.github.com/3284124 +created_on: 1358385070 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say "unexpected end of file" means you are missing some expected syntactic element, such a missing closing " or ' or } or done or fi or esac or .... +created_on: 1304018325 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 16 +ref_user: nobody +type: text + + +action: /say http://wooledge.org/mywiki/BashFAQ#faq70 -- How do I convert Unix (epoch) timestamps to human-readable values epoch is : Thu Jan 1 00:00:00 1970 +created_on: 1184772944 +enabled: 1 +owner: savetheWorld +rate_limit: 10 +ref_count: 7 +ref_user: nobody +type: text + + +action: /say Extended Regular Expressions. See http://mywiki.wooledge.org/RegularExpression or (POSIX) http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04 +created_on: 1319035129 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /call set-e +created_on: 1282146827 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 8 +ref_user: nobody +type: text + + +action: /say Why not tell us the error and stop us from having to guess? +created_on: 1181073693 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 15 +ref_user: nobody +type: text + + +action: /say The escape key generates the ASCII byte 033 octal (27 decimal). This may be represented as $'\033' or $'\e' in bash scripts. +created_on: 1300732409 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say Look. We can't read your mind. Tell us what you are doing, or we can't help. What on Earth are you doing? +created_on: 1183679172 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say http://wooledge.org/mywiki/NetEtiquette +created_on: 1200939686 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + + +action: /say 'eval' is a common misspelling of 'evil'. If eval is the answer, surely you are asking the wrong question. See http://mywiki.wooledge.org/BashFAQ/048 +created_on: 1250140546 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 372 +ref_user: nobody +type: text + + +action: /say # while ((++n<=9)) || ! evalBall="eval $evalBall"; do printf -v evalBall 'eval %q' "printf $n;${evalBall-printf 0\\\n}"; done; $evalBall +created_on: 1360533310 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + + +action: /say shbot runs each session in a new VM as root. Feel free to play with the bot in #evalbot. | Original: http://www.vidarholen.net/contents/evalbot/ | geirha's fork: https://github.com/geirha/shbot | current triggers: /msg shbot triggers +created_on: 1412087373 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 112 +ref_user: nobody +type: text + + +action: /say What do you think I am? A universal oracle or something? +created_on: 1390438660 +enabled: 1 +owner: kurahaupo +rate_limit: 10 +ref_count: 8 +ref_user: nobody +type: text + + +action: /say Something that is short-sighted and not thought through. Doing evil has harmful side effects. It's not clever or cool to be evil, it's dumb. +created_on: 1376581939 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 20 +ref_user: nobody +type: text + + +action: /say ex is a POSIX command-based file editor: ex -sc '%s/long john/big ed/g|x' file. If your ex is vim it can also take multiple files using ge and argdo: ex -sc 'argdo %s/foo/bar/ge|x' *.txt # See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex.html +created_on: 1418138806 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say Please tell us EXACTLY what you typed, and EXACTLY what the error is. This entails going to your terminal and copying text then pasting that exact text here. +created_on: 1379300809 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 394 +ref_user: nobody +type: text + + +action: /call exact +created_on: 1361190501 +enabled: 1 +owner: Stummi +rate_limit: 10 +ref_count: 13 +ref_user: nobody +type: text + + +action: /say Please give us an example of what you want, the input and the output +created_on: 1171310067 +enabled: 1 +owner: bronze_0_1 +rate_limit: 10 +ref_count: 27 +ref_user: nobody +type: text + + +action: /say If providing sample data, make it either real or realistic (if something is a product name, and you must anonymize, call it "Foo Widgets", not xxxxx; if it has 3 fields, provide 3 fields, don't simplify to 2; etc). +created_on: 1363891138 +enabled: 1 +owner: nDuff +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say If an error happens, bash does not create an environment for exceptions unlike many programming languages. It uses the C model for error handling: it makes you do it. Use a decent programming language, silly. +created_on: 1398017987 +enabled: 1 +owner: bwe +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say exec [command] [redirections] replaces the script's process by a new one that runs the command. When no command is given, only the redirections are applied to the current shell. http://wiki.bash-hackers.org/commands/builtin/exec +created_on: 1292167492 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 132 +ref_user: nobody +type: text + + +action: /say find's -execdir first goes into the directory that CONTAINS the match and makes {} the matched file/directory. Eg. if it matches a directory, it does NOT go into that directory, but into the one that contains it. +created_on: 1302781762 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say Check if any file matches a given pattern: exists () [[ -e $1 ]]; if exists *.txt; then ... +created_on: 1439651606 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say Every Unix process returns an exit status code to its parent. This is an unsigned 8-bit value, a number from 0 to 255 inclusive. Your script returns the exit status from the last command it executed, unless you specifically call "exit" with a value. Functions also return values, using "return". +created_on: 1157569900 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say "Expansions" and "substitutions" are several stages of pre-processing that commands and arguments are subject to prior to execution. They are among the most important concepts of shell programming. http://wiki.bash-hackers.org/syntax/expansion/intro +created_on: 1346254947 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say expect (http://expect.sf.net/) is a tool for scripting terminal applications in tcl, join #tcl for help. Alternative tools exist in most languages, for a shell version see http://empty.sf.net +created_on: 1407861687 +enabled: 1 +owner: pgas +rate_limit: 10 +ref_count: 270 +ref_user: nobody +type: text + + +action: /say When explaining problem, don't just give us something that doesn't solve your problem. Try explaining what you want IN ENGLISH, giving example input and output, stating other requirements and limitations. See also !doesntwork +created_on: 1207167380 +enabled: 1 +owner: ferret +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say is http://www.explainshell.com +created_on: 1377752854 +enabled: 1 +owner: zendeavor +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /call env +created_on: 1297784434 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 65 +ref_user: nobody +type: text + + +action: /say 'expr' is a program used in ancient shell code to do math. In Posix shells like bash, use $(( expression )). In bash, ksh88+, mksh/pdksh, or zsh, you can also use '(( expression ))' or 'let expression'. +created_on: 1415910826 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 132 +ref_user: nobody +type: text + + +action: /say filename=foobar.ext; extension=${filename#*.}; filename_without_extension=${filename%.*} +created_on: 1295463461 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 11 +ref_user: nobody +type: text + + +action: /say Use parameter expansion: ext=${filename##*.} noext=${filename%.*} +created_on: 1286395040 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 25 +ref_user: nobody +type: text + + +action: /say "Extended globs" (shopt -s extglob) allow you to say things like "all files that do not end in .jpg". See http://mywiki.wooledge.org/glob#extglob +created_on: 1357713077 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 618 +ref_user: nobody +type: text + + +action: /call extglob +created_on: 1321501721 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say Some people, when wanting to answer a question, decide that they will make the bot answer for them. That's why we create so many factoids. You can see my factoid "database" on the web, at http://wooledge.org/~greybot/ (Actually, this is the metadata database, so you can see the deleted ones here as well as the active ones.) +created_on: 1256734262 +enabled: 1 +owner: bronze +rate_limit: 10 +ref_count: 35 +ref_user: nobody +type: text + + +action: /say My factoid database, and other things, are available at http://wooledge.org/~greybot/ +created_on: 1335386268 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 168 +ref_user: nobody +type: text + + +action: /say fact() { local n=1 i; for ((i=1; i<=$1; i++)); do n=$((n*i)); done; echo $n; } +created_on: 1366309514 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say fail. +created_on: 1211188317 +enabled: 1 +owner: go|dfish +rate_limit: 10 +ref_count: 12 +ref_user: nobody +type: text + + +action: /say Did it print the word "failed"? Did it print a more helpful error message? Did it exit immediately without printing anything? Did it hang and not return to shell? Be more SPECIFIC. +created_on: 1222459330 +enabled: 1 +owner: ferret +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say If set, patterns which fail to match filenames during pathname expansion result in an expansion error. +created_on: 1253495123 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 13 +ref_user: nobody +type: text + + +action: /say Two or three lines of the code make a big difference to us helping you. Tell us EXACTLY 1) what you typed; 2) what you saw; and 3) what you expected to see. ** Fake code and data get you fake results! ** +created_on: 1179082038 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Quick way to make programs believe that they're reading/writing from/to a terminal: function faketty { script -qfc "$(printf "%q " "$@")" /dev/null; } +created_on: 1438877219 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say FAM (File Alteration Monitor), or maybe you wanted inotifywait instead. Also incron for a cron-like tool to trigger commands on filesystem changes. +created_on: 1303421554 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say https://gist.github.com/bahamas10/6567725 +created_on: 1379215208 +enabled: 1 +owner: dualbus +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say http://andromeda.kiwilight.com/~freak/%23bash/faq/ +created_on: 1326474939 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say http://mywiki.wooledge.org/FileDescriptor +created_on: 1319741437 +enabled: 1 +noembed: 1 +owner: greycat +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say http://wiki.bash-hackers.org/scripting/bashchanges +created_on: 1347884851 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 115 +ref_user: nobody +type: text + + +action: /say it girl from abroad. +created_on: 1211637480 +enabled: 1 +owner: Fenia +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say http://wooledge.org/mywiki/BashFAQ/089 -- I'm using a loop which runs once per line of input but it only seems to run once; everything after the first line is ignored? +created_on: 1223542062 +enabled: 1 +owner: ferret +rate_limit: 10 +ref_count: 42 +ref_user: nobody +type: text + + +action: /say Do we look like we care? +created_on: 1182554729 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say http://cr.yp.to/daemontools/fghack.html +created_on: 1304021057 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say FUCKING GOOGLE IT +created_on: 1162494756 +enabled: 1 +owner: goldfish +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Linux's Filesytem Hierarchy Standard, a Linux-only standard which you can read about on your GNU/Linux system by reading hier(7). See ##linux. See NABQ. +created_on: 1298928243 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say frequently ignored answer to a common question +created_on: 1257528684 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say function fib { typeset f=(0 1) i=1; while (( i <= $1 )); do (( f[i] = f[i-1] + f[i++] )); done; echo "${f[@]:0:$1}"; }; +created_on: 1360645205 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 20 +ref_user: nobody +type: text + + +action: /call fib +created_on: 1360609569 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /call namedpipe +created_on: 1261600783 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say Read http://mywiki.wooledge.org/BashFAQ/073#Examples_of_Filename_Manipulation for examples of how to extract the directory, extension, or a serial number from a filename. +created_on: 1303648351 +enabled: 1 +owner: kwtm +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say http://wooledge.org/mywiki/UsingFind +created_on: 1169088275 +enabled: 1 +owner: greycat|home +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + + +action: /say find . -name .svn -prune -o -type f -print +created_on: 1193056988 +enabled: 1 +owner: oMish_ +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say To read filenames into an array from find use: while read -rd ''; do arr+=("$REPLY"); done < <(find dir ... -print0) +created_on: 1208383662 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say while IFS= read -r -d '' file; do something "$file"; done < <(find /foo -print0) +created_on: 1232028169 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 7 +ref_user: nobody +type: text + + +action: /say Don't do this: find ... | xargs. Not even with the -print0/-0 options. Use find ... -exec .. {} + instead. +created_on: 1367848685 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /call loadable +created_on: 1277932739 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say FIRST LEARN BASH. Then do stuff with bash. The other way around doesn't work. +created_on: 1416435092 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say You can write code for a man and he'll be able to solve a single problem, but pointing a man at a guide will let him solve problems for the rest of his life. +created_on: 1419322492 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 8 +ref_user: nobody +type: text + + +action: /call bool +created_on: 1286907619 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say flatten() { find "${1:-.}" -depth \( -type f -exec bash -c 'f=${1##*/} t=$f i=0; while [[ -e $2/$t ]]; do t=$f.$((++i)); done; mv "$1" "$2/$t"' {} "${1:-.}" \; \) -o \( -type d -empty -exec rmdir {} \; \); } # usage: flatten [dir] +created_on: 1315971911 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say There are many "flavours" of regular expressions. They differ in their syntax and in the features they offer. You use the wrong flavour for the tool you chose. bash itself and awk use Extended Regular Expressions (ERE), sed, grep and ed by default use Basic Regular Expressions (BRE). Also see #regex and http://bit.ly/1czg17g +created_on: 1426593225 +enabled: 1 +owner: Riviera +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say http://mywiki.wooledge.org/BashFAQ/022 -- How can I calculate with floating point numbers instead of just integers? +created_on: 1323826791 +enabled: 1 +owner: Riviera +rate_limit: 10 +ref_count: 133 +ref_user: nobody +type: text + + +action: /say Invoke bc, awk, or dc to do floating calculations from bash. bash does not do floating calculations directly. +created_on: 1193865982 +enabled: 1 +owner: oMish +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /call mutex +created_on: 1340794572 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 20 +ref_user: nobody +type: text + + +action: /say to disable the XON/XOFF flow control in your terminal put ``stty -ixon'' in your .bashrc; if you use the screen utility, start it with option -fn (no flow control) or add "defflow off" line to your .screenrc +created_on: 1411032292 +enabled: 1 +owner: bxlecqy_ +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say Filenames are NOT lines! One filename can be several lines of text! Do not use line-based tools such as awk, grep, cut, wc, sed, etc. on them! Use globs and arrays or a for loop instead or find .. -exec. +created_on: 1217572602 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /call folder +created_on: 1381420348 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 13 +ref_user: nobody +type: text + + +action: /say If you're having trouble telling zeros from ohs, and ells from i's, consider switching to a decent fixed-width font. Inconsolata comes to mind. +created_on: 1338294287 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say A placeholder word, used as a variable name or data in examples. See http://www.catb.org/jargon/html/F/foo.html +created_on: 1293653231 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 29 +ref_user: nobody +type: text + + +action: /say The term foobar, along with foo, bar, and baz, is a common placeholder name (also referred to as a metasyntactic variable) used in computer programming or computer-related documentation. See: http://en.wikipedia.org/wiki/Foobar +created_on: 1228918951 +enabled: 1 +owner: biz +rate_limit: 10 +ref_count: 7 +ref_user: nobody +type: text + + +action: /say 14:26:22 linuxthefish | oh shit my script has delete /home!!! +created_on: 1401128973 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say The ''for var in ..'' statement iterates over arguments. for ((i=0; i < n; i++)) iterates over a numeric range. To iterate over filenames, use ''for file in [glob]''. Do *NOT* do ''for foo in `cat,ls,find,...`'': Here, for will iterate over resulting WORDS, NOT the "filenames", or "lines" that the command outputs. +created_on: 1227796419 +enabled: 1 +last_referenced_in: deadsoul +last_referenced_on: 1446177558.56293 +owner: lhunath +rate_limit: 10 +ref_count: 307 +ref_user: DeaDSouL!~deadsoul@94.29.129.54 +type: text + + +action: /say Never do this: for x in $(command) or `command` or $var. for-in is used for iterating arguments, not (output) strings. Instead, use a glob (eg. *.txt), arrays (eg. "${names[@]}") or a while-read loop (eg. while read -r line). See http://mywiki.wooledge.org/BashPitfalls#pf1 and http://mywiki.wooledge.org/DontReadLinesWithFor +created_on: 1377533488 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 162 +ref_user: nobody +type: text + + +action: /call for$ +created_on: 1309641316 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 90 +ref_user: nobody +type: text + + +action: /call cfor +created_on: 1392740526 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + + +action: /call for$ +created_on: 1294813779 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 272 +ref_user: nobody +type: text + + +action: /say 'INCOMING! ( do not use "for" for that! ) ' +created_on: 1291064782 +enabled: 1 +owner: bronze +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say 'foreach' isn't bash. Try 'help for'. +created_on: 1237406487 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say I don't remember… +created_on: 1426015603 +enabled: 1 +owner: gniourf +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say When bash creates a subshell or executes an external command, it needs to fork. Avoid forking unless you have a good reason to: solutions that fork are often slower, even more so on machines where forking is expensive (eg. ''[[ $ext = *.txt ]]'' is much faster than ''echo "$foo" | grep -q "\.txt$"''). +created_on: 1343468216 +enabled: 1 +owner: ghj +rate_limit: 10 +ref_count: 18 +ref_user: nobody +type: text + + +action: /say Explanation of :(){ :|:& } - http://mywiki.wooledge.org/BashFAQ/059 +created_on: 1294001960 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 25 +ref_user: nobody +type: text + + +action: /say When you run an external command in the shell, the shell fork(2)s, and the child created by fork exec(2)s the command. Unless you started the command in the background (&), the parent will wait(2) on the child. The child is then what's "running" in the terminal and getting input from it. The parent shell sleeps until it gets woken up by the kernel (for instance when the child terminates). See also !pm +created_on: 1380358899 +enabled: 1 +owner: BlastHardcheese +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say Don't use "for i in `ls *.mp3`": http://mywiki.wooledge.org/BashPitfalls#for_i_in_.60ls_.2A.mp3.60 +created_on: 1241599282 +enabled: 1 +owner: koala_man +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say If you're the only person asking a question here, and I tell you about a nifty URL in the BashFAQ, there's a really good chance that, yes, that URL was indeed for you. When in doubt, read it. +created_on: 1178652153 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say Use for when iterating over a list/array, or (C-style for) when counting. Use while when reading input lines, or when the stop condition is an arbitrary command. Ask me about . +created_on: 1410810859 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say # (( numerator=2021, denominator= 1145459, digits=7, d=10**digits, x = (100 * d * 2 * numerator + 1)/2/ denominator)) ; printf %d.%0*u%%\\n $((x/d)) $digits $((x%d)) +created_on: 1393551569 +enabled: 1 +owner: kurahaupo_mobile +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /call autoload +created_on: 1359430433 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say Bash functions don't really "return" a computational result. They return a "success or failure" code, 0 to 255 inclusive (cf. "exit"). If you need to return real information from a function to its caller, see http://mywiki.wooledge.org/BashFAQ/084 +created_on: 1242673737 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say Want to help? Learn bash, read the topic, and answer questions intelligently. Take correction like a man. Make your arguments logically, not emotionally. Banter in ##bashers, not in #bash. Have a nice day. +created_on: 1184858794 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say FSlint is a toolkit to clean filesystem lint, like duplicate files, badly named paths, and broken symlinks. Install via your package manager or google for the source files +created_on: 1289342689 +enabled: 1 +owner: Bronze +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say http://wooledge.org/mywiki/FtpMustDie +created_on: 1127503901 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 83 +ref_user: nobody +type: text + + +action: /say http://25.media.tumblr.com/tumblr_m5rim2Dloe1qh1byio2_500.gif +created_on: 1339974884 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say nobody has ever been able to fuck over the internet (yet). Stop using that word +created_on: 1217249363 +enabled: 1 +owner: kamathln +rate_limit: 10 +ref_count: 12 +ref_user: nobody +type: text + + +action: /call function +created_on: 1422891297 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /call stack +created_on: 1423707904 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say To define: funcname() { your code here; } ## To use: funcname arg1 arg2 ... The "function" keyword isn't portable. ## http://mywiki.wooledge.org/BashGuide/CompoundCommands#Functions +created_on: 1435601339 +enabled: 1 +owner: llua +rate_limit: 10 +ref_count: 318 +ref_user: nobody +type: text + + +action: /call function +created_on: 1317299034 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 67 +ref_user: nobody +type: text + + +action: /say you can't just swap furballs… until you can. +created_on: 1356859070 +enabled: 1 +owner: fr33load3r +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say !guide - http://wooledge.org/mywiki/BashGuide +created_on: 1181383689 +enabled: 1 +noembed: 1 +owner: xmb +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say "Good Morning Y'All Shell Scripters' +created_on: 1387625997 +enabled: 1 +owner: juanmabc +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say # When Chuck Norris goes to sleep every night, he checks his closet for a script written by greycat. +created_on: 1316711800 +enabled: 1 +owner: bronz_ +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say # There is no such thing as global warming. greycat was cold, so he turned the sun up by generating extra heat with a bash script that calculates the value of PI to the last digit in 12 seconds. +created_on: 1316711954 +enabled: 1 +owner: bronze +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say # greycat has counted to infinity. Twice. He did it with a bash script he wrote, using perfect quotes. +created_on: 1316712278 +enabled: 1 +owner: bronze +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say http://www.counts-welt.de/gafom.gif +created_on: 1218230934 +enabled: 1 +owner: trash +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say http://wooledge.org:8000/BashGuide#Choose_Your_Shell +created_on: 1196376234 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say We do not care for derivation war! +created_on: 1388316402 +enabled: 1 +owner: TheBonsai_ +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say If you've ever written incredibly complex bash code because you wanted to "generalize" something, or make a "library", or emulate a feature of some other language -- then you've got it. +created_on: 1238094715 +enabled: 1 +owner: tobor +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say A caricature of someone who uses Gentoo. Not all Gentoo users are Gentooners, but a surprising number of the ones who join #bash are. +created_on: 1182979318 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say curl -o get-bash http://sprunge.us/WYKB; chmod +x ./get-bash; openssl sha256 get-bash # SHA-256 b20627b409a99092567790657a53b69bd0730dcc3a759092bf4713e21ac47616 -- (run with ./get-bash) +created_on: 1414511944 +enabled: 1 +owner: sjohnson +rate_limit: 10 +ref_count: 24 +ref_user: nobody +type: text + + +action: /say If you are having trouble getting help from the channel, the best way is to paste samples of your input and what you want the output to look like in a pastebin with a short explanation of any special considerations, then post the URL to the pastebin in the channel with a short request for help. +created_on: 1158423749 +enabled: 1 +owner: bronze +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say http://wooledge.org/~greg/gethostbyname.c +created_on: 1242243207 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say The external command getopt(1) is never safe to use, unless you *know* it is GNU getopt, you call it in a GNU-specific way, *and* you ensure that GETOPT_COMPATIBLE is not in the environment. Use getopts (shell builtin) instead, or simply loop over the positional parameters. +created_on: 1253473637 +enabled: 1 +owner: \amethyst +rate_limit: 10 +ref_count: 116 +ref_user: nobody +type: text + + +action: /say while getopts ab: name; do case $name in a) a=1;; b) b=$OPTARG;; ?) echo invalid;; esac; done; shift $((OPTIND - 1)) # Tutorial: http://wiki.bash-hackers.org/howto/getopts_tutorial Examples: http://mywiki.wooledge.org/BashFAQ/035 +created_on: 1390006749 +enabled: 1 +owner: Riviera +rate_limit: 10 +ref_count: 167 +ref_user: nobody +type: text + + +action: /call getopts +created_on: 1236007014 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 10 +ref_user: nobody +type: text + + +action: /say # getrange(){ local input=() nums=();IFS=, read -ra input<<<"$1";for i in "${input[@]}";do if [[ $i =~ ^[[:digit:]]+-[[:digit:]]+$ ]];then if ((${i%-*}<${i#*-}));then for ((x=${i%-*};x<=${i#*-};x++));do nums+=("$x");done;else echo "Invalid range: $i">&2;fi;else if [[ $i =~ [[:digit:]]+ ]];then nums+=("$i");else echo "Invalid number: $i">&2;fi;fi;done;printf '%s ' "${nums[@]}";echo;};getrange 1,3,8,9-15,23,4 +created_on: 1417740942 +enabled: 1 +owner: mattcen +rate_limit: 10 +ref_count: 20 +ref_user: nobody +type: text + + +action: /say # getrange2 () { local input=() nums=(); IFS=, read -ra input <<< "$1"; for i in "${input[@]}";do if [[ $i =~ ^[[:digit:]]+-[[:digit:]]+$ ]];then eval "nums+=({${i%-*}..${i#*-}})";elif [[ $i =~ [[:digit:]]+ ]];then nums+=("$i");else echo "Invalid number or range: $i">&2;fi done;printf '%s\n' "${nums[*]}";};getrange2 1,3,8,9-15,23,4 +created_on: 1425023369 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 9 +ref_user: nobody +type: text + + +action: /say https://www.mirbsd.org/cvs.cgi/~checkout~/contrib/code/Snippets/getshver?rev=HEAD +created_on: 1361384997 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say go fuck youself +created_on: 1219480351 +enabled: 1 +owner: t1OOO +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Garbage In, Garbage Out +created_on: 1177954657 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say http://wooledge.org:8000/BashGuide#IO +created_on: 1196376171 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say web url: http://git.sv.gnu.org/cgit/bash.git - clone url: git://git.sv.gnu.org/bash.git - snapshot of latest version: http://git.sv.gnu.org/cgit/bash.git/snapshot/bash-master.tar.gz +created_on: 1413569890 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 17 +ref_user: nobody +type: text + + +action: /say http://www.counts-welt.de/giveadamn.gif +created_on: 1218230925 +enabled: 1 +owner: trash +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Google Is Your Friend. In other words, STFW. +created_on: 1180036674 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say Globs are shell patterns that can be used for matching strings or expanding pathnames: [[ $name = Bob* ]], rm *.txt -- http://mywiki.wooledge.org/glob +created_on: 1424879306 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 333 +ref_user: nobody +type: text + + +action: /call globs +created_on: 1321501754 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 11 +ref_user: nobody +type: text + + +action: /say glob only dotfiles with ''.[!.]*'' or ''.!(.|)'' (the latter with extglob). the former will not handle ''..foo'', but the latter will +created_on: 1360960297 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say for i in *; do echo -n "'$i'"; [[ -f $i ]] && echo || echo " is not a file"; done +created_on: 1186667599 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /call glob +created_on: 1256657199 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 35 +ref_user: nobody +type: text + + +action: /say In bash 4, when the globstar shell option is enabled ( shopt -s globstar ), the glob ** expands to all files and directories found recursively under the current directory, and **/ to all directories. Combinations like foo/**/*.txt work, but **.txt and foo** do not. +created_on: 1425599254 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 157 +ref_user: nobody +type: text + + +action: /say glob match in POSIX sh: gm() { case $1 in $2) return 0;; esac; return 1; } +created_on: 1407431889 +enabled: 1 +owner: emg +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say find . -type f -printf '%T+ %p\0' | sort -z | tr \\0 \\n +created_on: 1310138345 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say Making up broken examples with multiple errors in them does NOT explain your goal. +created_on: 1345575211 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 13 +ref_user: nobody +type: text + + +action: /say "code golfing" is trying to write a program in as few characters as possible. Don't ask for help, though. :P +created_on: 1342556700 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say # h=$(date +%H) h=${h#0}; if ((h<=4 || h>=22)); then tod=night; elif ((h>=17)); then tod=evening; elif ((h>=12)); then tod=afternoon; else tod=morning; fi; echo "Good $tod, #bash!" +created_on: 1378492651 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 26 +ref_user: nobody +type: text + + +action: /say http://cime.net/~goldfish/end.jpg +created_on: 1179277806 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say Google is NOT a preferred source for learning bash, because almost all the "tutorials" and scripts out there are JUNK. Instead, ask a good question here or refer to the Guide and FAQ (see topic) +created_on: 1363849702 +enabled: 1 +owner: twb +rate_limit: 10 +ref_count: 718 +ref_user: nobody +type: text + + +action: /say Bash has no 'goto', and no labels. You must use loops, functions, etc. +created_on: 1189001078 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 14 +ref_user: nobody +type: text + + +action: /say Proper formatting and indenting is important to avoid misunderstanding the scopes, blocks and contexts in your program. Apple broke SSL with a badly indented ''goto fail;'' https://www.imperialviolet.org/2014/02/22/applebug.html +created_on: 1393428002 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say How can I echo YYYY-MM-DD? echo YYYY-MM-DD +created_on: 1191405104 +enabled: 1 +owner: oMish +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say GRAMMAR THEORY: http://bash-hackers.org/wiki/doku.php/syntax/basicgrammar +created_on: 1203485974 +enabled: 1 +owner: TheBonsai +rate_limit: 10 +ref_count: 7 +ref_user: nobody +type: text + + +action: /say graybot is a clone of greybot that gets put into play when greybot is MIA and yitz_ notices it first. +created_on: 1268245093 +enabled: 1 +owner: yitz_ +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /call hi +created_on: 1378314086 +enabled: 1 +owner: sjohnson +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say grep(1) is a tool used to select certain lines from a stream/file. If you want to extract more specific information, use another tool. Maybe sed/awk or a more specific tool for your purpose. +created_on: 1359308797 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say similar functionality to GNU grep -o with bash and POSIX AWK: https://github.com/e36freak/ogrep +created_on: 1330636120 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say Awk can do almost everything grep can do. Instead of doing grep 'foo' | awk '{ statement }', try awk '/foo/{ statement }' +created_on: 1213729568 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /call factoids +created_on: 1261602342 +enabled: 1 +owner: tuxdev +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say greycat is neither grey, nor gray, nor a cat. +created_on: 1187098122 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 25 +ref_user: nobody +type: text + + +action: /say # echo "gip yxes ma I" | { read -r; n=${#REPLY}; o=; for ((i=n; i>=0; --i)); do o+="${REPLY:i:1}"; done; echo "$o"; } +created_on: 1379445140 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 13 +ref_user: nobody +type: text + + +action: /call catsgreycats +created_on: 1412736845 +enabled: 1 +owner: ormaaj +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say http://mywiki.wooledge.org/BashGuide/CompoundCommands#Command_grouping +created_on: 1294772531 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 19 +ref_user: nobody +type: text + + +action: /say Did you plug it in? Does the capslock LED light up? Is there smoke? Please don't make us guess. Instead, describe what you want to accomplish, and paste or pastebin any troublesome code you have. +created_on: 1205160485 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 19 +ref_user: nobody +type: text + + +action: /say You can't just make shit up and expect the computer to magically know what you mean. +created_on: 1391012685 +enabled: 1 +owner: Riviera +rate_limit: 10 +ref_count: 80 +ref_user: nobody +type: text + + +action: /say . PDF: . Also lhunath's newer version (work in progress): +created_on: 1426019200 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say if all you have is a hammer, everything looks like a nail +created_on: 1347552153 +enabled: 1 +owner: e36freak +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say if you want someone to write your scripts for you, rather than to point you in a direction where you can learn to write them yourself, perhaps you should, I don't know, offer to pay consulting fees +created_on: 1273871566 +enabled: 1 +owner: tuxdev +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say RTFM is for newbie questions, not hard ones. +created_on: 1187964208 +enabled: 1 +owner: ivazquez +rate_limit: 10 +ref_count: 6 +ref_user: nobody +type: text + + +action: /say See faq 46 +created_on: 1266515378 +enabled: 1 +owner: kojiro +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say hash is a builtin for managing bash's hashtables, with which bash determines what commands call what programs. See 'help hash' at your nearest bash prompt for more info. If you mean perl's hashes, bash 4.0 and later support associative arrays. No earlier bash version supports them. +created_on: 1257801026 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 15 +ref_user: nobody +type: text + + +action: /call shebang +created_on: 1246912108 +enabled: 1 +owner: lhunath +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say hastebin.com: to get the text, insert "/raw/" into the URL. E.g. http://hastebin.com/raw/blahblah.pl +created_on: 1412274901 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 5 +ref_user: nobody +type: text + + +action: /say this is the case I hate, when I know precisely the right answer but the "explanation" is not going to be worth the time it would takes to precisely formulate it. +created_on: 1193756795 +enabled: 1 +owner: oMish_ +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say "I have ____ and I want ____." Fill in the blanks. +created_on: 1383865435 +enabled: 1 +last_referenced_in: socialblunder +last_referenced_on: 1445497072.75953 +owner: emg +rate_limit: 10 +ref_count: 336 +ref_user: SocialBlunder!~SocialBlu@2605:a000:111a:e00a:4951:4a7a:8f79:9e82 +type: text + + +action: /say I have headache today. +created_on: 1192394861 +enabled: 1 +owner: oMish +rate_limit: 10 +ref_count: 4 +ref_user: nobody +type: text + + +action: /say # headtail(){ awk -v n="$1" 'i++ < n ; { a[NR%n]=$0 } END { for (i=NR-(n-1); i<=NR; i++) print a[i%n] }'; }; printf '%s\n' {1..3} | headtail 1 # head reads data in chunks. if stdin is not seekable, it can't reset the seek point +created_on: 1430325851 +enabled: 1 +owner: izabera +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say The Heirloom Bourne Shell is an implementation of the classic (pre-Posix) Bourne shell. http://heirloom.sourceforge.net/sh.html +created_on: 1243660916 +enabled: 1 +owner: \amethyst +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say A heisenbug disappears or alters its behavior when one attempts to probe or isolate it. +created_on: 1390918066 +enabled: 1 +owner: Riviera +rate_limit: 10 +ref_count: 3 +ref_user: nobody +type: text + + +action: /say One responds to '/msg greybot faq term' -- Try: /msg greybot links Any command except learn and forget can be used in pm. +created_on: 1296183848 +enabled: 1 +owner: pragma_ +rate_limit: 10 +ref_count: 64 +ref_user: nobody +type: text + + +action: /say I can do: !faq {number|string}, !pf {number|string}, !learn key value, !meta key, !forget key, !searchkeys string, !factstats, !faqstats, !faqpages, !date, !version. For help with Bash builtins, use "help command" in bash. +created_on: 1416425082 +enabled: 1 +owner: mute +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /call << +created_on: 1261498304 +enabled: 1 +owner: tuxdev +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /call <<< +created_on: 1261498353 +enabled: 1 +owner: tuxdev +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /call << +created_on: 1252529894 +enabled: 1 +owner: \amethyst +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /call <<< +created_on: 1261498368 +enabled: 1 +owner: tuxdev +rate_limit: 10 +ref_count: 27 +ref_user: nobody +type: text + + +action: /say hi. *5 minute pause* how do I [insert confusing question about a convoluted piece of code to solve an imaginary problem here] ? +created_on: 1435333796 +enabled: 1 +owner: llua +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say and don't ask to ask ;-) Bear with igli, he likes talking by bot +created_on: 1189961866 +enabled: 1 +owner: trash +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say Why files starting with dot (.) are "hidden": https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp +created_on: 1416426801 +enabled: 1 +owner: geirha +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say A colon separated list of "ignorespace", "ignoredups" and/or "erasedups" to control how lines are saved in the history. Also see HISTIGNORE. +created_on: 1379612802 +enabled: 1 +owner: koala_man +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say A colon-separated list of patterns used to decide which command lines should be saved on the history list. +created_on: 1379612831 +enabled: 1 +owner: koala_man +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say To keep all your shell history when running multiple shells: add two lines to your .bashrc; shopt -s histappend and PROMPT_COMMAND="history -a;$PROMPT_COMMAND" You may also want to increase the value of HISTSIZE. +created_on: 1288813871 +enabled: 1 +owner: Bronze +rate_limit: 10 +ref_count: 2 +ref_user: nobody +type: text + + +action: /say Just try it -- you can't break anything! (DO NOT test scripts as root.) +created_on: 1192164376 +enabled: 1 +owner: igli +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say After you've written a script, if you're going to use it again, move it to ~/bin/ and if necessary create that directory and edit .*profile to add it to PATH) +created_on: 1416250482 +enabled: 1 +owner: kurahaupo +rate_limit: 10 +ref_count: 0 +ref_user: nobody +type: text + + +action: /say "I have to count the lines in a file. But I'm not allowed to use wc. And I'm not allowed to use grep. And I have to type it in using a teletype. With no paper in it. In the dark. Left-handed." +created_on: 1257540795 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 211 +ref_user: nobody +type: text + + +action: /say https://orders.hookedonphonics.com +created_on: 1379088645 +enabled: 1 +owner: sjohnson +rate_limit: 10 +ref_count: 1 +ref_user: nobody +type: text + + +action: /say Don't tell us how you think the problem should be solved. "I want to grep a variable and use sed...." No. Wrong. Tell us what the GOAL is. +created_on: 1302539858 +enabled: 1 +owner: greycat +rate_limit: 10 +ref_count: 19 +ref_user: nobody +type: text + +
+action: /say http://wiki.bash-hackers.org/snipplets/print_horizontal_line +created_on: 1310720881 +enabled: 1 +owner: sn18 +rate_limit: 10 +ref_count: 43 +ref_user: nobody +type: text + + +action: /say You can't parse structured languages like HTML or XML using bash, grep, sed, cut, etc. Look into tidy, xmllint, xmlstarlet, ... Eg. xmllint --html --xpath '//p[@id="head"]//b[@class="name"]/text()' - <<< '