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

Xerox Solid Ink Printer Cuts Waste by 90%

Ink toner cartridges are expensive, wasteful, and energy-intensive. That’s why Xerox’s new ColorQube 9200 printers are so innovative. Instead of using traditional cartridges, the printers use solid blocks of ink that melt when heated. Xerox claims that its ,500 machine–meant squarely for corporate customers


Share

May 14 2009

Apple Hires Former OLPC Security Director

imamac writes “It seems Apple is seeking to beef up security by hiring Ivan Krstic, the one-time director of security architecture at One Laptop per Child. ‘Krstic, a well-respected innovator who designed the Bitfrost security specification for the OLPC initiative, joined Cupertino this week and will work on core OS security. His hiring comes at a crucial time for a company that ties security to its marketing campaigns despite public knowledge that it’s rather trivial to launch exploits against the Mac.'”

Read more of this story at Slashdot.


Share

May 14 2009

Twitter Robot from 1935 (PIC)

Aug. 1935—Known as the “notificator,” the new machine is installed in streets, stores railroad stations or other public place where individuals may leave messages for friends. The machine is similar in appearance to a candy-vending device.


Share

May 14 2009

Clean Up and Revive Your Bloated, Sluggish Mac

A few years back you dropped significant cash to switch over from the virus-laden world of Windows to a shiny new Mac, but over time it’s gotten slow and crufty. Let’s clean it up.


Share

May 13 2009

Tearful Mulroney recalls pain of RCMP letter – Toronto Star


CBC.ca

Tearful Mulroney recalls pain of RCMP letter
Toronto Star
OTTAWA–Brian Mulroney broke down in tears on the witness stand today as he recalled the personal devastation he suffered when news broke in 1995 that the RCMP considered him a suspect in the Airbus fraud case.
Mulroney lists international contacts to rebut Schreiber testimony Ottawa Citizen
Schreiber in hospital after gall bladder surgery Edmonton Sun
CTV.ca – CityNews – National Post – Macleans.ca
all 495 news articles  Langue : Français
Share

May 13 2009

IE Losing 10% Market Share Every Two Years

mjasay writes “Mozilla’s Asa Dotzler points to some interesting long-term trends in browser market share, noting that ‘browser releases aren’t having any major impact on the macro trends,’ which suggests that a better IE will likely have little impact on its sliding market share. The most intriguing conclusion from the data, however, is that Firefox could surpass IE market share as early as January 2013 if Firefox continues to gain 5 percent every year, even as IE drops 5 percent each year. In the past, Microsoft might have fought back by tying IE to other products to block competition, but with the EU keeping a close antitrust eye on Microsoft and the US Obama administration keen to make an example of an antitrust bully, Microsoft may have few good options beyond good old fashioned competition, which doesn’t seem to be working very well for the Redmond giant, as the market share data suggests. Microsoft’s loss of IE market power, in turn, could have serious consequences for the company’s efforts to compete with Google on the Web.”

Read more of this story at Slashdot.


Share

May 13 2009

Minor Damage Found On Space Shuttle

The BBC is reporting on minor damage to the space shuttle Atlantis revealed by a 10-hour inspection in orbit. On the shuttle’s right side, near where the wing joins the body, inspection revealed a 21″ (53cm) line of chips in the tiles that make up the vehicle’s heat shield. “…more analysis by engineers would determine whether a ‘focused inspection’ was needed in that specific area. If so, astronauts would use sensors to determine the exact depth of the damage to the heat shield tiles. NASA has placed the space shuttle Endeavour on stand-by to rescue the crew of Atlantis if they are endangered.” The crew couldn’t shelter on the ISS in case of trouble, because their orbit is higher and on a different inclination.

Read more of this story at Slashdot.


Share

May 12 2009

Apple Freezes Snow Leopard APIs

DJRumpy writes in to alert us that Apple’s new OS, Snow Leopard, is apparently nearing completion. “Apple this past weekend distributed a new beta of Mac OS X 10.6 Snow Leopard that altered the programming methods used to optimize code for multi-core Macs, telling developers they were the last programming-oriented changes planned ahead of the software’s release. …`Apple is said to have informed recipients of Mac OS X 10.6 Snow Leopard build 10A354 that it has simplified the`… APIs for working with Grand Central, a new architecture that makes it easier for developers to take advantage of Macs with multiple processing cores. This technology works by breaking complex tasks into smaller blocks, which are then`… dispatched efficiently to a Mac’s available cores for faster processing.”

Read more of this story at Slashdot.


Share

May 12 2009

Citrix Demos of a New Kind of Virtual Machine for Mac

Citrix made a number of announcements last week related to Mac and iPhone. While most of these announcements were targeted specifically towards IT/enterprise customers, one announcement has more potential mainstream significance.


Share