> On Aug 4, 2017, at 9:12 PM, ToddAndMargo wrote:
>
> Hi All,
>
> How would you convert this one liner over to a Perl 6 one
> liner with a pipe?
>
> ifconfig | grep flags | awk '{print $1}' | sort | sed -n 2,2p | sed -e 's/://‘
—snip—
First attempt; straight translation:
ifconfig | perl6 -e '
On 08/05/2017 12:34 AM, Elizabeth Mattijsen wrote:
On 5 Aug 2017, at 09:21, ToddAndMargo wrote:
On 08/04/2017 08:43 PM, Bruce Gray wrote:
P6-ish version:
ifconfig | perl6 -e 'say lines.map({ ~$0 if /^(\S+) ": flags="/ }).sort[1]'
Would some kind person please tell me what is going on here?
> On 5 Aug 2017, at 09:21, ToddAndMargo wrote:
>
> On 08/04/2017 08:43 PM, Bruce Gray wrote:
>> P6-ish version:
>> ifconfig | perl6 -e 'say lines.map({ ~$0 if /^(\S+) ": flags="/ }).sort[1]'
>
> Would some kind person please tell me what is going on here?
say the result of
reading all lines
On 08/04/2017 08:43 PM, Bruce Gray wrote:
P6-ish version:
ifconfig | perl6 -e 'say lines.map({ ~$0 if /^(\S+) ": flags="/ }).sort[1]'
Would some kind person please tell me what is going on here?
> On 5 Aug 2017, at 08:50, Sean McAfee wrote:
>
> On Fri, Aug 4, 2017 at 10:18 PM, ToddAndMargo wrote:
> On 08/04/2017 08:43 PM, Bruce Gray wrote:
>
> P6-ish version:
> ifconfig | perl6 -e 'say lines.map({ ~$0 if /^(\S+) ": flags="/ }).sort[1]'
>
>
> Wait a second. How does map skip input el
On Sat, Aug 5, 2017 at 2:50 AM, Sean McAfee wrote:
> On Fri, Aug 4, 2017 at 10:18 PM, ToddAndMargo
> wrote:
>
>> On 08/04/2017 08:43 PM, Bruce Gray wrote:
>>
>>>
>>> P6-ish version:
>>> ifconfig | perl6 -e 'say lines.map({ ~$0 if /^(\S+) ": flags="/
>>> }).sort[1]'
>>>
>>
>>
> Wait a second. Ho
On Fri, Aug 4, 2017 at 10:18 PM, ToddAndMargo wrote:
> On 08/04/2017 08:43 PM, Bruce Gray wrote:
>
>>
>> P6-ish version:
>> ifconfig | perl6 -e 'say lines.map({ ~$0 if /^(\S+) ": flags="/
>> }).sort[1]'
>>
>
>
Wait a second. How does map skip input elements like that?
> map { $_ if $_ %% 2 }, 1
On 08/04/2017 08:43 PM, Bruce Gray wrote:
On Aug 4, 2017, at 9:12 PM, ToddAndMargo wrote:
Hi All,
How would you convert this one liner over to a Perl 6 one
liner with a pipe?
ifconfig | grep flags | awk '{print $1}' | sort | sed -n 2,2p | sed -e 's/://‘
—snip—
First attempt; straight tran
Sorry, i typo'd
ifconfig | perl6 -e 'lines.grep(/flags/).map(*.words[0]).sort[1].chop'
On 08/05/2017 05:41 AM, ToddAndMargo wrote:
> On 08/04/2017 08:14 PM, Timo Paulssen wrote:
>> ifconfig | perl6 -e 'lines.grep("flags").map(*.words[0]).sort[1].chop'
>>
>> this should do the trick. i'm not sure
On 08/04/2017 08:14 PM, Timo Paulssen wrote:
ifconfig | perl6 -e 'lines.grep("flags").map(*.words[0]).sort[1].chop'
this should do the trick. i'm not sure if 2,2p is meant to "output just
the second result" and if it's okay to just unconditionally remove the
last character.
hth
- Timo
2,
ifconfig | perl6 -e 'lines.grep("flags").map(*.words[0]).sort[1].chop'
this should do the trick. i'm not sure if 2,2p is meant to "output just
the second result" and if it's okay to just unconditionally remove the
last character.
hth
- Timo
11 matches
Mail list logo