6

Using pipe in bash - is this the expected behaviour?

view full story
linux-howto

http://www.unix.com – Hi all, Am trying to convert a script from ksh to bash :wall:. One of the sub is something like below: Code: #!/bin/bash declare -a array01 step_01_test() {   local count=0   ps -ef | grep watch | grep -v grep | awk '{ print $8 }' | while read line   do       let count=${count}+1       array01[${count}]="${line}"       echo "---> ${array01[*]}"   done } step_02_test() {   local count=0   ps -ef | grep watch | grep -v grep | awk '{ print $8 }' > x.txt   while read line &nbs (HowTos)