Interesting. Of the four answers given, three assumed he wants to loop through the files with that extension.
But he only said he needs to check if the extension exists in the directory or not. That shouldn't require a loop.
you used ls, which is the same as "looping through the files", except that ls "abstracted" the process for you.
with the shell, if he knows what extension he is searching for.
or another way
Hi,
I am newbie in UNIX so please excuse for my questions.
Is there a a way to search for string in files within folder and sub folder in particluar file extensions.
Ex. search for ABC in folder 'A'(including it's sub folders) in html, xml files.
Thanks,
Ani (2 Replies)
Hi need to know if we can write a shell script to find files for a particular format;s ie both .csv and .txt in a particular folder and then copy them to a new folder on a dialy basis. Does anyone know how this can be accomplished?
Thanks,
Sandeep (20 Replies)
Greetings to All ... :b:
I have one root folder containing different other folders within it.
I need to get the list of all different types of file extensions residing in those folders.
Could anyone help me providing some shell script? (1 Reply)
Greetings to all!!:b:
I have one root folder containing several other folders inside it. This tree structure is deep. And the files are of similar extension.
I need to start at the top level and recursively search and rename all the files with say .a extension to .b .
This is the code to... (7 Replies)
unix program to which a directory name will be passed as
parameter. This directory will contain files with various
extensions. This script will create directories with the names of the
extention of the files and then put the files in the
corresponding folder. All files which do not have any... (2 Replies)
I have a file
n06-z30-sr65-rgdt0p25-varp0.25-8x6drw-test.cmod
and I want to get the extension.
At the moment I have
set filextension = `echo $f | awk 'BEGIN {FS="."} {print $2}'`
which of course does not work as there is a point in varp0.25 (13 Replies)
Hi All,
I want to fetch the files based on .done file and display the .csv files and Wil take .csv files for processing.
1.I need to display the .done files from the directory.
2.next i need to search for the .Csv files based on .done file.then move .csv files for the one directory
... (2 Replies)
I'm afraid this is a silly question but I can't figure it out.
I have a script like so...
echo "Enter DRDL Signature Version Number"
read DRDL_Number
mv signature_output.csv SERVICE_OBJECTS_S-$DRDL_Number.csv
The resultant filename does not contain the .csv as follows.... (3 Replies)
I have a specific set (all ending with .bam) of downloaded files in a directory /home/cmccabe/Desktop/NGS/API/2-15-2016. What I am trying to do is use a match to $2 in name to rename the downloaded files. To make things a more involved the date of the folder is unique and in the header of name... (1 Reply)
Discussion started by: cmccabe
1 Replies
LEARN ABOUT CENTOS
xkbqueryextension
XkbQueryExtension(3) XKB FUNCTIONS XkbQueryExtension(3)NAME
XkbQueryExtension - Determines the compatibility of a library at runtime.
SYNOPSIS
Bool XkbQueryExtension (Display *dpy, int *opcode_rtrn, int *event_rtrn, int *error_rtrn, int *major_in_out, int *minor_in_out);
ARGUMENTS
dpy connection to the X server
opcode_rtrn
backfilled with the major extension opcode
event_rtrn
backfilled with the extension base event code
error_rtrn
backfilled with the extension base error code
major_in_out
compile time lib major version in, server major version out
minor_in_out
compile time lib min version in, server minor version out
DESCRIPTION
Call XkbQueryExtension to check for the presence and compatibility of the extension in the server and to initialize the extension. Because
of potential version mismatches, you cannot use the generic extension mechanism functions ( XQueryExtension and XInitExtension ) for check-
ing for the presence of, and initializing the Xkb extension.
You must call XkbQueryExtension or XkbOpenDisplay before using any other Xkb library interfaces, unless such usage is explicitly allowed in
the interface description in this document. The exceptions are: XkbIgnoreExtension, XkbLibraryVersion, and a handful of audible-bell func-
tions. You should not use any other Xkb functions if the extension is not present or is uninitialized. In general, calls to Xkb library
functions made prior to initializing the Xkb extension cause BadAccess protocol errors.
XkbQueryExtension both determines whether a compatible Xkb extension is present in the X server and initializes the extension when it is
present.
The XkbQueryExtension function determines whether a compatible version of the X Keyboard Extension is present in the server. If a compati-
ble extension is present, XkbQueryExtension returns True; otherwise, it returns False.
If a compatible version of Xkb is present, XkbQueryExtension initializes the extension. It backfills the major opcode for the keyboard
extension in opcode_rtrn, the base event code in event_rtrn, the base error code in error_rtrn, and the major and minor version numbers of
the extension in major_in_out and minor_in_out. The major opcode is reported in the req_major fields of some Xkb events. For a discussion
of the base event code.
RETURN VALUES
True The XkbQueryExtension function returns True if it determines a compatible version of the X Keyboard Extension is present in
the server.
False The XkbQueryExtension function returns False if it determines a compatible version of the X Keyboard Extension is not
present in the server.
SEE ALSO XkbIgnoreExtension(3), XkbLibraryVersion(3), XkbOpenDisplay(3)X Version 11 libX11 1.6.0 XkbQueryExtension(3)