Sponsored Content
Full Discussion: Grep within script
Top Forums UNIX for Beginners Questions & Answers Grep within script Post 303031340 by Corona688 on Tuesday 26th of February 2019 04:23:12 PM
Old 02-26-2019
How about just not printing the no parts in the first place?

Code:
for cipher in ${ciphers[@]}
do
result=$(echo -n | openssl s_client -cipher "$cipher" -connect $SERVER 2>&1)
if [[ "$result" =~ ":error:" ]] ; then
  error=$(echo -n $result | cut -d':' -f6)
  #echo Testing $cipher...NO \($error\)
else
  if [[ "$result" =~ "Cipher is ${cipher}" || "$result" =~ "Cipher    :" ]] ; then
    echo Testing $cipher...YES
  else
    :
    #echo Testing $cipher...UNKNOWN RESPONSE
    #echo $result
  fi
fi
sleep $DELAY
done

: is a do-nothing. Those blocks just expect something inside them.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

grep from a script...

This is an extract from a script that i am trying to run. for tim in "2005:00:" "2005:01:" "2005:02:" "2005:03:" "2005:04:" "2005:05:"; do FormString="$tim" echo "grep '$FormString' access.10Aug-1201AM" count=`grep "$FormString" access.10Aug-1201AM | wc -l` ... (1 Reply)
Discussion started by: hamsasal
1 Replies

2. UNIX for Dummies Questions & Answers

grep script

hi guys, i was hoping you could help me out with the following im designing a help site for my work colleagues and would like a little script which would do a grep to check if an application is running on unix for example this is what i do on unix ps -ef | grep mqm and this tells me if... (4 Replies)
Discussion started by: drchris
4 Replies

3. Shell Programming and Scripting

Grep within a script

Hi, I am new to this - I have a unix command (below) that I would like to make automated. I would like the script to run the below command line but would like user input for '\' and '\' as these values will change depending on what i'm searching for. Is this possible? if so please help. ... (13 Replies)
Discussion started by: dnash
13 Replies

4. UNIX for Dummies Questions & Answers

trying to grep the first few lines of a continuos script, and exit the script anyidea

Hi. I am trying to extract the output of the first few lines of a continuos sh script. The when i run it, i wont to grep the the first 20 lines of it for an entry and basically do a crtl z out of it or to that effect, and output the results to a text file. I basically want to script... (5 Replies)
Discussion started by: k00061804
5 Replies

5. Shell Programming and Scripting

How to grep sql error in shell script and exit the script?

I need help in the following script. I want to grep the sql errors insert into the error table and exit the shell script if there is any error, otherwise keep running the scripts. Here is my script #!/bin/csh -f source .orapass set user = $USER set pass = $PASS cd /opt/data/scripts echo... (2 Replies)
Discussion started by: allinshell99
2 Replies

6. Shell Programming and Scripting

script use min resource ( grep grep)

Hi i wrote script use it as watchdog ( i mean it check another program (pooya) whenever that was killed (closed or crashed) it run another script (pooya_start.sh) to start it, this script work fine and do the job for me , i need help of an expert to tell me (exact command) how to change this... (8 Replies)
Discussion started by: pooyair
8 Replies

7. UNIX for Dummies Questions & Answers

grep IP script

Hello, I have a command and would like to make that as a script. How do I do that? my command is: grep -Eo +\.+\.+\.+. and i want to have that like grepscript.sh x.txt > IP.txt Can somebody help me? (3 Replies)
Discussion started by: eightball
3 Replies

8. Shell Programming and Scripting

Inconsistent `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l`

i have this line of code that looks for the same file if it is currently running and returns the count. `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l` basically it is assigned to a variable ISRUNNING=`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh |... (6 Replies)
Discussion started by: wtolentino
6 Replies

9. Shell Programming and Scripting

Help with script - GREP

Hallo gentlemen, i've a problem removing lines from txt file. To make it simple, here is an example: TEXT1.TXT --- contents: 9.9.9.9 geek.net 1.1.1.1 geek.com 2.2.2.2 leet.net TEXT2.TXT --- contents: geek.com coolbar.org I simply do: cat text1.txt | grep -f text2.txt >... (7 Replies)
Discussion started by: mirkocosta
7 Replies

10. Shell Programming and Scripting

Grep Script

Hi, New to scripting and looking for some help. I am trying to write a script that will search a specified directory for any new or modified files within the last 7 days and display the results. This will be ran daily and emailed? Thanks (18 Replies)
Discussion started by: Con592
18 Replies
BIO_f_cipher(3) 						      OpenSSL							   BIO_f_cipher(3)

NAME
BIO_f_cipher, BIO_set_cipher, BIO_get_cipher_status, BIO_get_cipher_ctx - cipher BIO filter SYNOPSIS
#include <openssl/bio.h> #include <openssl/evp.h> BIO_METHOD * BIO_f_cipher(void); void BIO_set_cipher(BIO *b,const EVP_CIPHER *cipher, unsigned char *key, unsigned char *iv, int enc); int BIO_get_cipher_status(BIO *b) int BIO_get_cipher_ctx(BIO *b, EVP_CIPHER_CTX **pctx) DESCRIPTION
BIO_f_cipher() returns the cipher BIO method. This is a filter BIO that encrypts any data written through it, and decrypts any data read from it. It is a BIO wrapper for the cipher routines EVP_CipherInit(), EVP_CipherUpdate() and EVP_CipherFinal(). Cipher BIOs do not support BIO_gets() or BIO_puts(). BIO_flush() on an encryption BIO that is being written through is used to signal that no more data is to be encrypted: this is used to flush and possibly pad the final block through the BIO. BIO_set_cipher() sets the cipher of BIO b to cipher using key key and IV iv. enc should be set to 1 for encryption and zero for decryption. When reading from an encryption BIO the final block is automatically decrypted and checked when EOF is detected. BIO_get_cipher_status() is a BIO_ctrl() macro which can be called to determine whether the decryption operation was successful. BIO_get_cipher_ctx() is a BIO_ctrl() macro which retrieves the internal BIO cipher context. The retrieved context can be used in conjunction with the standard cipher routines to set it up. This is useful when BIO_set_cipher() is not flexible enough for the applications needs. NOTES
When encrypting BIO_flush() must be called to flush the final block through the BIO. If it is not then the final block will fail a subsequent decrypt. When decrypting an error on the final block is signalled by a zero return value from the read operation. A successful decrypt followed by EOF will also return zero for the final read. BIO_get_cipher_status() should be called to determine if the decrypt was successful. As always, if BIO_gets() or BIO_puts() support is needed then it can be achieved by preceding the cipher BIO with a buffering BIO. RETURN VALUES
BIO_f_cipher() returns the cipher BIO method. BIO_set_cipher() does not return a value. BIO_get_cipher_status() returns 1 for a successful decrypt and 0 for failure. BIO_get_cipher_ctx() currently always returns 1. EXAMPLES
TBA SEE ALSO
TBA 0.9.8 2009-04-03 BIO_f_cipher(3)
All times are GMT -4. The time now is 10:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy