I have an Open Office Spreadsheet document stored inside a bash variable. I want to do something like the following to feed Open Office via STDIN
:
echo "$openOfficeDoc" | ooffice
But it doesn't work.
Note: The content of the bash variable must not be written to disk.
I'll emphasize that I'm trying to pass to Open Office the actual data of the file.
I'm trying to store passwords in an Open Office Spreadsheet file. The passwords are encrypted using GPG. I don't want the passwords to be written to disk for security reasons.
The bash variable value is a binary blob of an Open Office Spreadsheet document. It is not ASCII.
The bash code I used to create the blob is:
data=$(cat "Encrypted.gpg" | gpg -u "Dor" -d)
While Encrypted.gpg
is an encrypted file of an Open Office Spreadsheet.
Is it possible to feed Open Office via STDIN?
ooffice
should accept input from STDIN? That is a feature that must be implemented by an individual program, it is not true for any and all executables. Note that command line arguments are not STDIN -- i.e.,mycommand somearg
is not at all the same asecho somearg | mycommand
./proc/<pid of echo>/cmdline
if you're passing it toecho
as an argument. Theecho
process will terminated immediately after it has printed its argument (it will not run all the time just becauseooffice
is still running), but it seems unsafe to me nonetheless.echo
command is safe, because it's a shell built-in so it doesn't appear on the command line of any process. See the comment of the user "Gilles" here: unix.stackexchange.com/questions/78757/…