Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: print built-in doesn't print this.



On Sun, 2021-11-14 at 11:19 -0800, jdh wrote:
> I wanted to insert a string of '-'s to visually show a change in a list.
> But  I found out that
> 
>      print "--------"
> 
> Does not print anything out. Well maybe a \n.
> Is this intentional?  Or a well known feature?

print has standard option syntax, so you need to terminate
lists of options (even if they're empty) with "--".

print -- "--------"

The echo builtin is non-standard and doesn't have this
requirement, but it's non-standard in a different way in
different shells, so I'd recommend getting used to using
print like that.

pws







Messages sorted by: Reverse Date, Date, Thread, Author