![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Storing space delimited line in var with loop? | eltinator | Shell Programming and Scripting | 2 | 08-23-2007 10:09 PM |
| Moving Files | iAm4Free | Shell Programming and Scripting | 5 | 03-28-2007 01:13 AM |
| moving files ?? | rocker40 | UNIX for Dummies Questions & Answers | 9 | 11-09-2003 04:36 PM |
| moving only files... | sskb | UNIX for Dummies Questions & Answers | 12 | 11-19-2001 11:28 AM |
| moving space from one partition to another | jason6792 | UNIX for Advanced & Expert Users | 4 | 10-08-2001 03:54 PM |
|
|
Submit Tools | LinkBack | Thread Tools | 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!
__________________
Free Palestine |
| Forum Sponsor | ||
|
|