Re: What is wrong with my `nmcli device status`?

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

 



On 2020-08-24 20:07, ToddAndMargo via users wrote:
On 2020-08-24 02:21, Patrick O'Callaghan wrote:
On Sun, 2020-08-23 at 16:01 -0700, ToddAndMargo via users wrote:
On 2020-08-23 02:53, Patrick O'Callaghan wrote:
On Sat, 2020-08-22 at 18:21 -0700, ToddAndMargo via users wrote:
3) Why do you use "sed -n 1,1p" in GetGW?

Because I only wanted the first line.  Sometimes

with that commend you get two lines back.  I am

covering all my bases.

head -1

poc

Interesting.  It will print the first lines or the last lines.
Thank you!

Sed allows me to pick which ones I want.

'head' prints the first N lines (10 by default). See also 'tail'.

You said you wanted the first line, so 'head' is the obvious command,
but as with most things in UNIX/Linux, there is more than one way of
doing it.

poc

Some Raku trivia.  Print lines 3, 2, 5 in that order

$ cat Lines.txt
Line 0
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
Line 11

$ cat Lines.txt | raku -e ' my @x=$*IN.lines; for @x[3,2,5] {say $_};'
Line 3
Line 2
Line 5


And even quicker!

$ cat Lines.txt | raku -e '.say for lines()[3,2,5]'
Line 3
Line 2
Line 5


_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux