read
Basic Syntax
read [options] variableExamples
Reading User Input
echo "Enter your name:"
read name
echo "Hello, $name!"Reading Multiple Variables
echo "Enter your first name and last name:"
read first_name last_name
echo "Hello, $first_name $last_name!"Reading Input with a Prompt
Silent Input (e.g., Passwords)
Reading Input from a File
Advanced Examples
Reading Input with a Timeout
Reading a Single Character
Reading Input with a Delimiter
Reading an Array
Using Default Values
Practical Use Cases
Menu Selection
Confirmation Prompt
Conclusion
Last updated