Reputation: 1
I'm making a small dungeon dwelling text game. How can I make a custom response question? I am stuck on just asking for a name. I have:
#!/bin/bash/env bash
clear
echo "Welcome, Traveler, ..."|pv -qL 10
clear
echo "What is your name $NAME?" |pv -qL 10
read $NAME
echo "I see.. $NAME?" |pv -qL 10
I don't know how to get it to register the name for later use.
Upvotes: 0
Views: 60
Reputation: 361605
Leave out the dollar sign when calling read
. It needs the name of the variable to assign to (NAME
) rather than its value ($NAME
).
read NAME
Upvotes: 1