Hey there !
I am trying to do this
P=`echo "${array[j]}" | grep $somevalue`
echo $P
But P seems to get filled with blank spaces. echo "${array[j]}" alone works fine but piping it to grep doesnt work it seems. Is there a better way of doing this?
Appreciate any help.
Ara
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Bash array pipe
Re: Bash array pipe
please show us fully working examples.
please use code tags: to display code.
what are you trying to achieve? it seems convoluted (grep will return the whole line anyway).
it could most probably be achieved with pure bash (grep is an external utility, and every pipe '|' opens a new shell, try to avoid that).
please use code tags:
Code: Select all
code goes here
what are you trying to achieve? it seems convoluted (grep will return the whole line anyway).
it could most probably be achieved with pure bash (grep is an external utility, and every pipe '|' opens a new shell, try to avoid that).
Re: Bash array pipe
You are right. I dont need the grep, i assumed i did in the back of my mind(new to bash). Thanks!