Sep 20 2009

Bash Shell Script Error. “bad interpreter: No such file or directory error”

Today I created a simple shell script and I was getting a few odd errors:


cody@taylor:/var/some_folder/server$ ./process_xml.sh
-bash: ./process_xml.sh: /bin/sh^M: bad interpreter: No such file or directory

I figured it was probably a permissions error or an issue with the shebang (#!/bin/sh) line. I tried removing the shebang line, changing it to use dash or bash explicitly, chmoding to 777 and still no luck and another odd error.


cody@taylor:/var/some_folder/server$ sh process_xml.sh
: not found.sh: 4:

I then checked the log file that the commands were supposed to be writing to and it was filled with ‘^M’ on every line break and the log name itself was followed by a ‘?’. Took a minute or two but I finally clued in that I wrote that script on a windows machine and then exported it to an ubuntu linux server via subversion. It was just a basic text format issue.

Under DOS (Windows/PC) the end of a line of text is signalled using the ASCII code sequence CarriageReturn,LineFeed. Alternately written as CR,LF or the bytes 0x0D,0x0A. On the Macintosh platform, only the CR character is used. Under UNIX, the opposite is true and only the LF character is used.

After a quick :


cody@taylor:/var/some_folder/server$ apt-get install tofrodos
cody@taylor:/var/some_folder/server$ dos2unix process_xml.sh

Everything worked fine.

Share

May 14 2009

What Can I Do About Book Pirates?

peterwayner writes “Six of the top ten links on a Google search for one of my books points to a pirate site when I type in ‘wayner data compression textbook.’ Others search strings actually locate pages that are selling legit copies including digital editions for the Kindle. I’ve started looking around for suggestions. Any thoughts from the Slashdot crowd? The free copies aren’t boosting sales for my books. Do I (1) get another job, (2) sue people, or (3) invent some magic spell? Is society going to be able to support people who synthesize knowledge or will we need to rely on the Wikipedia for everything? I’m open to suggestions.”

Read more of this story at Slashdot.


Share

May 10 2009

Open Source Textbooks For California

T-1000, appropriately enough, lets us know about a California initiative to compile open source science and math textbooks for the state, in the hopes of saving money. The effort is spearheaded by Gov. Schwarzenegger. “The effort seems very promising, but the state’s complex standards and arduous textbook evaluation process will pose major challenges. … The governator will surely be able to stop the digital textbooks from gaining sentience and subjugating humanity, but there are trickier challenges that will be even tougher to defeat than the impending Skynet apocalypse. Textbooks are a surprisingly controversial issue in California and there is a lot of political baggage and bureaucratic red tape that will make an open source textbook plan especially troublesome. … [T]he traditional wiki approach is untenable for California teaching material. Individual changes to textbooks can become a source of fierce debate and there are a multitude of special interest groups battling over what the textbooks should say and how they should say it. It would take the concept of Wikipedia edit wars to a whole new level.”

Read more of this story at Slashdot.


Share

May 6 2009

Phony Wikipedia Entry Used By Worldwide Press

Hugh Pickens writes “A quote attributed to French composer Maurice Jarre was posted on wikipedia shortly after his death in March and later appeared in obituaries in mainstream media. ‘One could say my life itself has been one long soundtrack. Music was my life, music brought me to life, and music is how I will be remembered long after I leave this life. When I die there will be a final waltz playing in my head, that only I can hear,’ Jarre was quoted as saying. However, these words were not uttered by the Oscar-winning composer but written by Shane Fitzgerald, a final-year undergraduate student, who said he wanted to show how journalists use the internet as a primary source for their stories. Fitzgerald posted the quote on Wikipedia late at night after news of Jarre’s death broke. ‘I saw it on breaking news and thought if I was going to do something I should do it quickly. I knew journalists wouldn’t be looking at it until the morning,’ The quote had no referenced sources and was therefore taken down by moderators of Wikipedia within minutes. However, Fitzgerald put it back up a few more times until it was finally left up on the site for more than 24 hours. While he was wary about the ethical implications of using someone’s death as a social experiment, he had carefully generated the quote so as not to distort or taint Jarre’s life, he said. ‘I didn’t expect it to go that far. I expected it to be in blogs and sites, but on mainstream quality papers? I was very surprised.'”

Read more of this story at Slashdot.


Share

May 4 2009

Wikipedia Founder Slams Wikipedia Art

Calls artists ‘trolls’


Share

Apr 30 2009

How 10 Iconic Tech Products Got Their Names

From iPod and BlackBerry to Twitter and Wikipedia, we take a look at the processes and people who came up with the names for these famous tech products.

Share

Apr 25 2009

Wikipedia lawsuit could put it on the wrong side of fair use

Wikipedia uses plenty of copyrighted material and trademarks under the doctrine of fair use. But a trademark infringement lawsuit against a couple of artists would put the Wikimedia Foundation on the opposite side of the fair use fight.

Share

Apr 24 2009

Wikipedia Threatens Artists For Fair Use

Hugh Pickens writes “Can a noncommercial website use the trademark of the entity it critiques in its domain name? Surprisingly, it appears that the usually open-minded folks at Wikipedia think not. The EFF reports that Scott Kildall and Nathaniel Stern have created a noncommercial website at Wikipediaart.org intended to comment on the nature of art and Wikipedia. Since ‘Wikipedia’ is a trademark owned by the Wikimedia Foundation, the Foundation has demanded that the artists give up the domain name peaceably or it will attempt to take it by legal force. ‘Wikipedia should know better. There is no trademark or cybersquatting issue here,’ writes the EFF’s Corynne McSherry. ‘Moreover, even if US trademark laws somehow reached this noncommercial activity, the artists’ use of the mark is an obvious fair use.’ iI is hard to see what Wikipedia gains by litigating this matter but easy to see how they lose.”

Read more of this story at Slashdot.

Share

Apr 17 2009

Philosophies and Programming Languages

evariste.galois writes “Wikipedia has a special section called, ‘Language Philosophy,’ in every article for a programming language. This section looks at the motivation and the basic principles of the language design. What if we investigate further than that? What deeper connections between philosophies and programming languages exist? By considering the most influential thinkers of all time (e.g. Plato, Descartes, Kant) we can figure out which programming language fits best with aspects of their philosophy (Did you know that Kant was the first Python programmer)? The list is not exhaustive, but this is a funny and educative start.”

Read more of this story at Slashdot.

Share

Apr 15 2009

Wikipedia community vote on migration to CC BY-SA begins now

Wikipedians who have made 25 or more edits can vote on a proposed migration of Wikipedia’s main content license to Creative Commons Attribution-ShareAlike. Voting ends May 3.

Share