[Slackbuilds-users] requirements in README files
Ben Mendis
dragonwisard at gmail.com
Tue Jul 10 18:48:48 UTC 2012
I did it.
====
#!/bin/bash
read LINE
LINE=${LINE/This requires /} # Remove the leading 'This requires'
LINE=${LINE/and /} # Remove the 'and '
LINE=${LINE%.} # Remove the trailing '.'
while [ ${#LINE} != "0" ] # loop until the line is empty (fully-processed)
do
PKG=${LINE%%, *} # grab the text up to the first comma (if any)
echo Dep: $PKG
LINE=${LINE:${#PKG}} # subtract that string from the beginning of the line
LINE=${LINE#, } # remove the leading ', ' if any
done
====
On Tue, Jul 10, 2012 at 1:54 PM, Matteo Bernardini <
matteo.bernardini at gmail.com> wrote:
> 2012/7/10 J <j at dawnrazor.net>:
> > This requires x, y, and z.
> >
> > since that is currently the most popular format and so it makes sense to
> > adopt that as the format in question.
>
> a small thing that comes to mind: this form is easily parseable with
> perl, but it won't be that easy with other scripting languages, like
> bash.
> so, in the evenience, maybe another more parsing-friendly should be
> preferred (any choiche shouldn't be a problem for your perl scripts).
>
> Matteo
> _______________________________________________
> SlackBuilds-users mailing list
> SlackBuilds-users at slackbuilds.org
> http://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
> Archives - http://lists.slackbuilds.org/pipermail/slackbuilds-users/
> FAQ - http://slackbuilds.org/faq/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20120710/73bf7a2b/attachment.html>
More information about the SlackBuilds-users
mailing list