text:
User talk:Jamzze

Welcome, Jamzze!

If you have any questions, you can ask in the assistance reading room or possibly contact me personally.

--Xania   talk 00:45, 18 July 2022 (UTC)

Copyright violation

 * Hi - I am not the original writer of this recipe on Wikibooks, but split it from recipes that were on Cookbook:Sticky Toffee Pudding and have now been given their own recipe pages.
 * As I did not originally write this recipe on Wikibooks, I am not sure where this has been flagged for copyright material.
 * Please do elaborate further. Jamzze (discuss • contribs) 12:36, 19 July 2022 (UTC)
 * Hi Nostriker, thanks for outlining this.
 * I have looked at the source you quoted and the user on that page has this quoted next to the recipe:
 * "I was searching around for a decent sticky toffee pudding recipe to add to the Wikibooks UK Cookbook. Ended up making this recipe today, based on recipes I read online. It was dead nice."
 * It looks like this user had added this recipe to Wikibooks UK Cookbook that is also present on their website.
 * http://www.mcld.co.uk/recipes/#sticky-toffee-pudding Jamzze (discuss • contribs) 12:42, 19 July 2022 (UTC)
 * Hi @Nostriker, these issues should be addressed now. Please see both pages' discussion pages for details on what happened. Jamzze (discuss • contribs) 13:27, 19 July 2022 (UTC)
 * Hi @Jamzze, thanks for taking care of this so quickly! Since there weren't obvious comments in the edit histories or talk pages for these recipes indicating their origin and move, I assumed you had added these recipes to the cookbook yourself. We've had quite a few recent additions to the cookbook that have been appropriating content from food blogs, so lately I've been quick to flag things that appear to be copyright violations. I'll go ahead and remove the copyvio flags I put up. Cheers! -- Nostriker (discuss • contribs) 20:16, 19 July 2022 (UTC)
 * Additionally, if you'd like to check things for copyvios yourself, you can use the handy tool at https://copyvios.toolforge.org :) -- Nostriker (discuss • contribs) 20:19, 19 July 2022 (UTC)
 * I didn't know myself, so sorry for not copying over their histories! Glad everything is fine now Jamzze (discuss • contribs) 07:49, 20 July 2022 (UTC)

Cookbook - cats
Hi @L10nM4st3r - sorry, moved the post from proposals to projects after having read what each page was for (that will teach me to read before I post). If you would like to comment again, please do so at Reading_room/Projects - sorry for the inconvenience! Jamzze (discuss • contribs) 16:05, 24 July 2022 (UTC)
 * Already have. I'll be keeping an eye on it. Thanks! I had a similar problem once. Although much worse! L10nM4st3r / Roar at me 16:11, 24 July 2022 (UTC)

Changing cats
Hi Jamzze! I noticed you've been removing a lot of the cats in the cookbook and replacing them with more specific cats. I'm totally in favor of adding more specific cats, but I was wondering why you've been removing the original cats when adding the more specific ones (for example, removing the "beverage" cat when adding a more specific one). It seems to me like the original cats still have some value and should be kept—for example, someone might still want to be able to browse a list of all recipes in the beverage cat without having to go into sub-categories. I might be misunderstanding how categories work, but I just want to make sure we're not removing/hiding useful information and overcomplicating things! Cheers! -- Nostriker (discuss • contribs) 14:06, 27 July 2022 (UTC)

 * Hi - the beverage category had become too large to be useful (e.g. I was trying to find all the alcoholic beverage recipes and it was difficult to find them amongst the large list of other beverage recipes). In order to diffuse this category into more easily found areas, I changed the main category "beverage recipe" to more specific sub-categories e.g. "chocolate beverage recipes".
 * All the categories I have changed are still in "beverage recipes", but within their relevant sub-category so it is easier to locate the recipe that the user needs/ provide more specific tagging for recipes. It then does not make sense to keep the recipe categorised by the main parent category and sub-category, so the former was removed. As categories follow a tight relationship from the main category to sub-category to sub-sub category, etc. disrupting this by tagging a category between both layers (e.g. within a sub-category (i.e. beverage recipes) and a sub-sub category (i.e. chocolate beverage recipes) breaks down the idea of what categorisation is for. So, thats why I would recommed not tagging them in both.
 * As well, categories are not meant to act as a broad index, like you suggested with a user wanting to see all the recipes on a given topic on a single page, which are normally other projects of themselves. Instead, categories build relationships between discrete, thematic areas that are placed in a hierarchy from broad to specific. I think, though, that you can add a bit of wiki code to show all the sub-cats and their pages if a user did want this - happy to trial this out. As well, I think this brings up the need for a Cookbook index. Jamzze (discuss • contribs) 14:56, 27 July 2022 (UTC)
 * Gotcha, thank you! I typically focus primarily on content, copy editing, and page formatting, so this information is helpful. -- Nostriker (discuss • contribs) 15:05, 27 July 2022 (UTC)
 * Hi ya, I have added a drop-down menu for this cat, both as a link on the cat itself and displayed on the page Cookbook:Beverages - let me know how you feel about it.
 * For a page that displays all beverage recipes A-Z, that is another project, but something I am happy to look into. I am going to do some digging to see if there is any code that can be used to automatically generate it as a page, rather than trying to do it manually. Will let you know what I find! Jamzze (discuss • contribs) 15:20, 27 July 2022 (UTC)

Thanks!
Just wanted to say that I appreciate the work you've been doing on the Wikibooks Cookbook! Mbrickn (discuss • contribs) 17:59, 27 July 2022 (UTC)

You are now a reviewer
Thanks for your contributions. You have recently been auto-promoted to reviewer, meaning you can flag revisions and use rollback. L10nM4st3r / Roar at me 17:26, 4 August 2022 (UTC)
 * Please tell me how I can improve this one, it's a new template, found here. Thanks. You're the first to see it. (well, the first to have it on their talk page anyway) L10nM4st3r / Roar at me 17:29, 4 August 2022 (UTC)

Recipe style guidelines
Hello! Your feedback would be welcome and appreciated at Cookbook_talk:Policy/Recipe_template. Thanks! —Kittycataclysm (discuss • contribs) 15:22, 24 November 2022 (UTC)

title: User talk:Jamzze


text:
Cookbook:Garum (Boiled)

Garum is a traditional Roman fermented fish sauce or condiment. It was used often in now-ancient Roman cuisine, as a condiment or sauce on its own, an additive to sauces, or as a seasoning.

Ingredients

 * 1 sextarius (2 ⅓ cup/546 mL) anchovies or other fatty fish
 * 3 sextarii (7 cups/1.638 L) wine

Procedure

 * 1) Add anchovies and wine to a pot.
 * 2) Boil the mixture until thick.
 * 3) Strain the fluid through a sieve, and bottle for future use.

Notes, tips, and variations

 * Unit conversions to modern measures based on Wikipedia's page on Roman measures.
 * Boiled version from Apicius, fermented from Geoponika.

Warnings

 * Whether boiling or fermenting the fish sauce, the smell can be quite intense. Especially if fermenting. Be respectful of your neighbors.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Cookbook:Garum (Boiled)


text:
Category:Book:Minecraft/Blocks

If you want your page to get on this list, use Minecraft/block in the page.

title: Category:Book:Minecraft/Blocks


text:
Minecraft/Raw Beef

Dropped from cows. Also known as "steak" or "raw steak" on older editions.

title: Minecraft/Raw Beef


text:
Category:Book:Minecraft/Items

If you want your page here, use Minecraft/item in it.

title: Category:Book:Minecraft/Items


text:
Stardew Valley/Events

There are many cutscenes, festivals, and other events which occur in Stardew Valley. Many tell you something about your neighbors, whose lives can be very colorful.

Festivals
There are two festivals each month in Stardew Valley, a total of eight every year. In addition, there is a Night Market held every year where merchants from other area set up shop. The normal flow of time is interrupted when you enter a festival; you can enter the festival area any time it's active, you arrive back at your farm house when you exit the festival or it ends. You can talk to your neighbors there, and each festival has a "main event", a ceremony to witness or a mini-game to play.

Egg Festival
This takes place on the 13th day of Spring, from 9 AM to 2 PM, in Pelican Town. The main event is the Egg Hunt, where you compete with some of the younger villagers to find the most Easter eggs.

Winning the egg hunt isn't too hard, but scouting the locations of the eggs and some prior planning will help a great deal. Remember that you don't have to collect all the eggs, just more eggs than the other competitors. In effect you have to find 9 eggs, since the real competition is Abigail who finds 8. The prize for winning is a Straw Hat, and if you already have a Straw Hat, 1000g. You can, of course, collect more eggs if you are able, and videos of people collecting many more than 9 eggs can be found on YouTube. But you don't get any extra reward in the game for getting more than 9 eggs.

In case you don't want to plan out your own route, this will get you the 9 eggs needed to win. From the starting point:
 * 1) Go west, get the egg near the south end of the fence.
 * 2) Go north to the bench, then east to the two bushes and get the egg behind them.
 * 3) Go east to the clinic and get the egg to the left of it.
 * 4) Continue east to George and Evelyn’s house (avoiding getting caught by the extra table in front of Pierre’s door), get the egg near the trash can.
 * 5) Continue east past Pam’s trailer and get the egg on the riverbank.
 * 6) Circle back to George and Evelyn’s house, get egg behind the tree to the right of it.
 * 7) Go northwest to the wall behind George and Evelyn’s house, get the egg there.
 * 8,9) Start up the path to the Community Center but turn left behind Pierre’s, go west to the barrels and find 2 eggs there.

