Friday, October 9, 2009

Linux - Bash Shell Scripting - Reading From the Keyboard

To read a string from the keyboard and store it in a shell variable use the read command, e.g.,

#!/bin/bash
echo "Enter your name: "
read name
echo "Pleased to meet you $name."

No comments:

Post a Comment