#!/bin/sh doesn't show

Wolf Halton wolf.halton at gmail.com
Sat Sep 29 22:41:35 UTC 2012


On Sat, Sep 29, 2012 at 6:28 PM, Wolf Halton <wolf.halton at gmail.com> wrote:
> On Sat, Sep 29, 2012 at 9:43 AM, Jared Norris <jrnorris at gmail.com> wrote:
>> On 24 September 2012 22:39, cortman <c0rtm4n at gmail.com> wrote:
>>> Hi,
>>>
>>> Why is it that when you write out a script in moin moin and put it
>>> between code tags-
>>>
>>> {{{
>>> #!/bin/sh
>>> exec tail -n +3 $0
>>> # This file provides an easy way to add custom menu entries.  Simply type the
>>> # menu entries you want to add after this comment.  Be careful not to change
>>> # the 'exec tail' line above.
>>> }}}
>>>
>>> the #!/bin/sh disappears in the finished wiki? It's still in the
>>> syntax but doesn't show up when viewed.
>>> We're trying to transfer information from the Ubuntu forums to the
>>> wiki, so it is more widely available, but when it randomly removes
>>> important parts of code, that's a problem.
>>> Thanks for your attention.
>>>
>>> Regards,
>>> Cortman
>>>
>>> --
>>> ubuntu-doc mailing list
>>> ubuntu-doc at lists.ubuntu.com
>>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-doc
>>
>> From what I have done in the past I think it's trying to use the first
>> line as a formatting mark for the code section (as described in the
>> help [1]). If you double up the #!/bin/sh it still outputs a single
>> line which is what you're trying to get. So as a workaround I'd
>> suggest adding a line with the same #!/bin/sh and the outcome will be
>> what you're expecting. So as much as I can explain the result, I am
>> not certain the best way to achieve what you're trying to achieve
>> without the ugly workaround. Maybe someone else can suggest something
>> but I thought understanding why might help.
>>
>> [1] https://wiki.ubuntu.com/HelpOnFormatting#code_example
>>
>> --
>> Regards,
>>
>> Jared Norris
>> https://wiki.ubuntu.com/JaredNorris
>>
>> --
>> ubuntu-doc mailing list
>> ubuntu-doc at lists.ubuntu.com
>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-doc
>
> I believe you are right, and it is trying to use the '#!/bin/sh' line
> as a parser for the code block.  The only rub is that there is
> apparently no codeparser for shell scripting
> (https://wiki.ubuntu.com/HelpOnParsers).  To get a really perfect
> solution, one would have to go upstream and see if the moinmoin folks
> have an idea for this.
> I went to the moinmoin IRC channel and they suggested we try
> #!highlight bash
> as the codeparser.  I am working from a very restricted network right
> now.  I cannot log in to test this, but I will test it later.
> #!highlight sh
> should also work.
>
> Wolf
>
> --
> Wolf Halton
> This Apt Has Super Cow Powers - http://sourcefreedom.com
> Open-Source Software in Libraries - http://FOSS4Lib.org
> Advancing Libraries Together - http://LYRASIS.org
> Apache Open Office Developer wolfhalton at apache.org
>
>
> --
> This Apt Has Super Cow Powers - http://sourcefreedom.com
> Open-Source Software in Libraries - http://FOSS4Lib.org
> Advancing Libraries Together - http://LYRASIS.org
> Apache Open Office Developer wolfhalton at apache.org

Tested to work (and quicker than I expected to be able to check it.
https://wiki.ubuntu.com/saphil-shell-test

-- 
This Apt Has Super Cow Powers - http://sourcefreedom.com
Open-Source Software in Libraries - http://FOSS4Lib.org
Advancing Libraries Together - http://LYRASIS.org
Apache Open Office Developer wolfhalton at apache.org



More information about the ubuntu-doc mailing list