User Tools

Site Tools


assignments:ex3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
assignments:ex3 [2018/08/30 11:01]
dokuroot
assignments:ex3 [2018/09/03 21:51] (current)
dokuroot
Line 50: Line 50:
 **7.** ''​read''​ is a command that takes input from a user and stores it as a variable. First, we'll prompt the user for their name and store it as a variable using the ''​read''​ command: **7.** ''​read''​ is a command that takes input from a user and stores it as a variable. First, we'll prompt the user for their name and store it as a variable using the ''​read''​ command:
   read -p "What is your name? " name   read -p "What is your name? " name
-*the ''​-p''​ option allows us to include a text message. The variable name is the argument. Note that although it looks a little more complex, the **read** command has a familiar format. \\ \\+*the ''​-p''​ option allows us to include a text message. The variable name is the argument. Note that although it looks a little more complex, the ''​read'' ​command has a familiar format. \\ \\
 **8.** Print a personalized greeting to the terminal: **8.** Print a personalized greeting to the terminal:
   echo "​Hello,​ $name!"​   echo "​Hello,​ $name!"​
assignments/ex3.txt ยท Last modified: 2018/09/03 21:51 by dokuroot