Changeset 59 for confman/confman


Ignore:
Timestamp:
04/06/2006 20:41:27 (6 years ago)
Author:
ccowart
Message:

Importing not-world-readable files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • confman/confman

    r58 r59  
    1 #! /usr/local/bin/bash 
     1#! /bin/bash 
    22# 
    33# confman provides a command-line interface to Rescomp's server configuration  
     
    504504                local count 
    505505 
     506                # Let's see if we can read the file as ourself: 
     507                if [ ! -r $file ] ; then 
     508                        usefile=`mktemp -t confman` 
     509                        sudo cat $file > $usefile 
     510                else 
     511                        usefile="$file" 
     512                        cat $file > $usefile 
     513                fi 
     514 
    506515                # Put all non-alphanumerics into a file 
    507                 awk '{print $1}' $file | egrep -o "^[^-_A-Za-z0-9]" > $tmpfile 
    508                 for char in `cat $file | sort | uniq` ; do 
     516                awk '{print $1}' $usefile | egrep -o \ 
     517                        "^[^-_A-Za-z0-9]" > $tmpfile 
     518 
     519                for char in `cat $tmpfile | sort | uniq` ; do 
    509520                        count=`egrep -o "\\$char" $tmpfile | wc -l` 
    510521                        if [ $count -gt $biggestcount ] ; then 
Note: See TracChangeset for help on using the changeset viewer.