December 2018
Beginner
452 pages
12h 17m
English
Two other famous special devices, /dev/random and /dev/urandom, are best discussed in tandem with the next bit of redirection: input redirection.
Input normally comes from your keyboard, passed through by the Terminal to the command. The easiest example for this is the read command: it reads from stdin until it encounters a newline (when the Enter key is pressed) and then saves the input to the REPLY variable (or anything custom, should you have given that argument). It looks a bit like this:
reader@ubuntu:~$ read -p "Type something: " answerType something: Somethingreader@ubuntu:~$ echo ${answer}something
Easy. Now, let's say we run this command non-interactively, which means we cannot use a keyboard and Terminal to supply ...