Letters
You'll often get mail; sometimes this is a gift from a friendly neighbor, sometimes it's an announcement of an upcoming event, sometimes it's a request which starts a side quest. It's a good idea to check your mailbox every morning; an envelope icon appears when there is unread mail for you. After reading your mail, you can review it any time in the Letters sub-tab of the Collections tab.

Annual announcements
You receive these every year.
 * 12 Spring, Egg Festival Notice: Announcing the Egg Festival the next day.
 * 23 Spring, Flower Dance Notice: Announcing the Flower Dance the next day.
 * 10 Summer, Luau Notice: Announcing the Luau the next day.
 * 28 Summer, Dance Of The Moonlight Jellies: Announcing the Moonlight Jellies gathering that same evening.
 * 9 Fall, Stardew Valley Fair Notice: Announcing the Stardew Valley Fair the following week. You get a week's notice to prepare your grange display.
 * 15 Fall, Stardew Valley Fair Reminder: Reminder for the Stardew Valley Fair the next day.
 * 26 Fall, Spirit's Eve Notice: Announcing the Spirit's Eve Festival the next evening.
 * 7 Winter, Festival Of Ice Notice: Announcing the Festival Of Ice Notice the next day.
 * 14 Winter, Night Market Notice: Announcing the Night Market starting the next day and continuing for three days.
 * 18 Winter, Secret Gift-Giver: Announcing the Feast of the Winter Star the following week. You get a week's notice to prepare your gift.
 * 24 Winter, Feast Of The Winter Star Reminder: Reminder for the Feast of the Winter Star the next day.

Living of the Land topics
You can watch Living of the Land on your television every Monday and Thursday. Almost all the episodes are different for the first two years, and reruns start in year 3. The topics cover all kinds of hints on the game.

title: Stardew Valley/Events


text:
MATLAB Programming/Fundamentals of MATLAB/Basic MATLAB commands

Basic MATLAB command
During start to use the program, you may see "double greater than" symbols aka    on the top left of command window. You can start to type simple or complex mathematic equation to your liking.

Some of the examples are as follows:

or you may even assign a value to a variable / perform simple algebra equations

Note: You can learn more about MATLAB operator from this page: MATLAB Programming/Fundamentals of MATLAB/MATLAB operator

Basic Commands
These commands listed below are the commands that you usually will encounter when using MATLAB

clc - Clear command window. clear - Remove all variable values from workspace disp - Display the values inside of the variable / matrix help - Display tooltip help text inside the Command Window. The help displays the help for the functionality specified by NAME, such as a function, operator symbol, method, class, or toolbox.

Hello World
Once Hello World, which is the simplest of programs, works the beginner can move on to explore the MATLAB workspace available for developing or running Matlab code.

Using the workspace the beginner can then learn to manipulate basic MATLAB Variables.

For convenience Matlab allows the workspace to be saved and loaded using *.mat files.


text: Canadian Constitutional Law/Printable version


text: Category:Book:Wiki Markup

title: Category:Book:Wiki Markup


text: Wiki Markup/Printable version

title: Wiki Markup/Printable version


text:
User:Knoppson

I am a Master of Science in Electrical Engineering.

I graduated in 1996 from Chalmers University of Technology here in Gothenburg, Sweden.

I am very interested in Electromagnetic Field Theory and especially in the concept of (controlled) Thermonuclear Fusion.

I know however that magnetic confinement of a plasma to yield thermonuclear fusion has been tried for almost a 100 years.

I do however hope that my non-physisist diploma may contribute to the thermonuclear science in perhaps new ways.

title: User:Knoppson


text:
Talk:GENtle/Command line options

DNA maps from the command line
Hi all,

Is it possible to generate graphic maps of vectors from the command line?

Thanks,

Tom 68.82.79.44 (discuss) 18:43, 18 July 2022 (UTC)

title: Talk:GENtle/Command line options


text:
Wikibooks:GUS2Wiki

The following data is cached, and was last updated 2024-07-16T07:25:50Z. A maximum of NaN 5000 results ares available in the cache.
 * Special:GadgetUsage
 * GUS2Wiki

title: Wikibooks:GUS2Wiki


text:
User talk:2A02:A03F:84FD:2200:B467:500A:2544:7974

--Xania   talk 02:44, 19 July 2022 (UTC)


text:
Minecraft/Stone

Very common, stone is the next stage up after wood. Great to build with early game.

Obtaining
Stone is found basically everywhere underground, above y=0.

You can also get it when a water source block touches flowing lava.

When stone is mined, it drops cobblestone. To get stone, you must smelt cobblestone in a furnace.

title: Minecraft/Stone


text:
User talk:Einschlauesding/Archive/2022/July

Umm, hi
Been a while, how are you?

Also, I thought of something for my game. As the final boss is going to be so freaking crazy strong, it would 1-hit-KO, say, Thanos, with a fraction of its power, I need a way to get players on around the same level. So, here is what I have:

Doing certain actions gives XP. After 5 levels, you get an "ability point". You can get up to 20 of them (up to level 100) but need 60 to get every ability... So you can only fully fill one of the 4 choices: attack power, attack speed, movement speed and defence.

After reaching level 100, every 10 levels, including 100, gives you a "power point". You can have up to 41 (up to level 500). They can be used to increase your raw stats: health, melee attack, ranged attack, defence, attack speed and movement speed. Each needs 15 points to maximize (a total for 90 points to maximize every stat, which is not possible).

Then on level 500 to 1500, every hundred levels gives you a "death core" (named that as I can't think of anything else), for a maximum of 10. You have 3 slots to use these for abilities. There are going to be multiple to choose from. Some cost more than others, so you may only spend 3, or spend all 10 for only 2 abilities. Some I have an idea for are: Arrows are never consumed, bullets have a 50% less chance to be consumed (guns are powerful, after all - 5 death cores); Health regen is increased by 25% but maximum life decreased by 10% (very pushy - 3 death cores); health cannot be dropped below 1 if you have more than one heart (10% of your life = 1 heart (when you start the game, health is around 100. By endgame, it can be more than ten times that!) - 2 death cores. Nice, but not OP); When you take damage, you explode, dealing 100% damage to nearby enemies, but taking an additional 25% of the damage as fire (1 death core - the negative effect is HUGE, more than one core is a ripoff!)

And that's not all. What comes after level 1500 is a secret! Sadly, your level will be capped to 50 until you kill the second boss, 300 until you kill the middle boss, 700 until you kill the dragon, 1000 until you kill the second-to-final boss, and 1499 until you kill the final boss, a secret final boss. The super, tough-as-something-that-doesn't-even-exist-in-anything-that-I-can-think-of boss (exactly, we exist, so killing it won't be easy for us). Good luck saving the multiverse. You're gonna need it. Good ni*yawn*ght Zzzzzzzzz L10nM4st3r / Roar at me 22:06, 24 June 2022 (UTC)
 * I should probably check to see whether or not a user is blocked/locked before fixing their user talk page next time. Heh... L10nM4st3r / Roar at me 21:25, 25 June 2022 (UTC)
 * Uhh, you there? L10nM4st3r / Roar at me 15:51, 26 June 2022 (UTC)

Haha your right its been a while. Im a little bit sick but thats fine, what about you? I havent checked this in a while… Einschlauesding (discuss • contribs) 18:40, 26 June 2022 (UTC)

Also I still don't understand anything of all this information about your game…( -_•)? Einschlauesding (discuss • contribs) 18:43, 26 June 2022 (UTC)
 * Yea, I'm fine. Get well soon.
 * Basically, you level up and get to choose an ability to make you stronger, but you are never able to choose them all. L10nM4st3r / Roar at me 09:20, 27 June 2022 (UTC)

Ohhhh ok thanks Einschlauesding (discuss • contribs) 18:32, 27 June 2022 (UTC)
 * Do you want to play stardew valley some time [this year]? And also, I lost one of my wobbly teeth again today. I will now know a little more peace when eating! L10nM4st3r / Roar at me 19:53, 10 July 2022 (UTC)
 * Helllllo! Are you still alive?L10nM4st3r / Roar at me 19:06, 15 July 2022 (UTC)

Omg im so sorryyyyy.I was on vacation for 2 weeks and I havent checked. But yeah I would like to play with u again! Einschlauesding (discuss • contribs) 20:27, 15 July 2022 (UTC)

 * I hope it was nowhere hot, because if it was, I'm afraid I need to put you back in the freezer ;) I might literally melt too soon. If having a child headbutt your mouth and then run (and jump) into a door way in a game of.. Err.. Was it "Freeze tag"? Well, either way, I win! (again.)L10nM4st3r / Roar at me 22:02, 15 July 2022 (UTC)
 * I only just noticed that that makes no sense whatsoever, but who the fuck cares? L10nM4st3r / Roar at me 22:20, 15 July 2022 (UTC)

Yeah im sure I will melt at these temperatures but im home anyway so I probably won't melt like I would outside :p Anyways wanna play something now? Einschlauesding (discuss • contribs) 17:02, 16 July 2022 (UTC)
 * Yup L10nM4st3r / Roar at me 17:10, 16 July 2022 (UTC)

Wait give me 10 minutes I gotta help my mum Einschlauesding (discuss • contribs) 17:14, 16 July 2022 (UTC)
 * And I gotta eat, isn't the timing perfect!? L10nM4st3r / Roar at me 17:19, 16 July 2022 (UTC)

Yes lol Einschlauesding (discuss • contribs) 17:32, 16 July 2022 (UTC)

stuff

 * What to talk about then? Stupid time limit thing. Stupid fuck for fucks sake. L10nM4st3r / Roar at me 18:01, 16 July 2022 (UTC)

I love mochi Einschlauesding (discuss • contribs) 18:02, 16 July 2022 (UTC)

Thats all in my mind right now Einschlauesding (discuss • contribs) 18:02, 16 July 2022 (UTC)
 * What is Mochi? L10nM4st3r / Roar at me 18:03, 16 July 2022 (UTC)
 * Yum! L10nM4st3r / Roar at me 18:03, 16 July 2022 (UTC)

Yess Einschlauesding (discuss • contribs) 18:04, 16 July 2022 (UTC)
 * I got rice cakes, but the round kind, boring. L10nM4st3r / Roar at me 18:05, 16 July 2022 (UTC)

I never ate rice cake lol Einschlauesding (discuss • contribs) 18:06, 16 July 2022 (UTC)

 * I added cool arrows to my game yesterday! One explodes, one deals almost a hundred damage, one splits into many arrow heads mid flight, one pierces enemies and one electrocutes nearby monsters and even yourself. Some are dangerous, even to yourself! L10nM4st3r / Roar at me 18:08, 16 July 2022 (UTC)

Oh wooow, pretty cool. When do you think it's ready? Einschlauesding (discuss • contribs) 18:09, 16 July 2022 (UTC)
 * Don't know. I want to do an early acces, but I need certain stuff added first. If I don't add it first, your test world will need to be abandoned to complete the story. I still got to make combat fun though, and the first boss cannot be summoned using renuable resources, meaning that you need to kill it the first few times or you lose your chance. I still need to add magic and pets. And boots and gloves and other equipment. L10nM4st3r / Roar at me 18:13, 16 July 2022 (UTC)

Ohhhh alright seems like still a lot to do Einschlauesding (discuss • contribs) 18:18, 16 July 2022 (UTC)
 * Not if I brainstorm. So lets see. Slime enemies that drop cursed gel and sand fixes three problems at once: cursed arrows, cursed orbs (for first boss) and glass. Next, first boss drops a mace item and a currupt bone. The mace is more powerful than a club, and the cursed bone summons a mutant dog pet. L10nM4st3r / Roar at me 18:22, 16 July 2022 (UTC)

Yeahhh my English skills lose again im sorry- Einschlauesding (discuss • contribs) 18:29, 16 July 2022 (UTC)
 * What did you not get? I'll explain it. L10nM4st3r / Roar at me 18:31, 16 July 2022 (UTC)

Its more like many words Einschlauesding (discuss • contribs) 18:33, 16 July 2022 (UTC)

Ok yeah I could Google it but I'm lazy as hell Einschlauesding (discuss • contribs) 18:33, 16 July 2022 (UTC)
 * I bet I got u beat! Well, physically. I sit in a chair infront of a computer all day. See my userpage for some funny stuff btw, including laziness. L10nM4st3r / Roar at me 18:35, 16 July 2022 (UTC)

Well I lay in bed all day and let myself get taken over by social Media and feel depressed, so I'm sure you can't beat me hahaha >:P Einschlauesding (discuss • contribs) 18:40, 16 July 2022 (UTC)

 * 1) You have a point. L10nM4st3r / Roar at me 18:43, 16 July 2022 (UTC)
 * 2) You feel depressed?!?!?!?!?!?'?'?"?:?:?;?:!)@?!?!?! L10nM4st3r / Roar at me ~

 * Again!? Who is this "lady luck"? Does she like me? TWO TIMES IN ONE DAY!? Look: :!) longnose face! Better than l:! L10nM4st3r / Roar at me 18:47, 16 July 2022 (UTC)

