arithmetic problem


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers arithmetic problem
# 1  
Old 02-19-2002
Question arithmetic problem

i am used to making scripts for hp-ux. but lately i tried to make some for solaris. the problem is that when i tried to execute it it gave me an error the "let: not found". why is that? how can i perform an arithmetic function in the solaris shell script?

thanks Smilie
inquirer
# 2  
Old 02-19-2002
sh on HP-UX is a modified ksh and it supports the "let" command. sh on Solaris is just the old Bourne shell. Switch to ksh on Solaris and "let" will work.
# 3  
Old 02-20-2002
Computer thanks a lot

yes, you are right there. thanks a lot!

this site always never fails me... keep up the good work Smilie
inquirer
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help with date arithmetic please

Hello fellow forum members, I wrote below piece of code to calculate the date after a given date - date=$DATE_FINAL declare -a max_month=(0 31 28 31 30 31 30 31 31 30 31 30 31) eval $(echo $date|sed 's!\(....\)\(..\)\(..\)!year=\1;month=\2;day=\3!') (( year4=year%4 )) (( year100=year%100... (9 Replies)
Discussion started by: ektubbe
9 Replies

2. Homework & Coursework Questions

Arithmetic Problem with shell script programming.

Hello everybody, I decided to take a Unix Introduction class and have never had experience with programming. Everything was fine until recently when the Prof. started shell scripting and he wants us to make a small script to add unlimited numbers from arguments and from standard input. I... (8 Replies)
Discussion started by: Florinel76
8 Replies

3. Shell Programming and Scripting

Arithmetic Problem with shell script programming.

Hello everybody, I decided to take a Unix Introduction class and have never had experience with programming. Everything was fine until recently when the Prof. started shell scripting and he wants us to make a small script to add unlimited numbers from arguments and from standard input. I... (1 Reply)
Discussion started by: Florinel76
1 Replies

4. Programming

Pointer Arithmetic In C

I have a fundamental question on C pointer arithmetry.. Suppose i have a c string pointer already pointing to a valid location, Can I just do a charptr = charptr +1; to get to the next location, irregardless if my program is 32 or 64 bits? or should i do it this way: charptr =... (1 Reply)
Discussion started by: Leion
1 Replies

5. UNIX for Dummies Questions & Answers

Arithmetic: how to??

Hello all, I'd like to know how to perform arithmetic on multiple files. I have got many tab-delimited files. Each file contains about 2000 rows and 2000 columns. What I want to do is to to sum the values in each row & column in every file. The following explains what I want to do; ... (9 Replies)
Discussion started by: Muhammad Rahiz
9 Replies

6. UNIX for Dummies Questions & Answers

problem in script involving month arithmetic

advance happy new year to all, i am having a script.The purpose of the scripts is as follows.If the current month is march,june,september or december ,inc_flg should be set to '1' otherwise inc_flg should be set to '2' month= date +"%m" if || || || ; then inc_flg = 1 else ... (6 Replies)
Discussion started by: rajarp
6 Replies

7. Shell Programming and Scripting

Can I use wc -l with arithmetic expression?

Folks, I am wondering that i can use something like this in one line. For example, $((cat filename > wc -l) / 2) It doesn't work; how to get it work using command substitution? Moreover, is there any option for wc -l not to return filename after the line counts? wc -l filename would... (3 Replies)
Discussion started by: lalelle
3 Replies

8. Shell Programming and Scripting

problem in arithmetic operations

hello all, i am having a variable with a value of 0000010000 and if i add the variable with some no: suppose i=0000010000 n=`expr $i + 1` echo $n the output i am reciving is 10001 .it deletes all the zeros but i need result as 0000010001.. please help me... thanks in... (3 Replies)
Discussion started by: ithirak17
3 Replies

9. UNIX for Dummies Questions & Answers

Arithmetic In UNIX

I am a beginner and I have been searching the web all morning for this answer but can't find it anywhere. I know that prtint 1*2 will return 1*2 what if i actually want the problem to be calculated so i want print 1*2 to return 2 How is this done? (3 Replies)
Discussion started by: tygun
3 Replies

10. UNIX for Dummies Questions & Answers

arithmetic syntax

okay, I'm a complete beginner, and I keep getting stuck on the syntax here. I want to write a script where I read the current time as minutes and seconds, convert the minutes to seconds, and add the two, then redirect the output to a file. the command takes two arguments, which will also be... (1 Reply)
Discussion started by: paprbagprincess
1 Replies
Login or Register to Ask a Question