Solved

uuencode

Posted on 2013-06-06
5
385 Views
Last Modified: 2013-06-06
In the below shell, I wanted to know what is this uuencode doing..please help !

uuencode  $tradehome/$log/offset_trade.csv  $tradehome/$log/offset_trade.csv | /usr/ucb/mail -s "OFFSET TRADE EXCEPTION" ODSOffsetTradeExceptions@caxton.com



#!/bin/ksh -xve
# 01/26/01 SV  removed the Count(1) from the table
date
#rm   $tradehome/$log/offset_trade.csv
#touch  $tradehome/$log/offset_trade.csv
#chmod 777 $tradehome/$log/offset_trade.csv
echo "Started loading offset_trade_exception \n"
sqlplus -s $odsuser/$odspass <<!
whenever oserror  exit failure
whenever sqlerror exit failure
--
exec offset_trade_excep
--
!
echo "Finished Loading offset_trade_exception\n"
uuencode  $tradehome/$log/offset_trade.csv  $tradehome/$log/offset_trade.csv | /usr/ucb/mail -s "OFFSET TRADE EXCEPTION" ODSOffsetTradeExceptions@caxton.com
date

Open in new window

0
Comment
Question by:d27m11y
  • 2
  • 2
5 Comments
 
LVL 3

Assisted Solution

by:tsnirone
tsnirone earned 250 total points
Comment Utility
Seems the file:

$tradehome/$log/offset_trade.csv

gets encoded to itself (overwrite)

before it gets sent to that email adress with a subject of "OFFSET TRADE EXCEPTION"

In short: Its a formatting thing done to ensure that the receiver of the email can actually read the file sent.

http://en.wikipedia.org/wiki/Uuencoding

Hope this helps :)
0
 

Author Comment

by:d27m11y
Comment Utility
Is it used to convert Binary to ASCII.. is that what it is doing here ?
0
 
LVL 3

Accepted Solution

by:
tsnirone earned 250 total points
Comment Utility
Yes.

"Uuencoding is a form of binary-to-text encoding that originated in the Unix program uuencode, for encoding binary data for transmission over the uucp mail system." (from wiki)

:)
0
 

Author Closing Comment

by:d27m11y
Comment Utility
understood..
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
man uuencode
NAME
     uudecode, uuencode -- encode/decode a binary file

SYNOPSIS
     uuencode [-m] [-o output_file] [file] name
     uudecode [-cips] [file ...]
     uudecode [-i] -o output_file [file]

DESCRIPTION
     The uuencode and uudecode utilities are used to transmit binary files over transmission mediums that do not support other than
     simple ASCII data.

     The uuencode utility reads file (or by default the standard input) and writes an encoded version to the standard output, or
     output_file if one has been specified.  The encoding uses only printing ASCII characters and includes the mode of the file and
     the operand name for use by uudecode.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now