I'm trying to create a self-extracting encrypted archive. Here's code that doesn't work for me:openssl enc -aes-256-cfb -salt -d -a | tar -x -j <<EOFU2FsdGVkX19f7pGFSqDXJSREp/oDxJD0oii/FYvJlJpO8fB5ttZ/Qc8vSwIOS2y0QUlWLocow4S1YWf86615Ji3n16RLvhOIRiy9S8DNGXl9C6ea1FYDdiuy2lA75lME...8yQIpRng/gXItWlaGJapqW9z2wx7y2im/lPGM8UrwZN9uY3DuRx3XbpMY5yuRWU0oArQEvKxBAP/bB689j4P291Oauw1E8++na9phkEUXJY=EOFoutput:enter aes-256-cfb decryption password:tar: Unrecognized archive formattar: Error exit delayed from previous errors.embedded base64 data should be decrypted using openssl and its output should be piped into tar. openssl should be able to ask user for a password. If I remove tar pipeline:openssl enc -aes-256-cfb -salt -d -a >outfile <<EOF...then everything works fine. Therefore I assume that openssl can handle password prompt and input from the terminal without interfering with stdin/stdout (probably prompt goes into stderr and password reading is implemented using some tty magic).I managed to solve this task with the following construction:{ openssl enc -aes-256-cfb -salt -d -a | tar -x -j; } <<EOF...but I don't understand what's wrong with the first script.
decrypt and unarchive file embedded in the script
bash;here document
end of here document should be in front (or back of) openssl.what you did:sed -e s/^/water/ | sed -e s/^/wine/ <<EOFhello worldEOF(and you need to ctrl-d here)give :winehello worldonly second sed work (just wine, no water), what you must do :sed -e s/^/water/  <<EOF | sed -e s/^/wine/hello worldEOFgive :winewaterhello worldas you see, hello world was turn into waterhello world, then winewaterhello world.you should try openssl enc -aes-256-cfb -salt -d -a  <<EOF | tar -x -j