Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: option to show file:line everytime echo is called?
- X-seq: zsh-users 22347
- From: Timothee Cour <timothee.cour2@xxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: option to show file:line everytime echo is called?
- Date: Wed, 11 Jan 2017 18:25:30 -0800
- Cc: Ray Andrews <rayandrews@xxxxxxxxxxx>, zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0zDXCeD2qoJuT1NIsKayEnmTGj/mODMBHWCAhHlTAoY=; b=Qrto/k2IMkL0UDF62aiZEK+4x/bGU8VQV0nm440GntrFmqmc7nrd4XV1sIhOaQPDAg PTQTpTxyIS/rTMsTFYlONISkbWeG99J0pJv9o8c1p7v8l+HDXPXd/Dut9ZAL3jcRRN1S kq2MAzqpZRuBVth7nbCvDS7DWDRoXGoe9oSczQKIzgzEuS67vuEYrcLo7UXuczRifyNH me0eDYRy7jFi4k7MwUb1zC2tK0wUtbeqSMdlLksdx2aCn9BwRI3LUZ/ZUG83NTMuulnY btrMURYDjDkN6TTdZ76MDWlsOZt1fZVZ5cRsHIZu1ePRIOY7Aoj+cx4aHXoPXSMxYhea IQgg==
- In-reply-to: <20170110181757.GA10906@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CANri+EzTiiKkfeDODR8PyBc=khLFONk738sFp7Vpo4uzwKMoXw@mail.gmail.com> <20170110123002.s4esovwcepqizzd5@begemot.ajrh.net> <8ed3897d-82d3-5c5f-f2c1-5382e311e931__1904.16159243814$1484070246$gmane$org@eastlink.ca> <20170110181757.GA10906@fujitsu.shahaf.local2>
actually this doesn't work:
path/.zshrc:
```
alias echo2='echo ${0:A}:$LINENO'
echo2 FOO
fun(){
echo2 BAR
}
fun
```
shows:
path/.zshrc:2 FOO #OK
$PWD/fun:1 BAR #NOT OK, I want path/.zshrc:4
On Tue, Jan 10, 2017 at 10:17 AM, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
wrote:
> Ray Andrews wrote on Tue, Jan 10, 2017 at 09:12:37 -0800:
> > On 10/01/17 04:30 AM, Anthony Heading wrote:
> > >
> > >Maybe use an alias?
> > >
> > >#!/bin/env zsh
> > >alias echo='echo ${0:A}:$LINENO'
> > Where can I read up on " ${0:A} ", I haven't seen that construction
> before.
> > And probably there's a host of siblings equally useful.
>
> That's the `:A' modifier applied to the `$0' variable.
>
> :A is in http://zsh.sourceforge.net/Doc/Release/Expansion.html#Modifiers
>
> $0 is in http://zsh.sourceforge.net/Doc/Release/Parameters.html#
> Parameters-Set-By-The-Shell
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author