Results 1 to 3 of 3
Hey guys,
I need to save the output from my script into a new file.
The output is just the content of two variables.
My current code is
#!/bin/bash
echo ...
- 05-28-2008 #1Just Joined!
- Join Date
- May 2008
- Posts
- 2
[SOLVED] Save output
Hey guys,
I need to save the output from my script into a new file.
The output is just the content of two variables.
My current code is
#!/bin/bash
echo "Please enter 5 numbers"
read num1
read num2
read num3
read num4
read num5
add=`expr $num1 + $num2 + $num3 + $num4 + $num5`
ans=`expr $add / 5`
rem=`expr $add % 5`
echo "The average of the 5 numbers is $ans with a remainder of $rem"
I just need to store ans and rem.
Any ideas?
- 05-28-2008 #2
Hi and Welcome !
Redirect results to a file too.
Check contents of foo.Code:echo "The average of the 5 numbers is $ans with a remainder of $rem" >> foo
It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 05-28-2008 #3Just Joined!
- Join Date
- May 2008
- Posts
- 2
XD really?
So simple! Thank you!


