Hello friends,
I am writing a simple shell script which will copy one particular type of files to backup folder if files exists. If files doesn't exists, mv command should not be executed.
My file pattern is like wcm-spider-maestro.log.2009-07-15, wcm-spider-maestro.log.2009-07-16 etc..
I... (6 Replies)
cp $PATHLOGS/$DATE/*.* $TMP/logs_tmp/
cp $PATHLOGS/$DATE1/*.* $TMP/logs_tmp/
Before copying the files I have to check if the directory $DATE1 and $DATE2 exists.
If directory exists then, check if the folder contains some files.
if the file exists then, check if the file size is greater... (3 Replies)
Hi,
I have two files say xxx.txt and yyy.txt. xxx.txt is with list of patterns within double quotes. Eg.
"this is the line1"
"this is the line2"
The yyy.txt with lot of lines. eg:
"This is a test message which contains rubbish information just to fill the page which is of no use. this is... (3 Replies)
I want to perform SQL *Loader operation only if a file named "load.txt" exists in a directory "/home/loc/etc". Please help how to check this with a if condition. (8 Replies)
Hi ! All
I just want to search and write to new file if pattern is found in text file
following are my text files by which I want to search Month and last column number
my text file1
15-Jan-2011 25 ARTS 1255 125 125 178 198
15-Jan-2011 25 ARTS 1255 125 125 178 198
15-Jan-2011 25... (3 Replies)
Hi Gurus,
I have a requests to find if all the file in the filelist exist in certain directory.
example:
my filelist
abc
def
ddd
cde
afg
how can I find these 5 files exists at director /home/abc
Thanks in advance (7 Replies)
Hi guys,
I am beginner trying to learn unix. So any help is welcomed.
My requirement is to check whether is a file exists in a particular directory or not.
The directory path and filename are taken dynamically with user interaction. So the program should continue only if the $filename... (1 Reply)
I have many files that can have various amounts of rows. I essentially want to output each row into a new file if a pattern is matched between two files.
I have some code that does something similar but I want it to output every single input row from every file into a separate output file; that... (5 Replies)
Hi experts,
I have two arrays one has the file paths to be searched in , and the other has the files to be serached.For eg
searchfile.dat will have
abc303
xyz123
i have to search for files that could be abc303*.dat or for that matter any extension . abc303*.dat.gz
The following code... (2 Replies)
There are some files with suffix dates like abc_20032019.dat abc_17032019.dat
If at least one file exists then perform some operation else exit from execution.
Korn shell
----------------------------------
array=($inputdir/abc*.dat)
If ] ]
then
echo " file exits"
else
echo " file does... (10 Replies)
Discussion started by: Rajesh123
10 Replies
LEARN ABOUT PHP
xslt_set_scheme_handlers
XSLT_SET_SCHEME_HANDLERS(3) 1 XSLT_SET_SCHEME_HANDLERS(3)xslt_set_scheme_handlers - Set the scheme handlers for theXSLTprocessorSYNOPSIS
void xslt_set_scheme_handlers (resource $xh, array $handlers)
DESCRIPTION
Registers the scheme handlers (XPath handlers) for the document.
PARAMETERS
o $
xh -The XSLT processor link identifier, created with xslt_create(3).
o $handlers
- An array with the following keys: "get_all", "open", "get", "put", and "close". Every entry must be a function name or an array
in the following format: array($obj, "method"). Note that the given array does not need to contain all of the different scheme
handler elements (although it can), but it only needs to conform to the "handler" => "function" format described above. Each of
the individual scheme handler functions called are in the formats below:
string get_all(resource processor, string scheme, string rest)
resource open(resource processor, string scheme, string rest)
int get(resource processor, resource fp, string &data)
int put(resource processor, resource fp, string data)
void close(resource processor, resource fp)
RETURN VALUES
No value is returned.
EXAMPLES
Example #1
xslt_set_scheme_handlers(3) example
For example, here is an implementation of the "file_exists()" PHP function.
<?php
// Definition of the handler
function mySchemeHandler($processor, $scheme, $rest)
{
$rest = substr($rest,1); // to remove the first / automatically added by the engine
if ($scheme == 'file_exists') {
// result is embedded in a small xml string
return '<?xml version="1.0" encoding="UTF-8"?><root>' . (file_exists($rest) ? 'true' : 'false') . '</root>';
}
}
$SchemeHandlerArray = array('get_all' => 'mySchemeHandler');
// Start the engine
$params = array();
$xh = xslt_create();
xslt_set_scheme_handlers($xh, $SchemeHandlerArray);
$result = xslt_process($xh, "myFile.xml", "myFile.xsl", NULL, array(), $params);
xslt_free($xh);
echo $result;
?>
Then, inside the stylesheet, you can test whether a certain file exists with:
<xsl:if test="document('file_exists:anotherXMLfile.xml')/root='true'">
<!-- The file exist -->
</xsl:if>
SEE ALSO xslt_set_scheme_handler(3).
PHP Documentation Group XSLT_SET_SCHEME_HANDLERS(3)