LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-09-2003, 05:54 AM   #1
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
Bash variables


Hi all!

Does anyone know if there is any other variable in bash, except string ofcourse, which can contain for example the value 1.6 ???

I have to do some calculations with that and dont want to multiply everything with 10.
 
Old 01-09-2003, 11:21 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,530

Rep: Reputation: 110Reputation: 110
Try the "bc" utility. Example:

bash$ echo "0.5 + 1.6" | bc
2.1
 
Old 01-09-2003, 03:31 PM   #3
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
Nop, thats not what i meant. I need it for a monitoring script, to monitor some servers. They don't have bc installed and i really dont want to install it either. The script should run with as less as possible extra programs.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
(bash) how to list all variables? Duudson Programming 11 03-24-2005 12:35 PM
sed with bash variables MurrayL Linux - Software 2 03-21-2005 08:13 AM
bash variables pfaendtner Linux - Newbie 4 11-23-2004 01:00 PM
variables in bash haddad Linux - General 6 09-22-2004 05:29 PM
Variables in bash tcaptain Programming 1 03-03-2003 02:07 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration