help-bash
[Top][All Lists]
Advanced

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

Re: Calling a function with a shorter name


From: michael-franzese
Subject: Re: Calling a function with a shorter name
Date: Wed, 14 Apr 2021 04:35:36 +0200


> Sent: Wednesday, April 14, 2021 at 2:24 PM
> From: "Eli Schwartz" <eschwartz@archlinux.org>
> To: michael-franzese@gmx.com
> Cc: help-bash@gnu.org
> Subject: Re: Calling a function with a shorter name
>
> On 4/13/21 10:18 PM, michael-franzese@gmx.com wrote:
> > It is not really about saving a few bytes, but because it also takes 
> > parameters
> > and have the call chtcolr several times, I could use a shortcut and just 
> > add a
> > comment that I am calling chtcolr.
>
> Both functions and aliases do take parameters, though functions are
> better at that (because they process them as $1 etc. while aliases
> simply expand and leave parameters as regular words following the final
> command/word in the alias).

Would be better off using a function following your comment.
Thank you.

> I'm not sure what you mean here.
>
> > If I simply call it 'ct', everything becomes very cryptic.
>
> But you're already calling it "ct", on lines 488/489 of the script which
> isn't your test one. Isn't that cryptic too?

I see, I could move 'ct' to my test file and add a comment.  Will only use 'ct'
for my tests and a few other places.  Customarily, I use the full name.
Will only use the cryptic name very rarely.


> --
> Eli Schwartz
> Arch Linux Bug Wrangler and Trusted User
>
>



reply via email to

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