-
Just to follow up on this for anyone interested, I ended up taking a slightly different route to get this working.
What I did was run a loop to output the values of the variables into a plain txt file (one per line and including spaces), then when calling 7zip use the list file feature so it reads in the file and backs up the files listed within. Once done it removes the temp txt file.
Eg...
2009-11-03 06:14:38 UTC in p7zip
-
Hi p7zip,
Thanks heaps for that. I'm self taught with bash and haven't come across the usage of arrays yet. Your test files look good and I should be able to figure something out with what you've given me.
Thanks again and keep up the good work in porting 7zip over to Linux!
Cheers.
2009-10-09 06:05:16 UTC in p7zip
-
Thanks for the reply.
I thought it might have been a shell coding problem but I'm not so sure. If you try and run this script and create the two txt files yourself, it works.
--
file1="/folder/test1.txt"
file2="/folder/test2.txt"
files="$file1 $file2"
7za a -t7z /folder/test.7z $files
--
However if you rename the file...
2009-10-07 04:21:10 UTC in p7zip
-
Running Fedora 11 with p7zip 4.65
I'm trying to create a script that can dynamically choose which files to compress. At the moment I have some code that will let me do this (see below) but it runs into trouble whenever a space appears in the path or file name.
Example:
This works
# !/bin/bash
file1="/folder/test1.txt"
file2="/folder/test2.txt".
2009-10-01 02:34:20 UTC in p7zip