hi all,
i'm very new to scripting and have the folllowing issue. I have used a few commands to get a list of numbers, but I need to strip away the non-numeric ones, and then need a total of all values. any ideas?
root@unixserver # cat myfile | awk '{print $8}'| sort -rn
1504
1344
896
704... (2 Replies)
I am getting back on the C++ programming after many years away. I recently received an SDK that has code like this where numeric values end in 'U'. What does this mean?
if ((ptr % 16U) == 0U)
return buffer; (3 Replies)
How to check if the file contains only numeric values.
I don't want to read entire file it eats lot of cpu
Or any way which consumes less memory n cpu..
Please suggest
-S (2 Replies)
hi
i have two types of file
1. temp.0000000001.data (10 digit numeric)
2. temp.000000001.data (9 digit numeric)
i want to search a file which is having 10 digit numeric in between the file name.
i use command like this..
ls | grep temp.^*.data
but this will give both the files as... (2 Replies)
Hey guys & gals,
I am hoping for some advice on a sed or awk command that will
allow to only print lines from a file that contain 3 numeric values.
From previous searches here I saw that ygemici used the sed command
to remove lines containing more than 3 numeric values ;
however how... (3 Replies)
Hi All ,
I have a small code that checks pattern of digits entered in unix mode .
$ echo 201202 | wc -c
7 /* output*/
When i run same command in AIX 5.1 , i am getting output with some initial blanks
$ echo 201202 | wc -c
7 ... (4 Replies)
I have a code like this
v_num=9
comp_num=39
if
then
echo "pass"
fi
echo "end"
I am getting an error
ksh: v_num=99
comp_num=39
if
then
echo "pass"
fi
echo "end" (3 Replies)
From googling and reading man pages I figured out this sorts the first column by numeric values.
sort -g -k 1,1
Why does the -n option not work? The man pages were a bit confusing.
And what if I want to sort the second column numerically? I haven't been able to figure that out. The file... (7 Replies)
Hi All,
I am trying to replace a certain value from one place in a file . In the below file at position 35 I will have 8 I need to modify all 8 in that position to 7
I tried
awk '{gsub("8","7",$35)}1' infile > outfile ----> not working
sed -i 's/8/7'g' infile --- it is replacing all... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies
LEARN ABOUT DEBIAN
colorreset
COLORS(3) libbash colors Library Manual COLORS(3)NAME
colors -- libbash library for setting tty colors.
SYNOPSIS
colorSet <color>
colorReset
colorPrint [<indent>] <color> <text>
colorPrintN [<indent>] <color> <text>
DESCRIPTION
General
colors is a collection of functions that make it very easy to put colored text on tty.
The function list:
colorSet Sets the color of the prints to the tty to COLOR
colorReset Resets current tty color back to normal
colorPrint Prints TEXT in the color COLOR indented by INDENT (without adding a newline)
colorPrintN The same as colorPrint, but trailing newline is added
Detailed interface description follows.
Available colors:
Green
Red
Yellow
White
The color parameter is non-case-sensitive (i.e. RED, red, ReD, and all the other forms are valid and are the same as Red).
FUNCTIONS DESCRIPTIONS
colorSet <color>
Sets the current printing color to color.
colorReset
Resets current tty color back to normal.
colorPrint [<indent>] <color>
Prints text using the color color indented by indent (without adding a newline).
Parameters:
<indent>
The column to move to before start printing. This parameter is optional. If ommitted - start output from current cursor position.
<color>
The color to use.
<color>
The text to print.
colorPrintN [<indent>] <color>
The same as colorPrint, except a trailing newline is added.
EXAMPLES
Printing a green 'Hello World' with a newline:
Using colorSet:
$ colorSet green
$ echo 'Hello World'
$ colorReset
Using colorPrint:
$ colorPrint 'Hello World'; echo
Using colorPrintN:
$ colorPrintN 'Hello World'
AUTHORS
Hai Zaar <haizaar@haizaar.com>
Gil Ran <gil@ran4.net>
SEE ALSO ldbash(1), libbash(1)Linux Epoch Linux