[ubuntu-uk] Post install additions
tony.arnold at manchester.ac.uk
Tue Jun 24 22:48:38 BST 2008
> Tony Arnold wrote:
>> sudo aptitude install `grep -v '^#' packages`
> Tony >>> I'm very new to bash scripting, so can I just check...
> Am I right in thinking that
> grep -v '^#'
> means 'print lines that do not start with #'
> So I take it you rem out some lines in the packages file, and this
> expression ignores them?
Also correct. I can comment out packages or I can also put lines at the
start of the file starting with # to remind me what the file is all about.
> (And am I right in thinking that the ` ` signs around the expression
> after "install" are produced by the key to the left of the 1/! key on
> the top line of the keyboard?)
Also correct. The back quote cause the stuff between the quotes to be
executed and the output fed back into the command line. That process
also replaces newlines with spaces, so all my package names effectively
appear after the word 'install', each name separated by a space.
And, of course, aptitude ignored any packages that are already
installed, so I can run this script as often as I like adding the odd
package in between. (It doesn't remove anything, though, I do that by
hand if I need to.)
Tony Arnold, IT Security Coordinator, University of Manchester,
IT Services Division, Kilburn Building, Oxford Road, Manchester M13 9PL.
T: +44 (0)161 275 6093, F: +44 (0)870 136 1004, M: +44 (0)773 330 0039
E: tony.arnold at manchester.ac.uk, H: http://www.man.ac.uk/Tony.Arnold
More information about the ubuntu-uk