Yeah I don't know if I have depression but I really think so but my mum just believes that I'm lazy and that i just need to do more with my friends but I just don't feel the motivation for anything the most of the time and I have these shit feelings since 2020 and it just gets worse (・_・) Einschlauesding (discuss • contribs) 18:47, 16 July 2022 (UTC)

Wait what Lady luck huh Einschlauesding (discuss • contribs) 18:48, 16 July 2022 (UTC)

 * Yea were in a relationship now! Actually no, lady luck is about as real as santa. Don't show this message to a kid though. About the shit feelings, I can't help you there. Sorry L10nM4st3r / Roar at me 18:52, 16 July 2022 (UTC)

It's weird to think about that a brand made Santa and suddenly every child believed in him Einschlauesding (discuss • contribs) 18:55, 16 July 2022 (UTC)

And I don't wanted to ask for help, sorry if it came up like I wanted to you to help me lol Einschlauesding (discuss • contribs) 18:56, 16 July 2022 (UTC)

 * "Every" kid? Not me. Not after 7 years old at least. I figured it out fast. And I think it is basically to give them something to look forward to. L10nM4st3r / Roar at me 18:58, 16 July 2022 (UTC)

Hmm yeah but like everyone I know kinda believed in him. Of course many catholic children didn't because there is told that "Christ child"(translated) is bringing u presents(i also didnt believe in santa) Einschlauesding (discuss • contribs) 19:04, 16 July 2022 (UTC)
 * Are you catholic? I'm not religious. L10nM4st3r / Roar at me 19:07, 16 July 2022 (UTC)

Yeah but I'm not a strong believer, i mostly am because of my family Einschlauesding (discuss • contribs) 19:13, 16 July 2022 (UTC)
 * Oh ok. I was baptised, but then again, so is everybodyelse here. I don't believe in... Anything other than space matter and a big bang. And a more natural way to explain things. My family arenot religious either.

 * My opinion: If it takes god a week to make earth, wow, how did he make the gazillion other suns? Not earth nor the universe has lasted long enough for that. Sorry if you see it offensive. L10nM4st3r / Roar at me 19:19, 16 July 2022 (UTC)

Nope I'm very much on your side. I really can't believe that someone made the earth but actually is the whole universe more confusing I mean it seems endless and that is kind of scary right? We live on this planet and do all these things that wouldn't work on other planets we know but there is still so much undiscovered so is the "god made the earth in a week" not that questionable in my opinion.(I personally dont believe in it, as i said im mostlyjust catholic because of my whole family) Einschlauesding (discuss • contribs) 19:30, 16 July 2022 (UTC)

 * Ak! Sorry for the late reply :!(. I am a believer of aliens. Yes, the strange creatures. No, not wobbly green things with antennas and ride in flying frisbees. Like, a 3 headed velocerapter thing could exist. And, for all we know, there could be some kind of life, however small and insignificant or large and.. large, there could be life on every solar system we can see! Some could be specially adapted to certain planets, and the 1 in a million freak (like earth) has more chance to hold life. Or as I understand it from a TV show I watched. L10nM4st3r / Roar at me 21:27, 16 July 2022 (UTC)

Yeah it actually would be weird if there would only exist life on earth Einschlauesding (discuss • contribs) 17:11, 17 July 2022 (UTC)

Yooo wanna play splatoon today? Einschlauesding (discuss • contribs) 12:20, 19 July 2022 (UTC)
 * I had an idea on what to do in minecraft, and want to do it. Maybe half hour to an hour of splatoon, depending on how I feel. Actually I dont know. Too hot I'm not too motivated to do it really. Maybe one and a half hour splatoon. Oh btw, my new name is "shirtless"! Could you maybe, drag me to freezer the inside? too hot .L10nM4st3r / Roar at me 14:21, 19 July 2022 (UTC)

Yeah I know im Meeting too Einschlauesding (discuss • contribs) 15:31, 19 July 2022 (UTC)

Melting Einschlauesding (discuss • contribs) 15:31, 19 July 2022 (UTC)

Sorry for the late reply Einschlauesding (discuss • contribs) 15:31, 19 July 2022 (UTC)

 * Well, some people are awful mean. L10nM4st3r / Roar at me 17:43, 19 July 2022 (UTC)


text:
Cookbook:Sticky Toffee Pudding (with dates)

Sticky toffee pudding (STP) is a rich, dense, gooey dessert originating from the United Kingdom that can now be found across the world. Often found on a pub's menu, or in British or Commonwealth schools meals, this is a classic dessert that became popular in the 1970s.

Cake

 * 1¾ cups (250 g/8.8 oz) self-raising flour
 * ⅞ stick (100 g) unsalted butter, room temperature
 * 1 cup (250 g) caster sugar
 * 2 large or 3 medium eggs
 * 2½ cups (250 g) dates (without stones), finely chopped
 * 1¼ cups (300 ml) water
 * 1 teaspoon bicarbonate of soda
 * 1 teaspoon vanilla essence

Toffee sauce

 * 1⅔ cups (400 ml) whipping cream
 * ⅔ cup (120 g) dark, soft brown sugar
 * 1 teaspoon vanilla essence
 * 3 sticks (375 g) unsalted butter

Procedure

 * 1) Preheat oven to 180°C/360°F.
 * 2) Cream together the butter, sugar and vanilla. You can do this by beating it in a bowl with a wooden spoon for about 5 minutes, taking care to break up the crystals and smooth the mixture out as much as possible. Or, do it using an electric mixer if you prefer.
 * 3) Add the eggs one at a time, beating after you've added each egg.
 * 4) Fold in the flour.
 * 5) Bring the water to the boil and add the dates. Add the bicarb and immediately take the pan off the heat. Let it cool slightly, then add to the batter.
 * 6) Pour the batter into a greased cake tin—make sure you use one with enough room for the cake to rise.
 * 7) Bake in the oven for 40 minutes, or until a skewer inserted into the cake comes out clean.
 * 8) Remove from the oven and set aside to cool a little while you make the sauce
 * 9) Mix the sauce ingredients in a saucepan. Heat gently, stirring often to make sure that the mixture doesn't separate, until it is a smooth sauce—don't allow it to bubble.
 * 10) Divide the cake into portions and poke holes all over the top with a skewer or chopstick.
 * 11) Pour the sauce over the top of the cake, making sure it gets in the holes. Serve with cream, custard, or ice cream.

