Or use equality (==) instead of pattern matching (~). The ~ operator will match the pattern anywhere in the field.
aju_kup's solution to use a better pattern is of course a perfectly good solution as well; just pointing out an alternative which may be more convenient in some situations.
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)
Folks,
Is there a simple way to replace one digit by two digit using sed.
Example,
mydigit1918_2006_8_8_lag1.csv should be
mydigit1918_2006_08_08_lag01.csv.
I tried this way, but doesn't work.
echo mydigit1989_2006_8_8_lag1.csv|sed 's/]/0]/'
Thank you, (5 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)
I have to write a c program which takes a 3 digit number n and calculates the value of (2^n)+1 and then determines the number is prime or not.
I have tried to first calculate the value of 2^n and then adding one to it and then apply the logic of prime number.
but the ultimate problem is that... (7 Replies)
Hi,
Does anybody know what the below means:
I have a program containing the following and am trying to understand what it does:
temp=$(echo $count2 | tr -cd )
Cheers
Paul
Please start using code tags (2 Replies)
Hi all,
Need your help here. I have a file with thousand of lines, as shown in example below
KDKJAA 98324
OIDSAJ 324
KJAJAK 100
KJKAJK 89
JOIJOI 21
JDKDJL 12
UOIUOD 10
UDUYDS 8
UIUHKK 6
I would like to grep using... (5 Replies)
Thanks of your suggestions i was able to calculate the delta between some numbers in a column file with .
awk 'BEGIN{last=0}{delta=$1-last; last=$1; print $0" "delta}'
the file was like
499849120.00
500201312.00
500352416.00
500402784.00
500150944.00
499849120.00
500150944.00... (3 Replies)
Discussion started by: Board27
3 Replies
LEARN ABOUT POSIX
fc-match
FC-MATCH(1)FC-MATCH(1)NAME
fc-match - match available fonts
SYNOPSIS
fc-match [ -asvVh ] [ --all ] [ --sort ] [ --verbose ] [ [ -f format ] [ --format format ] ] [ --version ] [ --help ]
[ pattern [ element... ] ]
DESCRIPTION
fc-match matches pattern (empty pattern by default) using the normal fontconfig matching rules to find the best font available. If --sort
is given, the sorted list of best matching fonts is displayed. The --all option works like --sort except that no pruning is done on the
list of fonts.
If any elements are specified, only those are printed. Otherwise short file name, family, and style are printed, unless verbose output is
requested.
OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included
below.
-a Displays sorted list of best matching fonts, but do not do any pruning on the list.
-s Displays sorted list of best matching fonts.
-v Print verbose output of the whole font pattern for each match, or elements if any is provided.
-f Format output according to the format specifier format.
-V Show version of the program and exit.
-h Show summary of options.
pattern
Displays fonts matching pattern (uses empty pattern by default).
element
If set, the element property is displayed for matching fonts.
SEE ALSO fc-list(1)FcFontMatch(3)FcFontSort(3)FcPatternFormat(3)fc-cat(1)fc-cache(1)fc-pattern(1)fc-query(1)fc-scan(1)
The fontconfig user's guide, in HTML format: /usr/share/doc/fontconfig/fontconfig-user.html.
AUTHOR
This manual page was updated by Patrick Lam <plam@csail.mit.edu>.
Aug 13, 2008 FC-MATCH(1)