Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Modifying the shell script to select pattern

$
0
0
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


Viewing all articles
Browse latest Browse all 16232

Trending Articles