0

I have a file with pipe delimiters. I'd like to replace the pipes with <tab> and mail the file as attachment. I do get mail but still with pipes.

Part of my script -

OUTPUT_FILE=/path/to/file/filename.xls

sed 's/|/ /g' $OUTPUT_FILE

uuencode ${OUTPUT_FILE} $OUTPUT_FILE | mail -s "Test" [email protected]

I tried replacing $OUTPUT_FILE with ${OUTPUT_FILE} in sed but still I get file with pipe.

1
  • Checkout heirloom mailx (previously known as nail) which supports attachments out of the box Commented Sep 10, 2014 at 12:21

1 Answer 1

1

Your sed command is not modifying the contents of the file. You should pipe the output of sed directly to uuencode, like this:

OUTPUT_FILE=/path/to/file/filename.xls

sed 's/|/ /g' $OUTPUT_FILE |uuencode ${OUTPUT_FILE} | mail -s "Test" [email protected]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.