Sponsored Content
Top Forums Shell Programming and Scripting Modifying the shell script to select pattern Post 302934762 by emily on Tuesday 10th of February 2015 11:26:19 AM
Old 02-10-2015
Modifying the shell script to select pattern

Hello,
I have script which work 70% of the desired task [1], the output from script.sh is following [2], however the desired output I require is following [3].

Any piece of suggestion would be great..

thanks in advance,
emily

[1]
Code:
#!/bin/bash                                                                                                                                                                
PATHNAME=$1
CONSTANT=rfio:
GREP=$2
OUTPUT=$3

voms-proxy-init --voms cms:/cms/dcms

echo "Copying \"$1 | grep $2\" to $3"                                                                      
srmls "$PATHNAME" | grep "$2" | awk '{print string path $2}' string="" path=""  > "$3"

echo "progressing ... please be patient...

"[2]
Code:
/pnfs/desy.de/cms/tier2/store/user/HOUpgrade/Generation/SingleMuonGun/SingleMuMinus_Winter15_FlatPt-0to200_MCRUN2_72_V3_GEN_SIM_DIGI_L1RECO_L1/150201_151524/0000/SingleMuMinus_Winter15_FlatPt-0to200_MCRUN2_72_V1_GEN_SIM_DIGI_RECO_L1_199.root
/pnfs/desy.de/cms/tier2/store/user/HOUpgrade/Generation/SingleMuonGun/SingleMuMinus_Winter15_FlatPt-0to200_MCRUN2_72_V3_GEN_SIM_DIGI_L1RECO_L1/150201_151524/0000/SingleMuMinus_Winter15_FlatPt-0to200_MCRUN2_72_V1_GEN_SIM_DIGI_RECO_L1_746.root
/pnfs/desy.de/cms/tier2/store/user/HOUpgrade/Generation/SingleMuonGun/SingleMuMinus_Winter15_FlatPt-0to200_MCRUN2_72_V3_GEN_SIM_DIGI_L1RECO_L1/150201_151524/0000/SingleMuMinus_Winter15_FlatPt-0to200_MCRUN2_72_V1_GEN_SIM_DIGI_RECO_L1_92.root

[3]
Code:
/store/user/HOUpgrade/Generation/SingleMuonGun/SingleMuMinus_Winter15_FlatPt-0to200_MCRUN2_72_V3_GEN_SIM_DIGI_L1RECO_L1/150201_151524/0000/SingleMuMinus_Winter15_FlatPt-0\
to200_MCRUN2_72_V1_GEN_SIM_DIGI_RECO_L1_199.root
/store/user/HOUpgrade/Generation/SingleMuonGun/SingleMuMinus_Winter15_FlatPt-0to200_MCRUN2_72_V3_GEN_SIM_DIGI_L1RECO_L1/150201_151524/0000/SingleMuMinus_Winter15_FlatPt-0\
to200_MCRUN2_72_V1_GEN_SIM_DIGI_RECO_L1_746.root
/store/user/HOUpgrade/Generation/SingleMuonGun/SingleMuMinus_Winter15_FlatPt-0to200_MCRUN2_72_V3_GEN_SIM_DIGI_L1RECO_L1/150201_151524/0000/SingleMuMinus_Winter15_FlatPt-0\
to200_MCRUN2_72_V1_GEN_SIM_DIGI_RECO_L1_92.root


Last edited by rbatte1; 02-10-2015 at 12:53 PM.. Reason: Tightened CODE tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Modifying a csv file from Shell Script

Hi all, I have some script that creates a temp csv file. What I need to do is do some search and replace and modify the file from my shell script. I know the commands to open the file and then apply the reg ex but wasnt sure how I could do this from a script and modify the file? Any help... (2 Replies)
Discussion started by: not4google
2 Replies

2. Shell Programming and Scripting

using SELECT sql statement in shell script

Hi there I have a database on a remote box and i have been using shell script to insert data into it for example, i could have a script that did this SN=123456 n=server1 m=x4140 sql="UPDATE main SET hostname='$n',model='$m' WHERE serial='$SN';" echo $sql |/usr/sfw/bin/mysql -h... (4 Replies)
Discussion started by: hcclnoodles
4 Replies

3. UNIX for Dummies Questions & Answers

Modifying a shell script without using an editor

Hi all, I really wan't to know that how to edit a shell script with out using an editor.. Is there any command? (4 Replies)
Discussion started by: buddhi
4 Replies

4. Shell Programming and Scripting

How to use select into command in shell script?

I need to get total number of rows in a table by using select count(*) from table and need to assign into a variable in shell script. I used the following script, it does return the number of rows but also with oracle headers, Please help me to eliminate this headers. Shell Script #!/bin/sh... (16 Replies)
Discussion started by: vel4ever
16 Replies

5. Shell Programming and Scripting

Select combination unique using shell script

Hi All, bash-3.00$ gzgrep -i '\ ExecuteThread:' /******/******/******/******/stdout.log.txt.gz <Jan 7, 2012 5:54:55 PM UTC> <Error> <WebLogicServer> <BEA-000337> < ExecuteThread: '414' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "696" seconds working on the request... (4 Replies)
Discussion started by: osmanux
4 Replies

6. Shell Programming and Scripting

Execution problem with shell script for modifying a user

