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 TouchToneTommy 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 or linux? 2

Status
Not open for further replies.

MAWarGod

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

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
 
A command in perl?

- Kevin, perl coder unexceptional!
 
Huh?

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Any idea what happened the dice rolling tread Steve? Seems to have vanished....

- Kevin, perl coder unexceptional!
 
maybe he means dos2unix

- Kevin, perl coder unexceptional!
 
when I used a editor(editplus) on My unix perl scripts I did with a "window's editor" not unix and it ad's a unseen value to the script now I remember something you place by the name of the script up top that makes unix over look the added value

MA WarGod

I believe if someone can think it, it can be programmed
 
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.


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
 
I assume the dice rolling thread was red flagged as an obvious homework assignment. Shame, I was quite enjoying it...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
I assume the dice rolling thread was red flagged as an obvious homework assignment. Shame, I was quite enjoying it...

hmmm... didn't seem that obvious to me but now that you mention it... [flush]

- Kevin, perl coder unexceptional!
 
Yeah, it was obviously a homework assignment. But I didn't see that as a problem as long as we were just helping him debug his syntax errors.

This is the first time I've been exposed to Red flagging a post though. It would have been nice if the admins gave feedback to those people who had participating in a thread. Or at least those people they thought pushed the boundaries of intention.

I'll send them some feedback myself.
 
I have received individual feedback in the past about a similar red-flagged post. I guess it just depends on how busy the admins are. They do enforce the policy pretty strictly, however.

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
I'm still not convinced it was obvious.... sometimes people are teaching themselves perl, like I continue to do. Besides, that guy at least had some code, most of them just post the question/assignment and hope for the answer. But who knows, no big deal, I just hope we don't pull the trigger too qickly on legitimate questions or on people that are self learners.

- Kevin, perl coder unexceptional!
 
True. If the poster has obviously made an effort and posted some code, you can still help without actually doing their homework for them. Often just by suggesting a different technique or algorithm.

Let's face it, if some kid hands in one of ishnid's elegant one-liners on the first week of his course, any tutor worth the name should be able to figure they've had outside help. Assuming they can understand how it works, of course... [smile]

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
hehehe... I'm convinced ishnid is not human.



- Kevin, perl coder unexceptional!
 
well I guess "My Home work homework assignment" is trying to teach Myself perl and cgi. with the help of you all thank god for that. I have ask a lot of question here in the past. I do have books on perl but sometime in reading I get confused. But I really find this site useful it not that I want someone “to do the work for Me” its that I want to know how to from the phase or ect. That I am trying too.

Students come here for homework really oh my, what are they going to do in the work force?

MA WarGod

I believe if someone can think it, it can be programmed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top