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

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



On Sun, Nov 14, 2021, at 2:19 PM, 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?

It's interpreting "--------" as an option.  To print strings that
begin with "-" you can use the common "--" idiom to indicate that
subsequent arguments should not be interpreted as options.

    % print ------

    % print -- ------
    ------

-- 
vq




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