Hey everybody, I've been searching google and these forums and have found some solutions to the issues I've been having today within the OLD Bourne Shell. I am following chapter 6 of the Guide to Unix using Linux 4th Edition.
I am working on some basic calculations with variables in the BASH SHELL and doing the same within the Bourne Shell with modifications.
In BASH, I did the following:
Now I realize that the bourne shell does NOT have LET as a command, and I need to use expr.
I was able to get the math to work, by doing the following:
But how do I incorporate the variable of X into this?
I tried:
Anybody mind giving me an idea what I am doing wrong?
Hi,
I need some help to setup some environmental variables.
for example...Get A -> userdefined/user input
B -> a number.
c -> system variable...for example $GETCONF PAGE_SIZE
E = do some math using bc
display a message "The value is E"
setup the system/kernel paramter sysctl -p... (3 Replies)
Hi
I am trying to calculate the rate at which something is happening.
I have 2 files- a1 and b1.
I want to calculate something like this
((wc -l a1)/(wc -l a1 + wc -l b1))*100 over a loop for different a and b.
Is this possible, help me out fellas.
Thanks a lot :) (5 Replies)
Have a bit complicated math query ..
Basically i am given a number which is > 50 ..
I am suppose to find the calculation to get a number which is equal or more than the input number and is also a multiple of any number between 20 - 30 .
For example .
Input number is 60 .
Now 20x3 =60 ... (2 Replies)
there are two variables from a select query and these two variables has to assign in a update query . the two variables are two fields. How to assign without splitting by awk? (7 Replies)
Hi All
I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell.
Some operations like calculation don't work :
cat ${file1} | tail -$((${num1}-${num2})) > ${file2}
Is it possible to activate Korn Shell... (3 Replies)
I do not claim to be an expert, but I have done things with scripts that whole teams of folks have said can not be done. Of course they should have said we do not have the intestinal fortitude to git-r-done.
I have been using UNIX actually HPUX since 1992. Unfortunately my old computer died and... (7 Replies)
Develop a grade calculating program. This program will process all students in the file. This program should neatly display each field of each student's record *and* adds the following items: Course Average and Letter Grade. The course average is calculated by the following weights: 50% for quiz... (7 Replies)
Hi everybody:
I have a problem about use variables. I 've created this variable:
var=`wc -l file.txt | cut -c 1-2`;
n_var="$var"-1 ;
echo $n_var;
In my case var is 8.
When echo shows $n_var does not appear as I want. The question is how can I subtract, this is operate, to my variable.... (1 Reply)