Notes, tips, and variations

 * Finely chopping the dates helps make a really gooey cake, but some people prefer to chop the dates roughly so that they're more obvious in the finished pudding.


text:
Cookbook:Sticky Toffee Pudding (without dates)

Sticky Toffee Pudding (STP) is a rich, dense, gooey dessert originating from the United Kingdom that can now be found across the world. Often found on a pub's menu, or in British or Commonwealth schools meals, this is a classic dessert that became popular in the 1970s. This recipe makes for a great STP, but without the dates! It was published by Tam and Laura under a Creative Commons Attribution-ShareAlike 2.5 License, retrieved 2008-11-29 from http://tamandlaura.blogspot.com/2007/03/how-english-can-you-get.html. Laura has given permission for it to be reprinted here under the wikibooks license (permission obtained 2008-12-18, by email, mcld).

Cake

 * 1½ cups all-purpose flour
 * 2 teaspoons baking powder
 * ¾ teaspoon baking soda
 * ½ teaspoon ground cloves
 * ¼ teaspoon freshly ground nutmeg
 * 1 cup packed dark brown sugar
 * ¼ cup (½ stick) unsalted butter, room temperature
 * 2 standard eggs
 * 1 cup chopped toasted walnuts

Toffee sauce

 * 1 cup whipping cream
 * ⅔ cups sugar
 * ¼ cup (½ stick) unsalted butter

Procedure

 * 1) Preheat oven to 350 °F.
 * 2) Sift dry ingredients together.
 * 3) Cream butter, sugar, and eggs together.
 * 4) Combine wet and dry ingredients, mixing just until blended. Mix in walnuts.
 * 5) Pour batter into 8x8 buttered pan and bake until skewer comes out clean, about 25 minutes.
 * 6) Meanwhile, make the toffee sauce:
 * 7) * Combine half the cream with sugar and butter in heavy large saucepan.
 * 8) * Boil over medium-high heat until mixture thickens slightly and is deep golden, stirring constantly, about 10 minutes.
 * 9) * Remove from heat; cool 5 minutes.
 * 10) * Gradually whisk in remainder of cream (mixture will bubble vigorously). Stir over low heat until mixture is smooth.
 * 11) Poke warm cake all over with a chopstick or the handle of a wooden spoon. Pour half of toffee sauce over, making sure it soaks into all parts of the cake. Let sit for at least 30 minutes.
 * 12) Serve warm, topped with remaining toffee sauce and creme fraiche or unsweetened whipped cream.


text:
Cookbook talk:Sticky Toffee Pudding (without dates)

Copyright issue - this recipe is published under CC BY SA
Hi all, a user flagged this recipe for copyright issues.

I had split it from STP to open up the recipes that were used for it and placed them into their own articles.

As the page was not properly cited when I moved it over, this must of flagged up as a copyright issue.

Having checked the source, this recipe comes from a blog under CC BY-SA: https://tamandlaura.blogspot.com/2007/03/how-english-can-you-get.html and was posted by @Mcld. This user had also sought and was provided email permission (see notes on recipe article) @Nostriker - Jamzze (discuss • contribs) 13:05, 19 July 2022 (UTC)


text:
Cookbook talk:Sticky Toffee Pudding (with dates)

Copyright issues - recipe created by Wikibooks user Mcld
Hi all,

This recipe comes from a now split article Sticky Toffee Pudding which had been created by @Mcld

This was created by Mcld and was flagged from their own website http://www.mcld.co.uk/recipes/#sticky-toffee-puddin which they outline they placed into Wikibooks "I was searching around for a decent sticky toffee pudding recipe to add to the Wikibooks UK Cookbook. Ended up making this recipe today, based on recipes I read online. It was dead nice".

The edit history page for Sticky Toffee Pudding notes this action by @Mcld and that they used CC BY-SA content to create it. @Nostriker Jamzze (discuss • contribs) 13:14, 19 July 2022 (UTC)

 * Hi. Is there an issue? Your description here is correct. It's my own writing. Perhaps you're just documenting the edit trail? I don't see any problem, but please comment if you think there's a problem.--Mcld (discuss) 08:40, 1 October 2022 (UTC)


text:
Cookbook:Cauliflower Cheese

| Side dishes | British cuisine

Cauliflower cheese or cauliflower gratin (French: Choufleur au Gratin) is a filling and cheesy dish, great as a side to a roast dinner or any other dish.

Ingredients

 * 1 large cauliflower head
 * 300 ml (10 oz / 1 ¼ cups) white sauce
 * 100 g (3.5 oz) parmesan
 * 30 g (1.1 oz) unsalted butter
 * 1 tbsp breadcrumbs
 * 1 tbsp salt
 * 1 tbsp pepper

Procedure

 * 1) Cut your cauliflower into small florets, and place them heads down into a bowl of salty water to dress them for an hour.
 * 2) Drain florets, and add them to a saucepan of salted boiling water. Cook, uncovered, regularly checking the feel of the cauliflower with a knife to see when they are ready. Your knife should go smoothly, but with some firmness to the cauliflower still.
 * 3) Preheat your oven to 200°C (180°C fan/390°F/gas 6).
 * 4) Once the cauliflower has cooked, drain the florets and lay them in a dish of your choice. Combine the white sauce with ⅔ of the parmesan cheese, and pour over the cauliflower. Sprinkle over the breadcrumbs and remaining cheese.
 * 5) Place your dish into the oven for about 20 minutes, or until golden brown.
 * 6) Serve immediately.

title: Cookbook:Cauliflower Cheese


text:
Template:Beeton

This page incorporates text from the public domain cookbook Book of Household Management by Isabella Beeton.

title: Template:Beeton


text:
Category:Public domain recipes

Recipes that utilise or are wholly derived from public domain recipes.

title: Category:Public domain recipes


text: Category:Public domain recipe templates

title: Category:Public domain recipe templates


text:
Minecraft/Furnace

Use
It can be used to smelt and cook items, allowing the player to turn metals into ingots as well as cook food. However needs fuel and something to smelt. If there is fuel inside it, but nothing to smelt, the fuel is not used up. If the items inside have been smelted, but a consumed peice of fuel is still providing fuel, the provided fuel will drain, so you should top up the smelt slot as soon as possible to avoid waste. If the fuel runs out, the smelting progress will deplete until it empties completely.

It takes exactly ten seconds to smelt any item.

title: Minecraft/Furnace


text:
Bash Shell Scripting/About Bash

What is Bash?
Bash is a "Unix shell": a command line interface for interacting with the operating system. It is widely available, being the default shell on many GNU/Linux distributions and formerly on Mac OSX, with ports existing for many other systems. It was created in the late 1980s by a programmer named Brian Fox with the request of Richard Stallman, working for the Free Software Foundation. It was intended as a free software alternative to the Bourne shell (in fact, its name is an acronym for Bourne Again SHell), and it incorporates all features of that shell, as well as new features such as integer arithmetic and job control.

What is shell scripting?
In addition to the interactive mode, where the user types one command at a time, with immediate execution and feedback, Bash (like many other shells) also has the ability to run an entire script of commands, known as a "Bash shell script" (or "Bash script" or "shell script" or just "script"). A script might contain just a very simple list of commands — or even just a single command — or it might contain functions, loops, conditional constructs, and all the other hallmarks of imperative programming. In effect, a Bash shell script is a computer program written in the Bash programming language.

Shell scripting is the art of creating and maintaining such scripts.

Shell scripts can be called from the interactive command-line described above, or they can be called from other parts of the system. One script might be set to run when the system boots up; another might be set to run every weekday at 2:30 AM; another might run whenever a user logs into the system.

Shell scripts are commonly used for many system administration tasks, such as performing disk backups, evaluating system logs, and so on. They are also commonly used as installation scripts for complex programs. They are particularly suited to all of these because they allow complexity without requiring it: if a script just needs to run two external programs, then it can be a two-line script, and if it needs all the power and decision-making ability of a Turing-complete imperative programming language, then it can have that as well.

title: Bash Shell Scripting/About Bash


text:
Bash Shell Scripting/Prerequisites

You will need to have Bash installed on your system. It is recommended that you use a GNU/Linux based distribution like Ubuntu, Manjaro, etc. These have Bash installed by default.

If you are using a Unix-like operating system like FreeBSD or MacOS and Bash shell is not installed as default, you can install Bash from their package manager or use their default shell which have Bash support.

If you are on a Windows 10 or Windows 11 system, you can install Windows Subsystem for Linux. If you are on an older machine and don't have SSH access to a GNU/Linux or Unix system, you will probably find it easiest to make use of this book if you are using something like Cygwin, which has not only Bash but also many other common utilities, than if you are using a Bash port for Windows that includes only Bash. If you have Cygwin, just make sure that the directory containing those utilities — likely something like  — is listed in your Windows path.

On Android, an app called Termux can be installed.

title: Bash Shell Scripting/Prerequisites


text:
Bash Shell Scripting/How To Read

~ $ echo "Hello World!" Hello World! ~ $

(1) It's ideal to practice Bash while reading
You will probably find this book most useful if you have a Bash command-line open in another window while you are going through it. You may want to try out some of the examples; but more important is to try things out that aren't just copied from the book. If you think something probably works a certain way, test out your expectations! Except where noted otherwise, the examples in this book do not require any special privileges or permissions, and do not require any software aside from Bash itself and very common utilities that are generally found on any system where Bash is.

