Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Ryan Hill <dirtyepic@g.o>
Subject: Re: [gentoo-commits] gentoo-x86 commit in net-misc/openvpn: ChangeLog openvpn-2.1.3.ebuild
Date: Fri, 1 Oct 2010 21:38:56 -0600
On Fri, 1 Oct 2010 20:47:38 +0530
Nirbheek Chauhan <nirbheek@g.o> wrote:

> On Fri, Oct 1, 2010 at 6:37 PM, Peter Volkov <pva@g.o> wrote:
> > В Пнд, 27/09/2010 в 11:37 +0000, Dirkjan Ochtman (djc) пишет:
> >> src_compile() {
> >>       use static && sed -i -e '/^LIBS/s/LIBS = /LIBS = -static /' Makefile
> >>
> >>       emake || die "make failed"
> >>
> >>       if ! use minimal ; then
> >>               cd plugin
> >>               for i in $( ls 2>/dev/null ); do
> >
> > This is bad construction:
> > http://mywiki.wooledge.org/BashPitfalls#for_i_in_.24.28ls_.2A.mp3.29
> >
> 
> A nice way around this is to do the following:
> 
>     ls -1 | while read i; do
> 
> `read` delimits on newline, so you're safe.

This strips leading and trailing whitespace.

$ touch " test1"
$ touch "test2 "
$ touch "test 3"
$ touch " test 4 "

$ ls -1 | while read i; do echo "###${i}###"; done
###test2###
###test 3###
###test1###
###test 4###

instead use:

$ ls -1 | while IFS= read i; do echo "###${i}###"; done
###test2 ###
###test 3###
### test1###
### test 4 ###

or recursively:

$ find . -type f -print0 \
  | while IFS= read -d $'\0' i; do echo "###${i}###"; done
###./ test1###
###./ test 4 ###
###./test 3###
###./test2 ###

or just make things simple on yourself :)

$ for i in *; do echo "###${i}###"; done
### test1###
###test2 ###
###test 3###
### test 4 ###


-- 
fonts, gcc-porting,             we hold our breath, we spin around the world
toolchain, wxwidgets            you and me cling to the outside of the earth
@ gentoo.org                EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662
Attachment:
signature.asc (PGP signature)
Replies:
Re: Re: [gentoo-commits] gentoo-x86 commit in net-misc/openvpn: ChangeLog openvpn-2.1.3.ebuild
-- Nirbheek Chauhan
References:
Re: [gentoo-commits] gentoo-x86 commit in net-misc/openvpn: ChangeLog openvpn-2.1.3.ebuild
-- Peter Volkov
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Re: [gentoo-commits] gentoo-x86 commit in net-misc/openvpn: ChangeLog openvpn-2.1.3.ebuild
Next by thread:
Re: Re: [gentoo-commits] gentoo-x86 commit in net-misc/openvpn: ChangeLog openvpn-2.1.3.ebuild
Previous by date:
Re: .la files removal news item (GLEP 42)
Next by date:
Re: .la files removal news item (GLEP 42)


Updated Jun 29, 2012

Summary: Archive of the gentoo-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.