![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script Language Parser for Learning | kcampb9 | UNIX for Dummies Questions & Answers | 3 | 03-30-2008 02:21 PM |
| learning how to script | llsmr777 | UNIX for Dummies Questions & Answers | 11 | 06-28-2007 01:01 PM |
| A Text for learning the SH shell | ZINGARO | Shell Programming and Scripting | 1 | 08-09-2006 10:59 AM |
| Learning to write UNIX Shell Scripts | VENC22 | UNIX for Dummies Questions & Answers | 1 | 04-29-2005 09:03 AM |
| Learning Shell Scripting | liveapple2000 | Shell Programming and Scripting | 3 | 05-27-2002 01:36 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
learning how to use shell script
hello everyone, i am still trying to get this script to work, but with no luck. It is a little beyond my knowledge of scripting at the moment. The beginner book i have has an exercise listed that asks me to write a script tha allows for user input.
For example " what is your name: " and then you should be able to type your name in. And right after that it wants you to enter a number with a certain amount of digits in it(3). So it says somthing along the lines of; (the name you entered) " you entered the number ###. if someone could help show me how this is done i would greatly appreicate it. Thanks |
|
||||
|
well first of all you have to tell your environment which shell you are using, suppose your are using the bash shell then the script file would like:
#!/bin/bash #The beginning of your script code echo "What is your name ? " read name echo "Enter a 3 digit number" read number echo "The name you entered is " $name echo "The number you have entered is " $number #The end of your script code |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|