[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: function that prints each argument on a new line
From: |
Alex fxmbsw7 Ratchev |
Subject: |
Re: function that prints each argument on a new line |
Date: |
Tue, 6 Jul 2021 14:32:04 +0200 |
printf fmt is once, per next arguments
On Tue, Jul 6, 2021, 14:30 <lisa-asket@perso.be> wrote:
> From: Greg Wooledge <greg@wooledge.org>
> To: help-bash@gnu.org
> Subject: Re: function that prints each argument on a new line
> Date: 06/07/2021 13:54:01 Europe/Paris
>
> On Tue, Jul 06, 2021 at 01:40:46PM +0200, lisa-asket@perso.be wrote:
> > Would like to have a function that prints a number of lines by passing
> them as arguments.
>
> f() { printf '%s\n' "$@"; }
>
>
>
> I thought I would have to repeat the format `$#` times. Is that not so?
>
>
>