Redirect file to stdout - flip io redirection

I have some atypical problems in linux and unsquashfs.

Usually we redirect stdout to the specified file, but I want something to change. Redirecting created on the fly to stdout without actually creating the file.

unsquashfs can extract the specified file, but the file is completely overwritten. This makes it impossible to use a named pipe. This is necessary for me because I want to avoid creating a temporary large extracted file that consumes space and IO. I have to use the output on the command line. Unfortunately, unsquashfs does not have a “-” option for the extracted file, similar to the tar or zip command. Perhaps what I want without committing unsquashfs? Is this any pre-module or wrapper program or pseudo-phila with the help I can do the reverse redirection?

+4
source share
1 answer

You can use /dev/stdout , and it works in some cases, however, since it is still a pipe, it will not support some of the operations that the file does (like searching), so it all depends on the program.

+3
source

Source: https://habr.com/ru/post/1498364/


All Articles