Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Rainer Weikusat Newsgroups: comp.os.linux.development.system Subject: Re: UNIX(*)/ Linux history & system design Date: Tue, 06 May 2014 14:35:34 +0100 Lines: 43 Message-ID: <874n13c9nd.fsf@sable.mobileactivedefense.com> References: <87k3adxomn.fsf@sable.mobileactivedefense.com> <87wqear01o.fsf@sable.mobileactivedefense.com> <874n1dwvo0.fsf@sable.mobileactivedefense.com> <87zjj5vf1k.fsf@sable.mobileactivedefense.com> <87k3a0q867.fsf@sable.mobileactivedefense.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net lyRZ/JWS4llKIGhBQjCD/AIC9J62Wlqj1qKwIdUq3iuyUM53A= Cancel-Lock: sha1:uN2sDO2apy8PuNTZN9w+VQkLh8k= sha1:RzbUKzEcb4nIaPhoqyOQ8V8cxpo= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Xref: csiph.com comp.os.linux.development.system:680 crankypuss writes: > On 05/05/2014 02:31 PM, Rainer Weikusat wrote: >> crankypuss writes: > > > >>> Some seem to disagree with that view, but then some people blindly >>> parse command output with sed and use that to drive system-critical >>> functionality; go figure. >> >> I did a lot of shell-programming when I was working on 'embeddded Linux >> project' some years ago because that was the most convenient programming >> language available to me in that environment (ARM9 machine language and C >> being the other options) and 'sed' was the most sophisticated >> text-processing tool available to me. What's wrong with using it? > > I know nothing about "ARM9 machine language" but if C was available, > yet you used bash/sed, you must have been in one bigassed hurry or had > some extremely simple requirements. Simple solutions don't necessarily preclude complex requirements. As an example, assuming a list of interfaces and associated IPv4 address is supposed to be generated as preparation for displaying a 'configuration info' web page. Using ip(route), sh (ash, to be precise) and sed that's something like: ip -f inet -o addr show | sed 's/^.*: \([^ ]*\) *inet \([^ ]*\) .*/\1:\2/' Equivalent C code already becomes quite lengthy if the 'legacy' ioctl-interface is being used (see netdevice(7) for details) and this becomes worse for the 'native' netlink-interface which additionally has the nice properties that documentation basically doesn't exist (although this has improved somewhat since 1998) and that one is supposed to use 'helpful libraries' which are usually GPLed, ie, "all your sources belong to us" (but don't worry, unless you're at least as sucessful as Android, you can put them in some place where the sun doesn't shine for all we care about them). > I'm sure your performed your job as expected and were rewarded > accordingly. I wasn't forced to go hungry most of the time, if that's what you're referring to.