Announcement

Collapse
No announcement yet.

Numerous linux hangovers?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by oshunluvr View Post
    If you want to see what kernels are install, use dpkg -l and grep to see what's installed. Something like:

    dpkg -l |grep -E "^[^rc]" | awk '{print $2}'

    I use:

    dpkg --list | awk '/linux-image/ {print $2}'
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #17
      I have "apt list --installed | grep -i" aliased to "apli" and so
      Code:
      apli linux-image
      works for me.
      Kubuntu 20.04

      Comment


        #18
        @kubicle, I have yet another question about your script!

        Since I don't have any "rc" files left, I'm using
        Code:
        PCKGS=$(COLUMNS=200 dpkg -l | grep breeze | tr -s ' ' | cut -d ' ' -f 2)
        instead of
        Code:
        PCKGS=$(COLUMNS=200 dpkg -l | grep "^rc" | tr -s ' ' | cut -d ' ' -f 2)
        to ask my question.

        First, I run
        Code:
        COLUMNS=200 dpkg -l | grep breeze | tr -s ' ' | cut -d ' ' -f 2 > ~/Desktop/breeze.txt
        I open ~/Desktop/breeze.txt in vim. Each line ends with a pilcrow (?) and there's no space immediately before the pilcrow as seen in the image:

        Click image for larger version

Name:	20210307180145.png
Views:	1
Size:	16.6 KB
ID:	645081

        Now, I run
        Code:
        PCKGS=$(COLUMNS=200 dpkg -l | grep "^rc" | tr -s ' ' | cut -d ' ' -f 2)
        and follow that with
        Code:
        echo ${PCKGS}
        which gives me:
        Code:
        breeze breeze-cursor-theme breeze-gtk-theme breeze-icon-theme kde-style-breeze kwin-style-breeze libreoffice-style-breeze sddm-theme-breeze
        The question: how do spaces appear between the package names? What does "echo ${PCKGS}" do to convert the "one package name per line" (as seen in the image) to the single line output with package names separated by spaces?
        Kubuntu 20.04

        Comment


          #19
          Originally posted by chimak111 View Post
          The question: how do spaces appear between the package names? What does "echo ${PCKGS}" do to convert the "one package name per line" (as seen in the image) to the single line output with package names separated by spaces?
          If you wish to preserve control chars, you'd put the variable in double quotes, otherwise they are replaced by spaces.
          echo "${PCKGS}" vs. echo ${PCKGS}

          Comment


            #20
            Originally posted by kubicle View Post
            If you wish to preserve control chars, you'd put the variable in double quotes, otherwise they are replaced by spaces.
            echo "${PCKGS}" vs. echo ${PCKGS}
            Okay, thanks! So many intricacies
            Kubuntu 20.04

            Comment


              #21
              Originally posted by chimak111;445046...
              Each line ends with a pilcrow (?) ...
              Taking that question mark as implying a question, your .vimrc (or some other rc file) includes something like
              Code:
              set nu list lcs=eol:?
              to make visible the line numbers and the ends of lines.
              Regards, John Little

              Comment


                #22
                Originally posted by jlittle View Post
                Taking that question mark as implying a question, your .vimrc (or some other rc file) includes something like
                Code:
                set nu list lcs=eol:?
                to make visible the line numbers and the ends of lines.
                Thanks!

                I have
                Code:
                set list listchars=tab:→\ ,nbsp:␣,eol:?
                in my .vimrc. My sticking the "?" in the earlier post was because I wasn't sure whether the ? was an end-of-line or carriage return or "\n". I'm don't know how/whether those differ and are to be termed.
                Kubuntu 20.04

                Comment

                Working...
                X