Hi,
I need some assistance with comparing 2 diff application. The format of the first file is in TAR "filename.1.2.3.tar" . The second file is a running application for which i need to find the version and then prompt the user for action as below :-
Once compared, It needs to prompt the user,... (0 Replies)
What one finds challenging another finds simple...
(HPUX B.11.11)
I have a text file named something like 12345.dst that could look like this:
DOG
CAT
NONE
TEST
CAT
What I want to end up with is 12345.dst looking like this:
CAT
DOG
TEST
removing "NONE" should it be there and... (1 Reply)
Hello,
I have a script that monitors files uploaded via ftp. After a successful upload, the file name is written to the pipe.
There is another program that reads this pipe and allows automatically run any program or script ( say test.sh ) to process the newly uploaded file.
cat test.sh... (2 Replies)
This is my task - pls help
Write a script that will run every 5 min and check if a particular file has appeared in a particular directory. Once it appears then rename the file and move it a bkp directory and run another script. (3 Replies)
shell: #!/bin/ash
I searched and found a few relevant posts (here and here - both by porter, on the same day (?)) however both are just a do while loop, I need to check a file date and compare it to the current time.
I would like it to say if file 'test' is more than 12 hours old than "right... (3 Replies)
hi,
i have a service on unix platform, it will generate traces in a particular folder
i want to check using shell script if traces exist, then perform some action else continue to be in loop.
filename is service.tra
can you please help?
thanks (4 Replies)
Hi,
Is the below possible (SHELL = tcsh)?
-- I want to write an 'alias' something like this -
alias set_my_work "setenv SOME_VAR;tcsh -i;source work_script.cshrc"
The intention is to run this alias and enter a child shell, at the same time ensuring that the work_script.cshrc is source-ed.... (0 Replies)
Dear All,
this is my first post on this Forum, glad to be here.
I'm trying to fix an .ods file. Yes, I had a backup, but it's also corrupted.
When opening the document I get this EM:
read error
format error discovered in the file in sub-document content.xml at
2,337040(row,col).
So I... (3 Replies)
Hi friends,
In my shell script, I want to open a file using vi editor. After opening the file in vi, I want to save and quit this file automatically.... all through shell script.
the code segment is:
------------------------------------------------------------
cd ~/netfpga/projects/scone/sw/... (2 Replies)
Have some files in /tmp/dir
abc.zip
123.zip
345.zip
and if name matches to 345.zip then take action
My code....
am i doing something wrong ? Please advise.
#!/bin/bash
set -x
cd /tmp/dir
for i in *.*
do
if ]
then (4 Replies)
Discussion started by: abhaydas
4 Replies
LEARN ABOUT PHP
readdir
READDIR(3) 1 READDIR(3)readdir - Read entry from directory handleSYNOPSIS
string readdir ([resource $dir_handle])
DESCRIPTION
Returns the name of the next entry in the directory. The entries are returned in the order in which they are stored by the filesystem.
PARAMETERS
o $dir_handle
- The directory handle resource previously opened with opendir(3). If the directory handle is not specified, the last link opened
by opendir(3) is assumed.
RETURN VALUES
Returns the entry name on success or FALSE on failure.
Warning
This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on
Booleans for more information. Use the === operator for testing the return value of this function.
EXAMPLES
Example #1
List all entries in a directory
Please note the fashion in which readdir(3)'s return value is checked in the examples below. We are explicitly testing whether the
return value is identical to (equal to and of the same type as--see Comparison Operators for more information) FALSE since other-
wise, any directory entry whose name evaluates to FALSE will stop the loop (e.g. a directory named "0").
<?php
if ($handle = opendir('/path/to/files')) {
echo "Directory handle: $handle
";
echo "Entries:
";
/* This is the correct way to loop over the directory. */
while (false !== ($entry = readdir($handle))) {
echo "$entry
";
}
/* This is the WRONG way to loop over the directory. */
while ($entry = readdir($handle)) {
echo "$entry
";
}
closedir($handle);
}
?>
Example #2
List all entries in the current directory and strip out . and ..
<?php
if ($handle = opendir('.')) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
echo "$entry
";
}
}
closedir($handle);
}
?>
SEE ALSO is_dir(3), glob(3), opendir(3), scandir(3).
PHP Documentation Group READDIR(3)