(2) Try consulting documentation for unknown commands
When you are experimenting, you will likely find it helpful to consult the documentation for various commands. For commands that are built into Bash, you can use the built-in  command; for example,   will "print" (that is, display) information about the built-in   command. Try typing echo "Hello World!" and the output will be Hello World!. Therefore your echo is used for an output statement ( same as character cout>>"Hello World!" in c++). For external programs, it is likely that their manual pages are installed on your system, in which case you can view them via the  ("manual") command; for example, for information about the   ("copy") command, you can type. Additionally, most programs, when run with the argument, will print some help information; for example,   gives almost as much information as. (With many programs, however, the  approach does not give anywhere near as much information as the   approach.)

(3) Warning against blindly entering commands
A word of caution: this book is part of a wiki, which means that anyone may have edited it. It is possible — unlikely, but possible — that someone has added an "example" that is actually malicious code, or inserted malicious code into an existing example. Trust your instincts; if an example seems suspicious to you, if the surrounding text doesn't adequately explain what it does, if it doesn't seem to match the description in the surrounding text, then don't run it. And even if it's clear that an example is non-malicious, it's a good idea to run all of your experiments using an account that has no special privileges or permissions on the system, so you don't (say) accidentally delete something important. Bash is a very powerful systems administration tool, which sometimes means it's a powerful way to accidentally cripple your system! You can crash your smart phone if you're skimming and experimenting on Termux for Android. Rather do your experiments or create labs on an external environment. Virtual machine and sandboxes are good place to do that.

If you are completely new to Bash, or if you have some experience with the Bash command-line but are completely new to programming, you will probably find this book most useful if you begin at the beginning, and work your way through in linear order. If the topic of any section is completely familiar to you, you might want to skim it quickly for possible surprises, rather than skipping it completely; after all, you may not know what you may not know.

If you already have some Bash experience and some programming experience, you can probably skim the entire first half of the book, focusing only on examples that show Bash syntax you aren't already familiar with. That done, you should be in a good position to get the most out of the second half of the book.

If you already have a lot of Bash shell-scripting experience, this may not be the book for you; you will probably learn some things, but not as much as you would learn from the Bash Reference Manual on the Free Software Foundation's web-site, or simply from reading the entirety of. (But this being a wiki, you are invited to share the fruits of your experience!) This book is not a comprehensive reference manual; it focuses on techniques that are either widely used or widely useful, and mostly assumes a typical setup rather than exhaustively documenting all the unusual features that can affect the behavior of a command.

title: Bash Shell Scripting/How To Read


text:
Bash Shell Scripting/A Few Notes On Terminology

The language of Bash commands is a Turing-complete programming language, meaning that if it is even theoretically possible for a given computation to be performed, then it is theoretically possible to perform it in Bash. Furthermore, from a practical standpoint, it is possible to do some very sophisticated things in Bash, and people often do. Nonetheless, it is usually described as a "shell-scripting language" (or similar) rather than a "programming language", and the programs written in it are usually referred to as "Bash shell scripts" (or similar) rather than "Bash programs". We will follow that convention here, preferring script for a Bash script and program only when referring to external programs that might be invoked from a Bash script.

We will also often use the term utility. This term is somewhat subjective, and usage varies, but it typically describes an external program that requires no human interaction and is intended to work well with other programs. All utilities are programs, so we will use the terms somewhat interchangeably. The extreme opposite of a "utility" is an application; that term is also subjective, with variable usage, but it typically describes an external program that has a relatively complex graphical user interface (GUI) and is not intended to work well with other programs. Since applications, by their nature, are not generally called from Bash scripts, we will have less occasion to use that term. Many programs are neither "utilities" nor "applications", and some programs have elements both of utilities and of applications.

Of the various elements of a Bash script, some are typically called commands, while others are typically called statements. We will observe this distinction here, but you need not overly concern yourself with it. Normally "command" is used in reference to invocations of external programs, of Bash built-ins such as  that resemble external programs, of shell functions (which we will see below), and so on. Normally "statement" is used in reference to instances of Bash programming constructs such as  or variable assignment (which we will see shortly). Perhaps confusingly, command is also used in reference to any Bash built-in, even if a use of that built-in would result in a "statement" rather than a "command"; for example, "an  statement" is a statement that uses "the   command". If this distinction seems too fine, do not worry; in context, it should always be sufficiently clear what is meant by one term or the other.


text:
Bash Shell Scripting/Some Notes On Your Shell

Shell version
This textbook provides information for those commonly-available versions of Bash, as of December 2021, this should be Bash version 5. Using an earlier version of Bash will make you fail to try some features out.

The Bash, version 3.2, included in OS X is quite important to mention. A really noticeable change for some users may be the missing  option which enables interpretation of backslash escapes, an important feature for color printing. Although this can be done using a workaround (e.g. using  instead), this can be quite inconvenient.

Consider getting the source from http://www.gnu.org/software/bash/ and compile one.

 * Bash 4.3.18 for OS X 10.8+, built by Arthur200000: Baidu Download Link. Read KNOWN_ISSUES before you download. Just look for '下载', it means 'Download'.

bashrc
The  file determines the behavior of interactive shells, and having it properly configured can make life easier.

Most GNU/Linux distros have the  file. Use your favourite text editor to explore it.

In most cases, there is also a global  file, usually located at. Try changing it, if you are root. If you don't know what to do, take a look at those s:
 * Advanced Bash Scripting:Sample Bashrc
 * A Modified version of The BLFS /etc/bashrc


text:
Bash Shell Scripting/Intro Exercise

We will look at a few example to get a taste as to what Bash scripting can be used. Do not fret if you do not understand these just yet.

Hello World
Let's start with a simple "hello world" program:

We can either type this directly at the Bash prompt, or else save this as a file (say, ) and run it by typing   or   at the Bash prompt. (Later we will see some more sophisticated ways to create and run a Bash script file.) In either case, it will print :

$  Hello, world!

Here we have used the  symbol to indicate the Bash prompt: after , the rest of the line shows the command that we typed, and the following line shows the output of the command.

Check File
Here is a slightly more complex script:

This script tests whether there exists a file named  in the current directory, and uses an   statement to control, based on that test, which commands are run. It, too, could be typed directly at the prompt — any script can — but in this case that is not likely to be useful.

Both of the above are entirely "within Bash", in that they do not require Bash to run any external programs. (The commands,  , and   are all built-in commands, implemented by Bash itself.) But, being a shell-scripting language, a large part of Bash's purpose is to run external programs. The following script demonstrates this ability:

Here  and   are two common utility programs that, while not part of Bash, are found on most systems that have Bash. The above script assumes the presence of a default configuration file named, and checks for the presence of a configuration file named. If  exists, then the script uses the external program   to produce a "diff" (a report of the differences between, in this case, two files), so that the user can see what non-default configurations are in place. If  does not exist, then the script uses the external program   ("copy") to copy the default configuration file to.

As you can see, the external programs are run using the same sort of syntax as the built-in commands; they're both just "commands".

The above version of this script is very "verbose", in that it generates a great deal of output. A more typical script would likely not include the  commands, since users are unlikely to need this level of information. In that case, we might use the  notation to include comments that are completely ignored by Bash, and do not appear to the user. Such comments are simply informative notes for someone reading the script itself:

But the above is simply for demonstration's sake. In reality, a script this simple does not require any comments at all.

title: Bash Shell Scripting/Intro Exercise


text:
Bash Shell Scripting/Simple Commands

A simple command consists of a sequence of words separated by spaces or tabs. The first word is taken to be the name of a command, and the remaining words are passed as arguments to the command. We have already seen a number of examples of simple commands; here are some more:

 * This command uses  ("change directory"; a built-in command for navigating through the filesystem) to navigate "up" one directory.
 * The notation  means "parent directory". For example,   is equivalent to.
 * Assuming the program  ("remove") is installed, this command deletes the files ,  , and   in the current directory.
 * Bash finds the program  by searching through a configurable list of directories for a file named   that is executable (as determined by its file-permissions).
 * This command runs the program located at, passing   as the sole argument.
 * must be executable (as determined by its file-permissions).
 * Warning: Please ensure that there is NO SPACE between the forward slash and any files following it. e.g. assuming the "foo" folder exists in the "root" directory, then executing the following command: "rm -r / foo" will destroy your computer if performed with "sudo" access. You have been warned. If you don't understand the preceding, don't worry about it for the moment.
 * If  is a text-file rather than a binary program, and its first line begins with , then the remainder of that line determines the interpreter to use to run the file. For example, if the first line of   is  , then the above command is equivalent to.
 * must be executable (as determined by its file-permissions).
 * Warning: Please ensure that there is NO SPACE between the forward slash and any files following it. e.g. assuming the "foo" folder exists in the "root" directory, then executing the following command: "rm -r / foo" will destroy your computer if performed with "sudo" access. You have been warned. If you don't understand the preceding, don't worry about it for the moment.
 * If  is a text-file rather than a binary program, and its first line begins with , then the remainder of that line determines the interpreter to use to run the file. For example, if the first line of   is  , then the above command is equivalent to.

That example with  bears special note, since it illustrates how you can create a Bash-script that can be run like an ordinary program: just include   as the first line of the script (assuming that that is where Bash is located on your system; if not, adjust as needed), and make sure the script has the right file-permissions to be readable and executable. For the remainder of this book, all examples of complete shell scripts will begin with the line.

Navigation
As we saw in the first example, the utiliy command  serves to navigate with given arguments. In Unix and Unix-like systems like GNU/Linux there are 2 types of paths that are named as relative and absolute file path. Relative paths are relative to your contemporary position whereas absolute paths are specific. Here is an example of navigating to an absolute path:

There are specific arguments for relative path navigation that make different kinds of shortcuts possible. Here are some of those arguments:

To navigate up 2 directories you need to type:

