Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a command You give to remove window editer code for Unix?

Status
Not open for further replies.

MAWarGod

Programmer
Feb 15, 2002
352
0
0
US
a command You give to remove window editer code for Unix?

I remember learning it once something where the script name is but I have not delt with scripts in about 2 years and I totaly forget

Thank You

MA WarGod

I believe if someone can think it, it can be programmed
 
same qestion is in the perl furom.

- Kevin, perl coder unexceptional!
 
Windows and UNIX use different way to define end of row. Most of Windows test editors add simbol #13 (Carriage return). This invisible simbol results in error in UNIX. To avoid this, use special editors, wich can save files in UNIX format. Also you can use special script, removing inappropriate simbols. Type in shell:

$ tr -d '\r' < ScriptName.pl >a; mv a ScriptName.pl
where ScriptName.pl is name of your script.


for anyone that May need it in the future plus I will not lose it again as long as it is here

MA WarGod

I believe if someone can think it, it can be programmed
 
To remove Microsoft's CRLF using perl do. This not only removes those annoying carriage returns, it also makes a backup of the original.
Code:
perl -i.bak -npe 's/\r\n/\n/g' [i]<filename>[/i]

M. Brooks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top