#/bin/sh echo "enter the user name" read $username echo "Enter new home directory" read $newhd usermod -d $newhd $username ;; error while executing : enter the user name Rev Enter new home directory: /home/58745 usermod: option requires an argument -- 'd' Try `usermod --help' or... (2 Replies)
Discussion started by: Revanth547
2 Replies

7. Shell Programming and Scripting

Modifying contents of the file in shell script

Hello all, I have a Kconfig file that looks like something below ... ================================ menu "Application type" config GUI_TYPE_STANDARD bool "Standard Application" source "cfg/config/std.in" source... (12 Replies)
Discussion started by: anand.shah
12 Replies

8. Shell Programming and Scripting

How to print the output of a select query using shell script?

HI, I want to connect to database and fetch the count from a table. The sql query is as below : select count(*) from table_test where test_column='read'; How can I print the output of this statement using shell script. Thanks in advance. (4 Replies)
Discussion started by: confused_info
4 Replies

9. Shell Programming and Scripting

Modifying/Adding in the DNS server entry using shell script

Dear Experts. I need to add/modify the entries in the DNS server and this has to be achieved using shell script and below is the requirement, could you please let me know if a shell script can be written for this task? 1. Log in to primary DNS server 2. Check /etc/named.conf if zone is... (4 Replies)
Discussion started by: VKIRUPHAKARAN
4 Replies

10. Linux

How to execute a simple select script using a shell script?

Hi team, I have two select statements and need to run them using SYSDBA user select * from temp_temp_seg_usage; select segment_name, tablespace_name, bytes/ (1024*1024) UsedMb from dba_segments where segment_name='TEMP_TEMP_SEG_USAGE'; Need to run this using a shell script say named... (1 Reply)
Discussion started by: pamsy78
1 Replies
CMS_verify(3)							      OpenSSL							     CMS_verify(3)

NAME
CMS_verify - verify a CMS SignedData structure SYNOPSIS
#include <openssl/cms.h> int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, X509_STORE *store, BIO *indata, BIO *out, unsigned int flags); STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms); DESCRIPTION
CMS_verify() verifies a CMS SignedData structure. cms is the CMS_ContentInfo structure to verify. certs is a set of certificates in which to search for the signing certificate(s). store is a trusted certificate store used for chain verification. indata is the detached content if the content is not present in cms. The content is written to out if it is not NULL. flags is an optional set of flags, which can be used to modify the verify operation. CMS_get0_signers() retrieves the signing certificate(s) from cms, it must be called after a successful CMS_verify() operation. VERIFY PROCESS
Normally the verify process proceeds as follows. Initially some sanity checks are performed on cms. The type of cms must be SignedData. There must be at least one signature on the data and if the content is detached indata cannot be NULL. An attempt is made to locate all the signing certificate(s), first looking in the certs parameter (if it is not NULL) and then looking in any certificates contained in the cms structure itself. If any signing certificate cannot be located the operation fails. Each signing certificate is chain verified using the smimesign purpose and the supplied trusted certificate store. Any internal certificates in the message are used as untrusted CAs. If CRL checking is enabled in store any internal CRLs are used in addition to attempting to look them up in store. If any chain verify fails an error code is returned. Finally the signed content is read (and written to out is it is not NULL) and the signature's checked. If all signature's verify correctly then the function is successful. Any of the following flags (ored together) can be passed in the flags parameter to change the default verify behaviour. If CMS_NOINTERN is set the certificates in the message itself are not searched when locating the signing certificate(s). This means that all the signing certificates must be in the certs parameter. If CMS_NOCRL is set and CRL checking is enabled in store then any CRLs in the message itself are ignored. If the CMS_TEXT flag is set MIME headers for type text/plain are deleted from the content. If the content is not of type text/plain then an error is returned. If CMS_NO_SIGNER_CERT_VERIFY is set the signing certificates are not verified. If CMS_NO_ATTR_VERIFY is set the signed attributes signature is not verified. If CMS_NO_CONTENT_VERIFY is set then the content digest is not checked. NOTES
One application of CMS_NOINTERN is to only accept messages signed by a small number of certificates. The acceptable certificates would be passed in the certs parameter. In this case if the signer is not one of the certificates supplied in certs then the verify will fail because the signer cannot be found. In some cases the standard techniques for looking up and validating certificates are not appropriate: for example an application may wish to lookup certificates in a database or perform customised verification. This can be achieved by setting and verifying the signers certificates manually using the signed data utility functions. Care should be taken when modifying the default verify behaviour, for example setting CMS_NO_CONTENT_VERIFY will totally disable all content verification and any modified content will be considered valid. This combination is however useful if one merely wishes to write the content to out and its validity is not considered important. Chain verification should arguably be performed using the signing time rather than the current time. However since the signing time is supplied by the signer it cannot be trusted without additional evidence (such as a trusted timestamp). RETURN VALUES
CMS_verify() returns 1 for a successful verification and zero if an error occurred. CMS_get0_signers() returns all signers or NULL if an error occurred. The error can be obtained from ERR_get_error(3) BUGS
The trusted certificate store is not searched for the signing certificate, this is primarily due to the inadequacies of the current X509_STORE functionality. The lack of single pass processing means that the signed content must all be held in memory if it is not detached. SEE ALSO
ERR_get_error(3), CMS_sign(3) HISTORY
CMS_verify() was added to OpenSSL 0.9.8 1.0.1e 2013-02-11 CMS_verify(3)
All times are GMT -4. The time now is 04:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy