Fri, 19 Mar 2010 21:34:47 -0500 <ron.l.johnson@cox.net> wrote:
Googled and followed examples, which work, but my specific problem
doesn't work...
WORKS:
$ service="http mail ssh"
$ echo $service | cut -d\ -f2
mail
$ echo $service | cut -d' ' -f2
mail
dpkg --get-selections | grep -v deinstall$ | awk '{print $1}'
DOES NOT WORK:
$ dpkg --get-selections | grep -v deinstall$ | cut -d' ' -f1
$ dpkg --get-selections | grep -v deinstall$ | cut -d\ -f1
Is the problem that there's so *much* whitespace in the dpkg listing?
Firstly I am no pro at string manipulation but the working examples seems to have no line feed characters, whereas the "dpkg --get-selections" creates a new line for every package it prints.
In Unicode (linux)
LF: Line Feed, U+000A
I tried "dpkg --get-selections | grep -v deinstall$ | cut -d'\n' -f1" but still had not luck though...