[forge-users] Writing files with content

Daniel Cunha danielsoro at gmail.com
Fri May 30 12:01:18 EDT 2014


Lincoln,

"Most shells use '\' at the end of the line, and I'd like to stay
conventional if possible."

+1


On Fri, May 30, 2014 at 12:41 PM, Lincoln Baxter, III <
lincolnbaxter at gmail.com> wrote:

> Sorry Antonio. I've been out at a week long meeting.
>
> I think George's solution using stream redirection should work. The only
> question I have about it is multi-line support. I think your example is
> somewhat unconventional. Most shells use '\' at the end of the line, and
> I'd like to stay conventional if possible.
>
> ~Lincoln
>
>
> On Fri, May 30, 2014 at 11:15 AM, George Gastaldi <ggastald at redhat.com>
> wrote:
>
>> I think piping to a file would be more intuitive and it should work now:
>>
>> Eg:
>> echo Hi > a.txt
>>
>> cat file.txt>anotherfile.txt
>>
>> Em 30/05/2014, às 11:36, Antonio Goncalves <antonio.mailing at gmail.com>
>> escreveu:
>>
>> No feedback on this feature ? I feel it could fill many of my gaps.
>> Nobody else sees any need ?
>>
>>
>> 2014-05-25 18:02 GMT+02:00 Antonio Goncalves <antonio.mailing at gmail.com>:
>>
>>> Hi all,
>>>
>>> I see myself adding files here and there on my projects (JBoss cli
>>> commands, shell scripts, SQL scripts...) and I use the touch command in
>>> Forge extensively. But how could I add content to these files ? I mostly
>>> write Forge scripts, so I would love to do something like that in my script
>>> :
>>>
>>>
>>> # Creates a project
>>>
>>> project-new --named test
>>>
>>> # Adds a few extra files and directories
>>>
>>> mkdir src/main/script ;
>>> touch src/main/resources/insert.sql ; *// This creates an empty file*
>>>
>>> *touch* src/main/script/wildfly-show.cli *--content (((( **// This adds
>>> content to the file*
>>>
>>> version
>>>
>>> # ####################
>>>
>>> # #  System Properties
>>>
>>> # ####################
>>>
>>>
>>> /core-service=platform-mbean/type=runtime:read-attribute(name=system-properties)
>>>
>>> # ####################
>>>
>>> # #  Datasource
>>>
>>> # ####################
>>>
>>> /subsystem=datasources/data-source=ApplicationBlancheH2DS:read-resource
>>>
>>>
>>> /subsystem=datasources/data-source=ApplicationBlancheH2DS:test-connection-in-pool
>>>
>>>
>>> /subsystem=datasources/data-source=ApplicationBlancheOracleDS:read-resource
>>>
>>>
>>> /subsystem=datasources/data-source=ApplicationBlancheOracleDS:test-connection-in-pool
>>>
>>> /subsystem=datasources/jdbc-driver=oracle:read-resource
>>>
>>> *))))*
>>>
>>>
>>> And this command would just create a file with the previous content in
>>> it. As you can see, this can be tricky : when to end the content of a file
>>> (something similar to <![CDATA[]]>)
>>>
>>> What do you think ? Any idea to integrate this feature smoothly in Forge
>>> ?
>>>
>>>
>>> --
>>> Antonio Goncalves
>>> Software architect and Java Champion
>>>
>>> Web site <http://www.antoniogoncalves.org/> | Twitter
>>> <http://twitter.com/agoncal> | LinkedIn
>>> <http://www.linkedin.com/in/agoncal> | Paris JUG
>>> <http://www.parisjug.org/> | Devoxx France <http://www.devoxx.fr/>
>>>
>>
>>
>>
>> --
>> Antonio Goncalves
>> Software architect and Java Champion
>>
>> Web site <http://www.antoniogoncalves.org/> | Twitter
>> <http://twitter.com/agoncal> | LinkedIn
>> <http://www.linkedin.com/in/agoncal> | Paris JUG
>> <http://www.parisjug.org/> | Devoxx France <http://www.devoxx.fr/>
>>
>> _______________________________________________
>> forge-users mailing list
>> forge-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/forge-users
>>
>>
>> _______________________________________________
>> forge-users mailing list
>> forge-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/forge-users
>>
>
>
>
> --
> Lincoln Baxter, III
> http://ocpsoft.org
> "Simpler is better."
>
> _______________________________________________
> forge-users mailing list
> forge-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-users
>



-- 
Att;
Daniel Cunha (soro)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-users/attachments/20140530/4bd0de9d/attachment.html 


More information about the forge-users mailing list