From: Timothee Cour <timothee.cour2@gmail.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: Ray Andrews <rayandrews@eastlink.ca>, zsh-users@zsh.org
Subject: Re: option to show file:line everytime echo is called?
Date: Wed, 11 Jan 2017 18:25:30 -0800 [thread overview]
Message-ID: <CAM4j=kNB0ZVa5LdYgLOmfG=82EXOLzYjGEJ=H7Bo42qBQH3rWw@mail.gmail.com> (raw)
In-Reply-To: <20170110181757.GA10906@fujitsu.shahaf.local2>
[-- Attachment #1: Type: text/plain, Size: 859 bytes --]
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@daniel.shahaf.name>
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
>
next prev parent reply other threads:[~2017-01-12 2:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170110091259epcas5p14d052ee1dc7ebb5c4dd74e4aa02a8d18@epcas5p1.samsung.com>
2017-01-09 23:55 ` Timothee Cour
2017-01-10 9:30 ` Peter Stephenson
2017-01-10 11:22 ` Timothee Cour
2017-01-10 12:28 ` Peter Stephenson
[not found] ` <CANri+EwT3h8MkpeKSd-9_QLp9S=TEibmSgjS3r9mv0jY46dQAw__39244.7733007886$1484262699$gmane$org@mail.gmail.com>
2017-01-13 3:57 ` Daniel Shahaf
2017-01-13 7:57 ` Bart Schaefer
2017-01-13 8:06 ` Bart Schaefer
2017-01-13 8:31 ` Timothee Cour
2017-01-13 8:32 ` Timothee Cour
2017-01-14 0:36 ` Ray Andrews
2017-01-14 16:58 ` Bart Schaefer
[not found] ` <alpine.LRH.2.00.1701122304500.4560__6317.49331155351$1484294388$gmane$org@toltec.zanshin.com>
2017-01-13 14:52 ` Daniel Shahaf
2017-01-10 12:30 ` Anthony Heading
2017-01-10 12:50 ` Timothee Cour
2017-01-10 17:12 ` Ray Andrews
[not found] ` <8ed3897d-82d3-5c5f-f2c1-5382e311e931__1904.16159243814$1484070246$gmane$org@eastlink.ca>
2017-01-10 18:17 ` Daniel Shahaf
2017-01-12 2:25 ` Timothee Cour [this message]
2017-01-12 4:33 ` Anthony Heading
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAM4j=kNB0ZVa5LdYgLOmfG=82EXOLzYjGEJ=H7Bo42qBQH3rWw@mail.gmail.com' \
--to=timothee.cour2@gmail.com \
--cc=d.s@daniel.shahaf.name \
--cc=rayandrews@eastlink.ca \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).