

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Help
incomplete
2: Flags
incomplete
3: Positional Arguments
incomplete
4: Exit Codes
incomplete
5: Standard Output
incomplete
6: Standard Error
incomplete
7: Standard In
incomplete
8: Piping
incomplete
9: Unix Philosophy
incomplete
This lesson's interactive features are locked, please to keep using them
If there's a standard output, there must be a standard input, right?
"Standard Input", usually called "standard in" or stdin, is the default place where programs read their input. It's just a stream of data that programs can read from as they run.
All major programming languages provide a simple way to read from stdin. In Python, it's the input function:
# execution stops until the user types
# something (in this case "Lane") and presses enter
name = input("What is your name? ")
print("Hello,", name)
# Hello, Lane
The < operator redirects a file into a program's stdin. For example, to feed the contents of a file called input.txt into the "word count" program, you can run:
wc < input.txt
This is not the same as:
wc input.txt
In wc input.txt, the wc program is accepting a filepath string as an argument, and it opens the file itself.
In wc < input.txt, the wc program doesn't know anything about the file, the file's contents are just being sent to the program's stdin, and it reads from there.
The worldbanc/private/bin/worldbanc.sh program reads a name and email from stdin. The worldbanc/answers.txt file contains a name and an email, one per line.
Feed answers.txt into the worldbanc.sh program through stdin.
Submit the shell checks.