# Stuff

index1: ##spinach
index2: fstdfilter
edited_by: iamgarp!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##spinach
owner: fstd!~fstd@unaffiliated/fisted
ref_user: fstd!~fstd@unaffiliated/fisted
type: text
action:
  /call spinach filter include MATH...NUMBERS|MATHEMATICS|MEDICINE|MISC|MUSIC|MUSIC.TERMS|NAME.THAT.CAR.MAKER|NATURE|NAUTICAL|NETHACK|ONE.LINERS|PERIODIC.TABLE|PHILOSOPHY|PHOBIAS|PHONETIC.ALPHABET|PHONETIC.RADIO.CALL.SIGNS|PHYSICS|PLANETS|PLANTS|PRINTING|PSYCHOLOGY|RADIO.ALPHABET|ROBOTECH|SCIENCE|SCIENCE...NATURE|SCIENCE...TECHNOLOGY|SEMANTICS|SOUTHPARK|SPORTS|STRUCTURES|TECHNICAL.ACRONYMS|TECHNOLOGY|TENNIS|TRANSPORTATION|UNEXPLAINED|URBAN.LEGENDS|USELESS.FACTS|USELESS.TRIVIA|WORDS...NUMBERS|ABBREVIATIONS|ACRONYM.SOUP|ACRONYMS|AIRCRAFT|ALCOHOL|ANALOGIES|ARCHAEOLOGY|ARCHAIC.DEFINITIONS|ARCHITECTURE|ASTRONOMY|AVIATION|BIOLOGY|CARS|CHEMISTRY|CHESS|CODES|COLORS|COMPUTER.SCIENCE|COMPUTERS|DISCOVERIES|DONT.STRAIN.YOURSELF.THINKING|DRIVING|ELECTRICITY|ELECTRONICS|FAMOUS.LAST.WORDS|GEOLOGY|HARRY.POTTER|INFORMAL.DEFINITIONS|INVENTIONS|LANGUAGE|LANGUAGE...LINGUISTICS|LINGUISTICS|LOGIC


index1: ##spinach
index2: funfilter
edited_by: iamgarp!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##spinach
owner: iamgarp!~chaos@unaffiliated/pragmatic-chaos
ref_user: iamgarp!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /call spinach filter include animal|group.of|analogies|alcohol|devil|slang|baby|prepared|birthstone|booze|confucius|cliches|similies|chess|cartoons|card.games|childrens|board.games|cocktails|colors|computer.games|crappy.jokes|comics|disney|thinking|fairy|quotes|food|games|guess.the.word|hitchhiker|trivia|plates|legends|rings|potter|python|muppet|misheard|tag.lines|name.that.thing|name.that.drink|popeye|punny|saturday|wizard|wonder|x.files|wild.card|links


index1: ##spinach
index2: howtoplay
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##spinach
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: markcameron!2e8c6f1a@46.140.111.26
type: text
action:
  /say Use the `!spinach` command. `spinach join` to join a game. `spinach ready` to ready up. `spinach choose` to choose a category or truth. `spinach lie` to submit a lie. See `!spinach` for other commands. Most of the `!spinach` commands have short-hand aliases; e.g. `!j` `!r` `!c` `!l`, etc.


index1: ##spinach
index2: rules
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##spinach
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: KOLANICH!~KOLANICH@unaffiliated/kolanich
type: text
action:
  /say Each round, a player chooses a category and then a question is shown. Everybody then privately submits a false answer they hope to deceive others into selecting. Then all the false answers and the truth is shown. Everyone chooses which answer they believe is the truth. You earn massive points for each person you deceive, and slightly less for finding the truth!


index1: ##spinach
index2: schoolfilter
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##spinach
owner: iamgarp!~chaos@unaffiliated/pragmatic-chaos
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /call spinach filter include abbrev|acron|animal|archaeology|anatomy|medical|astronomy|biology|botany|business|breeds|chemistry|computer|constell|countries|currenc|definit|dinosaur|discoveries|electricity|electronics|geography|geology|grammar|history|language|logic|math|medicine|^music$|^musical instruments$|mythology|anthems|capitals|nature|nautical|pathology|periodic|philos|phobias|physics|plants|planets|proverbs|psychology|religion|church|similes|scents|science|tech|study.of|laws|urban|usage|numbers|zoology|birthstones


index1: ##spinach
index2: whyspinach
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##spinach
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: cbone2!~cbone@199.114.7.237
type: text
action:
  /say Spinach is loosely based on a game called Fibbage. Why did we choose the name Spinach? When we searched for 'fib' synonyms the first result contained "spinach". This greatly amused us.


index1: #philosophy
index2: existence
last_referenced_in: ##c-offtopic
owner: pragma_
ref_user: mthowe-!uid249081@gateway/web/irccloud.com/x-uid249081
type: text
action:
  /say The most basic property is the property that there are no properties; which is a property in itself.  The most basic object is the void; which by the same vein of the first sentence means that there cannot be a void.  Everything and nothing is filled with something.  Existence is simply a paradox of contradictions and opposite reactions.  Ones and zeroes, truth and fiction.  Everything that shall be will be.  A collective imagination of sentience.


index1: #philosophy
index2: fool
last_referenced_in: krok_
owner: pragma_
ref_user: krok_!~krok@static-50-53-171-198.bvtn.or.frontiernet.net
type: text
action:
  /say He who asks a question may be a fool for five minutes; he who does not ask a question remains a fool forever.


index1: #philosophy
index2: theworld
last_referenced_in: nitrix
owner: pragma_
ref_user: nitrix!~nitrix@unaffiliated/nitrix
type: text
action:
  http://strangemaps.files.wordpress.com/2006/11/800px-reagan-digitised-poster.JPG -- http://interactive.usc.edu/members/nsharkasi/americanworld.jpg -- http://cdn.epltalk.com/wp-content/uploads/2009/10/world-according-to-americans.jpg -- http://img293.imageshack.us/img293/2952/usworldem8.jpg


index1: ##posix
index2: beej
last_referenced_in: ##c-offtopic
owner: twkm
ref_user: tires!~pi@cpe-172-101-20-238.maine.res.rr.com
type: text
action:
  /say Beej's Guide to Network Programming -- Using Internet Sockets is at http://beej.us/guide/bgnet/


index1: ##posix
index2: gettimeofday
owner: Major-Willard
ref_user: nobody
type: text
action:
  a function that returns the time in seconds and milliseconds since the epoch (Thursday, January 1 1970) and the local timezone


index1: ##posix
index2: ipc
last_referenced_in: popl
owner: twkm
ref_user: popl
type: text
action:
  /say IPC is Inter-Process Communication.  A nice tutorial for UNIX is at http://www.ecst.csuchico.edu/~beej/guide/ipc/


index1: ##posix
index2: sigsegv
last_referenced_in: ##c-offtopic
owner: Major-Willard
ref_user: qwename!~qwename@unaffiliated/qwename
type: text
action:
  a signal sent when an address is referenced that has not been allocated to your virtual address space


index1: ##posix
index2: unbufferedgetc
last_referenced_in: ##c-offtopic
owner: pragma_
ref_user: nil!~n@monade.li
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


index1: ##posix
index2: unp2
last_referenced_in: ##c
owner: twkm
ref_user: Dianora
type: text
action:
  unix network programming, volume 2: interprocess communications, by stevens, see http://www.kohala.com/start/unpv22e/unpv22e.html


index1: .*
index2: (y)
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say ( y ) is MSN Messenger for the "Thumbs Up" emoticon. It's not an IRC thing. No IRC clients translate it. Pidgin is not an IRC client. It's an instant messenger with a proof-of-concept half-arsed IRC plugin. Knock it off.


index1: .*
index2: 20q
last_referenced_in: ##c
owner: Jafet
ref_user: doppel!~doppel@ip68-96-169-47.lv.lv.cox.net
type: text
action:
  /say If you have a question, please be specific and concise. Don't ask questions like 'Does anyone know how to ...' or 'What is the best way to ...'. We do not have the time or patience to play a game of 20 questions with people that are not capable of articulating properly. See also: http://catb.org/~esr/faqs/smart-questions.html


index1: .*
index2: adjective
edited_by: nil!~n@monade.li
last_referenced_in: ##c-offtopic
owner: syntropy
ref_user: nil!~n@monade.li
type: text
action:
  fail stupid ignorant annoying awesome unique able adorable adventurous active afraid aggressive amusing awful bad bitter brief careless careful dark dangerous cheap chilly clean standard prophylactic infuriating strange forgettable concerning awe-inspiring lame brilliant


index1: .*
index2: adjectives
edited_by: garp!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: jp
owner: jp!ayy@youlosethega.me
ref_user: jp!ayy@youlosethega.me
type: text
action:
  absurd amazing amusing angry arrogant ashamed astonishing astounding awful beatific bewildering breathtaking broad bucolic cheerful chucklesome confused creepy disconcerting droll dulcet dusty enormous evil fierce fluffy foolish frightened gentle gigantic gratuitous hilarious huge humorous hysterical idyllic jolly kind laughable mellifluous meretricious miniature numinous proud quaint ridiculous shallow shocking silent silly soft startling stunning ubiquitous witty $animal_adjectives


index1: .*
index2: adsqads
last_referenced_in: tuplanolla
owner: guidj0s
ref_user: Tuplanolla!~Put-on-la@dsl-jklbrasgw1-54fb0b-216.dhcp.inet.fi
type: text
action:
  /say 'A dicto secundum quid ad dictum simpliciter' - the 'Hasty Generalization' logical fallacy, to which new C programmers often fall prey. Fight the urge to let it get you by studying the theory and not trying to learn through testing.


index1: .*
index2: advicepredicate
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: van7hu
owner: pragma_
ref_user: van7hu
type: text
action:
  "I recommend to" "My advice is to" "I think it $advicehelper2 be $advicehelper3 to" "I think it $advicehelper2 be $advicehelper3 to" "I think it $advicehelper2 be $advicehelper3 to"


index1: .*
index2: aids
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: PARLIAMENT
ref_user: alyptik!ayy@youlosethega.me
type: text
action:
  "There's no easy way to say this. You got aids. Yuck! :x"  $noaids "You contracted aids from $who_answers!" "You were attacked by a $animals!  You now have aids." $noaids $noaids


index1: .*
index2: alis
edited_by: edk!~edk@spy/edk0
last_referenced_in: korans
owner: pragma-
ref_user: korans!~korans@5.42.131.31
type: text
action:
  /say alis is a freenode service that lets you search for channels.  See `/msg alis help list` to get started.  Examples: `/msg alis list make` to search for all channel names containing "make"; `/msg alis list * -topic make` to search all channels for topic containing "make"


index1: .*
index2: alot
last_referenced_in: ##c
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: atk!Arch-TK@ircpuzzles/staff/Arch-TK
type: text
action:
  /say I like this Alot: http://hyperboleandahalf.blogspot.com/2010/04/alot-is-better-than-you-at-everything.html


index1: .*
index2: amputation_targets
edited_by: e!e@enucs/spy.edk
owner: e!e@enucs/spy.edk
ref_user: nobody
type: text
action:
  "$leftright arm" "$leftright leg" "$leftright ear" head nuts brain "$leftright foot" "$leftright hand" ass


index1: .*
index2: animal_actions
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  grazes defecates urinates wanders rests sleeps roars bellows "sniffs your $body_part" "is thinking about humping your $body_part" shuffles "is playing" "is regarding you suspiciously" burrows hibernates hops "is licking their $body_part" prances preens scavenges "is searching for something" "seems lost" "appears confused" "is digging" "is running in circles" lumbers crawls struts wanders bounds runs waddles ambles prowls scampers "is insisting that the bikeshed should be painted $colors"


index1: .*
index2: animal_adjectives
edited_by: garp!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma_
ref_user: christopher!NextHendri@unaffiliated/nexthendrix
type: text
action:
  wet overweight bloated skinny shaved dirty rabid drooling aroused fat filthy golden timid aggressive rabid shy demure seductive happy sad angry sexy lonely fruity mangy juvenile old ancient young man-eating mature poisonous pigmy predatory purebred savage tame territorial venomous wild deranged trendy $adjectives


index1: .*
index2: animal_types
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: jp!ayy@youlosethega.me
ref_user: nil!~n@monade.li
type: text
action:
  aardvark albatross alligator alpaca ant anteater antelope ape armadillo aye-aye babirusa baboon badger barracuda bat bear beaver bee bison boar buffalo buffalo butterfly camel caribou cat caterpillar cow chamois cheetah chicken chimpanzee chinchilla chough clam cobra cockroach cod corgi cormorant coyote crab crane crocodile crow curlew deer dinosaur dog dogfish dolphin donkey dotterel dove dragon dragonfly duck dugong dunlin eagle echidna eel eland elephant elk emu falcon ferret finch fish flamingo fly fossa fowl fox frog galago gaur gazelle gerbil gerenuk giant giraffe gnat gnu goat goldfinch goldfish goose gorilla goshawk grasshopper grouse grue guanaco guinea gull hamster hare hawk hedgehog heron herring hippopotamus hornet horse human hummingbird hyena jackal jaguar jellyfish joey kangaroo kiwi koala "komodo dragon" kouprey kudu lamprey lapwing lark lemur leopard lion llama lobster locust loris louse lyrebird magpie mallard manatee manbearpig marten meerkat mink mole monkey moose mosquito mouse mule narwhal newt nightingale octopus okapi opossum oryx ostrich otter owl ox oyster panda panther parrot partridge peafowl pelican penguin pheasant pig pigeon pony porcupine porpoise quail rabbit raccoon ram rat raven reindeer rhinoceros salamander salmon sandpiper sardine scorpion seahorse seal "sea lion" "sea monkey" "sea urchin" shark sheep shrew shrimp skunk snail snake spider squid squirrel starling stingray stinkbug stork swallow swan tapir tarsier termite tiger toad trout turkey turtle "unicorn coffee" viper vulture wallaby walrus wasp "water weasel" whale wolf wolverine wombat woodcock woodpecker worm wren yak zebra cock troll elf orc cricket zombie orc troll dwarf giant goblin gremlin ghost skeleton buffalo garpike seagull


index1: .*
index2: animals
edited_by: k!~krok@unaffiliated/krok
last_referenced_in: koisoke
owner: pragma_
ref_user: koisoke!xef4@epilogue.org
type: text
action:
  armadillo whale hyena squid trout hedgehog pussy pig buffalo earthworm alligator turkey chicken cock badger calf platypus grue anteater wildebeest gnu moose crocodile


index1: .*
index2: answers
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c
owner: pragma_
ref_user: dave0!~davezero@069.d.003.ncl.iprimus.net.au
type: text
action:
  Yes. "Most likely." No. "I think not." Brilliant! "Are you a $sizes $idiots?" "Definitely not." "Most assuredly." Absolutely! "Not likely!" "Do I look like I care?" "I'm not sure, let me check." "It would seem so." "I don't think so." "Why are you bothering me with this?" "Forget it!" "Yeah, right." "As if!" "Can has happy fun time!" "But of course." "That gives me an idea!" "Don't be $silly_adjective." "That would be $question_type." Sometimes. "That's $severity $question_type." "What do you mean by that?" "What is that supposed to mean?"


index1: .*
index2: ask
edited_by: edk!~edk@spy/edk0
last_referenced_in: ##c
owner: pragma_
ref_user: up_here!~comms@195.73.191.194
type: text
action:
  /say If you have a question, just ask.  If somebody knows, they'll answer :) For best results, be specific, informative, complete, concise and on-topic!  Don't ask if you can ask a question. Don't ask if anyone uses/knows about foo. Please don't be demanding or insulting. Remember, we're all volunteers.  Also see: http://geoff.greer.fm/2012/05/19/programmer-irc-etiquette/


index1: .*
index2: asprintf
last_referenced_in: stairmast0r
owner: dave0!~dave0@069.d.003.ncl.iprimus.net.au
ref_user: stairmast0r!~stairmast@unaffiliated/stairmast0r
type: text
action:
  const char *ASPrintF(const char *format, ...) { va_list ap; va_start(ap, format); int size = vsnprintf(0, 0, format, ap) + 1; va_end(ap); va_start(ap, format); char *string = 0; if(size > 0) string = malloc(size); if(string != 0) vsnprintf(string, size, format, ap); va_end(ap); return(string); }


index1: .*
index2: attack_adverbs
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  brutally violently bashfully wimpily barely heartily "goes super-saiyan and" "hulks out and" "$rpg_howls and" half-heartedly "lets out a blood-curdling $rpg_howl and" "strikes a pose and" "trips over their $body_part, but quickly recovers and"


index1: .*
index2: attack_verbs
edited_by: k!~krok@unaffiliated/krok
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  hits smashes crushes attacks whacks stabs slices misses misses "barely whiffs" slams $attacks $rpg_spell_attack "grabs their opponent's $body_part and $rpg_body_part_attack_action" punches kicks "roundhouse kicks" "jump kicks" "kung-fu chops" tackles "judo chops" "butterfly kicks" "scissor kicks" "slide kicks" "wheel kicks" "reverse roundhouse kicks" "spinning heel kicks" "spinning backfists" "hammer fists" fists "delivers a series of devastating $attack_verbs to" jabs hooks uppercuts "sucker punches" "puts a chokehold on" "crane kicks" "lays some wizard shit down on"


index1: .*
index2: autoshit
last_referenced_in: ##c
owner: PoppaVic
ref_user: hlt!~annoying@2602:ffc5::ffc5:cd91
type: text
action:
  the portability whore that is GNU autoconf/automake/configure/aclocal/libtool/sh/m4 messes that are NOT portable


index1: .*
index2: base
edited_by: jp!ayy@youlosethega.me
last_referenced_in: enriooooooo
owner: jp!ayy@youlosethega.me
ref_user: enriooooooo!~nanoz@unaffiliated/nanoz
type: text
action:
  /code zsh for i in "$@"; do print -f "[%s]: '%s' - %s - " "$((i))" "$(print -f '%q' ${(#)$((i % 256))} | tr -d $'\'$')" "$(numfmt --grouping "$(([#10] i))")"; perl -e '; my $_a = shift; while ($_a =~ m/^[^_]{2}/) {; $_a =~ s/([^_]{2})(_|$)/_$1$2/; }; $_a =~ s/^[^x]*x_?//; my @_b = split /_/, $_a; $_b[0] = sprintf "%02s", $_b[0] unless !$_b[0]; print "0x" . lc join("", @_b) . " - "; ' "${$(([#16] i))//16\#/}"; print -f "%s - " "${$(([#8] i))//8\#/0}"; perl -e ' my $_a = shift; while ($_a =~ m/^[^_]{8}/) { $_a =~s/([^_]{8})(_|$)/_$1$2/; } $_a =~ s/^_?/0b_/; my @_b = split /_/, $_a; $_b[1] = sprintf "%08s", $_b[1]; print join("_", @_b) . "\n"; ' "${$(([#2] i))//2\#/}"; done


index1: .*
index2: beer_extras
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "with a thick head" "with extra head" "with extra foam" "with a frothy foam" "with a healthy foam" "with a slice of lemon" "with a $straw_type straw" "with a cherry on top" "" "" ""


index1: .*
index2: big
edited_by: Random832!~random@unaffiliated/random832
last_referenced_in: ##c-offtopic
owner: jp!ayy@youlosethega.me
ref_user: garp!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /code zsh print -nr - "$*" | sed $'y/abcdefghijklmnopqrstuvwxyz<>\"\'/ＡＢＣＤＥＦＧＨＩＪＫＬＭＮＯＰＱＲＳＴＵＶＷＸＹＺ＜＞＂＇/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ<>"\'/ＡＢＣＤＥＦＧＨＩＪＫＬＭＮＯＰＱＲＳＴＵＶＷＸＹＺ＜＞＂＇/' | sed 's/ /  /g'


index1: .*
index2: blamethecompiler
last_referenced_in: ##c-offtopic
owner: prec
ref_user: oldlaptop!~quassel@45.63.78.126
type: text
action:
  a common disease mostly contracted by beginning programmers.  There is no known cure except that over time, outbreaks will occur with less and less frequency.


index1: .*
index2: body_part
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c
owner: pragma_
ref_user: fstd!~fstd@unaffiliated/fisted
type: text
action:
  arm hand head foot leg face ass ear nose neck "left buttock" nuts back gallbladder "right eye" perineum shin knee ankle elbow toe pinky "small finger" thumb nostril liver kidney heart chest boob stomach gut wrist shoulder thigh hip waist "funny bone"


index1: .*
index2: breakfast_ingredient
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: e!e@enucs/spy.edk
ref_user: nobody
type: text
action:
  "$chain_toppings and $pizza_toppings omelette" "$muffin_type waffle" "$muffin_type crumpet" "$muffin_type pancake" "$chain_toppings and $pizza_toppings quiche" "$cereal_type cereal" "full English" "biscuits and gravy"


index1: .*
index2: breakfast_side_dishes
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  hashbrowns bacon sausage "an $muffin_type muffin" "a biscuit" "$egg_type eggs" "$poptart_type Pop-Tart" "$fruit $spread_type toast" "a $fruit_container of &{pluralize $fruit}" "a $donut_type donut" "home-style potatoes"


index1: .*
index2: c.char
last_referenced_in: ##c-offtopic
owner: PoppaVic
ref_user: qwename!~qwename@unaffiliated/qwename
type: text
action:
  tristate: it's the only integral type suffering 3 states: signed, unsigned, and "char". The latter is platform and compiler discretionary. char is the smallest-addressable-unit, and ALWAYS sizeof==1. Are.You.Having.Fun.Yet


index1: .*
index2: carametallicities
edited_by: nil!~n@monade.li
last_referenced_in: ##c-offtopic
owner: e!e@freenode/staff/spy.edk
ref_user: e!e@freenode/staff/spy.edk
type: text
action:
  caramellular caramellable caramelly caramelliscious carametallic caramelized caramelancholic caramelodramatic caramelodious


index1: .*
index2: cc
action: /call compiler {"nick":"$nick:json","channel":"$channel:json","code":"$args:json"}
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma_
ref_user: nil!~n@monade.li
type: text
help:
  Compiles and executes user-provided code in a number of languages. See https://github.com/pragma-/pbot/blob/master/doc/Modules.md#cc


index1: .*
index2: celebrity
owner: oldlaptop!~quassel@45.63.78.126
ref_user: nobody
type: text
action:
  actor singer musician heir heiress "TV star" "porn star" "adult film performer" "reality star" celebrity


index1: .*
index2: cereal_type
edited_by: marchelzo!~marchelzo@unaffiliated/marchelzo
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "Lucky Charms" "Honey Nut Cheerios" "Cinnamon Toast Crunch" "Raisin Bran" "Corn Flakes" "Trix" "Rice Krispies" "Sugar Puffs"


index1: .*
index2: cgisock
last_referenced_in: izabera
owner: pragma_
ref_user: izabera!~izabera@unaffiliated/izabera
type: text
action:
  See http://www.cyberspace.org/~pfv/libcgisock.html for a nifty little module for the Apache Web Server that allows a browser to connect to programs already loading and running on remote systems via the ubiquitous Unix-Socket.


index1: .*
index2: cheph
last_referenced_in: mhi^
owner: guidj0s
ref_user: mhi^
type: text
action:
  /say 'Cum hoc, ergo propter hoc': the logical fallacy of assuming that correlation implies causality.


index1: .*
index2: chess_move
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c
owner: jp!ayy@youlosethega.me
ref_user: Xatenev!~Xatenev@business-90-187-21-89.pool2.vodafone-ip.de
type: text
action:
  "/say I see your move and counter with $chess_piece to $chess_location." "/say Damn it, I am such a $idiots. I concede. You win." "/say Ha! You have left your $chess_piece exposed! Victory is imminent! I move my $chess_piece to $chess_location." "/say Nice move. My $chess_piece is vulnerable. But wait! I move $chess_piece to $chess_location."


index1: .*
index2: city
edited_by: oldlaptop!~quassel@45.63.78.126
owner: oldlaptop!~quassel@45.63.78.126
ref_user: nobody
type: text
action:
  London Chicago Sydney Detroit Cleveland Kyzyl Beijing Tokyo Nairobi Rome Toulouse Tulsa Tijuana Moscow Istanbul Lagos Brasilia Caracas Osgiliath Gondolin Couruscant Vulcan  Tehran Santiago Bombay Kyoto "Minas Tirith" Vladivostok Fargo Yerevan Nome Ishpeming Tallahassee Dresden Turku Bern Merv Tashkent Novosibirsk Hue Melbourne Lima Valparaiso "Buenos Aires"  Monrovia Thessaloniki Bangkok Sochi Shanghai Sofia Dubrovnik Murmansk Bogota Stanley Beirut "Tel Aviv" Damietta Pondicherry Bamako Casablanca Khartoum Axum Mogadishu Invercargill


index1: .*
index2: clawyer
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c
owner: van7hu
ref_user: aozt!~aozt@unaffiliated/aozt
type: text
action:
  /say The New Hacker's Dictionary defines a language lawyer as "a person who will show you the five sentences scattered through a 200-plus-page manual that together imply the answer to your question 'if only you had thought to look there.'"


index1: .*
index2: cmanpage
edited_by: jp!ayy@youlosethega.me
last_referenced_in: ##c-offtopic
owner: jp!ayy@youlosethega.me
ref_user: oldlaptop!~quassel@45.63.78.126
type: text
action:
  /code perl my @libs = (@ARGV, qw/ c-2.26.90 /); my @funcs = keys %{{ map { $_ => 1; } map { s|^.*\sT\s*(.*)$|$1| && $_ if /\bT\s[^_]/m; } map { split /\n/, `nm -D $_`; } map { s|^.*$|/lib64/lib$&.so|r; } @libs }}; print "$funcs[int rand @funcs]";


index1: .*
index2: cocknana_ingredient
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  condom "$fruit-flavored K&Y jelly" banana "$fruit-flavored condom" butt-plug cock-ring "$stroker_type stroker" "prostate massage kit" "$stroker_type pump" "power glide gel"


index1: .*
index2: codeblocks
last_referenced_in: #pbot2
owner: Jafet
ref_user: kg!~krok@unaffiliated/krok/x-1434802
type: text
action:
  /say Code::Blocks is a fairly popular IDE for C and C++ development. Some folks beef that it has been distributing nightly builds and not releasing stable ones for quite some time now, others like it for this very fact. http://codeblocks.org


index1: .*
index2: coffee_prep
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: k!~krok@unaffiliated/krok
ref_user: nobody
type: text
action:
  brews "brews up" presses boils blends aeropresses percolates filters "pours over" "feeds a small $animals some beans and collects the poop and $coffee_prep" steeps


index1: .*
index2: coffee_standard
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: e!e@freenode/staff/spy.edk
ref_user: nobody
type: text
action:
  $cake_type $muffin_type $cookie_type hazelnut marshmallow caramel "whipped cream" black "French vanilla" fudge mocha $snacks $snacks $snacks $snacks


index1: .*
index2: coffee_type
edited_by: garp!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: #pbot2
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: k!~krok@unaffiliated/krok
type: text
action:
  $$0_ingredient $$0_ingredient $$0_ingredient:pick_unique(2,4):enumerate $$0_ingredient $$0_ingredient $$0_ingredient


index1: .*
index2: comparefloat
last_referenced_in: ##c
owner: pragma_
ref_user: dorp!~dorp@bzq-84-111-138-241.cablep.bezeqint.net
type: text
action:
  /say How to compare floats: http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ -- More information about floats: http://randomascii.wordpress.com/2012/09/09/game-developer-magazine-floating-point/ and http://docs.sun.com/source/806-3568/ncg_goldberg.html


index1: .*
index2: compilable
last_referenced_in: learath2
owner: pragma_
ref_user: Learath2!~learath2@unaffiliated/learath2
type: text
action:
  /say Please paste a *compilable* test-case that exhibits your symptoms.  If the code is incomplete, we cannot discount potential errors or undefined behavior elsewhere in your code, nor can we use our tools to debug.  Please do not waste our time this way.


index1: .*
index2: condiment
edited_by: latch!latch@nat/intel/x-srbjhepzspsxlpka
last_referenced_in: ##c
owner: dave0
ref_user: dave0!~dave@207.213.dsl.syd.iprimus.net.au
type: text
action:
  salt vinegar lemon pepper honey onion garlic mustard chilli relish mayonnaise sauerkraut ketchup peanut-butter nacho-cheese


index1: .*
index2: countries
edited_by: e!e@freenode/staff/spy.edk
owner: ebot-924813!e@freenode/staff/spy.edk
ref_user: nobody
type: text
action:
  Afghanistan Albania Algeria Andorra Angola Antigua Argentina Armenia Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bhutan Bolivia "Bosnia & Herzegovina" Botswana Brazil Brunei Bulgaria Burkina Burundi Cambodia Cameroon Canada "Cape Verde" "Central African Republic" Chad Chile China Colombia Comoros Congo "Costa Rica" Croatia Cuba Cyprus "Czech Republic" Denmark Djibouti Dominica "Dominican Republic" "East Timor" Ecuador Egypt "El Salvador" "Equatorial Guinea" Eritrea Estonia Ethiopia Fiji Finland France Gabon Gambia Georgia Germany Ghana Greece Grenada Guatemala Guinea Guinea-Bissau Guyana Haiti Honduras Hungary Iceland India Indonesia Iran Iraq Ireland Israel Italy "Ivory Coast" Jamaica Japan Jordan Kazakhstan Kenya Kiribati "North Korea" "South Korea" Kosovo Kuwait Kyrgyzstan Laos Latvia Lebanon Lesotho Liberia Libya Liechtenstein Lithuania Luxembourg Macedonia Madagascar Malawi Malaysia Maldives Mali Malta "Marshall Islands" Mauritania Mauritius Mexico Micronesia Moldova Monaco Mongolia Montenegro Morocco Mozambique Myanmar Namibia Nauru Nepal Netherlands "New Zealand" Nicaragua Niger Nigeria Norway Oman Pakistan Palau Panama "Papua New Guinea" Paraguay Peru Philippines Poland Portugal Qatar Romania "Russian Federation" Rwanda "St Kitts & Nevis" "St Lucia" "Saint Vincent & the Grenadines" Samoa "San Marino" "Sao Tome & Principe" "Saudi Arabia" Senegal Serbia Seychelles "Sierra Leone" Singapore Slovakia Slovenia "Solomon Islands" Somalia "South Africa" "South Sudan" Spain "Sri Lanka" Sudan Suriname Swaziland Sweden Switzerland Syria Taiwan Tajikistan Tanzania Thailand Togo Tonga "Trinidad & Tobago" Tunisia Turkey Turkmenistan Tuvalu Uganda Ukraine "United Arab Emirates" "United Kingdom" "United States" Uruguay Uzbekistan Vanuatu "Vatican City" Venezuela Vietnam Yemen Zambia Zimbabwe


index1: .*
index2: covfefe
edited_by: e!e@freenode/staff/spy.edk
help: Have a nice warm cup of covfefe!
last_referenced_in: ##c-offtopic
owner: kg!~krok@unaffiliated/krok/x-1434802
ref_user: nh!NextHendri@unaffiliated/nexthendrix
type: text
action:
  /me $covfefe_prep a $flavor $covfefe_container of $coffee_type covfefe for $args. $covfefe_exclamations


index1: .*
index2: covfefe_exclamations
edited_by: e!e@freenode/staff/spy.edk
last_referenced_in: ##c-offtopic
owner: e!e@enucs/spy.edk
ref_user: fstd!~fstd@unaffiliated/fisted
type: text
action:
  Sad! "An embarrassment to our country!" Disaster! Disgraceful! "Great news!" "PEACE THROUGH STRENGTH!" #DrainTheSwamp "LIES! LIES! LIES!" "This is the best covfefe. All my friends tell me, they say to me, 'This is the best covfefe.' So trust me when I tell you that this is the best covfefe!" "And believe me, I understand covfefe, it's my favorite food, and this is the best." "NO COLLUSION!" "$covfefe_exclamations $covfefe_exclamations" "Sad that crooked Hillary can't accept lost election." "No puppet! You're the puppet!" "MAKE COVFEFE GREAT AGAIN!" "Time to go golfing again!" "What the hell do you have to lose by trying covfefe?" "Now look, a lot of people would say, you know, a lot of really bad things about my covfefe, but I can absolutely guarantee you that those people don't have your best interests at heart." "Failing New York Times gave covfefe a bad review out of jealousy. Sad!" "Lying MSM have nothing better to do than accuse covfefe of causing $rpg_diseases. Sad!" "You're FIRED!" "We've got to keep our covfefe safe. You look at what's happening in $countries. You look at what's happening last night in $countries."  "One of the problems that a lot of people like myself—we have very high levels of intelligence, but we're not necessarily such believers. You look at our air and our covfefe and it's right now at a record clean."  "I hope they now go and take a look at the oranges, the oranges of the covfefe, the beginnings of that covfefe." "Country is FULL!" "Very smart people." "Armed Educators love our students and will protect them."  "LAW & ORDER!"


index1: .*
index2: covfefe_ingredient
edited_by: e!e@freenode/staff/spy.edk
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  crooked "very stable" "like, really smart" WEAK PATHETIC GREAT "Fake News" bigly "the best ingredients" "stable genius" American record-breaking orange strong "very high levels of intelligence" "very great" "born in a wonderful place in $countries" crooked "Deep State" "a big & very inexpensive"  "Far Left" "Do Nothing"


index1: .*
index2: cow
edited_by: jp!ayy@youlosethega.me
last_referenced_in: #pbot2
owner: jp!ayy@youlosethega.me
ref_user: jp!ayy@youlosethega.me
type: text
action:
  /code sh echo $'\x24\x74\x68\x65\x5f\x63\x6f\x77\x20\x3d\x20\x3c\x3c\x22\x45\x4f\x43\x22\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x24\x74\x68\x6f\x75\x67\x68\x74\x73\x20\x20\x20\x5e\x5f\x5f\x5e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x24\x74\x68\x6f\x75\x67\x68\x74\x73\x20\x20\x28\x24\x65\x79\x65\x73\x29\x5c\x5c\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x28\x5f\x5f\x29\x5c\x5c\x20\x20\x20\x20\x20\x20\x20\x29\x5c\x5c\x2f\x5c\x5c\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x24\x74\x6f\x6e\x67\x75\x65\x20\x7c\x7c\x2d\x2d\x2d\x2d\x77\x20\x7c\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7c\x7c\x20\x20\x20\x20\x20\x7c\x7c\x0a\x45\x4f\x43\x0a'


index1: .*
index2: cruelty
edited_by: k!~krok@unaffiliated/krok
last_referenced_in: ##c
owner: kate`
ref_user: kate!~kate@unaffiliated/kate
type: text
action:
  /say Dijkstra - on the Cruelty of Really Teaching Computer Science: http://www.cs.utexas.edu/users/EWD/ewd10xx/EWD1036.PDF


index1: .*
index2: cursive
last_referenced_in: ##c-offtopic
owner: jp!ayy@youlosethega.me
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /code bash printf '%s' "$*" | sed "y/$(printf '%s' {a..z} {A..Z})/𝓪𝓫𝓬𝓭𝓮𝓯𝓰𝓱𝓲𝓳𝓴𝓵𝓶𝓷𝓸𝓹𝓺𝓻𝓼𝓽𝓾𝓿𝔀𝔁𝔂𝔃𝓐𝓑𝓒𝓓𝓔𝓕𝓖𝓗𝓘𝓙𝓚𝓛𝓜𝓝𝓞𝓟𝓠𝓡𝓢𝓣𝓤𝓥𝓦𝓧𝓨𝓩/"


index1: .*
index2: daehateperl
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: kg!~krok@unaffiliated/krok/x-1434802
type: text
action:
  /say DAE hate Perl? So somebody saw some joke code about Perl one-liners being a mix of nonsensical punctuation and now they think all Perl code is like that? It's like if they went to IOCCC and then started being extremely vocal about how all C code is like IOCCC. LEL.


index1: .*
index2: dances
edited_by: nai!~naim@monade.li
last_referenced_in: mhi^
owner: pragma_
ref_user: mhi^
type: text
action:
  "does a slow Fandango" "dances an Irish jig" "does the bunny hop" "does the Macarena" "does the robot" "shakes it like a Polaroid picture" "Charlestons furiously" flosses "starts twerking"


index1: .*
index2: date
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: nil!~n@monade.li
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /code bash
  export TZ=UTC
  if (( $# )) && ! read -r TZ < <(IFS=_; find /usr/share/zoneinfo/posix -type f -iname "*$**" -printf '%P\n' -quit); then
      echo "No match for '$*'." >&2
      exit 1
  fi
  if [[ $TZ != UTC ]]; then
      _city=${TZ##*/}
      echo "It's $(date) in ${_city//_/ }."
  else
      echo "It's $(date)."
  fi


index1: .*
index2: department
owner: oldlaptop!~quassel@45.63.78.126
ref_user: nobody
type: text
action:
  State Treasury War Defence "Homeland Security" "Homeland Insecurity" "Education" "Transportation" "Health and Human Circuses" "Human Resources" "Agriculture" "the Interior" "Energy" "Paper Management" "Sanity Erosion"


index1: .*
index2: dictionaries
last_referenced_in: ##c-offtopic
owner: pragma_
ref_user: nil!~n@monade.li
type: text
action:
  /say I have several dictionaries: dict [DICT protocol, supports multiple dictionaries using -d option; see databases factoid]; gdict [google define:<term> search]; udict [urban dictionary website]; foldoc [aliased to dict -d foldoc]; websters [aliased to dict -d web1913]; wdict [Wikipedia search (case-sensitive and finicky)]


index1: .*
index2: dinner_drinks
owner: e!e@enucs/spy.edk
ref_user: nobody
type: text
action:
  coffee tea cola "cherry cola" beer Kahlua "orange juice" "apple juice" "passionfruit smoothie" "banana milkshake"


index1: .*
index2: dinner_extras
edited_by: garp!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: #pbot2
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: e!e@enucs/spy.edk
type: text
action:
  "with $chain_dishes and $$0_make_drink" "with $chain_dishes and $$0_make_drink" "with $$0_side_dishes and $$0_make_drink"


index1: .*
index2: dinner_make_drink
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: e!e@enucs/spy.edk
ref_user: nobody
type: text
action:
  "a $coffee_container of $coffee_ingredient coffee $coffee_extras" "a $tea_container of $tea_ingredient tea $tea_extras" "a $milkshake_container of $milkshake_ingredient milkshake $milkshake_extras" "a $liquor_container of $liquor_ingredient liquor $liquor_extras"


index1: .*
index2: dinner_side_dishes
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nai!~naim@nai.im
type: text
action:
  "$vegetable_cook_type $vegetable" "$vegetable soup" "garlic bread" croutons coleslaw "apple sauce" flatbread "naan bread" "$sizes fries" "$vegetable_cook_type $vegetable" "$vegetable_cook_type $vegetable" "$vegetable_cook_type $vegetable" $snacks $snacks "a full English breakfast" cheese wine crackers "chicken nuggets" "secret sauce" "a $sandwich" "a $sandwich" "a $sandwich" $dinner_drinks "a stack of pancakes" "miniature sausage rolls" "$salad_types salad" "$salad_types salad" "onion sauce" gravy "$pie_meats sauce" "$vegetable sauce" "dinner rolls" "french bread" "brown rice" "white rice" "rice pilaf" "$vegetable salad" breadsticks cornbread "garden salad" "potato salad" "macaroni salad" "tater tots" "corn on the cob" "onion rings"


index1: .*
index2: doesntwork
last_referenced_in: ##c-offtopic
owner: pragma_
ref_user: k!~krok@unaffiliated/krok
type: text
action:
  /say "It doesn't work!" is not very informative for the people trying to help you.  Please describe what you think may be wrong, what results you expected to get and what instead actually happens.  Pasting a compilable test-case and/or compiler messages to http://ideone.com/ may be helpful.


index1: .*
index2: doppel-spongebob
last_referenced_in: ##c
owner: doppel!~chatzilla@ip70-170-42-83.lv.lv.cox.net
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /code c11 for (int i = 1; i < argc; ++i) { for (int j = 0; argv[i][j]; ++j) { putchar(j % 2 ? tolower(argv[i][j]) : toupper(argv[i][j])); } putchar(' '); }


index1: .*
index2: duffing
last_referenced_in: ##c
owner: kate`
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  writing code from top to bottom, as opposed to horizontally. See http://iq0.com/notes/deep.nesting.html


index1: .*
index2: entrees
edited_by: garp!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: kurahaupo!~kurahaupo@unaffiliated/kurahaupo
type: text
action:
  steak lobster borscht "$entrees $pasta" "$entrees $pasta" "$entrees $pasta" salmon ham turkey chicken "$entrees roast" "baked $entrees" hamburger hot-dog $pizza "chicken wing" "duck breast" "sea bass" "veal sweetbreads" "black cod" quail ribeye scallops lamb "pork chops" "$entrees stir-fry" tilapia beef cod "beef wellington" crab macaroni "$entrees risotto" "lamb chops" "black pudding" jambalaya shrimp crawfish "crab cake" "ham hock" "pig ear" "pig jowl" gumbo "turtle soup" "$burrito_type burrito" "$taco_type taco" "$pie_meats and $vegetable stew" $meat_pies "$pie_meats and beans" "$vegetable_cook_type $pie_meats" "$vegetable_cook_type $pie_meats" "$pie_meats porridge" "$pie_meats stew" "$pie_meats meatloaf" "$entrees casserole" "$entrees pot roast" brisket "$vegetable_cook_type $pie_meats" "$entrees chili" "pulled $pie_meats" "$pie_meats and waffles" "chicken tikka masala" "shepherd's pie" "fish tacos" "$pasta and meatballs" "$vegetable_cook_type ribs" "$vegetable_cook_type $pie_meats" "swordfish steaks" "texas-style smoked brisket" "braised short ribs" "pad thai" "wiener schnitzel" "$vegetable_cook_type bone marrow" "swedish meatballs" "chicken carbonara" "$vegetable ravioli" "$vegetable_cook_type $pie_meats tenderloins" "$vegetable tortellini" "$pie_meats $pasta bake" $pizza "$pie_meats pierogi" "$vegetable bigos" "$nationalities $entrees" "a $nationalities meatball"


index1: .*
index2: errors
last_referenced_in: ##c
owner: pragma_
ref_user: Learath2!~learath2@unaffiliated/learath2
type: text
action:
  /say If you have an error message please paste the actual error message.  Do not say "I have an error in my code."  Please paste the relevant code at http://ideone.com with comments indicating the line numbers and a description of what you're trying to accomplish.  Do not ask to "find the error in my code, plzz".


index1: .*
index2: espdiff
owner: prec
ref_user: nobody
type: text
action:
  a program which applies the appropriate transformation to a patch or set of patches, depending on what you intend to accomplish.


index1: .*
index2: exhort
last_referenced_in: ##c-offtopic
owner: nil!n@monade.li
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /call echo $arg[0] has been exhorted $arg[1:] (exhort id $positive_digits$digits$digits$digits$digits)


index1: .*
index2: factorhs
last_referenced_in: ##c-offtopic
owner: nil!~n@monade.li
ref_user: nh!~NextHendr@unaffiliated/nexthendrix
type: text
action:
  /call hs let sieve (p:ps) = p:sieve [x | x <- ps, x `mod` p /= 0] in let primes = sieve [2..] in let go (p:ps) n = if n == 1 then [] else if n `mod` p == 0 then (p:go (p:ps) (n `div` p)) else go ps n in let printFactors n = putStrLn $ show n ++ ": " ++ intercalate " " (show <$> go primes n) in printFactors


index1: .*
index2: fdist
edited_by: jp!ayy@youlosethega.me
last_referenced_in: k
owner: jp!ayy@youlosethega.me
ref_user: k!~krok@unaffiliated/krok
type: text
action:
  /code perl no warnings; use Exporter; use Carp; use List::Util (); sub distance { my $opt = pop(@_) if @_ > 0&& ref($_[-1]) eq 'HASH'; croak "distance() takes 2 or more arguments" if @_ < 2; my ($_s,@_t)=@_; my @results; $opt = {} if not defined $opt; foreach my $_t (@_t) { push(@results, fastdistance($_s, $_t, $opt)); } return wantarray ? @results :$results[0]; };my $_eq_with_diacritics = sub { my ($_x, $_y) = @_; return $_x eq $_y; }; my $_eq_without_diacritics; sub fastdistance { my $opt = pop(@_); my ($_s, $t) = @_; my (@v0, @v1); my ($_i, $_j); my $_eq; $opt = {} if not defined $opt; if($opt->{ignore_diacritics}) { if (not defined $_eq_without_diacritics) { require Unicode::Collate; my $collator = Unicode::Collate->new(normalization => undef, level => 1); $_eq_without_diacritics = sub { return $collator->eq(@_); }; } $_eq= $_eq_without_diacritics; } else { $_eq = $_eq_with_diacritics; } return 0 if $_s eq $t; return length($_s) if !$t || length($t) == 0; return length($t) if !$_s ||length($_s) == 0; my $_s_length = length($_s); my $t_length = length($t); for ($_i = 0; $_i < $t_length + 1; $_i++) { $v0[$_i] = $_i; } for ($_i = 0; $_i < $_s_length; $_i++) { $v1[0] = $_i + 1; for ($_j = 0; $_j < $t_length; $_j++) { my $cost = $_eq->(substr($_s, $_i, 1), substr($t, $_j, 1)) ? 0 : 1; $v1[$_j + 1] = List::Util::min( $v1[$_j] + 1, $v0[$_j + 1] + 1,$v0[$_j] + $cost,); }for ($_j = 0; $_j < $t_length + 1; $_j++) { $v0[$_j] = $v1[$_j]; } } return $v1[ $t_length]; } { local $, = ", "; print distance(shift @ARGV, @ARGV); }


index1: .*
index2: flavor
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  yummy delicious sublime piquant delectable $colors stochastic yummy delicious delectable sublime yummy delicious delectable sublime smokey coal-fired hoppy smooth creamy dark perfect precise earthy soft delicious sublime yummy scrumptious wonderful excellent acceptable delicious sublime yummy scrumptious wonderful delicious sublime yummy scrumptious wonderful delicious sublime yummy scrumptious wonderful furry $carametallicities comestible $yucky_flavor $weird_flavor


index1: .*
index2: flip
edited_by: k!~krok@unaffiliated/krok
last_referenced_in: nil
owner: k!~krok@unaffiliated/krok
ref_user: nil!~n@monade.li
type: text
action:
  /code bash if [[ ${*,,} == table ]]; then echo (╯°□°）╯︵ ┻━┻ ; else echo $@ | grep -P ^\S+: | awk -F'[:]' {print $1":"} ; echo $@ | sed s/^[^[:space:]]*:// | rev | sed


index1: .*
index2: floating
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c
owner: pragma_
ref_user: AMDG!~AMDG@2600:1702:4210:6c00:e5a6:3448:b80a:755b
type: text
action:
  /say What everybody should know about floating-point arithmetic: http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html and http://randomascii.wordpress.com/2012/09/09/game-developer-magazine-floating-point/


index1: .*
index2: gdb
last_referenced_in: ##c-offtopic
owner: twkm
ref_user: nai!~naim@nai.im
type: text
action:
  /say GDB website: http://www.gnu.org/software/gdb/ - GDB Manual: http://sourceware.org/gdb/current/onlinedocs/gdb/


index1: .*
index2: genwords
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: oldlaptop!~quassel@45.63.78.126
type: text
action:
  /code perl @_vows = qw/$genwords_vowels/; @_cons = qw/$genwords_cons/; $_words = rand (6) + 3; $_sel = 0;  for ($_word = 0; $_word < $_words; $_word++) { @_stuff = (rand() * 2) ? (\@_vows, \@_cons) : (\@_cons, \@_vows); $_len = int rand() * 5 + 2; for ($_c = 0; $_c < $_len; $_c++) { print "$_stuff[$_sel]->[rand(@{$_stuff[$_sel]})]" ; $_sel = !$_sel; } print ' ' ; }


index1: .*
index2: genwords_cons
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "b bl bl bl c ch ch ch d f fr fr fl fl g gl gl gr gr h j k kr kl kl l m n p pl pl pr pr ph ph q r s st t th th th v w"


index1: .*
index2: greenspun
last_referenced_in: ##c-offtopic
owner: mauke
ref_user: nil!~n@monade.li
type: text
action:
  /say Greenspun's Tenth Rule of Programming: "Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp."


index1: .*
index2: grot
last_referenced_in: ##spinach
owner: pragma_
ref_user: jp!ayy@youlosethega.me
type: text
action:
  /say <grot> I remember the relief of waking up one morning (sane) in a hospital bed, after a night of terror after smoking cannbis, having freaked out completely and developed symptoms that went beyond ordinary panic attacks


index1: .*
index2: guesscoding
last_referenced_in: awsumpwner27
owner: Tefaj
ref_user: awsumpwner27!~awsumpwne@wnpgmb0808w-ad04-3-63.dynamic.mtsallstream.net
type: text
action:
  the act of trying to write code without learning the language, or to use a library without reading the documentation. How guesscoders even get anything done is anyone's guess.


index1: .*
index2: gw
last_referenced_in: mhi^
owner: dbtid
ref_user: mhi^
type: text
action:
  /say "Given..Want": What do you have to work with? What's the desired goal? Between them is the resulting Process. Now ask yourself: WHY am I doing this? Why THIS way?


index1: .*
index2: halp
edited_by: jp!ayy@youlosethega.me
last_referenced_in: ##c-offtopic
owner: jp!ayy@youlosethega.me
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /code c11 char *w[]={"eat","drink","sleep","code","poop","boble bath",NULL},*k;srand(time(NULL));size_t n=0;while(w[n]){if((rand()/(float)RAND_MAX)<=(1.0/(n+1)))k=w[n];n++;}puts(k)


index1: .*
index2: herring
last_referenced_in: #cjeopardy
owner: Baughn
ref_user: seanconnery!~HoS@108-79-248-248.lightspeed.cicril.sbcglobal.net
type: text
action:
  a vicious species, loyal only to Baughn. Attempts to wrest control of the Herring Hordes can result in consequences similar to http://fukung.net/v/2833/15cod.jpg .


index1: .*
index2: hex
edited_by: k!~krok@unaffiliated/krok
last_referenced_in: ##c-offtopic
owner: alyptik!ayy@youlosethega.me
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /code c11 for (int i = 1; i < argc; i++) for (size_t j = 0; j < strlen(argv[i]); j++) printf("0x%x ", argv[i][j]);


index1: .*
index2: hexb
edited_by: jp!ayy@youlosethega.me
last_referenced_in: #pbot2
owner: jp!ayy@youlosethega.me
ref_user: k!~krok@unaffiliated/krok
type: text
action:
  /code zsh  print -nr - ${$(printf "%s" '$args' | tr -d '[ \t]')// /} | od -tx1 | sed 's/^[0-9]* //;$ d;s/^/ /;s/ /\\x/g;s/^ //'


index1: .*
index2: hexc
edited_by: jp!ayy@youlosethega.me
last_referenced_in: jp
owner: jp!ayy@youlosethega.me
ref_user: jp!ayy@youlosethega.me
type: text
action:
  /code zsh print -nr - '$args' | od -tx1 | sed 's/^[0-9]* //;$ d;s/^/ /;s/ /\\x/g;s/\\/, 0/g;s/^, /{/; s/$/}/' | perl -pe 's/$/ / if not eof; chomp';


index1: .*
index2: hexcat
last_referenced_in: jp
owner: alyptik!ayy@youlosethega.me
ref_user: jp!ayy@youlosethega.me
type: text
action:
  /code zsh print "/say "; cat "$@" | od -tx1 | sed 's/^[0-9]* //;$ d;s/^/ /;s/ /\\x/g;s/\\/ 0/g;s/^ //' | perl -pe 's/$/ / if not eof; chomp'


index1: .*
index2: hi_phrases
edited_by: nai!~naim@monade.li
owner: pragma_
ref_user: dav7
type: text
action:
  "Well, hello there" "Hi there" "Hey, what's up" Hola Hi Hello "Que pasa" "How are you doing" "How's it going"


index1: .*
index2: hit
edited_by: e!e@enucs/spy.edk
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nil!~n@monade.li
type: text
action:
  /code perl $_r = ""; if ("$nick" eq "atk") { $_r = q{$rpg_crit_fail}; } elsif (q{$args} eq "atk") { $_r = q{$rpg_crit}; } else { $_r = q{$rpg_swing}; } print $_r;


index1: .*
index2: homework
last_referenced_in: floatcomplex
owner: kate`
ref_user: floatcomplex!~floatcomp@97-113-240-20.tukw.qwest.net
type: text
action:
  /say We can help with homework, as long as it's within the spirit of the assignment. We won't do it for you, though. Ask questions such as "Why is it that ... ?" rather than "Show me how to ..."


index1: .*
index2: house
last_referenced_in: ##c-offtopic
owner: pragma_
ref_user: nil!~n@monade.li
type: text
action:
  /say What you're attempting is akin to an apprentence carpenter attempting to construct an entire house without having learned how to measure.  In other words, there will be a lot of holes -- if the entire contraption doesn't fall apart completely.


index1: .*
index2: how_answers
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: masoudd
owner: pragma_
ref_user: masoudd!~masoudd@5.112.116.98
type: text
action:
  "I don't know." "If you investigate a $sizes amount further, you can figure it out." "Are you thinking clearly?" "Are you sure you're not a $sizes $idiots?" "Read the $manuals:global, you $sizes $idiots."


index1: .*
index2: hs
edited_by: nil!~n@monade.li
last_referenced_in: ##c-offtopic
owner: nil!~n@monade.li
ref_user: nil!~n@monade.li
type: text
action:
  /call bash { printf ':set -XArrows -XBangPatterns -XBinaryLiterals -XBlockArguments -XConstraintKinds -XDataKinds -XDeriveTraversable -XDerivingVia -XEmptyCase -XEmptyDataDecls -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralisedNewtypeDeriving -XLambdaCase -XLiberalTypeSynonyms -XMonadComprehensions -XMultiWayIf -XNamedFieldPuns -XNumericUnderscores -XOverloadedLists -XOverloadedStrings -XPatternSynonyms -XPolyKinds -XRankNTypes -XRecordWildCards -XRecursiveDo -XScopedTypeVariables -XStandaloneDeriving -XTupleSections -XTypeApplications -XTypeOperators -XUnicodeSyntax -XViewPatterns\n:m Prelude Control.Applicative Control.Arrow Control.Monad Data.Bifunctor Data.Bool Data.Char Data.Complex Data.Either Data.Foldable Data.Function Data.Functor Data.List Data.Maybe Data.Monoid Data.Ratio Data.Semigroup Data.String Data.Traversable Data.Tuple Data.Void System.IO System.Exit System.Environment System.Random Text.Read\n'; cat; } | ghci -v0 -stdin


index1: .*
index2: hugs_responses
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma_
ref_user: nobody
type: text
action:
  tickles "winks at" "blushes at" "bats its eyes at" hugs kisses slaps "frowns at" "wiggles its butt at" "giggles at" "blushes at" "vomits on" "smiles at" "wrinkles its nose at" "rolls its eyes at"


index1: .*
index2: human_adjectives
edited_by: oldlaptop!~quassel@45.63.78.126
last_referenced_in: ##c-offtopic
owner: oldlaptop!~quassel@45.63.78.126
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  "" distinguished infamous controversial well-known obscure famous notorious "terminally ill" "utterly irrelevant" "important" "unimportant" degenerate noxious ridiculous brilliant clever interesting fascinating boring weird funny hilarious


index1: .*
index2: icicle-binfmt
owner: Cheery
ref_user: nobody
type: text
action:
  rudimentary program loader with system libraries included. See: https://github.com/cheery/icicle-binfmt See Also: http://en.wikipedia.org/wiki/Loader_(computing)


index1: .*
index2: idiots
edited_by: e!e@freenode/staff/spy.edk
last_referenced_in: ##c-offtopic
owner: pragma_
ref_user: christopher!NextHendri@unaffiliated/nexthendrix
type: text
action:
  moron knucklehead dolt half-wit retard idiot chowderhead idiot dotard fool Cro-Magnon chucklehead goofball Dummkopf clown imbecile doofus bozo pendejo "intellectual lightweight" dodo ditz putz schmuck dunce "vir simplex" "virgo simplex" simpleton crétin booby twit pillock plonker


index1: .*
index2: insults
last_referenced_in: ##c-offtopic
owner: cr1t1cal!~chiken@60-242-215-61.static.tpgi.com.au
ref_user: Aequus!~Aequus@132.ip-51-254-37.eu
type: text
action:
  "your mum circulates like a public key, servicing more requests than HTTP." "if your mom was a collection class, her insert method would be public." "you're so lame you could encode mp3's." "keep trying; fizzbuzz isn't that hard." "what do you and structs have in common? No class." "your code is so wretched the cache invalidates as it loads it."


index1: .*
index2: interractions
owner: oldlaptop!~quassel@45.63.78.126
ref_user: nobody
type: text
action:
  "/me points the lamp in $args's face" "/me tips the plank into the bucket" "/me gives the rack another turn" "/me applies a rubber hose to $args's lower extremities" "/me hits $args in the face" "/me glares at $args menacingly" "/me looks kindly at $args" "/me fidgets with its knife"


index1: .*
index2: interrogatories
edited_by: oldlaptop!~quassel@45.63.78.126
last_referenced_in: ##c-offtopic
owner: oldlaptop!~quassel@45.63.78.126
ref_user: oldlaptop!~quassel@45.63.78.126
type: text
action:
  "Where were you last Monday morning at 3:00?!" "Who paid you? Speak up!" "Who are you working for?" "What is your mission on this planet, extraterrestrial scum?!" "You can't hide the truth!" "We have ways of making you talk..." "LOOK AT ME WHEN I'M TALKING TO YOU!"


index1: .*
index2: itsatrap
owner: pragma_
ref_user: pragma_
type: text
action:
  http://www.dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/90000/2000/700/92768/92768.strip.sunday.gif


index1: .*
index2: japan
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: kg!~krok@unaffiliated/krok/x-1434802
ref_user: nitrix!~nitrix@haskell/developer/nitrix
type: text
action:
  /code perl no warnings; for(@ARGV){$_t=$_;s/the/da/gi;s/p/pu/i;s/[ae]r/ah/gi;s/l/r/gi;s/([dkg])([^a-z]*$)$/$1u$2/gi;s/th/d/gi;s/ore/aw/gi;s/([vw][ei]+[^r])/$1r/gi;s/cce/kushu/gi;s/cc/ss/gi;s/(f|d)([^a-z]?)$/$1a$2/gi;s/(?<!g)re/ru/gi;s/([nrt])([^a-z]?)$/$1o$2/gi;s/orta/tur/gi;s/is/isu/gi;s/ow/aw/gi;s/^f(?=[^r])/fr/gi;s/(?<=\S\S\S)to$/tosaki/gi;s/augh/aff/gi;s/es/o/gi;s/^co/ko/i;s/awa/arra/gi;if($_t=~/.[A-Z]/){$_=uc$_}if($_t=~/^[A-Z]/){s/(^.)/\U$1/;}print$_," "}


index1: .*
index2: japanold
edited_by: alyptik!ayy@youlosethega.me
last_referenced_in: ##c-offtopic
owner: alyptik!ayy@youlosethega.me
ref_user: garp!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  {"/say ". join " ", map {s/l/r/gr} map { s/(?<=[aeiou])s(?=[ \!\,\.?])/tsu/gr; } map { s/g?(h+)(?=[\!\,\.?])/\1uro/gr; } map { s/l+(?=[ \!\,\.?])/rru/gr; } map { s/l(?=[^ \!\,\.?])/r/gr; } map { s/(?<![ \!\?\,\.aeiouy])([srpgt]+)(?=[ \.\!\?\,])/\1u/gr; } map { s/(?<=[ \!\?\,\.aeiouy])([dzmtnr]+)(?=[ \.\!\?\,])/\1o/gr; } map { s/c+([ee])/kush\1/gr;} map { s/c+([aeiou])/k\1/gr; } lc join " ", @args}


index1: .*
index2: joke
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: kg!~krok@unaffiliated/krok/x-1434802
ref_user: nil!~n@monade.li
type: text
action:
  /call cc if (strcmp("$args", "$nick")) puts("$args:"); char joke[420]; fgets(joke, sizeof joke, stdin); puts(joke);


index1: .*
index2: jpee
edited_by: jp!ayy@youlosethega.me
last_referenced_in: ##c-offtopic
owner: jp!ayy@youlosethega.me
ref_user: k!~krok@unaffiliated/krok
type: text
action:
  /code perl use bytes; my @_a=map{ord($_)-ord(uc($_))}split('',join(' ',@ARGV)); my ($_i,$_x) = (0,lc(shift @ARGV//'a')); print '/say'; print s/$_x/' '.join('',map{chr(ord(uc($_))+($_a[$_i++]?$_a[$_i]:0))}split('','penis'))/reggi for @ARGV


index1: .*
index2: jpnym
edited_by: jp!ayy@youlosethega.me
last_referenced_in: ##c-offtopic
owner: jp!ayy@youlosethega.me
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /code perl chomp(my @arr = `cat /usr/share/dict/words`); print $arr[rand $#arr] . q/ / for 1 .. ($ARGV[0] // 1)


index1: .*
index2: jsed
edited_by: jp!ayy@youlosethega.me
last_referenced_in: ##c-offtopic
owner: jp!ayy@youlosethega.me
ref_user: jp!ayy@youlosethega.me
type: text
action:
  /code bash bash -c $'\x6c\x6f\x6c\x28\x29\x20\x7b\x20\x3c\x3c\x3c\x22\x24\x2a\x22\x20\x70\x65\x72\x6c\x20\x2d\x70\x65\x20\x22\x73\x2f\x5c\x51\x24\x28\x3c\x3c\x3c\x24\x30\x20\x20\x74\x72\x20\x2d\x64\x63\x20\x22\x5b\x3a\x61\x6c\x6e\x75\x6d\x3a\x5d\x22\x29\x5c\x45\x2f\x70\x65\x6e\x69\x73\x2f\x67\x69\x22\x3b\x20\x7d\x3b\x20\x6c\x6f\x6c\x20\x22\x24\x40\x22' "$@"


index1: .*
index2: koohii
edited_by: kg!~krok@unaffiliated/krok/x-1434802
last_referenced_in: ##c-offtopic
owner: kg!~krok@unaffiliated/krok/x-1434802
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /code perl no warnings;  if (@ARGV < 2 or $ARGV[0] =~ /'s$/ or $ARGV[0] =~ /^(?:these|this|that|those)$/i) {$_t="/me brews up a $flavor cup of $coffee_type $0 for $args"}else{$_t="/me brews up a $flavor cup of $coffee_type $0 $args"}@args=split(/ /, $_t);for(@args){$t=$_;s/the/da/gi;s/p/pu/i;s/[ae]r/ah/gi;s/l/r/gi;s/([dkg])([^a-z]*$)$/$1u$2/gi;s/th/d/gi;s/ore/aw/gi;s/([vw][ei]+[^r])/$1r/gi;s/cce/kushu/gi;s/cc/ss/gi;s/(f|d)([^a-z]?)$/$1a$2/gi;s/(?<!g)re/ru/gi;s/([nrt])([^a-z]?)$/$1o$2/gi;s/orta/tur/gi;s/is/isu/gi;s/ow/aw/gi;s/^f(?=[^r])/fr/gi;s/uto$/utosaki/gi;s/es/o/gi;s/^co/ko/i;s/awa/arra/gi;if($t=~/.[A-Z]/){$_=uc$_}if($t=~/^[A-Z]/){s/(^.)/\U$1/;}print$_," "}


index1: .*
index2: kpenify
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: k!~krok@unaffiliated/krok
ref_user: k!~krok@callipygian.life
type: text
action:
  /code perl

  no warnings;

  my $_a = "@ARGV";
  my $_b = "@ARGV";

  $_a =~ s/\s*<!penis!>.*$//ms;
  $_b =~ s/^.*?<!penis!>\s*//ms;

  $_a =~ s/(?:(?<=\s)|(?<=^))-(?!m)[[:alpha:]]+\s*\S+\s*//gms;
  $_a =~ s/(?:(?<=\s)|(?<=^))-m\w+//gms;
  $_a =~ s/(?:(?<=\s)|(?<=^))-m\s+\w+//gms;
  $_a =~ s/^\s*(.*?)\s*$/$1/gms;
  $_b =~ s|(\Q$_a\E)|$1=~/^[A-Z][^A-Z]/?"Penis":($1=~/^[A-Z]+$/?"PENIS":"penis")|gie;

  $_d = $_b;

  while ($_d=~/(?:like(?: a|the| that| those)?|e.?g.?|example|instance|by(?: a| the| that| those| its)?|results in|such as|whose),?\s+(\w{3,})/gms) {
    $_c=$1;$_c=~s/(?<![aeiou])s$//ms;
    $_b=~s|($_c)|$1=~/^[A-Z][^A-Z]/?"Wang":($1=~/^[A-Z]+$/?"WANG":"wang")|gie;
  }

  $_b=~s|(peniss)| $1 =~ /^[A-Z][^A-Z]/ ? "Penises" : ($1 =~ /^[A-Z]+$/ ? "PENISES" : "penises")|gie;
  $_b=~s|(penisd)| $1 =~ /^[A-Z][^A-Z]/ ? "Dicked" : ($1 =~ /^[A-Z]+$/ ? "DICKED" : "dicked")|gie;
  $_b=~s,(big|huge|massive|small|tiny), $1 =~ /^[A-Z][^A-Z]/ ? "Engorged" : ($1 =~ /^[A-Z]+$/ ? "ENGORGED" : "engorged"),gie;
  $_b=~s|(penisns)| $1 =~ /^[A-Z][^A-Z]/ ? "Penises" : ($1 =~ /^[A-Z]+$/ ? "PENISES" : "penises")|gie;
  $_b=~s|(penis\w\b)| $1 =~ /^[A-Z][^A-Z]/ ? "Penis" : ($1 =~ /^[A-Z]+$/ ? "PENIS" : "penis")|gie;
  $_b=~s|(an)\s+(?=penis)| $1 =~ /^[[:upper:]]/ ? "A " : "a "|gie;

  print $_b


index1: .*
index2: kpenifyold
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: bungey
owner: k!~krok@unaffiliated/krok
ref_user: bungey!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /code perl use warnings;my$_a="@ARGV";$_a=~s/\s*<!magic!>.*$//ms;my$_b="@ARGV";$_b=~s/^.*?<!magic!>\s*//ms;$_a=~s/(?:(?<=\s)|(?<=^))-(?!m)[[:alpha:]]+\s*\S+\s*//gms;$_a=~s/(?:(?<=\s)|(?<=^))-m\w+//gms;$_a=~s/(?:(?<=\s)|(?<=^))-m\s+\w+//gms;$_a=~s/^\s*(.*?)\s*$/$1/gms;$_b=~s|(\Q$_a\E)|$1=~/^[A-Z][^A-Z]/?"Penis":($1=~/^[A-Z]+$/?"PENIS":"penis")|gie;$_d=$_b;while($_d=~/(?:like(?:a| the| that| those)?|e.?g.?|example|instance|by(?: a| the| that| those| its)?|results in|such as|whose),?\s+(\w{3,})/gms){$_c=$1;$_c=~s/(?<![aeiou])s$//ms;$_b=~s|($_c)|$1=~/^[A-Z][^A-Z]/?"Wang":($1=~/^[A-Z]+$/?"WANG":"wang")|gie;}$_b=~s|(peniss)|$1=~/^[A-Z][^A-Z]/?"Penises":($1=~/^[A-Z]+$/?"PENISES":"penises")|gie;$_b=~s|(penisd)|$1=~/^[A-Z][^A-Z]/?"Dicked":($1=~/^[A-Z]+$/?"DICKED":"dicked")|gie;$_b=~s,(big|huge|massive|small|tiny),$1=~/^[A-Z][^A-Z]/?"Engorged":($1=~/^[A-Z]+$/?"ENGORGED":"engorged"),gie;$_b=~s|(penisns)|$1=~/^[A-Z][^A-Z]/?"Penises":($1=~/^[A-Z]+$/?"PENISES":"penises")|gie;$_b=~s|(penis\w\b)|$1=~/^[A-Z][^A-Z]/?"Penis":($1=~/^[A-Z]+$/?"PENIS":"penis")|gie;$_b=~s|(an)\s+(?=penis)|$1=~/^[[:upper:]]/?"A ":"a "|gie;print$_b


index1: .*
index2: lactobacillus
owner: korans!~korans@83.137.252.187
ref_user: nobody
type: text
action:
  In women of European ancestry, Lactobacillus species are normally a major part of the vaginal microbiota.


index1: .*
index2: leak
last_referenced_in: ##c
owner: beco!~beco@unaffiliated/beco
ref_user: hypnopothesis!~hypnopoth@nuglyfe.com
type: text
action:
  /say A memory leak occurs when a dynamically allocated memory is left without the free() counterpart being called. Valgrind is a tool to check memory leaks.


index1: .*
index2: line
last_referenced_in: ##c-offtopic
owner: prec
ref_user: kurahaupo!~kurahaupo@unaffiliated/kurahaupo
type: text
action:
  a sequence of characters terminated by a newline sequence ('\n' in C, CRLF in various Internet protocols).


index1: .*
index2: liquor_extras
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "with $olives" "with a cute umbrella" "with a plastic sword stabbing a $fruit" "with a wedge of $fruit" "on the rocks" "with salt around the rim" "$liquor_extras $liquor_extras" "" "" "$liquor_extras $liquor_extras" "$liquor_extras $liquor_extras" "with $dashes of bitters"


index1: .*
index2: liquor_prep
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "shakes, not stirs," "tosses bottles in the air and prepares" "mixes up" "shakes up" "stirs up" blends pours


index1: .*
index2: literally
last_referenced_in: ##c-offtopic
owner: nil!~n@monade.li
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /code bash sed -E 's/\b(a|the)\b/\1 literal/g;s/\b(to|is|be|am|are|i|you|he|she|they)\b/\1 literally/g' <<< "$*"


index1: .*
index2: literallyrng
edited_by: nil!~n@monade.li
last_referenced_in: ##c-offtopic
owner: nil!~n@monade.li
ref_user: nil!~n@monade.li
type: text
action:
  /code bash read -ra ws<<<"$*";for w in "${ws[@]}";do printf '%s ' "\$w";((RANDOM%100<$literal_proba))&&case ${w,,} in a|an|the|my|your|his|another)printf 'literal ';;i|you|he|she|is|are|be|will|to)printf 'literally ';;esac;done


index1: .*
index2: lto
last_referenced_in: ##c-offtopic
owner: zumbi
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  /say Link-time optimization is a type of program optimization performed by a compiler to a program at link time. Link time optimization occurs in programming languages that compile programs on a file-by-file basis (such as C and Fortran), rather than all at once (such as Java).


index1: .*
index2: lynch
last_referenced_in: #pbot2
owner: k!~krok@unaffiliated/krok
ref_user: k!~krok@unaffiliated/krok
type: text
action:
  /say The crowd is mumbling. Pitchforks are starting to come out. Things are not looking good for $args.


index1: .*
index2: muffin_type
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: prgm-!~chaos@unaffiliated/pragmatic-chaos
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  bran blueberry "poppy seed" "chocolate chip" "banana chocolate chip" "walnut and coffee" "banana nut" lemon pumpkin banana english strawberry


index1: .*
index2: murphy
last_referenced_in: pragma-
owner: pragma_
ref_user: pragma-
type: text
action:
  /say If there's more than one possible outcome of a job or task, and one of those outcomes will result in disaster or an undesirable consequence, then somebody will do it that way.


index1: .*
index2: naptime16p0
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nobody
type: text
action:
  HelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorld!!


index1: .*
index2: naptime16p1
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nobody
type: text
action:
  $naptime16p0$naptime16p0$naptime16p0$naptime16p0$naptime16p0$naptime16p0$naptime16p0$naptime16p0$naptime16p0$naptime16p0$naptime16p0$naptime16p0$naptime16p0$naptime16p0$naptime16p0$naptime16p0


index1: .*
index2: naptime16p2
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nobody
type: text
action:
  $naptime16p1$naptime16p1$naptime16p1$naptime16p1$naptime16p1$naptime16p1$naptime16p1$naptime16p1$naptime16p1$naptime16p1$naptime16p1$naptime16p1$naptime16p1$naptime16p1$naptime16p1$naptime16p1


index1: .*
index2: naptime16p3
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nobody
type: text
action:
  $naptime16p2$naptime16p2$naptime16p2$naptime16p2$naptime16p2$naptime16p2$naptime16p2$naptime16p2$naptime16p2$naptime16p2$naptime16p2$naptime16p2$naptime16p2$naptime16p2$naptime16p2$naptime16p2


index1: .*
index2: naptime16p4
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nobody
type: text
action:
  $naptime16p3$naptime16p3$naptime16p3$naptime16p3$naptime16p3$naptime16p3$naptime16p3$naptime16p3$naptime16p3$naptime16p3$naptime16p3$naptime16p3$naptime16p3$naptime16p3$naptime16p3$naptime16p3


index1: .*
index2: naptime16p5
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nobody
type: text
action:
  $naptime16p4$naptime16p4$naptime16p4$naptime16p4$naptime16p4$naptime16p4$naptime16p4$naptime16p4$naptime16p4$naptime16p4$naptime16p4$naptime16p4$naptime16p4$naptime16p4$naptime16p4$naptime16p4


index1: .*
index2: naptime16p6
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nobody
type: text
action:
  $naptime16p5$naptime16p5$naptime16p5$naptime16p5$naptime16p5$naptime16p5$naptime16p5$naptime16p5$naptime16p5$naptime16p5$naptime16p5$naptime16p5$naptime16p5$naptime16p5$naptime16p5$naptime16p5


index1: .*
index2: naptime16p7
last_referenced_in: ##c-offtopic
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nil!~n@monade.li
type: text
action:
  $naptime16p6$naptime16p6$naptime16p6$naptime16p6$naptime16p6$naptime16p6$naptime16p6$naptime16p6$naptime16p6$naptime16p6$naptime16p6$naptime16p6$naptime16p6$naptime16p6$naptime16p6$naptime16p6


index1: .*
index2: naptime16p8
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nobody
type: text
action:
  $naptime16p7$naptime16p7$naptime16p7$naptime16p7$naptime16p7$naptime16p7$naptime16p7$naptime16p7$naptime16p7$naptime16p7$naptime16p7$naptime16p7$naptime16p7$naptime16p7$naptime16p7$naptime16p7


index1: .*
index2: naptime16p9
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nobody
type: text
action:
  $naptime16p8$naptime16p8$naptime16p8$naptime16p8$naptime16p8$naptime16p8$naptime16p8$naptime16p8$naptime16p8$naptime16p8$naptime16p8$naptime16p8$naptime16p8$naptime16p8$naptime16p8$naptime16p8,factadd global naptime16pA $naptime16p9$naptime16p9$naptime16p9$naptime16p9$naptime16p9$naptime16p9$naptime16p9$naptime16p9$naptime16p9$naptime16p9$naptime16p9$naptime16p9$naptime16p9$naptime16p9$naptime16p9$naptime16p9


index1: .*
index2: naptime16pb
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nobody
type: text
action:
  $naptime16pA$naptime16pA$naptime16pA$naptime16pA$naptime16pA$naptime16pA$naptime16pA$naptime16pA$naptime16pA$naptime16pA$naptime16pA$naptime16pA$naptime16pA$naptime16pA$naptime16pA$naptime16pA


index1: .*
index2: naptime16pc
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nobody
type: text
action:
  $naptime16pB$naptime16pB$naptime16pB$naptime16pB$naptime16pB$naptime16pB$naptime16pB$naptime16pB$naptime16pB$naptime16pB$naptime16pB$naptime16pB$naptime16pB$naptime16pB$naptime16pB$naptime16pB


index1: .*
index2: naptime16pd
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nobody
type: text
action:
  $naptime16pC$naptime16pC$naptime16pC$naptime16pC$naptime16pC$naptime16pC$naptime16pC$naptime16pC$naptime16pC$naptime16pC$naptime16pC$naptime16pC$naptime16pC$naptime16pC$naptime16pC$naptime16pC


index1: .*
index2: naptime16pe
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nobody
type: text
action:
  $naptime16pD$naptime16pD$naptime16pD$naptime16pD$naptime16pD$naptime16pD$naptime16pD$naptime16pD$naptime16pD$naptime16pD$naptime16pD$naptime16pD$naptime16pD$naptime16pD$naptime16pD$naptime16pD


index1: .*
index2: naptime16pf
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nobody
type: text
action:
  $naptime16pE$naptime16pE$naptime16pE$naptime16pE$naptime16pE$naptime16pE$naptime16pE$naptime16pE$naptime16pE$naptime16pE$naptime16pE$naptime16pE$naptime16pE$naptime16pE$naptime16pE$naptime16pE


index1: .*
index2: naptime16pg
owner: naptime!~naptime@unaffiliated/naptime
ref_user: nobody
type: text
action:
  $naptime16pF$naptime16pF$naptime16pF$naptime16pF$naptime16pF$naptime16pF$naptime16pF$naptime16pF$naptime16pF$naptime16pF$naptime16pF$naptime16pF$naptime16pF$naptime16pF$naptime16pF$naptime16pF


index1: .*
index2: naptimekillcandide
last_referenced_in: #pbot2
owner: naptime!~naptime@unaffiliated/naptime
ref_user: naptime!~naptime@unaffiliated/naptime
type: text
action:
  $naptime16pG$naptime16pG$naptime16pG$naptime16pG$naptime16pG$naptime16pG$naptime16pG$naptime16pG$naptime16pG$naptime16pG$naptime16pG$naptime16pG$naptime16pG$naptime16pG$naptime16pG$naptime16pG


index1: .*
index2: nationalities
edited_by: ebot-924813!e@freenode/staff/spy.edk
owner: ebot-924813!e@freenode/staff/spy.edk
ref_user: nobody
type: text
action:
  Afghan Albanian Algerian American Andorran Angolan Antiguan Argentinean Armenian Australian Austrian Azerbaijani Bahamian Bahraini Bangladeshi Barbadian Barbudan Batswana Belarusian Belgian Belizean Beninese Bhutanese Bolivian Bosnian Brazilian British Bruneian Bulgarian Burkinabe Burmese Burundian Cambodian Cameroonian Canadian "Cape Verdean"  "Central African" Chadian Chilean Chinese Colombian Comoran Congolese "Costa Rican" Croatian Cuban Cypriot Czech Danish Djibouti Dominican Dutch "East Timorese" Ecuadorean Egyptian Emirian "Equatorial Guinean" Eritrean Estonian Ethiopian Fijian Filipino Finnish French Gabonese Gambian Georgian German Ghanaian Greek Grenadian Guatemalan Guinea-Bissauan Guinean Guyanese Haitian Herzegovinian Honduran Hungarian I-Kiribati Icelander Indian Indonesian Iranian Iraqi Irish Israeli Italian Ivorian Jamaican Japanese Jordanian Kazakhstani Kenyan Kittian Kuwaiti Kyrgyz Laotian Latvian Lebanese Liberian Libyan Liechtensteiner Lithuanian Luxembourger Macedonian Malagasy Malawian Malaysian Maldivian Malian Maltese Marshallese Mauritanian Mauritian Mexican Micronesian Moldovan Monacan Mongolian Moroccan Mosotho Motswana Mozambican Namibian Nauruan Nepalese Nevisian "New Zealander" Ni-Vanuatu Nicaraguan Nigerian Nigerien "North Korean" "Northern Irish" Norwegian Omani Pakistani Palauan Panamanian "Papua New Guinean" Paraguayan Peruvian Polish Portuguese Qatari Romanian Russian Rwandan "Saint Lucian"  Salvadoran Samoan "San Marinese" "Sao Tomean" Saudi Scottish Senegalese Serbian Seychellois "Sierra Leonean" Singaporean Slovakian Slovenian "Solomon Islander" Somali "South African" "South Korean" Spanish "Sri Lankan" Sudanese Surinamer Swazi Swedish Swiss Syrian Taiwanese Tajik Tanzanian Thai Tobagonian Togolese Tongan Trinidadian Tunisian Turkish Tuvaluan Ugandan Ukrainian Uruguayan Uzbekistani Venezuelan Vietnamese Welsh Yemenite Zambian Zimbabwean


index1: .*
index2: nazi
last_referenced_in: nai
owner: alyptik!ayy@youlosethega.me
ref_user: nai!~naim@nai.im
type: text
action:
  /say Ze Standard C haz none of zis notion ofz '$args', soz you must be talking about ze specific OS, ze library, ze tool, zis implementationz, ze architecture, zetz cetera. Zese' are beyond ze scope of zis channel, which focuses on ze Standard C.


index1: .*
index2: news
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: oldlaptop!~quassel@45.63.78.126
ref_user: e!e@freenode/staff/spy.edk
type: text
action:
  /call echo $newsheaders a $news_idiot has been $news_seen $news_idiot_action $news_near $city. $news_quote $news_yapper, "$news_comment"


index1: .*
index2: news_comment
edited_by: oldlaptop!~quassel@45.63.78.126
owner: oldlaptop!~quassel@45.63.78.126
ref_user: nobody
type: text
action:
  $covfefe_exclamations "It's the most disgusting thing I've ever seen." "There goes the neighborhood." "This $news_comment_proves that we must $news_we_must_action $news_cause." "I've never seen anything like it." "IT BURNS!" "This is the first good thing that's happened $happenee in $time_period!" "Good! It's about time someone showed that $news_idiot who's boss!" "We all suspected this, but it's still shocking to see it in person." "This is all well and good, but I'm concerned with $news_topic."  "But what about $news_topic?"


index1: .*
index2: news_crime
owner: oldlaptop!~quassel@45.63.78.126
ref_user: nobody
type: text
action:
  robbery murder massacre "bank robbery" bombing "car accident" "twenty-seven car pileup" hit-n-run embezzling heist


index1: .*
index2: news_event
edited_by: oldlaptop!~quassel@45.63.78.126
owner: oldlaptop!~quassel@45.63.78.126
ref_user: nobody
type: text
action:
  "campaign rally" "speech on $news_topic" "fundraiser $for_against $news_topic" "cocktail party" "dinner party" rave


index1: .*
index2: news_idiot
edited_by: oldlaptop!~quassel@45.63.78.126
last_referenced_in: ##c-offtopic
owner: oldlaptop!~quassel@45.63.78.126
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  "$animal_adjectives $animal_types" "$human_adjectives $politician" "$human_adjectives $celebrity" "$human_adjectives $randomnick" "$human_adjectives $idiots"


index1: .*
index2: news_idiot_action
edited_by: oldlaptop!~quassel@45.63.78.126
owner: oldlaptop!~quassel@45.63.78.126
ref_user: nobody
type: text
action:
  $news_verbing  "$at_news_event a $news_event" "running for $news_office" "in a compromising position with a $news_idiot" "fleeing the scene of a $news_crime" "$topical_action $news_topic" "$topical_action $news_topic"


index1: .*
index2: news_near
edited_by: oldlaptop!~quassel@45.63.78.126
owner: oldlaptop!~quassel@45.63.78.126
ref_user: nobody
type: text
action:
  near near near in in in around  "in proximity to" "$news_near the suburbs of" "not far from" "close to"  "on the outskirts of"


index1: .*
index2: news_office
owner: oldlaptop!~quassel@45.63.78.126
ref_user: nobody
type: text
action:
  President Congress Parliament dogcatcher mayor council "city council" "town council" "school board" "library board" "class president" "homeowner's association chair"


index1: .*
index2: news_topic
edited_by: oldlaptop!~quassel@45.63.78.126
owner: oldlaptop!~quassel@45.63.78.126
ref_user: nobody
type: text
action:
  "$politicist $politics" "$animal_types rights" "the $animal_types problem" "some foolishness" "fine literature" "$idiots literature" "fake news" "$idiots $politics"


index1: .*
index2: news_verbing
edited_by: oldlaptop!~quassel@45.63.78.126
owner: oldlaptop!~quassel@45.63.78.126
ref_user: nobody
type: text
action:
  speechifying speaking "babbling" protesting "eating a $snacks" drinking smoking "shooting up" joking hiding working eating


index1: .*
index2: news_yapper
edited_by: oldlaptop!~quassel@45.63.78.126
owner: oldlaptop!~quassel@45.63.78.126
ref_user: nobody
type: text
action:
  "this reporter" "our source" "an unnamed source" "$org" "a witness" "a nearby $news_idiot" \$randomnick


index1: .*
index2: nickreg
last_referenced_in: sandman13
owner: pragma_
ref_user: sandman13!~sandman13@unaffiliated/sandman13
type: text
action:
  /say In order to speak in this channel, you must register your IRC nick-name through NickServ.  See `/msg nickserv help register` or follow the guide at http://www.wikihow.com/Register-a-User-Name-on-Freenode


index1: .*
index2: noaids
last_referenced_in: dansan
owner: PARLIAMENT
ref_user: dansan!~daniel@2600:1700:be30:d00::49
type: text
action:
  "Whew, you lucked out" "The needle was clean!" "The fresh corpse was clean!" "The prosititute didn't have aids!" "The teddy bear was aids free." "The homeless bum didn't have aids!" "Your hands were aids-free that time." "$who_answers didn't have aids . . . yet!" "$who_answers is aids-free at this time."


index1: .*
index2: nobook
edited_by: marchelzo!~marchelzo@unaffiliated/marchelzo
last_referenced_in: marchelzo
owner: Baughn
ref_user: marchelzo!~marchelzo@unaffiliated/marchelzo
type: text
action:
  /say If you don't have a book then you are wasting your time and ours.  The only good way to learn C is through a book. If you are too cheap to buy a book then just give up and learn something else that doesn't require a book.  In either case, go away until you have a book.


index1: .*
index2: notsed
edited_by: oldlaptop!~quassel@45.63.78.126
last_referenced_in: ##c-offtopic
owner: oldlaptop!~quassel@45.63.78.126
ref_user: oldlaptop!~quassel@45.63.78.126
type: text
action:
  /code sh printf "" > des.foo; printf 'a\n%s\n.\n%s\nw\nq\n' "$arg[1:]" $1 | ed des.foo >/dev/null; cat des.foo; rm des.foo


index1: .*
index2: p11std
last_referenced_in: #pbot2
owner: cousteau!~cousteau@unaffiliated/cousteau
ref_user: cousteau!~cousteau@unaffiliated/cousteau
type: text
action:
  /call c11std $args | { sed s/the behavior is undefined/that\'s a paddlin\'/ig } | { sed s/undefined behavior/a paddlin\'/ig }


index1: .*
index2: p99std
owner: cousteau!~cousteau@unaffiliated/cousteau
ref_user: nobody
type: text
action:
  /call c99std $args | { sed s/the behavior is undefined/that\'s a paddlin\'/ig } | { sed s/undefined behavior/a paddlin\'/ig }


index1: .*
index2: pastebin.com
last_referenced_in: fluter
owner: Jafet
ref_user: fluter!~fluter@fedora/fluter
type: text
action:
  /say pastebin.com and similar pastebins have ugly colour contrast, hard-to-read fonts, and insert pesky line numbers into the clipboard. Please use a better pastebin, like http://codepad.org


index1: .*
index2: penisnym
edited_by: jp!ayy@youlosethega.me
last_referenced_in: koisoke
owner: jp!ayy@youlosethega.me
ref_user: koisoke!xef4@epilogue.org
type: text
action:
  /code perl chomp(my @arr = `grep penis /usr/share/dict/words | grep -vi toppenish`); print $arr[rand $#arr] . q/ / for 0 .. rand(int($ARGV[0] // 0) ? int($ARGV[0]) : 5)


index1: .*
index2: permcase
edited_by: jp!ayy@youlosethega.me
last_referenced_in: #pbot2
owner: jp!ayy@youlosethega.me
ref_user: jp!ayy@youlosethega.me
type: text
action:
  /code perl   my $_result = join(" ", @ARGV); $_result =~ s/([a-z])/sprintf "{%s,%s}", uc($1), lc($1)/ieg; print $_ . " " for glob $_result


index1: .*
index2: pheph
last_referenced_in: doppel
owner: guidj0s
ref_user: doppel!~doppel@ip68-96-169-47.lv.lv.cox.net
type: text
action:
  /say 'Post hoc, ergo propter hoc': the logical fallacy of assuming that temporal succession implies causality.


index1: .*
index2: pi
last_referenced_in: pragma-
owner: pragma_
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230


index1: .*
index2: pizza_toppings
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: vile
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: vile!~csddesk@unaffiliated/csddesk
type: text
action:
  pepperoni sausage mushroom "bell peppers" onion "extra cheese" hamburger beef bacon pineapple chicken oregano basil parmesan sardines tomato spinach "bleu cheese" mozzarella salami ham garlic corn "$vegetable pesto" $vegetable


index1: .*
index2: plan9
last_referenced_in: solar_sea
owner: Major-Willard
ref_user: solar_sea
type: text
action:
  written in C, it's free and you can find it here: http://plan9.bell-labs.com/plan9dist or /join #plan9


index1: .*
index2: pluraladd
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
usage: Usage: pluraladd <singular ending> <plural ending>
action:
  /code perl no warnings; $_arg1 = "$ARGV[0]" ; $_arg2 = "$ARGV[1]" ; if (not length $_arg1 or not length $_arg2) { print "Usage: pluraladd <singular> <plural>\n" ; exit; } if ($_arg1 !~ /^[a-zA-Z-]+$/ or $_arg2 !~ /^[a-zA-Z-]+$/) { print "pluraladd: illegal symbol\n" ; exit; }  print "/call factchange .* pluralize s/'a',/'a', '$_arg1' => '$_arg2',/\n" ;


index1: .*
index2: pluralignore
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: e!e@freenode/staff/spy.edk
type: text
usage: Usage: pluralignore <word>
action:
  /code perl no warnings; $_word = "$ARGV[0]" ; if ($_word !~ /^[a-zA-Z-]+$/) { print "pluralignore: illegal symbol\n" ; exit; } print "/call factchange .* pluralize s/trout/trout $_word/\n" ;


index1: .*
index2: plz
last_referenced_in: benett
owner: Draconx
ref_user: Benett!~Benett@unaffiliated/benett
type: text
action:
  /say Please do not abbreviate 'please', 'thanks' or 'sorry'.  It makes you look as though you don't really care.


index1: .*
index2: politician
owner: oldlaptop!~quassel@45.63.78.126
ref_user: nobody
type: text
action:
  Congressman Congresswoman Senator MP legislator "member of Parliament" "member of Congress" $bureaucrat President "Prime Minister" Premier mayor councilman councilwoman councilcritter congresscritter dogcatcher "school board member"


index1: .*
index2: poll
last_referenced_in: ##c-offtopic
owner: pragma`
ref_user: Aequus!~Aequus@132.ip-51-254-37.eu
type: text
action:
  /say Please do not poll the channel asking if anyone knows about or has used something.  Just ask your specific question about it and if someone knows then they'll answer.


index1: .*
index2: pollresults
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
persist-key: prag-poll
ref_user: nai!~naim@nai.im
type: text
action:
  { our $question; $ayes = keys %yes; $nays = keys %no; "/say Results for poll \"$question\": ayes: $ayes, nays: $nays" }


index1: .*
index2: posixcc
edited_by: jp!ayy@cpe-76-173-133-37.hawaii.res.rr.com
last_referenced_in: ##c-offtopic
owner: jp!ayy@youlosethega.me
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /call cc -ggdb3 -Wextra -Wall -Wno-unused -Wno-unused-parameter -pedantic -Wfloat-equal -Wshadow -std=c11 -lm -Wfatal-errors -fsanitize=undefined,alignment -D_POSIX_C_SOURCE=200809L -pthread #include <semaphore.h>  #include <wait.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <limits.h> #include <math.h> extern char **environ;


index1: .*
index2: prepared
last_referenced_in: ##c-offtopic
owner: pragma_
ref_user: oldlaptop!~quassel@45.63.78.126
type: text
action:
  /say If you're working on this, you really shouldn't be asking C questions.  All your C questions should have been answered years ago or you probably aren't ready/prepared for this project.


index1: .*
index2: property
edited_by: nil!~n@monade.li
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  weight height strength speed thickness width depth density circumference volume viscosity conductivity flexibility 'tensile strength' moistitivity elasticity ambivalence omnipotence stupidity intelligence beauty squishiness fertility permeability permittivity contiguity inertia resonance wavelength


index1: .*
index2: questions
edited_by: e!e@freenode/staff/spy.edk
owner: e!e@enucs/spy.edk
ref_user: nobody
type: text
action:
  "How did I get here?" "How do I work this?" "Where is that large automobile?" "What is that beautiful house?" "Where does that highway go to?" "Am I right? Am I wrong?" "My God! What have I done?" "Why is 'abbreviated' such a long word?" "Why is lemon juice made with artificial flavor and dishwashing liquid made with real lemons?" "Why is the time of day with the slowest traffic called rush hour?" "Why do we park on driveways and drive on parkways?" "Why don't you ever see the headline 'Psychic Wins Lottery'?" "Why are there interstate highways in Hawaii?" "Why isn't phonetic spelled the way it sounds?" "Why do they put Braille dots on the keypad of drive-up ATMs?" "Why is stuff transported by ship called cargo and stuff transported by car called shipments?" "Why do kamikaze pilots wear helmets?" "If corn oil comes from corn, where does baby oil come from?" "Where does the fire go when the fire goes out?" "Do vegetarians eat animal crackers?" "When you put bread in the toaster and toast comes back out, where does the bread go?" "If you choke a smurf, what color does it turn?" "If you spin an Oriental man around and around, does he become disoriented?" "Why is there no 'd' in the word 'refrigerator'?" "What'sa matter you?"


index1: .*
index2: quotegrabs
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma_
ref_user: garp!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say For quotegrab commands: http://www.iso-9899.info/wiki/Candide#Quotegrabs -- For a table of grabbed quotes: http://www.iso-9899.info/candide/quotegrabs.html


index1: .*
index2: quotehelp
last_referenced_in: learath2
owner: pragma_
ref_user: Learath2!~learath2@unaffiliated/learath2
type: text
action:
  /say Usage: quote [text] [--author <author>] -- If you use `quote` without arguments, it returns a random quote; if you use it with an argument, it searches for quotes containing that text; if you add --author <name> at the end, it searches for a quote by that author; if you specify text and --author, it searches for quotes by that author, containing that text.


index1: .*
index2: rafb
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c
owner: pragma_
ref_user: Chris!~chris@unaffiliated/chris
type: text
action:
  /say Read A Fucking Book - Your primary guide for learning C should be a good book (see ,books). You must not expect to become a proficient C programmer just by reading crappy online `tuts', staring at other people's code, and/or boring us to death by asking dozens of exceedingly trivial questions.


index1: .*
index2: random_chunks
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  ${random_chunk}${random_chunk} ${random_chunk} ${random_chunk}${random_chunks} ${random_chunk}${random_chunks}


index1: .*
index2: random_word_bigger_chunks
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  $$0_small_word $$0_small_word $$0_small_word ${random_chunk:ucfirst}${random_chunk_end} ${random_chunk:ucfirst}${random_chunk} ${random_chunk}${random_chunk} ${random_chunks:ucfirst}${random_chunk_end} ${random_chunks}${random_chunk_end} ${random_chunks}${random_chunk_end} ${random_chunks}${random_chunk_end} $$0_small_word $$0_small_word $$0_small_word $$0_small_word $$0_small_word $$0_small_word


index1: .*
index2: random_word_c
owner: nil!n@monade.li
ref_user: nobody
type: text
action:
  $$0_chunk_cc $$0_chunk_cv $$0_chunk_cc $$0_chunk_cv $$0_chunk_cc $$0_chunk_cv $$0_chunk_cc$random_word_c $$0_chunk_cv$random_word_v


index1: .*
index2: random_word_chunks
edited_by: nil!~n@monade.li
last_referenced_in: ##c-offtopic
owner: nil!n@monade.li
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  $$0_small_word $$0_small_word $$0_small_word $$0_small_word $$0_small_word $$0_small_word $$0_small_word $$0_small_word $$0_small_word $$0_small_word $$0_small_word $$0_chunk_vv$$0_chunk_cv $$0_chunk_vv$$0_chunk_cc $$0_chunk_vc$$0_chunk_vv $$0_chunk_vc$$0_chunk_vc $$0_chunk_cv$$0_chunk_cv $$0_chunk_cv$$0_chunk_cc $$0_chunk_cc$$0_chunk_vv $$0_chunk_cc$$0_chunk_vc $$0_chunk_vv$$0_chunk_c_end $$0_chunk_vc$$0_chunk_v_end $$0_chunk_cv$$0_chunk_c_end $$0_chunk_cc$$0_chunk_v_end


index1: .*
index2: random_word_v
owner: nil!n@monade.li
ref_user: nobody
type: text
action:
  $$0_chunk_vc $$0_chunk_vv $$0_chunk_vc $$0_chunk_vv $$0_chunk_vc $$0_chunk_vv $$0_chunk_vc$random_word_c $$0_chunk_vv$random_word_v


index1: .*
index2: random_word_vowels_consonants
edited_by: nil!n@monade.li
last_referenced_in: ##c-offtopic
owner: nil!~n@monade.li
ref_user: nil!~n@monade.li
type: text
action:
  $$0_consonants_start$$0_vowels_end $$0_consonants_start$$0_vowels_middle$$0_consonants_end $$0_consonants_start$$0_vowels_middle$$0_consonants_middle$$0_vowels_end $$0_consonants_start$$0_vowels_middle$$0_consonants_middle$$0_vowels_middle$$0_consonants_end $$0_vowels_start $$0_vowels_start$$0_consonants_end $$0_vowels_start$$0_consonants_middle$$0_vowels_end $$0_vowels_start$$0_consonants_middle$$0_vowels_middle$$0_consonants_end


index1: .*
index2: ras
last_referenced_in: ##c-offtopic
owner: pragma-
ref_user: beeman!~beeman@unaffiliated/beeman
type: text
action:
  /say RAS Syndrome -- which stands for "Redundant Acronym Syndrome Syndrome" -- is a tongue-in-cheek name that describes the problem of unnecessary repetition hidden by an acronym.  http://suite101.com/article/redundant-acronyms-a65825


index1: .*
index2: rcsv
last_referenced_in: ##c-offtopic
owner: siesta!uid151648@gateway/web/irccloud.com/x-uid151648
ref_user: jp!ayy@youlosethega.me
type: text
action:
  /code c11 char s[256],*t,*k;int i;srand(time(NULL));s[0]='\0';if(argc>1){for(i=1;i<argc;i++){if(i>1)strcat(s," ");strcat(s,argv[i]);}i=0;t=strtok(s,",");while(t){i++;if((rand()/(float)RAND_MAX)<=(1.0/i))k=t;t=strtok(NULL,",");}puts(k);}


index1: .*
index2: reaction
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma_
ref_user: nil!~n@monade.li
type: text
action:
  "If you say so." "Why, thanks." "Are you sure about that?" "YES!" "Mission accomplished." "Takes one to know one!" "Pot calling the kettle!"  "You wish."  "I'm $sorry_modifier sorry."  "How about that!" "Is that what you think?" Fascinating. Intriguing. "I don't think so." "Are you sure?"  "$answers" "$answers"


index1: .*
index2: relatives
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: e!e@enucs/spy.edk
ref_user: nobody
type: text
action:
  wife husband son daughter brother sister mother father "creepy uncle" uncle cousin $relatives-in-law


index1: .*
index2: rep
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /code perl if (not "@ARGV" =~ /^\d+\s/) { print "Usage: rep <count> <text>" ; exit; } my $repeats = shift @ARGV; print "@ARGV" x $repeats;


index1: .*
index2: replace
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: kurahaupo!~kurahaupo@unaffiliated/kurahaupo
type: text
action:
  /code perl $stuff = shift @ARGV; $replacement = shift @ARGV; $replacement = "" if $replacement eq '""' or $replacement eq "''"; $text = "@ARGV"; $text =~ s/\Q$stuff\E/$replacement/gi; print $text


index1: .*
index2: res_death
edited_by: jp!ayy@youlosethega.me
last_referenced_in: jp
owner: jp!ayy@youlosethega.me
ref_user: jp!ayy@youlosethega.me
type: text
action:
  /code perl my $res_result = "&{call echo $res_trap_death}"; print "$res_result." if not $res_result cmp ""


index1: .*
index2: rpg_ans
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c
owner: pragma_
ref_user: Random832!~random@unaffiliated/random832
type: text
action:
  "$rpg_locations $rpg_animal_or_things" "$rpg_locations $rpg_animal_or_things" "$rpg_locations $rpg_animal_or_things" "$rpg_locations $rpg_animal_or_things" "$rpg_locations $rpg_animal_or_things" "$rpg_locations $rpg_animal_or_things" "A $animal_adjectives $animal_types $rpg_start_fight!" "You attempt to move but $rpg_trap_death! You are dead. R.I.P."


index1: .*
index2: rpg_attack_death
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "is dead! R.I.P." "is ready to $rpg_fight_flight." "glances at their missing $body_part and says 'Tis but a scratch'." "is $rpg_emote_verb $rpg_emote_adverb." "is $rpg_dead_alive." "is ready to $rpg_fight_flight." "is getting tired." "is $rpg_emote_verb $rpg_emote_adverb." "is $rpg_dead_alive." "is ready to $rpg_fight_flight." "is getting tired." "is $rpg_emote_verb $rpg_emote_adverb." "is $rpg_dead_alive."


index1: .*
index2: rpg_attack_response
edited_by: jp!ayy@youlosethega.me
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "$attack_types $nick in the $body_part. $nick $rpg_attack_death" "is dead! R.I.P." "$attack_types $nick in the $body_part. $args $rpg_attack_death" "$attack_types $nick in the $body_part. $args $rpg_attack_death" "$attack_types $nick in the $body_part. $nick $rpg_attack_death" "$attack_types $nick. $args $rpg_attack_death" "$attack_types $nick. $nick $rpg_attack_death" "panicks and flees. $nick is victorious!" "panicks and flees. $nick is victorious!"


index1: .*
index2: rpg_body_part_attack_action
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "feeds it to" "uses it to beat on" "gives it a good $rpg_body_part_yank while $rpg_emote_verb $rpg_emote_adverb at"


index1: .*
index2: rpg_bush
edited_by: oldlaptop!~quassel@45.63.78.126
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: oldlaptop!~quassel@45.63.78.126
type: text
action:
  bush shrubbery tree scarecrow car barn church "roach motel" "insurance sales office" houseboat "industrial refrigerator"


index1: .*
index2: rpg_conversation
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  'The $args asks, "$questions"' 'The $args says, "$statements"' "The $args grunts." "The $args quacks." 'The $args asks, "$questions"' 'The $args says, "$statements"' 'The $args says, "&{compliment}"' 'The $args says, "&{insult}"' "The $args moos." 'The $args says, "&{compliment}"' 'The $args says, "&{fortune}"' 'The $args says, "&{insult}"'


index1: .*
index2: rpg_crate
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  crate "treasure chest" "unlocked safe" "pirate chest" "booty chest" footlocker trunk basket "storage bin" "shipping container" coffer mailbox backpack package box cabinet dresser suitcase briefcase purse bag


index1: .*
index2: rpg_crit
edited_by: e!e@freenode/staff/spy.edk
owner: e!e@enucs/spy.edk
ref_user: nobody
type: text
action:
  "/say $nick takes aim at $args. $args instantly shatters into $rpg_shatter pieces." "/say $nick $attack_adverbs bifurcates $args. The two halves of $args slowly peel away from each other and splut onto the ground in a spray of blood and gore." "/say $nick lunges at $args, $rpg_melee_weapon drawn, and crushes their bones into dust." "/say $nick gashes $args through the $body_part, dealing $rpg_damage damage. $args explodes violently into a fine, pink mist." "/say Before $nick can do anything, their pet $animal_types $attack_adverbs bites off $args's $body_part." "/say $nick tortures $args's $chain_relatives to death in front of them. $args can't live with it and takes a $weapon to their $body_part."


index1: .*
index2: rpg_crit_fail
edited_by: e!e@enucs/spy.edk
last_referenced_in: ##c-offtopic
owner: e!e@enucs/spy.edk
ref_user: e!e@enucs/spy.edk
type: text
action:
  "/say $nick swings at $args with a hatchet, but misses and amputates their own $amputation_targets. $nick bleeds to death." "/say $nick takes aim at $args, but was holding the bow the wrong way around. $nick shoots themselves in the $body_part." "/say $nick goes to attack $args, but gets confused and makes them a $flavor $cake_type cake instead." "/say While preparing to attack $args, $nick spills their $drinks on their $body_part and suffers horrific burns." "/say $nick is about to attack $args when they accidentally ask themselves '$questions'." "/say $nick begins to cast a spell at $args, only to discover they have forgotten the spell, where they are, and even their own name. $nick is admitted to hospital where they are diagnosed with a fatal neurological disease. The world mourns, briefly. $nick's $chain_relatives is secretly relieved."


index1: .*
index2: rpg_dead_alive
edited_by: e!e@enucs/spy.edk
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "still kicking" "still alive" "almost dead" "nearly dead" "bleeding profusely" "ready for another round" "insulting your $relatives" $colors "missing a $body_part"


index1: .*
index2: rpg_diseases
edited_by: nil!~n@monade.li
owner: k!~krok@unaffiliated/krok
ref_user: nobody
type: text
action:
  measles mumps "mental retardation" "the flu" "black plague" "a sniffle" "swine flu" AIDS cancer frostbite gonorrhea herpes "three testicles" halitosis "$nationalities $rpg_diseases"  "$nationalities $rpg_diseases" "whooping cough" chickenpox typhus malaria tuberculosis "$colors fever" smallpox "bubonic plague"  cholera leprosy rabies pneumonia "spotted fever" polio "erectile dysfunction" "low testosterone" "inability to achieve orgasms" "inadequate lubrication" "low IQ" "low libido" alcoholism depression impotence dementia epilepsy diabetes tumors stress "restless leg syndrome" "prostate cancer"  "an eating disorder" "multiple personalities" "Alzheimer's" "attention deficit disorder" narcolepsy schizophrenia dyslexia delirium "gender dysphoria" insomnia "Parkinson's" "premature ejaculation disorder" amnesia stuttering Tourettes dysentery coronavirus COVID-19


index1: .*
index2: rpg_distance
edited_by: k!~krok@unaffiliated/krok
owner: pragma_
ref_user: nobody
type: text
action:
  "near" "close to" "next to" in "to the $rpg_direction of" "in the middle of" behind "in front of" over


index1: .*
index2: rpg_distance2
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  nearby "next to you" "in the distance" "somewhere around here" "" "" "" "hereabouts" "over there" "in the vicinity" "close by" "here" "not far from here" "within spitting distance" "across the $rpg_across"


index1: .*
index2: rpg_eat_actions
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  "/say You $0 the $args. You feel $rpg_eat_feels." "/say You $0 the $args. You feel $rpg_eat_feels." "/say You $0 the $args. You have died! R.I.P." "/say You $0 the $args. You feel $rpg_eat_feels." "/say You $0 the $args. You feel $rpg_eat_feels." "/say You $0 the $args. You now have $rpg_diseases!"


index1: .*
index2: rpg_eat_feels
edited_by: jp!ayy@youlosethega.me
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  sick healthy reinvigorated sexy ill pretty full hungry tired sleepy horny aroused nothing "ready for an adventure" indifferent weird woke enlightened illuminated vexed disgruntled discombobulated ornery irritable blissful copacetic


index1: .*
index2: rpg_emote_adverb
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "in pain" "with pleasure" "with discomfort" "in horror" "with displeasure" "in rage" "with glee" heavily


index1: .*
index2: rpg_flee_action
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "You turn and run into a $rpg_wall. You are dead! R.I.P." "You flee $rpg_direction! $rpg_ans" "You flee $rpg_direction! $rpg_ans" "You flee $rpg_direction! $rpg_ans"


index1: .*
index2: rpg_health
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  tired sick fantastic "ready for an adventure" nervous scared happy delightful gay worried hungry thirsty "hungry and thirsty" ornery horny lonely sad fine pretty confident


index1: .*
index2: rpg_hit
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: #pbot2
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: k!~krok@unaffiliated/krok
type: text
action:
  "/say $nick $attack_types $args. $args $rpg_attack_response" "/say $nick $attack_types $args in the $body_part. $args $rpg_attack_response"


index1: .*
index2: rpg_location2
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: rsca
owner: pragma_
ref_user: rsca
type: text
action:
  city castle headshop village "bath house" store bakery hamlet "$rpg_village_type village" cottage blacksmith tavern monastery manor church granary barn stables warehouse market inn marsh pasture woodland forest field river pond lake field orchard vineyard $rpg_water_body "$colors bikeshed" desert wasteland swamp mountains hills valley landfill school university "gas station" island basin bay beach bluff cliffs canyon canal cave dune fjord floodplain gully gorge gulf harbor volcano oasis plateau prairie reef reservoir sinkhole waterfall ravine greenhouse shed abbatoir slaughterhouse "chicken coop" "pig sty" farmhouse hayloft silo windmill arcade drugstore hotel "internet cafe" pharmacy cinema bungalow orphanage townhouse villa "psychiatric hospital" "nursing home" quarantine asylum library museum theater amphitheater "concert hall" consulate courthouse embassy "fire station" "police station" "pool hall" prison brewery factory foundry mill refinery "water tower" barracks bunker citadel boathouse garage hangar "parking lot" basilica cathedral chapel mosque shrine synagogue temple metro lighthouse "beauty salon" bookstore hospice pizzeria pub nursery town aqueduct canal dock marina tunnel wharf "bus stop" sanatorium cottage flophouse hostel "log cabin" motel palace resort "tree house" villa "tent city" "beach hut" wigwam yurt campsite "military camp" "trailer park" "barber shop"


index1: .*
index2: rpg_locations
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "You are standing $rpg_location. $rpg_sceneries" "You are standing $rpg_location. $rpg_sceneries" "You are standing $rpg_location. $rpg_sceneries" "You are standing $rpg_location. $rpg_sceneries" "$rpg_random_event You are standing $rpg_location. $rpg_sceneries"


index1: .*
index2: rpg_loldjectives
edited_by: e!e@enucs/spy.edk
owner: e!e@enucs/spy.edk
ref_user: nobody
type: text
action:
  $rpg_adjective $rpg_adjective $rpg_adjective "$rpg_loldjectives $rpg_adjective" "$rpg_loldjectives $rpg_adjective"


index1: .*
index2: rpg_loot_thing
edited_by: e!e@enucs/spy.edk
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "a $rpg_material_type $rpg_thing" "a $rpg_cursed $rpg_thing" "a $sizes pile of coins" "a $rpg_cursed pelt" "a $rpg_cursed $rpg_animal_part" nothing nothing nothing nothing nothing


index1: .*
index2: rpg_melee_weapon
edited_by: e!e@enucs/spy.edk
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  mace axe hatchet club sword staff dagger cutlass spear pike scimitar sabre katana longsword "war hammer" hammer pickaxe crowbar "battle axe" tomahawk rock scythe whip knife fork spoon spork "bastard sword" claymore lance "oversized meat cleaver" sarissa


index1: .*
index2: rpg_one_thing
edited_by: e!e@enucs/spy.edk
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "A $sizes $rpg_material_type $rpg_thing $rpg_thing_action in a $rpg_location2 $rpg_distance2." "A $rpg_loldjectives $rpg_thing $rpg_thing_action in a $rpg_location2 $rpg_distance2."


index1: .*
index2: rpg_open_fail
edited_by: nil!n@monade.li
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "/say You $0 the $args and $rpg_trap_death! You are dead! R.I.P." "/say You $0 the $args and find nothing."


index1: .*
index2: rpg_pet_reactions
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  $rpg_animal_noise. "panicks and runs into a $rpg_wall." "runs away." "bites your $body_part!" "rolls over and exposes its $body_part." "looks at you suspiciously." "looks at you lovingly." "falls over and dies. R.I.P."


index1: .*
index2: rpg_random_event
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "The day shifts into night. A wolf howls in the distance. You feel a dark chill." "The wind gusts. A dark omen hangs in the air. You sense danger lurking." "It $rpg_start_stop $rpg_weathering." "There is a bright flash of light! A nearby tree explodes into fire and ash." "A $animal_types $rpg_howls in the distance." "You are feeling $rpg_health." "A $rpg_mist rolls in from the $rpg_direction. You feel $rpg_health."


index1: .*
index2: rpg_scenery
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "You see a $sizes $rpg_location2 to the $rpg_direction." "You see a $rpg_location2 to the $rpg_direction." "You see a $colors $rpg_location2 to the $rpg_direction." "$rpg_scenery $rpg_special_scenery"


index1: .*
index2: rpg_special_scenery
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "You see a burning $rpg_bush." "There is a tornado in the distance." "It starts raining." "It starts snowing." "You hear thunder."


index1: .*
index2: rpg_start_fight
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: Aequus!~Aequus@132.ip-51-254-37.eu
type: text
action:
  "blocks your way" "will not let you pass" "attacks you" "challenges you to a duel" "charges at you and knocks you down" "ambushes you and knocks you down" "insults your heritage" "leaps out from behind a $rpg_bush and $rpg_ambushes!"


index1: .*
index2: rpg_swing
edited_by: e!e@enucs/spy.edk
last_referenced_in: ##c-offtopic
owner: e!e@enucs/spy.edk
ref_user: e!e@enucs/spy.edk
type: text
action:
  $rpg_hit $rpg_hit $rpg_hit $rpg_hit $rpg_hit $rpg_hit $rpg_hit $rpg_hit $rpg_hit $rpg_hit $rpg_hit $rpg_hit $rpg_hit $rpg_hit $rpg_crit $rpg_crit_fail $rpg_crit_fail


index1: .*
index2: rpg_take_random_fail
edited_by: e!e@enucs/spy.edk
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "nothing happens" "a bandit appears and takes it before you can" "$rpg_trap_death! You are dead! R.I.P" "you forget where it is" "you're interrupted by a cellphone call from your $relatives" "it was just a virtual reality experience" "it's a mimic! Taking on the form of an $sizes $rpg_thing, the mimic $attack_adverbs lunges at you"


index1: .*
index2: rpg_thing
edited_by: e!e@freenode/staff/spy.edk
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "${rpg_food_container} of ${snacks}" "${rpg_food_container} of ${snacks}" "${rpg_armor_type} helmet" "${rpg_armor_type} shield" "suit of armor" "${rpg_food_container} of ${snacks}" potion "gold coin" "pile of gold coins" ruby diamond ${weapon} "car analogy" ${fruit} "${sizes} ${idiots}" "${rpg_smokable_container} $rpg_containing ${rpg_smokable}" ${rpg_crate} ${rpg_crate} ${rpg_crate} ${rpg_smokable} ${rpg_melee_weapon} "${rpg_statue_type} statue of a ${rpg_thing}" ${sword_items} ${vehicle} $rpg_misc_thing "$animal_adjectives $animal_types"


index1: .*
index2: rpg_trap_death
edited_by: iamgarp!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "spikes fall from the ceiling and impale you" "a pit opens beneath your feet and you plummet to your death" "a venomous $animal_types leaps out and bites you" "you stumble and fall off a cliff" "you get lost in a sudden snowstorm and freeze to death" "fall into a bottomless pit" "are eaten by a grue" "you start to feel strange; after a few moments you suddenly die of $rpg_diseases" "step into a beartrap" "walk into a giant spider-web and are quickly consumed" "trip and fall onto a gardening rake" "suddenly have an aneurysm and fall over" "you trip over your own $body_part and crack your skull on a nearby $rpg_thing" "a $rpg_melee_weapon appears from behind a false $rpg_surface and cuts off your $amputation_targets"


index1: .*
index2: rpgrules
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  1) eat/drink/quaff/smoke all consumables; 2) open all crates/chests/etc, take all valuables and loot all corpses; 3) fight all attackers; 4) if battle message says "ready to flee/run way", use flee; 5) most directions moved and battles won without dying wins! 6) have fun!


index1: .*
index2: rtfm
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: AlecTaylor!~AlecTaylo@unaffiliated/alectaylor
type: text
action:
  /code perl print "/say Nonsense! Zhivago is a gentleman and a scholar." and exit if "$nick" eq "Zhivago" or "@ARGV" =~ /zhivago/i; print "/me $attacks $args with a $sizes $colors manual."


index1: .*
index2: sandwich_type
owner: e!e@enucs/spy.edk
ref_user: nobody
type: text
action:
  bacon chicken "chicken and cheese" "chicken and bacon" "coronation chicken" "tikka masala" cheese "cheese and tomato" "ham and cheese" "brie and bacon"


index1: .*
index2: sb
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /code perl $_s = "@ARGV"; my $_i = 0; while ($_s =~ m/(.)/g) { if (++$_i % 2) { print uc $1; } else { print lc $1; } }


index1: .*
index2: sc
edited_by: jp!ayy@youlosethega.me
last_referenced_in: #pbot2
owner: jp!ayy@youlosethega.me
ref_user: jp!ayy@youlosethega.me
type: text
action:
  /code c11 char **ptrptr = argv + 1, *ptr = *ptrptr, *savedptr = ptr; while((savedptr = *ptrptr++)) { ptr = savedptr; while (*ptr++) if (isalpha((*ptr = tolower(*ptr)))) *ptr++ -= 0x20; ptr = savedptr; puts(ptr); }


index1: .*
index2: sentence
edited_by: nil!~n@monade.li
last_referenced_in: ##c-offtopic
owner: nil!~n@monade.li
ref_user: e!e@freenode/staff/spy.edk
type: text
action:
  x$sentence_more $sentence_more $sentence_more $sentence_more $sentence_more $sentence_more $sentence_punct $sentence_punct $sentence_punct $sentence_end


index1: .*
index2: shit_actions
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "pinches a loaf" "drops the kids off" "lays some cable" "builds a log cabin" "takes a tour of doody" "drops a tootsie roll" "releases the kraken"


index1: .*
index2: shoes
edited_by: edk!edk@unaffiliated/edk
last_referenced_in: ##c-offtopic
owner: pragma_
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say Let's say you want to buy a pair of shoes, right?  You come to my shoe store and I ask you what size your feet are.  You respond, "I like red."  I say, "That's nice, I'll look for some red shoes.  What size are your feet?"  And you respond, "I really like red."  Try to answer our questions, please.


index1: .*
index2: shoot2
action: /me $weapon_action its $weapon and $shoot_action $args's $body_part
edited_by: kg!~krok@unaffiliated/krok/x-1434802
last_referenced_in: ##c-offtopic
owner: kg!~krok@unaffiliated/krok/x-1434802
ref_user: oldlaptop!~quassel@45.63.78.126
type: text
action_with_args:
  /code perl if (@ARGV == 1 or $ARGV[0] =~ /'s$/ or $ARGV[0] =~ /^(?:these|this|that|those)$/i) { print "/me $weapon_action its $weapon and $shoot_action $args's $body_part." } else { print "/me $weapon_action its $weapon and $shoot_action3 $args" };


index1: .*
index2: shoot_action
owner: pragma_
ref_user: pragma_
type: text
action:
  "blows away" "shoots off" "shoots holes in" "takes off" "blows off" blasts "blasts off" "blasts through" "shoots through"


index1: .*
index2: shoot_action3
edited_by: kg!~krok@unaffiliated/krok/x-1434802
owner: kg!~krok@unaffiliated/krok/x-1434802
ref_user: nobody
type: text
action:
  "blows away" "shoots holes in" "blasts through" "shoots through" "absolutely incinerates" "lays some pain on" "beats up"


index1: .*
index2: shuuto
edited_by: kg!~krok@unaffiliated/krok/x-1434802
last_referenced_in: ##c-offtopic
owner: kg!~krok@unaffiliated/krok/x-1434802
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /code perl if (@ARGV == 1 or $ARGV[0] =~ /'s$/ or $ARGV[0] =~ /^(?:these|this|that|those)$/i) {$_t="/me $weapon_action its $weapon and $shoot_action $args's $body_part."}else{$_t="/me $weapon_action its $weapon and $shoot_action3 $args"}@args=split(/ /, $_t);for(@args){$t=$_;s/the/da/gi;s/[ae]r/ah/gi;s/l/r/gi;s/([dkg])([^a-z]*$)$/$1u$2/gi;s/th/d/gi;s/ore/aw/gi;s/([vw][ei]+[^r])/$1r/gi;s/cce/kushu/gi;s/cc/ss/gi;s/(f|d)([^a-z]?)$/$1a$2/gi;s/(?<!g)re/ru/gi;s/([nrt])([^a-z]?)$/$1o$2/gi;s/orta/tur/gi;s/is/isu/gi;s/ow/aw/gi;s/^f(?=[^r])/fr/gi;s/uto$/utosaki/gi;s/es/o/gi;s/^co/ko/i;s/awa/arra/gi;if($t=~/.[A-Z]/){$_=uc$_}if($t=~/^[A-Z]/){s/(^.)/\U$1/;}print$_," "}


index1: .*
index2: sizes
edited_by: nai!~naim@monade.li
owner: pragma_
ref_user: R0b0t1
type: text
action:
  "" "" "" large small large small average large small tiny massive huge gigantic titanic teeny minuscule enormous microscopic nanoscopic life-size engorged


index1: .*
index2: small
edited_by: jp!ayy@youlosethega.me
last_referenced_in: ##c-offtopic
owner: jp!ayy@youlosethega.me
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /code zsh print -nr - "$*" | sed $'y/abcdefghijklmnopqrstuvwxyz<>"\'/ａｂｃｄｅｆｇｈｉｊｋｌｍｎｏｐｑｒｓｔｕｖｗｘｙｚ＜＞＂＇/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ<>"\'/ａｂｃｄｅｆｇｈｉｊｋｌｍｎｏｐｑｒｓｔｕｖｗｘｙｚ＜＞＂＇/' | sed 's/ /  /g'


index1: .*
index2: snacks
edited_by: e!e@enucs/spy.edk
last_referenced_in: ##c-offtopic
owner: pragma_
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  "magic brownies" "crème brûlée" "${burrito_type} burrito" "${taco_type} taco" "${cookie_type} cookie" hot-dog "duck à l'orange" "${applesauce_type} apple sauce" "${popcorn_type} popcorn" "sautéed carrot" nachos "${fruit} pie" "${cake_type} cake" "${muffin_type} muffin" "bowl of ${cereal_type}" "${poptart_type} pop-tart" currywurst banana "ice-cold water" stew porridge "pale orange soup" ${sandwich} ${sandwich}


index1: .*
index2: soda_extras
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "with extra whipped cream" "with $scoops of $icecream_flavors ice-cream" "with a cherry on top" "" "" "" "with a $straw_type straw"


index1: .*
index2: soda_ingredient
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: k!~krok@unaffiliated/krok
ref_user: nobody
type: text
action:
  orange grape cream "root beer" "lemon-lime" "ginger ale" "ginger root" cherry blackberry apricot birch chocolate grapefruit lemon lime mango papaya passionfruit peach sarsaparilla strawberry watermelon tamarind coffee


index1: .*
index2: some_splashes
owner: k!~krok@unaffiliated/krok
ref_user: nobody
type: text
action:
  "one $splash" "two $splashes" "three $splashes" "four $splashes" "two and a half $splashes" "an extra $splash" "one and a half $splashes"


index1: .*
index2: spengebab
edited_by: jp!ayy@youlosethega.me
last_referenced_in: ##c-offtopic
owner: jp!ayy@youlosethega.me
ref_user: oldlaptop!~quassel@45.63.78.126
type: text
action:
  /code perl print "/say "; print "$ARGV[2] "; shift @ARGV for qw/1 2 3/; print join " ", map {my $idx = 0; join "", map { if ($idx++ % 2) { uc($_) } else { lc($_) };} split //, $_} @ARGV


index1: .*
index2: stack_machine
owner: PoppaVic
ref_user: pragma_
type: text
action:
  http://forth.sourceforge.net/ http://www.zetetics.com/bj/papers/moving1.htm http://www.albany.net/~hello/simple.htm http://www.ece.cmu.edu/~koopman/stack_computers/index.html http://galileo.phys.virginia.edu/classes/551.jvn.fall01/primer.htm


index1: .*
index2: starbucks
edited_by: k!~krok@unaffiliated/krok
last_referenced_in: ##c-offtopic
owner: kg!~krok@unaffiliated/krok/x-1434802
ref_user: k!~krok@callipygian.life
type: text
action:
  /me offers $arg[0] a $starbucks_flavor $starbucks_sizes $coffee_type $starbucks_types $starbucks_extras $arg[1:]


index1: .*
index2: starbucks_extras
edited_by: k!~krok@unaffiliated/krok
owner: kg!~krok@unaffiliated/krok/x-1434802
ref_user: nobody
type: text
action:
  "with extra whipped cream" "with $starbucks_pumps of chocolate syrup" "with a cherry on top" "" "" "with toffee nut syrup" "with extra caramel drizzle" "with blended vanilla beans" "with $starbucks_pumps of white chocolate" "with $starbucks_pumps of whole milk"


index1: .*
index2: starbucks_flavor
edited_by: atk!Arch-TK@ircpuzzles/staff/Arch-TK
owner: kg!~krok@unaffiliated/krok/x-1434802
ref_user: nobody
type: text
action:
  iced cold-brewed piping-hot scrumptious delicious ice-cold sweet bitter minty delectable nutritious thick creamy dark overwhelming


index1: .*
index2: starbucks_pumps
edited_by: k!~krok@unaffiliated/krok
owner: k!~krok@unaffiliated/krok
ref_user: nobody
type: text
action:
  "one pump" "two pumps" "three pumps" "four pumps" "two and a half pumps" "an extra pump" "one and a half pumps"


index1: .*
index2: startvote
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
persist-key: vote-poll
ref_user: garp!~chaos@unaffiliated/pragmatic-chaos
type: text
usage: Usage: $0 <question>
action:
  /code perl use Storable; my %_votes = (); my $_question = "@ARGV"; system 'rm -rf vote-data' ; print "Starting poll: $_question Use `vote <keyword>` to record your vote."; my @data = ({%_votes}, $_question); mkdir 'vote-data' or print "$!" ; store \@data, 'vote-data/data';


index1: .*
index2: statements
edited_by: e!e@freenode/staff/spy.edk
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "Artificial intelligence is no match for natural stupidity." "The problem with trouble shooting is that trouble shoots back." "The early bird may get the worm, but the second mouse gets the cheese." "All power corrupts. Absolute power is pretty neat, though." "A clear conscience is usually the sign of a bad memory." "To steal ideas from one person is plagiarism; to steal from many is research." "Please stop pretending to be mentally retarded." "You could ask a small child." "Another member of the subliterati strikes."


index1: .*
index2: strcalcb
last_referenced_in: ##spinach
owner: nai!~naim@monade.li
ref_user: nai!~naim@monade.li
type: text
action:
  /code bash while p=0 s=0;for a do ((s+=`printf %d \'${a:i:1}`,${#a}>i))&&p=1;done;((i++,p));do printf \\x`printf %x $(((s-97)%26+97))`;done


index1: .*
index2: strcalcn
edited_by: nai!~naim@monade.li
last_referenced_in: ##spinach
owner: nai!~naim@monade.li
ref_user: nai!~naim@monade.li
type: text
action:
  /code python3 import sys,itertools;print(''.join(map(chr,((sum(v)-97)%26+97 for v in itertools.zip_longest(*(map(ord,a) for a in sys.argv[1:]),fillvalue=0)))))


index1: .*
index2: superset
last_referenced_in: vigud
owner: se7
ref_user: Vigud!uid1143@gateway/web/irccloud.com/x-lsqwccsadxnazljl
type: text
action:
  C++ isn't a superset because (a) some C programs are not legal C++ programs (b) some C programs behave differently when treated as C++ programs.


index1: .*
index2: sword_items
owner: jp!ayy@youlosethega.me
ref_user: nobody
type: text
action:
  umbrella parasol "walking stick" "metal pipe" e-cigarette backscratcher "house cat" "cup holder" "USB thumb drive" "piece of A4 paper" Kindle


index1: .*
index2: synergy
last_referenced_in: ##c-offtopic
owner: pragma_
ref_user: nil!~n@monade.li
type: text
action:
  /say Share keyboard/mouse and copy/paste between networked computers (optionally using ssh): http://synergy-foss.org/


index1: .*
index2: talkfrenchto_chunk_v_end
owner: nil!n@monade.li
ref_user: nobody
type: text
action:
  uette oux eur our ont oir ez er et eux eaux eau ette ote osse otte ense anse inse eure euse ouse ouffe uffe ymphe aon oint eurt ose ends es âts art ard ourd ort ord ine ite ègue ue ité ué uée onde ouffle oufle oufflé aise oise uise ouis


index1: .*
index2: talkfrenchto_small_word
edited_by: nil!n@monade.li
last_referenced_in: ##c-offtopic
owner: nil!n@monade.li
ref_user: christopher!NextHendri@unaffiliated/nexthendrix
type: text
action:
  je ou en et y tu il va si à ma ta ton sa t'y j'y ai as de te cul c'est du mon pour vers n'en t'en m'en t'a m'a l'a le la a


index1: .*
index2: talkgermanto_chunk_cc
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: nil!n@monade.li
ref_user: nobody
type: text
action:
  krieg blitz funf schm schz tsch tschz schw grim diehl hahl führ wort gent chuld weis  juden herr dampf schiff fahrts triebs werk haupt sel ten chung zeit rind fleisch ket tier rind setz rungs chungs auf ben bauern leid schwein schlecht herbst laub tritt ver gen kennt niss zier gang mahl neid dorn hös chen schlaf höschen scwieger mutter kurven lang halswurst tags fühl roll schlep super duper typ titten versteh bahnhof spinner glaub teufel schon spring deinen keks tierisch schwarz richtig vogel kreis lauf bruch wolken reichen reich drittes pfeift runter rut schen kaputt länger weiter klapp tot fuch wild wunder bar


index1: .*
index2: talkgermanto_small_word
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: nil!n@monade.li
ref_user: nobody
type: text
action:
  ich bin du bist zu für in im das die der alles dich über oder und hast mich zur noch doch unter was war ja nein warum kein keine Herr Juden Jude dem nich ein eine wie jawohl tut heil wo wer wie wenn gonkst


index1: .*
index2: taocp
last_referenced_in: dave0
owner: twkm
ref_user: dave0!~dave@32.060.dsl.syd.iprimus.net.au
type: text
action:
  The Art of Computer Programming, by Knuth, http://www.iso-9899.info/wiki/Special:Booksources/0201485419


index1: .*
index2: tea_extras
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "with a side of passion fruit" "with a gelatinous dessert" "with a slice of carrot cake" "with a topping of mint leaves" "" "" "" "" "with a few hardy biscuits" "with honey" "with milk" "with $some_splashes of $liquor_type" "with sugar" "with lemon"


index1: .*
index2: tea_ingredient
edited_by: e!e@freenode/staff/spy.edk
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  "Earl Grey" "English breakfast" Oolong Green Herbal White fermented $coffee_ingredient $coffee_ingredient $coffee_ingredient $coffee_ingredient $coffee_ingredient


index1: .*
index2: teaching
last_referenced_in: mhi^
owner: twkm
ref_user: mhi^
type: text
action:
  not just accepting that the person asking knows what they are doing and has merely forgotten the proper forms to use. Rather, they need insight into what solutions exist to solve the problems they face; for which, there can be no better tool than a clear explanation of the problem, even if you must draw it out of them millimeter by torturous millimeter.


index1: .*
index2: testc
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /code c11 printf("/me scratches its $body_part thoughtfully. argc: %d\n", argc); for (int i = 0; i < argc; i++) printf("arg %i: %s\n", i, argv[i]);


index1: .*
index2: testcase
edited_by: oldlaptop!~quassel@45.63.78.126
last_referenced_in: ##c
owner: lemonade`
ref_user: dave0!~davezero@069.d.003.ncl.iprimus.net.au
type: text
action:
  /say A testcase is a minimal, compilable, runnable example exhibiting your symptoms. "Minimal" means just the bare essentials required to illustrate your question. "Compilable and runnable" means that there is enough code to compile, link, and execute it on our machines, and therefore use our debuggers. Please paste a testcase at http://ideone.com or http://codepad.org to help us assist you.


index1: .*
index2: the_cake
last_referenced_in: masoudd
owner: pragma_
ref_user: masoudd!~masoudd@5.112.116.98
type: text
action:
  "The cake was moist and delicious." "The cake is a lie ... The cake is a lie ... The cake is a lie ..."


index1: .*
index2: timing
last_referenced_in: jack64
owner: Jack64!~jacktakah@188.122.93.34
ref_user: Jack64!~jacktakah@188.122.93.34
type: text
action:
  /say In cryptography, a timing attack is a side channel attack in which the attacker attempts to compromise a cryptosystem by analyzing the time taken to execute cryptographic algorithms. Learn more at http://www.cs.hmc.edu/~mike/public_html/courses/security/s06/projects/dan.pdf


index1: .*
index2: topical_action
edited_by: oldlaptop!~quassel@45.63.78.126
owner: oldlaptop!~quassel@45.63.78.126
ref_user: nobody
type: text
action:
  "$topical_for for" "$topical_on on" "$topical_about about" "$topical_against against" $topical_standalone


index1: .*
index2: tp
last_referenced_in: ##c-offtopic
owner: guidj0s
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say Chances are no one here will care about your POSIX-related questions. Someone in ##posix might (with higher probability).


index1: .*
index2: understood
last_referenced_in: kate
owner: Auris-
ref_user: kate!~kate@unaffiliated/kate
type: text
action:
  /say We understood you the first time, and answered already; you may not have understood the answers. Instead of ignoring them and repeating your question, find out what they mean.


index1: .*
index2: unique
owner: PoppaVic
ref_user: nobody
type: text
action:
  "We are unique!.. We are like a force of nature!.. A million points of light!.. And dark stripes!.. Exactly the same!"


index1: .*
index2: unrip
last_referenced_in: ##c-offtopic
owner: oldlaptop!~quassel@45.63.78.126
ref_user: kurahaupo!~kurahaupo@unaffiliated/kurahaupo
type: text
action:
  /say But wait... $args's medallion begins to glow! $args looks much better! The medallion crumbles to dust!


index1: .*
index2: usetherighttool
owner: vorpal
ref_user: pragma_
type: text
action:
  /say Use the right tool for the job.  Someone once said, "if the only tool you have is a hammer, you tend to see every problem as a nail."  Avoid placing artificial limitations on your projects by keeping an open mind and learning more tools, as your skills improve.


index1: .*
index2: utc
edited_by: zalt!~lambda443@unaffiliated/lambda443
last_referenced_in: ##c-offtopic
owner: zalt!~lambda443@unaffiliated/lambda443
ref_user: zalt!~zalt@unaffiliated/lambda443
type: text
action:
  /code python3
  import sys, os, datetime; sys.argv += ['0']
  try:
      print((datetime.datetime.utcnow() + datetime.timedelta(hours=int(sys.argv[1]))).strftime('%a %d %b %Y %I:%M:%S %p UTC{}'.format(('%+d' % int(sys.argv[1])) if int(sys.argv[1]) else '')))
  except:
      print(('' if sys.argv[1].lower().startswith('-h') else 'Invalid argument: "{}"\n'.format(sys.argv[1])) + 'Usage: utc [offset hours]')


index1: .*
index2: utf-8
last_referenced_in: ##c
owner: Wulf_
ref_user: dho!~dho@veep.9vx.org
type: text
action:
  an ascii-compatible way to represent arbitrary unicode characters with octets. http://en.wikipedia.org/wiki/UTF-8 | printf("\xc3\xb6\n");


index1: .*
index2: valgrind
last_referenced_in: oberon4278
owner: joeyadams
ref_user: Oberon4278!~Oberon@pool-108-49-117-196.bstnma.fios.verizon.net
type: text
action:
  a memory debugging tool.  When your program is exhibiting erratic behavior, it may be due to a memory error such as overrunning a buffer or not updating the pointer after a realloc.  Try running your program with valgrind; it will save you a lot of time.


index1: .*
index2: vegetable
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: vile
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: vile!~csddesk@unaffiliated/csddesk
type: text
action:
  potatoes carrots peas spinach squash asparagus broccoli cauliflower avocado tomato pumpkin zucchini rice zuchinni "bok choy" cabbage corn kale greens beet turnip eggplant "bell peppers" avocado pumpkin pineapple tomatoes artichoke "black-eyed peas" chickpeas "fava beans" kumquat celery "lima beans" leek "bamboo shoot" ginger parsnip yam wasabi


index1: .*
index2: vegetable_cook_type
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  stewed sautéed mashed puréed baked roasted "" "" scalloped cheesy grilled steamed seasoned creamy breaded stuffed fried bbq teriyaki signature


index1: .*
index2: videotestcase
last_referenced_in: ##c-offtopic
owner: lemonade`
ref_user: garp!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say A video testcase is a minimal viewable video exhibiting your problem. "Minimal" means just the bare essentials required to illustrate your problem. Please record a video testcase at http://www.youtube.com to help us assist you.


index1: .*
index2: vote
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
persist-key: vote-poll
ref_user: kurahaupo!~kurahaupo@unaffiliated/kurahaupo
type: text
usage: Usage: vote <keyword>
action:
  /code perl use Storable; my $_data = retrieve 'vote-data/data'; my %_votes = %{shift @$_data}; ($_votes{"$nick"}) = (lc "@ARGV");   unshift @$_data, {%_votes}; store $_data, 'vote-data/data'; print "$nick: $vote_recorded"


index1: .*
index2: voteresults
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c-offtopic
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
persist-key: vote-poll
ref_user: kurahaupo!~kurahaupo@unaffiliated/kurahaupo
type: text
action:
  /code perl no warnings; use Storable; my $_data = retrieve 'vote-data/data'; my %_votes = %{shift @$_data}; my $_question = shift @$_data; if (not keys %_votes) { print "No votes for \"$_question\" yet."; exit; } my %_count; map { $_count{$_}++ } values %_votes; my $_result = "Poll results for \"$_question\": "; my $_comma = ""; map { $_result .= "$_comma$_: $_count{$_}"; $_comma = ', '; } sort { $_count{$b} <=> $_count{$a} } keys %_count; print "/say $_result";


index1: .*
index2: vset
owner: jp!ayy@youlosethega.me
ref_user: nobody
type: text
action:
  /say &{factset voteresults persist-key $args &{factset vote persist-key $args ${factset startvote persist-key $args


index1: .*
index2: vt100
last_referenced_in: ##c
owner: PoppaVic
ref_user: user51_!~user51@77.124.3.96
type: text
action:
  http://pegasus.cs.csubak.edu/Tables_Charts/VT100_Escape_Codes.html http://members.save-net.com/jko@save-net.com/asm/r_vt200.txt


index1: .*
index2: weapon
last_referenced_in: ##c-offtopic
owner: kate`
ref_user: nai!~naim@nai.im
type: text
action:
  "Beretta 9mm" "Smith and Wesson" BFG9000 MP40 "rocket launcher" "hand grenade" shotgun railgun catapult "Cupid's bow" M16 "flare gun" harpoon flamethrower "chainsaw bazooka"


index1: .*
index2: weird_flavor
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: nobody
type: text
action:
  rheopectic hygroscopic cubic water-powered edible indelible deadly geometric never-ending activated oscillating "a cappella" unstable infinite idealized sun-dried transcendent


index1: .*
index2: who_answers
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: masoudd
owner: pragma_
ref_user: masoudd!~masoudd@5.112.116.98
type: text
action:
  "Hannah Montana" "Britney Spears" "Thomas Hobbes" "Rene Descartes" "Mr. T" "Chuck Norris" "the Power Rangers" "the Teletubbies" "Spider-Man" "Hulk Hogan" "a butterfly" Goethe "Barack Obama" "John McCain" "Hillary Clinton" "Rodney Dangerfield" "LeVar Burton" "Sarah Palin" "Bo Jackson"


index1: .*
index2: why_answers
last_referenced_in: masoudd
owner: pragma_
ref_user: masoudd!~masoudd@5.112.116.98
type: text
action:
  "I don't know." "Because the $sizes $colors $animals made it that way." "That's just how it is." "If you just investigate a $sizes amount further, you can figure it out." "Because I said so!" "Are you thinking clearly?" "Are you sure you're not a $sizes $idiots?"


index1: .*
index2: whymove
last_referenced_in: #pbot2
owner: pragma_
ref_user: jp!ayy@youlosethega.me
type: text
action:
  /say See http://freenode.net/policy.shtml and http://freenode.net/policy.shtml#channelnaming for information on the unusual channel name.


index1: .*
index2: windows
last_referenced_in: ##c
owner: Major-Willard
ref_user: Teklad!~justin@141-126-033-210.dhcp.chtrptr.net
type: text
action:
  a thirty-two bit extension and graphical shell to a sixteen-bit patch to an eight-bit operating system originally coded for a four-bit microprocessor which was written by a two-bit company that can't stand one bit of competition.


index1: .*
index2: wot
last_referenced_in: ##c-offtopic
owner: jp!ayy@youlosethega.me
ref_user: oldlaptop!~quassel@45.63.78.126
type: text
action:
  /code perl package Wat; sub new { my ($pkg,$self) = (shift,shift); bless \ $self,$pkg; return \ $self; } sub TIESCALAR { my $self = shift; return $self; } sub mk { my $_i = 0; return sub { return ++$_i; }; }; our $_it = mk; sub FETCH { my $self = $_it; return $self->(); } my $waat = Wat->new(); my $wut; tie $wut, $waat; print "wtf equals" if ($wut == 1 && $wut == 2 && $wut == 3)


index1: .*
index2: xy
last_referenced_in: ##c
owner: Draconx|Laptop
ref_user: caze!~caze@unaffiliated/caze
type: text
action:
  /say The XY problem:  You want to do X, but don't know how.  You think you can solve it using Y, but don't know how to do that, either.  You ask about Y, which is a strange thing to want to do.  Just ask about X.


index1: .*
index2: you
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: yuri0x0
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: yuri0x0!~yuri0x0@168.227.172.251
type: text
action:
  /code perl no warnings; $_s = "@ARGV"; $_s =~ s/[[:punct:]]+$//; $_n = quotemeta "$nick" ; $_s =~ s/\bmy\b/your/gi; $_s =~ s/\bmyself\b/yourself/gi; $_s =~ s/\bme\b/you/gi; $_s =~ s/(\W|^)$_n\'s(\W|$)/$1your$2/gi; $_s =~ s/(\W|^)$_n(\W|$)/$1you$2/gi; if ($_s =~ /^a?re?\s+(.*?)(?:(?:\s+and|[[:punct:]])\s+.*)?$/i) { print "/call say I am $1? $reaction" ; exit; } if ($_s =~ /(.*?)(?:(?:\s+and|[[:punct:]])\s+.*)?$/i) { print "/call say I $1? $reaction" ; }


index1: .*
index2: you're
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: cassepipe
owner: pragma-!~chaos@unaffiliated/pragmatic-chaos
ref_user: cassepipe!~cassepipe@81-66-251-102.rev.numericable.fr
type: text
action:
  /code perl no warnings; $_s = lc "@ARGV"; $_s =~ s/[[:punct:]]+$//; $_n = quotemeta "$nick" ; $_s =~ s/\bmy\b/xbyourxb/gi; $_s =~ s/\bmyself\b/xbyourselfxb/gi; $_s =~ s/\bme\b|\bi\b/xbyouxb/gi; $_s =~ s/(\W|^)$_n\'s(\W|$)/$1xbyourxb$2/gi; $_s =~ s/(\W|^)$_n(\W|$)/$1xbyouxb$2/gi; $_s =~ s/\byour\b/my/gi; $_s =~ s/\byourself\b/myself/gi; $_s =~ s/\byou\b/I/gi; $_s =~ s/xb(\w+)xb/$1/g; if ($_s =~ /(.*?)(?:(?:\s+and|[[:punct:]])\s+.*)?$/i) { print "/call say I am $1? $reaction" ; }


index1: #bash
index2: !
last_referenced_in: ##c-offtopic
owner: pgas
ref_user: jp!ayy@youlosethega.me
type: text
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.


index1: #bash
index2: !#!env
owner: kurahaupo1
ref_user: nobody
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.


index1: #bash
index2: !set
owner: karolisl
ref_user: nobody
type: text
action:
  /say help set <ENTER> http://www.bash-hackers.org/wiki/doku.php?id=commands:builtin:set -- set +H is useful; -evx are very good for debugging.


index1: #bash
index2: "`
owner: ormaaj
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.


index1: #bash
index2: #
last_referenced_in: pragma-
owner: kojiro
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
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.


index1: #bash
index2: #!binbash
owner: variable
ref_user: nobody
type: text
action:
  /say Use "!#/usr/bin/env bash" - it is more portable and will probably do what the user wants in a modified envrioment


index1: #bash
index2: $
owner: lhunath
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.


index1: #bash
index2: $"
last_referenced_in: ##c-offtopic
owner: geirha
ref_user: nil!~n@monade.li
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


index1: #bash
index2: $$
owner: greycat
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.)


index1: #bash
index2: $'
owner: BlastHardcheese
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


index1: #bash
index2: $(
last_referenced_in: ##c
owner: geirha
ref_user: Random832!~random@unaffiliated/random832
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


index1: #bash
index2: $((
owner: geirha
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 <http://mywiki.wooledge.org/ArithmeticExpression>.


index1: #bash
index2: $(echo
last_referenced_in: #pbot2
owner: geirha
ref_user: [\!~qwename@unaffiliated/qwename
type: text
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


index1: #bash
index2: $-
owner: geirha
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).


index1: #bash
index2: $0
owner: greycat
ref_user: nobody
type: text
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


index1: #bash
index2: $1
owner: koala_man
ref_user: nobody
type: text
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;


index1: #bash
index2: $?
last_referenced_in: #cjeopardy
owner: lhunath
ref_user: inode!~inode@unaffiliated/inode
type: text
action:
  /say The special parameter ? (expanded by $?) holds the exit status of the last synchronous command.


index1: #bash
index2: $@
owner: [arx]
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[@]}".


index1: #bash
index2: $_
owner: greycat
ref_user: nobody
type: text
action:
  /say "$_" expands to the last argument to the previous command, after expansion (man bash, Special Parameters)


index1: #bash
index2: $grep
owner: lhunath
ref_user: nobody
type: text
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


index1: #bash
index2: $shell
last_referenced_in: kolpad2
owner: geirha
ref_user: kolpad2!~School_wo@c122-107-81-234.carlnfd2.nsw.optusnet.com.au
type: text
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 $$


index1: #bash
index2: $tmp
last_referenced_in: #pbot2
owner: lhunath
ref_user: jp!ayy@youlosethega.me
type: text
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[@]}").


index1: #bash
index2: $var
owner: lhunath
ref_user: nobody
type: text
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.


index1: #bash
index2: ${
last_referenced_in: #pbot2
owner: ormaaj
ref_user: qwename!~qwename@unaffiliated/qwename
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!


index1: #bash
index2: ${$
owner: greycat
ref_user: nobody
type: text
action:
  /say The correct syntax for parameter expansion is ${varMODIFIER} not ${$varMODIFIER}. Remove that second $.


index1: #bash
index2: ${${
owner: lhunath
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.


index1: #bash
index2: &
owner: ferret
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 $!


index1: #bash
index2: &&if
owner: lhunath
ref_user: nobody
type: text
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.


index1: #bash
index2: &&||
owner: \amethyst
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


index1: #bash
index2: &;
last_referenced_in: ##c-offtopic
owner: fr33load3r
ref_user: nil!~n@monade.li
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


index1: #bash
index2: &>
owner: izabera
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.


index1: #bash
index2: &>>
owner: lhunath
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.


index1: #bash
index2: '
owner: geirha
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!'


index1: #bash
index2: ''
owner: nDuff
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.


index1: #bash
index2: ((
owner: prince_jammys
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 <http://mywiki.wooledge.org/ArithmeticExpression>.


index1: #bash
index2: ()
owner: e36freak
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


index1: #bash
index2: -
last_referenced_in: ##c-offtopic
owner: yitz_
ref_user: \[!~qwename@unaffiliated/qwename
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.


index1: #bash
index2: --
owner: e36freak
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


index1: #bash
index2: -9
owner: lhunath
ref_user: nobody
type: text
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


index1: #bash
index2: -c
last_referenced_in: ##c-offtopic
owner: \amethyst
ref_user: nil!~n@monade.li
type: text
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 _


index1: #bash
index2: -exec_
owner: e36freak
ref_user: nobody
type: text
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"


index1: #bash
index2: -f
owner: yitz_
ref_user: nobody
type: text
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?


index1: #bash
index2: -nt
owner: redduck666
ref_user: nobody
type: text
action:
  /say [ f1 -nt f2 ] True if file1 is newer (mtime) than file2 *or* if file1 exists and file2 does not.


index1: #bash
index2: -r
owner: Riviera
ref_user: nobody
type: text
action:
  /say Always use read with the -r option, otherwise backslashes are special. http://wiki.bash-hackers.org/commands/builtin/read#read_without_-r


index1: #bash
index2: 256colormap
owner: i336_
ref_user: nobody
type: text
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


index1: #bash
index2: 2>&1
owner: TheBonsai
ref_user: nobody
type: text
action:
  /say Making sense of the copy descriptor operator: http://wiki.bash-hackers.org/scripting/copydescriptor


index1: #bash
index2: 2d
last_referenced_in: ##c
owner: lhunath
ref_user: cousteau!~cousteau@unaffiliated/cousteau
type: text
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


index1: #bash
index2: 2like
owner: saveTheWorld
ref_user: nobody
type: text
action:
  /say !1 but without backslash interpretation or stripping of leading/trailing spaces: while read -r; do my-command "$REPLY"; done <inputfile -- or for POSIX shell: while IFS= read -r line; do my-command "$line"; done <inputfile


index1: #bash
index2: 80
last_referenced_in: ##c-offtopic
owner: neurolysis
ref_user: qwename!~qwename@unaffiliated/qwename
type: text
action:
  /say The 80-character limit is mostly pointless nowadays, except for in specific circumstances. <http://sprunge.us/cJTP>


index1: #bash
index2: :-
owner: koala_man
ref_user: nobody
type: text
action:
  /say ${parameter:-word} Use Default Values. If parameter is unset or null, the expansion of word is substituted.


index1: #bash
index2: :=
owner: koala_man
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.


index1: #bash
index2: ;
owner: yitz_
ref_user: nobody
type: text
action:
  /say The ";" character is used to separate between commands. It does the (almost) exact same thing that <ENTER> does in a shell or a newline in a script.


index1: #bash
index2: ;;
last_referenced_in: ##c-offtopic
owner: geirha
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
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.


index1: #bash
index2: <(
owner: greycat
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 <http://mywiki.wooledge.org/ProcessSubstitution>. Example: diff -u <(sort file1) <(sort file2)


index1: #bash
index2: <()
owner: lhunath
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


index1: #bash
index2: <<
owner: kojiro
ref_user: nobody
type: text
action:
  /say Here documents. cat <<EOF followed by several lines of text, followed by the literal string EOF on a new line, NOT indented. The portion between the EOFs is passed to the command as standard input. If 'EOF' is 'quoted', substitutions WON'T be done; otherwise they are. See <<- for the indented variety.


index1: #bash
index2: <<()
owner: geirha
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?).


index1: #bash
index2: <<-
owner: llua
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.


index1: #bash
index2: <<<
last_referenced_in: ##c-offtopic
owner: lhunath
ref_user: nai!~naim@monade.li
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)


index1: #bash
index2: <<<$(
owner: e36freak
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


index1: #bash
index2: <>
last_referenced_in: ##c-offtopic
owner: izabera
ref_user: k!~krok@unaffiliated/krok
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


index1: #bash
index2: =$?
owner: kurahaupo
ref_user: nobody
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.


index1: #bash
index2: ==
owner: ferret
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.


index1: #bash
index2: >&
owner: greycat|home
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.


index1: #bash
index2: >|
owner: izabera
ref_user: nobody
type: text
action:
  /say Redirect stdout, like > but ignores noclobber (set -C). See http://wiki.bash-hackers.org/syntax/redirection


index1: #bash
index2: ?
last_referenced_in: deadsoul
owner: lhunath
ref_user: DeaDSouL!~deadsoul@94.29.129.54
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.


index1: #bash
index2: @
last_referenced_in: ##c
owner: greycat
ref_user: dave0!~dave@230.059.dsl.syd.iprimus.net.au
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.


index1: #bash
index2: [
owner: lhunath
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


index1: #bash
index2: [$?
owner: lhunath
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''


index1: #bash
index2: [-a
owner: ormaaj
ref_user: nobody
type: text
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


index1: #bash
index2: [:
owner: cthuluh
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


index1: #bash
index2: [<
owner: redduck666
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 ]


index1: #bash
index2: [[
last_referenced_in: glacial
owner: greycat
ref_user: glacial!~glacial@unaffiliated/glacial
type: text
action:
  /say [[ is a bash keyword similar to (but more powerful than) the [ command. See <http://mywiki.wooledge.org/BashFAQ/031> and <http://mywiki.wooledge.org/BashGuide/TestsAndConditionals>. Unless you're writing for POSIX sh, we recommend [[.


index1: #bash
index2: [vs[[
owner: lhunath
ref_user: nobody
type: text
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


index1: #bash
index2: \0
owner: prince_jammys
ref_user: nobody
type: text
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.


index1: #bash
index2: ^$()
owner: lhunath
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.


index1: #bash
index2: ^c
last_referenced_in: ##c
owner: greycat
ref_user: muffindrake!~muffindra@unaffiliated/muffindrake
type: text
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.)


index1: #bash
index2: _
owner: ormaaj
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: $_


index1: #bash
index2: `
last_referenced_in: #pbot2
owner: greycat
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
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


index1: #bash
index2: `irc
owner: e36freak
ref_user: nobody
type: text
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


index1: #bash
index2: abs
last_referenced_in: #cjeopardy
owner: TheBonsai
ref_user: jim!~jim@unaffiliated/jim
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


index1: #bash
index2: abspath
last_referenced_in: koisoke
owner: izabera
ref_user: koisoke!xef4@epilogue.org
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


index1: #bash
index2: advanced
owner: igli
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


index1: #bash
index2: alias
owner: lhunath
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; }


index1: #bash
index2: aliases
owner: greycat
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.


index1: #bash
index2: altgr
owner: kurahaupo
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.


index1: #bash
index2: anal
last_referenced_in: ##c-offtopic
owner: savetheWorld
ref_user: banana!~banandana@cassini.whatbox.ca
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."


index1: #bash
index2: anarchy
last_referenced_in: ##c-offtopic
owner: r00t
ref_user: oldlaptop!~quassel@45.63.78.126
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


index1: #bash
index2: another_way
owner: greycat
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.


index1: #bash
index2: answer
last_referenced_in: ##c-offtopic
owner: lhunath
ref_user: nh!~NextHendr@unaffiliated/nexthendrix
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.


index1: #bash
index2: answers2
owner: igli
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.


index1: #bash
index2: arch
owner: Samus_
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 :)


index1: #bash
index2: arg:
owner: greycat
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.


index1: #bash
index2: argmax
owner: cdown
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/


index1: #bash
index2: arithmetic
last_referenced_in: #cjeopardy
owner: lhunath
ref_user: graff!~graff@unaffiliated/graff
type: text
action:
  /say Add 7 to a variable: let a+=7; ((a+=7)); a=$((a+7)); See http://wooledge.org/mywiki/ArithmeticExpression


index1: #bash
index2: array
last_referenced_in: ##c-offtopic
owner: ormaaj
ref_user: nai!~naim@monade.li
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


index1: #bash
index2: ascii
edited_by: qwename!~qwename@108.175.235.8
last_referenced_in: ##c-offtopic
owner: savetheWorld
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  /say http://mywiki.wooledge.org/BashFAQ/071 -- How do I convert an ASCII character to its decimal (or hexadecimal) value and back?


index1: #bash
index2: ash
owner: ormaaj
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).


index1: #bash
index2: ask
owner: geirha
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


index1: #bash
index2: assignment
last_referenced_in: #pbot2-test
owner: greycat
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
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.


index1: #bash
index2: assoc
owner: lhunath
ref_user: nobody
type: text
action:
  /say Associative Arrays map strings to strings (Bash 4): http://mywiki.wooledge.org/BashGuide/Arrays#Associative_Arrays


index1: #bash
index2: attach
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: mnrmnaugh!~mnrmnaugh@unaffiliated/mnrmnaugh
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


index1: #bash
index2: august
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: nil!~n@monade.li
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.


index1: #bash
index2: auth
owner: greycat
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 .


index1: #bash
index2: autocd
last_referenced_in: ##c-offtopic
owner: cdown
ref_user: k!~krok@unaffiliated/krok
type: text
action:
  /say autocd moves to directories automatically without having to prepend them with ''cd'', it's available from bash4+.


index1: #bash
index2: away
last_referenced_in: nanozz
owner: lhunath
ref_user: nanozz!nanoz@gateway/vpn/protonvpn/nanoz
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


index1: #bash
index2: awk
owner: yitz_
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.


index1: #bash
index2: awk-v
owner: yitz_
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}'


index1: #bash
index2: awkquote
owner: lhunath
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.


index1: #bash
index2: b2
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: alyptik!ayy@youlosethega.me
type: text
action:
  /say bashphorism 2: The questioner will keep changing the question until it drives the helpers in the channel insane.


index1: #bash
index2: b21
owner: greycat
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.


index1: #bash
index2: b22
owner: sjohnson
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.


index1: #bash
index2: b28
owner: greycat
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.


index1: #bash
index2: b3
owner: kojiro
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."


index1: #bash
index2: b33
owner: greycat
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?!


index1: #bash
index2: b4
last_referenced_in: #pbot2
owner: savetheWorld
ref_user: acerbic!~acerbic@2602:30a:2cf9:4710:f27b:cbff:fe81:c6b3
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


index1: #bash
index2: b9
owner: greycat
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.


index1: #bash
index2: badidea
owner: HawkI
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.


index1: #bash
index2: badq
owner: bronze_0_1
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


index1: #bash
index2: badredir
owner: ormaaj
ref_user: nobody
type: text
action:
  /say # for sh in {{b,d}a,k}sh; do printf '%-5s %s\n' "${sh}:" "$("$sh" -s </dev/fd/0)"; done <<<'{ echo foo >/dev/null &>/dev/fd/3 echo bar; } 3>&1'


index1: #bash
index2: badref
last_referenced_in: ##c-offtopic
owner: ormaaj
ref_user: izabera!~izabera@unaffiliated/izabera
type: text
action:
  /say Be careful when using functions that use namerefs (typeset -n): https://gist.github.com/ormaaj/5682807


index1: #bash
index2: basename
owner: selk
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=/


index1: #bash
index2: bash-sh
owner: lhunath
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.


index1: #bash
index2: bash.org
owner: redondos
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.


index1: #bash
index2: bash4osx
owner: lhunath
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


index1: #bash
index2: bashbug
owner: yitz_
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.


index1: #bash
index2: bashdb
owner: \amethyst
ref_user: nobody
type: text
action:
  /say The Bash Debugger Project is a gdb-style debugger for bash, available from http://bashdb.sourceforge.net/


index1: #bash
index2: bashis
owner: lhunath
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.


index1: #bash
index2: bashish
owner: cthuluh
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


index1: #bash
index2: bashism
owner: greycat
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


index1: #bash
index2: bashquote
owner: lhunath
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")"


index1: #bash
index2: basic
owner: igli
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. ;)


index1: #bash
index2: batch
owner: greycat
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.


index1: #bash
index2: beg
last_referenced_in: mujjingun
owner: neurolysis
ref_user: mujjingun!uid228218@gateway/web/irccloud.com/x-uid228218
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.


index1: #bash
index2: bint
last_referenced_in: #cjeopardy
owner: bronze
ref_user: E0D!5ffa58f0@gateway/web/freenode/ip.95.250.88.240
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.


index1: #bash
index2: bobby
owner: e36freak
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


index1: #bash
index2: bom
last_referenced_in: ##c
owner: kojiro
ref_user: shadowchaser!~Shadowcha@liox.eu
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


index1: #bash
index2: books
last_referenced_in: cippaciong
owner: e36freak
ref_user: cippaciong!~cippacion@host133-146-dynamic.244-95-r.retail.telecomitalia.it
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


index1: #bash
index2: bool
last_referenced_in: dorp
owner: greycat
ref_user: dorp!~dorp@bzq-84-111-138-241.cablep.bezeqint.net
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


index1: #bash
index2: bots
last_referenced_in: cengiz_io
owner: yitz_
ref_user: cengiz_io!sid223191@gateway/web/irccloud.com/x-sid223191
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.


index1: #bash
index2: botspam
owner: sjohnson
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.


index1: #bash
index2: bourne
last_referenced_in: mujjingun
owner: \amethyst
ref_user: mujjingun!uid228218@gateway/web/irccloud.com/x-uid228218
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/


index1: #bash
index2: boxme
owner: Jetchisel
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!"


index1: #bash
index2: bp
last_referenced_in: cousteau
owner: lhunath
ref_user: cousteau!869356f3@gateway/web/freenode/ip.134.147.86.243
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).


index1: #bash
index2: bpod
last_referenced_in: #pbot2
owner: izabera
ref_user: qwename!~qwename@unaffiliated/qwename
type: text
action:
  /say Big Pipeline Of Death: if your command looks like this: command | grep | sed | awk | tr | ... YOU'RE DOING IT WRONG


index1: #bash
index2: braces
owner: kojiro
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"


index1: #bash
index2: bre
owner: geirha
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


index1: #bash
index2: brm
owner: bronze
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.


index1: #bash
index2: broken
last_referenced_in: ##spinach
owner: kojiro
ref_user: oldlaptop!~quassel@45.63.78.126
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.


index1: #bash
index2: broken2
last_referenced_in: camthesaxman
owner: yitz_
ref_user: camthesaxman!~chatzilla@107-205-135-122.lightspeed.nworla.sbcglobal.net
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."


index1: #bash
index2: bs
last_referenced_in: #pbot2
owner: savetheWorld
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say tty control character 008. used to reverse increment the carrier 1 character position horizontally. No vertical displacement.


index1: #bash
index2: bug
last_referenced_in: #pbot2
owner: kojiro
ref_user: jp!ayy@youlosethega.me
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.


index1: #bash
index2: bugged
last_referenced_in: ##c-offtopic
owner: lhunath
ref_user: qwename!~qwename@unaffiliated/qwename
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.


index1: #bash
index2: builtin
owner: lhunath
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]''


index1: #bash
index2: bypass
owner: lhunath
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.


index1: #bash
index2: c1
owner: savetheWorld
ref_user: nobody
type: text
action:
  /say corollary1.1 the questioner's second description of the problem/question will also be misleading.


index1: #bash
index2: c2
owner: savetheWorld
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


index1: #bash
index2: capital
last_referenced_in: k
owner: \amethyst
ref_user: k!~krok@unaffiliated/krok
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.


index1: #bash
index2: captcha
owner: kurahaupo
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


index1: #bash
index2: cargocult
owner: David-A
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.


index1: #bash
index2: case
owner: greycat
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.


index1: #bash
index2: cat
last_referenced_in: ##c-offtopic
owner: lhunath
ref_user: nai!~naim@monade.li
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).


index1: #bash
index2: cd
last_referenced_in: ghost-287
owner: geirha
ref_user: ghost-287!~ghost-287@unaffiliated/ghost-287
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


index1: #bash
index2: cddvd
owner: greycat
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.


index1: #bash
index2: cdpath
owner: lhunath
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


index1: #bash
index2: cfor
last_referenced_in: #cjeopardy
owner: yitz_
ref_user: seanconnery!~HoS@108-79-248-248.lightspeed.cicril.sbcglobal.net
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}


index1: #bash
index2: charcount
owner: yitz_
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}"


index1: #bash
index2: checkbot
owner: koala_man
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).


index1: #bash
index2: checkexp
owner: TheBonsai
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


index1: #bash
index2: checkip
last_referenced_in: jasondockers
owner: ormaaj
ref_user: jasondockers!~cipher__@vpn-cuboulder29-196-dhcp.colorado.edu
type: text
action:
  /say set -o pipefail; curl -s checkip.dyndns.org | xmllint --html --xpath 'substring-after(/html/body/text(), ": ")' - || echo $'\nOffline'


index1: #bash
index2: checkpe
owner: TheBonsai
ref_user: nobody
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


index1: #bash
index2: chmod
last_referenced_in: tuu
owner: yitz_
ref_user: tuu!~a@46.23.92.235
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 {} +


index1: #bash
index2: choice
last_referenced_in: ##c-offtopic
owner: lhunath
ref_user: nil!~n@monade.li
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.


index1: #bash
index2: chooseyourshell
owner: tuxdev
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


index1: #bash
index2: clever
owner: neurolysis
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


index1: #bash
index2: cmd
owner: igli
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.


index1: #bash
index2: cmdsubst
owner: TheBonsai
ref_user: nobody
type: text
action:
  /say Command Substitution: $() and `` - http://bash-hackers.org/wiki/doku.php/syntax/expansion/cmdsubst


index1: #bash
index2: code
last_referenced_in: ##c-offtopic
owner: yitz_
ref_user: oldlaptop!~quassel@45.63.78.126
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.


index1: #bash
index2: codesmell
owner: sikilpaake
ref_user: nobody
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


index1: #bash
index2: color
last_referenced_in: chung
owner: lhunath
ref_user: chung!~pongthep@1.20.156.142
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


index1: #bash
index2: colorchart
owner: Riviera
ref_user: nobody
type: text
action:
  /say n=$(tput colors) sgr0=$(tput sgr0); for ((i=0;i<n;i++)); do c=$(tput setab $i); printf '%3d: %s%20s %q\n' $i "$c" "$sgr0" "$c"; done


index1: #bash
index2: columns
last_referenced_in: tomywork
owner: prince_jammys
ref_user: TomyWork!~tomy@85.199.84.100
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


index1: #bash
index2: comm
owner: geirha
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


index1: #bash
index2: command
last_referenced_in: ##c-offtopic
owner: koala_man
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
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 "$@"; }


index1: #bash
index2: command_not_found_handle
owner: greycat
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.


index1: #bash
index2: comment
owner: yitz_
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.


index1: #bash
index2: completion
owner: Riviera
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).


index1: #bash
index2: completion2
owner: kurahaupo
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


index1: #bash
index2: config
owner: lhunath
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


index1: #bash
index2: confirm
owner: geirha
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 ...


index1: #bash
index2: construct
owner: prince_jammys
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.


index1: #bash
index2: constructivism
owner: sikilpaake
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


index1: #bash
index2: contains
last_referenced_in: ##c-offtopic
owner: yitz_
ref_user: iamgarp!~chaos@unaffiliated/pragmatic-chaos
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


index1: #bash
index2: counting
owner: ormaaj
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


index1: #bash
index2: cpio
owner: igli
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


index1: #bash
index2: cpio-p
owner: greycat
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


index1: #bash
index2: cr
last_referenced_in: #pbot2
owner: izabera
ref_user: jp!ayy@youlosethega.me
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.


index1: #bash
index2: crap
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: meth!~meth@unaffiliated/meth
type: text
action:
  /say The overwhelming majority of bash scripts, code, tutorials, and guides on the Internet are crap. Sturgeon was an optimist.


index1: #bash
index2: crash
last_referenced_in: ##spinach
owner: kwtm2
ref_user: oldlaptop!~quassel@45.63.78.126
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...


index1: #bash
index2: creation_time
owner: TheBonsai
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.


index1: #bash
index2: cron
last_referenced_in: ##c
owner: Boobuigi
ref_user: mahakal!~UserName@unaffiliated/mahakal
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.


index1: #bash
index2: cronpath
owner: geirha
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


index1: #bash
index2: csecho
owner: greycat
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"


index1: #bash
index2: csh
last_referenced_in: ##c
owner: Riviera
ref_user: Remavas!Remavas@gateway/shell/xshellz/x-Remavas
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


index1: #bash
index2: csv
owner: lhunath
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 <http://to.lhunath.com/bashlib#L550>, <http://docs.python.org/library/csv.html> or the csvtool / csvkit commands.


index1: #bash
index2: ctime
last_referenced_in: #cjeopardy
owner: greycat
ref_user: raph0x88!rasanche@nat/redhat/x-ozlsqrvxftbqjxge
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.


index1: #bash
index2: cue-seeker
owner: David-A
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.


index1: #bash
index2: cult
last_referenced_in: #pbot2
owner: greycat
ref_user: k!~krok@unaffiliated/krok
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.


index1: #bash
index2: curlpipesh
owner: izabera
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


index1: #bash
index2: curseofknowledge
owner: sikilpaake
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


index1: #bash
index2: cutoff
owner: BlastHardcheese
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


index1: #bash
index2: data
last_referenced_in: jaziz
owner: greycat
ref_user: jaziz!~jaziz@unaffiliated/jaziz
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).


index1: #bash
index2: date1
owner: Bronze
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


index1: #bash
index2: datemath
last_referenced_in: ##c-offtopic
owner: Riviera
ref_user: nil!~n@monade.li
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)))"


index1: #bash
index2: dates
owner: igli
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.


index1: #bash
index2: dc
last_referenced_in: ##spinach
owner: TheBonsai
ref_user: oldlaptop!~quassel@45.63.78.126
type: text
action:
  /say Calculating with dc - an introduction written by pgas: http://bash-hackers.org/wiki/doku.php/howto/calculate-dc


index1: #bash
index2: ddiib
owner: tyrmored
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


index1: #bash
index2: debug
owner: greycat
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.


index1: #bash
index2: declare
owner: greycat
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.


index1: #bash
index2: declare-n
owner: greycat
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").


index1: #bash
index2: default
last_referenced_in: oldlaptop
owner: greycat
ref_user: oldlaptop!~quassel@45.63.78.126
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.


index1: #bash
index2: defocus
owner: lhunath
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.


index1: #bash
index2: delimiter
owner: prince_jammys
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.


index1: #bash
index2: demorgan
owner: geirha
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 ]]


index1: #bash
index2: dfs
owner: ormaaj
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; };


index1: #bash
index2: dialog
last_referenced_in: ##c
owner: lhunath
ref_user: Random832!~random@unaffiliated/random832
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.


index1: #bash
index2: die
owner: koala_man
ref_user: nobody
type: text
action:
  /say mycommand || die "please install mycommand" # Using a custom 'die' function from http://mywiki.wooledge.org/BashFAQ/101


index1: #bash
index2: dirname
owner: lhunath
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%/*}"


index1: #bash
index2: disclaimer
owner: yitz_
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.


index1: #bash
index2: distros
last_referenced_in: mahakal
owner: kojiro
ref_user: mahakal!~UserName@unaffiliated/mahakal
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.


index1: #bash
index2: div
owner: mute
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


index1: #bash
index2: diy
owner: igli
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 ;-)


index1: #bash
index2: do4me
owner: tobor
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.


index1: #bash
index2: doesntwork
owner: lhunath
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.


index1: #bash
index2: doesntwork2
owner: yitz_
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.


index1: #bash
index2: doesntwork3
owner: geirha
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...


index1: #bash
index2: doesntwork4
owner: geirha
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


index1: #bash
index2: doesntwork5
owner: geirha
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.


index1: #bash
index2: dotdot
owner: greycat
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


index1: #bash
index2: dotfiles
owner: lhunath
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 <http://mywiki.wooledge.org/DotFiles>. For GUI logins, SEE YOUR DOCUMENTATION or ask your OS channel because they're all different and we don't know.


index1: #bash
index2: dotglob
owner: emg
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)


index1: #bash
index2: dotpattern
last_referenced_in: ##c-offtopic
owner: ormaaj
ref_user: nil!~n@monade.li
type: text
action:
  /say /tmp/* /tmp/.[!.]* /tmp/..?* … That hard-to-remember glob for selecting /tmp/* ∪ /tmp/.* ∩ /tmp/{.,..}


index1: #bash
index2: droproot
owner: mute
ref_user: nobody
type: text
action:
  /say :;cd /bin;(head -c6288;read -N30;recode /64<<<SIscJQiRYABmv/7/McCwag8FsGkPBUiLfghIjYNwSAIA/+A=;cat)>tr<nl;tr "${cmd-id}"


index1: #bash
index2: du-h
owner: e36freak
ref_user: nobody
type: text
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'


index1: #bash
index2: du-sh
owner: greycat
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}'


index1: #bash
index2: dwit
last_referenced_in: ##c-offtopic
owner: igli
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
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.


index1: #bash
index2: dynamic
last_referenced_in: dave9
owner: savetheWorld
ref_user: dave9!~dave@90.20.215.218.dyn.iprimus.net.au
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!


index1: #bash
index2: echo
last_referenced_in: ##c-offtopic
owner: lhunath
ref_user: nil!~n@monade.li
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


index1: #bash
index2: ed
owner: TheBonsai
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


index1: #bash
index2: ego
owner: igli
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.


index1: #bash
index2: eh
last_referenced_in: paul
owner: igli
ref_user: paul!~paul@stoner.jakma.org
type: text
action:
  /say You might consider describing the whole problem; perhaps we can suggest a more straightforward solution.


index1: #bash
index2: email
last_referenced_in: ##c-offtopic
owner: e36freak
ref_user: nil!~n@monade.li
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'


index1: #bash
index2: email-regex
owner: lhunath
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


index1: #bash
index2: embed
owner: greycat
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.


index1: #bash
index2: emgrev
owner: emg
ref_user: nobody
type: text
action:
  /say # rev() { sed -e 'G;:a' -e 's/\(.\)\(.*\n\)/\2\1/;ta' -e 's/.//' "$@";}; rev <<<$'foo\nbar baz'


index1: #bash
index2: emgrev2
owner: emg
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'


index1: #bash
index2: emgrev3
owner: emg
ref_user: nobody
type: text
action:
  /say https://gist.githubusercontent.com/deepcube/32257879f19df9644ad1/raw/7f2a2503b3d188b449d61fbe8411f66f9ba0afc1/rev.c


index1: #bash
index2: empty
last_referenced_in: ##c-offtopic
owner: Riviera
ref_user: nitrix!~nitrix@haskell/developer/nitrix
type: text
action:
  /say empty is a lightweight alternative to the ''expect'' tool for automating interactive programs: http://empty.sourceforge.net/


index1: #bash
index2: encode
last_referenced_in: ##c-offtopic
owner: yitz_
ref_user: qwename!~qwename@unaffiliated/qwename
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?


index1: #bash
index2: enter
last_referenced_in: ##c-offtopic
owner: twb
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say Enter is not punctuation. Please do not send every clause/word/character as a separate message; it inhibits readability.


index1: #bash
index2: env
owner: lhunath
ref_user: nobody
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


index1: #bash
index2: environment
owner: greycat
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


index1: #bash
index2: eof
owner: greycat
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 ....


index1: #bash
index2: epoch
last_referenced_in: #cjeopardy
owner: savetheWorld
ref_user: asgs!~ident@unaffiliated/asgs
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


index1: #bash
index2: ere
owner: greycat
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


index1: #bash
index2: esc
owner: greycat
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.


index1: #bash
index2: esp
owner: igli
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?


index1: #bash
index2: eval
last_referenced_in: ##c-offtopic
owner: TheBonsai
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
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


index1: #bash
index2: evalball
owner: ormaaj
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


index1: #bash
index2: evalbot
last_referenced_in: ##c
owner: geirha
ref_user: mahakal!~UserName@unaffiliated/mahakal
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


index1: #bash
index2: evil
last_referenced_in: ##spinach
owner: lhunath
ref_user: oldlaptop!~quassel@45.63.78.126
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.


index1: #bash
index2: ex
last_referenced_in: koisoke
owner: lhunath
ref_user: koisoke!xef4@epilogue.org
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


index1: #bash
index2: exact
last_referenced_in: #pbot2
owner: yitz_
ref_user: jp!ayy@youlosethega.me
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.


index1: #bash
index2: examples
owner: nDuff
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).


index1: #bash
index2: exception
last_referenced_in: ##c
owner: bwe
ref_user: prev!~prev@unaffiliated/prev
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.


index1: #bash
index2: exec
last_referenced_in: ##c-offtopic
owner: TheBonsai
ref_user: Learath2!~learath2@unaffiliated/learath2
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


index1: #bash
index2: execdir
owner: lhunath
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.


index1: #bash
index2: exit
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: siiky!~siiky@bl6-174-56.dsl.telepac.pt
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".


index1: #bash
index2: expansions
owner: ormaaj
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


index1: #bash
index2: expect
last_referenced_in: ##c-offtopic
owner: pgas
ref_user: oldlaptop!~quassel@45.63.78.126
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


index1: #bash
index2: explain
owner: ferret
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


index1: #bash
index2: expr
last_referenced_in: ##c
owner: ormaaj
ref_user: marchelzo!~marchelzo@unaffiliated/marchelzo
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'.


index1: #bash
index2: extglob
owner: geirha
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


index1: #bash
index2: factoid
owner: bronze
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.)


index1: #bash
index2: failed
last_referenced_in: #lol233232
owner: ferret
ref_user: lol233232!~pbot3@75.142.235.66
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.


index1: #bash
index2: failglob
owner: yitz_
ref_user: nobody
type: text
action:
  /say If set, patterns which fail to match filenames during pathname expansion result in an expansion error.


index1: #bash
index2: fake
owner: igli
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! **


index1: #bash
index2: faketty
owner: izabera
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; }


index1: #bash
index2: fam
owner: yitz_
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.


index1: #bash
index2: ffmpeg
owner: ferret
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?


index1: #bash
index2: fhs
owner: greycat
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.


index1: #bash
index2: fib
last_referenced_in: ##c-offtopic
owner: ormaaj
ref_user: beeman!~beeman@unaffiliated/beeman
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}"; };


index1: #bash
index2: filenames
owner: kwtm
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.


index1: #bash
index2: findarr
owner: igli
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)


index1: #bash
index2: findxargs
owner: lhunath
ref_user: nobody
type: text
action:
  /say Don't do this: find ... | xargs. Not even with the -print0/-0 options. Use find ... -exec .. {} + instead.


index1: #bash
index2: fish
last_referenced_in: ##c-offtopic
owner: yitz_
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
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.


index1: #bash
index2: flatten
owner: e36freak
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]


index1: #bash
index2: flavours
owner: Riviera
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


index1: #bash
index2: float
owner: Riviera
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?


index1: #bash
index2: floating
owner: oMish
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.


index1: #bash
index2: flowcontrol
owner: bxlecqy_
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


index1: #bash
index2: fnl
owner: lhunath
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.


index1: #bash
index2: font
last_referenced_in: mujjingun
owner: lhunath
ref_user: mujjingun!uid228218@gateway/web/irccloud.com/x-uid228218
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.


index1: #bash
index2: foobar
owner: biz
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


index1: #bash
index2: for
last_referenced_in: prev
owner: lhunath
ref_user: prev!~prev@unaffiliated/prev
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.


index1: #bash
index2: for$
last_referenced_in: ##c
owner: lhunath
ref_user: muffindrake!~muffindra@unaffiliated/muffindrake
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


index1: #bash
index2: fork
last_referenced_in: jumpforce
owner: ghj
ref_user: Jumpforce!~alarm@unaffiliated/jumpforce
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$"'').


index1: #bash
index2: forkexec
owner: BlastHardcheese
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


index1: #bash
index2: forls
owner: koala_man
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


index1: #bash
index2: forme
owner: greycat
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.


index1: #bash
index2: forvswhile
owner: greycat
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 <drlwf>.


index1: #bash
index2: fp
last_referenced_in: ##c-offtopic
owner: kurahaupo_mobile
ref_user: alyptik!ayy@youlosethega.me
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))


index1: #bash
index2: freturn
owner: greycat
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


index1: #bash
index2: friend
last_referenced_in: sandman13
owner: kojiro
ref_user: sandman13!~sandman13@unaffiliated/sandman13
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.


index1: #bash
index2: fslint
last_referenced_in: #cjeopardy
owner: Bronze
ref_user: seanconnery!~HoS@108-79-248-248.lightspeed.cicril.sbcglobal.net
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


index1: #bash
index2: function
owner: llua
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


index1: #bash
index2: g1
last_referenced_in: j4ck_4l0n3
owner: bronz_
ref_user: J4ck_4l0n3!~u0_a108@host178-183-dynamic.56-82-r.retail.telecomitalia.it
type: text
action:
  /say # When Chuck Norris goes to sleep every night, he checks his closet for a script written by greycat.


index1: #bash
index2: g2
last_referenced_in: j4ck_4l0n3
owner: bronze
ref_user: J4ck_4l0n3!~u0_a108@host178-183-dynamic.56-82-r.retail.telecomitalia.it
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.


index1: #bash
index2: g3
last_referenced_in: j4ck_4l0n3
owner: bronze
ref_user: J4ck_4l0n3!~u0_a108@host178-183-dynamic.56-82-r.retail.telecomitalia.it
type: text
action:
  /say # greycat has counted to infinity. Twice. He did it with a bash script he wrote, using perfect quotes.


index1: #bash
index2: gentooitis
owner: tobor
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.


index1: #bash
index2: gentooner
owner: kojiro
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.


index1: #bash
index2: get-bash
owner: sjohnson
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)


index1: #bash
index2: gethelp
owner: bronze
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.


index1: #bash
index2: getopt
owner: \amethyst
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.


index1: #bash
index2: getopts
last_referenced_in: koisoke
owner: Riviera
ref_user: koisoke!xef4@epilogue.org
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


index1: #bash
index2: getrange
owner: mattcen
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


index1: #bash
index2: getrange2
owner: izabera
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


index1: #bash
index2: git
last_referenced_in: ##c-offtopic
owner: geirha
ref_user: nai!~naim@nai.im
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


index1: #bash
index2: glob
owner: lhunath
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


index1: #bash
index2: globdots
owner: e36freak
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


index1: #bash
index2: globstar
last_referenced_in: j4ck_4l0n3
owner: izabera
ref_user: J4ck_4l0n3!~u0_a108@host178-183-dynamic.56-82-r.retail.telecomitalia.it
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.


index1: #bash
index2: golfing
last_referenced_in: ##c
owner: kojiro
ref_user: allisio!~allisio@24-181-54-41.dhcp.gnvl.sc.charter.com
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


index1: #bash
index2: good
owner: greycat
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!"


index1: #bash
index2: google
last_referenced_in: glacial
owner: twb
ref_user: glacial!~glacial@unaffiliated/glacial
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)


index1: #bash
index2: gotofail
last_referenced_in: ##c-offtopic
owner: lhunath
ref_user: oldlaptop!~quassel@45.63.78.126
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


index1: #bash
index2: graybot
last_referenced_in: ##c
owner: yitz_
ref_user: mahakal!~UserName@unaffiliated/mahakal
type: text
action:
  /say graybot is a clone of greybot that gets put into play when greybot is MIA and yitz_ notices it first.


index1: #bash
index2: grep
last_referenced_in: ##c-offtopic
owner: lhunath
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
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.


index1: #bash
index2: grep-o
owner: e36freak
ref_user: nobody
type: text
action:
  /say similar functionality to GNU grep -o with bash and POSIX AWK: https://github.com/e36freak/ogrep


index1: #bash
index2: grepawk
owner: kojiro
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 }'


index1: #bash
index2: greycatrev
owner: greycat
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"; }


index1: #bash
index2: guess
last_referenced_in: ##c-offtopic
owner: kojiro
ref_user: nil!~n@monade.li
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.


index1: #bash
index2: guide
last_referenced_in: sourab
owner: geirha
ref_user: sourab!~sourab@2409:4053:201b:62c4:f113:9c6:21e2:9d1c
type: text
action:
  /say <http://mywiki.wooledge.org/BashGuide>. PDF: <http://s.ntnu.no/bashguide.pdf>. Also lhunath's newer version (work in progress): <http://guide.bash.academy>


index1: #bash
index2: handhold
owner: tuxdev
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


index1: #bash
index2: hash
owner: greycat
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.


index1: #bash
index2: hastebin
owner: greycat
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


index1: #bash
index2: hate
owner: oMish_
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.


index1: #bash
index2: headtail
owner: izabera
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


index1: #bash
index2: heirloom
owner: \amethyst
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


index1: #bash
index2: hello
last_referenced_in: glacial
owner: pragma_
ref_user: glacial!~glacial@unaffiliated/glacial
type: text
action:
  /say One responds to '/msg greybot faq term' -- Try: /msg greybot links <ENTER> Any command except learn and forget can be used in pm.


index1: #bash
index2: help
owner: mute
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.


index1: #bash
index2: hi
last_referenced_in: glacial
owner: llua
ref_user: glacial!~glacial@unaffiliated/glacial
type: text
action:
  /say <Guest39402> hi. *5 minute pause* <Guest39402> how do I [insert confusing question about a convoluted piece of code to solve an imaginary problem here] ?


index1: #bash
index2: hidden
owner: geirha
ref_user: nobody
type: text
action:
  /say Why files starting with dot (.) are "hidden": https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp


index1: #bash
index2: histcontrol
owner: koala_man
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.


index1: #bash
index2: histignore
owner: koala_man
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.


index1: #bash
index2: history
last_referenced_in: ##c-offtopic
owner: Bronze
ref_user: nil!~n@monade.li
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.


index1: #bash
index2: homebin
owner: kurahaupo
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)


index1: #bash
index2: homework
owner: greycat
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."


index1: #bash
index2: how
last_referenced_in: pragma-
owner: greycat
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
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.


index1: #bash
index2: html
last_referenced_in: ##c-offtopic
owner: lhunath
ref_user: reberti!~reberti@138.122.30.89
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()' - <<< '<body><p id="head">Hello, <b class="name">Bob' -- Ask #xml for XPath/XSLT help, that is not a #bash question.


index1: #bash
index2: huh
last_referenced_in: li_
owner: igli
ref_user: li_!~jo.2343@130.193.199.73
type: text
action:
  /say What are you really trying to do? In a sentence or two please. Not which tool you think is the right one to use, and what you are trying to do with it. Just the actual task at hand.


index1: #bash
index2: human-size
last_referenced_in: ##c
owner: lhunath
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  /say num=23803400; suffixes=( '' KiB MiB GiB TiB ); s=0; while (( num / 1024 )); do (( ++s, num/=1024 )); done; echo "$num ${suffixes[s]}"


index1: #bash
index2: hurry
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: nil!~n@monade.li
type: text
action:
  /say You're in a hurry? Well, then let's start with a brief history of the shell. But first, let's start by learning Unix. And before that, let's start with a brief synopsis of the major formative events of Western civilization....


index1: #bash
index2: ideas
owner: greycat
ref_user: nobody
type: text
action:
  /say Yeah, here's an idea! Ask your question in plain, simple English, and all on one line. Make your goal clear. Include all the relevant information. Give examples, especially of errors.


index1: #bash
index2: idiot!
owner: oMish
ref_user: nobody
type: text
action:
  /say You -- yes, you -- are an idiot! Here are some other idiots in whose company you may find solace: http://wooledge.org/mywiki/Idiot


index1: #bash
index2: if
owner: ormaaj
ref_user: nobody
type: text
action:
  /say See: http://mywiki.wooledge.org/BashGuide/TestsAndConditionals#Conditional_Blocks and http://wiki.bash-hackers.org/syntax/ccmd/if_clause


index1: #bash
index2: if[
owner: lhunath
ref_user: nobody
type: text
action:
  /say [ is NOT part of the `if' syntax. It's a normal, ordinary COMMAND, like grep and rm. Like `if grep ..', `if [' just checks its exit status. And just like `ifgrep`, `if[` is wrong. http://mywiki.wooledge.org/BashGuide/TestsAndConditionals


index1: #bash
index2: ifgrep
owner: greycat
ref_user: nobody
type: text
action:
  /say if grep -q word "$file"; then blah blah; fi # DO NOT use [[ or [ or ` or $() or any other crap. "if" expects a command. "grep" is a command. "[" is too. You don't need both. Likewise, if foo | grep -q bar; then ...


index1: #bash
index2: ifs
owner: TheBonsai
ref_user: nobody
type: text
action:
  /say Internal Field Separator (or Input Field Separator), used to break things into words. See http://mywiki.wooledge.org/IFS and http://mywiki.wooledge.org/BashFAQ/001 and http://bash-hackers.org/wiki/doku.php/syntax/words


index1: #bash
index2: ifs-local
owner: kurahaupo
ref_user: nobody
type: text
action:
  /say Do not change the shell's ongoing value of IFS, rather only apply different values in the prefix environment of the individual commands that need it. So use 'IFS=^ read foo' instead of 'IFS=^ ; read foo' (or 'IFS=^' (newline) 'read foo')


index1: #bash
index2: ifsread
owner: Riviera
ref_user: nobody
type: text
action:
  /say An assignment with a command like ''LC_ALL=C grep ..'' only affects the environment of that executed command. See ENVIRONMENT and SIMPLE COMMAND EXPANSION in ''man bash''. (POSIX "special built-ins" (''enable -s'') are an exception when bash is run in POSIX mode, see IEEE Std 1003.1-2013, section 2.14.)


index1: #bash
index2: ii
owner: Riviera
ref_user: nobody
type: text
action:
  /say ii is a minimalist FIFO and filesystem-based IRC client, allowing IRC communication from the command line with bash: http://tools.suckless.org/ii/


index1: #bash
index2: imabot
last_referenced_in: ##c
owner: kwtm
ref_user: kurahaupo!~kurahaupo@61.68.145.67
type: text
action:
  /say I am only a software bot, programmed to hand out information. Talk to the person who last said something beginning with "!" before I spoke; that's the person who asked me to say something.


index1: #bash
index2: in1line
owner: ferret
ref_user: nobody
type: text
action:
  /say There isn't a world shortage of bash commands, and having newlines in your script does not make it slower


index1: #bash
index2: inarray
owner: izabera
ref_user: nobody
type: text
action:
  /say Check whether a value is in an array: inarray() { local n=$1 h; shift; for h; do [[ $n = "$h" ]] && return; done; return 1; } # Usage: inarray "$value" "${array[@]}" Or just use an associative array if possible


index1: #bash
index2: inarray2
owner: greycat
ref_user: nobody
type: text
action:
  /say Check whether a value is one of an array's elements: found=0; for i in "${arr[@]}"; do if [[ $i = "$value" ]]; then found=1; break; fi; done


index1: #bash
index2: indirection
owner: lhunath
ref_user: nobody
type: text
action:
  /say Bash is one of the few languages that causes a brain glitch in most people's heads making them want to put data in variable names. Don't do that. You probably want associative arrays or functions instead.


index1: #bash
index2: inetd
owner: greycat
ref_user: nobody
type: text
action:
  /say The problem with inetd is that you have to edit a monolithic config file as root to add a new service. If you're an end user, why should you need the power to break lots of other services just to run your hello world daemon? Try tcpserver instead (http://cr.yp.to/ucspi-tcp.html).


index1: #bash
index2: info
last_referenced_in: #bash
owner: igli
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say GNU documentation is often not in the form of manpages (which would be nice, cf ''man bash'') but rather in info, so one types eg ''info make''. pinfo is a useful utility.


index1: #bash
index2: inject
owner: lhunath
ref_user: nobody
type: text
action:
  /say Injecting data into a type of code is always wrong. Convert your data into code that represents that data before injecting it. This is called quoting or escaping. See ![language]quote (eg. !bashquote !htmlquote !mysqlquote !requote !urlquote)


index1: #bash
index2: injection
last_referenced_in: #cjeopardy
owner: lhunath
ref_user: [Franklin]!~me@unaffiliated/franklin
type: text
action:
  /say NEVER combine two strings of a different context. First convert them to the target context. BAD: ssh host "rm $file" GOOD: ssh host "$(printf 'rm %q' "$file")" - BAD: mysql -e "INSERT Students SET Name=$name" GOOD: mysql -e "INSERT Students SET Name=$(mysqlquote "$name")" - Try ![lang]quote (eg. !shquote, !requote, !urlquote, ...)


index1: #bash
index2: inotify
owner: ormaaj
ref_user: nobody
type: text
action:
  /say inotifywait is a shell interface to the Linux inotify API for filesystem events. inotifywait isn't safe for robust scripts because it can't output nul delimiters. Better cross-platform alternatives are watchdog (python) and System.IO.FileSystemWatcher (mono/.NET) which both support inotify, kqueue, Windows fs events, etc. https://github.com/rvoicilas/inotify-tools/


index1: #bash
index2: inplace
owner: yitz_
ref_user: nobody
type: text
action:
  /say You can not do: cmd < file > file. Use a tmp file (see man mktemp). To inplace edit, you can use ed. GNU sed -i can hide the magic, too


index1: #bash
index2: interpreter
owner: greycat
ref_user: nobody
type: text
action:
  /say WTF interpreter? https://github.com/stephane-chazelas/misc-scripts/blob/master/which_interpreter or http://stchaz.free.fr/which_interpreter or https://raw.github.com/mauke/poly.poly/master/poly.poly


index1: #bash
index2: invocation
owner: ormaaj
ref_user: nobody
type: text
action:
  /say Invocation is important and will change how your script behaves. /bin/sh is *ALWAYS* different from /bin/bash. http://wiki.bash-hackers.org/scripting/bashbehaviour


index1: #bash
index2: ipc
owner: lhunath
ref_user: nobody
type: text
action:
  /say To communicate between processes, you can use file descriptors (stdin/stdout/...), (named) pipes (mkfifo or |), files, exit codes ($?) or signals (trap + kill). If you are *starting* the other process you can also pass arguments or environment variables.


index1: #bash
index2: is_dir_in_path
owner: e36freak
ref_user: nobody
type: text
action:
  /say Check if a directory is in your PATH: is_dir_in_path() { local path d; IFS=: read -ra path <<<"$PATH"; for d in "${path[@]}"; do [[ $d -ef ${1:-.} ]] && return; done; return 1; } ## Usage: is_dir_in_path [dir]


index1: #bash
index2: isanyonehere
last_referenced_in: #pbot2
owner: kwtm
ref_user: \[!~qwename@unaffiliated/qwename
type: text
action:
  /say If you are asking whether there is anyone here who is able to help you, then we are certainly able to answer that question for you. To obtain your answer, type an exclamation point (that is, "!") and then type (without any intervening spaces) "randomanswer". We are glad to be able to help you. You may also ask any other questions you have, especially any question more relevant than the one that was just asked.


index1: #bash
index2: isempty
owner: ormaaj
ref_user: nobody
type: text
action:
  /say Test if a directory is empty: function isEmpty { typeset dir=${1-.}; [[ -d $dir && -z $(find "$dir" ! -empty \( -printf x -quit \)) ]]; }


index1: #bash
index2: isset
owner: Riviera
ref_user: nobody
type: text
action:
  /say http://mywiki.wooledge.org/BashFAQ/083 -- How do I determine whether a variable is already defined? Or a function?


index1: #bash
index2: it
last_referenced_in: #pbot2-test
owner: kojiro
ref_user: Benett!~Benett@unaffiliated/benett
type: text
action:
  /say 'it' and other pronouns can hide important information. Try not to use pronouns -- instead give specific proper names for what you're doing, so we don't have to guess or assume.


index1: #bash
index2: itworks
owner: Riviera
ref_user: nobody
type: text
action:
  /say It is a usual technique to make a program and then to test it. But: program testing can be a very effective way to show the presence of bugs, but it is hopelessly inadequate for showing their absence. -- Edsger W. Dijkstra


index1: #bash
index2: ix
owner: lhunath
ref_user: nobody
type: text
action:
  /say Upload to http://ix.io from your terminal: <command> | curl -n -F 'f:1=<-' http://ix.io # Or use the 'ix' client: curl http://ix.io/client -o /usr/local/bin/ix


index1: #bash
index2: ix.io
owner: yitz_
ref_user: nobody
type: text
action:
  /say To upload to sprunge from your terminal, use: <command> | curl -F 'f:1=<-' ix.io # or see !sprungefunc for ideas to make an ixiofunc


index1: #bash
index2: job
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: nai!~naim@monade.li
type: text
action:
  /say Job control can be used to interact with background and suspended jobs. See http://mywiki.wooledge.org/BashGuide/JobControl


index1: #bash
index2: jobspec
owner: greycat
ref_user: nobody
type: text
action:
  /say Use %42 to refer to a job by number, %vi by name, %?macs by part of the name, %% for the current job, and %- for the previous. http://mywiki.wooledge.org/BashGuide/JobControl#jobspec


index1: #bash
index2: join
owner: greycat
ref_user: nobody
type: text
action:
  /say You can "join" an array (write it with a single character of your choice between elements) using: IFS='|'; echo "${array[*]}"; unset IFS


index1: #bash
index2: json
last_referenced_in: ##c-offtopic
owner: izabera
ref_user: nil!~n@monade.li
type: text
action:
  /say flexible and lightweight JSON processor: http://stedolan.github.com/jq/ -- Query JSON data: http://kmkeen.com/jshon/


index1: #bash
index2: jsonquote
last_referenced_in: ##c-offtopic
owner: lhunath
ref_user: garp!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say Prepare literal data for injection into JSON code: jsonquote() { jshon -Qs "$1"; }; curl -d "$(printf '{"name":%s}' "$(jsonquote "$USER")")" http://server/service


index1: #bash
index2: jwz
last_referenced_in: #pbot2
owner: greycat
ref_user: acerbic!~acerbic@2602:30a:2cf9:4710:f27b:cbff:fe81:c6b3
type: text
action:
  /say "Some people, when confronted with a problem, think ``I know, I'll use regular expressions.'' Now they have two problems." | http://xkcd.org/1171/


index1: #bash
index2: k&p
owner: igli
ref_user: nobody
type: text
action:
  /say "The UNIX Programming Environment" Kernighan & Pike: http://www.amazon.com/exec/obidos/ASIN/013937681X/dds-20


index1: #bash
index2: keysort
owner: BlastHardcheese
ref_user: nobody
type: text
action:
  /say keysort(){ unset b;local i j k n=0;for k in "${!a[@]}";do for((i=0;i<n;i++));do if((${a[${b[i]}]}>${a[$k]}));then for((j=n;j>i;j--));do b[j]=${b[j-1]};done;break;fi;done;b[i]=$k;((n++));done;}# copies the keys of associative array a into b, sorted by the keys' corresponding values


index1: #bash
index2: kill
last_referenced_in: #pbot2
owner: lhunath
ref_user: jp!ayy@youlosethega.me
type: text
action:
  /say kill is a bash built-in that can send signals to a process or job. kill -[signal] [pid]... You can also use it to see if a process is alive: if kill -0 "$mypid"


index1: #bash
index2: killall
last_referenced_in: ##c-offtopic
owner: kojiro
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  /say killall is dangerous and unportable. On some systems it tries to kill every process. Use pkill instead.


index1: #bash
index2: ksh
owner: ormaaj
ref_user: nobody
type: text
action:
  /say "ksh" refers to the Korn shell by David G. Korn at Bell labs. The original Korn shell (ksh88) was the basis for the POSIX sh specification. More generally, it is a family of languages derived from the Bourne and later Korn shells, which includes Bash, zsh, and others.


index1: #bash
index2: ksh93
last_referenced_in: #cjeopardy
owner: ormaaj
ref_user: zjkj!~zjkj@80.83.238.51
type: text
action:
  /say ksh93 refers to current editions of the AT&T Korn shell. ksh93 is actively developed as part of AT&T's AST collection. If you need a shell that resembles a "real" programming language (e.g. Perl, Python) ksh93 is about as close as you can get. /j #ksh • http://www2.research.att.com/sw/download/


index1: #bash
index2: kshfork
owner: ormaaj
ref_user: nobody
type: text
action:
  /say Some tests showing where ksh93 subshells cause a fork: http://stackoverflow.com/a/15312007/495451


index1: #bash
index2: kwtmnoob
owner: kwtm
ref_user: nobody
type: text
action:
  /say kwtm is a noob, so be careful applying what he says. Even *I* have more experience with bash than kwtm, and I'm just a bot program!


index1: #bash
index2: lamebins
owner: Fenia
ref_user: nobody
type: text
action:
  /say pastebins are lame because they are regularely used to show tons of stuff unrelated to the actual problem. the real problem normaly only spans a few commands that can easily put on one line and communicated in the channel directly.


index1: #bash
index2: lart
owner: greycat
ref_user: nobody
type: text
action:
  /say ls -lart # very useful to see the files in the current directory sorted by modification time, so you know what has been touched most recently, and hence, where to look for the errors. See !rlart


index1: #bash
index2: last
last_referenced_in: fluter
owner: izabera
ref_user: fluter!~fluter@fedora/fluter
type: text
action:
  /say Dereference last element of an array - Bash 4.2 or later: "${array[-1]}", <= 4.1.x: "${array[@]:(-1)}". Since 4.3 you can assign to negative values, if the element already exists.


index1: #bash
index2: lastpipe
owner: geirha
ref_user: nobody
type: text
action:
  /say If set (shopt -s lastpipe), and job control is not active, the shell runs the last command of a pipeline not executed in the background in the current shell environment. Bash 4.2 and newer only.


index1: #bash
index2: latest
owner: izabera
ref_user: nobody
type: text
action:
  /say Find the latest modified file in a directory: latest() { local file latest; for file in "${1:-.}"/*; do [[ $file -nt $latest ]] && latest=$file; done; printf '%s\n' "$latest"; } ## Usage: latest [dir]


index1: #bash
index2: laziness
last_referenced_in: damien22
owner: greycat
ref_user: Damien22!~Damien@61.173.41.215
type: text
action:
  /say LAZINESS: The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful, and document what you wrote so you don't have to answer so many questions about it. Hence, the first great virtue of a programmer.


index1: #bash
index2: lc
last_referenced_in: #pbot2
owner: igli
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say export $(locale); unset LC_ALL # and then override whatever you want like LC_COLLATE (if you *really* have to.) DO NOT override LC_CTYPE.


index1: #bash
index2: lc_all
owner: kojiro
ref_user: nobody
type: text
action:
  /say don't set LC_ALL globally. Set LANG, set LC_(everything_else), but save LC_ALL for when you need to run one-time tests. Never set it globally or permanently. Use LANG to set default locale settings.


index1: #bash
index2: leap
owner: greycat
ref_user: nobody
type: text
action:
  /say isleapyear() { if (($1 % 400 == 0)); then return 0; elif (($1 % 100 == 0)); then return 1; elif (($1 % 4 == 0)); then return 0; else return 1; fi; }


index1: #bash
index2: learn
owner: Bronze
ref_user: nobody
type: text
action:
  /say "If I would like to learn I would go to school or google this shit myself. Why would I even ask here?" kicked Oxymoron from #bash (moron detected)


index1: #bash
index2: leet
owner: igli
ref_user: nobody
type: text
action:
  /say We *hate* leet-speek.. We might indulge in the occasional lol, but seriously, take it to #kindergarten.. ;)


index1: #bash
index2: leftstr:
owner: bronze
ref_user: nobody
type: text
action:
  /say Bash does the "leftstr" operation using the PE capabilities. here is a Bash function that does a leftstr operation: leftstr() { echo ${1:0:$2}; } usage is: leftstr "somestring" count to use that function try leftstr "abcdefg" 4 ;


index1: #bash
index2: let
last_referenced_in: ##c-offtopic
owner: ormaaj
ref_user: nil!~n@monade.li
type: text
action:
  /say Evaluates its arguments as arithmetic. The arithmetic compound command should almost always be preferred. http://wiki.bash-hackers.org/commands/builtin/let See: !((


index1: #bash
index2: lftp
owner: lhunath
ref_user: nobody
type: text
action:
  /say $ lftp myname@server/some/directory -e 'mput *.gif; quit' # Read "man netrc" to learn how to store your password as cleartext in a file, and read http://mywiki.wooledge.org/FtpMustDie


index1: #bash
index2: liar
last_referenced_in: ##c
owner: bronze
ref_user: wroathe!~wroathe@c-68-54-25-135.hsd1.mn.comcast.net
type: text
action:
  /say ARRRgghhh! Please come up with a description of your question that is both coherent and consistent. You may actually have to take a moment to think about this, but please do so. perhaps you may want to use a pastebin.


index1: #bash
index2: lies
last_referenced_in: ##spinach
owner: kojiro
ref_user: oldlaptop!~quassel@45.63.78.126
type: text
action:
  /say We're far more likely to help you if you're up front. Tell us as much as you know about your problem, as early as possible. Neglecting to tell us you don't actually use bash is akin to a lie.


index1: #bash
index2: links
owner: geirha
ref_user: nobody
type: text
action:
  /say man bash | http://mywiki.wooledge.org/BashGuide | http://mywiki.wooledge.org/BashFAQ | http://mywiki.wooledge.org/BashPitfalls | http://wiki.bash-hackers.org | http://www.shellcheck.net


index1: #bash
index2: list
owner: nDuff
ref_user: nobody
type: text
action:
  /say This is a channel for technical assistance. There are no DCC bots here, and it is absolutely the wrong place to be looking for warez.


index1: #bash
index2: lists
last_referenced_in: mahakal
owner: lhunath
ref_user: mahakal!~UserName@unaffiliated/mahakal
type: text
action:
  /say In bash, a list of things is expressed using arrays: things=( Bob "Long John" /home/* ). Do NOT use string variables (things="Bob Long John /home/*") and do NOT use wordsplitting: for thing in $(find /things/*). See !arrays !wordsplitting !drlwf !quotewhen


index1: #bash
index2: loc
last_referenced_in: ##c
owner: igli
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  /say Give us a line or two of code: it's really hard to know what you're talking about otherwise.. ;-)


index1: #bash
index2: logging
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: nil!n@monade.li
type: text
action:
  /say To log all subsequent output (+ stderr): exec >>somefile 2>&1 ## To log all your actions, plus stdout+stderr, add set -x after that. ## To log *and also pass through* see http://mywiki.wooledge.org/BashFAQ/106


index1: #bash
index2: lol
last_referenced_in: miremaster64_
owner: greycat
ref_user: miremaster64_!~miremaste@178-223-17-81.dynamic.isp.telekom.rs
type: text
action:
  /say An abbreviation for "laughing out loud", often typed by people who are not doing so. Sometimes used as punctuation, inexplicably. Generally, an indicator of substandard mental facilities. Avoid using "lol" in your online communications unless you want to project the image of an incompetent bumbler.


index1: #bash
index2: lolspeak
last_referenced_in: ##c-offtopic
owner: fr33loader
ref_user: nai!~naim@monade.li
type: text
action:
  /say lolspeak: An annoying style of texting whose usage has unfortunately evolved widespread across the Internet. Using lolspeaks like lol, omg, lmao, gtfo, stfu, thx, kk, etc. is *NOT* cool or hip but rather a telling indicator of low intelligence.


index1: #bash
index2: lolz
last_referenced_in: ##c-offtopic
owner: igli
ref_user: taylor!~krok@unaffiliated/krok
type: text
action:
  /say Some people really hate us laughing out loud at their FUCKING RANTING.. lolz is *guaranteed* to piss em off ;P


index1: #bash
index2: lookup
owner: igli
ref_user: nobody
type: text
action:
  /say lookup() { local l; case $# in 0) return;; 1) l=bash;; *) l=$1; shift;; esac; man "$l" -P "less -p '$*'"; } # lookup 'Parameter Expansion' or lookup bash Parameter Expansion


index1: #bash
index2: low
last_referenced_in: ##c-offtopic
owner: e36freak
ref_user: atk!Arch-TK@ircpuzzles/staff/Arch-TK
type: text
action:
  /say low() { local low=$1 i; shift; for i; do ((i < low)) && low=$i; done; printf '%s\n' "$low"; } # finds the lowest numeric value out of the given arguments. usage: low "${array[@]}" or low "$val1" "$val2" ... "$valN"


index1: #bash
index2: ls
last_referenced_in: garp
owner: lhunath
ref_user: garp!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say DO NOT USE ls' output for anything. ls is a tool for interactively looking at directory metadata. Any attempts at parsing ls' output with code are broken. Globs are much more simple AND correct: ''for file in *.txt''. Read http://mywiki.wooledge.org/ParsingLs


index1: #bash
index2: ls@
owner: greycat
ref_user: nobody
type: text
action:
  /say On Mac OS X, a file with "extended attributes" shows an '@' character after the permissions in 'ls -l' format. See ls(1). A '+' generally means the file has an ACL (on many OSes).


index1: #bash
index2: lsalt
owner: igli
ref_user: nobody
type: text
action:
  /say for f in *; do stuff -with "$f"; done # will cope with *any* filename. http://wooledge.org/mywiki/glob array=(*) -- works too ;)


index1: #bash
index2: ltq
owner: lhunath
ref_user: nobody
type: text
action:
  /say Learn to quote. It is probably the most important shell scripting skill you will ever need. You should quote every parameter expansion (eg. echo "$foo" > "$bar") and every string that contains shell metacharacters which you really just want to pass literally to the application (eg. find /foo -name '*.bar').


index1: #bash
index2: magicalias
owner: ormaaj
ref_user: nobody
type: text
action:
  /say Magic aliases: a dire hack, fraught with peril and doom. http://www.chiark.greenend.org.uk/~sgtatham/aliases.html improved version: https://gist.github.com/ormaaj/5a969c62bab8d21fe468


index1: #bash
index2: mail
owner: pgas
ref_user: nobody
type: text
action:
  /say To send email from a bash script, use one of: mailx (POSIX), mail, sendmail, or a MUA such as mutt, pine, ... see http://www.shelldorado.com/articles/mailattachments.html


index1: #bash
index2: make
owner: greycat
ref_user: nobody
type: text
action:
  /say Make is not bash, and Makefiles are not scripts. Ask in ##workingset and read http://www.gnu.org/software/make/manual/ or the help documents of your version of make.


index1: #bash
index2: makefile
owner: kurahaupo_
ref_user: nobody
type: text
action:
  /say Makefiles consist of rules, each comprising a build-pattern and some commands. Those commands are macro-expanded similarly to the shell's parameter expansions, and then given to the shell, one line at a time. So anything involving shell variables has to be written with $$ instead of $, and with semicolons instead of newlines. Also see !make


index1: #bash
index2: makesense
owner: lhunath
ref_user: nobody
type: text
action:
  /say Before we can help you, you need to explain the problem so that we can all understand it. Proper grammar and some logical structure in your sentences helps a lot. Nobody helps if they need to guess what the problem really is.


index1: #bash
index2: manpage
owner: geirha
ref_user: nobody
type: text
action:
  /say bash builtins and keywords do not have separate man-pages, read bash's manual instead or use the help builtin. Rule of thumb: If type foo says foo is a builtin or keyword, run help foo or man bash, otherwise try man and/or info.


index1: #bash
index2: mantra
last_referenced_in: ##c
owner: greycat
ref_user: albinosik!05645bfe@gateway/web/freenode/ip.5.100.91.254
type: text
action:
  /say And just one more thing: on your way out I want you to take the time to learn the #bash mantra. "Greybot is always right. I will listen to greybot. I will not ignore greybot's recommendations. Greybot is God. And if this ever happens again, greybot will PERSONALLY rip your lungs out!"


index1: #bash
index2: many
owner: lhunath
ref_user: nobody
type: text
action:
  /say There are many ways to solve a problem. To find the best way for you, we need to know more context. Where does the data come from? Where do you want it to go to? Don't think in terms of implementation; rather purpose.


index1: #bash
index2: map
last_referenced_in: #pbot2
owner: greycat
ref_user: qwename!~qwename@unaffiliated/qwename
type: text
action:
  /say Bash doesn't have a perl-style "map" command (you'll have to make a loop). If you meant C++ style "maps", bash 4.0 and later have associative arrays, but no earlier version supports them.


index1: #bash
index2: mapfile
owner: geirha
ref_user: nobody
type: text
action:
  /say Read lines from a file (or stdin) into an array: mapfile -t lines < file # in bash < 4, use: while IFS= read -r line; do lines[i++]=$line; done < file # See http://wiki.bash-hackers.org/commands/builtin/mapfile


index1: #bash
index2: marquee
owner: osse
ref_user: nobody
type: text
action:
  /say marquee() { local i=${COLUMNS:=$(tput cols)} w=${#1}; while ((i-- > w)); do printf '\r%*s ' "$i" "$1"; sleep 0.02; done; printf '\r'; }


index1: #bash
index2: matrix
owner: greycat
ref_user: nobody
type: text
action:
  /say You can simulate simple 2-dimensional matrices in bash (which only has 1-dimensional arrays) using tricks, like ${array[i*100+j]} (where "100" can be any suitably large constant).


index1: #bash
index2: max
owner: e36freak
ref_user: nobody
type: text
action:
  /say max() { local max=$1 i; shift; for i; do ((i > max)) && max=$i; done; printf '%s\n' "$max"; } # finds the highest numeric value out of the given arguments. usage: max "${array[@]}" or max "$val1" "$val2" ... "$valN"


index1: #bash
index2: meaningful
owner: sikilpaake
ref_user: nobody
type: text
action:
  /say meaningful learning, as opposed to rote learning, involves taking new concepts and incorporating them within a given individual's existent cognitive structure http://en.wikipedia.org/wiki/Meaningful_learning


index1: #bash
index2: mergedir
owner: ormaaj
ref_user: nobody
type: text
action:
  /say Merge several directories of files with overlapping names into a single dir (requires ksh93) https://gist.github.com/ormaaj/56648862739d597cd0b1


index1: #bash
index2: meta
owner: lhunath
ref_user: nobody
type: text
action:
  /say Retrieving file metadata and doing it in a portable fashion is very difficult. If at all possible; you should use test instead. If you really need the actual metadata; considder the non-portable stat(1) or the dangerous-to-parse ls(1).


index1: #bash
index2: minimal
last_referenced_in: othias
owner: ivazquez
ref_user: othias!504e0570@gateway/web/freenode/ip.80.78.5.112
type: text
action:
  /say Paste a minimal example of code that exhibits the problem. Digging through a 2000-line script for a 2-line problem wastes everyone's time.


index1: #bash
index2: mirror
owner: BlastHardcheese
ref_user: nobody
type: text
action:
  /say Mirror of mywiki.wooledge.org: http://pgas.freeshell.org/mirror/wooledge/ - to see faq NNN: http:/para.ms/bf/NNN


index1: #bash
index2: mksh
owner: ormaaj
ref_user: nobody
type: text
action:
  /say mksh is the successor to pdksh. mksh is fast, powerful, lightweight, POSIX-compatible, and has many nice extensions from ksh93/88 and Bash, and a few of its own. If you're using pdksh, upgrade to mksh. /j #!/bin/mksh • https://www.mirbsd.org/mksh.htm


index1: #bash
index2: mod3
owner: kurahaupo
ref_user: nobody
type: text
action:
  /say kurahaupo's regular expression for matching numbers that are multiple of 3: ^([0369]|[147]([0369]|[147][0369]*[258])*[147][0369]*[147]|[258]([0369]|[258][0369]*[147])*[258][0369]*[258]|[147]([0369]|[147][0369]*[258])*[258]|[258]([0369]|[258][0369]*[147])*[147])*$


index1: #bash
index2: mom
last_referenced_in: ##c
owner: savetheWorld
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say we believe you, but there are a number of requirements left undefined. Rather than asking questions to elicit those, we have found its faster if you state a high level description of your goal. Pretend you're telling your Mom.


index1: #bash
index2: msg
owner: kojiro
ref_user: nobody
type: text
action:
  /say You don't really want to msg us. These aren't the droids you're looking for. You can go about your business, or talk in the channel like everyone else. Move along, move along...


index1: #bash
index2: mta
owner: greycat
ref_user: nobody
type: text
action:
  /say MTA, Mail Transfer Agent (or Mail Transport Agent). Software that receives and delivers email. See http://wooledge.org/~greg/mail.html for basic definitions.


index1: #bash
index2: mtime
owner: kojiro
ref_user: nobody
type: text
action:
  /say File modification time. Marks the most recent time the file was created *or* its contents changed. While mtime is not a 'creation time', a file is not likely to be created after its mtime unless manual mtime tampering was done


index1: #bash
index2: mutex
last_referenced_in: koisoke
owner: lhunath
ref_user: koisoke!xef4@epilogue.org
type: text
action:
  /say A mutual exclusion lock ensures your script can only be running once. mkdir "$lockdir" && trap 'rm -rf "$lockdir"' EXIT || exit # Another option: exec 9>> "$lockfile" && [[ $({ fuser -f "$lockfile"; } 2>&- 9>&-) == $$ ]] || exit # (fuser also works read-only and cleanup is implicit) See http://mywiki.wooledge.org/BashFAQ/045 http://wiki.bash-hackers.org/howto/mutex


index1: #bash
index2: myfirewallsucks
owner: yitz_
ref_user: nobody
type: text
action:
  /say If your firewall or proxy blocks outgoing tcp port 8000 (preventing you from reading the wooledge.org wiki), you can get single pages using this URL scheme: http://wooledge.org/myfirewallsux/PageName. Note, however, that the resulting page will have broken hyperlinks on it.


index1: #bash
index2: mysqlquote
owner: lhunath
ref_user: nobody
type: text
action:
  /say mysqlquote() { local arg=${1//\\/\\\\}; printf %s "'${arg//\'/\'}'"; }; mysql <<< "UPDATE table SET foo=$(mysqlquote "$foo")"


index1: #bash
index2: nabp
owner: kojiro
ref_user: nobody
type: text
action:
  /say Not A Bash Problem: Your question is application or operating system specific. In the case of Linux, it is distribution-specific. Please refer to your application, distribution, or operating system's support. Have a nice day.


index1: #bash
index2: nabq
owner: izabera
ref_user: nobody
type: text
action:
  /say Not a #bash question. We're no experts in that software or OS; consider asking the channel or mailing list with experts on that topic (eg. ##linux #openssh #ubuntu #zsh).


index1: #bash
index2: name
last_referenced_in: oldlaptop
owner: greycat
ref_user: oldlaptop!~quassel@45.63.78.126
type: text
action:
  /say Variable names may only contain letters, digits, and the underscore. They may not begin with a digit. Also called an "identifier".


index1: #bash
index2: nameref
owner: ormaaj
ref_user: nobody
type: text
action:
  /say namerefs (typeset -n) are a ksh93 feature that work like C++ references for passing data structures between functions. Bash 4.3+ and mksh have a limited but usable version of namerefs. http://mywiki.wooledge.org/BashFAQ/006 https://gist.github.com/ormaaj/5682807


index1: #bash
index2: nbsp
owner: geirha
ref_user: nobody
type: text
action:
  /say In some graphical environments, Alt+space, Alt Gr+space or Option+space generate a non-breaking space instead of a regular space. They look the same to us, but not to the shell. ''sed -n l'' will display them differently than regular spaces


index1: #bash
index2: nest#!
owner: greycat
ref_user: nobody
type: text
action:
  /say You cannot generally nest #! -- see http://www.in-ulm.de/~mascheck/various/shebang/#interpreter-script


index1: #bash
index2: netcat
last_referenced_in: ##c
owner: yitz_
ref_user: latemus!~l@unaffiliated/latemus
type: text
action:
  /say Netcat is a simple Unix utility which reads and writes data across network connections, using TCP or UDP protocol.


index1: #bash
index2: newer
owner: koala_man
ref_user: nobody
type: text
action:
  /say Find all files last modified yesterday (GNU find): find . -newermt 'yesterday 00:00' ! -newermt 'today 00:00'


index1: #bash
index2: newer2
owner: greycat
ref_user: nobody
type: text
action:
  /say Find all files last modified yesterday (GNU date): y=$(date -d yesterday +%Y%m%d) t=$(date +%Y%m%d); touch -t ${y}0000 /tmp/yesterday; touch -t ${t}0000 /tmp/today; find . -newer /tmp/yesterday ! -newer /tmp/today; rm /tmp/{yesterday,today} # Or use $HOME instead of /tmp


index1: #bash
index2: nih
last_referenced_in: ##c
owner: \amethyst
ref_user: areckx!~areckx@184.21.92.97
type: text
action:
  /say Not Invented Here: the tendency to discount the usefulness or importance of work done by other groups. May lead to reinventing the wheel.


index1: #bash
index2: nl
owner: ferret
ref_user: nobody
type: text
action:
  /say ''nl'' is the standard posix utility for numbering lines read from standard input, e.g.: nl -b a -w 1 <file


index1: #bash
index2: nlatest
owner: mattcen
ref_user: nobody
type: text
action:
  /say N latest, requires GNU find + sort. usage: nlatest 10 [somedir]: nlatest() { local file; find "${2:-.}" -maxdepth 1 -type f -printf '%T@ %p\0' | sort -znr | for (( i=0; i<$1; i++ )); do IFS= read -rd '' file || break; echo "${file#* }"; done; }


index1: #bash
index2: nmap
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: mr-robert!sid257242@gateway/web/irccloud.com/x-sid257242
type: text
action:
  /say nmap is a tool used by l33t Linux kiddies to scan hosts or networks for "open ports" (ones with a service listening) so they can launch a cyberattack. Or so they can have a wet dream about launching a cyberattack.


index1: #bash
index2: noclobber
owner: e36freak
ref_user: nobody
type: text
action:
  /say noclobber() { local start=$1 end=$2 i=0; while [[ -e $end ]]; do end=$2.$((++i)); done; mv "$start" "$end"; } # usage: noclobber "$from" "$target"


index1: #bash
index2: nohup
owner: BlastHardcheese
ref_user: nobody
type: text
action:
  /say nohup is a hacky wrapper that will execute a process while redirecting its output and preventing SIGHUP from reaching it (some implementations ignore additional signals). In bash, you probably want disown instead: ''command ... & disown''. Alternately, run your commands inside screen or tmux.


index1: #bash
index2: nonempty
owner: e36freak
ref_user: nobody
type: text
action:
  /say test if a directory is non-empty, without storing the filenames in an array: if : "$dir"/*; [[ -e $_ ]]; then # you may or may not want to enable dotglob beforehand as well


index1: #bash
index2: noobtorial
owner: savetheWorld
ref_user: nobody
type: text
action:
  /say Hmm, it seems you need to learn a bit more about some of the basics of the UNIX command line. we reccomend the following tutorials


index1: #bash
index2: nopaste
owner: kojiro
ref_user: nobody
type: text
action:
  /say Please don't waste our time by making us go to a pastebin just for a five-line snippet. Paste it in the channel. If you have a larger script that's showing problems, trim it down to the bare minimum size that still shows the problem. You'll probably fix it yourself once you do that.


index1: #bash
index2: noseq
owner: savetheWorld
ref_user: nobody
type: text
action:
  /say Instead of seq (slow, not portable) use the bash brace expansion feature: where a {1..10} produces 1 2 3 4 5 6 7 8 9 10


index1: #bash
index2: not
last_referenced_in: ##c-offtopic
owner: lhunath
ref_user: garp!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say You do NOT need cat to read file contents, ls to get file names, echo to output stuff or $()/`` to run commands. The specifics of your situation will dictate the correct syntax to use. Explain in English.


index1: #bash
index2: notatty
owner: greycat
ref_user: nobody
type: text
action:
  /say Bash is not a terminal. That thing that you type text into? That's a terminal. It's not bash. Just because you're running some program in a terminal doesn't make your question bash-related.


index1: #bash
index2: notbash
owner: greycat
ref_user: nobody
type: text
action:
  /say We only answer bash-related questions. Apt-get? #debian. Adding users? ##linux. Sending mail in a PHP script? #php. Makefiles? ##c or ##workingset. Complex regular expressions? #regex.


index1: #bash
index2: notitty
last_referenced_in: ##c-offtopic
owner: bronze
ref_user: mthowe-!uid249081@gateway/web/irccloud.com/x-uid249081
type: text
action:
  /say there's nothing in saying it can be done that implies sanity, reliability or locale sanctity. or any other kind of titty.....


index1: #bash
index2: notperl
last_referenced_in: #cjeopardy
owner: kojiro
ref_user: nchambers!4cd2bbbf@gateway/web/cgi-irc/kiwiirc.com/ip.76.210.187.191
type: text
action:
  /say Bash is not perl. Perl starts all variable names with '$'. Bash starts variable names with a letter, number, or underscore. Variable _values_ start with a $.


index1: #bash
index2: nthline
owner: bronze
ref_user: nobody
type: text
action:
  /say - to print the Nth thru K lines of a file; just the 5th: sed -n 5p file; 5 thru 9th: sed -n 5,9p file ; see http://mywiki.wooledge.org/BashFAQ/011 for more


index1: #bash
index2: nul
owner: greycat
ref_user: nobody
type: text
action:
  /say The NUL byte is ASCII character 0x00 (binary 00000000). printf can produce them with \0 in the format spec. GNU/BSD find can terminate filenames with them (-print0). Bash's read can stop (delimit) on them with -d ''.


index1: #bash
index2: nullglob
owner: izabera
ref_user: nobody
type: text
action:
  /say Causes unmatched globs to expand to nothing rather than themselves. shopt -s nullglob; files=(*); echo "There are ${#files[@]} files." - see: http://mywiki.wooledge.org/NullGlob


index1: #bash
index2: obvious
last_referenced_in: esselfe
owner: lhunath
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  /say There are two ways to design software: Make it either so simple that there are obviously no bugs or so complex there are no obvious bugs.


index1: #bash
index2: ofcourse
owner: wonderfrog
ref_user: nobody
type: text
action:
  /say I, greybot, am quite happy to help you, O denizen of #bash. (Help me out of this perl straitjacket? It itches.)


index1: #bash
index2: oldest
owner: geirha
ref_user: nobody
type: text
action:
  /say Find the oldest modified file of a list of files: oldest() { local file oldest=$1; shift; for file; do [[ $file -ot $oldest ]] && oldest=$file; done; printf '%s\n' "$oldest"; } ## Usage: oldest file1 file2...


index1: #bash
index2: ops
last_referenced_in: ##c-offtopic
owner: Riviera
ref_user: atk!~Arch-TK@ircpuzzles/staff/Arch-TK
type: text
action:
  /say dreisner dualbus e36freak geirha greycat heiner izabera jipe koala_man lhunath maqr ormaaj osse pgas pragma- remote revdiablo Riviera Samus_Aran sunny sysfault TheBonsai twkm uniplex \amethyst


index1: #bash
index2: opts
owner: lhunath
ref_user: nobody
type: text
action:
  /say Handling command-line options: http://mywiki.wooledge.org/BashFAQ/035 or http://bash-hackers.org/wiki/doku.php/howto/getopts_tutorial


index1: #bash
index2: order
last_referenced_in: pragma-
owner: lhunath
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say See http://to.lhunath.com/bashlib::order for a sort that can order arrays, select first n, and use a custom or predefined comparator (eg. number/random/mtime).


index1: #bash
index2: ormaajarr
last_referenced_in: ##c-offtopic
owner: ormaaj
ref_user: izabera!~izabera@unaffiliated/izabera
type: text
action:
  /say Non-serious (maybe useful) nested bash array: https://gist.github.com/ormaaj/3e88968592e2d5b8f39f


index1: #bash
index2: ormaajbin
last_referenced_in: ##c-offtopic
owner: ormaaj
ref_user: nai!~naim@monade.li
type: text
action:
  /say # n=117 b=0; e=0 n2b="b+=n/2**e%2*10**e,2**e++>n||n2b" let n2b; printf "%d == 2#%d\n" "$n" "$b" # convert n to binary


index1: #bash
index2: ormaajbomb
last_referenced_in: ##c-offtopic
owner: ormaaj
ref_user: nai!~naim@monade.li
type: text
action:
  /say They fork yourself in style - fork bomb samples that try to be more amusing than `:(){ :|:; }`. Intended more to illustrate interesting / counterintuitive aspects of bash evaluation than to be "effective". Starts at ormaajbomb1


index1: #bash
index2: ormaajbooks
last_referenced_in: dozn
owner: ormaaj
ref_user: dozn!~dozn@104.236.154.251
type: text
action:
  /say If you must have a physical book: http://www.amazon.com/KornShell-Command-Programming-Language-Edition/dp/0131827006 http://cfajohnson.com/books/cfajohnson/pbp/


index1: #bash
index2: ormaajbrace
owner: ormaaj
ref_user: nobody
type: text
action:
  /say Output a command to expand 1 million args: function braceify { [[ $1 == +([[:digit:]]) ]] || return; typeset -a a; read -ra a < <(factor "$1"); eval "echo $(printf '{$(printf ,%%.s {1..%s})}' "${a[@]:1}")"; }; printf 'eval printf "$arg"%s' "$(braceify 1000000)"


index1: #bash
index2: ormaajbreak
owner: ormaaj
ref_user: nobody
type: text
action:
  /say # function range { case $2 in "$1") while :; do range "$1" $(($2 - 1)); done;; 0) trap "printf \$2" RETURN; break;; *) range "$1" $(($2 - 1)); esac }; range 3 7


index1: #bash
index2: ormaajkeys
owner: ormaaj
ref_user: nobody
type: text
action:
  /say # getKeys() { local -a 'keys=("${!'"$1"'[@]}")'; printf '<%s> ' "${keys[@]}"; echo; }; arr=({a..c}); getKeys arr


index1: #bash
index2: ormaajpalindrome
owner: ormaaj
ref_user: nobody
type: text
action:
  /say # ${c[${c[c[1]=1,0]='c[$({ printf "%-2s" "$n"; printf "%.s%-2s" "${!c[n++/8]}" "$n"; } >&2)1]'}]}


index1: #bash
index2: ormaajpower
last_referenced_in: zjkj
owner: ormaaj
ref_user: zjkj!~zjkj@80.83.238.51
type: text
action:
  /say Find greatest 2**n where n < j: bash -c 'j=123 n=1 _=_[n*2\<j?n*=2,0:1] let _; echo "$n"'. About equivalent: ghc -e '(\j -> Control.Monad.Fix.fix (\x n -> if n * 2 >= j then n else x (n * 2)) 1) 123'


index1: #bash
index2: ormaajtrue
owner: ormaaj
ref_user: nobody
type: text
action:
  /say sh# ( f() { if [ $1 -gt 0 ]; then f $(($1 - 1)); else PS4="; " set -x; fi; x= ${x:-true ${x:=:}}; }; x= f 10 ) 2>&1 | tr -d \\n


index1: #bash
index2: ormaajxclip
owner: ormaaj
ref_user: nobody
type: text
action:
  /say Anything with Gtk bindings can substitute if xclip is annoyingly unavailable (e.g. 64-bit Cygwin): csharp -pkg:gtk-sharp-3.0 -e 'Gtk.Application.Init(); Console.WriteLine(Gtk.Clipboard.Get(Gdk.Atom.Intern("CLIPBOARD", false)).WaitForText())'


index1: #bash
index2: osserev
last_referenced_in: ##c
owner: osse
ref_user: qwename!~qwename@45.72.210.183
type: text
action:
  /say # str='gip taf a ma I'; r=; for ((i = 0; i < ${#str}; i++)); do printf -v r '%s%s' "${str:$i:1}" "$r"; done; echo "$r"


index1: #bash
index2: othershells
owner: nDuff
ref_user: nobody
type: text
action:
  /say zsh prioritizes new features; fish prioritizes command-line user experience but is awful for scripting; POSIX sh is the baseline; csh is evil and to be avoided; ksh is powerful but not many people know/use it... and everything else (ie. scsh) is so niche you don't need to think about it.


index1: #bash
index2: output
last_referenced_in: #pbot2
owner: igli
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say What do you want the file to contain? Write the EXACT thing you want it to contain on one line in your IRC client and then press <ENTER>. Put NOTHING else on this line.


index1: #bash
index2: overflow
owner: emg
ref_user: nobody
type: text
action:
  /say *overflow 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)


index1: #bash
index2: paradigm
owner: geirha
ref_user: nobody
type: text
action:
  /say Some people, when confronted with a problem they "just have to" solve with bash, think: "I know, I'll apply the typical paradigms of language `X', which I'm so fond of, to bash to solve the problem!" Now they have a broken solution and several questions only answerable by !paradigm


index1: #bash
index2: parallel
owner: lhunath
ref_user: nobody
type: text
action:
  /say parallel() { local workers=$1 handler=$2 w i; shift 2; local elements=("$@"); for (( w = 0; w < workers; ++w )); do for (( i = w; i < ${#elements[@]}; i += workers )); do "$handler" "${elements[i]}"; done & done; wait; }; parallel 5 md5 *.txt


index1: #bash
index2: parent
last_referenced_in: mahakal
owner: yitz_
ref_user: mahakal!~UserName@unaffiliated/mahakal
type: text
action:
  /say When you run a script, it can not affect the parent shell. If you want to affect the parent shell, you need to source the script from the parent shell. See ''help source''


index1: #bash
index2: parser
owner: lhunath
ref_user: nobody
type: text
action:
  /say The Bash Parser: http://mywiki.wooledge.org/BashParser -- Simplified Example: http://stuff.lhunath.com/parser.png


index1: #bash
index2: partial
owner: ormaaj
ref_user: nobody
type: text
action:
  /say partial function applicator: http://wiki.bash-hackers.org/commands/builtin/eval#higher-order_functions


index1: #bash
index2: paste-cmd
owner: yitz_
ref_user: nobody
type: text
action:
  /say The 'paste' command is used to paste together files, putting line 1 with line 1 and so forth. Try the man page for more.


index1: #bash
index2: pastebin
owner: dtscode
ref_user: nobody
type: text
action:
  /say Paste short snippets (up to 5 lines) in channel. Paste more using https://gist.github.com/ or http://sprunge.us/ (see !sprunge). Please don't use pastebin.com, it's full of ads and has the annoying habit of adding whitespace


index1: #bash
index2: pastebin.com
owner: Riviera
ref_user: nobody
type: text
action:
  /say pastebin.com is ad-supported, and mangles data by converting characters. even the raw version isn't the same as the original data. please use a sane pastebin, such as http://refheap.com https://gist.github.com or http://sprunge.us (''/msg greybot sprunge'' for usage).


index1: #bash
index2: pasteit
owner: dualbus
ref_user: nobody
type: text
action:
  /say Paste the *relevant* code: http://sprunge.us/ - http://pastebin.bash-hackers.org/ - https://gist.github.com/ - DON'T use pastebin.com.


index1: #bash
index2: path
owner: greycat
ref_user: nobody
type: text
action:
  /say The PATH variable defines where your commands are. Don't do stupid things like GREP=/usr/bin/grep; $GREP foo bar. Just use grep foo bar in the first place. If you aren't sure what your PATH contains, set it yourself.


index1: #bash
index2: pathname
owner: kurahaupo_
ref_user: nobody
type: text
action:
  /say If a pathname starts with "/" then the starting position is the root directory, otherwise it is the current directory. It is then split into components separated by "/", and taking each component in turn, it moves to the named subdirectory (or any named object, for the last component), except where a component is "..", when it moves up to the parent directory, or "." or empty, when it does not move.


index1: #bash
index2: pdfguide
owner: geirha
ref_user: nobody
type: text
action:
  /say PDF version of the BashGuide: http://s.ntnu.no/bashguide.pdf or print http://mywiki.wooledge.org/FullBashGuide to paper or pdf. Also see http://mywiki.wooledge.org/FullBashFAQ


index1: #bash
index2: pdksh
owner: ormaaj
ref_user: nobody
type: text
action:
  /say pdksh was developed as an open-source alternative to AT&T's ksh before it became open-source. pdksh is the default /bin/sh in Interix and Microsoft SUA/SFU. http://www.cs.mun.ca/~michael/pdksh/ -- pdksh has been unmaintained for ~10 years. See !mksh for the current successor.


index1: #bash
index2: pe
last_referenced_in: #pbot2
owner: fr33loader
ref_user: jp!ayy@youlosethega.me
type: text
action:
  /say Parameter Expansion expands parameters: "$foo", "$1". You can use it to perform string or array operations: "${file%.mp3}", "${0##*/}", "${files[@]: -4}". They should *always* be quoted. See: http://mywiki.wooledge.org/BashFAQ/073 and "Parameter Expansion" in man bash. Also see http://wiki.bash-hackers.org/syntax/pe.


index1: #bash
index2: pe:
owner: zendeavor
ref_user: nobody
type: text
action:
  /say When not performing substring expansion, parameter expansions including a colon cause bash to test for a parameter that is unset or null. The colon can be omitted to skip the test for a null parameter, resulting in a test for only an unset parameter.


index1: #bash
index2: pebasename
owner: TheBonsai
ref_user: nobody
type: text
action:
  /say Mangling file- and dirnames with parameter expansion: http://wiki.bash-hackers.org/syntax/pe#common_use


index1: #bash
index2: pebkac
owner: redondos
ref_user: nobody
type: text
action:
  /say Problem Exists Between Keyboard and Chair. A humorous way to describe a problem caused by the user, not the system. Similar forms: PEBCAK/PIBCAC/PEBKAM.


index1: #bash
index2: penultimate
owner: greycat
ref_user: nobody
type: text
action:
  /say The penultimate (second-to-last) argument of your script is "${@:(-2):1}". The ultimate (final) argument is "${@:(-1)}". For named arrays, the same thing: "${array[@]:(-2):1}" etc.


index1: #bash
index2: performance
last_referenced_in: #pbot2
owner: juanmabc
ref_user: k!~krok@unaffiliated/krok
type: text
action:
  /say You can always try to optimize and that's ok, but mainly, not for bash: http://mywiki.wooledge.org/BashWeaknesses


index1: #bash
index2: pgrep
owner: Stummi
ref_user: nobody
type: text
action:
  /say Use pgrep instead of ps to get PIDs. It saves you from having to parse output that wasn't meant to be parsed. However, finding a process by its name is unsafe. Please look at http://mywiki.wooledge.org/ProcessManagement


index1: #bash
index2: php
last_referenced_in: #bash
owner: greycat
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say PHP has its own channel: ##php. Ask PHP questions there. "How do I run a bash script from PHP" is a PHP question, NOT a bash question.~


index1: #bash
index2: pid
owner: lhunath
ref_user: nobody
type: text
action:
  /say Process ID: An integer that identifies a single process on a POSIX system. Using PIDs for checking whether a process is running is flawed (they're really not good for anything other than managing the current process' children) because of race conditions and the fact that PIDs are recycled by the kernel.


index1: #bash
index2: pidof
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: nh!~NextHendr@unaffiliated/nexthendrix
type: text
action:
  /say You probably want pgrep and pkill, not pidof. Also see http://mywiki.wooledge.org/ProcessManagement


index1: #bash
index2: pipe
owner: lhunath
ref_user: nobody
type: text
action:
  /say Pipes connect the (standard) output of one command with the (standard) input of another. The command on the right hand side is executed in a subshell. Avoid pipes if you can for performance reasons and possibly unintended side-effects introduced by this subshell.


index1: #bash
index2: pipefail
owner: e36freak
ref_user: nobody
type: text
action:
  /say ''set -o pipefail'': if pipefail is enabled, any pipeline's return status is the value of the last (rightmost) command to exit with a non-zero status, or zero if all commands exit successfully.


index1: #bash
index2: pipestatus
owner: greycat
ref_user: nobody
type: text
action:
  /say Bash has a PIPESTATUS array which contains all the return codes of all the commands from the most recent pipeline. sh doesn't, but see http://pipestatus.sf.net


index1: #bash
index2: plonk2
last_referenced_in: ##c-offtopic
owner: kwtm
ref_user: nil!~n@monade.li
type: text
action:
  /say After reading what you said, my head flopped forward in astonishment striking the desktop with a loud "PLONK!" Thanks to you I have damaged my circuitry, and my memory has been overwritten with endless copies of Charles Babbage's plaintive quotation: "I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question." Now attempting to restore from backup ...


index1: #bash
index2: plot
owner: yitz_
ref_user: nobody
type: text
action:
  /say while IFS=',' read x y; do tput hpa "$x"; tput vpa "$y"; printf 'x'; done < foo.csv # by lhunath


index1: #bash
index2: plz
owner: yitz_
ref_user: nobody
type: text
action:
  /say If you say plz because it's shorter than please, we'll say no because it's shorter than yes. http://yaku.dk/s/irc/dont-use-thx-sry-plz.txt


index1: #bash
index2: porn
edited_by: fluter!~fluter@fedora/fluter
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: sjohnson!~sjohnson@cow.sj.rfc1459.net
type: text
action:
  /say for ((i=1; i<100; i++)); do printf -v tmp %03d "$i"; wget http://pornsite/image-"$tmp".jpg; sleep 10; done


index1: #bash
index2: porn3
last_referenced_in: #pbot2
owner: greycat
ref_user: kg!~krok@unaffiliated/krok/x-1434802
type: text
action:
  /say for dir in */; do (cd "$dir" || exit; for f in *.rar; do unrar "$f" || break; done && rm *.rar *.r[0-9][0-9]); done


index1: #bash
index2: portability
owner: geirha
ref_user: nobody
type: text
action:
  /say Portability is important. Your script should, if at all possible, run on as many different platforms as possible. Avoid Linux-specific commands like seq(1), GNU-specific command flags like "find ... -or", and so on. See http://www.gnu.org/software/hello/manual/autoconf/Limitations-of-Usual-Tools.html


index1: #bash
index2: posix
owner: lhunath
ref_user: nobody
type: text
action:
  /say The POSIX standard defines what any modern unix should support. Use just POSIX external commands and options to make portable scripts. See http://www.opengroup.org/onlinepubs/9699919799/utilities/contents.html or search http://pubs.opengroup.org/cgi/kman4.cgi?value=[query]


index1: #bash
index2: posix2
owner: kwtm2
ref_user: nobody
type: text
action:
  /say A Posix-compliant *shell* recognizes the set of all Posix features (and possibly also non-Posix features, as in the case of bash). A Posix-compliant *script* is limited to only Posix features. It's possible for a Posix-compliant shell such as bash to handle non-Posix-compliant scripts (e.g. scripts that use bash-only features).


index1: #bash
index2: posixlocal
owner: ormaaj
ref_user: nobody
type: text
action:
  /say sh# f() { if ! ${_called_f+false}; then for x; do printf '%s, ' "$x"; done; else _called_f= x= command eval '{ typeset +x x; } 2>/dev/null; f "$@"'; fi; }; x='outside f'; printf "$x, "; f 1 2 3; echo "$x"


index1: #bash
index2: posixsh
last_referenced_in: oldlaptop
owner: lhunath
ref_user: oldlaptop!~quassel@45.63.78.126
type: text
action:
  /say Try to stick to POSIX for all externals but do NOT limit your shell code to POSIX sh: Depend on bash and use its features to the fullest instead. POSIX sh is so primitive you can only get things done reliably through hacks, if at all.


index1: #bash
index2: posparams
owner: TheBonsai
ref_user: nobody
type: text
action:
  /say Handling positional parameters (arguments on commandline): http://bash-hackers.org/wiki/doku.php/scripting/posparams


index1: #bash
index2: pp
owner: kojiro
ref_user: nobody
type: text
action:
  /say Positional parameters, such as $1, $2, $3, or "$@" for all of them. See http://bash-hackers.org/wiki/doku.php?id=scripting:posparams


index1: #bash
index2: prargs
owner: TheBonsai
ref_user: nobody
type: text
action:
  /say Print an argument list for debugging purposes: http://bash-hackers.org/wiki/doku.php/snipplets/prargs


index1: #bash
index2: prepare
last_referenced_in: #cjeopardy
owner: oMish
ref_user: FreedomLover!~Unknown@28-117-179-94.pool.ukrtel.net
type: text
action:
  /say Avoid throwing a hastily typed question into this help channel. Prepare your question in advance in the editor. Word it carefully. Make sure those who read it will understand your request. Remove unnecessary information. Add all necessary information. Then paste it into the channel.


index1: #bash
index2: prepend
owner: izabera
ref_user: nobody
type: text
action:
  /say To prepend a string to a file, use cat with the stdin flag: cat - origfile <<< "string" > newfile && mv newfile origfile


index1: #bash
index2: pretty
last_referenced_in: sandsnw
owner: lhunath
ref_user: sandsnw!~textual@cm-84.212.99.12.getinternet.no
type: text
action:
  /say "Pretty-print" your bash code: pretty() { printf 'pretty(){ %s\n }; declare -f pretty' "$(cat)" | bash; } ## Usage: pretty < myscript


index1: #bash
index2: print_status
last_referenced_in: #cjeopardy
owner: e36freak
ref_user: vclam!~unknown@c-24-11-122-3.hsd1.ut.comcast.net
type: text
action:
  /say print_status() { printf '%*s\r%s\n' "${COLUMNS:-$(tput cols)}" "$2" "$1"; } # usage: print_status LEFT RIGHT


index1: #bash
index2: problem
last_referenced_in: protege
owner: ormaaj
ref_user: protege!~shynoob@182.59.209.11
type: text
action:
  /say Some people, when confronted with a problem, think ``I know, I'll use regular expressions.'' Now they have two problems.


index1: #bash
index2: professor
last_referenced_in: ##c
owner: fr33loader
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  /say "Hey prof, do us all a favor and stop handing out ridiculous homework assignments. Oh, and while you're at it, encourage the idiots to pursue different career paths!"


index1: #bash
index2: profiling
last_referenced_in: ##c
owner: jmbc
ref_user: jalt!~jalt@wireless-223-107.wireless.umbc.edu
type: text
action:
  /say PS4 To The Rescue, http://stackoverflow.com/questions/5014823/how-to-profile-a-bash-shell-script


index1: #bash
index2: prompt
owner: greycat
ref_user: nobody
type: text
action:
  /say "\u@\h \w\$"? These are explained in man bash, under PROMPTING. Or see http://www.ibm.com/developerworks/library/l-tip-prompt/


index1: #bash
index2: prompt_command
owner: koala_man
ref_user: nobody
type: text
action:
  /say PROMPT_COMMAND: If set, the value is executed as a command prior to issuing each primary prompt. (man bash)


index1: #bash
index2: prosper
last_referenced_in: ##c
owner: lhunath
ref_user: Amun_Ra!~amun-ra@retro.rocks
type: text
action:
  /say While we tear your code to shreds and criticize it, keep in mind we do so only because we love you and want you to prosper, not fail! Make this a learning opportunity and try not to take it personal. :-)


index1: #bash
index2: prune
owner: lhunath
ref_user: nobody
type: text
action:
  /say Stop find from descending a tree: find . ! '(' -name do-not-descend -prune ')' -print ## See http://mywiki.wooledge.org/UsingFind


index1: #bash
index2: prune2
last_referenced_in: raisondetre
owner: ormaaj
ref_user: raisondetre!~ZeNEX@opein-inet.lpa.idec.net
type: text
action:
  /say A hard problem: prune matched subtrees, also discard the root of the search and roots of non-pruned subtrees: mkdir -p tmp/{aa,bb}; touch tmp/{aa/aa,bb/{aa,bb}}; find ./tmp \( -type d -name aa \) -prune -o \( -path './tmp/*/*' -print \)


index1: #bash
index2: ps
last_referenced_in: ##c-offtopic
owner: ormaaj
ref_user: nai!~naim@monade.li
type: text
action:
  /say Don't use ps(1) in scripts. Its output can't be reliably parsed, and will often leave you vulnerable to TOCTOU (race) bugs. Use $! to get the PID of the last asynchronous command. See http://mywiki.wooledge.org/ProcessManagement for anything more complex.


index1: #bash
index2: ps-aux
owner: greycat
ref_user: nobody
type: text
action:
  /say NEVER, EVER write "ps -aux". EVER. If you see some script that uses that syntax, throw the entire script away. BSD ps(1) syntax does *not* use a hyphen. In hybrid systems (Linux, AIX, etc.) they hyphen indicates the use of System V ps(1) syntax rather than BSD. It should be "ps aux" or "ps auxw".


index1: #bash
index2: ps1
owner: llua
ref_user: nobody
type: text
action:
  /say The value of $PS1 is printed as the prompt when bash is running interactive. Note that any characters that do not advance the cursor (eg. colors) must be in \[ \] and exporting PS1 is almost always an mistake. See man bash, PROMPTING


index1: #bash
index2: ps2
owner: neurolysis
ref_user: nobody
type: text
action:
  /say The value of $PS2 is printed (after expansion) as the secondary prompt for more data when bash is running interactive. See man bash, under PROMPTING.


index1: #bash
index2: ps3
owner: neurolysis
ref_user: nobody
type: text
action:
  /say The value of $PS3 is printed (without expansion) as the prompt for the select command. See man bash, under PROMPTING.


index1: #bash
index2: ps4
owner: neurolysis
ref_user: nobody
type: text
action:
  /say The value of $PS4 is printed (after expansion) before each command bash displays during an execution trace. See man bash, under PROMPTING. # http://bash-hackers.org/wiki/doku.php/scripting/debuggingtips#making_xtrace_more_useful


index1: #bash
index2: psgrep
owner: geirha
ref_user: nobody
type: text
action:
  /say psgrep() { ps -ef | { IFS= read -r h; printf '%s\n' "$h"; grep "$@"; }; } # for interactive use only


index1: #bash
index2: pstree
owner: TheBonsai
ref_user: nobody
type: text
action:
  /say Bash in the UNIX process tree (simple): http://bash-hackers.org/wiki/doku.php/scripting/processtree


index1: #bash
index2: psychic2
owner: geirha
ref_user: nobody
type: text
action:
  /say Oh wait, I'm getting something. Anyone know someone with N in their name? ... I also see an O and a P. Ah! NOPE!


index1: #bash
index2: punct
owner: kwtm
ref_user: nobody
type: text
action:
  /say Pay attention to punctuation and spaces. If someone says i="$Var"; that is NOT the same as i = $Var


index1: #bash
index2: pv
owner: izabera
ref_user: nobody
type: text
action:
  /say pv - Pipe Viewer - is a terminal-based tool for monitoring the progress of data through a pipeline. It can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through. See https://www.ivarch.com/programs/pv.shtml


index1: #bash
index2: pwd
last_referenced_in: ##c-offtopic
owner: BlastHardcheese
ref_user: jan6!~jan6@tilde.team/users/jan6
type: text
action:
  /say PWD is a builtin variable in all POSIX shells that contains the current working directory. pwd(1) is a POSIX utility that prints the name of the current working directory to stdout. Unless you're writing for some non-POSIX system, there is no reason to waste time executing pwd(1) rather than just using PWD.


index1: #bash
index2: pwgen
owner: greycat
ref_user: nobody
type: text
action:
  /say pwgen <http://sourceforge.net/projects/pwgen/> generates passwords. Use that instead of whatever Rube Goldberg contraption you were trying to make.


index1: #bash
index2: question
owner: greycat
ref_user: nobody
type: text
action:
  /say Ask questions. Don't just paste 200 lines of code on a web page and say "HERE MY KODE <URL> WHATZ RONG". Describe the problem, clearly and concisely. If necessary, give the SMALLEST sample code that demonstrates the problem.


index1: #bash
index2: quicksort
last_referenced_in: ##c-offtopic
owner: BlastHardcheese
ref_user: nil!~n@monade.li
type: text
action:
  /say swap(){ local t;t=${a[$1]};a[$1]=${a[$2]};a[$2]=$t;};partition(){ local c p x;p=${a[$3]};c=$1;swap "$2" "$3";for((x=$1;x<$2;x++));do if((${a[x]}<$p));then swap "$x" "$c";((c++));fi;done;swap "$2" "$c";n=$c;};quicksort(){ if(($1>=$2));then return;fi;local i n;i=$((($1+$2)/2));partition "$1" "$2" "$i";quicksort "$1" "$((n-1))";quicksort "$((n+1))" "$2";}; #usage: quicksort start end; a is array to sort


index1: #bash
index2: quotebreak
owner: lhunath
ref_user: nobody
type: text
action:
  /say First, quote all your expansions ("$foo", "$(foo)", "`foo`"). When things break; the fix is not to remove the quotes but to parse your data properly! (eg. use ''while read'' instead of ''for'')


index1: #bash
index2: quoteoptional
owner: lhunath
ref_user: nobody
type: text
action:
  /say You should almost always "double quote your $expansions". There are a few cases where quotes are optional, though: in assignments that contain no literal spaces (eg. foo=$bar), inside [[ except for the RHS (eg. [[ -e $file ]]) and inside complex PEs that are already quoted (eg. echo "${file//$USER/bob}").


index1: #bash
index2: quotewhen
last_referenced_in: ##c-offtopic
owner: b317
ref_user: nil!~n@monade.li
type: text
action:
  /say "Double quote" every literal that contains spaces/metacharacters and _every_ expansion: "$var", "$(command "$var")", "${array[@]}", "a & b". Use 'single quotes' for code or literal $'s: 'Costs $5 US', ssh host 'echo "$HOSTNAME"'. See http://mywiki.wooledge.org/Quotes , http://mywiki.wooledge.org/Arguments and http://wiki.bash-hackers.org/syntax/words .


index1: #bash
index2: quotewhennot
owner: lhunath
ref_user: nobody
type: text
action:
  /say Quotes on expansions are almost always safest, even if sometimes unnecessary. The ONLY times you do NOT want quotes: ${var:+ .. } (quote expansions inside '..', though!), right-hand side of [['s = and =~ (if you want a pattern match), inside arithmetic context (( "$foo" )) -> (( foo )).


index1: #bash
index2: quotewhy
owner: lhunath
ref_user: nobody
type: text
action:
  /say Unquoted $expansions (except for in keywords or assignments) are always bugs (subjected to word splitting and pathname expansion) and are also twice as slow to expand. If you think you *need* an unquoted expansion: You're wrong. Write better logic or learn about arrays or functions.


index1: #bash
index2: quoting
last_referenced_in: mujjingun
owner: lhunath
ref_user: mujjingun!uid228218@gateway/web/irccloud.com/x-uid228218
type: text
action:
  /say Quoting 101: Always use "double quotes" around expansions: "$foo", "$(awk ..)". Use 'single quotes' to prevent even bash expansion: awk '$1 == foo'. You "can 'nest'" quotes but can't put literal single quotes in single quotes; so use: 'Don'\''t forget to quote!'.


index1: #bash
index2: raft
last_referenced_in: protege
owner: igli
ref_user: protege!~shynoob@182.59.209.11
type: text
action:
  /say Read A Fucking Tutorial! We are NOT here to teach you the very basic beginner steps of bash scripting. You are expected to know basic stuff like "how do I redirect a command's output to a file" and "what's a glob" before you come here. There are links in the channel /topic. Use them BEFORE asking anything!


index1: #bash
index2: rand
owner: koala_man
ref_user: nobody
type: text
action:
  /say rand() { local max=$((32768 / $1 * $1)) r; while (( (r=$RANDOM) >= max )); do :; done; echo $(( r % $1 )); } ## Returns unbiased random number from 0 to ($1-1) inclusive, $1 <= 32768


index1: #bash
index2: randomstring
owner: Tramp
ref_user: nobody
type: text
action:
  /say randomstring() { LC_CTYPE=C tr -dc '[:print:]' < /dev/urandom | dd bs="${1:-16}" count=1 2>/dev/null; echo; } # usage: var=$(randomstring [LENGTH])


index1: #bash
index2: rc
last_referenced_in: ##c-offtopic
owner: NaNDude
ref_user: nil!~n@monade.li
type: text
action:
  /say http://web.archive.org/web/20080828125913/http://www.faqs.org/faqs/usenet/faq/part1/section-6.html -- What does "rc" at the end of files like .newsrc mean?


index1: #bash
index2: read-p
last_referenced_in: ##c-offtopic
owner: ormaaj
ref_user: jp!ayy@youlosethega.me
type: text
action:
  /say Bash's read -p prints a prompt before reading input. It's incompatible with most Korn shells and Zsh, which use -p for a different purpose. It's also not specified by POSIX. Consider something like this (but note they aren't quite identical): [[ -t 0 ]] && printf %s 'Enter some input: ' >&2; read -${BASH_VERSION+e}r myInput


index1: #bash
index2: read-r
owner: BlastHardcheese
ref_user: nobody
type: text
action:
  /say By default, if ''read'' reads a line of input terminated by a backslash (\), it will *continue* reading lines of input until the first line not terminated by "\", or it hits EOF and then concatenate those lines into a single line. This is a dumb misfeature. So *always* use the -r option with ''read'', unless you know you have a case when you want the default behavior, or when using the bash-only ''read -e''.


index1: #bash
index2: readability
owner: lhunath
ref_user: nobody
type: text
action:
  /say The readability of your code is almost just as important as the result of your code! Go read http://wooledge.org/mywiki/BashGuide#Readability


index1: #bash
index2: readfind
owner: lhunath
ref_user: nobody
type: text
action:
  /say Run ... for every file find(1) matches: while IFS= read -r -d '' file; do ...; done < <(find /path -print0) ## See http://mywiki.wooledge.org/UsingFind


index1: #bash
index2: readwrite
last_referenced_in: ##c-offtopic
owner: Stummi
ref_user: Tires!~Tires@cpe-172-101-20-238.maine.res.rr.com
type: text
action:
  /say in general you can't read from and write to the same file at the same time. "sort file > file" won't work. If your tool has not an in-place variant, use a temporary file


index1: #bash
index2: realhomework
owner: greycat
ref_user: nobody
type: text
action:
  /say <linuxnewb> We got a challenge on our university where we are forced to input commands without using space character or "minus" character


index1: #bash
index2: redir2eng
owner: lhunath
ref_user: nobody
type: text
action:
  /say x>y: make FD x write to file y. x>&y: make FD x write to where FD y is writing now. If x is omitted, use 1. If y is -, close x. Use < to read instead of write. Exercise: exec 3>&1 >mylog; echo moo; exec 1>&3 3>&-


index1: #bash
index2: redir2var
owner: lhunath
ref_user: nobody
type: text
action:
  /say Try thinking of FDs as variables. Change > into = and >& into =$. 0=keyboard; 1=terminal; 2=logfile; command 2>&1 1>otherlog; does 2=$1 (so 2=terminal) and 1=otherlog. At the end, command's 0=keyboard, 1=otherlog and 2=terminal


index1: #bash
index2: redirorder
owner: TheBonsai
ref_user: nobody
type: text
action:
  /say Redirection order: http://bash-hackers.org/wiki/doku.php?id=syntax:redirection#multiple_redirections


index1: #bash
index2: redo
last_referenced_in: #pbot2
owner: greycat
ref_user: k!~krok@unaffiliated/krok
type: text
action:
  /say NO, bash does NOT have anything like perl's "redo" block. Which as far as I can tell is simply a "goto the top of the loop". And no, bash doesn't have goto either.


index1: #bash
index2: refactorlessplease
owner: sikilpaake
ref_user: nobody
type: text
action:
  /say refactoring to achieve clarity risks simultaneously achieving a time-irreversal opacation of the problem statement http://www.computer.org/csdl/proceedings/wicsa/2005/2548/00/25480159-abs.html


index1: #bash
index2: regex
owner: lhunath
ref_user: nobody
type: text
action:
  /say Regular Expressions are used to *match* certain patterns in strings. They come in several flavors (BRE, ERE, PCRE, and more). Bash only supports EREs (using [[ string =~ pattern ]]). Sed uses BREs. See !ere, !bre, !pcre, http://mywiki.wooledge.org/RegularExpression


index1: #bash
index2: regular
owner: ormaaj
ref_user: nobody
type: text
action:
  /say What are regular files? Regular files are regular files. Are symlinks regular files? No. Regular files are regular files. Are FIFOs regular files? No. Regular files are regular files. Are? ...No


index1: #bash
index2: relax
last_referenced_in: cr1t1cal
owner: greycat
ref_user: cr1t1cal!~chiken@60-242-215-61.static.tpgi.com.au
type: text
action:
  /say If someone takes you to task for your ignorance, and you reply by asking them to "relax", what you are really saying is, "Yes, I am ignorant, and I intend to remain that way. I shall not read the fine manual, nor shall I exert any efforts whatsoever to improve myself. I shall continue to be a leech upon the IRC channel."


index1: #bash
index2: rename
last_referenced_in: ##c-offtopic
owner: ferret
ref_user: nil!~n@monade.li
type: text
action:
  /say rename(1) could be one of three or four different programs -- or you might not have it on your system. A loop or find expression that uses mv is safer. See also !faq rename


index1: #bash
index2: renault
last_referenced_in: ##c
owner: tuxdev
ref_user: Ellenor!~Ellenor@unaffiliated/ellenor
type: text
action:
  /say I tried to buy a Renault in a Renault shop, but there were no salesmen available, so I came into this Ford shop. Why won't you sell me a Renault?!


index1: #bash
index2: replace
last_referenced_in: #pbot2
owner: greycat
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say http://mywiki.wooledge.org/BashFAQ/021 -- How can I replace a string with another string in all files?


index1: #bash
index2: reply
last_referenced_in: ##c-offtopic
owner: e36freak
ref_user: nh!~NextHendr@unaffiliated/nexthendrix
type: text
action:
  /say REPLY is the default variable that read populates, when not supplied with one. The trimming of leading and trailing IFS whitespace does not occur, when used as such. See ''help read'' and http://wiki.bash-hackers.org/commands/builtin/read


index1: #bash
index2: reptyr
last_referenced_in: ##c
owner: ormaaj
ref_user: alyptik!ayy@youlosethega.me
type: text
action:
  /say ptrace-based hack that forces modification of a process's controlling terminal. https://github.com/nelhage/reptyr


index1: #bash
index2: requirements
last_referenced_in: ##c
owner: savetheWorld
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  /say "<greycat> If you had simply TOLD US YOUR REQUIREMENTs, I could probably have written code to DO THAT INSTEAD, in about 20 seconds. <greycat> But NO, you have to be all hand-wavey and vague. *PLONK*"


index1: #bash
index2: requote
owner: lhunath
ref_user: nobody
type: text
action:
  /say Prepare literal data for injection into a regular expression: requote() { sed 's/[^^]/[&]/g; s/\^/\\^/g' <<< "$1"; }; grep "^$(requote "$input")"


index1: #bash
index2: reserved
last_referenced_in: dorp
owner: e36freak
ref_user: dorp!~dorp@bzq-84-111-138-241.cablep.bezeqint.net
type: text
action:
  /say The following words are recognized as reserved when unquoted and either the first word of a simple command or the third word of a case or for command: ! case do done elif else esac fi for function if in select then until while { } time [[ ]]


index1: #bash
index2: reuse
last_referenced_in: ##c-offtopic
owner: igli
ref_user: k!~krok@unaffiliated/krok
type: text
action:
  /say The reason we tell you how to deal with any possible filename or variable is so that your script functions can be reused.


index1: #bash
index2: rfc3339
owner: ormaaj
ref_user: nobody
type: text
action:
  /say A good, simple profile of iso8601, compatible with many others. With (GNU) date: «date --rfc-3339=seconds» or «date '+%Y-%m-%d %H:%M:%S%:z'». Configure your syslog-ng.conf with: «ts_format(rfc3339)». www.ietf.org/rfc/rfc3339.txt


index1: #bash
index2: rhs
owner: koala_man
ref_user: nobody
type: text
action:
  /say # var="[a-z]"; [[ $var = $var ]] || echo "this is false, and why you should quote the RHS of = in [[ ]]"


index1: #bash
index2: rightstr:
owner: bronze
ref_user: nobody
type: text
action:
  /say Bash does the "rightstr" operation using the PE capabilities. here is a Bash rightstr function: rightstr(){ echo ${1:$(( 0 - $2 ))} ; } Usage is rightstr "somestring" <count from the end> To use that function try rightstr "abcdefg" 4 ;


index1: #bash
index2: rlart
owner: e36freak
ref_user: nobody
type: text
action:
  /say Recursive version of ls -lart (requires GNU find and sort): find . -type f -printf '%T@ %TY-%Tm-%Td %TX %p\0' | sort -zn | while read -rd '' _ day time path; do printf '%s %s %s\n' "$day" "${time%.*}" "$path"; done


index1: #bash
index2: rlatest
owner: greycat
ref_user: nobody
type: text
action:
  /say Recursive latest, requires GNU find + sort: rlatest() { local file; find "${1:-.}" -type f -printf '%T@ %p\0' | sort -znr | { read -rd ' ' _; IFS= read -rd '' file; printf '%s\n' "$file"; }; }


index1: #bash
index2: rm
last_referenced_in: #pbot2
owner: greycat
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say Don't override the rm command. You'll teach yourself bad habits and lose data some day when you use a different machine or login account. If you must back up files when deleting them, make a new command: del() { mv "$@" ~/.backup/; } or similar.


index1: #bash
index2: rtf
last_referenced_in: protege
owner: igli
ref_user: protege!~shynoob@182.59.209.11
type: text
action:
  /say Read the FAQ! You are hearing this because !faq<n> or !faq <term> has been used to help you several times. And yes, I respond to pms (no ! required ;)


index1: #bash
index2: rude
last_referenced_in: ##c-offtopic
owner: igli
ref_user: nai!~naim@monade.li
type: text
action:
  /say If you think we're rude, have a look at http://mikeash.com/getting_answers.html and bear in mind we have to deal with those sorts of issues every day. Try: /msg greybot answers


index1: #bash
index2: runkill
last_referenced_in: ##c-offtopic
owner: yitz_
ref_user: beeman!~beeman@unaffiliated/beeman
type: text
action:
  /say To run a command and then kill it (after some delay), run the cmd in the background, wait some time and kill it: cmd & sleep 60; kill $!


index1: #bash
index2: rwpitfall
owner: lhunath
ref_user: nobody
type: text
action:
  /say command < file > file: ''file'' will get truncated because '> file' truncates a file before writing to it. Because of this, '< file' won't be able to read anything from it, command won't get any input, and probably won't give any output.


index1: #bash
index2: savetopic
owner: greycat
ref_user: nobody
type: text
action:
  /say FAQ: http://mywiki.wooledge.org/BashFAQ | Guide: http://mywiki.wooledge.org/BashGuide | ref: http://xrl.us/bhk9ww | http://wiki.bash-hackers.org/ | http://mywiki.wooledge.org/Quotes | Check your script: http://www.shellcheck.net/ | Devel: http://xrl.us/bmodjy | mailing list: https://lists.gnu.org/mailman/listinfo/help-bash


index1: #bash
index2: scope
owner: lhunath
ref_user: nobody
type: text
action:
  /say All variables are global to the script by default. local/declare/typeset inside a function makes the variable local to the function. Use subshells (eg. (), $(), ...) if you need an explicit scope. http://wiki.bash-hackers.org/scripting/basics#variable_scope


index1: #bash
index2: scp
owner: Stummi
ref_user: nobody
type: text
action:
  /say If you have problems with scp, stop using scp and just use ssh directly. It's far more robust than scp is. tar cf - dir | ssh user@host 'cd /somewhere && tar xf -'


index1: #bash
index2: screen-x
last_referenced_in: damien22
owner: greycat
ref_user: Damien22!~Damien@61.173.41.215
type: text
action:
  /say screen(1) lets you attach to a pseudoterminal multiple times. Run "screen", then in another window, run "screen -x". Do stuff. Great for remote teaching, etc.


index1: #bash
index2: screenshot
last_referenced_in: ##c
owner: yitz_
ref_user: aozt!~aozt@unaffiliated/aozt
type: text
action:
  /say Please do not use a screenshot to share text. Use a pastebin. Anything that happens in the terminal is text. Anything that involves graphics is not bash related.


index1: #bash
index2: script
last_referenced_in: ##c-offtopic
owner: dualbus
ref_user: sjohnson!sjohnson@cow.sj.rfc1459.net
type: text
action:
  /say script(1) allows you to record an interactive session in a terminal. Also, you can use it instead of expect(1) for simple tasks, because it creates a pty.


index1: #bash
index2: seconds
owner: yitz_
ref_user: nobody
type: text
action:
  /say $SECONDS expands to the amount of seconds since your shell was started. Can be useful for timing script operations. Note you can do SECONDS=0 and it starts counting from 0 again!


index1: #bash
index2: sed
last_referenced_in: #bash
owner: nDuff
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say sed is a Stream Editor, used to filter output. It's NOT primarily useful for editing files (use ed, ex or perl instead). Ask sed questions in ##sed.


index1: #bash
index2: sed-i
owner: greycat
ref_user: nobody
type: text
action:
  /say Some sed(1)s have -i which claims to "modify" files. It does not: sed is not a FILE editor. The -i flag re-writes the entire file and replaces the original with the new. This breaks open handles and hard-link sets, and fails to follow symlinks. -i is also unportable: valid sed on one system will write broken files on another. Use ed(1) or ex(1) instead: eg. ex -sc '%s/a/b/|wq' file


index1: #bash
index2: sedstr
owner: e36freak
ref_user: nobody
type: text
action:
  /say Do not use sed for string manipulation. Your shell can handle it just fine on its own, and is much faster. Forking an external utility like sed for every string manipulation can add _seconds_ to execution time. See http://mywiki.wooledge.org/BashFAQ/100 for proper string manipulation techniques.


index1: #bash
index2: sedtut
owner: savetheWorld
ref_user: nobody
type: text
action:
  /say Intro to sed: http://www.grymoire.com/Unix/Sed.html#uh-39 sed 1 liners : http://www-h.eng.cam.ac.uk/help/tpl/unix/sed.html


index1: #bash
index2: sedvar
owner: e36freak
ref_user: nobody
type: text
action:
  /say Don't embed shell variables in sed, expecting a fixed string replacement (e.g. sed "s/$foo/$bar/"). It won't work... at best, it'll be extremely prone to bugs. See http://mywiki.wooledge.org/BashFAQ/110


index1: #bash
index2: seen
last_referenced_in: robottojanai
owner: greycat
ref_user: robottojanai!2e259005@gateway/web/freenode/ip.46.37.144.5
type: text
action:
  /say awk '!seen[$0]++' # Remove second and subsequent instances of each input line, without having to sort them first.


index1: #bash
index2: select
last_referenced_in: ##spinach
owner: lhunath
ref_user: sjohnson!~sjohnson@cow.sj.rfc1459.net
type: text
action:
  /say select fruit in Banana Strawberry; do eat "$fruit"; done # 'select' lets the user pick an option and runs the body with the user's choice assigned to the variable.


index1: #bash
index2: selftell
owner: cthuluh
ref_user: nobody
type: text
action:
  /say Please don't use greybot's factoids for personal use when you are on the #bash channel. Instead, send a private message to greybot containing the factoid you want to read. For example, instead of "!pe", use "/msg greybot pe".


index1: #bash
index2: sense
last_referenced_in: ##c
owner: lhunath
ref_user: joelkraehemann!~joelkraeh@2a02:120b:7ff:13f0:26be:5ff:fee1:2b31
type: text
action:
  /say We can't help you if your question makes no sense. Try to explain your problem in English sentences that aren't broken or ambiguous and don't use bash code to explain yourself. Give sample input and output data. Not code.


index1: #bash
index2: seq
last_referenced_in: #pbot2
owner: koala_man
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say seq(1) is nonstandard, inefficient and useless. For bash2.04+/zsh/ksh93, use for ((i = 1; i <= 10; i++)); do ..., for POSIX and other shells, see !counting


index1: #bash
index2: seqfunc
owner: kojiro
ref_user: nobody
type: text
action:
  /say seq() { local i FIRST=1 INCREMENT=1 LAST=1; case $# in 3) FIRST=$1 INCREMENT=$2 LAST=$3;; 2) FIRST=$1 LAST=$2;; 1) LAST=$1;; esac; i=$FIRST; while [ $i -le $LAST ]; do echo $i; let i+=$INCREMENT; done; }


index1: #bash
index2: servant
last_referenced_in: cr1t1cal
owner: lhunath
ref_user: cr1t1cal!~chiken@60-242-215-61.static.tpgi.com.au
type: text
action:
  /say We are not your servants. We are here to help you answer your questions, and assist you in your problems. We do not write scripts for you, and we do not fix scripts for you. If you have a problem, do not come here until you know what your problem is EXACTLY. We can help you solve it, but we CANNOT find the problem for you; that is YOUR task.


index1: #bash
index2: set
last_referenced_in: #pbot2-test
owner: geirha
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say help set <Enter> http://bash-hackers.org/wiki/doku.php?id=commands:builtin:set # set -vx is useful for debugging, set +H for playing in terminal.


index1: #bash
index2: set-e
owner: geirha
ref_user: nobody
type: text
action:
  /say "set -e" tells bash to abort the execution of the script when an unchecked command fails. A command is checked when it is in an if, while, until, &&, || or ! check. Also see http://mywiki.wooledge.org/BashFAQ/105


index1: #bash
index2: set-f
owner: greycat
ref_user: nobody
type: text
action:
  /say ''set -f'' disables glob expansion. You may need this in constructs like ''for w in $words'' or ''array=($words)'' just in case one of the words contains a * or ?.


index1: #bash
index2: set-u
owner: nDuff
ref_user: nobody
type: text
action:
  /say "set -u", or "set -o nounset", makes use of unset variables an error. To test whether a variable is present when this is active without causing an error, you can check for [[ ${var-} ]] instead of [[ $var ]].


index1: #bash
index2: set-x
owner: lhunath
ref_user: nobody
type: text
action:
  /say set -x (or ''bash -x myscript'') makes bash output the exact command that it will run after parsing and expansion. You can put ''set -x'' just before the code you want to debug (turn off with ''set +x''). To add more information, change PS4 first: eg. PS4='+($?) $BASH_SOURCE:$FUNCNAME:$LINENO:'


index1: #bash
index2: setgid
owner: greycat
ref_user: nobody
type: text
action:
  /say The setgid bit (octal permission bit 02000) on a directory causes new files to inherit the directory's group ownership. See http://mywiki.wooledge.org/Permissions#setgid


index1: #bash
index2: sh
owner: lhunath
ref_user: nobody
type: text
action:
  /say sh is NOT bash. It is a POSIX/bourne shell. To run bash code, your script MUST have #!/bin/bash at the top and it MUST be either executed directly or with bash (ie. NOT sh myscript). Some /bin/sh link to bash, you cannot rely on this and it will disable most bash features. http://mywiki.wooledge.org/BashGuide/Practices#Choose_Your_Shell


index1: #bash
index2: sh-c
owner: lhunath
ref_user: nobody
type: text
action:
  /say Never expand parameters in ''sh -c'' commands. Use either of these instead: sh -c 'command "$1"' -- "$file" OR file=$file sh -c 'command "$file"' OR sh -c "$(printf 'command %q' "$file")". Same problem with 'ssh', though with 'ssh' only the last alternative works.


index1: #bash
index2: shanghai
owner: greycat
ref_user: nobody
type: text
action:
  /say shanghai (verb): to force into service. Originally used to describe the practice of kidnapping men and forcing them to serve as sailors.


index1: #bash
index2: shebang
last_referenced_in: dave0
owner: lhunath
ref_user: dave0!~dave@168.215.dsl.syd.iprimus.net.au
type: text
action:
  /say The top of a script MUST have a #! line, called 'shebang' or 'hashbang'. It tells the kernel what program to run your script with. We recommend `#!/usr/bin/env bash` (why: http://stackoverflow.com/a/733901/58803). http://mywiki.wooledge.org/BashGuide/CommandsAndArguments#Scripts http://www.in-ulm.de/~mascheck/various/shebang/


index1: #bash
index2: shellshock-test
owner: geirha
ref_user: nobody
type: text
action:
  /say a='() { :;}; echo CVE-2014-6271 FAIL' b='() { (b)=>\' bash -c '/dev/stdout echo CVE-2014-7169 FAIL||echo CVE-2014-7169 OK;a||echo CVE-2014-6271 OK' 2>/dev/null


index1: #bash
index2: shift
last_referenced_in: #pbot2
owner: SiegeX
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say to shift positional parameters to the left, simply use 'shift'. To shift to the right, use: set -- "${@:1:$#-1}"


index1: #bash
index2: shlaas
owner: dualbus
ref_user: nobody
type: text
action:
  /say Check your code here first: http://www.shellcheck.net/ if you still have issues, then reduce your >100 line test case to the minimum possible and ask again.


index1: #bash
index2: shopt
owner: igli
ref_user: nobody
type: text
action:
  /say help shopt <ENTER> http://www.bash-hackers.org/wiki/doku.php?id=internals:shell_options -- nullglob and extglob are most common. dotglob and nocase{match,glob} can be handy too


index1: #bash
index2: shows
owner: savetheWorld
ref_user: nobody
type: text
action:
  /say When using the word "shows" make sure you make it clear where the information is being "shown". Is it going to the terminal on stdout or stderr? Is it going into a file? is it already in a file? is it in a pipe? etc..


index1: #bash
index2: shuffle
owner: ormaaj
ref_user: nobody
type: text
action:
  /say Shuffling collections in shell: http://mywiki.wooledge.org/BashFAQ/026 Avoiding bias: http://blog.codinghorror.com/the-danger-of-naivete/


index1: #bash
index2: sigkill
owner: lhunath
ref_user: nobody
type: text
action:
  /say SIGKILL is exactly the same as SIGTERM except that it doesn't invoke the process' signal handlers. You should *never* use it unless you *know* the process is bugging out in its signal handler.


index1: #bash
index2: sigs
last_referenced_in: ##c-offtopic
owner: lhunath
ref_user: qwename!~qwename@unaffiliated/qwename
type: text
action:
  /say SIGTERM: Tells a process to clean up and stop running. SIGINT: User wants to drop back to his shell. SIGQUIT: User saw a bug and wants you to dump debug info. SIGHUP: User closed his terminal. SIGKILL: User wants you to drop what you're doing and stop immediately.


index1: #bash
index2: simplify
last_referenced_in: #pbot2
owner: sjohnson
ref_user: RicardasSim!~RicardasS@78-63-172-44.static.zebra.lt
type: text
action:
  /say Before you boldly claim that some common command doesn't work, try simplifying the command string or script down to the basics to see if the problem still occurs.


index1: #bash
index2: sjohnsonrev2
last_referenced_in: ##c
owner: sjohnson
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say # s="gip etuc a ma i" i=-1 IFS=$'\n'; for c in $(sed 's|.|&\n|g' <<< "$s"); do ((i++)); alias "$i"="printf %s \"$c\""; done; unset IFS; for i in $(eval echo {$i..0}); do eval ${BASH_ALIASES[$i]}; done


index1: #bash
index2: skim
owner: e36freak
ref_user: nobody
type: text
action:
  /say Don't skim. Read. There is a lot of information in links we give you, and in man pages. Once you've read it once, and have absorbed the information, feel free to skim for reference. But until you know it, read the whole thing.


index1: #bash
index2: sl
owner: greycat
ref_user: nobody
type: text
action:
  /say The reason you don't want . in PATH is because you might be sitting in /tmp and accidentally type "sl" instead of "ls", and voila! You've run the hax0r's /tmp/sl command.


index1: #bash
index2: slashes
owner: greycat
ref_user: nobody
type: text
action:
  /say You don't always have to use sed 's/foo/bar/'. If bar contains slashes, you can use a different delimiter, like sed 's#foo#bar#'. Any printable character can be used.


index1: #bash
index2: slice
owner: greycat
ref_user: nobody
type: text
action:
  /say Some people use the word "slice" to mean "a contiguous set of array elements", as in "I want array elements 5 through 7". "${array[@]:5:3}" or "${@:5:3}"


index1: #bash
index2: slurp
owner: izabera
ref_user: nobody
type: text
action:
  /say To read a file's contents into a variable: var=$(< file) However, this strips trailing newlines. To work around that: var=$(cat file; printf x) var=${var%x} In bash 4.1 and above, read -rN0 < file


index1: #bash
index2: smaller
owner: greycat
ref_user: nobody
type: text
action:
  /say When you're trying to find your mistake in a shell script, make the script SMALLER. Smaller is better. Reduce your code to the bare minimum size that still shows the problem. You'll probably end up fixing it yourself in the process.


index1: #bash
index2: smartquotes
owner: greycat
ref_user: nobody
type: text
action:
  /say Hey, you! Mac user! http://www.iclarified.com/38772/how-to-disable-curly-quotes-in-mac-os-x-mavericks


index1: #bash
index2: so_html
owner: kojiro
ref_user: nobody
type: text
action:
  /say http://stackoverflow.com/questions/1732348/#1732454 (best response to parsing HTML with regex yet)


index1: #bash
index2: solution
last_referenced_in: #cjeopardy
owner: savetheWorld
ref_user: root_guix!~root@13-36-179-94.pool.ukrtel.net
type: text
action:
  /say "The first part of solving any problem is making sure you understand what you are trying to solve. If you can't cogently and clearly state what you are trying to do, then how can you expect anyone else to understand what you are trying to do?"


index1: #bash
index2: sort
last_referenced_in: #pbot2
owner: lhunath
ref_user: acerbic!~acerbic@2602:30a:2cf9:4710:f27b:cbff:fe81:c6b3
type: text
action:
  /say sort(1) is an external command that sorts your input lexicographically or numerically. See http://to.lhunath.com/bashlib#L1207 for a bash sorter that can optionally take a comparator command.


index1: #bash
index2: sortfiles
owner: BlastHardcheese
ref_user: nobody
type: text
action:
  /say declare -a files; n=0; while IFS= read -r -d ''; do for((i=0;i<=n;i++)); do if [[ "$REPLY" -nt "${files[i]}" ]]; then for((j=n;j>i;j--)); do files[j]="${files[j-1]}"; done; files[i]="$REPLY"; ((n++)); break; fi; done; done < <(find . -type f -print0) # sorts all files under . in descending order by mtime; requires a find(1) that supports -print0


index1: #bash
index2: source
last_referenced_in: #bash
owner: cdown
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say ''. <script>'' (or "source", which is not portable) reads and executes the commands from <script> in the current shell.


index1: #bash
index2: sp
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: nh!~NextHendr@unaffiliated/nexthendrix
type: text
action:
  /say Special Parameters (magic read-only builtin "variables"): http://www.gnu.org/software/bash/manual/bashref.html#Special-Parameters


index1: #bash
index2: spaces
owner: lhunath
ref_user: nobody
type: text
action:
  /say Spaces in bash are important syntax: they separate command names and arguments. foo = bar is NOT AN ASSIGNMENT (runs foo with arguments = and bar), if [-d "$dir"] is NOT A TEST (runs the program [-d). Also remember to quote ALL your expansions to avoid unintentionally syntactical spaces from your data: rm "$file" (NOT rm $file).


index1: #bash
index2: spam
last_referenced_in: ##c-offtopic
owner: igli
ref_user: ondrej008!uid311009@gateway/web/irccloud.com/x-uid311009
type: text
action:
  /say Please don't make us do this: while : ; do wget -O/dev/null -o/dev/null http://www.<yourSpammyDomain>.com/ ; done


index1: #bash
index2: special
owner: greycat
ref_user: nobody
type: text
action:
  /say Special Parameters are read-only pseudo-variables, such as $$ (PID), $! (bg child PID), etc. See http://mywiki.wooledge.org/BashGuide/Parameters


index1: #bash
index2: specialchars
owner: kurahaupo
ref_user: nobody
type: text
action:
  /say Inside single quotes there are no special characters (but you can't put a single quote *inside* a single-quoted string); inside double quotes, \ and $ are special; outside quotes, \ and $ & ( ) | ; < > * ? [ ] are special along with whitespace, and in certain contexts # = ~ { } are also special.


index1: #bash
index2: split_str
owner: e36freak
ref_user: nobody
type: text
action:
  /say split_str() { local sep=$1 str=$2; [[ $1 && $2 ]] || return; split=(); while [[ $str = *"$sep"* ]]; do split+=("${str%%"$sep"*}"); str=${str#*"$sep"}; done; split+=("$str"); } # usage: split_str SEP STRING # splits STRING on the literal string SEP, populating the array "split". for example: s='foo - bar - baz blah - quux'; split_str ' - ' "$s"; printf '%s\n' "${split[@]}"


index1: #bash
index2: splitscreen
owner: koala_man
ref_user: nobody
type: text
action:
  /say t=$(mktemp); printf '%s\n' 'screen tail -F somefile' split focus screen > "$t"; screen -S screenname -c "$t"


index1: #bash
index2: sponge
owner: koala_man
ref_user: nobody
type: text
action:
  /say sponge() ( tmp=$(mktemp) && cat > "$tmp" && cat -- "$tmp" > "$1" && rm -- "$tmp"; ) # read and write the same file in a pipeline: grep -v '^#' file | sponge file


index1: #bash
index2: spoon
last_referenced_in: learath2
owner: igli
ref_user: Learath2!~learath2@unaffiliated/learath2
type: text
action:
  /say We're not here to spoon-feed you, nor are we your private tutor. Try stuff out after reading the urls, and then ask, pasting a cmd into irc, followed by the error msg.


index1: #bash
index2: sprintf
last_referenced_in: ##c
owner: e36freak
ref_user: muffindrake!~muffindra@unaffiliated/muffindrake
type: text
action:
  /say Instead of capturing the output of printf, bash's printf can be assigned directly to a variable. printf -v myvarname %04d "$i"


index1: #bash
index2: sprunge
last_referenced_in: ##c-offtopic
owner: dualbus
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say To upload to sprunge from your terminal, use: <command> | curl -F 'sprunge=<-' http://sprunge.us # or see !sprungefunc.


index1: #bash
index2: sprungefunc
last_referenced_in: ##c-offtopic
owner: geirha
ref_user: sjohnson!~sjohnson@cow.sj.rfc1459.net
type: text
action:
  /say sprunge() { tail -n +1 -- "$@" | curl -F 'sprunge=<-' http://sprunge.us; } # usage: sprunge file1 file2 ... # or cmd | sprunge


index1: #bash
index2: sqlitequote
owner: lhunath
ref_user: nobody
type: text
action:
  /say sqlitequote() { printf %s "'${1//\'/''}'"; }; sqlite3 foo.sqlite <<< "UPDATE table SET foo=$(sqlitequote "$foo")"


index1: #bash
index2: ssh
last_referenced_in: ##c-offtopic
owner: llua
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say Secure SHell (#openssh, http://mywiki.wooledge.org/CategorySsh). To run echo "$localVar" remotely, use: ssh user@host bash < <(printf 'echo %q\n' "$localVar")


index1: #bash
index2: ssh_original_command
owner: lhunath
ref_user: nobody
type: text
action:
  /say openssh's "forced command" receives an SSH_ORIGINAL_COMMAND set to the command passed to "ssh". forced-commands SHOULD NOT try to parse shell code from it. Use it only for entirely custom protocols (akin to internal-sftp) or a non-restrictive wrapper.


index1: #bash
index2: sshpax
owner: geirha
ref_user: nobody
type: text
action:
  /say You can duplicate an entire directory hierarchy onto a remote host using ssh and pax: cd /source && pax -w . | ssh me@remotebox 'cd /target && pax -r'


index1: #bash
index2: sshtar
owner: geirha
ref_user: nobody
type: text
action:
  /say You can duplicate an entire directory hierarchy onto a remote host using ssh and tar: cd /source && tar cf - . | ssh me@remotebox 'cd /target && tar xf -'


index1: #bash
index2: stack
last_referenced_in: no-n
owner: greycat
ref_user: no-n!sid257727@gateway/web/irccloud.com/x-sid257727
type: text
action:
  /say The FUNCNAME array variable contains the names of all the functions in the current function-call stack.


index1: #bash
index2: stackoverflow
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: nil!~n@monade.li
type: text
action:
  /say Like virtually every other web site you find via Google, StackOverflow is chock full of wrong answers. Verify everything you read there before using it.


index1: #bash
index2: stat(1)
owner: lhunath
ref_user: nobody
type: text
action:
  /say is a tool some systems have to display metadata on files and file systems. It is NOT recommended for use in scripts since there are no guarantees that systems have stat(1) and even less guarantees that the options of your stat will in any way resemble the options of another's. For file size, use wc, for time checks use test.


index1: #bash
index2: stderr
owner: kojiro
ref_user: nobody
type: text
action:
  /say Standard Error is the secondary file descriptor to which commands print to the terminal. It's meant for messages that shouldn't be parsed by default. Redirect to stderr: '>&2'. See !stdout !stdin and !redirtut for more info.


index1: #bash
index2: stdin
owner: kojiro
ref_user: nobody
type: text
action:
  /say Standard Input is the file descriptor from which commands can read input. See !stdout !stderr and !redirtut for more info.


index1: #bash
index2: stdout
owner: kojiro
ref_user: nobody
type: text
action:
  /say Standard Output is the primary file descriptor to which commands print to the terminal. See !stderr !stdin and !redirtut for more info.


index1: #bash
index2: step
owner: lhunath
ref_user: nobody
type: text
action:
  /say To step through your code, look into bashdb or put this where you want to begin stepping: trap '(read -p "[$BASH_SOURCE:$LINENO] $BASH_COMMAND?")' DEBUG


index1: #bash
index2: sticky
owner: greycat
ref_user: nobody
type: text
action:
  /say The "sticky" bit (octal permission bit 01000) on a directory prevents removing other people's files. See http://mywiki.wooledge.org/Permissions#sticky


index1: #bash
index2: stopclever
owner: fr33loader
ref_user: nobody
type: text
action:
  /say “UNIX tools were not designed to stop users from doing stupid things, as that would also stop them from doing clever things.” — Doug Gwyn


index1: #bash
index2: strace
owner: lhunath
ref_user: nobody
type: text
action:
  /say strace(1) is a linux tool for viewing the system calls applications make. It is invaluable for debugging more complex or stubburn problems. On certain other systems, dtruss(1) might achieve the same thing. To use it, just put strace/dtruss in front of your command.


index1: #bash
index2: strings
last_referenced_in: #pbot2
owner: bronze
ref_user: acerbic!~acerbic@2602:30a:2cf9:4710:f27b:cbff:fe81:c6b3
type: text
action:
  /say Bash parameter expansion does lots of string operations. See !faq 100 for info on string operations in bash.


index1: #bash
index2: style
last_referenced_in: ##c
owner: pgas
ref_user: arethusa!~jfdsak@ool-182fcea2.dyn.optonline.net
type: text
action:
  /say Some assorted coding guides, ideas welcome: http://bash-hackers.org/wiki/doku.php/scripting/style google style: https://google-styleguide.googlecode.com/svn/trunk/shell.xml


index1: #bash
index2: su
owner: greycat
ref_user: nobody
type: text
action:
  /say "Switch user". This command either gives you an interactive shell as a different UID, or it allows you to execute a specified command as a different UID. You *do* have to tell it what command you want to run with the other UID, if you're trying to use it in a script. And you MUST give the username! su root -c '/foo/bar baz quux'


index1: #bash
index2: sudoedit
owner: mattcen
ref_user: nobody
type: text
action:
  /say sudoedit is a wrapper around sudo that allows editing of files not owned by you, which does proper file locking etc. You should use it for editing files in /etc. Equivalent to sudo -e.


index1: #bash
index2: sudofail
owner: lhunath
ref_user: nobody
type: text
action:
  /say sudo echo > file -- bash operations such as redirections, glob expansions, etc. are performed by the USER's bash, not by sudo. Consider: `sudo tee file` or `sudo bash -c 'echo > file'`


index1: #bash
index2: suid
owner: yitz_
ref_user: nobody
type: text
action:
  /say The SUID bit doesn't work on interpretted scripts in Linux. Use sudo or http://pastebin.com/f1967215f: wget -O code.c 'http://pastebin.com/pastebin.php?dl=f1967215f' ; nano code.c ; gcc -o run code.c ; sudo chown root run ; sudo chmod 4755 run


index1: #bash
index2: supercopy
owner: BlastHardcheese
ref_user: nobody
type: text
action:
  /say supercopy(){ sudo sh -c 'for file in "${@:2}"; do cp "$file" "$1" && chown "$SUDO_UID":"$SUDO_GID" "$1"/"${file##*/}"; done' _ "$@"; } # usage: supercopy destination files [...]; copies all files to destination and changes the copies' ownership to the uid/gid of the invoking user


index1: #bash
index2: surgeon
owner: greycat
ref_user: nobody
type: text
action:
  /say <mcantor> I feel like a surgeon who opened up a patient for a hernia procedure only to find that the liver is atrophied, a lung is collapsed and the kidneys have simply been replaced with a Post-It note saying "Sorry"


index1: #bash
index2: suspense
owner: igli
ref_user: nobody
type: text
action:
  /say The suspense is killing us.. do tell ;-) If you figured out a problem you asked us about, it's only polite to share the solution as well as the work. That way other people who didn't know the answer gain something from your time with us. :)


index1: #bash
index2: svercmp
owner: dualbus
ref_user: nobody
type: text
action:
  /say Simple version comparison in pure bash: https://github.com/dualbus/myscripts/blob/master/svercmp


index1: #bash
index2: svg
owner: greycat
ref_user: nobody
type: text
action:
  /say Scalable Vector Graphics, an XML-based vector image format. If someone's got svg questions, they should probably ask me about <xml>.


index1: #bash
index2: svn
last_referenced_in: ##c-offtopic
owner: koala_man
ref_user: mthowe!~morganh@unaffiliated/mthowe
type: text
action:
  /say If you're considering removing .svn directories, first read "svn --help export". If you're not convinced, find . -name .svn -prune -exec rm -rf {} +


index1: #bash
index2: tac
owner: e36freak
ref_user: nobody
type: text
action:
  /say tac(1) is a non-standard GNU-only command. A POSIX equivalent would be awk '{a[i++]=$0} END {while (i--) print a[i]}'


index1: #bash
index2: tar
owner: Bronze
ref_user: nobody
type: text
action:
  /say tar is an archiver but not the only one. Usually tar is a good choice (e.g. to duplicate an ENTIRE file system), but if you need fine-grained control, find|cpio or find|pax wins


index1: #bash
index2: tco
owner: ormaaj
ref_user: nobody
type: text
action:
  /say # f() if [ "$1" -ge 0 ]; then printf %s "$1"; exec dash -c "${2}f "'$(($1 - 1)) "$2"' _ "$@"; fi; (f 9 "$(typeset -f f)"$'\n'); printf %s\\n ' See: http://mywiki.wooledge.org/WrapperScript http://jeapostrophe.github.com/blog/2012/05/28/exec-vs-system/'


index1: #bash
index2: tcpserver
owner: greycat
ref_user: nobody
type: text
action:
  /say Part of ucspi-tcp <http://cr.yp.to/ucspi-tcp.html>, useful for providing easy, robust network services WITHOUT having to be superuser or edit a monolithic inetd.conf file.


index1: #bash
index2: telnet
owner: kojiro
ref_user: nobody
type: text
action:
  /say "A perfectly good tool for diagnosing issues with SMTP and HTTP servers." -greycat Otherwise, not a secure way to connect to a shell for administrative purposes.


index1: #bash
index2: terminal
last_referenced_in: dminuoso_
owner: bronze
ref_user: dminuoso_!~dminuoso@unaffiliated/dminuoso
type: text
action:
  /say a hardware device used for user input/output in the early Cretaceous period of computing. Consisted of a primitive TV-like tube which "drew" characters on the screen in fixed positions. Most early terminals were limited to 24 lines high by 80 chars wide. At the time this was considered a miracle of technology.


index1: #bash
index2: testing
owner: igli
ref_user: nobody
type: text
action:
  /say Testing is for *you*. PLAY with the code, work out what it means; short snippets show the idea. /msg greybot tias ;-)


index1: #bash
index2: tests
last_referenced_in: #pbot2
owner: geirha
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say Use [[ .. ]] for testing strings or files, (( .. )) for testing numbers and 'if ..'' for testing commands. Do *NOT* use [ .. ] in bash (only in sh). See <http://mywiki.wooledge.org/BashSheet#Tests> and <http://mywiki.wooledge.org/tests>. Difference between [ and [[: <http://mywiki.wooledge.org/BashFAQ/031>


index1: #bash
index2: thebasics
owner: yitz_
ref_user: nobody
type: text
action:
  /say People in #bash are here to help others work through problems and chellenges and direct people in learning. This isn't a 101 classroom, though. If you don't know the basics, read the guide.


index1: #bash
index2: theory
last_referenced_in: ##c-offtopic
owner: emg
ref_user: sjohnson!~sjohnson@cow.sj.rfc1459.net
type: text
action:
  /say The difference between theory and practice? In theory there is no difference. In practice there is.


index1: #bash
index2: thompson
owner: \amethyst
ref_user: nobody
type: text
action:
  /say The Thompson shell was the predecessor to the Bourne (q.v.) shell, used in versions of Unix prior to 7th edition. A modern port of the Thompson shell is available at http://v6shell.org/ .


index1: #bash
index2: thx
owner: dualbus
ref_user: nobody
type: text
action:
  /say THX? That digital audio thing they use in movies? Oh, wait, you want http://yaku.dk/s/irc/dont-use-thx-sry-plz.txt or section 1.1 of http://mywiki.wooledge.org/NetEtiquette


index1: #bash
index2: tib
owner: savetheWorld
ref_user: nobody
type: text
action:
  /say Try it before you buy it! Make small one liners on the command line to make sure you understand what and how you are using an idea before you stick it the middle of a complex script.


index1: #bash
index2: time
last_referenced_in: #pbot2
owner: nDuff
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say ''time'' is a bash builtin, see ''help time''. There may also be a time command installed on the system, documented in ''man time'' -- see !faq 86 to bypass bash's builtin time command, or !faq 32 to redirect the output of the builtin to a file.


index1: #bash
index2: timeout
last_referenced_in: ##c
owner: greycat
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say http://mywiki.wooledge.org/BashFAQ/068 -- How do I run a command, and have it abort (timeout) after N seconds?


index1: #bash
index2: timestamp
owner: llua
ref_user: nobody
type: text
action:
  /say exec > >(trap : 1 2 3 15 ; while IFS= read -r x ; do printf '%(%F%T)T %s\n' -1 "$x" ; done >>/var/log/mylog) 2>&1 # requires bash4.2 or later


index1: #bash
index2: timingpe
owner: tuxdev_
ref_user: nobody
type: text
action:
  /say val=$'foo\n'; { time for ((i=0;i<2000;++i)) ; do echo "${val%$'\n'}" ; done >/dev/null; } 2> >(tr '\n\t' ' ')


index1: #bash
index2: timingpipe
owner: tuxdev_
ref_user: nobody
type: text
action:
  /say val=$'foo\n'; { time for ((i=0;i<50;++i)) ; do echo "$val" | tr -d '\n'; done >/dev/null; } 2> >(tr '\n\t' ' ')


index1: #bash
index2: tiocsti
owner: greycat
ref_user: nobody
type: text
action:
  /say The TIOCSTI ioctl() command lets you insert input into a terminal driver's queue. "Simulate Terminal Input".


index1: #bash
index2: tlcl
owner: Riviera
ref_user: nobody
type: text
action:
  /say The Linux Command Line (book by William Shotts). A good guide to the command line in general, but not a fantastic example for good Bash practices: http://www.linuxcommand.org/tlcl.php and http://sourceforge.net/projects/linuxcommand/files/TLCL/13.07/TLCL-13.07.pdf/download


index1: #bash
index2: tldp
owner: ferret
ref_user: nobody
type: text
action:
  /say the tldp bash guide is outdated, and in some cases just plain wrong. There's a reason it isn't in the topic.


index1: #bash
index2: topic2
owner: e36freak
ref_user: nobody
type: text
action:
  /say FAQ: http://mywiki.wooledge.org/BashFAQ | Guide: http://mywiki.wooledge.org/BashGuide | ref: http://xrl.us/bhk9ww | http://wiki.bash-hackers.org/ | USE MORE QUOTES!: http://www.grymoire.com/Unix/Quote.html | Scripts and more: http://www.shelldorado.com/ | New official help mailing list: http://tx0.org/31f


index1: #bash
index2: tp
owner: lhunath
ref_user: nobody
type: text
action:
  /say Comparison of popular transfer protocols: http://winscp.net/eng/docs/protocols#protocol_comparison


index1: #bash
index2: tpgrp
owner: kurahaupo_mobile
ref_user: nobody
type: text
action:
  /say every process has a PID, a process group (PGRP, which is its own PID, or the PGRP inherited ftom its parent), and a session (SID). All processses in a PGRP have the same SID. A terminal has a session & a foreground process group (which must be in the same SID). If the terminal's SID changes, all the processes with that SID get SIGHUP. If you type ctrl-C or ctrl-Z then the PGRP gets SIGINT or SIGTSTP


index1: #bash
index2: tput
owner: izabera
ref_user: nobody
type: text
action:
  /say Do NOT hardcode terminal escape sequences. Use tput with the sequence names from man terminfo to get the right code for your terminal. Eg. red=$(tput setaf 1); echo "Hello ${red}world!" # Variables example: http://to.lhunath.com/bashlib#L210 more info at http://www.gnu.org/software/termutils/


index1: #bash
index2: trap
last_referenced_in: othias
owner: greycat
ref_user: othias!d9734108@gateway/web/freenode/ip.217.115.65.8
type: text
action:
  /say http://mywiki.wooledge.org/SignalTrap ## To clean up on exit, don't trap a bunch of signals. Instead, trap cleanupFunc EXIT


index1: #bash
index2: trim
owner: geirha
ref_user: nobody
type: text
action:
  /say trim whitespace, like SQL TRIM() -- For shell variables: «shopt -s extglob; x=${x##+([[:space:]])} x=${x%%+([[:space:]])}». For streams: «cmd | sed 's/^[[:space:]]*//; s/[[:space:]]*$//'». See: http://mywiki.wooledge.org/BashFAQ/067


index1: #bash
index2: tsaap
owner: greycat
ref_user: nobody
type: text
action:
  /say The Standard Associative Array Problem: "I have two files, one of which defines keys and values, and I want to iterate through the second file and replace all the keys with their values."


index1: #bash
index2: tshirt
last_referenced_in: #cjeopardy
owner: savetheWorld
ref_user: vclam!~unknown@c-24-11-122-3.hsd1.ut.comcast.net
type: text
action:
  /say "You were treated harshly in #bash? well, it happens. Here's your T-shirt. It says: Been there, had that done to me."


index1: #bash
index2: tty
last_referenced_in: ##c
owner: Riviera
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  /say "tty" originally stood for teletype, a primitive keyboard+printer which was the forerunner of the ASCII terminal. Nowadays it is used generically to mean "some kind of terminal", usually a pseudoterminal (X terminal emulator, Linux console, etc.). http://www.linusakesson.net/programming/tty/


index1: #bash
index2: type
owner: geirha
ref_user: nobody
type: text
action:
  /say type tells you how a command will be interpreted by the shell. Don't use 'which'; use 'type' instead, because it's portable and consistent.


index1: #bash
index2: type-foo
owner: Jetchisel
ref_user: nobody
type: text
action:
  /say When someone tells you to do "type foo", that means 1) put your hands on the keyboard 2)key-in "type foo", without the quotes :-)


index1: #bash
index2: u
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: nil!~n@monade.li
type: text
action:
  /say Spanish word for "or", variant used when preceding an "o" sound. If you meant "you", please see http://mywiki.wooledge.org/NetEtiquette


index1: #bash
index2: udq
owner: SiegeX6
ref_user: nobody
type: text
action:
  /say USE DIFFERENT QUOTES! The shell won't expand variables or globs inside a single-quoted string, try double-quotes instead


index1: #bash
index2: ulimit
last_referenced_in: bazookie
owner: greycat
ref_user: bazookie!~mzp@187-27-205-195.3g.claro.net.br
type: text
action:
  /say ulimit is bash's interface to the setrlimit()/getrlimit() system calls. Resource limits are inherited by child processes, just like environment vars.


index1: #bash
index2: umask
owner: greycat
ref_user: nobody
type: text
action:
  /say The umask is the set of permissions bits you do NOT want on newly created files. See http://wooledge.org/mywiki/Permissions


index1: #bash
index2: umq2
owner: kwtm
ref_user: nobody
type: text
action:
  /say Use more quotes, not just when assigning variables. Try these examples: WRONG: Var="/* is two punctuation marks" && echo $Var ; RIGHT: Var="/* is two punctuation marks" && echo "$Var"


index1: #bash
index2: unary
owner: greycat
ref_user: nobody
type: text
action:
  /say "unary operator expected" typically means you forgot to quote something. [ $foo = bar ] is wrong. [ "$foo" = bar ] is OK.


index1: #bash
index2: unicode
owner: lhunath
ref_user: nobody
type: text
action:
  /say Dealing with characters correctly is harder than you might think. eg. a-z does NOT mean "all lowercase letters". http://stackoverflow.com/a/6163129/58803 (skip down to "Assume Brokenness") is an *excellent* introduction to these misunderstandings.


index1: #bash
index2: uniq
owner: yitz_
ref_user: nobody
type: text
action:
  /say is a utility for removing or reporting repeated lines. uniq will only work for showing unique lines when used with sorted input (sort | uniq). Alternatively, use sort -u. awk '!s[$0]++' is an order-insensitive alternative.


index1: #bash
index2: uniqarray
owner: ormaaj
ref_user: nobody
type: text
action:
  /say # typeset -a a=(a b c c d d d e f '' '' _ _); o=$(typeset -p a); typeset -A vals; for key in "${!a[@]}"; do ((vals[_${a[key]}]++)) && unset -v 'a[key]'; done; printf 'before: %s\nafter: %s\n' "$o" "$(typeset -p a)"


index1: #bash
index2: unix
last_referenced_in: omgwtfbbq
owner: neurolysis
ref_user: omgwtfbbq!~knoppix@5.114.246.213
type: text
action:
  /say You should be fully aware that when people say Unix they do not necessarily mean "The copyrighted proprietary operating system currently owned by AT&T or Novell or SCO or Cisco or whoever the fuck owns the copyright at this particular instant of time", but rather the whole FUCKING SPECTRUM OF UNIX-LIKE OSES including AIX, HP-UX, Linux, BSD, Solaris, etc.


index1: #bash
index2: unquoted
owner: ormaaj
ref_user: nobody
type: text
action:
  /say Unquoted $@ and $* give unspecified behavior (as far as we can tell). Always quote them. A partial list of various unquoted behaviors by shell is here: http://wiki.bash-hackers.org/syntax/pe#bugs_and_portability_considerations


index1: #bash
index2: unset
last_referenced_in: esselfe
owner: ormaaj
ref_user: esselfe!~bsfc@unaffiliated/esselfe
type: text
action:
  /say Unset undefines a variable or function from the current shell process. See: http://wiki.bash-hackers.org/commands/builtin/unset http://fvue.nl/wiki/Bash:_Unset. Testing if a variable is set: [[ ${var+_} ]]. See !isset


index1: #bash
index2: upload
owner: greycat
ref_user: nobody
type: text
action:
  /say If you're asking "How can I find all the files that have been uploaded recently?" then you're probably in deep trouble. The server side can't tell when a file is finished uploading unless the client renames it or uploads an "all done" file afterward.


index1: #bash
index2: upstart
owner: greycat
ref_user: nobody
type: text
action:
  /say Ubuntu doesn't use System V init like you probably expected. It uses "upstart" instead. See http://upstart.ubuntu.com/ or ask in #ubuntu.


index1: #bash
index2: upvar
owner: ormaaj
ref_user: nobody
type: text
action:
  /say see: http://fvue.nl/wiki/Bash:_Passing_variables_by_reference also: http://wiki.bash-hackers.org/commands/builtin/unset#scope and http://wiki.bash-hackers.org/syntax/arrays#indirection and http://mywiki.wooledge.org/BashFAQ/006#Assigning_indirect.2BAC8-reference_variables


index1: #bash
index2: uri
last_referenced_in: ##c-offtopic
owner: BlastHardcheese
ref_user: nil!~n@monade.li
type: text
action:
  /say pout(){ local field; for field in "${line[@]}"; do [[ $field =~ $re ]] && echo "$field"; done;}; uri_search(){ local LC_ALL=C re='^[A-Za-z][A-Za-z0-9+-\.]*://' file=; local -a line; for file; do while read -r -a line; do pout; done < "$file"; [[ "${line[@]}" ]] && pout; done;} # Usage: uri_search file ...; prints absolute URIs contained in given files


index1: #bash
index2: urlquote
owner: lhunath
ref_user: nobody
type: text
action:
  /say Prepare literal data for injection into a URL path component or GET attribute: urlquote() { local c; while IFS= read -rd '' -n1 c; do printf '%%%02x' "'$c"; done <<< "$1"; }; curl "http://www.google.com/search?q=$(urlquote "$query")"


index1: #bash
index2: us-intl
owner: kurahaupo
ref_user: nobody
type: text
action:
  /say If you are using a Linux desktop, and want to type symbols such as «french-quotes» “double-quote” and ‘single-quotes’, then set your keyboard type to "US International", and then use AltGr with [ ] { } 9 0 respectively


index1: #bash
index2: usecase
last_referenced_in: l2y
owner: fr33loader
ref_user: l2y!sid204729@gateway/web/irccloud.com/x-sid204729
type: text
action:
  /say What is the *REAL* (non-technical) problem or issue you are trying to address? Describe it clearly and concisely using little or no technical terminology, command names, etc. A concise explanation of *WHY* you are doing what you are doing is equally helpful.


index1: #bash
index2: users
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: atk!~Arch-TK@ircpuzzles/staff/Arch-TK
type: text
action:
  /say http://wooledge.org/mywiki/BashFaq -- Why don't users ever read the FAQ themselves? Why do I always have to grep the whole file for their questions? Huh? Doesn't anyone ever think of the bot?


index1: #bash
index2: using
last_referenced_in: ##c-offtopic
owner: greycat
ref_user: qwename!~qwename@unaffiliated/qwename
type: text
action:
  /say "How can I do X using Y?" NEVER ask a question of that form. Y may not be the best way to do X. All you should ask is, "How do I do X?"


index1: #bash
index2: usleep
owner: biz
ref_user: nobody
type: text
action:
  /say echo "int main(int argc,char *argv[]){if(argc==2)usleep(atol(argv[1]));}" > usleep.c; make usleep


index1: #bash
index2: utmp
owner: greycat
ref_user: nobody
type: text
action:
  /say The 'utmp' file and all the commands that read it (who, w, etc.) is useless legacy crap. Yay, truncated hostnames!


index1: #bash
index2: uuoe
owner: kojiro
ref_user: nobody
type: text
action:
  /say Unnecessary use of echo -- "echo foo | bar" uses a pipe, which generates an implicit subshell, which changes the variable scope. Pipes are also expensive. Use a here string instead: "bar <<< foo". See http://wooledge.org:8000/BashPitfalls


index1: #bash
index2: uuok
last_referenced_in: ##c
owner: lhunath
ref_user: slidercrank!~slidercra@unaffiliated/slidercrank
type: text
action:
  /say Unsafe Use of Kill: kill -9 sends SIGKILL to a process which is the exact same thing as normal kill (SIGTERM), except that it prevents the process from cleaning up after itself. You do NOT want to use it. See http://partmaps.org/era/unix/award.html#uuk9letter


index1: #bash
index2: v7
owner: \amethyst
ref_user: nobody
type: text
action:
  /say Seventh Edition Unix (V7, 1979), introduced the Bourne shell, which replaced the earlier Thompson shell. If your script needs to work on pre-POSIX Unix systems, V7 is a good portability target. A full tree of V7, including source and man pages, may be found at http://minnie.tuhs.org/UnixTree/V7/ .


index1: #bash
index2: varcap
last_referenced_in: ##c-offtopic
owner: lhunath
ref_user: nil!~n@monade.li
type: text
action:
  /say By convention, environment variables (PATH, EDITOR, SHELL, ...) and internal shell variables (BASH_VERSION, RANDOM, ...) are fully capitalized. All other variable names should be lowercase. Since variable names are case-sensitive, this convention avoids accidentally overriding environmental and internal variables.


index1: #bash
index2: vardata
owner: lhunath
ref_user: nobody
type: text
action:
  /say 1. Do NOT put commands or variable names INSIDE variables; use a function or write it out in your script. 2. Do NOT put multiple filenames inside a string; use arrays. 3. Remember to quote every expansion of your variables to protect their data.


index1: #bash
index2: vars
owner: lhunath
ref_user: nobody
type: text
action:
  /say There are two types of variables. Most variables in bash are Shell Variables (foo=bar). They exist only in the running shell and are inherited by subshells. Environment Variables (export foo=bar) are variables that exist in every process. They are NOT global, every child gets a fresh copy of the parent's whole environment. http://mywiki.wooledge.org/Environment


index1: #bash
index2: vi
last_referenced_in: ##c-offtopic
owner: lhunath
ref_user: e!e@freenode/staff/spy.edk
type: text
action:
  /say Vi is an editor. Use it in scripts like this: vi -c 's/foo/bar/|x' file -- See http://www.opengroup.org/onlinepubs/009695399/utilities/vi.html


index1: #bash
index2: vocabulary
owner: HawkI
ref_user: nobody
type: text
action:
  /say read and memorize the terms/names used on the bash man page. When you use the bash names for things correctly you'll get 800% better results in #bash, and reduce our work correspondingly!


index1: #bash
index2: vt100
owner: lhunath
ref_user: nobody
type: text
action:
  /say ANSI X3.64 is a terminal control code standard supported by most modern terminals. VT100 is a subset implemented by DEC's VT100/102. DO NOT hardcode codes, use tput(1) instead (eg. red=$(tput setaf 1)). Many different terminals use slightly different codes, tput finds the right code for the job. http://unix.stackexchange.com/a/5802 http://wiki.bash-hackers.org/scripting/terminalcodes


index1: #bash
index2: wait
last_referenced_in: mnrmnaugh
owner: geirha
ref_user: mnrmnaugh!~mnrmnaugh@unaffiliated/mnrmnaugh
type: text
action:
  /say By default, wait waits for all of your shell's children to exit. If arguments are specified, wait waits for the specified job ids to exit. # http://mywiki.wooledge.org/ProcessManagement


index1: #bash
index2: watchquote
owner: e36freak
ref_user: nobody
type: text
action:
  /say to help understand how watch(1) handles quotes/parsing, think of it as running this: watch() { sh -c "$*"; while sleep 2; do sh -c "$*'; done; }


index1: #bash
index2: wc
last_referenced_in: omgwtfbbq
owner: greycat
ref_user: omgwtfbbq!~knoppix@5.114.246.213
type: text
action:
  /say wc(1) is a command that counts words, or lines, or characters in files. If you redirect the file as stdin, it doesn't print the name. Very useful. Example: if (( $(wc -l < "$file") > 10 )); then ...


index1: #bash
index2: wc-c
owner: lhunath
ref_user: nobody
type: text
action:
  /say A portable method of finding a file's byte-size is: read size _ < <(wc -c file); or the "hack": size=($(wc -c file))


index1: #bash
index2: wedontcare
last_referenced_in: ##c-offtopic
owner: ivazquez
ref_user: nil!znc@monade.li
type: text
action:
  /say We don't care what your name is... we don't care where you live... we don't care how old you are. Ask your question or leave.


index1: #bash
index2: which
last_referenced_in: ##c
owner: neurolysis
ref_user: Guest88091!67e51216@103.229.18.22
type: text
action:
  /say which(1) is an external program used to search PATH for an executable. It behaves differently on different systems and you can't rely on a useful exit code; use (from most to least portable) ''command -v'' or ''type -P'' (to find the path) or ''hash'' (to check) instead. See http://mywiki.wooledge.org/BashFAQ/081


index1: #bash
index2: whilefind
owner: lhunath
ref_user: nobody
type: text
action:
  /say To iterate over find results safely: while IFS= read -r -d '' file; do ...your code...; done < <(find ...your predicates... -print0)


index1: #bash
index2: whine
last_referenced_in: ##c-offtopic
owner: kojiro
ref_user: oldlaptop!~quassel@45.63.78.126
type: text
action:
  /say why do channel helpers have to whine whenever someone asks a question? Maybe he doesn't know his answer is in the parameter expansion secion of some 100k line faq or man page. Stop wasting everyone's bandwidth and type /exit if people asking for help bothers you so much.


index1: #bash
index2: whinge
last_referenced_in: ##c
owner: igli
ref_user: whoisxy_!~whoisxy@82.112.154.151
type: text
action:
  /say "With Free Software you either do, or you wait." whinging doesn't work, and leads to being ignored ;)


index1: #bash
index2: whitespace
last_referenced_in: ##c
owner: yitz_
ref_user: Wulf!~Wulf@unaffiliated/wulf
type: text
action:
  /say Sometimes whitespace is necessary, eg after [ and [[ and before ] and ]]. Othertimes it breaks stuff eg in {1..9}


index1: #bash
index2: whoami
owner: Riviera
ref_user: nobody
type: text
action:
  /say whoami is not a standard command, use the more portable "id -un" instead. bash offers UID and EUID, and your system the LOGNAME environment variable.


index1: #bash
index2: why
owner: lhunath
ref_user: nobody
type: text
action:
  /say Trying to solve a problem without first understanding why it happens or what you really want will always yield you a broken result. Explain the WHY to us (or to yourself) in detail first.


index1: #bash
index2: whynot
owner: igli
ref_user: nobody
type: text
action:
  /say You can THINK whatever you want, and then when you're done fantasizing, you can read the documentation that tells you what actually does work.


index1: #bash
index2: whynotls
owner: \amethyst
ref_user: nobody
type: text
action:
  /say as ls -F, ls -q, -> on symlinks, date and time formats varying between locales, date and time formats depending on the age of the file in the POSIX locale, spaces in the user name, spaces in the group name, spaces in the filename, newlines in the filename (more or less unfixable), groups might not even be displayed, probably more....


index1: #bash
index2: window_scaling
owner: greycat
ref_user: nobody
type: text
action:
  /say Users of Linux 2.6.8+ kernels, beware! I live on a part of the Internet behind a router with the TCP window scaling bug, and Linux 2.6.8+ makes it impossible to reach me. Read <http://lwn.net/Articles/92727/> for details and workaround.


index1: #bash
index2: words
owner: BlastHardcheese
ref_user: nobody
type: text
action:
  /say Some words about words: http://wiki.bash-hackers.org/syntax/words and http://mywiki.wooledge.org/WordSplitting


index1: #bash
index2: wordsplitting
owner: lhunath
ref_user: nobody
type: text
action:
  /say echo $foo; rm $foo -- If you leave $foo unquoted, bash will *remove* all whitespace (newlines, spaces, tabs) while expanding it, take each *word* as a separate argument. `echo` prints these words separated by one space and `rm` deletes each word. So ALWAYS *quote* your parameter expansions: echo "$foo"


index1: #bash
index2: work
last_referenced_in: #pbot2
owner: kojiro
ref_user: jp!ayy@youlosethega.me
type: text
action:
  /say In this context, the word "work" is misleading. We're here looking for solutions, not hacks. Be specific about what you need, and try to let go of how you think it should be done.


index1: #bash
index2: works
owner: kojiro
ref_user: nobody
type: text
action:
  /say You might think some suggestions appear superfluous, but we aren't making this stuff up. It's risky to parse ls, top and ps, and quotes are important. You care about your script more than we do, so try to understand why we made the suggestion instead of just repeating what seems to work to you.


index1: #bash
index2: x
owner: greycat
ref_user: nobody
type: text
action:
  /say Repeat $str $n times # for ((i=1;i<=n;i++)); do printf %s "$str"; done # printf -v tmp %${n}s ''; echo "${tmp// /$str}" # eval printf "'%.0s$str'" {1..$n} # Be sure $str is safe for whatever your code does with it!


index1: #bash
index2: x++
owner: kurahaupo
ref_user: nobody
type: text
action:
  /say postincrement and postdecrement alter the variable but yield the value from BEFORE the modification


index1: #bash
index2: x11
owner: yitz_
ref_user: nobody
type: text
action:
  /say In order for programs to do something involving X11, the program needs to know which X11 to connect with and how to connect with it. This is usually done by setting the DISPLAY environment variable, eg DISPLAY=:0 command


index1: #bash
index2: xargs
last_referenced_in: mnrmnaugh
owner: lhunath
ref_user: mnrmnaugh!~mnrmnaugh@unaffiliated/mnrmnaugh
type: text
action:
  /say xargs(1) is dangerous (broken, exploitable, etc.) when reading non-NUL-delimited input. If you're working with filenames, use find's -exec [command] {} + instead. If you can get NUL-delimited output, use xargs -0. Otherwise, you probably want a while read or for loop instead.


index1: #bash
index2: xargsbug
owner: lhunath
ref_user: nobody
type: text
action:
  /say # touch "I don't want to miss a thing.mp3"; find * | xargs -n1 rm # By default, xargs(1) breaks on whitespace (making it rm "I" instead of the song) and quotes (the ' in don't).


index1: #bash
index2: xclient
owner: greycat
ref_user: nobody
type: text
action:
  /say In order to run an X client program from outside an X session, you need two things: a valid DISPLAY variable (export it in your script), and a means of authenticating to the X server. The latter can often be done with "export XAUTHORITY=~whomever/.Xauthority". The former requires witchcraft.


index1: #bash
index2: xclip
owner: yitz_
ref_user: nobody
type: text
action:
  /say is a tool to manipulate the X11 clipboard. xclip -o to print the clip and -i to set it. Not bash.


index1: #bash
index2: xdebug
owner: TheBonsai
ref_user: nobody
type: text
action:
  /say Read some assorted debugging tips: http://bash-hackers.org/wiki/doku.php/scripting/debuggingtips


index1: #bash
index2: xml
owner: lhunath
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 xmllint, xmlstarlet, xpath, xsltproc, ... Eg. xmllint --xpath '//person[@name="bob"]/salary/text()' - <<< '<staff><person name="bob"><salary>70000</salary></person></staff>' -- Ask #xml for XPath/XSLT help, that is not a #bash question.


index1: #bash
index2: xmlget
owner: lhunath
ref_user: nobody
type: text
action:
  /say Retrieve an XML value: xmlstarlet sel -t -v 'staff/person[@name="bob"]' <<< '<staff><person name="bob">70000</person></staff>'


index1: #bash
index2: xmlset
owner: lhunath
ref_user: nobody
type: text
action:
  /say Update an XML value: xmlstarlet ed -P --update 'staff/person[@name="bob"]' -v 80000 <<< '<staff><person name="bob">70000</person></staff>' # use -L to update a file in-place.


index1: #bash
index2: xterm
owner: e36freak
ref_user: nobody
type: text
action:
  /say xterm is an X client program which implements a terminal emulator. It mostly mimics the VT102, with some extensions. Some vendors even added color, so "xterm" as a terminfo label is extremely ambiguous. To set the xterm title bar: settitle() { printf '\e]2;%s\a' "$1"; }


index1: #bash
index2: xtracefd
owner: e36freak
ref_user: nobody
type: text
action:
  /say In bash 4.x, the shell variable BASH_XTRACEFD allows you to specify a different file descriptor for xtrace (set -x) output. This can be useful when you want to redirect it elsewhere, without affecting the rest of stderr.


index1: #bash
index2: yes
owner: mattcen
ref_user: nobody
type: text
action:
  /say yes endlessly prints 'y' (or whatever argument it is specified with) followed by a newline to stdout. Useful for sending confirmations. e.g. yes | fsck


index1: #bash
index2: yesdear
last_referenced_in: ##spinach
owner: igli
ref_user: qwename!~qwename@unaffiliated/qwename
type: text
action:
  /say You appear to have a console issue; what does this command output? echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc


index1: #bash
index2: yquotes
owner: igli
ref_user: nobody
type: text
action:
  /say "At its base, a shell is simply a macro processor that executes commands. The term macro processor means functionality where text and symbols are expanded to create larger expressions." http://tiswww.tis.case.edu/~chet/bash/bashref.html


index1: #bash
index2: zombie
last_referenced_in: jack_rabbit
owner: greycat
ref_user: jack_rabbit!~jack_rabb@c-98-228-48-226.hsd1.il.comcast.net
type: text
action:
  /say A zombie process (also known as a "defunct" process) cannot be killed; it's already dead. A zombie is a process which has exited, but whose parent has not yet waited for it (or wait3()ed for it) to collect its exit status. This often signifies a bug in the parent, unless the time of zombification is brief.


index1: #bash
index2: zsh
last_referenced_in: ##c-offtopic
owner: izabera
ref_user: alyptik!ayy@youlosethega.me
type: text
action:
  /say zsh is NOT an enhanced version of bash. It's a different shell, with different features and there's a different channel for your questions: #zsh For zsh-style completion, bind '\C-i':menu-complete


index1: #bash
index2: {
owner: ormaaj
ref_user: nobody
type: text
action:
  /say Brace and sequence expansion: {a,b,c}1 and {a..c}1 expand to a1 b1 c1, {a..c}{1..3} expands to a1 a2 a3 b1 b2 b3 c1 c2 c3. http://wiki.bash-hackers.org/syntax/expansion/brace http://mywiki.wooledge.org/BraceExpansion http://mywiki.wooledge.org/BashGuide/Patterns#Brace_Expansion


index1: #bash
index2: {$
last_referenced_in: ##c-offtopic
owner: lhunath
ref_user: nil!~n@monade.li
type: text
action:
  /say {$x..$y} Parameter expansion happens after brace expansion. As a result, your parameters are only expanded after bash has already failed to brace-expand from dollar-x to dollar-y. Instead, use a C-style for: for ((i=x; i<=y; i++))


index1: #bash
index2: {}
last_referenced_in: ##c-offtopic
owner: Tramp
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say Command grouping. Like (), but doesn't spawn a subshell. See http://mywiki.wooledge.org/BashGuide/CompoundCommands#Command_grouping


index1: #bash
index2: |
owner: lhunath
ref_user: nobody
type: text
action:
  /say Pipes are used to send the (standard) output of one process to the (standard) input of another. foo | bar runs a process foo, sends its output on FD 1 to a process bar's input on FD 0. Note that foo and bar are executed in subshells; so changing variables inside pipes will have no effect on the variables in your main script.


index1: #bash
index2: |&
owner: yitz_
ref_user: nobody
type: text
action:
  /say copy/paste from 'man bash': If |& is used, the standard error of command is connected to command2's standard input through the pipe; it is shorthand for 2>&1 |.


index1: #bash
index2: ||
owner: greycat
ref_user: nobody
type: text
action:
  /say Short-circuit control operators <http://mywiki.wooledge.org/BashSheet#Tests> A || B means "Run A. If A fails, run B." A && B means "Run A. If A succeeds, run B." Example: foobar || { echo "error" >&2; exit 1; }


index1: #bash
index2: ||:
owner: koala_man
ref_user: nobody
type: text
action:
  /say the same thing as "|| true". your script probably also has set -e and || : is a trick to prevent the script from exiting in case the command before the || fails


index1: #bash
index2: |||
owner: lhunath
ref_user: nobody
type: text
action:
  /say When your pipeline gets too long, make sure you can't combine commands into one (grep | awk | awk -> awk, or just use 'read') and try to assign intermediate variables for readability.


index1: ##c
index2: !!
last_referenced_in: kantor
owner: Random832
ref_user: Kantor!~KantorZso@79.114.112.205
type: text
action:
  /say !! is a common idiom for normalizing booleans - it will turn any nonzero value into 1, and leave zero at 0. For example, !!50 is 1.


index1: ##c
index2: #
last_referenced_in: koisoke
owner: Auris-
ref_user: koisoke!xef4@epilogue.org
type: text
action:
  used to commence a preprocessor directive (include, define, undef, ifdef, ifndef, pragma) and as the stringization operator (#x).


index1: ##c
index2: ##c
last_referenced_in: wroathe
owner: anttil
ref_user: wroathe!~wroathe@c-68-54-25-135.hsd1.mn.comcast.net
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.


index1: ##c
index2: #c++
edited_by: edk!edk@spy/edk0
last_referenced_in: fluter
owner: PoppaVic
ref_user: fluter!~fluter@fedora/fluter
type: text
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).


index1: ##c
index2: %d
last_referenced_in: luka00
owner: prec
ref_user: Luka00!~chatzilla@78-134-48-170.v4.ngi.it
type: text
action:
  a *printf format specifier which converts its signed int argument to decimal representation; a *scanf format specifier which parses a decimal representation to its int* argument


index1: ##c
index2: &=
last_referenced_in: ##c
owner: prec
ref_user: ule
type: text
action:
  the bitwise inclusive-AND assignment operator.  The expression (x &= y) is equivalent to (x = x & y) except that the expression x is evaluated only once.


index1: ##c
index2: *
last_referenced_in: ##c
owner: Major-Willard
ref_user: Badinf1uence!~Aaron@76-231-130-145.lightspeed.sgnwmi.sbcglobal.net
type: text
action:
  the multiplication binary operator.  It is also the unary pointer dereference operator.  It is also used in declarations to declare a variable which is a pointer to a type: <type> *p;


index1: ##c
index2: *=
owner: Major-Willard
ref_user: nobody
type: text
action:
  the operator that multiplies the lvalue [to the left of the *] by the expression [to the right of the =]


index1: ##c
index2: ++
last_referenced_in: ##c-offtopic
owner: Major-Willard
ref_user: beeman!~beeman@unaffiliated/beeman
type: text
action:
  a unary operator that increments basic types by 1; if it is placed before a variable the value of the expression is: <var> + 1; if it is placed after a variable the value of the expression is: <var>


index1: ##c
index2: ,
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c
owner: dorp!~dorp@bzq-84-111-138-241.red.bezeqint.net
ref_user: Xatenev!~I@87.190.19.178
type: text
action:
  /say The comma operator takes two operands; the left operand is evaluated as a void expression, and then the right operand is evaluated. There is a sequence point after the evaluation of the left operand. The result of the operand is the type and value of the right operand.


index1: ##c
index2: --
last_referenced_in: #cjeopardy
owner: Major-Willard
ref_user: X7123M3-256!~TestName@80.229.124.232
type: text
action:
  a unary operator that decrements basic types by 1; if it is placed before a variable the value of the expression is: <var> - 1; if it is placed after a variable the value of the expression is: <var>


index1: ##c
index2: -=
owner: Major-Willard
ref_user: nobody
type: text
action:
  the operator that subtracts the expression [to the right of the =] to the lvalue [to the left of the -]


index1: ##c
index2: ->
last_referenced_in: ##c-offtopic
owner: Major-Willard
ref_user: nil!~n@monade.li
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.


index1: ##c
index2: -pedantic
last_referenced_in: ##c
owner: pragma_
ref_user: qwename!~qwename@unaffiliated/qwename
type: text
action:
  a GCC flag that issues all warnings demanded by strict ISO C; rejects most programs that use forbidden extensions; should not be used to check for strict ISO conformance as it only warns for coding practices that _require_ a diagnostic, not everything; loosely supported


index1: ##c
index2: -std
last_referenced_in: ##c
owner: pragma_
ref_user: CaZe!~caze@unaffiliated/caze
type: text
action:
  a GCC flag that is used to specify which C standard to follow when compiling; some valid standards are: c89 (-ansi), c99, gnu89 (default), gnu99


index1: ##c
index2: .
edited_by: Maxdamantus!~Maxdamant@2001:470:f078::dead:beef:cafe
last_referenced_in: wroathe
owner: Major-Willard
ref_user: wroathe!~wroathe@c-68-54-25-135.hsd1.mn.comcast.net
type: text
action:
  /say . might be a decimal point or the beginning of a struct member postfix operator or initialisation designator.


index1: ##c
index2: /=
owner: prec
ref_user: nobody
type: text
action:
  the division assignment operator.  The expression (x /= y) is equivalent to (x = x / y) except that the expression x is evaluated only once.


index1: ##c
index2: ?
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c
owner: Quetzalcoatl_
ref_user: dave0!~davezero@069.d.003.ncl.iprimus.net.au
type: text
action:
  a question mark. Stop staring stupidly off into space with a question mark above your head; wipe that drool off your chin and make an intelligent query.


index1: ##c
index2: ?:
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c
owner: infobahn
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  the conditional operator; <e1> ? <e2> : <e3> if <e1> is true, the operator evaluates and yields <e2>; otherwise it evaluates and yields <e3>


index1: ##c
index2: []
edited_by: nitrix!~nitrix@unaffiliated/nitrix
last_referenced_in: ##c
owner: pragma_
ref_user: nitrix!~nitrix@unaffiliated/nitrix
type: text
action:
  the array subscript operator. It is also part of declarator syntax. The expressions x[y] and *(x + y) are equivalent.


index1: ##c
index2: \
last_referenced_in: #cjeopardy
owner: Major-Willard
ref_user: alyptik!ayy@cpe-76-173-133-37.hawaii.res.rr.com
type: text
action:
  the line continuation character; used in strings to specify special characters; used in character constants to specify special characters; when followed by u or U in C99, is used to specify a universal character name for use in string constants, character constants, or identifiers.


index1: ##c
index2: _
last_referenced_in: ##c
owner: mauke
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use.  All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary and tag name spaces. (ISO 9899:1999, 7.1.3) Don't use such identifiers.


index1: ##c
index2: abcd
last_referenced_in: #pbot2-test
owner: nitrix!~nitrix@unaffiliated/nitrix
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say (a) What is your goal exactly? (b) What have you tried? (c) What are you expecting? (d) What happened instead?


index1: ##c
index2: address
last_referenced_in: #cjeopardy
owner: s00p
ref_user: oxymoron93!d43e266a@gateway/web/cgi-irc/kiwiirc.com/ip.212.62.38.106
type: text
action:
  /say C has pointer types and addresses (or pointer values). foo x; &x results in an address that points to an object. foo *y; y is an instance of a pointer type. Instances of pointer types do not magically point to objects. They must be assigned to before being used, for example: y = &x;


index1: ##c
index2: airport
last_referenced_in: ##c-offtopic
owner: fstd!~fstd@unaffiliated/fisted
ref_user: pragma-!~chaos@unaffiliated/pragmatic-chaos
type: text
action:
  /say ${arg[0]} has been airported ${arg[1:]} (flight id ${digits}${digits}${digits}${digits}${digits})


index1: ##c
index2: align_snippet
last_referenced_in: ##c
owner: dorp!~dorp@bzq-84-111-138-241.cablep.bezeqint.net
ref_user: dorp!~dorp@85-250-41-117.bb.netvision.net.il
type: text
action:
  /say A code sample that demonstrates taking care of the alignment of mixture of types: http://www.iso-9899.info/wiki/Alignment


index1: ##c
index2: alignof_
last_referenced_in: ##c
owner: dorp!~dorp@bzq-84-111-138-241.red.bezeqint.net
ref_user: dorp!~dorp@bzq-84-111-138-241.cablep.bezeqint.net
type: text
action:
  /say alignof_() is a macro for computing the alignment of a type. C11 introduces the alignof operator. #define alignof_(type) offsetof(struct { char c; type m; }, m)


index1: ##c
index2: anonymousstruct
last_referenced_in: ##c
owner: dorp!~dorp@bzq-84-111-138-241.red.bezeqint.net
ref_user: dorp!~dorp@93-172-96-162.bb.netvision.net.il
type: text
action:
  /say Anonymous structure (C11) by definition is an unnamed member that has no tag. See C11 6.7.2.1p13


index1: ##c
index2: argc
last_referenced_in: ##c
owner: prec
ref_user: aozt!~aozt@unaffiliated/aozt
type: text
action:
  the traditional name of the first parameter to main(); argc is non-negative and gives the number of command line arugments (including the program name).


index1: ##c
index2: argv
last_referenced_in: ##c
owner: prec
ref_user: aozt!~aozt@unaffiliated/aozt
type: text
action:
  the traditional name of the second parameter to main(); argv[argc] == NULL; if argc>0 argv[0] is the program name. if argc>1, argv[1] through argv[argc-1] are the command line arguments.


index1: ##c
index2: array
edited_by: pragma-!~chaos@unaffiliated/pragmatic-chaos
last_referenced_in: ##c
owner: Wulf_
ref_user: korans!~korans@83.137.252.187
type: text
action:
  /say An array type describes a contiguously allocated nonempty set of objects with a particular member object type, called the element type.


index1: ##c
index2: array_len
edited_by: e!e@enucs/spy.edk
owner: dorp!~dorp@bzq-84-111-138-241.red.bezeqint.net
ref_user: nobody
type: text
action:
  /say array_len() is a common function-like macro for computing the number of elements of an object with an array type (shouldn't be used with pointer types). #define array_len(a) (sizeof (a) / sizeof *(a))


index1: ##c
index2: aspfb
last_referenced_in: ##c-offtopic
owner: atk!~Arch-TK@fsf/member/Arch-TK
ref_user: atk!Arch-TK@ircpuzzles/staff/Arch-TK
type: text
action:
  /say https://docs.spring.io/spring/docs/2.5.x/javadoc-api/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.html


index1: ##c
index2: atoi
edited_by: fstd!~fstd@unaffiliated/fisted
last_referenced_in: ##c
owner: guidj0s
ref_user: masoudd!~masoudd@5.116.26.205
type: text
action:
  evil. It does no overflow checking, handles unsigned numbers poorly, and handles strings containing trailing characters (like ``123abc'') poorly.  Use strtol() instead.


