LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-26-2016, 11:55 PM   #1
arun natarajan
Member
 
Registered: Jun 2014
Posts: 111

Rep: Reputation: Disabled
remove ctrl H characters


hi,

i tried to redirect the output of (#man bash > bash) file.

after that when i tried open with vi , i got the ^H characters.

please find the attachments 1.txt 2.GUI

when i tried to remove the same with following commands nothing succeeded.

# uname -a
Linux node1.localdomain 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
#file bash
bas: ASCII English text, with overstriking
# sed -i 's/^H//g' bash
# sed -i 's/\^H//g' bash
# sed -i 's/\^[*H]//g' bash
# tr -d '^H' < bash
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	49
Size:	196.8 KB
ID:	22576   Click image for larger version

Name:	2.png
Views:	49
Size:	101.5 KB
ID:	22577  
 
Old 07-27-2016, 03:29 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
In vi, type Ctrl-V then Ctrl-H to enter the match you want.
 
Old 07-27-2016, 03:31 AM   #3
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 364Reputation: 364Reputation: 364Reputation: 364
(mainly to give this a non-zero reply count...)
The '^H' is actually a SINGLE [control] character: backspace. (see man ascii)
(I hope you aren't typing TWO chars in those cmds you tried: shift-six ^ plus an H is UNrelated!)
Look into using these two keystrokes: ctrl-v ctrl-h in vi. Like:
:%s/ctrl-v ctrl-h//g
Again, those are *only two* keystrokes, holding the control key down. And NO space!

Best wishes!
 
1 members found this post helpful.
Old 07-27-2016, 06:06 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
As the others have answered your issue, I thought I would just add that it is a bad idea to use the name of a command for the name of your file, ie. bash itself is an executable command.
 
Old 07-27-2016, 06:17 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Manpages are stored in nroff format. You can also use the following command to covert a man page to plain text.

man bash | col -b > bash.txt
 
Old 07-27-2016, 12:25 PM   #6
arun natarajan
Member
 
Registered: Jun 2014
Posts: 111

Original Poster
Rep: Reputation: Disabled
michaelk , it worked from your command.

Thanks all for your time.
 
  


Reply



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] Remove double characters Aomine Daiki Programming 3 06-23-2015 06:22 AM
[SOLVED] Remove Characters From Within Variable dnoob Programming 13 02-21-2011 01:12 AM
Replace Ctrl-M (^M) characters with spaces.... visitnag Linux - Newbie 3 04-16-2008 09:05 AM
remove characters in c alaios Programming 2 07-10-2005 10:10 AM
how to have no interpretation of special characters (ctrl, tab ...) in a script xround Linux - General 1 11-29-2004 07:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:20 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