To navigate to the path you were before navigating to your current location you need to type:

To print the path that you are currently in, its possible to use another built-in Unix utility named.

Quoting
We saw above that the command  removes three separate files: ,  , and. This happens because Bash splits the command into four separate words based on whitespace, and three of those words become arguments to the program. But what if we need to delete a file whose name contains a space?

Bash offers several quoting mechanisms that are useful for this case; the most commonly used are single-quotes  and double-quotes. Either of these commands will delete a file named :

Within the quotation marks, the space character loses its special meaning as a word-separator. Normally we wrap an entire word in quotation marks, as above, but in fact, only the space itself actually needs to be enclosed;  or   is equivalent to.

Another commonly-used quoting mechanism is the backslash, but it works slightly differently; it quotes (or "escapes") just one character. This command, therefore, is equivalent to the above:

In all of these cases, the quoting characters themselves are not passed in to the program. (This is called quote removal.) As a result,  has no way of knowing whether it was invoked — for example — as   or as.

Filename expansion and tilde expansion
Bash supports a number of special notations, known as expansions, for passing commonly-used types of arguments to programs.

One of these is filename expansion, where a pattern such as  is replaced with the names of all files matching that pattern. For example, if the current directory contains the files,  ,  , and  , then this command:

is equivalent to this command:

Here the asterisk  means "zero or more characters"; there are a few other special pattern characters (such as the question mark , which means "exactly one character"), and some other pattern-matching rules, but this use of   is by far the most common use of patterns.

Filename expansion is not necessarily limited to files in the current directory. For example, if we want to list all files matching  inside the directory , we can write this:

which may expand to something like this:

If no files match a specified pattern, then no substitution happens; for example, this command:

will most likely just print.

What happens if we have an actual file named  that we want to refer to? (Yes, filenames can contain asterisks!) Then we can use either of the quoting styles we saw above, or use backslash to remove special meaning from asterisk. Either of these:

will print the actual file, rather than printing all files whose names end in.

Another, similar expansion is tilde expansion. Tilde expansion has a lot of features, but the main one is this: in a word that consists solely of a tilde, or in a word that begins with   (tilde-slash), the tilde is replaced with the full path to the current user's home directory. For example, this command:

will print out the names of all files named  in the current user's home directory.

Brace expansion
Similar to filename expansion is brace expansion, which is a compact way of representing multiple similar arguments. The following four commands are equivalent:

The first command lists each argument explicitly. The other three commands all use brace expansion to express the arguments more tersely: in the second command, all the possibilities  through   are given, separated by commas; in the third command, a numeric sequence is given ("from 1 to 5, incrementing by 1"); and the fourth command is the same as the third, but leaves the   implicit.

We can also list the files in the opposite order:

with the default increment size being  when the endpoint of the sequence is less than the starting-point.

Since in Bash, the first word of a command is the program that is run, we could also write the command this way:

but obviously that is not conducive to readability. (The same sort of thing, incidentally, can be done with filename expansion.)

Brace expansion, like filename expansion, can be disabled by any of the quoting mechanisms;,  , or   produces an actual literal curly-brace.

Redirecting output
Bash allows a command's standard output (file-descriptor 1) to be sent to a file, rather than to the console. For example, the common utility program  writes out a file to standard output; if we redirect its standard output to a file, then we have the effect of copying the contents of one file into another file.

If we want to overwrite the destination file with the command's output, we use this notation:

If we want to keep the existing contents of the destination file as they are, and merely append the command's output to the end, we use this notation:

However, not everything that a program writes to the console goes through standard output. Many programs use standard error (file-descriptor 2) for error-messages and some types of "logging" or "side-channel" messages. If we wish for standard error to be combined with standard output, we can use either of these notations:

If we wish for standard error to be appended to a different file from standard output, we use this notation:

In fact, we can redirect only standard error, while leaving standard output alone:

In all of the above examples, we can replace  with   if we want to overwrite the redirect-target rather than append to it.

Later we will see some more advanced things that we can do with output redirection.

Redirecting input
Just as Bash allows a program's output to be sent into a file, it also allows a program's input to be taken from a file. For example, the common Unix utility  copies its input to its output, such that this command:

will write out the contents of  to the console.

As we have already seen, this trick is not needed in this case, since  can instead be instructed to copy a specified file to its output; the above command is simply equivalent to this one:

This is the rule rather than the exception; most common Unix utilities that can take input from the console also have the built-in functionality to take their input from a file instead. In fact, many, including, can take input from multiple files, making them even more flexible than the above. The following command prints out  followed by  :

Nonetheless, input redirection has its uses, some of which we will see later on.

A preview of pipelines
Although they are outside the scope of this chapter, we now have the background needed for a first look at pipelines. A pipeline is a series of commands separated by the pipe character. Each command is run at the same time, and the output of each command is used as the input to the next command.

For example, consider this pipeline:

We have already seen the  utility;   simply writes the file   to its standard output. The program  is a common Unix utility that filters ("greps", in Unix parlance) based on a pattern; for example, the command   will print to its standard output any lines of input that contain the string. The command  uses the   option to invert the pattern; the command prints any lines of input that don't contain the string. Since the input to each command is the output of the previous command, the net result is that the pipeline prints any lines of  that do contain   and do not contain.

title: Bash Shell Scripting/Simple Commands


text:
Bash Shell Scripting/Variables

In a Bash script, there are a few different kinds of parameters that can hold values. One major kind of parameter is variables: named parameters. If you are familiar with almost any other imperative programming language (such as C, BASIC, Fortran, or Pascal), then you are already familiar with variables. The following simple script uses the variable  to hold the value , and prints out a "Hello, world!" message:

As you can see, the string  in the second line was replaced by   before that command was run. This substitution is known as variable expansion.

Variable expansion is more flexible than you might suspect. For example, it can even hold the name of the command to run:

In both of the above examples, we have used the notation  to perform the variable expansion. The briefer notation  − without curly brackets − would have the same effect in these cases. Sometimes the curly brackets are necessary (for example,  cannot be written as , because the latter would be interpreted as  ), but they can usually be omitted, and real-world scripts usually omit them.

Of course, needless to say, the above are not very realistic examples; they demonstrate only how to use variables, not why or when to use them. If you are familiar with other imperative programming languages, then it is probably already obvious to you why and when you would use variables; if not, then this should become clear as you read through this book and see examples that use them more realistically.

You may have noticed that we have used double-quotes, rather than single-quotes  , for character-strings that include variable expansions. This is because single-quotes prevent variable expansion; a command such as  will print the actual string , rather than printing the value of a variable named.

It is generally a good idea to wrap variable expansions in double-quotes, because otherwise the results of variable expansion will undergo filename expansion, as well as word splitting (whereby white-space is used to separate the words that make up a command). For example, this script:

is liable to print something like, which is probably not what we want. Real-world scripts frequently do not include double-quotes except when they are clearly necessary, but this practice sometimes leads to confusing bugs.

A number of variables have special significance. For example, the variable  determines the list of directories that Bash should search in when trying to run an external program; if it is set to , then the command   will look to run either   or. The variable  is pre-initialized to the current user's home directory, and it determines the behavior of tilde-expansion. For example, if a script sets, then   will print. (This will not actually change the user's home directory, however.)

title: Bash Shell Scripting/Variables


text:
Bash Shell Scripting/Positional Parameters

In most of the above commands — both those that run a built-in command, and those that use an external program — we have supplied one or more arguments, that indicate what the command should operate on. For example, when we invoke the common Unix utility  ("make directory") to create a new directory, we invoke it with a command like this one:

where  is the name of the new directory to create.

And as we have seen, Bash scripts are themselves programs that can be run. So it goes without saying that they, too, can take arguments. These arguments are available to the program as its positional parameters. Earlier, we saw that variables are one kind of parameter. Positional parameters are very similar, but are identified by numbers rather than by names. For example,  (or  ) expands to the script's first argument. So, suppose we want to create a simple script called  that takes two arguments — a filename, and a line of text — and creates the specified file with the specified text. We can write it as follows:

(Notice the line  at the very beginning of the file; we covered that line at Basic commands. When you run this code, that line wil guarantee that it will be interpreted by the Bash shell, even if you are running from another program or your computer has a non-standard configuration.)

After making it executable by running, we can run it as follows:

We can also refer to all of the arguments at once by using, which expands to all of the positional parameters, in order. When wrapped in double-quotes, as, each argument becomes a separate word. (Note: the alternative  is perhaps more common, but   becomes a single word, with spaces in between the original parameters.   is almost always preferable to either   or , which allow an argument to become split into multiple words if it contains whitespace, and to  , which combines multiple arguments into a single word.) This is often useful in concert with the built-in command  , which removes the first positional parameter, such that   becomes  ,   becomes  , and so on. For example, if we change  as follows:

then we can run it as follows:

and all of the arguments, except the filename, will be written to the file.

The number of positional parameters is available as ; for example, if   is , then the positional parameters are  ,  , and.

Note that positional parameters beyond  require the curly braces; should you need to refer to the tenth argument, for example, you must write   rather than. (The latter would be interpreted as .) That said, it is not usually a good idea to have so many arguments with specific meanings, since it is hard for users to keep track of them. If you find yourself specifically referring to your script's tenth argument, it may be worth re-evaluating your approach.

If you have some experience with Bash, or with Unix utilities, you've most likely noticed that many commands can take various "options", indicated with a leading hyphen, in addition to their regular arguments. For example,  deletes an individual file, while   deletes an entire directory with all of its contents. (The  is short for "recursive": the command "recursively" deletes an entire tree of directories.) These options are actually just arguments. In, there is just one argument , while in   there are two (  and  ). In a sense, there is nothing inherently special about these arguments, but this notation for options is so widespread as to be considered standard; many or most of the Bash built-in commands can accept various options, and later we will see various techniques for supporting options as arguments to our Bash scripts.


