Hi Craig,
You can pipe the following awk command:
awk '/has the variants/ {curport=$1; next} NF==1 $1~/\[\+\]/ {print
curport,substr($1,4),Default; next} NF==1 {print curport,$1,N}'
Francois.
Le 30/09/2014 17:44, Craig Treleaven a écrit :
tl;dr version:
How do I transform a listing
tl;dr version:
How do I transform a listing like this:
$ port variants php53-mysql php54-mysql |grep -v conflicts |grep -e
mariadb -e mysql -e percona | cut -d : -f 1
php53-mysql has the variants
mariadb
mysql4
mysql5
mysql51
mysql55
mysql56
[+]mysqlnd
percona
php54-mysql
On Tue, Sep 30, 2014 at 11:44 AM, Craig Treleaven ctrelea...@macports.org
wrote:
I have only rudimentary acquaintance with sed and less with awk. I'd like
to learn more and this seemed like an opportunity to do so. From some
reading [1], I think sed's Hold buffer is the way to extract the
At 2:27 PM -0400 9/30/14, Lawrence Velázquez wrote:
On Sep 30, 2014, at 12:00 PM, Brandon Allbery allber...@gmail.com wrote:
On Tue, Sep 30, 2014 at 11:44 AM, Craig
Treleaven ctrelea...@macports.org wrote:
I have only rudimentary acquaintance with sed
and less with awk. I'd like to learn
On Sep 30, 2014, at 4:02 PM, Craig Treleaven ctrelea...@macports.org wrote:
you've given me a complete solution!
I just realized that you're probably using N to signify that a variant is not
selected, so Y should be used if a variant *is* selected.
# Save port to hold space.
/ has the
At 2:27 PM -0400 9/30/14, Lawrence Velázquez wrote:
On Sep 30, 2014, at 12:00 PM, Brandon Allbery allber...@gmail.com wrote:
On Tue, Sep 30, 2014 at 11:44 AM, Craig
Treleaven ctrelea...@macports.org wrote:
I have only rudimentary acquaintance with
sed and less with awk. I'd like to learn