On 03/28/10 09:46, Sergio de Almeida Lenzi wrote: <snip> > this scripts outputs the commands needed to fix the system
I'm having some problems with the script. > watch out > ================================== > #!/bin/sh > > endp() { > rm -f $t > exit $1 > } > > t=/tmp/$$ > > if [ $# -ne 1 ] > then > echo use $0 library > endp 1 > fi > > lib=$1 > > find /usr/local/bin /usr/local/lib -name -type f | \ Is the 'f' a typo? I had to remove it because find kept on erroring on it. > while read x > do > grep $lib $x | \ > awk '{print $3}' | \ > while read y > do > pkg_info -W $y >> $t > done > done > awk '{print $NF}' $t | sort -u > /tmp/buildpkglist > echo nice portmaster -Bdg `cat /tmp/buildpkglist` > endp 0 The final output (after removing the stray 'f'): ./portmaster-script jpeg awk: can't open file /tmp/42352 source line number 1 nice portmaster -Bdg ran as regular user and root to no different affect. I switched out all instances of awk for grep with the following result: ./portmaster-script jpeg grep: /tmp/42436: No such file or directory nice portmaster -Bdg Thanks for the suggestion, but this script doesn't seem to work on my system and I can't seem to figure out what exactly is causing it to fail. -- Yours In Christ, PIT Emails are not formal business letters, whatever businesses may want. Original content copyright under the OWL http://owl.apotheon.org Please do not CC me. If I'm posting to a list it is because I am subscribed.
signature.asc
Description: OpenPGP digital signature