![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Storing space delimited line in var with loop? | eltinator | Shell Programming and Scripting | 2 | 08-24-2007 01:09 AM |
| Moving Files | iAm4Free | Shell Programming and Scripting | 5 | 03-28-2007 04:13 AM |
| moving files ?? | rocker40 | UNIX for Dummies Questions & Answers | 9 | 11-09-2003 08:36 PM |
| moving only files... | sskb | UNIX for Dummies Questions & Answers | 12 | 11-19-2001 03:28 PM |
| moving space from one partition to another | jason6792 | UNIX for Advanced & Expert Users | 4 | 10-08-2001 06:54 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Moving files with space, in for loop
Hi All
I need to put a bunch of specific files in a directory (with loads of other files), into a tar archive. The best way I thought of doing this was putting the filenames into a file, reading them line by line in a for loop, and then adding them to a tar acrhive. However the filenames have spaces: /the/path/to/the/file/the file name with spaces So when I do a for x in `cat /listoffiles` etc, it doesn't work because the shell sees the spaces as separators, and hence the bits of the name as separate files. Anyone got a resolution to this? If I list the filename at the command line, enclosed by quotes, it's OK - but when I put $x in quotes in my for loop, it doesn't work. Thanks for any help! |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|