bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: REVIEW REQUEST - user manual generation


From: Gavin Smith
Subject: Re: Fwd: REVIEW REQUEST - user manual generation
Date: Sat, 4 Jun 2016 23:29:27 +0100

On 4 June 2016 at 22:40, Vincent Belaïche <address@hidden> wrote:
> These two things also work:
>
> --8<----8<----8<----8<----8<-- begin -->8---->8---->8---->8---->8----
>   in_input_funnies=`echo "$in_input" \
>     | $SED -e 's![^}#$%&^_{~]!!g; s!\(.\)!\1\'"
> "'!g' \
>     | uniq`
> --8<----8<----8<----8<----8<--  end  -->8---->8---->8---->8---->8----
>
> --8<----8<----8<----8<----8<-- begin -->8---->8---->8---->8---->8----
>   in_input_funnies=`echo "$in_input" \
>     | $SED -e 's![^}#$%&^_{~]!!g; s!\(.\)!\1\''
> ''!g' \
>     | uniq`
> --8<----8<----8<----8<----8<--  end  -->8---->8---->8---->8---->8----
>
> but I prefer the one with "$newline" to keep the sed command on the same
> line.

Nice idea to hide it in a variable.

I'd come up with

in_input_funnies=`echo "$in_input" \
    | $SED -e 's![^}#$%&^_{~]!!g; s!\(.\)!\1'\\\\'
''!g' \
    | uniq`

which is fairly similar to the two examples above you gave, except
it's less clear. (Four backslashes because backslash escaped once for
the shell, and once for the ``-expression.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]