The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-18-2006
bebop1111116 bebop1111116 is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 30
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
  #2 (permalink)  
Old 09-18-2006
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,538
And that beginner book did not show you how to get user input??
you can read this book and also this page
  #3 (permalink)  
Old 09-18-2006
charbel charbel is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 41
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
  #4 (permalink)  
Old 09-18-2006
bebop1111116 bebop1111116 is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 30
thanks for your help everyone

Last edited by bebop1111116; 09-18-2006 at 12:18 PM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0