text:
Bash Shell Scripting/Exit Status

When a process completes, it returns a small non-negative integer value, called its exit status or its return status, to the operating system. By convention, it returns zero if it completed successfully, and a positive number if it failed with an error. (This approach allows multiple different errors to be distinguished by using different positive numbers.) A Bash script can obey this convention by using the built-in command. The following command:

terminates the shell script, returning an exit status of four, indicating some sort of error. When no exit status is specified (either because  is run with no argument, or because the script ends without calling  ), the script returns the exit status of the last command it ran.

One way that exit statuses are used is with the Bash operators  ("and") and   ("or"). If two commands are separated by, then the command on the left is run first, and the command on the right is only run if the first command succeeds. Conversely, if they are separated by, then the command on the right is only run if the command on the left fails.

For example, suppose we want to delete the file  and recreate it as a blank file. We can delete it using the common Unix utility  ("remove"), and recreate it using the common Unix utility  ; so, we might write this:

But really, if  fails, we don't want to run  : we don't want to recreate the file if we failed to delete it to begin with. So, we can write this instead:

This is the same as before, except that it won't try to run  unless   has succeeded.

A third Boolean-like operator,  ("not"), inverts the exit status of a command. For example, this command:

is equivalent to, except that it will indicate success if   indicates failure, and vice versa. (This is not usually useful when exit statuses are used as actual exit statuses, indicating success or failure, but we will soon see some extended uses of exit statuses where a "not" operation is more useful.)

The exit status of a command is (briefly) available as. This can be useful when it is necessary to distinguish between multiple different failure statuses; for example, the  command (which searches for lines in a file that match a specified pattern) returns 0 if it finds a match, 1 if it finds no matches, and 2 if a genuine error occurs.

title: Bash Shell Scripting/Exit Status


text:
Bash Shell Scripting/Conditional Expressions

Very often, we want to run a certain command only if a certain condition is met. For example, we might want to run the command  ("copy the file   to location  ") if, and only if,   exists. We can do that like this:

The above uses two built-in commands:

 * The construction  returns an exit status of zero (success) if   is true, and a nonzero exit status (failure) if   is false. In our case,   is , which is true if and only if there exists a file named.
 * The construction  < first runs ; if that completes successfully (that is, if its exit status is zero), then it goes on to run.

In other words, the above is equivalent to this:

except that it is more clear (and more flexible, in ways that we will see shortly).

In general, Bash treats a successful exit status (zero) as meaning "true" and a failed exit status (nonzero) as meaning "false", and vice versa. For example, the built-in command  always "succeeds" (returns zero), and the built-in command   always "fails" (returns one).

statements
statements are more flexible than what we saw above; we can actually specify multiple commands to run if the test-command succeeds, and in addition, we can use an  clause to specify one or more commands to run instead if the test-command fails:

The commands can even include other  statements; that is, one   statement can be "nested" inside another. In this example, an  statement is nested inside another   statement's   clause:

This particular pattern — an  clause that contains exactly one   statement, representing a fallback-test — is so common that Bash provides a convenient shorthand notation for it, using   ("else-if") clauses. The above example can be written this way:

A single  statement can have any number of   clauses, representing any number of fallback conditions.

Lastly, sometimes we want to run a command if a condition is false, without there being any corresponding command to run if the condition is true. For this we can use the built-in  operator, which precedes a command; when the command returns zero (success or "true"), the   operator changes returns a nonzero value (failure or "false"), and vice versa. For example, the following statement will copy  to   unless   already exists:

All those examples above are examples using the  expressions. Actually  just runs everything in   when the command in the statement returns 0: So the behavior of  is quite like the logical 'and'   and 'or'   in some ways: Always notice that misuse of those logical operands may lead to errors. In the case above, everything was fine because plain  is almost always successful.

Conditional expressions
In addition to the  condition used above, which is true if   exists, there are quite a few kinds of conditions supported by Bash's   notation. Five of the most commonly used are:

 * : True if  exists and is a directory.
 * : True if  exists and is a regular file.
 * : True if  exists, whatever it is.
 * : True if  matches  . (  has the same form as a pattern in filename expansion; for example, unquoted   means "zero or more characters".)
 * : True if  does not match.
 * : True if  contains Posix extended regular expression  . See Regular_Expressions/POSIX-Extended_Regular_Expressions for more information.

In the last three types of tests, the value on the left is usually a variable expansion; for example,  returns a successful exit status if the variable named   contains the value.

The above conditions just scratch the surface; there are many more conditions that examine files, a few more conditions that examine strings, several conditions for examining integer values, and a few other conditions that don't belong to any of these groups.

One common use for equality tests is to see if the first argument to a script is a special option. For example, consider our  statement above that tries to copy   or   to. The above version is very "verbose": it generates a lot of output. Usually we don't want a script to generate quite so much output; but we may want users to be able to request the output, for example by passing in  as the first argument. The following script is equivalent to the above  statements, but it only prints output if the first argument is  :

Later, when we learn about shell functions, we will find a more compact way to express this. (In fact, even with what we already know, there is a more compact way to express this: rather than setting  to   or , we can set   to   or  , where the colon   is a Bash built-in command that does nothing. We can then replace all uses of   with  . A command such as   would then become  , printing  , if verbose-mode is turned on, but would become  , doing nothing, if verbose-mode is turned off. However, that approach might be more confusing than is really worthwhile for such a simple purpose.)

Combining conditions
To combine multiple conditions with "and" or "or", or to invert a condition with "not", we can use the general Bash notations we've already seen. Consider this example:

The test-command  uses the   and   operators that we saw above that work based on exit status. is "successful" if  is true, which means that   will only run   if   exists. Furthermore,  inverts the exit status of , so that   is "successful" if and only if   doesn't exist. The end result is that  is "successful" — "true" — if and only if   does exist and   does not exist.

The construction  actually has built-in internal support for these operators, such that we can also write the above this way:

but the general-purpose notations are often more clear; and of course, they can be used with any test-command, not just the  construction.

Notes on readability
The  statements in the above examples are formatted to make them easy for humans to read and understand. This is important, not only for examples in a book, but also for scripts in the real world. Specifically, the above examples follow these conventions:

 * The commands within an  statement are indented by a consistent amount (by two spaces, as it happens). This indentation is irrelevant to Bash — it ignores whitespace at the beginning of a line — but is very important to human programmers. Without it, it is hard to see where an   statement begins and ends, or even to see that there is an   statement. Consistent indentation becomes even more important when there are   statements nested within   statements (or other control structures, of various kinds that we will see).
 * The semicolon character  is used before  . This is a special operator for separating commands; it is mostly equivalent to a line-break, though there are some differences (for example, a comment always runs from   to the end of a line, never from   to  ). We could write   at the beginning of a new line, and that is perfectly fine, but it's good for a single script to be consistent one way or the other; using a single, consistent appearance for ordinary constructs makes it easier to notice unusual constructs. In the real world, programmers usually put   at the end of the   or   line, so we have followed that convention here.
 * A newline is used after  and after  . These newlines are optional — they need not be (and cannot be) replaced with semicolons — but they promote readability by visually accentuating the structure of the   statement.
 * Regular commands are separated by newlines, never semicolons. This is a general convention, not specific to  statements. Putting each command on its own line makes it easier for someone to "skim" the script and see roughly what it is doing.

These exact conventions are not particularly important, but it is good to follow consistent and readable conventions for formatting your code. When a fellow programmer looks at your code — or when you look at your code two months after writing it — inconsistent or illogical formatting can make it very difficult to understand what is going on.


text:
Bash Shell Scripting/Loops

Often we want to run the same sequence of commands, over and over again, with slight differences. For example, suppose that we want to take all files named  and rename them to   ("backup"). We can use file-expansion to get the list of files named, but how do we use that list? There's no obvious command containing, say,, that would perform the three moves we need. What we need is a  loop:

The above takes the variable, and assigns it in turn to each word in the expansion of. Each time, it runs the body of the loop. In other words, it is equivalent to the following:

There is nothing special here about filename expansion; we can use the same approach to iterate over any other argument-list, such as the integers 1 through 20 (using brace expansion):

or the positional parameters :

