[Slackbuilds-users] requirements in README files
Fridrich von Stauffenberg
cancellor2 at gmail.com
Tue Jul 10 19:33:25 UTC 2012
Or just
sed 's/^This requires //;s/, /\n/g;s/ and /\n/g;s/.$//'
:-)
10.07.2012 21:48, Ben Mendis пишет:
> #!/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
More information about the SlackBuilds-users
mailing list