Sponsored Content
Full Discussion: help writing script file
Top Forums UNIX for Dummies Questions & Answers help writing script file Post 48495 by lanboy_2005 on Tuesday 9th of March 2004 10:44:45 AM
Old 03-09-2004
what I have so far.

So far I was able to figure out a little bit and it seems to work.
I think.

I'm still unsure of how to find the average of 10 numbers and not sure if I'm doing this correctly. I want to be able to play around with the while loop and if statements so I'll be able to write a script that reads 10 numbers and can find a max, min and average. Any advice would be appreciated. I'm terrible with math Smilie so this is making things even harder for me.

Here is what I have so far.

ksh-2.04$ cat>maximum
echo "Enter 2 Numbers Below to Find Which One is The Maximum Number: "
read num1 num2
if [ $num1 -gt $num2 ]
then
echo "Number1: $num1 is the Maximum"
else
echo "Number2: $num2 is the Maximum"

fi

exit

ksh-2.04$ sh maximum
Enter 2 Numbers Below to Find Which One is The Maximum Number:
32
Number2: is the Maximum
ksh-2.04$

Thanks

Lanboy_2005
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Writing to a file within a script

Hi, At the moment i have a script where it asks the user if they want to create a file and what to put in the file. The problem is when the script is run the user inputs the information, though when they are finished typing what they want to be in the file there is no way for the program to know... (3 Replies)
Discussion started by: Jaken
3 Replies

2. Shell Programming and Scripting

writing script file for database

how to disable a constraint type of a field (present in diffrent tables) in the database unix a unix script file.. (3 Replies)
Discussion started by: shaksing
3 Replies

3. Shell Programming and Scripting

script for writing to a file

Hi, Can some some give ideas/help how to write to a file. i need to create a calender from the inputs given on command line i.e frm date,todate & -i is interval is given to write to a file. -i is 1 then a calender is daily , if -i =2 then calender is alternate day e.g $1 ... (0 Replies)
Discussion started by: innocent
0 Replies

4. UNIX for Dummies Questions & Answers

HELP! writing shell script with c++ file

how would i write a shell script to count number of one-line comments in a c++ file. please help with coding thank you. (1 Reply)
Discussion started by: deadleg
1 Replies

5. UNIX for Dummies Questions & Answers

Help writing a script to find a file

I just started learning about Unix and I cant figure out what im doing wrong. I'm trying to write a script that will ask for the file name and tell what type it is. This is what i have so far. http://i63.photobucket.com/albums/h123/wacand/untitled.jpg (2 Replies)
Discussion started by: wacand
2 Replies

6. Shell Programming and Scripting

Help with writing shell script file

I am trying to prompt the user using tput command to read the information ( 5 last names, first names and grades) from the keyboard. Save the data in a file called student.txt. Sort the file by last name and display it on the screen My pseudocode is as follow: Pseudocode: Initialize... (1 Reply)
Discussion started by: jestaton
1 Replies

7. Shell Programming and Scripting

Need help in writing a script to edit a file

Hi all, I need help in writing a script to edit a file Here is the sample of my file abc xxx 123 456 789 045 def yyy 987 678 098 cdf zzz 435 543 jhg vvv 987 765 (2 Replies)
Discussion started by: leo.maveriick
2 Replies

8. Shell Programming and Scripting

writing the main script file

Hi, I am new to shell scripting,and i was planning to write a script that will move files which have a datetime >= currentdate-N from a source to destination folder. All configuration should be done through a properties files. Here the value of N should be taken as 10 days(modification... (6 Replies)
Discussion started by: rahul125
6 Replies

9. UNIX for Dummies Questions & Answers

Writing a script that will take the first line from each file and store it in an output file

Hi, I have 1000 files names data1.txt through data1000.txt inside a folder. I want to write a script that will take each first line from the files and write them as output into a new file. How do I go about doing that? Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies

10. Shell Programming and Scripting

Help Writing File Restore Script

Hi all, I have been tasked with creating a script that sends a file into a created "recycling" directory and another script that restores a "deleted" file. I have already created the removal script but am stuck on the restoring part. I need to restore the file to its original location by... (0 Replies)
Discussion started by: bashbeginner
0 Replies
NUMBOUND(1)						User Contributed Perl Documentation					       NUMBOUND(1)

NAME
numbound - Find boundary numbers in files or STDIN. SYNOPSIS
numbound [-dhlV] <FILE> | numbound [-dhlV] (Input on STDIN from pipeline.) numbound [-dhlV] (Input on STDIN. Use Ctrl-D to stop.) DESCRIPTION
numbound will find boundary numbers (minimum and maximum) in files or STDIN. By default it will find the upper bound in the set of numbers (the maximum number) in the files or on STDIN. You can use the -l option for finding the lower bound (minumum number). OPTIONS
-l -- Return the lower bound number in the set (the minimum number) -h Help: You're looking at it. -V Increase verbosity. -d Debug mode. For developers BUGS
numbound currently will only gather the first number on each line instead of all the numbers on the lines. SEE ALSO
numaverage(1), numinterval(1), numnormalize(1), numgrep(1), numprocess(1), numsum(1), numrandom(1), numrange(1), numround(1) COPYRIGHT
numbound is part of the num-utils package, which is copyrighted by Suso Banderas and released under the GPL license. Please read the COPYING and LICENSE files that came with the num-utils package Developers can read the GOALS file and contact me about providing submitions or help for the project. MORE INFO
More info on numbound can be found at: http://suso.suso.org/programs/num-utils/ perl v5.10.1 2009-10-31 NUMBOUND(1)
All times are GMT -4. The time now is 02:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy