Sponsored Content
Full Discussion: Matching a decimal number?
Top Forums Shell Programming and Scripting Matching a decimal number? Post 302674435 by lucshi09 on Thursday 19th of July 2012 03:56:01 PM
Old 07-19-2012
that's great! However, is there any way to do this using awk/gawk instead?

Thanks
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Test decimal number

Hi, I would like test if a number is a decimal number or not (9 Replies)
Discussion started by: francis_tom
9 Replies

2. Shell Programming and Scripting

Add zero in decimal number

echo "scale=2; 282.73/640" | bc This will print .44 How to make the variable as 0.44 (2 Replies)
Discussion started by: sandy1028
2 Replies

3. Shell Programming and Scripting

Hex to decimal - Execute command for the matching part

Alo I have this input: 0x10=some text 0x20=some text 0x30=some text and want this output: 16=some text 32=some text 48=some text I want to use a command to convert from hex to decimal i.e.: $ echo $((0x15a)) or $ printf '%d\n' 0x15a I try to use something like this: sed... (5 Replies)
Discussion started by: chitech
5 Replies

4. UNIX for Dummies Questions & Answers

check if a decimal number is greater than zero

Hello, In my code I am checking to see if a variable that contains a decimal number is greater than 0 in the following manner: if do something fi However I am getting the error message (if $i for the current iteration holds 9.6352) command 9.6352 is not found How can I rectify... (5 Replies)
Discussion started by: Gussifinknottle
5 Replies

5. Shell Programming and Scripting

number of digits after decimal

Hi All, I have a file of decimal numbers, cat file1.txt 1.1382666907 1.2603107334 1.6118799297 24.4995857056 494.7632588468 560.7633734425 ..... I want to see the output as only 7 digits after decimal (5 Replies)
Discussion started by: senayasma
5 Replies

6. Shell Programming and Scripting

Decimal number calculation problem

I have a below snippet of code from my perl script and its causing a problem when the output of $lTAX is 0 (zero) its getting displayed as -0.00. I want output to be 0 not -0.00. Any help would be appreciated. #!/usr/bin/perl my $lTotA = 50.94; my $lVatA = 8.49; my $lAllocD; my $lAdjNr =... (4 Replies)
Discussion started by: Devesh5683
4 Replies

7. Shell Programming and Scripting

Sort Decimal number in UNIX

Hello Everyone, In one of my script, I would like to sort the decimal numbers. For e.g. If I have numbers like 1.0 1.1 1.2 2.0 2.1 3.0 4.0 5.0 6.0 7.0 7.1 7.10 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 I would like to sort them 1.0 1.1 1.2 2.0 2.1 3.0 4.0 5.0 6.0 7.0 7.1 7.2 7.3 7.4... (3 Replies)
Discussion started by: sachinrastogi
3 Replies

8. Shell Programming and Scripting

awk decimal point numbers matching

Hi All, Can some one help me in identifying the significance of character "$" ,Which is playing critical role in matching decimal point numbers as below. $ echo "01#.01"|awk '{if ($0 ~ /^+(\.*)?$/) print}' $ echo "01#.01"|awk '{if ($0 ~ /^+(\.*)?/) print}' 01#.01 $ Regards, Rmkganesh. (3 Replies)
Discussion started by: rmkganesh
3 Replies

9. Shell Programming and Scripting

Zero padding a Number before and after a decimal place

Hi I was hoping someone could help me with a sed script I am trying to write? I am on a Mac running ElCapitan I have some text that I have converted from a pdf that I want to format into an xml file. In the file I have managed to delete all the text I do not need. The text I have left is... (8 Replies)
Discussion started by: Paul Walker
8 Replies
gt5(1)							      General Commands Manual							    gt5(1)

NAME
gt5 - a diff-capable 'du-browser' SYNOPSIS
gt5 [ dir | file | dir file | file file2 ] [options] DESCRIPTION
gt5 reads the output of du, compares it with a du-log saved by the last run, converts it into HTML and opens the resulting file with a textbrowser. If files are given on the commandline they are expected to be (optionally gzip/bzip2-compressed) logfiles of du -akx /some/dir. It is up to you to take care that the given directories/files represent the same directory. gt5 will show lots of new files if you don't. ;-) OPTIONS
--cut-at float Files and directories that are below float percent of their parents are not shown. Default is 0.1, gt5 will accept values between 0.01 and 30. --debug Turn on debug. Generate HTML files and do not run browser. --diff-dir directory Use directory instead of ~/.gt5-diffs/ to read/store du-logs. This switch is ignored if gt5 is only used with files. --discard Do not save the current state, in other words: be able to diff against the old state again. This feature is disabled if gt5 is only used with files. --help Display brief help. --link-files Also insert links to files to access them from within gt5. This can be very handy if your browser is configured to handle the files MIME-type correctly. This feature is disabled if gt5 is only used with files. --max-depth int Do not show anything below a depth of int directories. Default is 5 (also see BUGS below). --max-lines int Only consider the int biggest files and directories within the output of du. --no-diffs Use this if you are not interested in the history of the directories processed, for example in /tmp. --save-as file DEPRECATED, use du -akx or du -ak (see --with-mounts), save the output to a file and run gt5 against one (ore two) of these files later. --save-state Force saving current state, overwriting a previous --discard. (Some people seem to have gt5 aliased to 'gt5 --discard'.) --verbose Display messages. --with-mounts By default gt5 calls du with -akx to ignore mounted filesystems. Use this to inspect mounted partitions too, i.e. call du with -ak HELPERS
If gawk or a textbrowser are missing and you want to install them into ~/bin (or /usr/local/bin if you have write access there), gt5 comes with the following helpers: --get-gawk Download, compile and install a copy of gawk. --get-links Download, compile and install a copy of links. --get-links2 Download, compile and install a copy of links2. --get-elinks Download, compile and install a copy of elinks. TEXTBROWSERS
It is recommended to use links with gt5. Other textbrowsers are also possible but there are several good reasons why links is given prior- ity over the others: elinks: links is much faster on startup/exit lynx: does not honor a documents coloring netrik: no colors, unfavourable cursor navigation retawq: no colors, can't handle <a name>-tags w3m: Version 0.5.2 and later are known to work. Older versions experienced unfavourable handling of <a name>-tag, unfavourable cursor navigation and no colors Only links/links2, elinks and lynx are now considered usable (and also chosen in that order). See ENVIRONMENT/GT5_BROWSER below. FILES
~/.gt5.html contains a copy of the last run ~/.gt5-diffs/ compressed du-logs are stored here ENVIRONMENT
GT5_BROWSER force using a (specific) textbrowser GT5_CHARSET force using a (specific) charset for HTML header instead of using $LANG GT5_DEBUG_DIR Directory where to write gt5.debug* data if --debug option is set. BUGS
Directories at depth max-depth are not browsable and so look like files. AUTHOR
Thomas Sattler <gt5 at gmx dot net> SEE ALSO
du(1), links(1), elinks(1), lynx(1) gt5 v1.4.0.1 July 2009 gt5(1)
All times are GMT -4. The time now is 03:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy