Dear Shell scripters,
I have a small code which copy the txt files from some destination to file name OutPutFile. [1]
I want to modify this script to introduce several constant.
The string it is reading is like
/eos/uscms/store/user/pooja04//analysis2012/525/data/doubleele/2012/datav1/vgtree_320_1_YiM.root
I want the final string in the OUTPUTFILE to be like:
Chain->Add("/eos/uscms/store/user/pooja04//analysis2012/525/data/doubleele/2012/datav1/vgtree_320_1_YiM.root");
I don't know how to add these constant like [", ;] etc. Kindly help.
Thanks in advance
Pooja
SCRIPT [1]
#!/bin/bash
#usage ./copyTextFromCastor.sh $PATH $GREP $OUTPUTFILE
PATHNAME=$1
CONSTANT=Chain
GREP=$2
OUTPUT=$3
echo "Copying \"$1 | grep $2\" to $3"
ls -ltr "$PATHNAME" | grep "$2" | awk '{print string path $9}' string="$CONSTANT" path="$1" > "$3"
echo "progressing ... please be patient..."