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
. – goldilocks Sep 17 '13 at 17:57/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. – Martin von Wittich Sep 17 '13 at 18:21echo
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: http://unix.stackexchange.com/questions/78757/securely-feeding-a-program-with-a-password – Dor Sep 18 '13 at 11:42echo -e "HTTP/1.1 200 OK\r\n\r\ncolumn1,column2,column3\nb1,b2,b3\nc1,c2,c3" | nc -i 1 -l 127.0.0.1 8888
that serves the file via HTTP, and thenooffice http://localhost:8888/a.csv
. The "only" thing you should modify is to implement a sucessful response to WebDAV's PROPFIND and feed it tonc
– Elias Torres Arroyo Sep 18 '13 at 15:06echo
is usually a builtin command. – Martin von Wittich Sep 18 '13 at 16:43