help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: eshell aliases and extra parameters


From: Colin Baxter
Subject: Re: eshell aliases and extra parameters
Date: Wed, 19 Jun 2019 06:26:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Dear Jonetsu,
>>>>> jonetsu  <jonetsu@teksavvy.com> writes:

    > Hello, I have defined an alias for eshell, which is found in
    > .emacs/eshell/alias :

    > alias PC17 g++ -Wall -std=c++17 -pthread $1

    > This works fine to compile files, such as:

    > PC17 explicit.cc

    > Although it does not work when an extra compile parameter is
    > added, such as:

    > PC17 -DEXPLICIT explicit.cc g++: fatal error: no input files

    > It looks like $1 does not stand for any number of arguments,
    > taking one and rejecting any others.

    > At the regular Linux console, the just-about same (w/o the $1)
    > alias works with extra params:

    > alias PC17='g++ -Wall -std=c++17 -pthread

    > % PC17 -DEXPLICIT explicit.cc

    > Is there a way to add on-the-spot parameters in eshell w/o having
    > to modify the eshell alias itself ?

Try $* rather than $1, as in

alias PC17 g++ -Wall -std=c++17 -pthread $*

Best wishes,

Colin Baxter.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]