*To*: debian-user <debian-user@lists.debian.org>*Subject*: Re: shell wrappers for trig and other mathematical functions*From*: David <bouncingcats@gmail.com>*Date*: Thu, 3 Oct 2019 15:21:14 +1000*Message-id*: <[🔎] CAMPXz=qW7ZZDx6a197knsVEEcGaFt6Ms-o8CVXEe=KpTAtkSTQ@mail.gmail.com>*In-reply-to*: <[🔎] CAD8GWssAk=NosD9ZLibrOgCSi35YN6tQbUdSKHLdpOzDA0VZGA@mail.gmail.com>*References*: <[🔎] CAOphizJnMAXDnLRaMNRUGpC2A7W6S03nJGXb2Pgk53wF71WRzw@mail.gmail.com> <[🔎] bf98c73f-4937-1352-8664-538c89a37954@holgerdanske.com> <[🔎] CAOphiz+_06DQtoP0NOzbR4BuvMu9oCpY79AFt5zHdYih9puquQ@mail.gmail.com> <[🔎] 20191002125529.GT28751@eeg.ccf.org> <[🔎] CAD8GWssAk=NosD9ZLibrOgCSi35YN6tQbUdSKHLdpOzDA0VZGA@mail.gmail.com>

On Thu, 3 Oct 2019 at 02:39, Lee <ler762@gmail.com> wrote: > On 10/2/19, Greg Wooledge <wooledg@eeg.ccf.org> wrote: >> This is what shell functions are for. You can just drop the shell >> functions into your ~/.bashrc and then use them in every interactive >> shell thenceforth. >> I strongly recommend this approach over the aliases that were previously >> suggested, by the way. Functions are so much cleaner. > How are functions cleaner? > I've been using aliases for I don't know how long and haven't noticed > any problems: > what am I missing? Seeing as this is a FAQ, I hope it's not impolite for me to respectfully chip-in with some links in reply: https://mywiki.wooledge.org/BashGuide/CommandsAndArguments#Aliases https://mywiki.wooledge.org/BashGuide/CommandsAndArguments#Functions http://mywiki.wooledge.org/BashFAQ/080 https://mywiki.wooledge.org/BashGuide/CompoundCommands#Functions I understand "cleaner" to mean that functions take arguments, so they work in a way that is more intuitive and robust. One mechanism (alias) is a leading-text substitution, the other (function) is a programming language. Use what meets your needs, with aware of limitations and alternatives. aliases have an easy user interface. 'man bash' says: For almost every purpose, aliases are superseded by shell functions. I hope this is a useful response, apologies if you knew all this already.

**Follow-Ups**:**Re: shell wrappers for trig and other mathematical functions***From:*Lee <ler762@gmail.com>

**References**:**shell wrappers for trig and other mathematical functions***From:*Dan Hitt <dan.hitt@gmail.com>

**Re: shell wrappers for trig and other mathematical functions***From:*David Christensen <dpchrist@holgerdanske.com>

**Re: shell wrappers for trig and other mathematical functions***From:*Dan Hitt <dan.hitt@gmail.com>

**Re: shell wrappers for trig and other mathematical functions***From:*Greg Wooledge <wooledg@eeg.ccf.org>

**Re: shell wrappers for trig and other mathematical functions***From:*Lee <ler762@gmail.com>

- Prev by Date:
**Re: Breaking the mail thread. Was: Re: Authentication for telnet.** - Next by Date:
**Re: USB flash drive opens read only -- how to fix?** - Previous by thread:
**Re: OT: Reason to buy a Raspberry Pi ;-) (was Re: shell wrappers for trig and other mathematical functions)** - Next by thread:
**Re: shell wrappers for trig and other mathematical functions** - Index(es):