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

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
hatem_from_mesrAsked:
Who is Participating?
 
omarfaridConnect With a Mentor Commented:
enter key :)
0
 
omarfaridCommented:
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
 
hatem_from_mesrAuthor Commented:
hi omarfarid,
thanks for reply does that means gedit can't display control characters to the editor to remove them???
0
Improved Protection from Phishing Attacks

WatchGuard DNSWatch reduces malware infections by detecting and blocking malicious DNS requests, improving your ability to protect employees from phishing attacks. Learn more about our newest service included in Total Security Suite today!

 
omarfaridCommented:
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
 
hatem_from_mesrAuthor Commented:
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
 
omarfaridCommented:
can you show sample of these files?
0
 
hatem_from_mesrAuthor Commented:
hi omarfarid,
do you have a sample because I don't have
0
 
omarfaridCommented:
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
 
hatem_from_mesrAuthor Commented:
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
 
omarfaridCommented:
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
 
hatem_from_mesrAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.