09-18-2006
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
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm new to UNIX and I want to learn Shell Scripting. I want a web site that has Shell Scripting tutorials. Any suggesstions?.? (3 Replies)
Discussion started by: liveapple2000
3 Replies
2. UNIX for Dummies Questions & Answers
Hi All,
I am relatively new to UNIX.
I know some basic commands.
I am learning to write shell scripts.
My first aim is to connect to a Data Base via shell script.
Any ideas on this?
Any links, docs which will tell me about scripting??
Thanks
VEN (1 Reply)
Discussion started by: VENC22
1 Replies
3. Shell Programming and Scripting
Know a very best Text for learning the SH shell (standard shell)??
can you speak a text for me ??? (1 Reply)
Discussion started by: ZINGARO
1 Replies
4. UNIX for Dummies Questions & Answers
Can any one please provide a fast learning tips to learn UNIX shell scripting?
Thanks,
Gov (3 Replies)
Discussion started by: Govindh.v
3 Replies
5. Shell Programming and Scripting
Hi,
I had completed RHCE and i am interested to learn shell scripting.
Request you to please let me know which book is best for learning shell scripting or any online website.
Thanks & Regards
arun (2 Replies)
Discussion started by: Arun.Kakarla
2 Replies
6. Shell Programming and Scripting
Hi
Which is the most useful shell scripting book. Planning to learn shell scripting.Thanks in advance. (1 Reply)
Discussion started by: arunvellanki
1 Replies
7. UNIX Desktop Questions & Answers
I am trying to learn Shell scripting in UNIX. Could Any one please suggest on how to get UNIX account or any other free stimulator available for download on which I can practice Unix shell script?
Thanks,
sam70 (9 Replies)
Discussion started by: sam70
9 Replies
8. Shell Programming and Scripting
i am a beginner i m learning shell by myself
i have problem writing a korn shell that takes an absolute pathname to directory and display all ordinary files in the directory ordered by their length.
i was thinking use grep ls sort and sed. maybe, i m wrong! can someone tell me? (2 Replies)
Discussion started by: babuda0059
2 Replies
9. UNIX for Beginners Questions & Answers
Will it be good to learn 1) Perl or 2) Ruby first? (3 Replies)
Discussion started by: alvinoo
3 Replies
10. UNIX for Beginners Questions & Answers
Hello everyone! I am a mechanical engineering student from Brazil, and I'm trying to get into numerical simulation in fluid dynamics.
A teacher recommended OpenFoam and from what I've been reading, it seems that I need to get familiar with ''the Shell'' at first, and this is why I'm here. I... (2 Replies)
Discussion started by: Heisenflower
2 Replies
LEARN ABOUT ULTRIX
escape
escape(1) Mail Avenger 0.8.3 escape(1)
NAME
escape - escape shell special characters in a string
SYNOPSIS
escape string
DESCRIPTION
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result.
EXAMPLES
The following is a contrived example showing how one can unintentionally end up executing the contents of a string:
$ var='; echo gotcha!'
$ eval echo hi $var
hi
gotcha!
$
Using escape, one can avoid executing the contents of $var:
$ eval echo hi `escape "$var"`
hi ; echo gotcha!
$
A less contrived example is passing arguments to Mail Avenger bodytest commands containing possibly unsafe environment variables. For
example, you might write a hypothetical reject_bcc script to reject mail not explicitly addressed to the recipient:
#!/bin/sh
formail -x to -x cc -x resent-to -x resent-cc
| fgrep "$1" > /dev/null
&& exit 0
echo "<$1>.. address does not accept blind carbon copies"
exit 100
To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt
script:
bodytest reject_bcc `escape "$RECIPIENT"`
SEE ALSO
avenger(1),
The Mail Avenger home page: <http://www.mailavenger.org/>.
BUGS
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells.
AUTHOR
David Mazieres
Mail Avenger 0.8.3 2012-04-05 escape(1)