[PLUG] Collect input via bash?

David Fleck dcf at aracnet.com
Sat Aug 31 17:14:28 UTC 2002


On Sat, 31 Aug 2002, Tyler F. Creelan wrote:
> How do I collect user input using bash? For example, if you wanted to
> collect three strings at the command line and store them as variables:
>
> $./myscript.sh
>
> your name: foo bar
> number of oranges : 34
> number of apples : 6
>
> Any ideas?

#!/bin/sh

echo "your name: "
read name

echo "number of apples: "
read apples

echo "number of oranges: "
read oranges

echo "$name $apples $oranges"


--
 David Fleck
 dcf at aracnet.com





More information about the PLUG mailing list