Sep
20
2009
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.
7 comments | tags: .ipa, bad interpreter, error, linux, Mac, problem, shell script, solution, ubuntu, wikipedia | posted in linux, problems and solutions, reference
May
14
2009
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
Comments Off on Xerox Solid Ink Printer Cuts Waste by 90% | tags: Mac | posted in technical news
May
14
2009
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.
Comments Off on Apple Hires Former OLPC Security Director | tags: Apple, laptop, Mac, OLPC, security | posted in technical news
May
14
2009
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.
Comments Off on Twitter Robot from 1935 (PIC) | tags: Mac, robot, twitter | posted in technical news
May
14
2009
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.
Comments Off on Clean Up and Revive Your Bloated, Sluggish Mac | tags: Mac, virus | posted in technical news
May
13
2009
Comments Off on Tearful Mulroney recalls pain of RCMP letter – Toronto Star | tags: google, Mac, network, news, tv | posted in technical news
May
13
2009
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.
Comments Off on IE Losing 10% Market Share Every Two Years | tags: google, Mac, microsoft, obama, redmond, web | posted in technical news
May
13
2009
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.
Comments Off on Minor Damage Found On Space Shuttle | tags: Mac | posted in technical news
May
12
2009
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.
Comments Off on Apple Freezes Snow Leopard APIs | tags: Apple, developer, Mac, program, programming, technology | posted in technical news
May
12
2009
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.
Comments Off on Citrix Demos of a New Kind of Virtual Machine for Mac | tags: iphone, Mac, Phone | posted in technical news