Join Scott Simpson for an in-depth discussion in this video Changing where things go with pipes and redirection, part of Up and Running with Bash Scripting.
A lot of what you'll be doing with…scripts involves getting something to go somewhere else.…Bash has a couple ways of doing this.…First, let's look at pipes.…Piping takes the result of one command and sends, or pipes it into another command.…For example, take a look at the result of listing the contents of…this directory, which has a lot of things in it from the previous movie.…That's a bunch of stuff.…It would be nice to take that output, and display it page by page.…I can do this by piping the output of ls into the more command.…And if you're looking for the pipe character, it's usually Shift Backslash.…
The key for which on most keyboards is right…above the Return key, but your keyboard might vary.…And now I can take advantage of more's pagination.…Redirection, on the other hand, works with…a standard input, standard output and standard error.…That is, the input from the command line environment, the output…to it and the errors that arise when something goes wrong.…Let's set up a little bit of an example here.…
- What is Bash?
- Managing output with grep, awk, and cut
- Understanding Bash script syntax
- Creating a basic Bash script
- Displaying text with "echo"
- Working with numbers, strings, and arrays
- Reading and writing text files
- Working with loops
- Using functions
- Getting user input during execution
- Ensuring a response
Skill Level Beginner
1. Working with the Command Line
2. Building Bash Scripts
3. Control Structures
4. Interacting with the User
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.