Shell differences for openssl command output


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell differences for openssl command output
# 1  
Old 09-15-2017
Shell differences for openssl command output

The following works in bash (/bin/bash):

Code:
echo "U2FsdGVkX198UexvhHEtfC7iLbT3awAfla77fvSjZQJ0LC4GmDMeLOghPWXpyy6e" | openssl aes-128-cbc -a -d -salt -pass file:<( echo -n "toy" )
Fri Sep 15 15:20:01 PDT 2017

But fails when run in sh (/bin/sh):
Code:
echo "U2FsdGVkX198UexvhHEtfC7iLbT3awAfla77fvSjZQJ0LC4GmDMeLOghPWXpyy6e" | openssl aes-128-cbc -a -d -salt -pass file:<( echo -n "toy" )
sh: 15: Syntax error: "(" unexpected

is there a way around this?

As you can see here, i'm using a named pipe for the password and id like to continue doing that. I just need this (or a very close variation of it) to work in /bin/sh.

OS: All Unix flavors.
# 2  
Old 09-16-2017
That is a bashism called "process substitution". Which sh doesn't offer. Provide a real file with "toy" in it.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Comparing 2 xml files and print the differences only in output

Hi....I'm having 2 xml files, one is having some special characters and another is a clean xml file does not have any special characters. Now I need one audit kind of file which will show me only from which line the special characters have been removed and the special characters. Can you please... (1 Reply)
Discussion started by: Krishanu Saha
1 Replies

2. Shell Programming and Scripting

Shell command output into HTML

Hi unix geeks out there, I have a file that contains the output of a command in text format ------------------------------------------------------------------------ r201535 | kashyapgiri@gmail.com| 2012-06-21 05:00:01 +0530 (Thu, 21 Jun 2012) | 1 line Changed paths: M... (8 Replies)
Discussion started by: Kashyap
8 Replies

3. Shell Programming and Scripting

openSSL command help

I am running a openssl command like this: openssl s_client -showcerts -connect $fqdn:$portand the result is some ridiculous amount of stuff but i only want to cut out part of the certificate chain. How do i do that? (2 Replies)
Discussion started by: shade917
2 Replies

4. Shell Programming and Scripting

Command need to be used for the scripts output differences

Hi All, Actually we want to know the command need to use if the difference between two files are null, then it should not send as mail. Oterwise it should send as mail alert. Below for your reference, # Email the spoolfile. diff free_sp_new.log free_sp_old.log if output of above... (1 Reply)
Discussion started by: thanvir.akram
1 Replies

5. Shell Programming and Scripting

I need to understand the differences between the bash shell and the Bourne shell

I do not claim to be an expert, but I have done things with scripts that whole teams of folks have said can not be done. Of course they should have said we do not have the intestinal fortitude to git-r-done. I have been using UNIX actually HPUX since 1992. Unfortunately my old computer died and... (7 Replies)
Discussion started by: awk_sed_hello
7 Replies

6. UNIX for Dummies Questions & Answers

shell differences?

What is the differene between sh and ksh, if i want to write function count() { ls | wc -l } How to use in both shell means how to run this function in both the shell. correct me if my question is wrong (2 Replies)
Discussion started by: hi2_t
2 Replies

7. Programming

How to read output of a shell command

Hello All, I have a an application written in C and runing on Red Hat Linux. In my code I have written a command that is fired on the linux shell by using system() function call. Now I need to read the output of this command in my c program and assign it to a variable. Can anyone... (1 Reply)
Discussion started by: shamik
1 Replies

8. Shell Programming and Scripting

openssl shell script

HI :) I have a script with an encrypted file that will output the decrypted content. my question is, instead of printing it, how can I pass it to the python parser? I kept trying lots of ways.. no luck :( #!/bin/sh openssl enc -aes-256-cfb8 -a -d -pass pass:mypass<<EOF... (2 Replies)
Discussion started by: skeeter144
2 Replies

9. UNIX for Dummies Questions & Answers

Compare 2 files for a single column and output differences

Hi, I have a column in 2 different files which i want to compare, and output the results to a different file. The columns are in different positions in those 2 files. File 1 the column is in position 10-15 File 2 the column is in position 15-20 Please advise Thanks (1 Reply)
Discussion started by: samit_9999
1 Replies

10. Shell Programming and Scripting

to print output using shell command

suppose u have 2 files ; where both files have one line in common. say one file like that >gi|62859953|ref|NP_001017322.1| plexin B2 MKEKERTKAITEIYLTRLLSVKGTLQQFVDNFFQSVLNSNQVVPPAVKYFFDFLDEQAEKYEIKDEDTVHIWKTNSLSLR... (13 Replies)
Discussion started by: cdfd123
13 Replies
Login or Register to Ask a Question