Dear all,
I am using following function of some script to assign variable "JobNo" some value form file $SAMPLE"_status.log" [1] ( generated using the red color command )
crab ntuplize_crab -status -c $SAMPLE >& $SAMPLE"_status.log" &
echo $SAMPLE"_status.log" "====="
jobNo=$(awk '/Jobs with Wrapper/ && $NF != 0{s=1} /List of jobs/ && s{if(p){p=p","$NF}else{p=$NF};s=""}END{print p}' $SAMPLE"_status.log" )
#sleep 200
echo $jobNo "====="
echo $jobNo "====="
The name of the file is correctly printed on the screen and also I checked the content is fine which is [1].
Now, the execution of this script pass me the following output:
qcd120_status.log =====
=====
=====
The blue is the file name and is fine. But when I am trying to print the JobNo it only print the "===="..
And when I use the above command on the terminal it is passing me the proper JobNo which I want, should be following:
57,331,333,336,348,2-3,11,28,45,49,67-68,80,82,87,102-104,107-108,111-112,114,117-118,123-125,127-132,134,139,148-157,159-161,169-172,174,179-180,182-185,200,202,204,208-210,219,226,236,238,245,251,253-257,262,265,271,280,288,308,330,353,355,375,377,381,385,387
Please help, I am completely stuck.
[1]
crab: ExitCodes Summary
>>>>>>>>> 309 Jobs with Wrapper Exit Code : 0
List of jobs: 1,4-10,12-27,29-44,46-48,50-56,58-66,69-79,81,83-86,88-101,105-106,109-110,113,115-116,119-122,126,133,135-138,140-147,158,162\
-168,173,175-178,181,186-199,201,203,205-207,211-218,220-225,227-235,237,239-244,246-250,252,258-261,263-264,266-270,272-279,281-287,289-307,309-329,\
332,334-335,337-347,349-352,354,356-374,376,378-380,382-384,386,388-401
See https://twiki.cern.ch/twiki/bin/view/CMS/JobExitCodes for Exit Code meaning
crab: ExitCodes Summary
>>>>>>>>> 4 Jobs with Wrapper Exit Code : 8028
List of jobs: 57,331,333,336
See https://twiki.cern.ch/twiki/bin/view/CMS/JobExitCodes for Exit Code meaning
crab: ExitCodes Summary
>>>>>>>>> 1 Jobs with Wrapper Exit Code : 8021
List of jobs: 348
See https://twiki.cern.ch/twiki/bin/view/CMS/JobExitCodes for Exit Code meaning
crab: ExitCodes Summary
>>>>>>>>> 87 Jobs with Wrapper Exit Code : 60307
List of jobs: 2-3,11,28,45,49,67-68,80,82,87,102-104,107-108,111-112,114,117-118,123-125,127-132,134,139,148-157,159-161,169-172,174,179-180\
,182-185,200,202,204,208-210,219,226,236,238,245,251,253-257,262,265,271,280,288,308,330,353,355,375,377,381,385,387
See https://twiki.cern.ch/twiki/bin/view/CMS/JobExitCodes for Exit Code meaning
crab: 401 Total Jobs