03-07-2007
hello brother! can we use the * wildcard with if and if yes then how?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
With the if statement:
if
How can I make it so it accepts a wildcard after the ${CURR_DAY_MONTH} variable?
Putting
a -f /webtrends/SUN/mrw2/access.${CURR_DAY_DAY}${CURR_DAY_MONTH}*
won't work, right? I think I need some kind of special character so it knows the wildcard is... (3 Replies)
Discussion started by: LordJezo
3 Replies
2. Shell Programming and Scripting
Normally you would have something like..
if
then
foo bar
fi
but what if you wanted to do something like
if
then
foo bar
fi
How do I get Unix to accept anything that matches a pattern of FILENAME with anything after it during an in if statement? (3 Replies)
Discussion started by: LordJezo
3 Replies
3. UNIX for Dummies Questions & Answers
when writing a shell script (bourne) and using a unix command like 'ls' is there anything special you need to do to use a wildcard (like *)? (3 Replies)
Discussion started by: benu302000
3 Replies
4. UNIX for Dummies Questions & Answers
ok, I'm trying to write a script file that lists files with specific elements in the name into a txt file, it looks like this
ls s*.dat > file_names.txt
can't figure out whats wrong with that line, any ideas?
thanks in advance (10 Replies)
Discussion started by: benu302000
10 Replies
5. UNIX for Dummies Questions & Answers
Hi All
Please excuse another straightforward question. When creating a tar archive from a directory I am attempting to use wildcards to eliminate certain filetypes (otherwise the archive gets too large). So I am looking for something along these lines.
tar -cf archive.tar * <minus all *.rst... (5 Replies)
Discussion started by: C3000
5 Replies
6. Shell Programming and Scripting
Hello,
I would like to use a simple "if then" test to check if an argument to a command begins with "http://" as follows:
if http://* ]; then
command
fi
but the wildcard just seems to be ignored, ie., it will only execute the command if the expression is strictly "http://" with nothing... (0 Replies)
Discussion started by: Allasso
0 Replies
7. Shell Programming and Scripting
Hello,
I would like to use a simple "if then" test to check if an argument to a command begins with "http://" as follows:
if http://* ]]; then
command
fi
but the wildcard just seems to be ignored, ie., it will only execute the command if the expression is strictly "http://" with... (5 Replies)
Discussion started by: Allasso
5 Replies
8. Shell Programming and Scripting
hey guys, what i am doing is that i would like the program to check if there was anything inputted. If nothing is imputed, it is suppose to display a message.
echo -n "Enter Author:"
read Author
#echo -n "Enter Title:"
#read Title
if ] ; then
echo "you enter something"
else
echo... (9 Replies)
Discussion started by: gregarion
9 Replies
9. UNIX for Advanced & Expert Users
These 2 websites do a GREAT job of explaining different types of wildcards. I learned about the categories of characters which I never knew about at all.
GNU/Linux Command-Line Tools Guide - Wildcards
GREP (1 Reply)
Discussion started by: cokedude
1 Replies
10. Shell Programming and Scripting
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
LEARN ABOUT ULTRIX
xfreefontinfo
XListFonts(3X11) MIT X11R4 XListFonts(3X11)
Name
XListFonts, XFreeFontNames, XListFontsWithInfo, XFreeFontInfo - obtain or free font names and information
Syntax
char **XListFonts(display, pattern, maxnames, actual_count_return)
Display *display;
char *pattern;
int maxnames;
int *actual_count_return;
XFreeFontNames(list)
char *list[];
char **XListFontsWithInfo(display, pattern, maxnames, count_return, info_return)
Display *display;
char *pattern;
int maxnames;
int *count_return;
XFontStruct **info_return;
XFreeFontInfo(names, free_info, actual_count)
char **names;
XFontStruct *free_info;
int actual_count;
Arguments
actual_count
Specifies the actual number of matched font names returned by
actual_count_return
Returns the actual number of font names.
count_return
Returns the actual number of matched font names.
display Specifies the connection to the X server.
info_return
Returns a pointer to the font information.
free_info Specifies the pointer to the font information returned by
list Specifies the array of strings you want to free.
maxnames Specifies the maximum number of names to be returned.
names Specifies the list of font names returned by
pattern Specifies the null-terminated pattern string that can contain wildcard characters.
Description
The function returns an array of available font names (as controlled by the font search path; see that match the string you passed to the
pattern argument. The string should be ISO Latin-1; uppercase and lowercase do not matter. Each string is terminated by an ASCII null.
The pattern string can contain any characters, but each asterisk (*) is a wildcard for any number of characters, and each question mark (?)
is a wildcard for a single character. The client should call when finished with the result to free the memory.
The function frees the array and strings returned by or
The function returns a list of font names that match the specified pattern and their associated font information. The list of names is
limited to size specified by maxnames. The information returned for each font is identical to what would return except that the per-char-
acter metrics are not returned. The pattern string can contain any characters, but each asterisk (*) is a wildcard for any number of char-
acters, and each question mark (?) is a wildcard for a single character. To free the allocated name array, the client should call To free
the the font information array, the client should call
The function frees the the font information array. To free an structure without closing the font, call with the names argument specified
as NULL.
See Also
XLoadFont(3X11), XSetFontPath(3X11)
X Window System: The Complete Reference, Second Edition, Robert W. Scheifler and James Gettys
XListFonts(3X11)