10-29-2009
Thank you ripat and panyam. It works perfectly fine
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I'm receiving an exit code 64 in our batch scheduler (BMC product control-m) executing a PERL script on UX-HP. Can you tell me where I can find a list of exit codes and their meaning. I'm assuming the exit code is from the Unix operating system not PERL. (3 Replies)
Discussion started by: jkuchar747
3 Replies
2. Shell Programming and Scripting
i need to use a case statement to do something when the user enters nothing at the prompt.
i know about the if statement and that isnt' what i'm interested in using for this. i want to use case.
heres the scenerio. a program asks a user for an input. i want to use a case statement to... (1 Reply)
Discussion started by: Terrible
1 Replies
3. Shell Programming and Scripting
Hi there,
Im having some problems with this function, I pass two arguments to the function $1 $2 (Arguments are month and date inputted by the user)
for some reason the case always fails... however in the cases defined below where it shouldnt fail the result is:
if it fails with input... (6 Replies)
Discussion started by: Darklight
6 Replies
4. UNIX for Dummies Questions & Answers
Hi, I need to change military time to regular time. I know to use case to indicate whether a.m. or p.m. as follows:
case "$hour"
in
0? | 1 ) echo a.m.;;
1 ) echo p.m.;;
* ) echo p.m.;;
esac
My question is how do I add the hour and minute... (2 Replies)
Discussion started by: karp3158
2 Replies
5. Shell Programming and Scripting
Hello Experts,
I am building a shell where I need to use case structure. The structure is in a function as in the sample code below:
# Shell mySh
#!/bin/sh
doThis(){
var=$1
case "$var" in
IT)
echo "ok 1 $var"
;;
... (7 Replies)
Discussion started by: hkansal
7 Replies
6. Shell Programming and Scripting
Hi all,
Am writing a script that uses the case statement and it is not working the way that I expect it to be. Script so far is as below.
What am expecting to happen is if the user enter neither Y or YES or N or NO, it is supposed to exit out of the script running only on_exit, otherwise,... (3 Replies)
Discussion started by: newbie_01
3 Replies
7. UNIX for Dummies Questions & Answers
I have 2 shell scripts the primary one would load the other one which will have functions defined in it.
Script 1:
. /apps/bin/Script 2
function
if
then
continue...
....
fi
Script 2:
function() (10 Replies)
Discussion started by: Ariean
10 Replies
8. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
The assignment is posted below:
Maintain automobile records in a database
Write a shell script to create,... (1 Reply)
Discussion started by: Boltftw
1 Replies
9. Shell Programming and Scripting
Hello, I wrote the case on code but it mistakes. I am not sure.
If/elif code:
#!/bin/ksh
you=$LOGNAME
hour=`date | awk '{print substr($4, 1, 2)}'`
print "The time is: $(date)"
if (( hour > 0 && $hour < 12 ))
then
print "Good morning, $you!"
elif (( hour == 12 ))
then (7 Replies)
Discussion started by: Masterpoker
7 Replies
10. Shell Programming and Scripting
i would like to search a variable for a pattern, without having make any calls to external tools.
i have a code like this:
COUNTPRO2="gine is very bad
vine is pretty good"
case "${COUNTPRO2}" in
*vine*)
factor=${COUNTPRO2}
echo $factor
;;
esac
If the variable contains... (7 Replies)
Discussion started by: SkySmart
7 Replies
LEARN ABOUT NETBSD
arithmetic
ARITHMETIC(6) BSD Games Manual ARITHMETIC(6)
NAME
arithmetic -- quiz on simple arithmetic
SYNOPSIS
arithmetic [-o +-x/] [-r range]
DESCRIPTION
arithmetic asks you to solve problems in simple arithmetic. Each question must be answered correctly before going on to the next. After
every 20 problems, it prints the score so far and the time taken. You can quit at any time by typing the interrupt or end-of-file character.
The options are as follows:
-o By default, arithmetic asks questions on addition of numbers from 0 to 10, and corresponding subtraction. By supplying one or more
of the characters +-x/, you can ask for problems in addition, subtraction, multiplication, and division, respectively. If you give
one of these characters more than once, that kind of problem will be asked correspondingly more often.
-r If a range is supplied, arithmetic selects the numbers in its problems in the following way. For addition and multiplication, the
numbers to be added or multiplied are between 0 and range, inclusive. For subtraction and division, both the required result and the
number to divide by or subtract will be between 0 and range. (Of course, arithmetic will not ask you to divide by 0.) The default
range is 10.
When you get a problem wrong, arithmetic will remember the numbers involved, and will tend to select those numbers more often than others, in
problems of the same sort. Eventually it will forgive and forget.
arithmetic cannot be persuaded to tell you the right answer. You must work it out for yourself.
DIAGNOSTICS
``What?'' if you get a question wrong. ``Right!'' if you get it right. ``Please type a number.'' if arithmetic doesn't understand what you
typed.
SEE ALSO
bc(1), dc(1)
BSD
May 31, 1993 BSD