LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Process Substitution not working with echo command (https://www.linuxquestions.org/questions/linux-newbie-8/process-substitution-not-working-with-echo-command-618579/)

muazfarooqaslam 02-04-2008 09:07 AM

Process Substitution not working with echo command
 
Hi guys,

i am trying to use process substitution ion following code segment, and it's not working

Code:

echo -n "Number of Requests: "
cat  <(wc -l $1)
echo -n "Successfully Processed: "
cat  <(grep "The common subscriber data were added successfully" /opt/mmsc-2.2/bulktool/logging/log |awk -F '|' '{print $7}' | awk -F ':' '{print $3}' | cut -b 18-29 | wc -l)
echo -n "Already Provisioned: "
cat  <(grep "uPower response: Duplicate value" /opt/mmsc-2.2/bulktool/logging/log  | awk -F '|' '{print $7}' | awk -F ':' '{print $3}' | cut -b 5-16 | wc -l)

it is giving following output,

Number of Requests: /dev/fd/63
Successfully Processed: /dev/fd/63
Already Provisioned: /dev/fd/63
Failed Requests:
Please see BulkProv200802042006.res file for details.
./provExpress: line 1: 30854 Exit 1 grep "The common subscriber data were added successfully" /opt/mmsc-2.2/bulktool/logging/log
30855 Done | awk -F '|' '{print $7}'
30859 Done | awk -F ':' '{print $3}'
30861 Done | cut -b 18-29
30862 Broken pipe | wc -l



node1# ./provExpress: line 1: 30857 Done grep "uPower response: Duplicate value" /opt/mmsc-2.2/bulktool/logging/log
30865 | awk -F '|' '{print $7}'
30869 | awk -F ':' '{print $3}'
30871 | cut -b 5-16
30872 Broken pipe | wc -l


Why am i having these weired things (all highlighted in bold)

Please help

thanks

muazfarooqaslam 02-04-2008 09:10 AM

sorry, pasted wrong code segment. Please see this one,

Code:

echo -n "Number of Requests: "
echo  <(wc -l $1)
echo -n "Successfully Processed: "
echo  <(grep "The common subscriber data were added
successfully" /opt/mmsc-2.2/bulktool/logging/log |awk -F '|' '{print
$7}' | awk -F ':' '{print $3}' | cut -b 18-29 | wc -l)
echo -n "Already Provisioned: "
echo  <(grep "uPower response: Duplicate value" /opt/mmsc-2.2
/bulktool/logging/log  | awk -F '|' '{print $7}' | awk -F ':' '{print
$3}' | cut -b 5-16 | wc -l)



All times are GMT -5. The time now is 02:48 AM.