10-11-2005
No I cannt remove the duplicate entries from the list which have the same path. Because I dont know to remove which entry. Bcoz according to this entry some manipulation are being done. ok I am attatching the out put here:
For the satement (1) .......
test.xml test1.xml sample.xml tst2.xml test3.xml mvtest.xml mvtest.xml neha.xml
for the satement (2)..........
/backup/surjya/mdbase/test.xml
/backup/surjya/mdbase/test1.xml
/backup/surjya/test/sample.xml
/backup/surjya/test/tst2.xml
/backup/surjya/test/test3.xml
/backup/surjya/mvfile/mvtest.xml
/backup/surjya/test/mvtest.xml
/backup/surjya/mvfile/mvtest.xml
/backup/surjya/test/mvtest.xml
/backup/surjya/mvfile/neha.xml
The above output shows that it has 10 entries where as it should have 8 entries. At this stage we dont know which entry shoulsd be removed.
So please tell me is there any other way to find the sorted file list with full path accros the directories.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
What is the smartest way to just extract file name from a full path name.
e.g. if I have
/usr/sanjay/bin/file_name.c
I want only file_name.c
Sanjay (2 Replies)
Discussion started by: sanjay92
2 Replies
2. UNIX for Advanced & Expert Users
hi guys
i give "ps -ef | grep some_executable_file" on the command line.
this "some_executable_file" resides on many paths which r included in the PATH environment variable, so the output depicts only "some_executable_file" in the COMMAND column. how can i get the full path?
thanx (3 Replies)
Discussion started by: xtrix
3 Replies
3. UNIX for Advanced & Expert Users
How can i list every single file on a sun solaris server running 2.8 starting from '/' with the full path included in it?
example.
/
...
...
...
/etc/inetd.conf
/etc/passwd
/etc/shadow
...
...
...
/var/adm/messages
/var/adm/messages.0
/var/adm/messages.1
...
...
...... (4 Replies)
Discussion started by: Sowser
4 Replies
4. Shell Programming and Scripting
This has been bugging me for a while. How can i list file to show full path.
/directory/test
$ ls file.tst
file.tst
$
desired output:
/directory/test/file.tst (2 Replies)
Discussion started by: ryandegreat25
2 Replies
5. Shell Programming and Scripting
Hi,
I have a file abcd.txt which has contents in the form of full path file names i.e.
$home> vi abcd.txt
/a/b/c/r1.txt
/q/w/e/r2.txt
/z/x/c/r3.txt
Now I want to retrieve only the directory path name for each row
i.e
/a/b/c/
/q/w/e/
How to get the same through shell script?... (7 Replies)
Discussion started by: royzlife
7 Replies
6. Shell Programming and Scripting
Iam trying to load the full path of multiplie files in the same directory to an array if the filenames matches a pattern. The following is the current code;
where $input=C:\test
# change to and open the comparison directory
chdir("$input2") || die "Cannot change dir: $!";
opendir(DIR2,... (2 Replies)
Discussion started by: cold_Que
2 Replies
7. Shell Programming and Scripting
/Path/snowbird9/nrfCompMgrRave1230100920.log.gz:09/20/2010 06:14:51 ERROR Error Message.
/Path/snowbird6/nrfCompMgrRave1220100920.log.gz:09/20/2010 06:14:51 ERROR Error Message.
/Path/snowbird14/nrfCompMgrRave920100920.log.gz:09/20/2010 06:14:51 ERROR Error Message.... (0 Replies)
Discussion started by: Shirisha
0 Replies
8. Shell Programming and Scripting
Hi,
I would like to know how to grep all the paths in a file having extension .BMP
For e.g.
File Name :
sample.txt
File Content :
xxxxxxxxxxxxxxxxx
xxxxx/root/cdrive/picure.BMP xxxx
xxxxxxxxxxx
xxxxx/root/ddrive/picure.BMP xxxx
xxxxxxxxxxx
Expected Output : ... (4 Replies)
Discussion started by: vdivb
4 Replies
9. Linux
Hi
I have a requirement like this:
/abc/a/x.txt
/abc/a/y.txt
/abc/b/x.gz
/abc/b/y.txt
I need output like this:
/abc/a:*.txt
/abc/b:*.txt
/abc/b:*.gz
I have tried find /abc -type f -name "*.*" ||awk -F . '{print $NF}' it is print only extensions without path name.
Please... (5 Replies)
Discussion started by: lijjumathew
5 Replies
10. Shell Programming and Scripting
Hi,
I need to do find and replace, but the pattern is not full known.
for example,
my file has /proj/app-d1/sun or /data/site-d1/conf
here app-d1 and site-d1 is not constant. It may be different in different files. common part is /proj/xx/sun and /data/xxx/conf
i want to find where ever... (6 Replies)
Discussion started by: rbalaj16
6 Replies
OPENDIR(3) 1 OPENDIR(3)
opendir - Open directory handle
SYNOPSIS
resource opendir (string $path, [resource $context])
DESCRIPTION
Opens up a directory handle to be used in subsequent closedir(3), readdir(3), and rewinddir(3) calls.
PARAMETERS
o $path
- The directory path that is to be opened
o $context
- For a description of the $context parameter, refer to the streams section of the manual.
RETURN VALUES
Returns a directory handle resource on success, or FALSE on failure.
If $path is not a valid directory or the directory can not be opened due to permission restrictions or filesystem errors, opendir(3)
returns FALSE and generates a PHP error of level E_WARNING. You can suppress the error output of opendir(3) by prepending '@' to the front
of the function name.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.0.0 | |
| | |
| | $path supports the ftp:// URL wrapper. |
| | |
| 4.3.0 | |
| | |
| | $path can also be any URL which supports direc- |
| | tory listing, however only the file:// URL wrap- |
| | per supports this in PHP 4 |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
opendir(3) example
<?php
$dir = "/etc/php5/";
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo "filename: $file : filetype: " . filetype($dir . $file) . "
";
}
closedir($dh);
}
}
?>
The above example will output something similar to:
filename: . : filetype: dir
filename: .. : filetype: dir
filename: apache : filetype: dir
filename: cgi : filetype: dir
filename: cli : filetype: dir
SEE ALSO
is_dir(3), readdir(3), dir(3).
PHP Documentation Group OPENDIR(3)