General :: Add Decimal Numbers?

Aug 10, 2010

Can anyone specify the methods how to add decimal numbers in Linux

View 5 Replies


ADVERTISEMENT

Programming :: Subtract Two Non-real (aka Decimal'd) Numbers Via Bash?

Apr 28, 2010

I just need to perform a simple operation of subtracting two numbers - that aren't whole numbers, i.e 200.56 - 67.24attempting to use expr i merely get "expr: non-numeric argument"

View 3 Replies View Related

Ubuntu :: New Calculator - Change The Pull Down To 'decimal' Expecting To See The Decimal (base 10) Value

Mar 31, 2011

snappy title to grab attention. maybe not stupid, but bleeding difficult to use, talk about a non-obvious, non-intuitive interface; I want to enter a hex value, and have the calculator convert that to decimal. So, I use the pull-down, choose 'hexadecimal', enter the hex value, then change the pull down to 'decimal', expecting to see the decimal (base 10) value. What do I see? The display just adds the hexadecimal base to the end of the hex value I just wrote! Where's my decimal (base 10) number damn it? I can't for the life of me work it out.

View 4 Replies View Related

General :: How To Get Decimal Value

Jul 4, 2011

i have a small script that takes the time in seconds(this is a very long number like 615.232145457577) and i convert it to minutes or hours by dividing by 60 or 3600 respectively. I would like to be able to get the result with maybe upto to 2 decimal values.

If i do echo "613.568787987975 / 3600" |bc -l
this gives: .17043577444110416666
How can i just get .17

View 3 Replies View Related

General :: Creating Bash File That Changes Decimal To Binary Using Obase?

Apr 21, 2011

Code:
#!/bin/bash
echo 'obase=2;10'|bc

[code]...

View 2 Replies View Related

Programming :: Create Inverted Files To Associate Files To Numbers ( Numbers Being The Index Of My Paths )?

Apr 4, 2011

am writing a small search program for my class. I have decided to use indexing for my program. Ive researched online about indexing and how search engines do it. If im gonno do that I need to create inverted files to associate files to numbers ( numbers being the index of my paths ) . Now I was wondering what would be the best way to create an inverted file ? I was going to create sql tables using mysql api in C but then again there is no array data type or vectors to store few numbers in a single column in mysql and it is not advised to use Enum or SET

View 14 Replies View Related

Ubuntu :: How To Go From Decimal To Numerical Values

Nov 10, 2010

I get this:

0000000 1202 0 0 0 0 0 0 0
0000020 141 89 63 89 141 0 0 0

[code]....

How to go from decimal to numerical values?

View 4 Replies View Related

Fedora :: No Decimal Point In Programming Calculator?

Dec 9, 2010

I just noticed there doesn't seem to be a decimal point button on the calculator (gcalctool 5.32.0) when it is in programming mode. I'm using Fedora 14 (32-bit).

View 4 Replies View Related

Programming :: Convert Hex To Decimal Inside Script With Awk

Dec 14, 2010

I have a script that creates a textfile with ip addresses and ports, but the ports are in hex format so they need to be converted.

Currently I have this code:

Code:

I'd like to have the second column in decimal instead of hex, like this:

Code:

Is there any way to do that with awk, preferably in a oneliner? Would printf be an option?

View 11 Replies View Related

Programming :: Bash: Convert Decimal To Minutes:seconds?

Jan 13, 2011

I have a script in the works that reads an MP3 file and gets the track length. Trouble is, it gives me the total seconds, like this:

Sample Track.mp3 = 225.55 seconds

What I'd like to have is that 225.55 converted into minutes:seconds format (in this case, 3:45). How can I do this?

View 10 Replies View Related

Programming :: If Statements With Decimal Places - Compare It To A Predefined Value

Aug 11, 2010

I'm writing an if statement where a variable is a number such as 14.05 (this is actually a temperature) and I want to compare it to a predefined value, sample code below:

Code:

I have all sorts of errors regardless of how I do this (double quotes, square brackets). The best idea I've had is stripping off the decimal place so it's a 4 digit number (e.g warning=1503 and DEV_TMP=1405) however this seems a little unnescessary and I'm sure there's an easier way of achieving the same thing.

View 11 Replies View Related

General :: Set The Gpio Pin Numbers For SCL And SDA?

Mar 2, 2011

On my board there is no i2c lines out. So I am trying to get i2c over GPIO by GPIO bit-banging. How to use i2c-gpio driver? Where to set the gpio pin numbers for SCL and SDA?

View 1 Replies View Related

General :: Random Numbers Between -5.0 To +5.0?

May 25, 2010

How to create random numbers between -5.0 to +5.0

View 12 Replies View Related

General :: Getting Numbers From A Line Of Text?

May 10, 2010

I'm working with a rather large file of data taking from a tracking program on my phone, and trying to pull only the longitude and latitude from it. Any given line in the data looks more or less like this:

{"lon":-122.3083848,"time":1.273515839496E9,"source":"skyhook","nap":28,"altitude":0,"name":"location","hpe" :29,"bearing":0,"ncell":0,"lat":47.6544453}

I've run it through this command:

grep skyhook log-2010-05-10_18-17-28.json | cut -d"," -f1,10

to get this:

{"lon":-122.30872015,"lat":47.65812201}
{"lon":-122.3076686,"lat":47.6569975}
{"lon":-122.3079161,"lat":47.656395}
{"lon":-122.3096168,"lat":47.656218}
{"lon":-122.3096285,"lat":47.656206}

Which is a lot nicer, but I would prefer not to have to hand remove the non-number characters by hand since there are thousands of data points. what I could do to get it to just be longitude and latitude in 'number number' format?

View 8 Replies View Related

General :: Getting Serial Numbers Of H/w From A Host

Aug 1, 2011

Does any one know the process or commands to get the serial no: of a h/w device from a host?

I am looking for serial No: of Hdd,Graphic card,processor,RAM

I can get the serials of HDD & RAM using hdparm & dmidecode,but don't know how to get it for processor & Graphics card.

View 6 Replies View Related

General :: How To Enable Alt + Numbers In Ubuntu?

Mar 17, 2011

I want to use the Alt + numbers function in Ubuntu but I don't know how> I researched it first and i read I had to do Shift + Ctrl + numbers but ti doesn't work,

View 4 Replies View Related

General :: How To Ls Files That Start With Numbers?

May 13, 2010

I want wondering if I can ls files that start with numbers only in a folder.

Suppose:
001.txt
302.txt

[code]....

View 6 Replies View Related

General :: What Command Run To Determine The IP Numbers?

Apr 20, 2011

Firstly I would like to say that Linux is very cool, especially the CLI. I have been trying to learn how to do some things in Fedora after being told Fedora was a good distro to get my feet wet. I have run into some issues and cant seem to find any answers. What Linux utility can be configured to automatically save the current logs?

How does your Fedora get an IP number? What IP numbers has your Fedora been assigned since it was installed (based on the logs you have)? What command did you run to determine the IP numbers? What command would you run to determine the number of times a user successfully used "su"? What command would you run to determine the number of times a user unsuccessfully used "su"? Having some issues with the file system as your Fedora boots up.

View 5 Replies View Related

General :: Show The Permissions With Numbers Instead Of With Letters?

Jun 3, 2010

Any way to show the permissions with numbers (777) instead of with letters (drwxrwxrwx) using "ls" command or any other command ?

View 2 Replies View Related

General :: Find Files In A Directory That Contain Numbers?

Mar 1, 2011

I am trying find files in a directory that contain numbers. I have tried ls /etc *[0-9]* but that doesn't work. If I cd to /etc and run ls *[0-9]* it almost works but it also includes results from within files. My last thought was to try: find /etc [0-9] -type f but this does not work either. My second problem is that I am trying to get list of files in a directory that were changed less than 10 hours ago, using grep, while leaving out directories. I am completely stuck with the second problem.

View 8 Replies View Related

General :: If ... Elseif ... Else BASH Ladder - Take In Two Numbers And Add Them

Nov 16, 2010

Our assignment is to take in two numbers and add them. While the inputs will always be numbers, we are to inform the user if they are doing it wrong. My code:

[Code]....

The code worked fine before I tried to idiot-proof it. I'll probably end up nesting the if statements checking if the first two inputs are not null, but I'm more annoyed at why the script isn't working.

View 3 Replies View Related

General :: Kernel Log Format - Numbers In Brackets?

Oct 6, 2009

In the file /var/log/kern.log, I see kernel logs in the following format,
Oct 6 11:18:30 machine kernel: [212.443755] Some logs...
What are the numbers in the bracket [212.443755] stands for?

View 2 Replies View Related

General :: Using Rpm Command To Count The Numbers Of License

Feb 27, 2010

I am a newbie in Linux. Here is my question....

Create the file ~/license_counts, which tables the number of occurrences of packages which are licensed under a given license, for the top 5 most commonly used licenses, sorted in numerically descending order. If performed correctly, your file should be formatted similarly to the following. (Do not be concerned if the actual counts or license names are different. Also, you might notice logically similar licenses, such as LGPL/GPL and GPL/LGPL. Do not make any attempt to combine them into a single entry.)

The resulted format:

I tried some method but cannot get it to work.

View 2 Replies View Related

General :: Listing Directory And Files' Permission Into Numbers?

Jul 20, 2010

Is it possible for listing directory and files' permission into numbers?

Generally ls command shows directory and files' permission as follows;

[root:maestro:/home/ddisk_net]# ls -al
Total 44
drwx------ 4 ddisk_net users 4096 7월 20 10:40 .
drwxr-xr-x 21 root root 4096 7월 20 10:28 ..
-rw------- 1 ddisk_net webteam 5 7월 20 10:40 .bash_history
-rw-r--r-- 1 ddisk_net users 33 1월 22 2009 .bash_logout

[code].....

View 9 Replies View Related

General :: Assign Port Numbers Against Interface (LAN Card)

Apr 22, 2010

I am using RHEL 5. In my Linux Box I have two Lan cards (eth0 and eth1). "eth0" is connected with network 192.168.10.0 and "eth1" is connected with network 192.168.11.0. Both Network are inter connected via routing. Now I want a situation where, I want to dedicatedly assign some port numbers against a lan card. Like eth0 will be assigned for ssh (22) and eth1 is assigned for telnet (23). So that, when a user connect to 22 port then he/she is connected to the server through eth0 , and when a user connect 23 port then he/she is connected to the server through eth1. Is it possible to do using iptables or other?

View 2 Replies View Related

General :: DU Style Directory Listing With File Numbers

Sep 6, 2010

Is there a command to return a recursive listing of sub-directories and the number of files in them? I have found plenty of ways to give me the total number of files in a directory structure, but none that gives a list of the sub-directories with the number of files in them. "du" gives me a listing of directories with their sizes, but I couldn't find an option (or any other way) to give me the number of files as well. Ideally, I'd like to get list with "Size" "Files" "Dir name" - And the order of the columns doesn't matter. Is there a "simple" command line solution or do I need a shell script for that?

View 5 Replies View Related

General :: Convert The Numbers Back Into Their Corresponding ASCII Character

May 19, 2010

To encrypt the text, we take the word "python" and make it at least the same size as "welcome home" by repeating it as follows:

w e l c o m e h o m e
p y t h o n p y t h o n
Then, we convert each letter into its numerical ASCII value as follows:
w e l c o m e h o m e = 119 101 108 099 111 109 101 032 104 111 109 101

[Code].....

And, finally, we convert the numbers back into their corresponding ASCII character:

View 11 Replies View Related

General :: Line Numbers To Html In Mixed Content?

Aug 21, 2010

I have huge files, wherein some lines begin with a number. I want to convert that number to a bookmark link

Sample file:

Code:

C.S. Lewis (I think) wrote:

1 If war is ever
2 legal, then peace
3 is sometimes
4 sinful.

Text without numbers toom I need the numbers to be <a name tags where the id is the letter x and the number that is at the beginning of the line:

Code:

C.S. Lewis (I think) wrote:
<a name="x1">1</a> If war is ever
<a name="x2">2</a> legal, then peace
<a name="x3">3</a> is sometimes
<a name="x4">4</a> sinful.

Text without numbers too I'm not sure why I can't get this, but after hours of 3 line long seds and endless while read lines, grepping ^[[:digits:]]s I can't figure it out.

View 3 Replies View Related

General :: Parsing Columns In Bash / Extract The First Set Of Numbers And Get Them To Appear Only Once?

Sep 28, 2009

as a result of a find command, i have

852065 72: /bin/gunzip
852065 72: /bin/gzip
852065 72: /bin/zcat

(the first column is inode number and the second is size if you're curious)

I want to be able to format it in a way such that:
852065 72:
/bin/gunzip
/bin/gzip
/bin/zcat

I know I can get the bottom half using awk- but I can't figure out how to extract the first set of numbers and get them to appear only once

View 9 Replies View Related

General :: Replace Sequential Numbers In A File With A Different Sequence Using Sed?

Apr 11, 2010

I am trying to find a way to replace a set of sequential numbers in a file with a different sequence using sed. This might be done easier using awk or some sort of bash script, but it seems to me there must be a way to do this easily with sed. Basically, what I am editing is a Cisco switch config. I want to change the sequence of ports to a different numbered sequence. Here is an example of what I am trying to do.I want to change for example, the file:

Code:
cat testfile
interface FastEthernet0/1

[code]...

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved