[SLUG] creating tar archive of filenames containing spaces

From: Jonathon Conte (thesicktwist@hotmail.com)
Date: Mon Apr 30 2007 - 13:07:13 EDT


I want to write a script that uses ls and grep to send a filtered list of
files to tar to create an archive. I'm getting hung up on filenames that
contain spaces. What looks wrong below?

jconte@peregrine:~/Desktop/spaces$ ls
filename with spaces
jconte@peregrine:~/Desktop/spaces$ ls -Q
"filename with spaces"
jconte@peregrine:~/Desktop/spaces$ tar -cf ../test.tar $(ls -Q)
tar: "filename: Cannot stat: No such file or directory
tar: with: Cannot stat: No such file or directory
tar: spaces": Cannot stat: No such file or directory
tar: Error exit delayed from previous errors

Thanks for any suggestions.
Jonathon

_________________________________________________________________
Interest Rates NEAR 39yr LOWS! $430,000 Mortgage for $1,299/mo - Calculate
new payment
http://www.lowermybills.com/lre/index.jsp?sourceid=lmb-9632-19132&moid=14888

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:14:49 EDT