From: "R.. Kumar 1.9.1 OSX" Date: 2010-08-18T23:07:25+09:00 Subject: Re: Unix Philosophy in Ruby Programing David Masover wrote: > On Tuesday, August 17, 2010 04:44:10 am R.. Kumar 1.9.1 OSX wrote: >> David Masover wrote: >> >> Another issue with calling Unix commands is portability. I've finally >> begun converting my shell scripts to ruby since the parameters and >> output across unices do not match. e.g. OSX's BSD commands differ *a >> lot* from the GNU coreutils ones such as 'date', 'expr', and sleep. > > This is solvable -- there is enough in common, and GNU coreutils are > themselves portable. I'm not convinced that this is more of a problem If you've tried to make your software run: say the date command for computing the next date and the user could have BSD or GNU's date you'd know what I mean. What's more you don't know if a user on OSX has installed GNU coreutils with "+default_names" or not. And you cannot force him to use one of these for your software. What gaurantee is there that there won't be changes in the future. Some of these may not even be clearly documented. Such as white spaces in the output of "wc" which made one script fail, then differences in whether you need to escape "+" in regexes and whether some commands even take a "+" or not in regex. Far too many differences in behavior for us to solve at a ruby level. And we haven't even looked at other flavors of unix yet. Anyway, i guess this is more an opinion, I personally reached a point where I realized that anything more than simple script needed to go into ruby. >> Anyway, for more of Unix philosophy in ruby, there is a presentation of >> the "GLI" project - helps to create application with multiple >> subcommands such as github. > > That's not a Unix philosophy, that's a Unix commandline interface. If you read what I wrote, i am talking about a *presentation*, not the software itself. -- Posted via http://www.ruby-forum.com/.