LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   uuencode in Linux (https://www.linuxquestions.org/questions/linux-newbie-8/uuencode-in-linux-4175478647/)

ptm9 09-26-2013 10:54 AM

uuencode in Linux
 
Hello,

I am relatively new to Linux but have a variety of other "UNIX" experience. I am working on an application and need to send an email attachment via mailx. In the past on "UNIX" I used uuencode to accomplish this. uuencode is not installed on any of our boxes and we are currently without a sysadmin. Are their any alternatives for uuencode in standard out-of-the-box Redhat Linux?

Thanks in advance for your help.

Pat

unSpawn 09-26-2013 12:03 PM

Pipe the output through 'openssl base64'?

Z038 09-26-2013 02:57 PM

uuencode is included in GNU sharutils. You can look to see if there is a redhat package for it, or you can download the source and compile.

ptm9 09-26-2013 03:25 PM

uuencode
 
To: unSpawn - thank you for this. My first attempt yielded the file as the body of the message. I'll continue to work with this and try other approaches.


To: Z038 - I did find that the package exists - unfortunately, we are now "between" sysadmins, so there is nobody to install it!

chrism01 09-26-2013 05:48 PM

On RHEL (Centos etc), its just
Code:

yum install <pkgname>
as root user.
The yum cmd takes care of dependencies automatically & will ask for confirmation (unless the cmd name has been aliased to do otherwise).
If you like, pick the least important box and try it.

unSpawn 09-26-2013 06:06 PM

Quote:

Originally Posted by ptm9 (Post 5035502)
To: unSpawn - thank you for this. My first attempt yielded the file as the body of the message.

Most things Linux adhere to Open Standards. I suggest you re-read 'man mailx' again.
Code:

TMPFILE=`mktemp -p /tmp att.XXXXXXXXXX` && {
 cat /tmp/output_file | openssl base64 > "${TMPFILE}"
 echo "Message body" | mailx -s "Subject" -a "${TMPFILE}" user@h.ost
 rm -f "${TMPFILE}"
}


ptm9 09-26-2013 06:50 PM

unSpawn Thanks - was relying on old practice - did need to re-read man mailx

ptm9 09-26-2013 06:53 PM

chrism01 - thanks - it's fun here recently - no sysadmin but no one in Dev allowed to have root access for any reason

chrism01 09-27-2013 01:01 AM

In that case, tell the mgr some things will have to wait ... ;)


All times are GMT -5. The time now is 08:50 PM.