Am 19. Mär, 2010 schwätzte Ron Johnson so:
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?
dpkg is outputting tabs.
Cut uses a tab as the default delimiter :).