?
Solved

how to make gedit display the control characters if any exist in the file

Posted on 2009-04-22
11
Medium Priority
?
907 Views
Last Modified: 2013-12-16
hi all,
if my scripts that I wrote or received act strangly because of control characters exist in the code that reverse program flow
does their any way to make gedit display it so that I can see it and delete it easily and if there is not what is the easy and woriking practical technic to do it
please send me a working example to test it since it's an occasionlly problem not daily
please reply as soon as possible
regards
hatem gamal
0
Comment
Question by:hatem_from_mesr
  • 6
  • 5
11 Comments
 
LVL 40

Expert Comment

by:omarfarid
ID: 24202149
how these scripts are transferred to the system? if these are text files that are transferred via ftp, then you can either transfer in text / ascii mode , or run dos2unix on these files.

you may use vi or vim editors to open files.
0
 

Author Comment

by:hatem_from_mesr
ID: 24202224
hi omarfarid,
thanks for reply does that means gedit can't display control characters to the editor to remove them???
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24202265
I never used it, but I can imagine that it is a text editor :) The man page says that it is a simple text editor.

But how the files are created and copied to your system?
0
A Cyber Security RX to Protect Your Organization

Join us on December 13th for a webinar to learn how medical providers can defend against malware with a cyber security "Rx" that supports a healthy technology adoption plan for every healthcare organization.

 

Author Comment

by:hatem_from_mesr
ID: 24208690
do you know any text editor or tool that do the task of removing harmful control characters
if the answer is yes please tell me.
regards
hatem gamal
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24211534
can you show sample of these files?
0
 

Author Comment

by:hatem_from_mesr
ID: 24211781
hi omarfarid,
do you have a sample because I don't have
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24211923
if you use vi editor then you can get rid of control char e.g. cntrl-M by substitue command:

:1,$s/^V^M//g

Please press cntrl-V followed by cntrl-M in the above example
0
 

Author Comment

by:hatem_from_mesr
ID: 24212424
hi omarfarid,

I'll say what I understood and please tell me if it's correct
vi editor  have substitute comand that can rid of control characters
can you please how to make the substitute command in vi
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24212465
if you refer to previous comment I showed how to do it. If you are not familiar with vi, then

- vi filename
- press : key followed by 1,$ s/cntrl-Vcntrl-M//g followed by emter key Please note that is control V followed by control M. This is to replace a control M char in the whole file
0
 

Author Comment

by:hatem_from_mesr
ID: 24212901
hi omarfarid,
sorry for my ignorance please tell me waht do you mean by the emter key or do you means enter key  please tell me
best regards
hatem gamal
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 2000 total points
ID: 24212915
enter key :)
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month16 days, 2 hours left to enroll

850 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