Shell script to call apt-get install --reinstall

2001-09-21 Thread Josh McKinney
I am trying to call a shell script to reinstall all packages.  I have a file
that lists all installed packages called file.  The problem is when I call the
script it just goes by saying it couldn't find the package.
Here is the script.

#!/bin/bash

cat file | (IFS=  ; while read prog; do apt-get install --reinstall $prog; 
done)

Thanks
Josh
-- 
Linux, the choice| Pedaeration, n.:  The perfect body heat
of a GNU generation   -o)| achieved by having one leg under the  sheet
Kernel 2.4.9-ac12  /\| and one hanging off the edge of the bed.   
on a i586 _\_v   | -- Rich Hall, Sniglets 
 | 



Re: Shell script to call apt-get install --reinstall

2001-09-21 Thread Colin Watson
(Your Mail-Followup-To: is broken, by the way, as it doesn't give your
domain: Mail-Followup-To: josh, debian-user@lists.debian.org.)

On Fri, Sep 21, 2001 at 01:10:23AM -0500, Josh McKinney wrote:
 I am trying to call a shell script to reinstall all packages.  I have
 a file that lists all installed packages called file.  The problem
 is when I call the script it just goes by saying it couldn't find the
 package.
 Here is the script.
 
 #!/bin/bash

#!/bin/sh should be fine for most simple shell scripts (and many complex
ones too).

 cat file | (IFS=  ; while read prog; do apt-get install --reinstall $prog; 
 done)

If file contains newlines, then your IFS setting will be too strict.

Personally, I'd use 'xargs apt-get --reinstall install  file'.

Cheers,

-- 
Colin Watson  [EMAIL PROTECTED]