Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.utils.bug > #2187

Re: UUencode and emails problems

Path csiph.com!xmission!news.glorb.com!usenet.stanford.edu!not-for-mail
From Bruce Korb <bkorb@gnu.org>
Newsgroups gnu.utils.bug
Subject Re: UUencode and emails problems
Date Wed, 26 Aug 2015 16:16:16 -0700
Lines 47
Approved bug-gnu-utils@gnu.org
Message-ID <mailman.167.1440630984.28410.bug-gnu-utils@gnu.org> (permalink)
References <3F89B7EEBF109541B08F8F5DF1936A051087E06F@CERES.corp.alfamobile.com.lb>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Trace usenet.stanford.edu 1440630985 2305 208.118.235.17 (26 Aug 2015 23:16:25 GMT)
X-Complaints-To action@cs.stanford.edu
To RALPH ABI RACHED <RALPH.ABIRACHED@alfamobile.com.lb>, "bug-gnu-utils@gnu.org" <bug-gnu-utils@gnu.org>
Envelope-to bug-gnu-utils@gnu.org
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0
In-Reply-To <3F89B7EEBF109541B08F8F5DF1936A051087E06F@CERES.corp.alfamobile.com.lb>
X-detected-operating-system by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value).
X-Received-From 2001:4830:134:3::e
X-BeenThere bug-gnu-utils@gnu.org
X-Mailman-Version 2.1.14
Precedence list
List-Id Bug reports for the GNU utilities <bug-gnu-utils.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-gnu-utils>, <mailto:bug-gnu-utils-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-gnu-utils>
List-Post <mailto:bug-gnu-utils@gnu.org>
List-Help <mailto:bug-gnu-utils-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-gnu-utils>, <mailto:bug-gnu-utils-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.utils.bug:2187

Show key headers only | View raw


On 08/26/15 11:44, RALPH ABI RACHED wrote:
> WEEKDAY=`date '+%a'`
> if [[ "$WEEKDAY" = "Sun" ]]
> then
>          print "Week Number,From,To,Idle Average (%),Load Average (%)" > $TRASH/week_avg.sar
>          SAR_FILES_COUNT=`ls -ltr ${SAR_ARCHIVE_DIR}/sar_${THIS_YEAR}* | wc -l`
>
>          let i=1
>          while (( i < SAR_FILES_COUNT ))
>          do
>                          let j=i+7
>                          ls -ltr ${SAR_ARCHIVE_DIR}/sar_${THIS_YEAR}* | awk '{print $9}' | sed -n "${i},${j}p" | xargs grep Average > $TRASH/temp.sar
>                          let SUM=0
>                          while read LINE
>                          do
>                                          IDLE_VAL=`echo -e $LINE | awk '{print $5}'`
>                                          let SUM=SUM+IDLE_VAL
>                          done < $TRASH/temp.sar
>                          let AVG=SUM/7
>
>                          FIRST_DAY=`sed -n '1p' $TRASH/temp.sar | awk -F_ '{print $3}' | awk -F: '{print $1}'`
>                          LAST_DAY=`sed -n '7p' $TRASH/temp.sar | awk -F_ '{print $3}' | awk -F: '{print $1}'`
>                          let WEEK_NUMBER=${j}/7
>                          let LOAD_AVG=100-AVG
>                          print "${WEEK_NUMBER},${FIRST_DAY},${LAST_DAY},${AVG},${LOAD_AVG}" >> $TRASH/week_avg.sar
>                          let i=j
>          done
>          uuencode $TRASH/week_avg.sar weekly_avg_$CURRENT_DATE.csv >> /svw/svwtst1b/work/billops/temp_mail.sar
> fi
>
> echo -e $TXT_MAIL >> /svw/svwtst1b/work/billops/temp_mail.sar
>
> nail -r "BOP" -s "System Activity Reporter" $TO < /svw/svwtst1b/work/billops/temp_mail.sar

Wow.

A) why not just "tar -cJf" it and attach using MIME.
B) if you have to roll your own, wny not use "shar"?
    it just does all that stuff for you.
C) you can use compression options with shar, too,
    to make it much moore compact than just "uuencoding"
    all the files
D) *plus* if files meet the criteria for "text" files,
    the uuencoding step can be skipped.

So, what are you really trying to accomplish?

Back to gnu.utils.bug | Previous | Next | Find similar


Thread

Re: UUencode and emails problems Bruce Korb <bkorb@gnu.org> - 2015-08-26 16:16 -0700

csiph-web