Re: [PATCH v7] ls-files: introduce "--format" option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> 于2022年7月20日周三 00:47写道:
>
> ZheNing Hu <adlternative@xxxxxxxxx> writes:
>
> > Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> 于2022年7月18日周一 16:29写道:
> >>
> >>
> >> On Wed, Jul 13 2022, ZheNing Hu via GitGitGadget wrote:
> >>
> >> > +test_expect_success 'setup' '
> >> > +     printf "LINEONE\nLINETWO\nLINETHREE\n" >o1.txt &&
> >> > +     printf "LINEONE\r\nLINETWO\r\nLINETHREE\r\n" >o2.txt &&
> >> > +     printf "LINEONE\r\nLINETWO\nLINETHREE\n" >o3.txt &&
> >>
> >> If you want to do this sort of thing in general this pattern is better:
> >>
> >>         x="a b c" &&
> >>         printf "%s\n" $x
> >>         printf "%s\r\n" $x
> >>
> >
> > Let see what's these cmd output:
> >
> > x="a b c" &&
> > printf "%s\n" $x &&
> > printf "%s\r\n" $x
> >
> > a b c
> > a b c
>
> The above makes it look as if your shell is broken or you have an
> unusual IFS that does not have space in it.  Are you sure you did
> not place anything around $x on the second and the third line, which
> is given to printf after its contents split into words at $IFS?

Ok... That's zsh's strange feature.... I turn to use bash, it's find.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux