bug-bash
[Top][All Lists]
Advanced

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

Re: ignoring comments in a 'cat' call


From: Chris F.A. Johnson
Subject: Re: ignoring comments in a 'cat' call
Date: Wed, 7 Oct 2009 22:58:39 -0400 (EDT)
User-agent: Alpine 2.00 (LMD 1167 2008-08-23)

On Wed, 7 Oct 2009, Tamlyn1978 wrote:

> I have a file with a list of programs with comments describing what they do,
> e.g.
> 
> unison # file syncronisation
> grass # gis program
> 
> I have a script, which I run as root and includes the command:
> 
> address@hidden:~$ aptitude install $(cat programs) -y
> 
> where 'programs' is the file with the list of programs. Aptitude does not
> ignore the '#' comments, reading them, and the subsequent comment text as
> package files.
> 
> Is there a way to make 'cat' ignore the comments or is there a better
> alternative to cat in this case?

aptitude install $(cut -d ' ' -f1 programs) -y

-- 
   Chris F.A. Johnson, webmaster         <http://woodbine-gerrard.com>
   ===================================================================
   Author:
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]