I found below script to check whether the variable is a digit in ksh.
############################
#!/bin/ksh
REPLY="3f"
if ]*\)'` != ${REPLY} && "${REPLY}" != "0" ]]
then
print "is digit\n"
else
print "not digit\n"
fi
############################
Although it works fine, but... (6 Replies)
Hi All,
How can i convert a number 24 to 0024
In the same way how can i convert 123 to 0123?
All this has to be done inside a script
Thanks in advance
JS (6 Replies)
I have a var storing date
var=`date`
Now the date is returned as
Mon Feb 2 00:25:48 PST 2009
Is there any way to check the date field alone ("2" in above case) and if its a single digit then add a prefix 0 to it and store the result in same variable "var"
My intention in above case is... (3 Replies)
Hi,
I have a text file with content as follows:
bla foo3200492
comment on this: 3900302
here comes the teddy 12
all I need is:
3200492
3900302
12
So I need the correct "sed" command to delete everything until the first number.
I am not a regex expert, because I have to... (3 Replies)
hi All,
i want to add the single digit front of the line in the report file and string compare with pattern file.
patter file: pattern1.txt
pattern num
like 4
love 3
john 2
report file: report.txt
i like very much
but john is good boy
i will love u
so after execute... (9 Replies)
Hi,
I am trying to create a csv from a existing flat file.I am using the same data to create the csv file. But I have issues \10 columns onwards..
sed... (5 Replies)
Hello!
My final exam in my Linux class is tomorrow, and I was just reviewing the grep and sed commands. I came across an example, by which I got stumped: it asks to provide a sed command that deletes all lines that contain exactly 3 to 5 digit strings, from a file.
In this case, I created a... (3 Replies)
Like I have below string
XX_49154534_491553_201_122023_D
XX_49159042_491738_201_103901_D
and the expected output would be
0154534
0159042
XX and 49 can be dynamic. (1 Reply)
Discussion started by: nadeemrafikhan
1 Replies
LEARN ABOUT REDHAT
iswdigit
ISWDIGIT(3) Linux Programmer's Manual ISWDIGIT(3)NAME
iswdigit - test for decimal digit wide character
SYNOPSIS
#include <wctype.h>
int iswdigit(wint_t wc);
DESCRIPTION
The iswdigit function is the wide-character equivalent of the isdigit function. It tests whether wc is a wide character belonging to the
wide character class "digit".
The wide character class "digit" is a subclass of the wide character class "xdigit", and therefore also a subclass of the wide character
class "alnum", of the wide character class "graph" and of the wide character class "print".
Being a subclass of the wide character class "print", the wide character class "digit" is disjoint from the wide character class "cntrl".
Being a subclass of the wide character class "graph", the wide character class "digit" is disjoint from the wide character class "space"
and its subclass "blank".
Being a subclass of the wide character class "alnum", the wide character class "digit" is disjoint from the wide character class "punct".
The wide character class "digit" is disjoint from the wide character class "alpha" and therefore also disjoint from its subclasses "lower",
"upper".
The wide character class "digit" always contains exactly the digits '0' to '9'.
RETURN VALUE
The iswdigit function returns non-zero if wc is a wide character belonging to the wide character class "digit". Otherwise it returns zero.
CONFORMING TO
ISO/ANSI C, UNIX98
SEE ALSO isdigit(3), iswctype(3)NOTES
The behaviour of iswdigit depends on the LC_CTYPE category of the current locale.
GNU 1999-07-25 ISWDIGIT(3)