Sponsored Content
Full Discussion: spaces in filenames, for do
Top Forums Shell Programming and Scripting spaces in filenames, for do Post 302141085 by porter on Wednesday 17th of October 2007 04:10:12 PM
Old 10-17-2007
Code:
while read N
do
     cp "$N" "$dest_dir"
done <filenames.txt

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

spaces in filenames

I have a problem with the script below #!/bin/sh for vo in `find -maxdepth 1 -type f -regex "^\./*$"` do ls -l "$vo" some other commands done It works fine until `find ...` returns files with spaces. I've tryed to change IFS but haven't succeed Any solutions? (4 Replies)
Discussion started by: Hitori
4 Replies

2. Shell Programming and Scripting

how to handle spaces in filenames

I'm trying to do something like that: for $filename in `ls -1` do some_command $filename done but it doesn't work properly for file names with spaces, for...in splits at spaces. Anyway around? (4 Replies)
Discussion started by: rayne
4 Replies

3. Shell Programming and Scripting

Unix filenames and spaces

I have files on my unix boxes that users have created with spaces. Example: /tmp/project plan ls -l "/tmp/project plan" works fine. $/tmp>ls -l "/tmp/project plan" -rw-r--r-- 1 root other 0 Jan 31 12:32 /tmp/project plan I created a file called test and put just the... (2 Replies)
Discussion started by: x96riley3
2 Replies

4. Shell Programming and Scripting

spaces in filenames

