Solved

uuencode

Posted on 2013-06-06
5
397 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
ID: 39226208
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
ID: 39226862
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
ID: 39226906
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
ID: 39226942
understood..
0
 
LVL 84

Expert Comment

by:ozo
ID: 39227621
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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…

685 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