Help required on basic Unix Bourne Shell Script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help required on basic Unix Bourne Shell Script
# 1  
Old 03-25-2010
Help required on basic Unix Bourne Shell Script

Howdy People Smilie,

I'm a newbie & its my first question here. I've started learning Unix Bourne Shell scripting recently and struggling already Smilie Can someone PLEASE help me with the following problem. Somehow my script is not working.

  • Display an initial prompt of the form:
    Welcome to machine name. What is your name?
    where machine name is the network name for the machine that the script is running on.
  • Read the name that the user enters
  • Respond with the output:
    Hello name, how are you?
  • Read the response from the user
  • If the response contains the word “good” respond with:
    I'm glad to hear that.
  • Otherwise, respond with:
    I'm sorry to hear that. Hope you feel better soon.
  • Finally output: Good-bye.

Much appreciated guys. Thanks heaps in advance Smilie
# 2  
Old 03-25-2010
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

UNIX shell script required to read two columns from xml

Hello All, I am new to unix scripting. I need to read FROMINSTANCE, FROMFIELD from below XML code and need to write a script for insert into SQ_EPIC values( "DID", "PROJECT_NAME") Select DID, PROJECT_NAME from EPIC<CONNECTOR TOINSTANCETYPE="Source Qualifier" TOINSTANCE="SQ_EPIC" TOFIELD="DID"... (7 Replies)
Discussion started by: sekhar.lsb
7 Replies

2. Shell Programming and Scripting

ORACLE SQL: Basic help required in script

Hi, I am having the following codes which generates 24 files: declare begin for i in 0..23 loop EXECUTE IMMEDIATE 'create tablespace TSCGFCDR' ||to_char(sysdate,'DD')||'_'||to_char(i,'fm00')|| to_char(i+1,'fm00')||to_char(sysdate,'MONYY')||' DATAFILE '|| ... (4 Replies)
Discussion started by: hitesh1907
4 Replies

3. Shell Programming and Scripting

help with bourne shell script

Attempting to write a script to eventually notify me via email for when there is packetloss across the backbone. I am looking for values greater than 0% in the mtr field. #!/bin/sh target=www.google.com date +"%D"_"%T" >> /home/rich/mtr.log echo "----------------------------------------" >>... (1 Reply)
Discussion started by: closedown
1 Replies

4. Shell Programming and Scripting

How to send email using shell script in UNIX, Is any environment setup required in Mac OS X ?

Hi All, I am using Mac OS X (Leopard OS). I am very new to UNIX. My requirement is that, by running a shell script, I create a log file. So I have to send a mail having that log file attached. What I tried to do is, I simply tried to check,whether this direct command works or not. So I... (2 Replies)
Discussion started by: Afreen
2 Replies

5. Programming

Creating a basic UNIX shell script for chatting

Hey guys, This is quite simply what I'm trying to make: A program that runs in a UNIX terminal that you can output text messages to from another machine. These text messages would be prepended with a customized prompt. I'd also like to have the window spew out random dumps of flavor text not... (1 Reply)
Discussion started by: AcerAspirant
1 Replies

6. Shell Programming and Scripting

Delete File 5 Min old in Unix (Bourne Shell)??

Guys, I am writing a script to delete files 5 min old in Sun Os Unix. find . -name "*.txt" -mtime +1 -print I could find an equivalent command to look for files which are 5 min old. i tried -mmin option it didn't work either. Can any body trow a light on this. Cheers :) S:b: (5 Replies)
Discussion started by: sudharma
5 Replies

7. Shell Programming and Scripting

cd from a Bourne Shell Script - Please Help

Dear Bourne Shell Expert, I am trying to change the current working directory from within a Bourne Shell script. Simply enough i thought ! As I am sure you are well aware, Inside the script i echo `pwd` and it seems ok, but the shell spawns another shell to execute this and as such, when my... (10 Replies)
Discussion started by: fawqati
10 Replies

8. Shell Programming and Scripting

UNix Bourne Shell

i require a utility that identifies all users currently logged into the system. It should create a file called logfile which contains a list of usernames together with a count of how many login sessions they are currently running, for example coc9io : 1 hbh8jd : 3 dg7hy : 1 root : 4 it... (3 Replies)
Discussion started by: peter112
3 Replies

9. UNIX for Dummies Questions & Answers

Bourne Shell Script

Hello, I'm throwing this out there as a novice to the Unix world...I've been working on a project that requires me to ouput (using the echo command) a list of names in a single column format, but the problem is the input is in row format followed by a blank space...If anyone could give me a... (2 Replies)
Discussion started by: dmhonor914
2 Replies

10. UNIX for Advanced & Expert Users

Bourne shell script need help please ?

i have this assignment.. and i mad this script but there is something wrong with it.. if anyone can tell me.. watz going on... i would appreciate it.. tHnX in advance.. count=1 val=$2 op=$1 ans=0 if then if then while do ... (7 Replies)
Discussion started by: dezithug
7 Replies
Login or Register to Ask a Question