Hi I hope someone will be able to resolve this little teaser! I am running a script for file in `ls directory` do echo "$file" ...other code here.... done this works fine unless we receive a file with a name which has a space in it ie "filena me" (I know its not good... (8 Replies)
Discussion started by: Bab00shka
8 Replies

5. Shell Programming and Scripting

Moving filenames containing spaces

I want to ftp all the sh files in the directory. Also if any of the file name contains spaces in them, it should be converted to underscores before it is ftped. I wrote the following code below: FILESSH=$(ls /mysh/*.sh) --- FILESH being used here for some other task --- echo "$FILESSH" |... (3 Replies)
Discussion started by: amicon007
3 Replies

6. Shell Programming and Scripting

awk and spaces in filenames

Hey there, this is my first post and I'll try to explain my situation as best I can.Here is a sample of the input file: ADO Sample.h,v ADO Sample 2010-05-21 lyonsb /repository/patents/TSCommon/OpenSource/Dundass/ug6mfc/DataSources/Ado/ADO Sample ADO SampleDoc.h,v ADO SampleDoc 2010-05-21... (3 Replies)
Discussion started by: rodan90
3 Replies

7. Shell Programming and Scripting

removing spaces in filenames

I have a problem mounting images because of the spaces in the filenames. Does anyone know how to rename files by removing the spaces with the find command? find Desktop/$dir -name "*.dmg" -print -exec ??? (4 Replies)
Discussion started by: ianebaj
4 Replies

8. Shell Programming and Scripting

Remove spaces in filenames

Hi, I have files like below, In files coming as spaces. Before transfering those files into ftp server. I want to remove the spaces and then can transfer the files into unix server. e.g: filenames are 1) SHmail _profile001_20120908.txt 2) SHmail_profile001 _20120908.txt 3) sh... (3 Replies)
Discussion started by: kirankumar
3 Replies

9. UNIX for Dummies Questions & Answers

Reading filenames with spaces

Hello I've got a certain no. of files in a directory whose names I'm reading and redirecting into a temporary text file using the command below: ls -l | grep ^- | awk '{print $9}'However, whenever the file names contain spaces the above command considers only the part of the file name up to... (5 Replies)
Discussion started by: S. BASU
5 Replies

10. Shell Programming and Scripting

Handling filenames with spaces

I'm trying to handle some files with spaces in their name using "" or \ . Like "file 1" or file\ 1. My current confusion can be expressed by the following shell script: #!/bin/bash touch "file 1" "file 2" echo -n "ls: " ; ls echo --- for file in "file 1" "file 2" ; do echo $file... (9 Replies)
Discussion started by: Ralph
9 Replies
ExtUtils::Manifest(3)					User Contributed Perl Documentation				     ExtUtils::Manifest(3)

NAME
ExtUtils::Manifest - utilities to write and check a MANIFEST file SYNOPSIS
use ExtUtils::Manifest qw(...funcs to import...); mkmanifest(); my @missing_files = manicheck; my @skipped = skipcheck; my @extra_files = filecheck; my($missing, $extra) = fullcheck; my $found = manifind(); my $manifest = maniread(); manicopy($read,$target); maniadd({$file => $comment, ...}); DESCRIPTION
Functions ExtUtils::Manifest exports no functions by default. The following are exported on request mkmanifest mkmanifest(); Writes all files in and below the current directory to your MANIFEST. It works similar to the result of the Unix command find . > MANIFEST All files that match any regular expression in a file MANIFEST.SKIP (if it exists) are ignored. Any existing MANIFEST file will be saved as MANIFEST.bak. manifind my $found = manifind(); returns a hash reference. The keys of the hash are the files found below the current directory. manicheck my @missing_files = manicheck(); checks if all the files within a "MANIFEST" in the current directory really do exist. If "MANIFEST" and the tree below the current directory are in sync it silently returns an empty list. Otherwise it returns a list of files which are listed in the "MANIFEST" but missing from the directory, and by default also outputs these names to STDERR. filecheck my @extra_files = filecheck(); finds files below the current directory that are not mentioned in the "MANIFEST" file. An optional file "MANIFEST.SKIP" will be consulted. Any file matching a regular expression in such a file will not be reported as missing in the "MANIFEST" file. The list of any extraneous files found is returned, and by default also reported to STDERR. fullcheck my($missing, $extra) = fullcheck(); does both a manicheck() and a filecheck(), returning then as two array refs. skipcheck my @skipped = skipcheck(); lists all the files that are skipped due to your "MANIFEST.SKIP" file. maniread my $manifest = maniread(); my $manifest = maniread($manifest_file); reads a named "MANIFEST" file (defaults to "MANIFEST" in the current directory) and returns a HASH reference with files being the keys and comments being the values of the HASH. Blank lines and lines which start with "#" in the "MANIFEST" file are discarded. maniskip my $skipchk = maniskip(); my $skipchk = maniskip($manifest_skip_file); if ($skipchk->($file)) { .. } reads a named "MANIFEST.SKIP" file (defaults to "MANIFEST.SKIP" in the current directory) and returns a CODE reference that tests whether a given filename should be skipped. manicopy manicopy(\%src, $dest_dir); manicopy(\%src, $dest_dir, $how); Copies the files that are the keys in %src to the $dest_dir. %src is typically returned by the maniread() function. manicopy( maniread(), $dest_dir ); This function is useful for producing a directory tree identical to the intended distribution tree. $how can be used to specify a different methods of "copying". Valid values are "cp", which actually copies the files, "ln" which creates hard links, and "best" which mostly links the files but copies any symbolic link to make a tree without any symbolic link. "cp" is the default. maniadd maniadd({ $file => $comment, ...}); Adds an entry to an existing MANIFEST unless its already there. $file will be normalized (ie. Unixified). UNIMPLEMENTED MANIFEST A list of files in the distribution, one file per line. The MANIFEST always uses Unix filepath conventions even if you're not on Unix. This means foo/bar style not fooar. Anything between white space and an end of line within a "MANIFEST" file is considered to be a comment. Any line beginning with # is also a comment. Beginning with ExtUtils::Manifest 1.52, a filename may contain whitespace characters if it is enclosed in single quotes; single quotes or backslashes in that filename must be backslash-escaped. # this a comment some/file some/other/file comment about some/file 'some/third file' comment MANIFEST.SKIP The file MANIFEST.SKIP may contain regular expressions of files that should be ignored by mkmanifest() and filecheck(). The regular expressions should appear one on each line. Blank lines and lines which start with "#" are skipped. Use "#" if you need a regular expression to start with a "#". For example: # Version control files and dirs. RCS CVS ,v$ B.svn # Makemaker generated files and dirs. ^MANIFEST. ^Makefile$ ^blib/ ^MakeMaker-d # Temp, old and emacs backup files. ~$ .old$ ^#.*#$ ^.# If no MANIFEST.SKIP file is found, a default set of skips will be used, similar to the example above. If you want nothing skipped, simply make an empty MANIFEST.SKIP file. In one's own MANIFEST.SKIP file, certain directives can be used to include the contents of other MANIFEST.SKIP files. At present two such directives are recognized. #!include_default This inserts the contents of the default MANIFEST.SKIP file #!include /Path/to/another/manifest.skip This inserts the contents of the specified external file The included contents will be inserted into the MANIFEST.SKIP file in between #!start included /path/to/manifest.skip and #!end included /path/to/manifest.skip markers. The original MANIFEST.SKIP is saved as MANIFEST.SKIP.bak. EXPORT_OK &mkmanifest, &manicheck, &filecheck, &fullcheck, &maniread, and &manicopy are exportable. GLOBAL VARIABLES $ExtUtils::Manifest::MANIFEST defaults to "MANIFEST". Changing it results in both a different "MANIFEST" and a different "MANIFEST.SKIP" file. This is useful if you want to maintain different distributions for different audiences (say a user version and a developer version including RCS). $ExtUtils::Manifest::Quiet defaults to 0. If set to a true value, all functions act silently. $ExtUtils::Manifest::Debug defaults to 0. If set to a true value, or if PERL_MM_MANIFEST_DEBUG is true, debugging output will be produced. DIAGNOSTICS
All diagnostic output is sent to "STDERR". "Not in MANIFEST:" file is reported if a file is found which is not in "MANIFEST". "Skipping" file is reported if a file is skipped due to an entry in "MANIFEST.SKIP". "No such file:" file is reported if a file mentioned in a "MANIFEST" file does not exist. "MANIFEST:" $! is reported if "MANIFEST" could not be opened. "Added to MANIFEST:" file is reported by mkmanifest() if $Verbose is set and a file is added to MANIFEST. $Verbose is set to 1 by default. ENVIRONMENT
PERL_MM_MANIFEST_DEBUG Turns on debugging SEE ALSO
ExtUtils::MakeMaker which has handy targets for most of the functionality. AUTHOR
Andreas Koenig "andreas.koenig@anima.de" Maintained by Michael G Schwern "schwern@pobox.com" within the ExtUtils-MakeMaker package and, as a separate CPAN package, by Randy Kobes "r.kobes@uwinnipeg.ca". perl v5.16.3 2012-09-11 ExtUtils::Manifest(3)
All times are GMT -4. The time now is 01:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy