I have two huge files (150G each) and I need to use a tool for which I should supply them as a single file (since the tool only accepts one file). However, I do not want to merge these files for several reasons, but I cannot pipe them using something like <(cat file1 file2)
or myfile=$(cat file1 file2)
because the script uses the path of the input file, not its content.
So I would need something like the following:
alias myfile = "cat file1 file2"
So that using the following command would work:
tool_x --file /path/myfile
I already tried this mentioned command, but it didn't work.
I would just need to be able to treat the result of a "cat" command as an actual file, with the possibility to accessing this file using a path.
Is it possible to achieve something like that?
tool_x
is. That<(cat file1 file2)
is a named pipe and sometimes works. Did it give an error?<(...)
is a process substitution, not (necessarily) a named pipe. It's implemented using either/dev/fd
or a named pipe, and I seem to recall named pipes are used only if/dev/fd
is not available.