how to write a shell script code to display information

Asked by anthony tomlin

i am trying to write a simple program for a class and i am having trouble writing the shell script code to display information.. can someone show me an example of what the code should look like?..
additional information to my original question:

#!/bin/sh
echo "Hello"

this was sent to me and i was wondering if this was the complete code because in the book that i am using for school the code seems longer but i stil can't understand it all... sorry for sending twice but i forgot to include the code that was sent to me .. as i stated before i want to know if this is all i need? because in my book its talking about syntaxes like ( IFS, DO/WHILE, THEN/ELSE, GREP, FI) i wanted to know if these words are included how to write the code to use them at least given an example of what it should look like.. thank you very much for you help and expertise

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu bash Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Ryan Dwyer (ryandwyer) said :
#1

#!/bin/sh
echo "Hello"

Revision history for this message
Sam_ (and-sam) said :
#2
Revision history for this message
Midnight Matt (randygaffer) said :
#3

You generally want to put in the command `exit 0` as the last line in any script. That returns control from your script, which runs as its own shell inside the main shell, back to the main shell.

It's possible that the `Hello World` syntax you posted was the entirety of your very first programming assignment. Later on, you'll be getting into decision statements, controlled loops, error handling, etc.

Good Luck.

Can you help with this problem?

Provide an answer of your own, or ask anthony tomlin for more information if necessary.

To post a message you must log in.