From the course: Linux Bash Shells and Scripts: Streamlining Tasks and Enhancing Workflows with Automation
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Using the coproc command - Linux Tutorial
From the course: Linux Bash Shells and Scripts: Streamlining Tasks and Enhancing Workflows with Automation
Using the coproc command
- [Instructor] We're getting into more advanced and less commonly used things. These vary a little bit, some moderately common, some not too common at all. But they're powerful, they're handy, and you might see 'em and it's good to know about 'em. Let's start with coprocesses. A coprocess is a way to start a command in the background and you can send it input and get its results. So it's kind of interactively working with a pipe, but you don't have to do the command in a pipeline. You can start it up and it continues to run and you can send it more stuff and read the results. So you can interact with it. You don't have to restart it over and over again. We'll see some examples. It's a little bit challenging, but if you look through the examples and think about it, I think most people get it. Let's say we have a script that just reads a line and does something with it over and over again, right? So it's a while loop here. The tr command translates corresponding character. So you give…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Using the coproc command5m 22s
-
(Locked)
Debugging scripts with -x and -u options3m 12s
-
(Locked)
Signals and traps2m 38s
-
(Locked)
Using the eval and getopt commands3m 57s
-
(Locked)
Challenge: Debugging scripts and using trap and eval1m 21s
-
(Locked)
Solution: Debugging scripts and using trap and eval2m 8s
-
(Locked)
Challenge: getopt, trap, and coproc3m 4s
-
(Locked)
Solution: getopt, trap, and coproc4m 13s
-
(Locked)
-