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."
Friday, October 9, 2009
Linux - Bash Shell Scripting - Reading From the Keyboard
Labels:
bash shell scripting,
linux,
reading from keyboard,
tutorial
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment