LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-03-2016, 11:24 AM   #1
pavan27
LQ Newbie
 
Registered: Nov 2007
Posts: 14

Rep: Reputation: 0
remove special character "^[[A" from the file


Hello Experts,

i am working on backup script, i need to send backup log to my email account via mialx command. here my problem is, my backup log has some special characters, so mail command is sending the backup log as a attachment.
here is my mail command
cat /opt/couchbase/scripts/logs/cdb_bakcup_201602031704.log|mailx -s "CERT:slcdb10:Couchbase Backup status on " pavan27@domain.com
Code:
backup log content :
  [####################] 100.0% (7303/estimated 7303 msgs)^[[A  

bucket: beer-sample, msgs transferred...
       :                total |       last |    per sec
 byte  :              2541549 |    2541549 |   963817.4
  [####################] 100.0% (1/estimated 1 msgs)^[[A 

bucket: cb01, msgs transferred...
       :                total |       last |    per sec
 byte  :              2541644 |    2541644 |  3362092.1
.
bucket: cb02, msgs transferred...
       :                total |       last |    per sec
 byte  :              2541644 |    2541644 |  6012039.2
.
bucket: cb03, msgs transferred...
       :                total |       last |    per sec
 byte  :              2541644 |    2541644 |  6170418.0
.
bucket: default, msgs transferred...
       :                total |       last |    per sec
 byte  :              2541644 |    2541644 |  6512344.3
done
special character i need to eliminate is "^[[A" , from mail attachment i did see the special character "^[[A" showing as "<-[A".

please help me to resolve the issue .

Thank you,
Pavan
 
Old 02-03-2016, 11:26 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,856
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
use 'cat -v' instead of 'cat'
 
1 members found this post helpful.
Old 02-03-2016, 11:31 AM   #3
pavan27
LQ Newbie
 
Registered: Nov 2007
Posts: 14

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by NevemTeve View Post
use 'cat -v' instead of 'cat'

perfect, worked for me.

Bunch of Thanks Nevem
 
  


Reply

Tags
awk regex, bash scripting, sed bash, shell scripting


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] HOWTO: enter "special character" while typing SaintDanBert Linux - Software 3 01-26-2011 12:36 PM
[SOLVED] Script to remove lines in a file with more than "x" instances of any character ? pissed_budgie Programming 12 10-08-2010 08:16 PM
Can't search special character "/" in PHP 5 Swift&Smart Programming 4 10-26-2007 07:44 AM
remove folder that stats with a "special" character mago Linux - General 3 06-27-2006 04:40 PM
remove "special" text out of a file tearinox Linux - General 1 03-15-2004 08:43 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration