Sponsored Content
Full Discussion: Getting File Name
Top Forums Programming Getting File Name Post 42265 by Perderabo on Friday 24th of October 2003 09:29:16 PM
Old 10-24-2003
It's not the temp file that bothers me. It's the extra processes. First you launch a shell. It reads a command line. It launches a pair of processes. Then you read the temp file.

Now compare that to just reading the directory.

And popen() is not much better.
 

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Match list of strings in File A and compare with File B, C and write to a output file in CSV format

Hi Friends, I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving... File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Discussion started by: asnandhakumar
6 Replies

2. Shell Programming and Scripting

Compare 2 text file with 1 column in each file and write mismatch data to 3rd file

Hi, I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file. File1 - file2 = file3 wc -l file1.txt 58112 wc -l file2.txt 55260 head -5 file1.txt 101214200123 101214700300 101250030067 101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies

3. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies
File::Spec::OS2(3pm)					 Perl Programmers Reference Guide				      File::Spec::OS2(3pm)

       canonpath
	      No physical check on the filesystem, but a logical cleanup of a path. On UNIX eliminated successive slashes and successive "/.".

       splitpath
		  ($volume,$directories,$file) = File::Spec->splitpath( $path );
		  ($volume,$directories,$file) = File::Spec->splitpath( $path, $no_file );

       Splits a path in to volume, directory, and filename portions. Assumes that the last file is a path unless the path ends in '/', '/.', '/..'
       or $no_file is true.  On Win32 this means that $no_file true makes this return ( $volume, $path, undef ).

       Separators accepted are  and /.

       Volumes can be drive letters or UNC sharenames (\servershare).

       The results can be passed to "catpath" to get back a path equivalent to (usually identical to) the original path.

       splitdir
	      The opposite of catdir().

	   @dirs = File::Spec->splitdir( $directories );

       $directories must be only the directory portion of the path on systems that have the concept of a volume or that have path syntax that dif-
       ferentiates files from directories.

       Unlike just splitting the directories on the separator, leading empty and trailing directory entries can be returned, because these are
       significant on some OSs. So,

	   File::Spec->splitdir( "/a/b//c/" );

       Yields:

	   ( '', 'a', 'b', '', 'c', '' )

       catpath
	      Takes volume, directory and file portions and returns an entire path. Under Unix, $volume is ignored, and this is just like cat-
	      file(). On other OSs, the $volume become significant.

NAME
File::Spec::OS2 - methods for OS/2 file specs SYNOPSIS
require File::Spec::OS2; # Done internally by File::Spec if needed DESCRIPTION
See File::Spec::Unix for a documentation of the methods provided there. This package overrides the implementation of these methods, not the semantics. perl v5.8.0 2002-06-01 File::Spec::OS2(3pm)
All times are GMT -4. The time now is 02:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy