from bash to Coral

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

from bash to Coral

laurent laffont
Hi,

Is it possible today to write this using Coral ?

find application library -type f \( -name "*.php" -o -name "*.phtml" \) -exec  /usr/local/bin/xgettext -j -L PHP --from-code=utf-8 --keyword=traduire --keyword=_ -o library/translation/fr.pot {} \;
for i in `ls library/translation/*.po`
do
/usr/local/bin/msgmerge -s $i library/translation/fr.pot -o $i
/usr/local/bin/msgfmt -o `echo $i|cut -d '.' -f1`.mo $i
done



I need to write several scripts like this - would be cool to start with Coral.


Laurent Laffont - @lolgzs

Pharo Smalltalk Screencasts: http://www.pharocasts.com/
Blog: http://magaloma.blogspot.com/
Reply | Threaded
Open this post in threaded view
|

Re: from bash to Coral

Stéphane Ducasse

On Mar 14, 2011, at 12:33 PM, laurent laffont wrote:

> Hi,
>
> Is it possible today to write this using Coral ?
>
> find application library -type f \( -name "*.php" -o -name "*.phtml" \) -exec  /usr/local/bin/xgettext -j -L PHP --from-code=utf-8 --keyword=traduire --keyword=_ -o library/translation/fr.pot {} \;
> for i in `ls library/translation/*.po`
> do
> /usr/local/bin/msgmerge -s $i library/translation/fr.pot -o $i
> /usr/local/bin/msgfmt -o `echo $i|cut -d '.' -f1`.mo $i
> done
>
>
>
> I need to write several scripts like this - would be cool to start with Coral.

I would love that too.
Can you give a try?

Stef


Reply | Threaded
Open this post in threaded view
|

Re: from bash to Coral

Igor Stasenko
In reply to this post by laurent laffont
On 14 March 2011 12:33, laurent laffont <[hidden email]> wrote:

> Hi,
> Is it possible today to write this using Coral ?
> find application library -type f \( -name "*.php" -o -name "*.phtml" \)
> -exec  /usr/local/bin/xgettext -j -L PHP --from-code=utf-8
> --keyword=traduire --keyword=_ -o library/translation/fr.pot {} \;
> for i in `ls library/translation/*.po`
> do
> /usr/local/bin/msgmerge -s $i library/translation/fr.pot -o $i
> /usr/local/bin/msgfmt -o `echo $i|cut -d '.' -f1`.mo $i
> done
>
every time i see things like that i want vomit :)

>
> I need to write several scripts like this - would be cool to start with
> Coral.

Yes. Definitely :)

>
> Laurent Laffont - @lolgzs
>
> Pharo Smalltalk Screencasts: http://www.pharocasts.com/
> Blog: http://magaloma.blogspot.com/
> Developer group: http://cara74.seasidehosting.st
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: from bash to Coral

Adrien BARREAU
In reply to this post by laurent laffont
Hi Laurent,

I would say yes, because Coral can execute any piece of Smalltalk.
So if you can do what that script does with OSProcess, there is no reason you can't put it in a Coral script.

At that time, there is no Coral API to make your life easier on top on things like OSProcess, but perhaps I should write some things like that.
If you have any ideas while trying, don't hesitate to tell me :).

Adrien.


From: [hidden email]
Date: Mon, 14 Mar 2011 12:33:30 +0100
To: [hidden email]
Subject: [Pharo-project] from bash to Coral

Hi,

Is it possible today to write this using Coral ?

find application library -type f \( -name "*.php" -o -name "*.phtml" \) -exec  /usr/local/bin/xgettext -j -L PHP --from-code=utf-8 --keyword=traduire --keyword=_ -o library/translation/fr.pot {} \;
for i in `ls library/translation/*.po`
do
/usr/local/bin/msgmerge -s $i library/translation/fr.pot -o $i
/usr/local/bin/msgfmt -o `echo $i|cut -d '.' -f1`.mo $i
done



I need to write several scripts like this - would be cool to start with Coral.


Laurent Laffont - @lolgzs

Pharo Smalltalk Screencasts: http://www.pharocasts.com/
Blog: http://magaloma.blogspot.com/
Reply | Threaded
Open this post in threaded view
|

Re: from bash to Coral

laurent laffont
On Mon, Mar 14, 2011 at 3:20 PM, Adrien BARREAU <[hidden email]> wrote:
Hi Laurent,

I would say yes, because Coral can execute any piece of Smalltalk.
So if you can do what that script does with OSProcess, there is no reason you can't put it in a Coral script.

At that time, there is no Coral API to make your life easier on top on things like OSProcess, but perhaps I should write some things like that.
If you have any ideas while trying, don't hesitate to tell me :).

OK, I put this on my things-to-try list :)

Laurent
 
Adrien.


From: [hidden email]
Date: Mon, 14 Mar 2011 12:33:30 +0100
To: [hidden email]
Subject: [Pharo-project] from bash to Coral


Hi,

Is it possible today to write this using Coral ?

find application library -type f \( -name "*.php" -o -name "*.phtml" \) -exec  /usr/local/bin/xgettext -j -L PHP --from-code=utf-8 --keyword=traduire --keyword=_ -o library/translation/fr.pot {} \;
for i in `ls library/translation/*.po`
do
/usr/local/bin/msgmerge -s $i library/translation/fr.pot -o $i
/usr/local/bin/msgfmt -o `echo $i|cut -d '.' -f1`.mo $i
done



I need to write several scripts like this - would be cool to start with Coral.


Laurent Laffont - @lolgzs

Pharo Smalltalk Screencasts: http://www.pharocasts.com/
Blog: http://magaloma.blogspot.com/

Reply | Threaded
Open this post in threaded view
|

Re: from bash to Coral

David T. Lewis
In reply to this post by Adrien BARREAU
FYI, rudimentary scripting on top of OSProcess/CommandShell is in class
CommandShell, method category "command scripting". Possibly the shell
syntax parsing, file name globbing etc from CommandShell could be tied
in with Coral, although I have not looked into this.

Dave

On Mon, Mar 14, 2011 at 03:20:06PM +0100, Adrien BARREAU wrote:

>
> Hi Laurent,
>
> I would say yes, because Coral can execute any piece of Smalltalk.
> So if you can do what that script does with OSProcess, there is no reason you can't put it in a Coral script.
>
> At that time, there is no Coral API to make your life easier on top on things like OSProcess, but perhaps I should write some things like that.
> If you have any ideas while trying, don't hesitate to tell me :).
>
> Adrien.
>
> From: [hidden email]
> Date: Mon, 14 Mar 2011 12:33:30 +0100
> To: [hidden email]
> Subject: [Pharo-project] from bash to Coral
>
> Hi,
> Is it possible today to write this using Coral ?
> find application library -type f \( -name "*.php" -o -name "*.phtml" \) -exec  /usr/local/bin/xgettext -j -L PHP --from-code=utf-8 --keyword=traduire --keyword=_ -o library/translation/fr.pot {} \;
>
> for i in `ls library/translation/*.po`do /usr/local/bin/msgmerge -s $i library/translation/fr.pot -o $i /usr/local/bin/msgfmt -o `echo $i|cut -d '.' -f1`.mo $i
>
> done
>
>
> I need to write several scripts like this - would be cool to start with Coral.
>
> Laurent Laffont - @lolgzs
>
>
>
> Pharo Smalltalk Screencasts: http://www.pharocasts.com/
> Blog: http://magaloma.blogspot.com/
> Developer group: http://cara74.seasidehosting.st
>
>
>      

Reply | Threaded
Open this post in threaded view
|

Re: from bash to Coral

Stéphane Ducasse
tx david.


> FYI, rudimentary scripting on top of OSProcess/CommandShell is in class
> CommandShell, method category "command scripting". Possibly the shell
> syntax parsing, file name globbing etc from CommandShell could be tied
> in with Coral, although I have not looked into this.
>
> Dave
>
> On Mon, Mar 14, 2011 at 03:20:06PM +0100, Adrien BARREAU wrote:
>>
>> Hi Laurent,
>>
>> I would say yes, because Coral can execute any piece of Smalltalk.
>> So if you can do what that script does with OSProcess, there is no reason you can't put it in a Coral script.
>>
>> At that time, there is no Coral API to make your life easier on top on things like OSProcess, but perhaps I should write some things like that.
>> If you have any ideas while trying, don't hesitate to tell me :).
>>
>> Adrien.
>>
>> From: [hidden email]
>> Date: Mon, 14 Mar 2011 12:33:30 +0100
>> To: [hidden email]
>> Subject: [Pharo-project] from bash to Coral
>>
>> Hi,
>> Is it possible today to write this using Coral ?
>> find application library -type f \( -name "*.php" -o -name "*.phtml" \) -exec  /usr/local/bin/xgettext -j -L PHP --from-code=utf-8 --keyword=traduire --keyword=_ -o library/translation/fr.pot {} \;
>>
>> for i in `ls library/translation/*.po`do /usr/local/bin/msgmerge -s $i library/translation/fr.pot -o $i /usr/local/bin/msgfmt -o `echo $i|cut -d '.' -f1`.mo $i
>>
>> done
>>
>>
>> I need to write several scripts like this - would be cool to start with Coral.
>>
>> Laurent Laffont - @lolgzs
>>
>>
>>
>> Pharo Smalltalk Screencasts: http://www.pharocasts.com/
>> Blog: http://magaloma.blogspot.com/
>> Developer group: http://cara74.seasidehosting.st
>>
>>
>>    
>