Bob
Bob

Reputation: 4990

linux read command - what is notused, discard?

I've seen notused and discard used with the read command but I can't find where these two keywords are defined; they're not in the docs for read

https://unix.stackexchange.com/a/7214/393711

while read -t 0 notused; do
   read input
   echo "ignoring $input"
done

https://superuser.com/questions/276531/clear-stdin-before-reading

read -t 1 -n 10000 discard 
read -p "Give me some input: " input

Upvotes: 1

Views: 344

Answers (1)

Charles Duffy
Charles Duffy

Reputation: 295766

These are not keywords at all; they're just variable names. They fit into the syntax in the position [name ...], wherein any arbitrary names (including names that intentionally imply that data should not be used!) can be given for the content that is read.

Upvotes: 5

Related Questions