Sponsored Content
Top Forums UNIX for Dummies Questions & Answers [Solved] Calculation on sun again Post 302734533 by fpmurphy on Thursday 22nd of November 2012 09:08:41 AM
Old 11-22-2012
You seem to be mixing up old and modern bash or ksh93 scripting integer syntax. I suggest you stick to modern syntax. Also make sure that you have a appropriate shebang as the first line of your script.

Code:
$ a=0
$ b=40000
$ c=10000
$ a=$(( b - c ))
$ echo $a
30000
$ d=$(( a - 10000 ))
$ echo $d
20000
$ d=$(( a - 50000 ))
$ echo $d
-20000
$ if (( d > 0 ))
> then
> echo "greater"
> fi
$

 

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Help: Sun Disk partitioning for Sun V240 & StorEdge 3300

Dear Sun gurus, I have Sun Fire V240 server with its StorEdge 3300 disk-array. Following are its disks appeared in format command. I have prepared its partitions thru format and metainit & metattach (may be i have made wrong steps, causing the errors below because I have done thru some document... (1 Reply)
Discussion started by: shafeeq
1 Replies

2. UNIX for Dummies Questions & Answers

Sun Solaris 10: How do I create a bootup disc? The Sun website confuses me

Hey there, I am starting a Computer Science Foundation year at the end of this month and am trying to get a little bit ahead of the game. I have always wanted to learn Unix and am currently struggling with creating a boot disc to run Solaris (I have chosen to study this) from as opposed to... (0 Replies)
Discussion started by: Jupiter
0 Replies

3. Solaris

Sun Fire 280R Sun Solaris CRT/Monitor requirements

I am new to Sun. I brought Sun Fire 280R to practice UNIX. What are the requirements for the monitor/CRT? Will it burn out old non-Sun CRTs? Does it need LCD monitor? Thanks. (3 Replies)
Discussion started by: bramptonmt
3 Replies

4. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

5. Emergency UNIX and Linux Support

[Solved] DCMU (disk control and monitor utility) sun fire

Hi , during 2 weeks i´ve been trying to find them. i need DCMU packets for managing internal disks on sun fire x4500 and sun fire x4600 on rhel. i have opened to tickets to myoraclesupport but no answer. please anybody could tell me a link or anythiing?? i´ve been searching and searching... (1 Reply)
Discussion started by: pabloli150
1 Replies

6. UNIX for Dummies Questions & Answers

[Solved] How to calculate in sun bash

I have two problems, and it would be great if someone could help me: The first line does not calculate. I have checked the origin term to calculate the variables and the result is OK. Normal substactions with $xx -100 work, but not in this constallation. I tried it with "| bc" and no result... (2 Replies)
Discussion started by: Pieter0815
2 Replies

7. Hardware

[solved] Sun Netra X1 - Adding a Second Hard Drive

As the title suggests, I'm trying to install a second drive (really want an OS mirror) on a Sun Netra X1. I've taken the spacer out, and had a go at with the drill-press so now I have a nice HDD tray. Have installed an IDE drive in the tray, plugged in the power and data cables that were... (0 Replies)
Discussion started by: Smiling Dragon
0 Replies
Info::Layer3::Sun(3pm)					User Contributed Perl Documentation				    Info::Layer3::Sun(3pm)

NAME
SNMP::Info::Layer3::Sun - SNMP Interface to L3 Sun Solaris AUTHOR
begemot SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. my $sun = new SNMP::Info( AutoSpecify => 1, Debug => 1, DestHost => 'mysunrouter', Community => 'public', Version => 1 ) or die "Can't connect to DestHost. "; my $class = $sun->class(); print "SNMP::Info determined this device to fall under subclass : $class "; DESCRIPTION
Subclass for Generic Sun Routers running SunOS Inherited Classes SNMP::Info::Layer3 Required MIBs Inherited Classes' MIBs See "Required MIBs" in SNMP::Info::Layer3 for its own MIB requirements. GLOBALS
These are methods that return scalar value from SNMP $sun->vendor() Returns 'sun' $sun->os() Returns 'sun' $sun->os_ver() Returns the software version extracted from message of the day. $sun->model() Returns 'Solaris Router' $sun->serial() Returns serial number Globals imported from SNMP::Info::Layer3 See documentation in "GLOBALS" in SNMP::Info::Layer3 for details. TABLE METHODS
These are methods that return tables of information in the form of a reference to a hash. Overrides $sun->i_ignore() Returns reference to hash. Increments value of IID if port is to be ignored. Ignores loopback Table Methods imported from SNMP::Info::Layer3 See documentation in "TABLE METHODS" in SNMP::Info::Layer3 for details. perl v5.12.4 2011-09-28 Info::Layer3::Sun(3pm)
All times are GMT -4. The time now is 09:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy