file = ["file1","file2",...].join(" ")
`paste "#{file}"`
Hello, I have this simple problem that has been bugging me for days. I want to use Ruby to select files to paste together, but when I use the above code, it returns saying that files are not found. If I run for a single file, e.g. paste file1, it works. Does someone see why the code isn’t working?
Thanks in advance
It’s because you quote #{file}. The thing that is executed is
paste "file1 file2".You probably want
paste #{file}which would result inpaste file1 file2. In your case, paste expects a file that is called “file1 file2” (filename with a space).In other words, remove the double quotes in your second line.