On Thu, Jul 20, 2023 at 3:28 PM Greg Wooledge wrote:
>
> The idea that this would "work" is quite surprising to me. The basic
> idea of a function is that it does stuff and then returns you to the
> point where you were when the function was called.
>
>
Really ?
> In other languages, would you
On Fri, 21 Jul 2023, 04:09 Greg Wooledge, wrote:
> On Fri, Jul 21, 2023 at 12:33:07AM +1000, Martin D Kealey wrote:
> > Saying that this *ought* to be done using aliases is not reasonable, as
> it
> > means forgoing the other stuff that functions can do, like taking
> > parameters, declaring loca
On Fri, Jul 21, 2023, 1:36 PM Greg Wooledge wrote:
> On Fri, Jul 21, 2023 at 01:15:16PM +0200, alex xmb ratchev wrote:
> > On Thu, Jul 20, 2023, 8:09 PM Greg Wooledge wrote:
> > > On Fri, Jul 21, 2023 at 12:33:07AM +1000, Martin D Kealey wrote:
> [...]
> > > Well in any case, the behavior you wa
On Fri, Jul 21, 2023 at 01:15:16PM +0200, alex xmb ratchev wrote:
> On Thu, Jul 20, 2023, 8:09 PM Greg Wooledge wrote:
> > On Fri, Jul 21, 2023 at 12:33:07AM +1000, Martin D Kealey wrote:
[...]
> > Well in any case, the behavior you wanted is not reliable across shells,
> > nor even across version
On Thu, Jul 20, 2023, 8:09 PM Greg Wooledge wrote:
> On Fri, Jul 21, 2023 at 12:33:07AM +1000, Martin D Kealey wrote:
> > C has longjmp, and other languages have exceptions. Non-local break is a
> > usable "Bash shaped" analogue of those. Not perfect, sure, but close
> enough
> > to be useful. (N
On Fri, Jul 21, 2023 at 12:33:07AM +1000, Martin D Kealey wrote:
> C has longjmp, and other languages have exceptions. Non-local break is a
> usable "Bash shaped" analogue of those. Not perfect, sure, but close enough
> to be useful. (Non-local continue is a logical extension of that.)
>
> Saying
i most dont understand your text story
On Thu, Jul 20, 2023, 3:03 PM Martin D Kealey
wrote:
>
>
> On Thu, 20 Jul 2023, 18:03 Grisha Levit, wrote:
>
>> Sounds like you want all the commands in the alias to be executed as a
>> group -- so you can just write it as one:
>>
>> alias bad='{ echo fail
On Thu, 20 Jul 2023, 23:28 Greg Wooledge, wrote:
> The idea that this would "work" is quite surprising to me.
Shell functions are SO unlike functions in other languages that it
surprises me that anyone would assume any particular parallel holds.
Everything about them is dynamic: where they fin
On Thu, Jul 20, 2023 at 11:03:35PM +1000, Martin D Kealey wrote:
> On Thu, 20 Jul 2023, 18:03 Grisha Levit, wrote:
>
> > Sounds like you want all the commands in the alias to be executed as a
> > group -- so you can just write it as one:
> >
> > alias bad='{ echo fail; continue; }'
> >
>
> That
On Thu, 20 Jul 2023, 18:03 Grisha Levit, wrote:
> Sounds like you want all the commands in the alias to be executed as a
> group -- so you can just write it as one:
>
> alias bad='{ echo fail; continue; }'
>
That right there USED to work as a function:
bad() { echo fail; continue; }
But then
the bugfixed version
that ran 24m long
On Thu, Jul 20, 2023, 10:08 AM alex xmb ratchev wrote:
>
>
> On Thu, Jul 20, 2023, 10:03 AM Grisha Levit wrote:
>
>>
>>
>> On Thu, Jul 20, 2023, 01:42 alex xmb ratchev wrote:
>>
>>>
>>>
>>> 2. it says [[ ! -d then ' continue ' .. where is cp
>>> i call no
On Thu, Jul 20, 2023, 10:03 AM Grisha Levit wrote:
>
>
> On Thu, Jul 20, 2023, 01:42 alex xmb ratchev wrote:
>
>>
>>
>> 2. it says [[ ! -d then ' continue ' .. where is cp
>> i call no , not c , ...
>> 1. cp missing
>> 2. the [[ ! -d return to continue looks bug wrong
>>
>
> Try putting the code
On Thu, Jul 20, 2023, 01:42 alex xmb ratchev wrote:
>
>
> 2. it says [[ ! -d then ' continue ' .. where is cp
> i call no , not c , ...
> 1. cp missing
> 2. the [[ ! -d return to continue looks bug wrong
>
Try putting the code that uses the alias into a function, and then print
the function defi
sorry for possible negative effected texting
i d wish to discuss , why aliases are a big gain , and why so my indenting
i ve been in #bash and #awk since 200[012] , where such negative english
texting like me getting banned there for years , ..
i did learn back then , and did , and do answer bash
Hi Alex
Aliases are not functions, and they don't work the same way.
A function is like a separate script, except that it runs in the same
process & context as the caller. Its meaning is determined as the script
RUNS.
An alias is quite different: it replaces tokens while the script is being
PARSE
15 matches
Mail list logo