In fact, that specific case is so common that Bash provides the equivalent shorthand, with   being implied. (But it's probably better to use the explicit form anyway.)

Another kind of loop is the  loop. It is similar to an  statement, except that it loops repeatedly as long as its test-command continues to be successful. For example, suppose that we need to wait until the file  is deleted. One approach is to "sleep" for a few seconds, then "wake up" and see if it still exists. We can loop repeatedly in this fashion:

Conversely, we can use an  loop to loop until a given command is successful; for example, the reverse of the above might be:

Of course, this is the same as combining  with , but in some cases it may be more readable.
 * Just like,   judges   or   in the same way. Try it out yourself.

title: Bash Shell Scripting/Loops


text:
Bash Shell Scripting/Shell Functions

A shell function is a special type of variable that is essentially a script-within-a-script. This feature allows us to group a sequence of commands into a single named command, which is particularly useful if the sequence of commands needs to be run from many places within the script. A shell function can even consist of just a single command; this may be useful if the command is particularly complicated, or if its significance would not immediately be obvious to a reader. (That is, shell functions can serve two purposes: they can save typing, and they can allow for more readable code by creating intuitively-named commands.) Consider the following script:

The above script creates a shell function called  that asks the user to type a password, and stores the result in a specified variable. It then runs  to store the password as  ; and lastly, if the call to   succeeded (as determined by its exit status), the retrieved password is printed to standard output (which is obviously not a realistic use; the goal here is simply to demonstrate the behavior of  ).

The function  doesn't do anything that couldn't be done without a shell function, but the result is much more readable. The function invokes the built-in command  (which reads a line of user input and saves it in one or more variables) with several options that most Bash programmers will not be familiar with. (The  option disables a special meaning for the backslash character; the   option causes a specified prompt, in this case , to be displayed at the head of the line; and the   option prevents the password from being displayed as the user types it in. Since the   option also prevents the user's newline from being displayed, the   command supplies a newline.) Additionally, the function uses the conditional expression   to make sure that the script's input is coming from a terminal (a console), and not from a file or from another program that wouldn't know that a password is being requested. (This last feature is debatable; depending on the general functionality of the script, it may be better to accept a password from standard input regardless of its source, under the assumption that the source was designed with the script in mind.) The overall point is that giving sequence of commands a name —  — makes it much easier for a programmer to know what it does.

Within a shell function, the positional parameters (, , and so on, as well as  ,  , and  ) refer to the arguments that the function was called with, not the arguments of the script that contains the function. If the latter are needed, then they need to be passed in explicitly to the function, using. (Even then,  and   will only affect the positional parameters within the function, not those of the caller.)

A function call returns an exit status, just like a script (or almost any command). To explicitly specify an exit status, use the  command, which terminates the function call and returns the specified exit status. (The  command cannot be used for this, because it would terminate the entire script, just as if it were called from outside a function.) If no exit status is specified, either because no argument is given to the   command or because the end of the function is reached without having run a   command, then the function returns the exit status of the last command that was run.

Incidentally, either  or   may be omitted from a function declaration, but at least one must be present. Instead of, many programmers write. Similarly, the  notation is not exactly required, and is not specific to functions; it is simply a notation for grouping a sequence of commands into a single compound command. The body of a function must be a compound command, such as a  block or an   statement;   is the conventional choice, even when all it contains is a single compound command and so could theoretically be dispensed with.

title: Bash Shell Scripting/Shell Functions


text:
Bash Shell Scripting/Environment

Subshells
In Bash, one or more commands can be wrapped in parentheses, causing those commands to be executed in a "subshell". (There are also a few ways that subshells can be created implicitly; we will see those later.) A subshell receives a copy of the surrounding context's "execution environment", which includes any variables, among other things; but any changes that the subshell makes to the execution environment are not copied back when the subshell completes. So, for example, this script:

prints this: bar
bar
bip
foo

bar

The same is true of function definitions; just like a regular variable, a function defined within a subshell is not visible outside the subshell.

A subshell also delimits changes to other aspects of the execution environment; in particular, the  ("change directory") command only affects the subshell. So, for example, this script:

prints this: /
/
/home
/

An  statement within a subshell terminates only that subshell. For example, this script:

prints this: subshell succeeded
subshell failed

Like in a script as a whole,  defaults to returning the exit status of the last-run command, and a subshell that does not have an explicit   statement will return the exit status of the last-run command.

Environment variables
We have already seen that, when a program is called, it receives a list of arguments that are explicitly listed on the command line. What we haven't mentioned is that it also receives a list of name-value pairs called "environment variables". Different programming languages offer different ways for a program to access an environment variable; C programs can use  (and/or accept them as a third argument to  ), Perl programs can use , Java programs can use  , and so forth.

In Bash, environment variables are simply made into regular Bash variables. So, for example, the following script prints out the value of the  environment variable:

The reverse, however, is not true: regular Bash variables are not automatically made into environment variables. So, for example, this script:

will not print, because the variable   is not passed into the   command as an environment variable. ( runs the one-line Bash script  .)

To turn a regular Bash variable into an environment variable, we have to "export" it into the environment. The following script does print :

Note that  doesn't just create an environment variable; it actually marks the Bash variable as an exported variable, and later assignments to the Bash variable will affect the environment variable as well. That effect is illustrated by this script:

The  command can also be used to remove a variable from an environment, by including the   option; for example,   undoes the effect of. And multiple variables can be exported or unexported in a single command, such as  or.

It's important to note that environment variables are only ever passed into a command; they are never received back from a command. In this respect, they are similar to regular Bash variables and subshells. So, for example, this command:

prints ; the change to   inside the one-line script doesn't affect the process that invoked it. (However, it would affect any scripts that were called in turn by that script.)

If a given environment variable is desired for just one command, the syntax  may be used, with the syntax of a variable assignment (or multiple variable assignments) preceding a command on the same line. (Note that, despite using the syntax of a variable assignment, this is very different from a normal Bash variable assignment, in that the variable is automatically exported into the environment, and in that it only exists for the one command. If you want avoid the confusion of similar syntax doing dissimilar things, you can use the common Unix utility  for the same effect. That utility also makes it possible to remove an environment variable for one command — or even to remove all environment variables for one command.) If   already exists, and it's desired to include its actual value in the environment for just one command, that can be written as.

An aside: sometimes it's useful to put variable definitions — or function definitions — in one Bash script (say, ) that can be called by another Bash script (say,  ). We can see that simply invoking that other Bash script, as  or as , will not work: the variable definitions in   would not be seen by  , not even if we "exported" those definitions. (This is a common point of confusion:  exports variables into the environment so that other processes can see them, but they're still only seen by child processes, not by parents.) However, we can use the Bash built-in command   ("dot") or , which runs an external file almost as though it were a shell function. If  looks like this:

then this script:

will print.

Scope
We have now seen some of the vagaries of variable scope in Bash. To summarize what we've seen so far:

 * Regular Bash variables are scoped to the shell that contains them, including any subshells in that shell.
 * They are not visible to any child processes (that is, to external programs).
 * If they are created inside a subshell, they are not visible to the parent shell.
 * If they are modified inside a subshell, those modifications are not visible to the parent shell.
 * This is also true of functions, which in many ways are similar to regular Bash variables.
 * Function-calls are not inherently run in subshells.
 * A variable modification within a function is generally visible to the code that calls the function.
 * Bash variables that are exported into the environment are scoped to the shell that contains them, including any subshells or child processes in that shell.
 * The  built-in command can be used to export a variable into the environment. (There are other ways as well, but this is the most common way.)
 * They differ from non-exported variables only in that they are visible to child processes. In particular, they are still not visible to parent shells or parent processes.
 * External Bash scripts, like other external programs, are run in child processes. The  or   built-in command can be used to run such a script internally, in which case it's not inherently run in a subshell.

To this we now add:

 * Bash variables that are localized to a function-call are scoped to the function that contains them, including any functions called by that function.
 * The  built-in command can be used to localize one or more variables to a function-call, using the syntax   or  . (There are other ways as well — for example, the   built-in command has the same effect — but this is probably the most common way.)
 * They differ from non-localized variables only in that they disappear when their function-call ends. In particular, they still are visible to subshells and child function-calls. Furthermore, like non-localized variables, they can be exported into the environment so as to be seen by child processes as well.

In effect, using  to localize a variable to a function-call is like putting the function-call in a subshell, except that it only affects the one variable; other variables can still be left non-"local".

It's important to note that, although local variables in Bash are very useful, they are not quite as local as local variables in most other programming languages, in that they're seen by child function-calls. For example, this script:

will actually print  rather than. This is because the original value of  is hidden until   returns. (In programming language theory, a variable like  is said to be "dynamically scoped" rather than "lexically scoped".)

One difference between  and a subshell is that whereas a subshell initially takes its variables from its parent shell, a statement like   immediately hides the previous value of  ; that is,   becomes locally unset. If it is desired to initialize the local  to the value of the existing , we must explicitly specify that, by using a statement like.

When a function exits, variables regain the values they had before their  declarations (or they simply become unset, if they had previously been unset). Interestingly, this means that a script such as this one:

will actually print : the   statement in the function takes effect before the variable is localized, so the value   is what is restored when the function returns.

And since  is simply an executable command, a function can decide at execution-time whether to localize a given variable, so this script:

will actually print bar
baz

title: Bash Shell Scripting/Environment


text:
Bash Shell Scripting/Pipelines And Substitution

As we have seen, a command's return value, taken strictly, is just a small non-negative integer intended to indicate success or failure. Its real output is what it writes to the standard output stream. By default, text written to the standard output stream is printed to the terminal, but there are a few ways that it can be "captured" and used as the command's true return value.

Pipelines
When a sequence of commands are linked together in a pipeline, the output of each command is passed as input to the next. This is a very powerful technique, since it lets us combine a number of small utility programs to create something complex.

Command substitution
Command substitution is a bit like variable expansion, but it runs a command and captures its output, rather than simply retrieving the value of a variable. For example, consider our  example above:

There is really no reason that the caller should have to save the password in a variable. If  simply printed the password to its standard output, then the caller could use command substitution, and use it directly:

To evaluate, Bash runs the command   in a subshell, capturing its standard output, and replaces   with the captured output.

In addition to the notation, an older notation   (using backquotes) is also supported, and still quite commonly found. The two notations have the same effect, but the syntax of  is more restrictive, and in complex cases it can be trickier to get right.

Command substitution allows nesting; something like  is allowed. (It runs the command, using its output as an argument to  , and using the output of that as an argument to  .)

Command substitutions can actually contain a sequence of commands, rather than just one. As we've seen previously, semicolons can be used instead of newlines to separate commands, and it is common to do this within command substitutions. Each of the semicolon-separated statements runs in sequence in a single subshell and their combined output is captured. Command substitutions can also contain variable assignments and function definitions, but these are useful only within the substitution, and do not persist in the parent shell once the substitution is finished.