Re: FYI - regex to list installed WO frameworks
Re: FYI - regex to list installed WO frameworks
- Subject: Re: FYI - regex to list installed WO frameworks
- From: Kieran Kelleher <email@hidden>
- Date: Tue, 11 Sep 2012 11:10:21 -0400
The power of unix :)
On Sep 11, 2012, at 11:01 AM, Bastian Triller <email@hidden> wrote:
> or use ls:
> $ ls -1 /Library/Frameworks/*.framework/Resources/Java/*.jar|cut -d/
> -f4|sort -u
>
> Am Dienstag, den 11.09.2012, 09:30 -0400 schrieb Kieran Kelleher:
>> Clever one! That is the shortest so far :)
>>
>> On Sep 11, 2012, at 9:15 AM, Maik Musall <email@hidden> wrote:
>>
>>> Hi,
>>>
>>>
>>> if the frameworks all are in the main directory, this is shorter :-)
>>>
>>>
>>> find /Library/Frameworks -path "*framework/Resources/Java/*.jar" |
>>> cut -d/ -f4 | sort -u
>>>
>>>
>>> Maik
>>>
>>>
>>>
>>> Am 11.09.2012 um 14:56 schrieb Kieran Kelleher
>>> <email@hidden>:
>>>
>>>> Nice. Seems like the winner to me. Fastest and shortest command
>>>> that functionally works on my machine. :)
>>>>
>>>>
>>>> find /Library/Frameworks -name "*.jar" | perl -n -e
>>>> '/(.+).framework\/Resources\/Java\/(\1).jar/ && print
>>>> "$1.framework\n"'
>>>>
>>>>
>>>>
>>>> On Sep 11, 2012, at 12:53 AM, Alexis Tual <email@hidden>
>>>> wrote:
>>>>
>>>>> Hi Kieran,
>>>>> I thought awk could do it, but it can't handle grouping, so perl
>>>>> to the rescue (aka "the fun") :
>>>>>
>>>>> find . -name "*.jar" | perl -n -e '/(.+).framework\/Resources
>>>>> \/Java\/(\1).jar/ && print "$1.framework\n"'
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Alex
>>>>>
>>>>> 2012/9/11 Kieran Kelleher <email@hidden>
>>>>> Here is the output of the original 3-stage command - I
>>>>> was curious if anyone could produce the same output with
>>>>> a shorter command (purely as a fun exercise :) )
>>>>>
>>>>> kieran@kieranmacpro ~ find /Library/Frameworks -name
>>>>> "*.jar" | egrep "(.+).framework/Resources/Java/(\1).jar"
>>>>> | sed -E 's/\/Library\/Frameworks
>>>>> \/([[:alnum:]]+[.]framework)\/Resources\/Java
>>>>> \/[[:alnum:]]+[.]jar/\1/'
>>>>> Ajax.framework
>>>>> AjaxLook.framework
>>>>> BTBusinessLogic.framework
>>>>> DB2PlugIn.framework
>>>>> DerbyPlugIn.framework
>>>>> DRGrouping.framework
>>>>> ERAttachment.framework
>>>>> ERAttributeExtension.framework
>>>>> ERCaching.framework
>>>>> ERCalendar.framework
>>>>> ERCaptcha.framework
>>>>> ERCayenne.framework
>>>>> ERChangeNotificationJMS.framework
>>>>> ERChronic.framework
>>>>> ERCoolComponents.framework
>>>>> ERCoreBusinessLogic.framework
>>>>> ERDirectToWeb.framework
>>>>> ERDistribution.framework
>>>>> ERDivaliteLook.framework
>>>>> ERDivaLook.framework
>>>>> ERExcelLook.framework
>>>>> ERExtensions.framework
>>>>> ERFirebug.framework
>>>>> ERIMAdaptor.framework
>>>>> ERIndexing.framework
>>>>> ERIUI.framework
>>>>> ERJars.framework
>>>>> ERJasperReports.framework
>>>>> ERJavaMail.framework
>>>>> ERJGroupsSynchronizer.framework
>>>>> ERJQuery.framework
>>>>> ERJQueryMobile.framework
>>>>> ERModernDefaultSkin.framework
>>>>> ERModernDirectToWeb.framework
>>>>> ERModernLook.framework
>>>>> ERMoviesLogic.framework
>>>>> ERNeutralLook.framework
>>>>> EROpenID.framework
>>>>> EROraclePlugIn.framework
>>>>> ERPDFGeneration.framework
>>>>> ERPersistentSessionStorage.framework
>>>>> ERPlot.framework
>>>>> ERProfiling.framework
>>>>> ERPrototaculous.framework
>>>>> ERPrototypes.framework
>>>>> ERQuartzScheduler.framework
>>>>> ERRest.framework
>>>>> ERSelenium.framework
>>>>> ERTaggable.framework
>>>>> ERWOAdaptor.framework
>>>>> ERWorkerChannel.framework
>>>>> ERXiss.framework
>>>>> ExcelGenerator.framework
>>>>> FrontBasePlugIn.framework
>>>>> GoogleChart.framework
>>>>> H2PlugIn.framework
>>>>> JavaERJDBCAdaptor.framework
>>>>> JavaFSAdaptor.framework
>>>>> JavaMemoryAdaptor.framework
>>>>> JavaMonitorFramework.framework
>>>>> JavaMonitorSupport.framework
>>>>> JavaNeo4JAdaptor.framework
>>>>> JavaRESTAdaptor.framework
>>>>> JavaWOExtensions.framework
>>>>> MooTools.framework
>>>>> MySQLPlugIn.framework
>>>>> PostgresqlPlugIn.framework
>>>>> SnapshotExplorer.framework
>>>>> Validity.framework
>>>>> WOJRebel.framework
>>>>> WOLips.framework
>>>>> WOOgnl.framework
>>>>> WOPayPal.framework
>>>>> WRReporting.framework
>>>>> YUI.framework
>>>>>
>>>>>
>>>>>
>>>>> On Sep 10, 2012, at 5:31 PM, Bastian Triller
>>>>> <email@hidden> wrote:
>>>>>
>>>>>> jfc@ul30a:~$ ls
>>>>>>
>>>>> -1 /opt/Apple/Local/Library/Frameworks/*.framework/Resources/Java/*.jar ; find --version ; for regextype in emacs posix-{awk,basic,egrep,extended} ; do echo $regextype ; find /opt/Apple/Local/Library/Frameworks/ -regextype $regextype -iregex ".*/(.*).framework/Resources/Java/\1\.jar" ; done
>>>>>> /opt/Apple/Local/Library/Frameworks/Ajax.framework/Resources/Java/Ajax.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/Ajax.framework/Resources/Java/jabsorb-1.2.2.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/Ajax.framework/Resources/Java/src.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERExtensions.framework/Resources/Java/ERExtensions.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERExtensions.framework/Resources/Java/src.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/commons-cli-1.2.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/commons-codec-1.6.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/commons-io-2.2.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/commons-lang-2.6.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/ERFoundation.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/ERJars.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/ERWebObjects.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/erxservletadaptor.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/httpclient-4.2.1.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/httpcore-4.2.1.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/icu4j-3_8_1.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/joda-time-2.1.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/junit-4.10.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/log4j-1.2.17.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/ognl-2.6.7.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/slf4j-api-1.6.6.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/slf4j-log4j12-1.6.6.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/src.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJavaMail.framework/Resources/Java/activation-1.1.1.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJavaMail.framework/Resources/Java/dsn-1.4.5.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJavaMail.framework/Resources/Java/ERJavaMail.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJavaMail.framework/Resources/Java/imap-1.4.5.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJavaMail.framework/Resources/Java/mailapi-1.4.5.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJavaMail.framework/Resources/Java/mockmail.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJavaMail.framework/Resources/Java/pop3-1.4.5.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJavaMail.framework/Resources/Java/smtp-1.4.5.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJavaMail.framework/Resources/Java/src.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERPrototypes.framework/Resources/Java/ERPrototypes.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERPrototypes.framework/Resources/Java/src.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERRest.framework/Resources/Java/commons-beanutils-1.8.3.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERRest.framework/Resources/Java/commons-collections-3.2.1.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERRest.framework/Resources/Java/commons-logging-1.1.1.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERRest.framework/Resources/Java/ERRest.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERRest.framework/Resources/Java/ezmorph-1.0.6.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERRest.framework/Resources/Java/json-lib-2.3-jdk15.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERRest.framework/Resources/Java/src.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/JavaMonitorFramework.framework/Resources/Java/JavaMonitorFramework.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/JavaMonitorFramework.framework/Resources/Java/src.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/JavaWOExtensions.framework/Resources/Java/JavaWOExtensions.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/JavaWOExtensions.framework/Resources/Java/src.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/WOLips.framework/Resources/Java/src.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/WOLips.framework/Resources/Java/WOLips.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/WOOgnl.framework/Resources/Java/src.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/WOOgnl.framework/Resources/Java/WOOgnl53.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/WOOgnl.framework/Resources/Java/WOOgnl54.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/WOOgnl.framework/Resources/Java/WOOgnl.jar
>>>>>> find (GNU findutils) 4.4.2
>>>>>> Copyright (C) 2007 Free Software Foundation, Inc.
>>>>>> License GPLv3+: GNU GPL version 3 or later
>>>>>> <http://gnu.org/licenses/gpl.html>
>>>>>> This is free software: you are free to change and
>>>>> redistribute it.
>>>>>> There is NO WARRANTY, to the extent permitted by law.
>>>>>>
>>>>>> Written by Eric B. Decker, James Youngman, and Kevin
>>>>> Dalley.
>>>>>> Built using GNU gnulib version
>>>>> e5573b1bad88bfabcda181b9e0125fb0c52b7d3b
>>>>>> Features enabled: D_TYPE O_NOFOLLOW(enabled)
>>>>> LEAF_OPTIMISATION FTS()
>>>>>> CBO(level=0)
>>>>>> emacs
>>>>>> find: Invalid back reference
>>>>>> posix-awk
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/ERJars.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/JavaWOExtensions.framework/Resources/Java/JavaWOExtensions.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERExtensions.framework/Resources/Java/ERExtensions.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERRest.framework/Resources/Java/ERRest.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERPrototypes.framework/Resources/Java/ERPrototypes.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJavaMail.framework/Resources/Java/ERJavaMail.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/Ajax.framework/Resources/Java/Ajax.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/WOLips.framework/Resources/Java/WOLips.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/WOOgnl.framework/Resources/Java/WOOgnl.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/JavaMonitorFramework.framework/Resources/Java/JavaMonitorFramework.jar
>>>>>> posix-basic
>>>>>> find: Invalid back reference
>>>>>> posix-egrep
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/ERJars.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/JavaWOExtensions.framework/Resources/Java/JavaWOExtensions.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERExtensions.framework/Resources/Java/ERExtensions.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERRest.framework/Resources/Java/ERRest.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERPrototypes.framework/Resources/Java/ERPrototypes.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJavaMail.framework/Resources/Java/ERJavaMail.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/Ajax.framework/Resources/Java/Ajax.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/WOLips.framework/Resources/Java/WOLips.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/WOOgnl.framework/Resources/Java/WOOgnl.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/JavaMonitorFramework.framework/Resources/Java/JavaMonitorFramework.jar
>>>>>> posix-extended
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJars.framework/Resources/Java/ERJars.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/JavaWOExtensions.framework/Resources/Java/JavaWOExtensions.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERExtensions.framework/Resources/Java/ERExtensions.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERRest.framework/Resources/Java/ERRest.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERPrototypes.framework/Resources/Java/ERPrototypes.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/ERJavaMail.framework/Resources/Java/ERJavaMail.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/Ajax.framework/Resources/Java/Ajax.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/WOLips.framework/Resources/Java/WOLips.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/WOOgnl.framework/Resources/Java/WOOgnl.jar
>>>>>> /opt/Apple/Local/Library/Frameworks/JavaMonitorFramework.framework/Resources/Java/JavaMonitorFramework.jar
>>>>>>
>>>>>>
>>>>>> Am Montag, den 10.09.2012, 15:29 -0400 schrieb Kieran
>>>>> Kelleher:
>>>>>>> [Just sharing a cryptic command so future me never
>>>>> forgets it :) ]
>>>>>>>
>>>>>>> There might be a shorter, more efficient command, but
>>>>> anyway, this works. It lists WebObjects frameworks
>>>>> currently installed in your OS X /Library/Frameworks by
>>>>> looking for paths matching the pattern
>>>>> FRAMEWORKNAME.framework/Resources/Java/FRAMEWORKNAME.jar
>>>>>>>
>>>>>>> (It should be all on one line)
>>>>>>>
>>>>>>> find /Library/Frameworks -name *.jar | egrep
>>>>> "(.+).framework/Resources/Java/(\1).jar" | sed -E
>>>>> 's/\/Library\/Frameworks
>>>>> \/([[:alnum:]]+[.]framework)\/Resources\/Java
>>>>> \/[[:alnum:]]+[.]jar/\1/'
>>>>>>>
>>>>>>> I could have eliminated the egrep portion if I could
>>>>> have figured out how to get regex back-reference to the
>>>>> first group work in the search string.... but no success
>>>>> there, so egrep does that bit of logic before passing to
>>>>> sed. If anyone figures out a shorter version of this
>>>>> during your afternoon coffee break, send it back :)
>>>>>>>
>>>>>>> -Kieran
>>>>>>> _______________________________________________
>>>>>>> Do not post admin requests to the list. They will be
>>>>> ignored.
>>>>>>> Webobjects-dev mailing list
>>>>> (email@hidden)
>>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>>>
>>>>>>>
>>>>>>> This email sent to email@hidden
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Do not post admin requests to the list. They will be
>>>>> ignored.
>>>>> Webobjects-dev mailing list
>>>>> (email@hidden)
>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>
>>>>> This email sent to email@hidden
>>>>>
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Webobjects-dev mailing list (email@hidden)
>>>> Help/Unsubscribe/Update your Subscription:
>>>> 40selbstdenker.ag
>>>>
>>>> This email sent to email@hidden
>>>
>>>
>>
>>
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden